From a7ac019dcef41f5481fe5e6cc82d742310f259f9 Mon Sep 17 00:00:00 2001 From: Gabriel Grinberg Date: Tue, 26 Dec 2023 17:58:17 +0200 Subject: [PATCH] Deploy website - based on 0d39b74ff6b9152b8e898c98a577bbaa36e67c3f --- 404.html | 6 +++--- assets/css/{styles.6d680f3c.css => styles.b07e47f5.css} | 2 +- assets/js/{0f8300a0.368f7932.js => 0f8300a0.40bf21f8.js} | 2 +- assets/js/{1df93b7f.1d72a79e.js => 1df93b7f.b5fbcbac.js} | 2 +- assets/js/{3f72396a.9bf60090.js => 3f72396a.3b1372cf.js} | 2 +- assets/js/{5328e403.96ffad58.js => 5328e403.7d01d420.js} | 2 +- assets/js/{7a4a9b46.ecd791fe.js => 7a4a9b46.9fb3b1b2.js} | 2 +- assets/js/{8926b418.2c64d072.js => 8926b418.e60006ca.js} | 2 +- assets/js/{d5c55fab.cff3822e.js => d5c55fab.0ab53de2.js} | 2 +- assets/js/{f989b58c.8457b8a7.js => f989b58c.3ebfd358.js} | 2 +- .../{runtime~main.d9fa0635.js => runtime~main.45d79ea0.js} | 2 +- blog/archive/index.html | 6 +++--- blog/index.html | 6 +++--- blog/introducing-flyde/index.html | 6 +++--- blog/tags/flyde/index.html | 6 +++--- blog/tags/index.html | 6 +++--- blog/tags/intro/index.html | 6 +++--- docs/StdLib/index.html | 6 +++--- docs/Tutorials/code-parts/index.html | 6 +++--- docs/Tutorials/hello-world-with-flyde/index.html | 6 +++--- docs/api-reference/classes/NodeInstanceError/index.html | 6 +++--- docs/api-reference/classes/PartError/index.html | 6 +++--- docs/api-reference/classes/PartInstanceError/index.html | 6 +++--- docs/api-reference/enums/DataShapeType/index.html | 6 +++--- docs/api-reference/enums/DebuggerEventType/index.html | 6 +++--- docs/api-reference/enums/InlineValueNodeType/index.html | 6 +++--- docs/api-reference/enums/InlineValuePartType/index.html | 6 +++--- docs/api-reference/index.html | 6 +++--- docs/api-reference/interfaces/BaseDebuggerData/index.html | 6 +++--- docs/api-reference/interfaces/BaseNode/index.html | 6 +++--- docs/api-reference/interfaces/BasePart/index.html | 6 +++--- docs/api-reference/interfaces/BasePinData/index.html | 6 +++--- docs/api-reference/interfaces/CodeNode/index.html | 6 +++--- docs/api-reference/interfaces/CodePart/index.html | 6 +++--- docs/api-reference/interfaces/DynamicOutput/index.html | 6 +++--- docs/api-reference/interfaces/ImportSource/index.html | 6 +++--- docs/api-reference/interfaces/InlineNodeInstance/index.html | 6 +++--- docs/api-reference/interfaces/InlinePartInstance/index.html | 6 +++--- docs/api-reference/interfaces/InlineValueNode/index.html | 6 +++--- docs/api-reference/interfaces/InlineValuePart/index.html | 6 +++--- docs/api-reference/interfaces/InputPin/index.html | 6 +++--- docs/api-reference/interfaces/InstanceViewData/index.html | 6 +++--- docs/api-reference/interfaces/NodeInstanceConfig/index.html | 6 +++--- docs/api-reference/interfaces/NodeStyle/index.html | 6 +++--- docs/api-reference/interfaces/OMap/index.html | 6 +++--- docs/api-reference/interfaces/OMapF/index.html | 6 +++--- docs/api-reference/interfaces/OutputPin/index.html | 6 +++--- docs/api-reference/interfaces/PartError/index.html | 6 +++--- docs/api-reference/interfaces/PartInstanceConfig/index.html | 6 +++--- docs/api-reference/interfaces/PartStyle/index.html | 6 +++--- docs/api-reference/interfaces/RefNodeInstance/index.html | 6 +++--- docs/api-reference/interfaces/RefPartInstance/index.html | 6 +++--- docs/api-reference/interfaces/SimpleFnData/index.html | 6 +++--- docs/api-reference/interfaces/VisualNode/index.html | 6 +++--- docs/api-reference/interfaces/VisualPart/index.html | 6 +++--- docs/api-reference/modules/index.html | 6 +++--- docs/code-nodes/index.html | 6 +++--- docs/index.html | 6 +++--- docs/lifecycle/index.html | 6 +++--- docs/packages/index.html | 6 +++--- docs/quick-start/index.html | 6 +++--- docs/terminology/index.html | 6 +++--- index.html | 6 +++--- markdown-page/index.html | 6 +++--- playground/apis/index.html | 6 +++--- playground/bmi/index.html | 6 +++--- playground/debounce-throttling/index.html | 6 +++--- playground/fibonacci/index.html | 6 +++--- playground/hello-world/index.html | 6 +++--- playground/index.html | 6 +++--- playground/react-counter/index.html | 6 +++--- 71 files changed, 193 insertions(+), 193 deletions(-) rename assets/css/{styles.6d680f3c.css => styles.b07e47f5.css} (73%) rename assets/js/{0f8300a0.368f7932.js => 0f8300a0.40bf21f8.js} (65%) rename assets/js/{1df93b7f.1d72a79e.js => 1df93b7f.b5fbcbac.js} (54%) rename assets/js/{3f72396a.9bf60090.js => 3f72396a.3b1372cf.js} (65%) rename assets/js/{5328e403.96ffad58.js => 5328e403.7d01d420.js} (66%) rename assets/js/{7a4a9b46.ecd791fe.js => 7a4a9b46.9fb3b1b2.js} (61%) rename assets/js/{8926b418.2c64d072.js => 8926b418.e60006ca.js} (66%) rename assets/js/{d5c55fab.cff3822e.js => d5c55fab.0ab53de2.js} (69%) rename assets/js/{f989b58c.8457b8a7.js => f989b58c.3ebfd358.js} (63%) rename assets/js/{runtime~main.d9fa0635.js => runtime~main.45d79ea0.js} (98%) diff --git a/404.html b/404.html index 2bd935be2..5b9bcfd3c 100644 --- a/404.html +++ b/404.html @@ -14,14 +14,14 @@ - - + +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/assets/css/styles.6d680f3c.css b/assets/css/styles.b07e47f5.css similarity index 73% rename from assets/css/styles.6d680f3c.css rename to assets/css/styles.b07e47f5.css index ab9f5a68c..1172838fe 100644 --- a/assets/css/styles.6d680f3c.css +++ b/assets/css/styles.b07e47f5.css @@ -1 +1 @@ -@charset "UTF-8";@import url(https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700);*,.flyde-flow-editor *,.flyde-flow-editor :after,.flyde-flow-editor :before,html{box-sizing:border-box}.col,.container{padding:0 var(--ifm-spacing-horizontal);width:100%}.markdown>h2,.markdown>h3,.markdown>h4,.markdown>h5,.markdown>h6{margin-bottom:calc(var(--ifm-heading-vertical-rhythm-bottom)*var(--ifm-leading))}pre,table{overflow:auto}blockquote,pre{margin:0 0 var(--ifm-spacing-vertical)}.breadcrumbs__link,.button{transition-timing-function:var(--ifm-transition-timing-default)}.button,code{vertical-align:middle}.button--outline.button--active,.button--outline:active,.button--outline:hover,:root{--ifm-button-color:var(--ifm-font-color-base-inverse)}.menu__link:hover,a{transition:color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.navbar--dark,:root{--ifm-navbar-link-hover-color:var(--ifm-color-primary)}.menu,.navbar-sidebar{overflow-x:hidden}:root,html[data-theme=dark]{--ifm-color-emphasis-500:var(--ifm-color-gray-500)}.markdown li,body{word-wrap:break-word}.toggleButton__N08,html{-webkit-tap-highlight-color:transparent}:root{--ifm-color-scheme:light;--ifm-dark-value:10%;--ifm-darker-value:15%;--ifm-darkest-value:30%;--ifm-light-value:15%;--ifm-lighter-value:30%;--ifm-lightest-value:50%;--ifm-contrast-background-value:90%;--ifm-contrast-foreground-value:70%;--ifm-contrast-background-dark-value:70%;--ifm-contrast-foreground-dark-value:90%;--ifm-color-primary:#3578e5;--ifm-color-secondary:#ebedf0;--ifm-color-success:#00a400;--ifm-color-info:#54c7ec;--ifm-color-warning:#ffba00;--ifm-color-danger:#fa383e;--ifm-color-primary-dark:#306cce;--ifm-color-primary-darker:#2d66c3;--ifm-color-primary-darkest:#2554a0;--ifm-color-primary-light:#538ce9;--ifm-color-primary-lighter:#72a1ed;--ifm-color-primary-lightest:#9abcf2;--ifm-color-primary-contrast-background:#ebf2fc;--ifm-color-primary-contrast-foreground:#102445;--ifm-color-secondary-dark:#d4d5d8;--ifm-color-secondary-darker:#c8c9cc;--ifm-color-secondary-darkest:#a4a6a8;--ifm-color-secondary-light:#eef0f2;--ifm-color-secondary-lighter:#f1f2f5;--ifm-color-secondary-lightest:#f5f6f8;--ifm-color-secondary-contrast-background:#fdfdfe;--ifm-color-secondary-contrast-foreground:#474748;--ifm-color-success-dark:#009400;--ifm-color-success-darker:#008b00;--ifm-color-success-darkest:#007300;--ifm-color-success-light:#26b226;--ifm-color-success-lighter:#4dbf4d;--ifm-color-success-lightest:#80d280;--ifm-color-success-contrast-background:#e6f6e6;--ifm-color-success-contrast-foreground:#003100;--ifm-color-info-dark:#4cb3d4;--ifm-color-info-darker:#47a9c9;--ifm-color-info-darkest:#3b8ba5;--ifm-color-info-light:#6ecfef;--ifm-color-info-lighter:#87d8f2;--ifm-color-info-lightest:#aae3f6;--ifm-color-info-contrast-background:#eef9fd;--ifm-color-info-contrast-foreground:#193c47;--ifm-color-warning-dark:#e6a700;--ifm-color-warning-darker:#d99e00;--ifm-color-warning-darkest:#b38200;--ifm-color-warning-light:#ffc426;--ifm-color-warning-lighter:#ffcf4d;--ifm-color-warning-lightest:#ffdd80;--ifm-color-warning-contrast-background:#fff8e6;--ifm-color-warning-contrast-foreground:#4d3800;--ifm-color-danger-dark:#e13238;--ifm-color-danger-darker:#d53035;--ifm-color-danger-darkest:#af272b;--ifm-color-danger-light:#fb565b;--ifm-color-danger-lighter:#fb7478;--ifm-color-danger-lightest:#fd9c9f;--ifm-color-danger-contrast-background:#ffebec;--ifm-color-danger-contrast-foreground:#4b1113;--ifm-color-white:#fff;--ifm-color-black:#000;--ifm-color-gray-0:var(--ifm-color-white);--ifm-color-gray-100:#f5f6f7;--ifm-color-gray-200:#ebedf0;--ifm-color-gray-300:#dadde1;--ifm-color-gray-400:#ccd0d5;--ifm-color-gray-500:#bec3c9;--ifm-color-gray-600:#8d949e;--ifm-color-gray-700:#606770;--ifm-color-gray-800:#444950;--ifm-color-gray-900:#1c1e21;--ifm-color-gray-1000:var(--ifm-color-black);--ifm-color-emphasis-0:var(--ifm-color-gray-0);--ifm-color-emphasis-100:var(--ifm-color-gray-100);--ifm-color-emphasis-200:var(--ifm-color-gray-200);--ifm-color-emphasis-300:var(--ifm-color-gray-300);--ifm-color-emphasis-400:var(--ifm-color-gray-400);--ifm-color-emphasis-600:var(--ifm-color-gray-600);--ifm-color-emphasis-700:var(--ifm-color-gray-700);--ifm-color-emphasis-800:var(--ifm-color-gray-800);--ifm-color-emphasis-900:var(--ifm-color-gray-900);--ifm-color-emphasis-1000:var(--ifm-color-gray-1000);--ifm-color-content:var(--ifm-color-emphasis-900);--ifm-color-content-inverse:var(--ifm-color-emphasis-0);--ifm-color-content-secondary:#525860;--ifm-background-color:transparent;--ifm-background-surface-color:var(--ifm-color-content-inverse);--ifm-global-border-width:1px;--ifm-global-radius:0.4rem;--ifm-hover-overlay:rgba(0,0,0,.05);--ifm-font-color-base:var(--ifm-color-content);--ifm-font-color-base-inverse:var(--ifm-color-content-inverse);--ifm-font-color-secondary:var(--ifm-color-content-secondary);--ifm-font-family-base:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ifm-font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--ifm-font-size-base:100%;--ifm-font-weight-light:300;--ifm-font-weight-normal:400;--ifm-font-weight-semibold:500;--ifm-font-weight-bold:700;--ifm-font-weight-base:var(--ifm-font-weight-normal);--ifm-line-height-base:1.65;--ifm-global-spacing:1rem;--ifm-spacing-vertical:var(--ifm-global-spacing);--ifm-spacing-horizontal:var(--ifm-global-spacing);--ifm-transition-fast:200ms;--ifm-transition-slow:400ms;--ifm-transition-timing-default:cubic-bezier(0.08,0.52,0.52,1);--ifm-global-shadow-lw:0 1px 2px 0 rgba(0,0,0,.1);--ifm-global-shadow-md:0 5px 40px rgba(0,0,0,.2);--ifm-global-shadow-tl:0 12px 28px 0 rgba(0,0,0,.2),0 2px 4px 0 rgba(0,0,0,.1);--ifm-z-index-dropdown:100;--ifm-z-index-fixed:200;--ifm-z-index-overlay:400;--ifm-container-width:1140px;--ifm-container-width-xl:1320px;--ifm-code-background:#f6f7f8;--ifm-code-border-radius:var(--ifm-global-radius);--ifm-code-font-size:90%;--ifm-code-padding-horizontal:0.1rem;--ifm-code-padding-vertical:0.1rem;--ifm-pre-background:var(--ifm-code-background);--ifm-pre-border-radius:var(--ifm-code-border-radius);--ifm-pre-color:inherit;--ifm-pre-line-height:1.45;--ifm-pre-padding:1rem;--ifm-heading-color:inherit;--ifm-heading-margin-top:0;--ifm-heading-margin-bottom:var(--ifm-spacing-vertical);--ifm-heading-font-family:var(--ifm-font-family-base);--ifm-heading-font-weight:var(--ifm-font-weight-bold);--ifm-heading-line-height:1.25;--ifm-h1-font-size:2rem;--ifm-h2-font-size:1.5rem;--ifm-h3-font-size:1.25rem;--ifm-h4-font-size:1rem;--ifm-h5-font-size:0.875rem;--ifm-h6-font-size:0.85rem;--ifm-image-alignment-padding:1.25rem;--ifm-leading-desktop:1.25;--ifm-leading:calc(var(--ifm-leading-desktop)*1rem);--ifm-list-left-padding:2rem;--ifm-list-margin:1rem;--ifm-list-item-margin:0.25rem;--ifm-list-paragraph-margin:1rem;--ifm-table-cell-padding:0.75rem;--ifm-table-background:transparent;--ifm-table-stripe-background:rgba(0,0,0,.03);--ifm-table-border-width:1px;--ifm-table-border-color:var(--ifm-color-emphasis-300);--ifm-table-head-background:inherit;--ifm-table-head-color:inherit;--ifm-table-head-font-weight:var(--ifm-font-weight-bold);--ifm-table-cell-color:inherit;--ifm-link-color:var(--ifm-color-primary);--ifm-link-decoration:none;--ifm-link-hover-color:var(--ifm-link-color);--ifm-link-hover-decoration:underline;--ifm-paragraph-margin-bottom:var(--ifm-leading);--ifm-blockquote-font-size:var(--ifm-font-size-base);--ifm-blockquote-border-left-width:2px;--ifm-blockquote-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-blockquote-padding-vertical:0;--ifm-blockquote-shadow:none;--ifm-blockquote-color:var(--ifm-color-emphasis-800);--ifm-blockquote-border-color:var(--ifm-color-emphasis-300);--ifm-hr-background-color:var(--ifm-color-emphasis-500);--ifm-hr-height:1px;--ifm-hr-margin-vertical:1.5rem;--ifm-scrollbar-size:7px;--ifm-scrollbar-track-background-color:#f1f1f1;--ifm-scrollbar-thumb-background-color:silver;--ifm-scrollbar-thumb-hover-background-color:#a7a7a7;--ifm-alert-background-color:inherit;--ifm-alert-border-color:inherit;--ifm-alert-border-radius:var(--ifm-global-radius);--ifm-alert-border-width:0px;--ifm-alert-border-left-width:5px;--ifm-alert-color:var(--ifm-font-color-base);--ifm-alert-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-alert-padding-vertical:var(--ifm-spacing-vertical);--ifm-alert-shadow:var(--ifm-global-shadow-lw);--ifm-avatar-intro-margin:1rem;--ifm-avatar-intro-alignment:inherit;--ifm-avatar-photo-size:3rem;--ifm-badge-background-color:inherit;--ifm-badge-border-color:inherit;--ifm-badge-border-radius:var(--ifm-global-radius);--ifm-badge-border-width:var(--ifm-global-border-width);--ifm-badge-color:var(--ifm-color-white);--ifm-badge-padding-horizontal:calc(var(--ifm-spacing-horizontal)*0.5);--ifm-badge-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-breadcrumb-border-radius:1.5rem;--ifm-breadcrumb-spacing:0.5rem;--ifm-breadcrumb-color-active:var(--ifm-color-primary);--ifm-breadcrumb-item-background-active:var(--ifm-hover-overlay);--ifm-breadcrumb-padding-horizontal:0.8rem;--ifm-breadcrumb-padding-vertical:0.4rem;--ifm-breadcrumb-size-multiplier:1;--ifm-breadcrumb-separator:url('data:image/svg+xml;utf8,');--ifm-breadcrumb-separator-filter:none;--ifm-breadcrumb-separator-size:0.5rem;--ifm-breadcrumb-separator-size-multiplier:1.25;--ifm-button-background-color:inherit;--ifm-button-border-color:var(--ifm-button-background-color);--ifm-button-border-width:var(--ifm-global-border-width);--ifm-button-font-weight:var(--ifm-font-weight-bold);--ifm-button-padding-horizontal:1.5rem;--ifm-button-padding-vertical:0.375rem;--ifm-button-size-multiplier:1;--ifm-button-transition-duration:var(--ifm-transition-fast);--ifm-button-border-radius:calc(var(--ifm-global-radius)*var(--ifm-button-size-multiplier));--ifm-button-group-spacing:2px;--ifm-card-background-color:var(--ifm-background-surface-color);--ifm-card-border-radius:calc(var(--ifm-global-radius)*2);--ifm-card-horizontal-spacing:var(--ifm-global-spacing);--ifm-card-vertical-spacing:var(--ifm-global-spacing);--ifm-toc-border-color:var(--ifm-color-emphasis-300);--ifm-toc-link-color:var(--ifm-color-content-secondary);--ifm-toc-padding-vertical:0.5rem;--ifm-toc-padding-horizontal:0.5rem;--ifm-dropdown-background-color:var(--ifm-background-surface-color);--ifm-dropdown-font-weight:var(--ifm-font-weight-semibold);--ifm-dropdown-link-color:var(--ifm-font-color-base);--ifm-dropdown-hover-background-color:var(--ifm-hover-overlay);--ifm-footer-background-color:var(--ifm-color-emphasis-100);--ifm-footer-color:inherit;--ifm-footer-link-color:var(--ifm-color-emphasis-700);--ifm-footer-link-hover-color:var(--ifm-color-primary);--ifm-footer-link-horizontal-spacing:0.5rem;--ifm-footer-padding-horizontal:calc(var(--ifm-spacing-horizontal)*2);--ifm-footer-padding-vertical:calc(var(--ifm-spacing-vertical)*2);--ifm-footer-title-color:inherit;--ifm-footer-logo-max-width:min(30rem,90vw);--ifm-hero-background-color:var(--ifm-background-surface-color);--ifm-hero-text-color:var(--ifm-color-emphasis-800);--ifm-menu-color:var(--ifm-color-emphasis-700);--ifm-menu-color-active:var(--ifm-color-primary);--ifm-menu-color-background-active:var(--ifm-hover-overlay);--ifm-menu-color-background-hover:var(--ifm-hover-overlay);--ifm-menu-link-padding-horizontal:0.75rem;--ifm-menu-link-padding-vertical:0.375rem;--ifm-menu-link-sublist-icon:url('data:image/svg+xml;utf8,');--ifm-menu-link-sublist-icon-filter:none;--ifm-navbar-background-color:var(--ifm-background-surface-color);--ifm-navbar-height:3.75rem;--ifm-navbar-item-padding-horizontal:0.75rem;--ifm-navbar-item-padding-vertical:0.25rem;--ifm-navbar-link-color:var(--ifm-font-color-base);--ifm-navbar-link-active-color:var(--ifm-link-color);--ifm-navbar-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-navbar-padding-vertical:calc(var(--ifm-spacing-vertical)*0.5);--ifm-navbar-shadow:var(--ifm-global-shadow-lw);--ifm-navbar-search-input-background-color:var(--ifm-color-emphasis-200);--ifm-navbar-search-input-color:var(--ifm-color-emphasis-800);--ifm-navbar-search-input-placeholder-color:var(--ifm-color-emphasis-500);--ifm-navbar-search-input-icon:url('data:image/svg+xml;utf8,');--ifm-navbar-sidebar-width:83vw;--ifm-pagination-border-radius:var(--ifm-global-radius);--ifm-pagination-color-active:var(--ifm-color-primary);--ifm-pagination-font-size:1rem;--ifm-pagination-item-active-background:var(--ifm-hover-overlay);--ifm-pagination-page-spacing:0.2em;--ifm-pagination-padding-horizontal:calc(var(--ifm-spacing-horizontal)*1);--ifm-pagination-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-pagination-nav-border-radius:var(--ifm-global-radius);--ifm-pagination-nav-color-hover:var(--ifm-color-primary);--ifm-pills-color-active:var(--ifm-color-primary);--ifm-pills-color-background-active:var(--ifm-hover-overlay);--ifm-pills-spacing:0.125rem;--ifm-tabs-color:var(--ifm-font-color-secondary);--ifm-tabs-color-active:var(--ifm-color-primary);--ifm-tabs-color-active-border:var(--ifm-tabs-color-active);--ifm-tabs-padding-horizontal:1rem;--ifm-tabs-padding-vertical:1rem;--docusaurus-progress-bar-color:var(--ifm-color-primary);--ifm-color-primary:#007ec6;--ifm-color-primary-dark:#00659f;--ifm-color-primary-darker:#00507e;--ifm-color-primary-darkest:#003b5d;--ifm-color-primary-light:#0085d2;--ifm-color-primary-lighter:#30a7ec;--ifm-color-primary-lightest:#72cbff;--ifm-code-font-size:95%;--docusaurus-highlighted-code-line-bg:rgba(0,0,0,.1);--docusaurus-announcement-bar-height:auto;--docusaurus-collapse-button-bg:transparent;--docusaurus-collapse-button-bg-hover:rgba(0,0,0,.1);--doc-sidebar-width:300px;--doc-sidebar-hidden-width:30px;--docusaurus-tag-list-border:var(--ifm-color-emphasis-300)}.badge--danger,.badge--info,.badge--primary,.badge--secondary,.badge--success,.badge--warning{--ifm-badge-border-color:var(--ifm-badge-background-color)}.button--link,.button--outline{--ifm-button-background-color:transparent}html{-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;text-size-adjust:100%;background-color:var(--ifm-background-color);color:var(--ifm-font-color-base);color-scheme:var(--ifm-color-scheme);font:var(--ifm-font-size-base)/var(--ifm-line-height-base) var(--ifm-font-family-base);text-rendering:optimizelegibility}iframe{border:0;color-scheme:auto}.container{margin:0 auto;max-width:var(--ifm-container-width)}.container--fluid{max-width:inherit}.row{display:flex;flex-wrap:wrap;margin:0 calc(var(--ifm-spacing-horizontal)*-1)}.margin-bottom--none,.margin-vert--none,.markdown>:last-child{margin-bottom:0!important}.margin-top--none,.margin-vert--none{margin-top:0!important}.row--no-gutters{margin-left:0;margin-right:0}.margin-horiz--none,.margin-right--none{margin-right:0!important}.row--no-gutters>.col{padding-left:0;padding-right:0}.bp5-toast-container.bp5-toast-container-left,.row--align-top{align-items:flex-start}.bp5-toast-container.bp5-toast-container-right,.row--align-bottom{align-items:flex-end}.menuExternalLink_o9JJ,.row--align-center{align-items:center}.row--align-stretch{align-items:stretch}.row--align-baseline{align-items:baseline}.col{--ifm-col-width:100%;flex:1 0;margin-left:0;max-width:var(--ifm-col-width)}.padding-bottom--none,.padding-vert--none{padding-bottom:0!important}.padding-top--none,.padding-vert--none{padding-top:0!important}.padding-horiz--none,.padding-left--none{padding-left:0!important}.padding-horiz--none,.padding-right--none{padding-right:0!important}.col[class*=col--]{flex:0 0 var(--ifm-col-width)}.col--1{--ifm-col-width:8.33333%}.col--offset-1{margin-left:8.33333%}.col--2{--ifm-col-width:16.66667%}.col--offset-2{margin-left:16.66667%}.col--3{--ifm-col-width:25%}.col--offset-3{margin-left:25%}.col--4{--ifm-col-width:33.33333%}.col--offset-4{margin-left:33.33333%}.col--5{--ifm-col-width:41.66667%}.col--offset-5{margin-left:41.66667%}.col--6{--ifm-col-width:50%}.col--offset-6{margin-left:50%}.col--7{--ifm-col-width:58.33333%}.col--offset-7{margin-left:58.33333%}.col--8{--ifm-col-width:66.66667%}.col--offset-8{margin-left:66.66667%}.col--9{--ifm-col-width:75%}.col--offset-9{margin-left:75%}.col--10{--ifm-col-width:83.33333%}.col--offset-10{margin-left:83.33333%}.col--11{--ifm-col-width:91.66667%}.col--offset-11{margin-left:91.66667%}.col--12{--ifm-col-width:100%}.col--offset-12{margin-left:100%}.margin-horiz--none,.margin-left--none{margin-left:0!important}.bp5-popover.bp5-minimal,.margin--none{margin:0!important}.margin-bottom--xs,.margin-vert--xs{margin-bottom:.25rem!important}.margin-top--xs,.margin-vert--xs{margin-top:.25rem!important}.margin-horiz--xs,.margin-left--xs{margin-left:.25rem!important}.margin-horiz--xs,.margin-right--xs{margin-right:.25rem!important}.margin--xs{margin:.25rem!important}.margin-bottom--sm,.margin-vert--sm{margin-bottom:.5rem!important}.margin-top--sm,.margin-vert--sm{margin-top:.5rem!important}.margin-horiz--sm,.margin-left--sm{margin-left:.5rem!important}.margin-horiz--sm,.margin-right--sm{margin-right:.5rem!important}.margin--sm{margin:.5rem!important}.margin-bottom--md,.margin-vert--md{margin-bottom:1rem!important}.margin-top--md,.margin-vert--md{margin-top:1rem!important}.margin-horiz--md,.margin-left--md{margin-left:1rem!important}.margin-horiz--md,.margin-right--md{margin-right:1rem!important}.margin--md{margin:1rem!important}.margin-bottom--lg,.margin-vert--lg{margin-bottom:2rem!important}.margin-top--lg,.margin-vert--lg{margin-top:2rem!important}.margin-horiz--lg,.margin-left--lg{margin-left:2rem!important}.margin-horiz--lg,.margin-right--lg{margin-right:2rem!important}.margin--lg{margin:2rem!important}.margin-bottom--xl,.margin-vert--xl{margin-bottom:5rem!important}.margin-top--xl,.margin-vert--xl{margin-top:5rem!important}.margin-horiz--xl,.margin-left--xl{margin-left:5rem!important}.margin-horiz--xl,.margin-right--xl{margin-right:5rem!important}.margin--xl{margin:5rem!important}.bp5-button:empty,.padding--none{padding:0!important}.padding-bottom--xs,.padding-vert--xs{padding-bottom:.25rem!important}.padding-top--xs,.padding-vert--xs{padding-top:.25rem!important}.padding-horiz--xs,.padding-left--xs{padding-left:.25rem!important}.padding-horiz--xs,.padding-right--xs{padding-right:.25rem!important}.padding--xs{padding:.25rem!important}.padding-bottom--sm,.padding-vert--sm{padding-bottom:.5rem!important}.padding-top--sm,.padding-vert--sm{padding-top:.5rem!important}.padding-horiz--sm,.padding-left--sm{padding-left:.5rem!important}.padding-horiz--sm,.padding-right--sm{padding-right:.5rem!important}.padding--sm{padding:.5rem!important}.padding-bottom--md,.padding-vert--md{padding-bottom:1rem!important}.padding-top--md,.padding-vert--md{padding-top:1rem!important}.padding-horiz--md,.padding-left--md{padding-left:1rem!important}.padding-horiz--md,.padding-right--md{padding-right:1rem!important}.padding--md{padding:1rem!important}.padding-bottom--lg,.padding-vert--lg{padding-bottom:2rem!important}.padding-top--lg,.padding-vert--lg{padding-top:2rem!important}.padding-horiz--lg,.padding-left--lg{padding-left:2rem!important}.padding-horiz--lg,.padding-right--lg{padding-right:2rem!important}.padding--lg{padding:2rem!important}.padding-bottom--xl,.padding-vert--xl{padding-bottom:5rem!important}.padding-top--xl,.padding-vert--xl{padding-top:5rem!important}.padding-horiz--xl,.padding-left--xl{padding-left:5rem!important}.padding-horiz--xl,.padding-right--xl{padding-right:5rem!important}.padding--xl{padding:5rem!important}code{background-color:var(--ifm-code-background);border:.1rem solid rgba(0,0,0,.1);border-radius:var(--ifm-code-border-radius);font-family:var(--ifm-font-family-monospace);font-size:var(--ifm-code-font-size);padding:var(--ifm-code-padding-vertical) var(--ifm-code-padding-horizontal)}pre{background-color:var(--ifm-pre-background);border-radius:var(--ifm-pre-border-radius);color:var(--ifm-pre-color);font:var(--ifm-code-font-size)/var(--ifm-pre-line-height) var(--ifm-font-family-monospace);padding:var(--ifm-pre-padding)}.clean-btn,pre code{border:none;padding:0}pre code{background-color:transparent;font-size:100%;line-height:inherit}kbd{background-color:var(--ifm-color-emphasis-0);border:1px solid var(--ifm-color-emphasis-400);box-shadow:inset 0 -1px 0 var(--ifm-color-emphasis-400);color:var(--ifm-color-emphasis-800);font:80% var(--ifm-font-family-monospace)}h1,h2,h3,h4,h5,h6{color:var(--ifm-heading-color);font-family:var(--ifm-heading-font-family);font-weight:var(--ifm-heading-font-weight);line-height:var(--ifm-heading-line-height);margin:var(--ifm-heading-margin-top) 0 var(--ifm-heading-margin-bottom) 0}h1{font-size:var(--ifm-h1-font-size)}h2{font-size:var(--ifm-h2-font-size)}h3{font-size:var(--ifm-h3-font-size)}h4{font-size:var(--ifm-h4-font-size)}h5{font-size:var(--ifm-h5-font-size)}h6{font-size:var(--ifm-h6-font-size)}img{max-width:100%}img[align=right]{padding-left:var(--image-alignment-padding)}img[align=left]{padding-right:var(--image-alignment-padding)}.markdown{--ifm-h1-vertical-rhythm-top:3;--ifm-h2-vertical-rhythm-top:2;--ifm-h3-vertical-rhythm-top:1.5;--ifm-heading-vertical-rhythm-top:1.25;--ifm-h1-vertical-rhythm-bottom:1.25;--ifm-heading-vertical-rhythm-bottom:1}.markdown:after,.markdown:before{content:"";display:table}.markdown:after{clear:both}.markdown h1:first-child{--ifm-h1-font-size:3rem;margin-bottom:calc(var(--ifm-h1-vertical-rhythm-bottom)*var(--ifm-leading))}.markdown>h2{--ifm-h2-font-size:2rem;margin-top:calc(var(--ifm-h2-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h3{--ifm-h3-font-size:1.5rem;margin-top:calc(var(--ifm-h3-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h4,.markdown>h5,.markdown>h6{margin-top:calc(var(--ifm-heading-vertical-rhythm-top)*var(--ifm-leading))}.markdown>p,.markdown>pre,.markdown>ul{margin-bottom:var(--ifm-leading)}.markdown li>p{margin-top:var(--ifm-list-paragraph-margin)}.markdown li+li{margin-top:var(--ifm-list-item-margin)}ol,ul{margin:0 0 var(--ifm-list-margin);padding-left:var(--ifm-list-left-padding)}ol ol,ul ol{list-style-type:lower-roman}ol ol,ol ul,ul ol,ul ul{margin:0}ol ol ol,ol ul ol,ul ol ol,ul ul ol{list-style-type:lower-alpha}table{border-collapse:collapse;display:block;margin-bottom:var(--ifm-spacing-vertical)}table thead tr{border-bottom:2px solid var(--ifm-table-border-color)}table thead,table tr:nth-child(2n){background-color:var(--ifm-table-stripe-background)}table tr{background-color:var(--ifm-table-background);border-top:var(--ifm-table-border-width) solid var(--ifm-table-border-color)}table td,table th{border:var(--ifm-table-border-width) solid var(--ifm-table-border-color);padding:var(--ifm-table-cell-padding)}table th{background-color:var(--ifm-table-head-background);color:var(--ifm-table-head-color);font-weight:var(--ifm-table-head-font-weight)}table td{color:var(--ifm-table-cell-color)}strong{font-weight:var(--ifm-font-weight-bold)}a{color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration);text-decoration:none}a:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.button:hover,.text--no-decoration,.text--no-decoration:hover,a:not([href]){text-decoration:none}p{margin:0 0 var(--ifm-paragraph-margin-bottom);margin-bottom:10px;margin-top:0}blockquote{border-left:var(--ifm-blockquote-border-left-width) solid var(--ifm-blockquote-border-color);box-shadow:var(--ifm-blockquote-shadow);color:var(--ifm-blockquote-color);font-size:var(--ifm-blockquote-font-size);padding:var(--ifm-blockquote-padding-vertical) var(--ifm-blockquote-padding-horizontal)}blockquote>:first-child{margin-top:0}blockquote>:last-child{margin-bottom:0}hr{background-color:var(--ifm-hr-background-color);border:0;height:var(--ifm-hr-height);margin:var(--ifm-hr-margin-vertical) 0}.shadow--lw{box-shadow:var(--ifm-global-shadow-lw)!important}.shadow--md{box-shadow:var(--ifm-global-shadow-md)!important}.shadow--tl{box-shadow:var(--ifm-global-shadow-tl)!important}.text--primary,.wordWrapButtonEnabled_VB_4 .wordWrapButtonIcon_Xcrc{color:var(--ifm-color-primary)}.text--secondary{color:var(--ifm-color-secondary)}.text--success{color:var(--ifm-color-success)}.text--info{color:var(--ifm-color-info)}.text--warning{color:var(--ifm-color-warning)}.text--danger{color:var(--ifm-color-danger)}.text--center{text-align:center}.bp5-align-left .bp5-button,.bp5-button-group.bp5-align-left .bp5-button,.bp5-button.bp5-align-left,.text--left{text-align:left}.text--justify{text-align:justify}.bp5-align-right .bp5-button,.bp5-button.bp5-align-right,.bp5-rtl,.text--right{text-align:right}.text--capitalize{text-transform:capitalize}.text--lowercase{text-transform:lowercase}.alert__heading,.text--uppercase{text-transform:uppercase}.text--light{font-weight:var(--ifm-font-weight-light)}.text--normal{font-weight:var(--ifm-font-weight-normal)}.text--semibold{font-weight:var(--ifm-font-weight-semibold)}.text--bold{font-weight:var(--ifm-font-weight-bold)}.text--italic{font-style:italic}.text--truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text--break{word-wrap:break-word!important;word-break:break-word!important}.clean-btn{background:none;color:inherit;cursor:pointer;font-family:inherit}.alert,.alert .close{color:var(--ifm-alert-foreground-color)}.clean-list{list-style:none;padding-left:0}.alert--primary{--ifm-alert-background-color:var(--ifm-color-primary-contrast-background);--ifm-alert-background-color-highlight:rgba(53,120,229,.15);--ifm-alert-foreground-color:var(--ifm-color-primary-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-primary-dark)}.alert--secondary{--ifm-alert-background-color:var(--ifm-color-secondary-contrast-background);--ifm-alert-background-color-highlight:rgba(235,237,240,.15);--ifm-alert-foreground-color:var(--ifm-color-secondary-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-secondary-dark)}.alert--success{--ifm-alert-background-color:var(--ifm-color-success-contrast-background);--ifm-alert-background-color-highlight:rgba(0,164,0,.15);--ifm-alert-foreground-color:var(--ifm-color-success-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-success-dark)}.alert--info{--ifm-alert-background-color:var(--ifm-color-info-contrast-background);--ifm-alert-background-color-highlight:rgba(84,199,236,.15);--ifm-alert-foreground-color:var(--ifm-color-info-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-info-dark)}.alert--warning{--ifm-alert-background-color:var(--ifm-color-warning-contrast-background);--ifm-alert-background-color-highlight:rgba(255,186,0,.15);--ifm-alert-foreground-color:var(--ifm-color-warning-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-warning-dark)}.alert--danger{--ifm-alert-background-color:var(--ifm-color-danger-contrast-background);--ifm-alert-background-color-highlight:rgba(250,56,62,.15);--ifm-alert-foreground-color:var(--ifm-color-danger-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-danger-dark)}.alert{--ifm-code-background:var(--ifm-alert-background-color-highlight);--ifm-link-color:var(--ifm-alert-foreground-color);--ifm-link-hover-color:var(--ifm-alert-foreground-color);--ifm-link-decoration:underline;--ifm-tabs-color:var(--ifm-alert-foreground-color);--ifm-tabs-color-active:var(--ifm-alert-foreground-color);--ifm-tabs-color-active-border:var(--ifm-alert-border-color);background-color:var(--ifm-alert-background-color);border:var(--ifm-alert-border-width) solid var(--ifm-alert-border-color);border-left-width:var(--ifm-alert-border-left-width);border-radius:var(--ifm-alert-border-radius);box-shadow:var(--ifm-alert-shadow);padding:var(--ifm-alert-padding-vertical) var(--ifm-alert-padding-horizontal)}.alert__heading{align-items:center;display:flex;font:700 var(--ifm-h5-font-size)/var(--ifm-heading-line-height) var(--ifm-heading-font-family);margin-bottom:.5rem}.alert__icon{display:inline-flex;margin-right:.4em}.alert__icon svg{fill:var(--ifm-alert-foreground-color);stroke:var(--ifm-alert-foreground-color);stroke-width:0}.alert .close{margin:calc(var(--ifm-alert-padding-vertical)*-1) calc(var(--ifm-alert-padding-horizontal)*-1) 0 0;opacity:.75}.bp5-control.bp5-radio input:checked:disabled~.bp5-control-indicator:before,.close{opacity:.5}.alert .close:focus,.alert .close:hover{opacity:1}.alert a{text-decoration-color:var(--ifm-alert-border-color)}.alert a:hover{text-decoration-thickness:2px}.avatar{column-gap:var(--ifm-avatar-intro-margin);display:flex}.avatar__photo{border-radius:50%;display:block;height:var(--ifm-avatar-photo-size);overflow:hidden;width:var(--ifm-avatar-photo-size)}.bp5-tabs:not(.bp5-vertical) .bp5-tab-indicator-wrapper,.bp5-tabs:not(.bp5-vertical).bp5-fill,.bp5-tabs:not(.bp5-vertical).bp5-fill .bp5-tab-list,.card--full-height,.navbar__logo img,body,html{height:100%}.avatar__photo--sm{--ifm-avatar-photo-size:2rem}.avatar__photo--lg{--ifm-avatar-photo-size:4rem}.avatar__photo--xl{--ifm-avatar-photo-size:6rem}.avatar__intro{display:flex;flex:1 1;flex-direction:column;justify-content:center;text-align:var(--ifm-avatar-intro-alignment)}.badge,.breadcrumbs__item,.breadcrumbs__link,.button,.dropdown>.navbar__link:after,span.bp5-popover-target{display:inline-block}.avatar__name{font:700 var(--ifm-h4-font-size)/var(--ifm-heading-line-height) var(--ifm-font-family-base)}.avatar__subtitle{margin-top:.25rem}.avatar--vertical{--ifm-avatar-intro-alignment:center;--ifm-avatar-intro-margin:0.5rem;align-items:center;flex-direction:column}.badge{background-color:var(--ifm-badge-background-color);border:var(--ifm-badge-border-width) solid var(--ifm-badge-border-color);border-radius:var(--ifm-badge-border-radius);color:var(--ifm-badge-color);font-size:75%;font-weight:var(--ifm-font-weight-bold);line-height:1;padding:var(--ifm-badge-padding-vertical) var(--ifm-badge-padding-horizontal)}.badge--primary{--ifm-badge-background-color:var(--ifm-color-primary)}.badge--secondary{--ifm-badge-background-color:var(--ifm-color-secondary);color:var(--ifm-color-black)}.breadcrumbs__link,.button.button--secondary.button--outline:not(.button--active):not(:hover){color:var(--ifm-font-color-base)}.badge--success{--ifm-badge-background-color:var(--ifm-color-success)}.badge--info{--ifm-badge-background-color:var(--ifm-color-info)}.badge--warning{--ifm-badge-background-color:var(--ifm-color-warning)}.badge--danger{--ifm-badge-background-color:var(--ifm-color-danger)}.breadcrumbs{margin-bottom:0;padding-left:0}.breadcrumbs__item:not(:last-child):after{background:var(--ifm-breadcrumb-separator) center;content:" ";display:inline-block;filter:var(--ifm-breadcrumb-separator-filter);height:calc(var(--ifm-breadcrumb-separator-size)*var(--ifm-breadcrumb-size-multiplier)*var(--ifm-breadcrumb-separator-size-multiplier));margin:0 var(--ifm-breadcrumb-spacing);opacity:.5;width:calc(var(--ifm-breadcrumb-separator-size)*var(--ifm-breadcrumb-size-multiplier)*var(--ifm-breadcrumb-separator-size-multiplier))}.breadcrumbs__item--active .breadcrumbs__link{background:var(--ifm-breadcrumb-item-background-active);color:var(--ifm-breadcrumb-color-active)}.breadcrumbs__link{border-radius:var(--ifm-breadcrumb-border-radius);font-size:calc(1rem*var(--ifm-breadcrumb-size-multiplier));padding:calc(var(--ifm-breadcrumb-padding-vertical)*var(--ifm-breadcrumb-size-multiplier)) calc(var(--ifm-breadcrumb-padding-horizontal)*var(--ifm-breadcrumb-size-multiplier));transition-duration:var(--ifm-transition-fast);transition-property:background,color}.breadcrumbs__link:link:hover,.breadcrumbs__link:visited:hover,area[href].breadcrumbs__link:hover{background:var(--ifm-breadcrumb-item-background-active);text-decoration:none}.breadcrumbs__link:any-link:hover{background:var(--ifm-breadcrumb-item-background-active);text-decoration:none}.breadcrumbs--sm{--ifm-breadcrumb-size-multiplier:0.8}.breadcrumbs--lg{--ifm-breadcrumb-size-multiplier:1.2}.button{background-color:var(--ifm-button-background-color);border:var(--ifm-button-border-width) solid var(--ifm-button-border-color);border-radius:var(--ifm-button-border-radius);cursor:pointer;font-size:calc(.875rem*var(--ifm-button-size-multiplier));font-weight:var(--ifm-button-font-weight);line-height:1.5;padding:calc(var(--ifm-button-padding-vertical)*var(--ifm-button-size-multiplier)) calc(var(--ifm-button-padding-horizontal)*var(--ifm-button-size-multiplier));text-align:center;transition-duration:var(--ifm-button-transition-duration);transition-property:color,background,border-color;-webkit-user-select:none;user-select:none;white-space:nowrap}.button,.button:hover{color:var(--ifm-button-color)}.button--outline{--ifm-button-color:var(--ifm-button-border-color)}.button--outline:hover{--ifm-button-background-color:var(--ifm-button-border-color)}.button--link{--ifm-button-border-color:transparent;color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration)}.button--link.button--active,.button--link:active,.button--link:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.button.disabled,.button:disabled,.button[disabled]{opacity:.65;pointer-events:none}.button--sm{--ifm-button-size-multiplier:0.8}.button--lg{--ifm-button-size-multiplier:1.35}.button--block{display:block;width:100%}.button.button--secondary{color:var(--ifm-color-gray-900)}:where(.button--primary){--ifm-button-background-color:var(--ifm-color-primary);--ifm-button-border-color:var(--ifm-color-primary)}:where(.button--primary):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-primary-dark);--ifm-button-border-color:var(--ifm-color-primary-dark)}.button--primary.button--active,.button--primary:active{--ifm-button-background-color:var(--ifm-color-primary-darker);--ifm-button-border-color:var(--ifm-color-primary-darker)}:where(.button--secondary){--ifm-button-background-color:var(--ifm-color-secondary);--ifm-button-border-color:var(--ifm-color-secondary)}:where(.button--secondary):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-secondary-dark);--ifm-button-border-color:var(--ifm-color-secondary-dark)}.button--secondary.button--active,.button--secondary:active{--ifm-button-background-color:var(--ifm-color-secondary-darker);--ifm-button-border-color:var(--ifm-color-secondary-darker)}:where(.button--success){--ifm-button-background-color:var(--ifm-color-success);--ifm-button-border-color:var(--ifm-color-success)}:where(.button--success):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-success-dark);--ifm-button-border-color:var(--ifm-color-success-dark)}.button--success.button--active,.button--success:active{--ifm-button-background-color:var(--ifm-color-success-darker);--ifm-button-border-color:var(--ifm-color-success-darker)}:where(.button--info){--ifm-button-background-color:var(--ifm-color-info);--ifm-button-border-color:var(--ifm-color-info)}:where(.button--info):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-info-dark);--ifm-button-border-color:var(--ifm-color-info-dark)}.button--info.button--active,.button--info:active{--ifm-button-background-color:var(--ifm-color-info-darker);--ifm-button-border-color:var(--ifm-color-info-darker)}:where(.button--warning){--ifm-button-background-color:var(--ifm-color-warning);--ifm-button-border-color:var(--ifm-color-warning)}:where(.button--warning):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-warning-dark);--ifm-button-border-color:var(--ifm-color-warning-dark)}.button--warning.button--active,.button--warning:active{--ifm-button-background-color:var(--ifm-color-warning-darker);--ifm-button-border-color:var(--ifm-color-warning-darker)}:where(.button--danger){--ifm-button-background-color:var(--ifm-color-danger);--ifm-button-border-color:var(--ifm-color-danger)}:where(.button--danger):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-danger-dark);--ifm-button-border-color:var(--ifm-color-danger-dark)}.button--danger.button--active,.button--danger:active{--ifm-button-background-color:var(--ifm-color-danger-darker);--ifm-button-border-color:var(--ifm-color-danger-darker)}.button-group{display:inline-flex;gap:var(--ifm-button-group-spacing)}.bp5-button-group:not(.bp5-minimal)>.bp5-button:not(:first-child),.bp5-button-group:not(.bp5-minimal)>.bp5-popover-target:not(:first-child) .bp5-button,.bp5-button-group:not(.bp5-minimal)>.bp5-popover-wrapper:not(:first-child) .bp5-button,.bp5-control-group .bp5-numeric-input:not(:first-child) .bp5-input-group,.button-group>.button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.bp5-slider-handle.bp5-start,.button-group>.button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.button-group--block{display:flex;justify-content:stretch}.bp5-hotkey-dialog .bp5-hotkey-label,.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels .bp5-dialog-step-container,.button-group--block>.button{flex-grow:1}.card{background-color:var(--ifm-card-background-color);border-radius:var(--ifm-card-border-radius);box-shadow:var(--ifm-global-shadow-lw);display:flex;flex-direction:column;overflow:hidden}.card__image{padding-top:var(--ifm-card-vertical-spacing)}.bp5-large .bp5-menu-header:first-of-type>h6,.bp5-menu-header:first-of-type>h6,.card__image:first-child{padding-top:0}.card__body,.card__footer,.card__header{padding:var(--ifm-card-vertical-spacing) var(--ifm-card-horizontal-spacing)}.card__body:not(:last-child),.card__footer:not(:last-child),.card__header:not(:last-child){padding-bottom:0}.card__body>:last-child,.card__footer>:last-child,.card__header>:last-child{margin-bottom:0}.card__footer{margin-top:auto}.table-of-contents{font-size:.8rem;margin-bottom:0;padding:var(--ifm-toc-padding-vertical) 0}.table-of-contents,.table-of-contents ul{list-style:none;padding-left:var(--ifm-toc-padding-horizontal)}.table-of-contents li{margin:var(--ifm-toc-padding-vertical) var(--ifm-toc-padding-horizontal)}.table-of-contents__left-border{border-left:1px solid var(--ifm-toc-border-color)}.table-of-contents__link{color:var(--ifm-toc-link-color);display:block}.table-of-contents__link--active,.table-of-contents__link--active code,.table-of-contents__link:hover,.table-of-contents__link:hover code{color:var(--ifm-color-primary);text-decoration:none}.bp5-callout.bp5-intent-primary a,a:hover{text-decoration:underline}.close{color:var(--ifm-color-black);float:right;font-size:1.5rem;font-weight:var(--ifm-font-weight-bold);line-height:1;padding:1rem;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.close:hover,.pin.optional:not(.connected) .pin-inner{opacity:.7}.base-node-view.dragged,.close:focus,.ins-view .ins-view-inner.dragged,.ins-view.dragged,.json-view .jv-chevron:hover,.node-io-view .node-io-view-inner.dragged,.theme-code-block-highlighted-line .codeLineNumber_VYTV:before{opacity:.8}.dropdown{display:inline-flex;font-weight:var(--ifm-dropdown-font-weight);position:relative;vertical-align:top}.dropdown--hoverable:hover .dropdown__menu,.dropdown--show .dropdown__menu{opacity:1;pointer-events:all;transform:translateY(-1px);visibility:visible}#nprogress,.bp5-dialog-container,.bp5-overlay:not(.bp5-overlay-open),.bp5-popover-transition-container.bp5-popover-leave .bp5-popover-content,.dropdown__menu,.navbar__item.dropdown .navbar__link:not([href]),.node-preview{pointer-events:none}.dropdown--right .dropdown__menu{left:inherit;right:0}.dropdown--nocaret .navbar__link:after{content:none!important}.dropdown__menu{background-color:var(--ifm-dropdown-background-color);border-radius:var(--ifm-global-radius);box-shadow:var(--ifm-global-shadow-md);left:0;list-style:none;max-height:80vh;min-width:10rem;opacity:0;overflow-y:auto;padding:.5rem;position:absolute;top:calc(100% - var(--ifm-navbar-item-padding-vertical) + .3rem);transform:translateY(-.625rem);transition-duration:var(--ifm-transition-fast);transition-property:opacity,transform,visibility;transition-timing-function:var(--ifm-transition-timing-default);visibility:hidden;z-index:var(--ifm-z-index-dropdown)}.menu__caret,.menu__link,.menu__list-item-collapsible{border-radius:.25rem;transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.dropdown__link{border-radius:.25rem;color:var(--ifm-dropdown-link-color);display:block;font-size:.875rem;margin-top:.2rem;padding:.25rem .5rem;white-space:nowrap}.dropdown__link--active,.dropdown__link:hover{background-color:var(--ifm-dropdown-hover-background-color);color:var(--ifm-dropdown-link-color);text-decoration:none}.dropdown__link--active,.dropdown__link--active:hover{--ifm-dropdown-link-color:var(--ifm-link-color)}.dropdown>.navbar__link:after{border-color:currentcolor transparent;border-style:solid;border-width:.4em .4em 0;content:"";margin-left:.3em;position:relative;top:2px;transform:translateY(-50%)}.footer{background-color:var(--ifm-footer-background-color);color:var(--ifm-footer-color);padding:var(--ifm-footer-padding-vertical) var(--ifm-footer-padding-horizontal)}.footer--dark{--ifm-footer-background-color:#303846;--ifm-footer-color:var(--ifm-footer-link-color);--ifm-footer-link-color:var(--ifm-color-secondary);--ifm-footer-title-color:var(--ifm-color-white)}.footer__links{margin-bottom:1rem}.footer__link-item{color:var(--ifm-footer-link-color);line-height:2}.footer__link-item:hover{color:var(--ifm-footer-link-hover-color)}.footer__link-separator{margin:0 var(--ifm-footer-link-horizontal-spacing)}.footer__logo{margin-top:1rem;max-width:var(--ifm-footer-logo-max-width)}.footer__title{color:var(--ifm-footer-title-color);font:700 var(--ifm-h4-font-size)/var(--ifm-heading-line-height) var(--ifm-font-family-base);margin-bottom:var(--ifm-heading-margin-bottom)}.menu,.navbar__link{font-weight:var(--ifm-font-weight-semibold)}.bp5-code,.bp5-code-block,.bp5-monospace-text,.bp5-running-text code,.bp5-running-text pre{font-family:monospace;text-transform:none}.bp5-button[class*=bp5-icon-]:before,.bp5-callout[class*=bp5-icon-]:before{line-height:1;font-family:blueprint-icons-16,sans-serif;font-style:normal;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-variant:normal}.docItemContainer_QBgl article>:first-child,.docItemContainer_QBgl header+*,.footer__item,label.bp5-label .bp5-control-group>.bp5-button-group,label.bp5-label .bp5-control-group>.bp5-html-select,label.bp5-label .bp5-control-group>.bp5-input,label.bp5-label .bp5-control-group>.bp5-popover-wrapper,label.bp5-label .bp5-control-group>.bp5-select,label.bp5-label .bp5-control-group>.bp5-slider{margin-top:0}.admonitionContent_Esg6>:last-child,.bp5-callout .bp5-heading:last-child,.bp5-non-ideal-state .bp5-heading:only-child,.bp5-non-ideal-state:empty:before,.bp5-non-ideal-state>:last-child,.bp5-select-popover .bp5-input-group,.collapsibleContent_yVEW>:last-child,.footer__items{margin-bottom:0}.bp5-input-group .bp5-button:empty,.bp5-list-unstyled li,.codeBlockStandalone_qlgt,[type=checkbox]{padding:0}.hero{align-items:center;background-color:var(--ifm-hero-background-color);color:var(--ifm-hero-text-color);display:flex}.hero--primary{--ifm-hero-background-color:var(--ifm-color-primary);--ifm-hero-text-color:var(--ifm-font-color-base-inverse)}.hero--dark{--ifm-hero-background-color:#303846;--ifm-hero-text-color:var(--ifm-color-white)}.hero__title,.title_PlBF{font-size:3rem}.bp5-tree-node-list,.menu__list{list-style:none;margin:0;padding-left:0}.menu__caret,.menu__link{padding:var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal)}.menu__list .menu__list{flex:0 0 100%;margin-top:.25rem;padding-left:var(--ifm-menu-link-padding-horizontal)}.menu__list-item:not(:first-child){margin-top:.25rem}.menu__list-item--collapsed .menu__list{height:0;overflow:hidden}.bp5-tree-node-caret.bp5-tree-node-caret-open,.details_jMJo[data-collapsed=false].isBrowser_YMID>summary:before,.details_jMJo[open]:not(.isBrowser_YMID)>summary:before,.menu__list-item--collapsed .menu__caret:before,.menu__list-item--collapsed .menu__link--sublist:after{transform:rotate(90deg)}.menu__list-item-collapsible{display:flex;flex-wrap:wrap;position:relative}.menu__caret:hover,.menu__link:hover,.menu__list-item-collapsible--active,.menu__list-item-collapsible:hover{background:var(--ifm-menu-color-background-hover)}.menu__list-item-collapsible .menu__link--active,.menu__list-item-collapsible .menu__link:hover{background:none!important}.menu__caret,.menu__link{align-items:center;display:flex}.navbar-sidebar,.navbar-sidebar__backdrop{opacity:0;transition-duration:var(--ifm-transition-fast);transition-timing-function:ease-in-out;left:0;bottom:0;top:0}.menu__link{color:var(--ifm-menu-color);flex:1;line-height:1.25}.menu__link:hover{color:var(--ifm-menu-color);text-decoration:none}.menu__caret:before,.menu__link--sublist-caret:after{content:"";filter:var(--ifm-menu-link-sublist-icon-filter);height:1.25rem;transform:rotate(180deg);transition:transform var(--ifm-transition-fast) linear;width:1.25rem}.menu__link--sublist-caret:after{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem;margin-left:auto;min-width:1.25rem}.menu__link--active,.menu__link--active:hover{color:var(--ifm-menu-color-active)}.navbar__brand,.navbar__link{color:var(--ifm-navbar-link-color)}.menu__link--active:not(.menu__link--sublist){background-color:var(--ifm-menu-color-background-active)}.menu__caret:before{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem}.navbar--dark,html[data-theme=dark]{--ifm-menu-link-sublist-icon-filter:invert(100%) sepia(94%) saturate(17%) hue-rotate(223deg) brightness(104%) contrast(98%)}.navbar{background-color:var(--ifm-navbar-background-color);box-shadow:var(--ifm-navbar-shadow);height:var(--ifm-navbar-height);padding:var(--ifm-navbar-padding-vertical) var(--ifm-navbar-padding-horizontal)}.bp5-alert-body,.bp5-multistep-dialog-panels,.bp5-tabs.bp5-vertical,.navbar,.navbar>.container,.navbar>.container-fluid{display:flex}.navbar--fixed-top{position:sticky;top:0;z-index:var(--ifm-z-index-fixed)}.navbar__inner{display:flex;flex-wrap:wrap;justify-content:space-between;width:100%}.navbar__brand{align-items:center;display:flex;margin-right:1rem;min-width:0}.navbar__brand:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.announcementBarContent_Jcns,.bp5-button-group .bp5-button.bp5-fill,.bp5-button-group.bp5-align-left .bp5-button-text,.bp5-button-group.bp5-align-right .bp5-button-text,.bp5-button-group.bp5-fill .bp5-button:not(.bp5-fixed),.bp5-button.bp5-align-left .bp5-button-text,.bp5-button.bp5-align-right .bp5-button-text,.bp5-control-group.bp5-fill>:not(.bp5-fixed),.bp5-control-group>.bp5-fill,.navbar__title{flex:1 1 auto}.navbar__toggle{display:none;margin-right:.5rem}.navbar__logo{flex:0 0 auto;height:2rem;margin-right:.5rem}.navbar__items{align-items:center;display:flex;flex:1;min-width:0}.navbar__items--center{flex:0 0 auto}.navbar__items--center .navbar__brand,label.bp5-label.bp5-inline .bp5-control-group>.bp5-button-group,label.bp5-label.bp5-inline .bp5-control-group>.bp5-html-select,label.bp5-label.bp5-inline .bp5-control-group>.bp5-input,label.bp5-label.bp5-inline .bp5-control-group>.bp5-popover-wrapper,label.bp5-label.bp5-inline .bp5-control-group>.bp5-select,label.bp5-label.bp5-inline .bp5-control-group>.bp5-slider{margin:0}.add-node-menu-list-item .content,.base-node-editor .form-row>div,.hero .container .hero-example,.navbar__items--center+.navbar__items--right,.visual-node-editor .edit-group-modal>header .text-wrapper{flex:1}.navbar__items--right{flex:0 0 auto;justify-content:flex-end}.navbar__items--right>:last-child{padding-right:0}.navbar__item{display:inline-block;padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.navbar__link--active,.navbar__link:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.navbar--dark,.navbar--primary{--ifm-menu-color:var(--ifm-color-gray-300);--ifm-navbar-link-color:var(--ifm-color-gray-100);--ifm-navbar-search-input-background-color:hsla(0,0%,100%,.1);--ifm-navbar-search-input-placeholder-color:hsla(0,0%,100%,.5);color:var(--ifm-color-white)}.navbar--dark{--ifm-navbar-background-color:#242526;--ifm-menu-color-background-active:hsla(0,0%,100%,.05);--ifm-navbar-search-input-color:var(--ifm-color-white)}.navbar--primary{--ifm-navbar-background-color:var(--ifm-color-primary);--ifm-navbar-link-hover-color:var(--ifm-color-white);--ifm-menu-color-active:var(--ifm-color-white);--ifm-navbar-search-input-color:var(--ifm-color-emphasis-500)}.navbar__search-input{-webkit-appearance:none;appearance:none;background:var(--ifm-navbar-search-input-background-color) var(--ifm-navbar-search-input-icon) no-repeat .75rem center/1rem 1rem;border:none;border-radius:2rem;color:var(--ifm-navbar-search-input-color);cursor:text;display:inline-block;font-size:.9rem;height:2rem;padding:0 .5rem 0 2.25rem;width:12.5rem}.navbar__search-input::placeholder{color:var(--ifm-navbar-search-input-placeholder-color)}.navbar-sidebar{background-color:var(--ifm-navbar-background-color);box-shadow:var(--ifm-global-shadow-md);position:fixed;transform:translate3d(-100%,0,0);transition-property:opacity,visibility,transform;visibility:hidden;width:var(--ifm-navbar-sidebar-width)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar__items{transform:translateZ(0)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar--show .navbar-sidebar__backdrop{opacity:1;visibility:visible}.navbar-sidebar__backdrop{background-color:rgba(0,0,0,.6);position:fixed;right:0;transition-property:opacity,visibility;visibility:hidden}.navbar-sidebar__brand{align-items:center;box-shadow:var(--ifm-navbar-shadow);display:flex;flex:1;height:var(--ifm-navbar-height);padding:var(--ifm-navbar-padding-vertical) var(--ifm-navbar-padding-horizontal)}.navbar-sidebar__items{display:flex;height:calc(100% - var(--ifm-navbar-height));transition:transform var(--ifm-transition-fast) ease-in-out}.navbar-sidebar__items--show-secondary{transform:translate3d(calc((var(--ifm-navbar-sidebar-width))*-1),0,0)}.navbar-sidebar__item{flex-shrink:0;padding:.5rem;width:calc(var(--ifm-navbar-sidebar-width))}.navbar-sidebar__back{background:var(--ifm-menu-color-background-active);font-size:15px;font-weight:var(--ifm-button-font-weight);margin:0 0 .2rem -.5rem;padding:.6rem 1.5rem;position:relative;text-align:left;top:-.5rem;width:calc(100% + 1rem)}.navbar-sidebar__close{display:flex;margin-left:auto}.pagination{column-gap:var(--ifm-pagination-page-spacing);display:flex;font-size:var(--ifm-pagination-font-size);padding-left:0}.pagination--sm{--ifm-pagination-font-size:0.8rem;--ifm-pagination-padding-horizontal:0.8rem;--ifm-pagination-padding-vertical:0.2rem}.pagination--lg{--ifm-pagination-font-size:1.2rem;--ifm-pagination-padding-horizontal:1.2rem;--ifm-pagination-padding-vertical:0.3rem}.bp5-button-group,.pagination__item,.star-hint,.star-hint .star-wrapper{display:inline-flex}.pagination__item>span{padding:var(--ifm-pagination-padding-vertical)}.pagination__item--active .pagination__link{color:var(--ifm-pagination-color-active)}.pagination__item--active .pagination__link,.pagination__item:not(.pagination__item--active):hover .pagination__link{background:var(--ifm-pagination-item-active-background)}.pagination__item--disabled,.pagination__item[disabled]{opacity:.25;pointer-events:none}.pagination__link{border-radius:var(--ifm-pagination-border-radius);color:var(--ifm-font-color-base);display:inline-block;padding:var(--ifm-pagination-padding-vertical) var(--ifm-pagination-padding-horizontal);transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.bp5-breadcrumb:hover,.pagination__link:hover,.sidebarItemLink_ei87:hover{text-decoration:none}.pagination-nav{grid-gap:var(--ifm-spacing-horizontal);display:grid;gap:var(--ifm-spacing-horizontal);grid-template-columns:repeat(2,1fr)}.pagination-nav__link{border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-pagination-nav-border-radius);display:block;height:100%;line-height:var(--ifm-heading-line-height);padding:var(--ifm-global-spacing);transition:border-color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pagination-nav__link:hover{border-color:var(--ifm-pagination-nav-color-hover);text-decoration:none}.pagination-nav__link--next{grid-column:2/3;text-align:right}.pagination-nav__label{font-size:var(--ifm-h4-font-size);font-weight:var(--ifm-heading-font-weight);word-break:break-word}.pagination-nav__link--prev .pagination-nav__label:before{content:"« "}.pagination-nav__link--next .pagination-nav__label:after{content:" »"}.pagination-nav__sublabel{color:var(--ifm-color-content-secondary);font-size:var(--ifm-h5-font-size);font-weight:var(--ifm-font-weight-semibold);margin-bottom:.25rem}.pills__item,.tabs{font-weight:var(--ifm-font-weight-bold)}.pills{display:flex;gap:var(--ifm-pills-spacing);padding-left:0}.pills__item,video{display:inline-block}.pills__item{border-radius:.5rem;cursor:pointer;padding:.25rem 1rem;transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pills__item--active{color:var(--ifm-pills-color-active)}.pills__item--active,.pills__item:not(.pills__item--active):hover{background:var(--ifm-pills-color-background-active)}.pills--block{justify-content:stretch}.pills--block .pills__item{flex-grow:1;text-align:center}.tabs{color:var(--ifm-tabs-color);display:flex;margin-bottom:0;overflow-x:auto;padding-left:0}.bp5-dialog-header .bp5-heading,.bp5-drawer-header .bp5-heading,.bp5-text-overflow-ellipsis,.omnibar-item .description{word-wrap:normal;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.tabs__item{border-bottom:3px solid transparent;border-radius:var(--ifm-global-radius);cursor:pointer;display:inline-flex;padding:var(--ifm-tabs-padding-vertical) var(--ifm-tabs-padding-horizontal);transition:background-color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.tabs__item--active{border-bottom-color:var(--ifm-tabs-color-active-border);border-bottom-left-radius:0;border-bottom-right-radius:0;color:var(--ifm-tabs-color-active)}.tabs__item:hover{background-color:var(--ifm-hover-overlay)}.tabs--block{justify-content:stretch}.tabs--block .tabs__item{flex-grow:1;justify-content:center}html[data-theme=dark]{--ifm-color-scheme:dark;--ifm-color-emphasis-0:var(--ifm-color-gray-1000);--ifm-color-emphasis-100:var(--ifm-color-gray-900);--ifm-color-emphasis-200:var(--ifm-color-gray-800);--ifm-color-emphasis-300:var(--ifm-color-gray-700);--ifm-color-emphasis-400:var(--ifm-color-gray-600);--ifm-color-emphasis-600:var(--ifm-color-gray-400);--ifm-color-emphasis-700:var(--ifm-color-gray-300);--ifm-color-emphasis-800:var(--ifm-color-gray-200);--ifm-color-emphasis-900:var(--ifm-color-gray-100);--ifm-color-emphasis-1000:var(--ifm-color-gray-0);--ifm-background-color:#1b1b1d;--ifm-background-surface-color:#242526;--ifm-hover-overlay:hsla(0,0%,100%,.05);--ifm-color-content:#e3e3e3;--ifm-color-content-secondary:#fff;--ifm-breadcrumb-separator-filter:invert(64%) sepia(11%) saturate(0%) hue-rotate(149deg) brightness(99%) contrast(95%);--ifm-code-background:hsla(0,0%,100%,.1);--ifm-scrollbar-track-background-color:#444;--ifm-scrollbar-thumb-background-color:#686868;--ifm-scrollbar-thumb-hover-background-color:#7a7a7a;--ifm-table-stripe-background:hsla(0,0%,100%,.07);--ifm-toc-border-color:var(--ifm-color-emphasis-200);--ifm-color-primary-contrast-background:#102445;--ifm-color-primary-contrast-foreground:#ebf2fc;--ifm-color-secondary-contrast-background:#474748;--ifm-color-secondary-contrast-foreground:#fdfdfe;--ifm-color-success-contrast-background:#003100;--ifm-color-success-contrast-foreground:#e6f6e6;--ifm-color-info-contrast-background:#193c47;--ifm-color-info-contrast-foreground:#eef9fd;--ifm-color-warning-contrast-background:#4d3800;--ifm-color-warning-contrast-foreground:#fff8e6;--ifm-color-danger-contrast-background:#4b1113;--ifm-color-danger-contrast-foreground:#ffebec}#nprogress .bar{background:var(--docusaurus-progress-bar-color);height:2px;left:0;position:fixed;top:0;width:100%;z-index:1031}#nprogress .peg{box-shadow:0 0 10px var(--docusaurus-progress-bar-color),0 0 5px var(--docusaurus-progress-bar-color);height:100%;opacity:1;position:absolute;right:0;transform:rotate(3deg) translateY(-4px);width:100px}[data-theme=dark]{--ifm-color-primary:#25c2a0;--ifm-color-primary-dark:#21af90;--ifm-color-primary-darker:#1fa588;--ifm-color-primary-darkest:#1a8870;--ifm-color-primary-light:#29d5b0;--ifm-color-primary-lighter:#32d8b4;--ifm-color-primary-lightest:#4fddbf;--docusaurus-highlighted-code-line-bg:rgba(0,0,0,.3)}mark{background-color:#d7f0ff}video{height:100%;left:0;right:0;z-index:0}.videos-container{display:flex;filter:blur(1px);height:100%;object-fit:cover;opacity:.1;position:absolute}.bp5-button.bp5-loading,.bp5-callout,.bp5-control-group .bp5-button,.bp5-control-group .bp5-html-select,.bp5-control-group .bp5-input,.bp5-control-group .bp5-select,.react-resizable{position:relative}.bp5-control-group .bp5-input.bp5-disabled,.bp5-control-group .bp5-input:disabled,.bp5-control-group .bp5-input[readonly],.bp5-input-group>.bp5-icon,.bp5-input-group>.bp5-input-left-container,.bp5-slider-handle:focus,.container{z-index:1}*,:after,:before{box-sizing:inherit}body{color:#1c2127;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,blueprint-icons-16,sans-serif;font-weight:400;letter-spacing:0;text-transform:none}.bp5-heading,strong{font-weight:600}.bp5-text-small,small{font-size:12px}::selection{background:rgba(125,188,255,.6)}.bp5-breadcrumb,.bp5-breadcrumbs-collapsed,.bp5-button .bp5-icon,.bp5-button .bp5-icon-large,.bp5-button .bp5-icon-standard,.bp5-dark .bp5-tooltip .bp5-text-muted,.bp5-editable-text-placeholder>.bp5-editable-text-content,.bp5-html-select .bp5-icon,.bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:not(:hover):not(:focus),.bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:not(:hover):not(:focus) .bp5-icon,.bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:not(:hover):not(:focus) .bp5-icon-large,.bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:not(:hover):not(:focus) .bp5-icon-standard,.bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:not(:hover):not(:focus),.bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:not(:hover):not(:focus) .bp5-icon,.bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:not(:hover):not(:focus) .bp5-icon-large,.bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:not(:hover):not(:focus) .bp5-icon-standard,.bp5-input-group>.bp5-icon,.bp5-input-group>.bp5-input-left-container>.bp5-icon,.bp5-menu-item .bp5-menu-item-icon,.bp5-menu-item .bp5-menu-item-label,.bp5-menu-item .bp5-submenu-icon,.bp5-menu-item:before,.bp5-select .bp5-icon,.bp5-tag.bp5-minimal:not([class*=bp5-intent-]) .bp5-tag-remove,.bp5-text-muted,.bp5-tooltip.bp5-dark .bp5-text-muted,.bp5-tree .bp5-icon,.bp5-tree .bp5-icon-large,.bp5-tree .bp5-icon-standard{color:#5f6b7c}.bp5-text-disabled,a.bp5-button.bp5-disabled{color:rgba(95,107,124,.6)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary,.bp5-button.bp5-minimal.bp5-intent-primary,.bp5-button.bp5-outlined.bp5-intent-primary,.bp5-callout.bp5-intent-primary .bp5-heading,.bp5-callout.bp5-intent-primary>.bp5-icon:first-child,.bp5-callout.bp5-intent-primary[class*=bp5-icon-]:before,.bp5-form-group.bp5-intent-primary .bp5-form-group-sub-label,.bp5-form-group.bp5-intent-primary .bp5-form-helper-text,.bp5-html-select.bp5-minimal select.bp5-intent-primary,.bp5-icon-large.bp5-intent-primary,.bp5-icon-standard.bp5-intent-primary,.bp5-icon.bp5-intent-primary,.bp5-input-group.bp5-intent-primary>.bp5-icon,.bp5-select.bp5-minimal select.bp5-intent-primary,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-] .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-] .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover:before,a,a:hover{color:#215db0}.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]),.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-danger:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-success:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-warning:before,.bp5-dark a .bp5-icon,.bp5-dark a .bp5-icon-large,.bp5-dark a .bp5-icon-standard,.bp5-dark a code,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected .bp5-menu-item-label,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-danger .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-danger .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-danger:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-success .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-success .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-success:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-warning .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-warning .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-warning:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-] .bp5-menu-item-label,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active .bp5-menu-item-label,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover .bp5-menu-item-label,a .bp5-icon,a .bp5-icon-large,a .bp5-icon-standard,a code,a>.bp5-dark .bp5-code,a>.bp5-dark .bp5-running-text code{color:inherit}.bp5-code,.bp5-dark .bp5-tooltip .bp5-code,.bp5-dark .bp5-tooltip .bp5-running-text code,.bp5-running-text code,.bp5-tooltip.bp5-dark .bp5-code,.bp5-tooltip.bp5-dark .bp5-running-text code{background:hsla(0,0%,100%,.7);box-shadow:inset 0 0 0 1px rgba(17,20,24,.2);color:#5f6b7c}a>.bp5-code,a>.bp5-running-text code{color:#2d72d2}.bp5-code-block,.bp5-dark .bp5-tooltip .bp5-code-block,.bp5-dark .bp5-tooltip .bp5-running-text pre,.bp5-running-text pre,.bp5-tooltip.bp5-dark .bp5-code-block,.bp5-tooltip.bp5-dark .bp5-running-text pre{background:hsla(0,0%,100%,.7);box-shadow:inset 0 0 0 1px rgba(17,20,24,.15);color:#1c2127}.bp5-code-block>code,.bp5-dark .bp5-code-block>code,.bp5-dark .bp5-running-text pre>code,.bp5-dark .bp5-tooltip .bp5-code-block>code,.bp5-dark .bp5-tooltip .bp5-running-text pre>code,.bp5-running-text pre>code,.bp5-tooltip .bp5-code-block>code,.bp5-tooltip .bp5-running-text pre>code,.bp5-tooltip.bp5-dark .bp5-code-block>code,.bp5-tooltip.bp5-dark .bp5-running-text pre>code{background:none;box-shadow:none;color:inherit}.bp5-dark .bp5-tooltip .bp5-key,.bp5-dark .bp5-tooltip .bp5-running-text kbd,.bp5-key,.bp5-running-text kbd,.bp5-tooltip.bp5-dark .bp5-key,.bp5-tooltip.bp5-dark .bp5-running-text kbd{background:#fff;box-shadow:0 0 0 1px rgba(17,20,24,.1),0 1px 1px rgba(17,20,24,.2);color:#5f6b7c}.bp5-card,.bp5-elevation-0{box-shadow:0 0 0 1px rgba(17,20,24,.15)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success,.bp5-button.bp5-minimal.bp5-intent-success,.bp5-button.bp5-outlined.bp5-intent-success,.bp5-callout.bp5-intent-success .bp5-heading,.bp5-callout.bp5-intent-success>.bp5-icon:first-child,.bp5-callout.bp5-intent-success[class*=bp5-icon-]:before,.bp5-dark .bp5-tooltip .bp5-icon-large.bp5-intent-success,.bp5-dark .bp5-tooltip .bp5-icon-standard.bp5-intent-success,.bp5-dark .bp5-tooltip .bp5-icon.bp5-intent-success,.bp5-form-group.bp5-intent-success .bp5-form-group-sub-label,.bp5-form-group.bp5-intent-success .bp5-form-helper-text,.bp5-html-select.bp5-minimal select.bp5-intent-success,.bp5-icon-large.bp5-intent-success,.bp5-icon-standard.bp5-intent-success,.bp5-icon.bp5-intent-success,.bp5-input-group.bp5-intent-success>.bp5-icon,.bp5-menu-item.bp5-intent-success,.bp5-select.bp5-minimal select.bp5-intent-success,.bp5-tag.bp5-minimal.bp5-intent-success .bp5-tag-remove,.bp5-tooltip.bp5-dark .bp5-icon-large.bp5-intent-success,.bp5-tooltip.bp5-dark .bp5-icon-standard.bp5-intent-success,.bp5-tooltip.bp5-dark .bp5-icon.bp5-intent-success{color:#1c6e42}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning,.bp5-button.bp5-minimal.bp5-intent-warning,.bp5-button.bp5-outlined.bp5-intent-warning,.bp5-callout.bp5-intent-warning .bp5-heading,.bp5-callout.bp5-intent-warning>.bp5-icon:first-child,.bp5-callout.bp5-intent-warning[class*=bp5-icon-]:before,.bp5-dark .bp5-tooltip .bp5-icon-large.bp5-intent-warning,.bp5-dark .bp5-tooltip .bp5-icon-standard.bp5-intent-warning,.bp5-dark .bp5-tooltip .bp5-icon.bp5-intent-warning,.bp5-form-group.bp5-intent-warning .bp5-form-group-sub-label,.bp5-form-group.bp5-intent-warning .bp5-form-helper-text,.bp5-html-select.bp5-minimal select.bp5-intent-warning,.bp5-icon-large.bp5-intent-warning,.bp5-icon-standard.bp5-intent-warning,.bp5-icon.bp5-intent-warning,.bp5-input-group.bp5-intent-warning>.bp5-icon,.bp5-menu-item.bp5-intent-warning,.bp5-select.bp5-minimal select.bp5-intent-warning,.bp5-tag.bp5-minimal.bp5-intent-warning .bp5-tag-remove,.bp5-tooltip.bp5-dark .bp5-icon-large.bp5-intent-warning,.bp5-tooltip.bp5-dark .bp5-icon-standard.bp5-intent-warning,.bp5-tooltip.bp5-dark .bp5-icon.bp5-intent-warning{color:#935610}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger,.bp5-button.bp5-minimal.bp5-intent-danger,.bp5-callout.bp5-intent-danger .bp5-heading,.bp5-callout.bp5-intent-danger>.bp5-icon:first-child,.bp5-callout.bp5-intent-danger[class*=bp5-icon-]:before,.bp5-dark .bp5-tooltip .bp5-icon-large.bp5-intent-danger,.bp5-dark .bp5-tooltip .bp5-icon-standard.bp5-intent-danger,.bp5-dark .bp5-tooltip .bp5-icon.bp5-intent-danger,.bp5-form-group.bp5-intent-danger .bp5-form-group-sub-label,.bp5-form-group.bp5-intent-danger .bp5-form-helper-text,.bp5-html-select.bp5-minimal select.bp5-intent-danger,.bp5-icon-large.bp5-intent-danger,.bp5-icon-standard.bp5-intent-danger,.bp5-icon.bp5-intent-danger,.bp5-input-group.bp5-intent-danger>.bp5-icon,.bp5-menu-item.bp5-intent-danger,.bp5-select.bp5-minimal select.bp5-intent-danger,.bp5-tag.bp5-minimal.bp5-intent-danger .bp5-tag-remove,.bp5-tooltip.bp5-dark .bp5-icon-large.bp5-intent-danger,.bp5-tooltip.bp5-dark .bp5-icon-standard.bp5-intent-danger,.bp5-tooltip.bp5-dark .bp5-icon.bp5-intent-danger{color:#ac2f33}.bp5-heading{color:#1c2127;margin:0 0 10px;padding:0}.bp5-dark,.bp5-dark .bp5-breadcrumb-current,.bp5-dark .bp5-button:not([class*=bp5-intent-]).bp5-active,.bp5-dark .bp5-button:not([class*=bp5-intent-]):active,.bp5-dark .bp5-button:not([class*=bp5-intent-]):hover,.bp5-dark .bp5-control,.bp5-dark .bp5-dialog-step-viewed:not(.bp5-active) .bp5-dialog-step-title,.bp5-dark .bp5-file-input.bp5-file-input-has-selection .bp5-file-upload-input,.bp5-dark .bp5-heading,.bp5-dark .bp5-html-select .bp5-icon:hover,.bp5-dark .bp5-html-select select.bp5-active,.bp5-dark .bp5-html-select select:active,.bp5-dark .bp5-html-select select:hover,.bp5-dark .bp5-menu-header>h6,.bp5-dark .bp5-menu-item.bp5-active .bp5-menu-item-label,.bp5-dark .bp5-menu-item:active .bp5-menu-item-label,.bp5-dark .bp5-running-text h1,.bp5-dark .bp5-running-text h2,.bp5-dark .bp5-running-text h3,.bp5-dark .bp5-running-text h4,.bp5-dark .bp5-running-text h5,.bp5-dark .bp5-running-text h6,.bp5-dark .bp5-running-text table td,.bp5-dark .bp5-running-text table th,.bp5-dark .bp5-select .bp5-icon:hover,.bp5-dark .bp5-select select.bp5-active,.bp5-dark .bp5-select select:active,.bp5-dark .bp5-select select:hover,.bp5-dark .bp5-tab,.bp5-dark .bp5-tag-input .bp5-input-ghost,.bp5-dark .bp5-tree-node-caret:hover,.bp5-dark label.bp5-label,.bp5-dark table.bp5-html-table td,.bp5-dark table.bp5-html-table th,.bp5-running-text .bp5-dark table td,.bp5-running-text .bp5-dark table th,.bp5-tag-input.bp5-dark .bp5-input-ghost,.bp5-tooltip .bp5-heading,.bp5-tooltip .bp5-popover-content{color:#f6f7f9}.bp5-running-text h1,h1.bp5-heading{font-size:36px;line-height:40px}.bp5-running-text h2,h2.bp5-heading{font-size:28px;line-height:32px}.bp5-running-text h3,h3.bp5-heading{font-size:22px;line-height:25px}.bp5-running-text h4,h4.bp5-heading{font-size:18px;line-height:21px}.bp5-running-text h5,h5.bp5-heading{font-size:16px;line-height:19px}.bp5-running-text h6,h6.bp5-heading{font-size:14px;line-height:16px}.bp5-ui-text{font-size:14px;font-weight:400;letter-spacing:0;line-height:1.28581;text-transform:none}.bp5-running-text{font-size:14px;line-height:1.5}.bp5-running-text h1,.bp5-running-text h2,.bp5-running-text h3,.bp5-running-text h4,.bp5-running-text h5,.bp5-running-text h6{color:#1c2127;font-weight:600;margin-bottom:20px;margin-top:40px}.bp5-running-text hr{border:none;border-bottom:1px solid rgba(17,20,24,.15);margin:20px 0}.bp5-running-text p{margin:0 0 10px;padding:0}.bp5-control.bp5-large,.bp5-text-large{font-size:16px}a:hover{cursor:pointer}.bp5-code,.bp5-running-text code{border-radius:2px;font-size:smaller;padding:2px 5px}.bp5-code-block,.bp5-running-text pre{word-wrap:break-word;border-radius:2px;display:block;font-size:13px;line-height:1.4;margin:10px 0;padding:13px 15px 12px;word-break:break-all}.bp5-alert-contents,.bp5-toast-message{word-break:break-word}.bp5-code-block>code,.bp5-running-text pre>code{font-size:inherit;padding:0}.bp5-key,.bp5-running-text kbd{align-items:center;border-radius:2px;display:inline-flex;font-family:inherit;font-size:12px;height:24px;justify-content:center;line-height:24px;min-width:24px;padding:2px 4px;vertical-align:middle}.bp5-breadcrumb .bp5-icon,.bp5-key .bp5-icon,.bp5-key .bp5-icon-large,.bp5-key .bp5-icon-standard,.bp5-key-combo:before,.bp5-key-combo>*,.bp5-running-text kbd .bp5-icon,.bp5-running-text kbd .bp5-icon-large,.bp5-running-text kbd .bp5-icon-standard,.bp5-tag-input .bp5-tag-input-values:before,.bp5-tag-input .bp5-tag-input-values>*,.fib-btn,input.input{margin-right:5px}.bp5-blockquote,.bp5-running-text blockquote{border-left:4px solid rgba(171,179,191,.5);margin:0 0 10px;padding:0 20px}.bp5-dark .bp5-blockquote,.bp5-dark .bp5-running-text blockquote,.bp5-running-text .bp5-dark blockquote{border-color:rgba(115,128,145,.5)}.bp5-list,.bp5-running-text ol,.bp5-running-text ul{margin:10px 0;padding-left:30px}.bp5-form-group .bp5-form-group-sub-label,.bp5-form-group label.bp5-label,.bp5-list li:not(:last-child),.bp5-running-text ol li:not(:last-child),.bp5-running-text ul li:not(:last-child){margin-bottom:5px}.bp5-form-group .bp5-form-helper-text,.bp5-label .bp5-menu,.bp5-list ol,.bp5-list ul,.bp5-running-text ol ol,.bp5-running-text ol ul,.bp5-running-text ul ol,.bp5-running-text ul ul,label.bp5-label .bp5-button-group,label.bp5-label .bp5-control-group{margin-top:5px}.bp5-list-unstyled,.output-jsx>main ul,.output-log>main ul{list-style:none;margin:0;padding:0}.bp5-dark{color-scheme:dark}.bp5-dark .bp5-breadcrumb,.bp5-dark .bp5-breadcrumbs-collapsed,.bp5-dark .bp5-button:not([class*=bp5-intent-]) .bp5-icon-large:not([class*=bp5-intent-]),.bp5-dark .bp5-button:not([class*=bp5-intent-]) .bp5-icon-standard:not([class*=bp5-intent-]),.bp5-dark .bp5-button:not([class*=bp5-intent-]) .bp5-icon:not([class*=bp5-intent-]),.bp5-dark .bp5-button:not([class*=bp5-intent-])[class*=bp5-icon-]:before,.bp5-dark .bp5-callout.bp5-callout-icon>.bp5-icon:first-child,.bp5-dark .bp5-callout[class*=bp5-icon-]:before,.bp5-dark .bp5-dialog-header .bp5-icon,.bp5-dark .bp5-dialog-header .bp5-icon-large,.bp5-dark .bp5-drawer-header .bp5-icon,.bp5-dark .bp5-drawer-header .bp5-icon-large,.bp5-dark .bp5-editable-text-placeholder>.bp5-editable-text-content,.bp5-dark .bp5-text-muted{color:#abb3bf}.bp5-dark .bp5-breadcrumb.bp5-disabled,.bp5-dark .bp5-control.bp5-disabled,.bp5-dark .bp5-dialog-step-title,.bp5-dark .bp5-html-select option:disabled,.bp5-dark .bp5-input-group.bp5-disabled .bp5-icon,.bp5-dark .bp5-select option:disabled,.bp5-dark .bp5-tab[aria-disabled=true],.bp5-dark .bp5-text-disabled,.bp5-dark label.bp5-label.bp5-disabled,.bp5-dark label.bp5-label.bp5-disabled .bp5-text-muted,.bp5-tooltip .bp5-text-disabled{color:rgba(171,179,191,.6)}.bp5-dark .bp5-divider,.bp5-dark .bp5-menu-divider,.bp5-dark .bp5-menu-header,.bp5-dark .bp5-running-text hr,.bp5-tooltip .bp5-running-text hr{border-color:hsla(0,0%,100%,.2)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-primary,.bp5-dark .bp5-callout.bp5-intent-primary .bp5-heading,.bp5-dark .bp5-callout.bp5-intent-primary>.bp5-icon:first-child,.bp5-dark .bp5-callout.bp5-intent-primary[class*=bp5-icon-]:before,.bp5-dark .bp5-icon-large.bp5-intent-primary,.bp5-dark .bp5-icon-standard.bp5-intent-primary,.bp5-dark .bp5-icon.bp5-intent-primary,.bp5-dark a,.bp5-dark a:hover{color:#8abbff}.bp5-dark .bp5-code,.bp5-dark .bp5-running-text code,.bp5-tooltip .bp5-code,.bp5-tooltip .bp5-running-text code{background:rgba(17,20,24,.3);box-shadow:inset 0 0 0 1px rgba(17,20,24,.4);color:#abb3bf}.bp5-dark .bp5-code-block,.bp5-dark .bp5-running-text pre,.bp5-tooltip .bp5-code-block,.bp5-tooltip .bp5-running-text pre{background:rgba(17,20,24,.3);box-shadow:inset 0 0 0 1px rgba(17,20,24,.4);color:#f6f7f9}.bp5-dark .bp5-key,.bp5-dark .bp5-running-text kbd,.bp5-tooltip .bp5-key,.bp5-tooltip .bp5-running-text kbd{background:#383e47;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 1px 1px 0 rgba(17,20,24,.4);color:#abb3bf}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-success,.bp5-dark .bp5-callout.bp5-intent-success .bp5-heading,.bp5-dark .bp5-callout.bp5-intent-success>.bp5-icon:first-child,.bp5-dark .bp5-callout.bp5-intent-success[class*=bp5-icon-]:before,.bp5-dark .bp5-icon-large.bp5-intent-success,.bp5-dark .bp5-icon-standard.bp5-intent-success,.bp5-dark .bp5-icon.bp5-intent-success{color:#72ca9b}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-warning,.bp5-dark .bp5-callout.bp5-intent-warning .bp5-heading,.bp5-dark .bp5-callout.bp5-intent-warning>.bp5-icon:first-child,.bp5-dark .bp5-callout.bp5-intent-warning[class*=bp5-icon-]:before,.bp5-dark .bp5-icon-large.bp5-intent-warning,.bp5-dark .bp5-icon-standard.bp5-intent-warning,.bp5-dark .bp5-icon.bp5-intent-warning{color:#fbb360}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-danger,.bp5-dark .bp5-callout.bp5-intent-danger .bp5-heading,.bp5-dark .bp5-callout.bp5-intent-danger>.bp5-icon:first-child,.bp5-dark .bp5-callout.bp5-intent-danger[class*=bp5-icon-]:before,.bp5-dark .bp5-icon-large.bp5-intent-danger,.bp5-dark .bp5-icon-standard.bp5-intent-danger,.bp5-dark .bp5-icon.bp5-intent-danger{color:#fa999c}:focus{-moz-outline-radius:6px;outline:rgba(45,114,210,.6) solid 2px;outline-offset:2px}.bp5-focus-disabled :focus:not(.bp5-focus-style-manager-ignore *),.bp5-focus-disabled :focus:not(.bp5-focus-style-manager-ignore *)~.bp5-control-indicator,.bp5-input-ghost:focus{outline:0!important}.bp5-alert{max-width:400px;padding:20px}.bp5-alert-body .bp5-icon{font-size:40px;margin-right:20px;margin-top:0}.bp5-alert-footer{display:flex;flex-direction:row-reverse;margin-top:10px}.bp5-alert-footer .bp5-button,.bp5-dialog-footer-actions .bp5-button{margin-left:10px}.bp5-breadcrumbs{cursor:default;flex-wrap:wrap;height:30px;list-style:none;margin:0;padding:0}.bp5-breadcrumbs,.bp5-breadcrumbs>li,.bp5-tree-node-secondary-label .bp5-popover-target,.bp5-tree-node-secondary-label .bp5-popover-wrapper{align-items:center;display:flex}.bp5-breadcrumbs>li:after{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='m10.71 7.29-4-4a1.003 1.003 0 0 0-1.42 1.42L8.59 8 5.3 11.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71l4-4c.18-.18.29-.43.29-.71 0-.28-.11-.53-.29-.71z' fill='%235f6b7c'/%3E%3C/svg%3E");content:"";display:block;height:16px;margin:0 5px;width:16px}.bp5-breadcrumbs>li:last-of-type:after,.bp5-collapse .bp5-collapse-body[aria-hidden=true]{display:none}.bp5-breadcrumb,.bp5-breadcrumb-current,.bp5-breadcrumbs-collapsed{align-items:center;display:inline-flex;font-size:16px}.bp5-breadcrumb.bp5-disabled,.bp5-control.bp5-disabled,.bp5-tab[aria-disabled=true],.bp5-tree-node.bp5-disabled .bp5-tree-node-caret,.bp5-tree-node.bp5-disabled .bp5-tree-node-icon{color:rgba(95,107,124,.6);cursor:not-allowed}.bp5-breadcrumb-current{color:inherit;font-weight:600}.bp5-breadcrumb-current .bp5-input{font-size:inherit;font-weight:inherit;vertical-align:baseline}.bp5-breadcrumbs-collapsed{background:rgba(143,153,168,.15);border:none;border-radius:2px;cursor:pointer;margin-right:2px;padding:1px 5px;vertical-align:text-bottom}.bp5-breadcrumbs-collapsed:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 6.03a2 2 0 1 0 0 4 2 2 0 1 0 0-4zm12 0a2 2 0 1 0 0 4 2 2 0 1 0 0-4zm-6 0a2 2 0 1 0 0 4 2 2 0 1 0 0-4z' fill='%235f6b7c'/%3E%3C/svg%3E") 50% no-repeat;content:"";display:block;height:16px;width:16px}.bp5-breadcrumbs-collapsed:hover{background:rgba(143,153,168,.3);color:#1c2127;text-decoration:none}.bp5-dark .bp5-breadcrumbs>li:after{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='m10.71 7.29-4-4a1.003 1.003 0 0 0-1.42 1.42L8.59 8 5.3 11.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71l4-4c.18-.18.29-.43.29-.71 0-.28-.11-.53-.29-.71z' fill='%23abb3bf'/%3E%3C/svg%3E");color:#abb3bf}.bp5-dark .bp5-breadcrumbs-collapsed{background:rgba(143,153,168,.2)}.bp5-dark .bp5-breadcrumbs-collapsed:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 6.03a2 2 0 1 0 0 4 2 2 0 1 0 0-4zm12 0a2 2 0 1 0 0 4 2 2 0 1 0 0-4zm-6 0a2 2 0 1 0 0 4 2 2 0 1 0 0-4z' fill='%23abb3bf'/%3E%3C/svg%3E") 50% no-repeat}.bp5-dark .bp5-breadcrumbs-collapsed:hover{background:rgba(143,153,168,.3);color:#f6f7f9}.bp5-button{align-items:center;border:none;border-radius:2px;cursor:pointer;display:inline-flex;flex-direction:row;font-size:14px;justify-content:center;min-height:30px;min-width:30px;padding:5px 10px;text-align:left;vertical-align:middle}.bp5-button>*,.bp5-control-group>*,.bp5-html-select select>*,.bp5-key-combo>*,.bp5-menu-item>*,.bp5-select select>*,.bp5-tag-input>*,.bp5-tag>*{flex-grow:0;flex-shrink:0}.bp5-button>.bp5-fill,.bp5-control-group>.bp5-fill,.bp5-html-select select>.bp5-fill,.bp5-key-combo>.bp5-fill,.bp5-non-ideal-state.bp5-non-ideal-state-horizontal>.bp5-fill,.bp5-non-ideal-state>.bp5-fill,.bp5-select select>.bp5-fill,.bp5-tag-input .bp5-tag-input-values>.bp5-fill,.bp5-tag-input>.bp5-tag-input-values,.bp5-tag>.bp5-fill{flex-grow:1;flex-shrink:1}.bp5-button:before,.bp5-button>*,.bp5-html-select select:before,.bp5-html-select select>*,.bp5-large .bp5-tag:before,.bp5-large .bp5-tag>*,.bp5-menu-item:before,.bp5-menu-item>*,.bp5-select select:before,.bp5-select select>*,.bp5-tab-icon,.bp5-tag.bp5-large:before,.bp5-tag.bp5-large>*{margin-right:7px}.bp5-button.bp5-large:empty:before,.bp5-button.bp5-large>:last-child,.bp5-button:empty:before,.bp5-button>:last-child,.bp5-html-select select:empty:before,.bp5-html-select select>:last-child,.bp5-key-combo:empty:before,.bp5-key-combo>:last-child,.bp5-large .bp5-button:empty:before,.bp5-large .bp5-button>:last-child,.bp5-large .bp5-tag:empty:before,.bp5-large .bp5-tag>:last-child,.bp5-menu-item:empty:before,.bp5-menu-item>:last-child,.bp5-non-ideal-state.bp5-non-ideal-state-horizontal:empty:before,.bp5-non-ideal-state.bp5-non-ideal-state-horizontal>:last-child,.bp5-select select:empty:before,.bp5-select select>:last-child,.bp5-tag-input .bp5-tag-input-values:empty:before,.bp5-tag-input .bp5-tag-input-values>:last-child,.bp5-tag-input.bp5-large:empty:before,.bp5-tag-input.bp5-large>:last-child,.bp5-tag.bp5-large:empty:before,.bp5-tag.bp5-large>:last-child,.bp5-tag:empty:before,.bp5-tag>:last-child{margin-right:0}.bp5-button.bp5-disabled,.bp5-button:disabled,.bp5-input-group.bp5-disabled,.bp5-tag-input .bp5-input-ghost.bp5-disabled,.bp5-tag-input .bp5-input-ghost:disabled,.toggleButtonDisabled_FVOf{cursor:not-allowed}.bp5-button-group.bp5-fill,.bp5-button.bp5-fill,.bp5-tag.bp5-fill,.docMainContainer_L3kR,.docPage_ShNT{display:flex;width:100%}.bp5-button:not([class*=bp5-intent-]){background-color:#f6f7f9;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.1);color:#1c2127}.bp5-button:not([class*=bp5-intent-]):hover,.bp5-html-select select:hover,.bp5-select select:hover{background-clip:padding-box;background-color:#edeff2;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button:not([class*=bp5-intent-]).bp5-active,.bp5-button:not([class*=bp5-intent-]):active,.bp5-html-select select.bp5-active,.bp5-html-select select:active,.bp5-select select.bp5-active,.bp5-select select:active,.bp5-slider-handle.bp5-active,.bp5-slider-handle:active{background-color:#dce0e5;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button:not([class*=bp5-intent-]).bp5-disabled,.bp5-button:not([class*=bp5-intent-]):disabled,.bp5-file-input input.bp5-disabled+.bp5-file-upload-input:after,.bp5-file-input input:disabled+.bp5-file-upload-input:after,.bp5-html-select select.bp5-disabled,.bp5-html-select select:disabled,.bp5-select select.bp5-disabled,.bp5-select select:disabled,.bp5-slider-handle.bp5-disabled,.bp5-slider-handle:disabled{background-color:rgba(211,216,222,.5);box-shadow:none;color:rgba(95,107,124,.6);cursor:not-allowed;outline:0}.bp5-button.bp5-intent-danger,.bp5-button.bp5-intent-primary,.bp5-button.bp5-intent-success,.bp5-button.bp5-intent-warning,.bp5-file-upload-input:after,.bp5-html-select select,.bp5-select select{box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.1)}.bp5-button:not([class*=bp5-intent-]).bp5-disabled.bp5-active,.bp5-button:not([class*=bp5-intent-]).bp5-disabled.bp5-active:hover,.bp5-button:not([class*=bp5-intent-]):disabled.bp5-active,.bp5-button:not([class*=bp5-intent-]):disabled.bp5-active:hover{background:rgba(211,216,222,.7)}.bp5-button.bp5-intent-primary{background-color:#2d72d2;color:#fff}.add-node-menu-list-item.selected:not(:hover) .source,.bp5-button.bp5-intent-danger.bp5-active,.bp5-button.bp5-intent-danger:active,.bp5-button.bp5-intent-danger:hover,.bp5-button.bp5-intent-primary.bp5-active,.bp5-button.bp5-intent-primary:active,.bp5-button.bp5-intent-primary:hover,.bp5-button.bp5-intent-success.bp5-active,.bp5-button.bp5-intent-success:active,.bp5-button.bp5-intent-success:hover,.bp5-button.bp5-intent-warning.bp5-active,.bp5-button.bp5-intent-warning:active,.bp5-button.bp5-intent-warning:hover,.bp5-dark .bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content .bp5-icon,.bp5-dark .bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content .bp5-icon-large,.bp5-dark .bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content .bp5-icon-standard,.bp5-tag-remove:active,.bp5-tag-remove:hover,.bp5-tag.bp5-intent-danger .bp5-tag-remove:active,.bp5-tag.bp5-intent-danger .bp5-tag-remove:hover,.bp5-tag.bp5-intent-primary .bp5-tag-remove:active,.bp5-tag.bp5-intent-primary .bp5-tag-remove:hover,.bp5-tag.bp5-intent-success .bp5-tag-remove:active,.bp5-tag.bp5-intent-success .bp5-tag-remove:hover,.bp5-toast[class*=bp5-intent-] a:hover,.bp5-toast[class*=bp5-intent-]>.bp5-icon,.bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content,.bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content .bp5-icon,.bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content .bp5-icon-large,.bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content .bp5-icon-standard,.bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content .bp5-tree-node-caret:hover:before{color:#fff}.bp5-button.bp5-intent-primary:hover{background-color:#215db0;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button.bp5-intent-primary.bp5-active,.bp5-button.bp5-intent-primary:active{background-color:#184a90;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button.bp5-intent-primary.bp5-disabled,.bp5-button.bp5-intent-primary:disabled{background-color:rgba(45,114,210,.5);border-color:transparent;box-shadow:none;color:hsla(0,0%,100%,.6)}.bp5-button.bp5-intent-success{background-color:#238551;color:#fff}.bp5-button.bp5-intent-success:hover{background-color:#1c6e42;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button.bp5-intent-success.bp5-active,.bp5-button.bp5-intent-success:active{background-color:#165a36;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button.bp5-intent-success.bp5-disabled,.bp5-button.bp5-intent-success:disabled{background-color:rgba(35,133,81,.5);border-color:transparent;box-shadow:none;color:hsla(0,0%,100%,.6)}.bp5-button.bp5-intent-warning:hover{background-color:#935610;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button.bp5-intent-warning.bp5-active,.bp5-button.bp5-intent-warning:active{background-color:#77450d;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button.bp5-intent-warning.bp5-disabled,.bp5-button.bp5-intent-warning:disabled{border-color:transparent;box-shadow:none}.bp5-button.bp5-intent-danger{background-color:#cd4246;color:#fff}.bp5-button.bp5-intent-danger:hover{background-color:#ac2f33;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button.bp5-intent-danger.bp5-active,.bp5-button.bp5-intent-danger:active{background-color:#8e292c;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button.bp5-intent-danger.bp5-disabled,.bp5-button.bp5-intent-danger:disabled{background-color:rgba(205,66,70,.5);border-color:transparent;box-shadow:none;color:hsla(0,0%,100%,.6)}.bp5-button[class*=bp5-intent-] .bp5-button-spinner .bp5-spinner-head{stroke:#fff}.bp5-button.bp5-large,.bp5-large .bp5-button{font-size:16px;min-height:40px;min-width:40px;padding:5px 15px}.bp5-button.bp5-large:before,.bp5-button.bp5-large>*,.bp5-large .bp5-button:before,.bp5-large .bp5-button>*,.bp5-tag-input.bp5-large:before,.bp5-tag-input.bp5-large>*{margin-right:10px}.bp5-button.bp5-small,.bp5-small .bp5-button,.bp5-tag-input .bp5-button{min-height:24px;min-width:24px;padding:0 7px}.bp5-button.bp5-loading>:not(.bp5-button-spinner),.bp5-button.bp5-loading[class*=bp5-icon-]:before{visibility:hidden}.bp5-button.bp5-loading .bp5-button-spinner{margin:0;position:absolute}.bp5-button[class*=bp5-icon-]:before{color:#5f6b7c;font-size:16px;font-weight:400;height:16px;width:16px}.bp5-button .bp5-icon-large.bp5-align-right,.bp5-button .bp5-icon-standard.bp5-align-right,.bp5-button .bp5-icon.bp5-align-right,.bp5-tab-tag{margin-left:7px}.bp5-button .bp5-icon:first-child:last-child,.bp5-button .bp5-spinner+.bp5-icon:last-child{margin:0 -7px}.bp5-dark .bp5-button:not([class*=bp5-intent-]),.bp5-dark .bp5-file-upload-input:after,.bp5-dark .bp5-html-select select,.bp5-dark .bp5-select select{background-color:#383e47;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1),0 1px 2px rgba(17,20,24,.2);color:#f6f7f9}.bp5-dark .bp5-button:not([class*=bp5-intent-]):hover,.bp5-dark .bp5-file-upload-input:hover:after,.bp5-dark .bp5-html-select select:hover,.bp5-dark .bp5-select select:hover{background-color:#2f343c;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1),0 1px 2px rgba(17,20,24,.4)}.bp5-dark .bp5-button:not([class*=bp5-intent-]).bp5-active,.bp5-dark .bp5-button:not([class*=bp5-intent-]):active,.bp5-dark .bp5-file-upload-input:active:after,.bp5-dark .bp5-html-select select.bp5-active,.bp5-dark .bp5-html-select select:active,.bp5-dark .bp5-select select.bp5-active,.bp5-dark .bp5-select select:active{background-color:#1c2127;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1),0 1px 2px rgba(17,20,24,.4)}.bp5-dark .bp5-button:not([class*=bp5-intent-]).bp5-disabled,.bp5-dark .bp5-button:not([class*=bp5-intent-]):disabled,.bp5-dark .bp5-file-input input.bp5-disabled+.bp5-file-upload-input:after,.bp5-dark .bp5-file-input input:disabled+.bp5-file-upload-input:after,.bp5-dark .bp5-html-select select.bp5-disabled,.bp5-dark .bp5-html-select select:disabled,.bp5-dark .bp5-select select.bp5-disabled,.bp5-dark .bp5-select select:disabled{background-color:rgba(64,72,84,.5);box-shadow:none;color:rgba(171,179,191,.6)}.bp5-dark .bp5-button:not([class*=bp5-intent-]).bp5-disabled.bp5-active,.bp5-dark .bp5-button:not([class*=bp5-intent-]):disabled.bp5-active{background:rgba(64,72,84,.7)}.bp5-dark .bp5-button:not([class*=bp5-intent-]) .bp5-button-spinner .bp5-spinner-head,.bp5-dark .bp5-html-select select .bp5-button-spinner .bp5-spinner-head,.bp5-dark .bp5-select select .bp5-button-spinner .bp5-spinner-head{stroke:#8f99a8;background:rgba(17,20,24,.5)}.bp5-dark .bp5-button[class*=bp5-intent-],.bp5-dark .bp5-button[class*=bp5-intent-]:hover{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1),0 1px 2px rgba(17,20,24,.2)}.bp5-dark .bp5-button[class*=bp5-intent-].bp5-active,.bp5-dark .bp5-button[class*=bp5-intent-]:active{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1),0 1px 2px rgba(17,20,24,.4)}.bp5-dark .bp5-button[class*=bp5-intent-].bp5-disabled,.bp5-dark .bp5-button[class*=bp5-intent-]:disabled{box-shadow:none;color:hsla(0,0%,100%,.3)}.bp5-dark .bp5-button[class*=bp5-intent-] .bp5-button-spinner .bp5-spinner-head,.bp5-dark .bp5-spinner .bp5-spinner-head{stroke:#8f99a8}.bp5-button.bp5-disabled .bp5-icon,.bp5-button.bp5-disabled .bp5-icon-large,.bp5-button.bp5-disabled .bp5-icon-standard,.bp5-button.bp5-disabled:before,.bp5-button:disabled .bp5-icon,.bp5-button:disabled .bp5-icon-large,.bp5-button:disabled .bp5-icon-standard,.bp5-button:disabled:before,.bp5-button[class*=bp5-intent-] .bp5-icon,.bp5-button[class*=bp5-intent-] .bp5-icon-large,.bp5-button[class*=bp5-intent-] .bp5-icon-standard,.bp5-button[class*=bp5-intent-]:before{color:inherit!important}.bp5-button-group.bp5-minimal .bp5-button,.bp5-button.bp5-minimal,.bp5-html-select.bp5-minimal select,.bp5-select.bp5-minimal select{background:none;box-shadow:none}.bp5-button-group.bp5-minimal .bp5-button:hover,.bp5-button.bp5-minimal:hover,.bp5-button.bp5-outlined:hover,.bp5-html-select.bp5-minimal select:hover,.bp5-select.bp5-minimal select:hover{background:rgba(143,153,168,.15);box-shadow:none;color:#1c2127;text-decoration:none}.bp5-button-group.bp5-minimal .bp5-button.bp5-active,.bp5-button-group.bp5-minimal .bp5-button:active,.bp5-button.bp5-minimal.bp5-active,.bp5-button.bp5-minimal:active,.bp5-button.bp5-outlined.bp5-active,.bp5-button.bp5-outlined:active,.bp5-html-select.bp5-minimal select.bp5-active,.bp5-html-select.bp5-minimal select:active,.bp5-select.bp5-minimal select.bp5-active,.bp5-select.bp5-minimal select:active{background:rgba(143,153,168,.3);box-shadow:none;color:#1c2127}.bp5-button-group.bp5-minimal .bp5-button.bp5-disabled,.bp5-button-group.bp5-minimal .bp5-button.bp5-disabled:hover,.bp5-button-group.bp5-minimal .bp5-button:disabled,.bp5-button-group.bp5-minimal .bp5-button:disabled:hover,.bp5-button.bp5-minimal.bp5-disabled,.bp5-button.bp5-minimal.bp5-disabled:hover,.bp5-button.bp5-minimal:disabled,.bp5-button.bp5-minimal:disabled:hover,.bp5-html-select.bp5-minimal select.bp5-disabled,.bp5-html-select.bp5-minimal select:disabled,.bp5-select.bp5-minimal select.bp5-disabled,.bp5-select.bp5-minimal select:disabled{background:none;color:rgba(95,107,124,.6);cursor:not-allowed}.bp5-button.bp5-minimal.bp5-disabled.bp5-active,.bp5-button.bp5-minimal.bp5-disabled:hover.bp5-active,.bp5-button.bp5-minimal:disabled.bp5-active,.bp5-button.bp5-minimal:disabled:hover.bp5-active{background:rgba(143,153,168,.3)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button:active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button:hover,.bp5-dark .bp5-button.bp5-minimal,.bp5-dark .bp5-button.bp5-minimal.bp5-active,.bp5-dark .bp5-button.bp5-minimal:active,.bp5-dark .bp5-button.bp5-minimal:hover,.bp5-dark .bp5-button.bp5-outlined,.bp5-dark .bp5-button.bp5-outlined.bp5-active,.bp5-dark .bp5-button.bp5-outlined:active,.bp5-dark .bp5-button.bp5-outlined:hover,.bp5-dark .bp5-html-select.bp5-minimal select,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select:active,.bp5-dark .bp5-html-select.bp5-minimal select:hover,.bp5-dark .bp5-select.bp5-minimal select,.bp5-dark .bp5-select.bp5-minimal select.bp5-active,.bp5-dark .bp5-select.bp5-minimal select:active,.bp5-dark .bp5-select.bp5-minimal select:hover,.bp5-html-select.bp5-minimal .bp5-dark select,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select:active,.bp5-html-select.bp5-minimal .bp5-dark select:hover,.bp5-select.bp5-minimal .bp5-dark select,.bp5-select.bp5-minimal .bp5-dark select.bp5-active,.bp5-select.bp5-minimal .bp5-dark select:active,.bp5-select.bp5-minimal .bp5-dark select:hover{background:none;box-shadow:none;color:#fff}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button:hover,.bp5-dark .bp5-button.bp5-minimal:hover,.bp5-dark .bp5-button.bp5-outlined:hover,.bp5-dark .bp5-html-select.bp5-minimal select:hover,.bp5-dark .bp5-select.bp5-minimal select:hover,.bp5-html-select.bp5-minimal .bp5-dark select:hover,.bp5-select.bp5-minimal .bp5-dark select:hover,table.bp5-html-table.bp5-html-table-striped tbody tr:nth-child(odd) td{background:rgba(143,153,168,.15)}.bp5-dark .bp5-button.bp5-minimal.bp5-active,.bp5-dark .bp5-button.bp5-minimal:active{background:rgba(143,153,168,.3)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-disabled,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-disabled:hover,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button:disabled,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button:disabled:hover,.bp5-dark .bp5-button.bp5-minimal.bp5-disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-disabled:hover,.bp5-dark .bp5-button.bp5-minimal:disabled,.bp5-dark .bp5-button.bp5-minimal:disabled:hover,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-disabled,.bp5-dark .bp5-html-select.bp5-minimal select:disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-disabled,.bp5-dark .bp5-select.bp5-minimal select:disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-disabled,.bp5-html-select.bp5-minimal .bp5-dark select:disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-disabled,.bp5-select.bp5-minimal .bp5-dark select:disabled{background:none;color:rgba(171,179,191,.6);cursor:not-allowed}.bp5-dark .bp5-button.bp5-minimal.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-disabled:hover.bp5-active,.bp5-dark .bp5-button.bp5-minimal:disabled.bp5-active,.bp5-dark .bp5-button.bp5-minimal:disabled:hover.bp5-active{background:rgba(143,153,168,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:hover,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:hover,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:hover,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:hover,.bp5-button.bp5-minimal.bp5-intent-danger.bp5-active,.bp5-button.bp5-minimal.bp5-intent-danger:active,.bp5-button.bp5-minimal.bp5-intent-danger:hover,.bp5-button.bp5-minimal.bp5-intent-primary.bp5-active,.bp5-button.bp5-minimal.bp5-intent-primary:active,.bp5-button.bp5-minimal.bp5-intent-primary:hover,.bp5-button.bp5-minimal.bp5-intent-success.bp5-active,.bp5-button.bp5-minimal.bp5-intent-success:active,.bp5-button.bp5-minimal.bp5-intent-success:hover,.bp5-button.bp5-minimal.bp5-intent-warning.bp5-active,.bp5-button.bp5-minimal.bp5-intent-warning:active,.bp5-button.bp5-minimal.bp5-intent-warning:hover,.bp5-button.bp5-outlined.bp5-intent-danger.bp5-active,.bp5-button.bp5-outlined.bp5-intent-danger:active,.bp5-button.bp5-outlined.bp5-intent-danger:hover,.bp5-button.bp5-outlined.bp5-intent-primary.bp5-active,.bp5-button.bp5-outlined.bp5-intent-primary:active,.bp5-button.bp5-outlined.bp5-intent-primary:hover,.bp5-button.bp5-outlined.bp5-intent-success.bp5-active,.bp5-button.bp5-outlined.bp5-intent-success:active,.bp5-button.bp5-outlined.bp5-intent-success:hover,.bp5-button.bp5-outlined.bp5-intent-warning.bp5-active,.bp5-button.bp5-outlined.bp5-intent-warning:active,.bp5-button.bp5-outlined.bp5-intent-warning:hover,.bp5-dark .bp5-editable-text.bp5-disabled:before,.bp5-dark .bp5-input-group.bp5-intent-danger .bp5-input.bp5-disabled,.bp5-dark .bp5-input-group.bp5-intent-danger .bp5-input:disabled,.bp5-dark .bp5-input-group.bp5-intent-primary .bp5-input.bp5-disabled,.bp5-dark .bp5-input-group.bp5-intent-primary .bp5-input:disabled,.bp5-dark .bp5-input-group.bp5-intent-success .bp5-input.bp5-disabled,.bp5-dark .bp5-input-group.bp5-intent-success .bp5-input:disabled,.bp5-dark .bp5-input-group.bp5-intent-warning .bp5-input.bp5-disabled,.bp5-dark .bp5-input-group.bp5-intent-warning .bp5-input:disabled,.bp5-dark .bp5-input.bp5-intent-danger.bp5-disabled,.bp5-dark .bp5-input.bp5-intent-danger:disabled,.bp5-dark .bp5-input.bp5-intent-primary.bp5-disabled,.bp5-dark .bp5-input.bp5-intent-primary:disabled,.bp5-dark .bp5-input.bp5-intent-success.bp5-disabled,.bp5-dark .bp5-input.bp5-intent-success:disabled,.bp5-dark .bp5-input.bp5-intent-warning.bp5-disabled,.bp5-dark .bp5-input.bp5-intent-warning:disabled,.bp5-dark .bp5-submenu.bp5-popover,.bp5-dark table.bp5-html-table.bp5-html-table-bordered.bp5-html-table-striped tbody tr:not(:first-child) td:first-child,.bp5-disabled .bp5-slider-handle .bp5-slider-label,.bp5-html-select.bp5-minimal select.bp5-intent-danger.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-danger:active,.bp5-html-select.bp5-minimal select.bp5-intent-danger:hover,.bp5-html-select.bp5-minimal select.bp5-intent-primary.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-primary:active,.bp5-html-select.bp5-minimal select.bp5-intent-primary:hover,.bp5-html-select.bp5-minimal select.bp5-intent-success.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-success:active,.bp5-html-select.bp5-minimal select.bp5-intent-success:hover,.bp5-html-select.bp5-minimal select.bp5-intent-warning.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-warning:active,.bp5-html-select.bp5-minimal select.bp5-intent-warning:hover,.bp5-input-group.bp5-intent-danger .bp5-input.bp5-disabled,.bp5-input-group.bp5-intent-danger .bp5-input:disabled,.bp5-input-group.bp5-intent-primary .bp5-input.bp5-disabled,.bp5-input-group.bp5-intent-primary .bp5-input:disabled,.bp5-input-group.bp5-intent-success .bp5-input.bp5-disabled,.bp5-input-group.bp5-intent-success .bp5-input:disabled,.bp5-input-group.bp5-intent-warning .bp5-input.bp5-disabled,.bp5-input-group.bp5-intent-warning .bp5-input:disabled,.bp5-input.bp5-intent-danger.bp5-disabled,.bp5-input.bp5-intent-danger:disabled,.bp5-input.bp5-intent-primary.bp5-disabled,.bp5-input.bp5-intent-primary:disabled,.bp5-input.bp5-intent-success.bp5-disabled,.bp5-input.bp5-intent-success:disabled,.bp5-input.bp5-intent-warning.bp5-disabled,.bp5-input.bp5-intent-warning:disabled,.bp5-omnibar .bp5-input,.bp5-omnibar .bp5-input:focus,.bp5-select.bp5-minimal select.bp5-intent-danger.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-danger:active,.bp5-select.bp5-minimal select.bp5-intent-danger:hover,.bp5-select.bp5-minimal select.bp5-intent-primary.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-primary:active,.bp5-select.bp5-minimal select.bp5-intent-primary:hover,.bp5-select.bp5-minimal select.bp5-intent-success.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-success:active,.bp5-select.bp5-minimal select.bp5-intent-success:hover,.bp5-select.bp5-minimal select.bp5-intent-warning.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-warning:active,.bp5-select.bp5-minimal select.bp5-intent-warning:hover,.bp5-submenu.bp5-popover.bp5-dark,.visual-node-editor .inline-node-container .visual-node-editor>main,table.bp5-html-table.bp5-html-table-bordered.bp5-html-table-striped tbody tr:not(:first-child) td{box-shadow:none}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:hover,.bp5-button.bp5-minimal.bp5-intent-primary:hover,.bp5-button.bp5-outlined.bp5-intent-primary:hover,.bp5-html-select.bp5-minimal select.bp5-intent-primary:hover,.bp5-select.bp5-minimal select.bp5-intent-primary:hover{background:rgba(45,114,210,.15);color:#215db0}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:active,.bp5-button.bp5-minimal.bp5-intent-primary.bp5-active,.bp5-button.bp5-minimal.bp5-intent-primary:active,.bp5-button.bp5-outlined.bp5-intent-primary.bp5-active,.bp5-button.bp5-outlined.bp5-intent-primary:active,.bp5-html-select.bp5-minimal select.bp5-intent-primary.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-primary:active,.bp5-select.bp5-minimal select.bp5-intent-primary.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-primary:active{background:rgba(45,114,210,.3);color:#184a90}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary.bp5-disabled,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:disabled,.bp5-button.bp5-minimal.bp5-intent-primary.bp5-disabled,.bp5-button.bp5-minimal.bp5-intent-primary:disabled,.bp5-html-select.bp5-minimal select.bp5-intent-primary.bp5-disabled,.bp5-html-select.bp5-minimal select.bp5-intent-primary:disabled,.bp5-select.bp5-minimal select.bp5-intent-primary.bp5-disabled,.bp5-select.bp5-minimal select.bp5-intent-primary:disabled{background:none;color:rgba(33,93,176,.5)}.bp5-button.bp5-minimal.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-button.bp5-minimal.bp5-intent-primary:disabled.bp5-active{background:rgba(45,114,210,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary .bp5-button-spinner .bp5-spinner-head,.bp5-button.bp5-minimal.bp5-intent-primary .bp5-button-spinner .bp5-spinner-head,.bp5-button.bp5-outlined.bp5-intent-primary .bp5-button-spinner .bp5-spinner-head,.bp5-html-select.bp5-minimal select.bp5-intent-primary .bp5-button-spinner .bp5-spinner-head,.bp5-select.bp5-minimal select.bp5-intent-primary .bp5-button-spinner .bp5-spinner-head{stroke:#215db0}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:hover,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-primary:hover,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-primary:hover,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-primary:hover,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-primary:hover,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-primary:hover,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-primary:hover{background:rgba(45,114,210,.2);color:#8abbff}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-primary.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-primary:active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-primary.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-primary:active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-primary.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-primary:active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-primary.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-primary:active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-primary.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-primary:active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-primary.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-primary:active{background:rgba(45,114,210,.3);color:#99c4ff}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary.bp5-disabled,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-primary.bp5-disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-primary:disabled,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-primary.bp5-disabled,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-primary:disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-primary.bp5-disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-primary:disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-primary.bp5-disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-primary:disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-primary.bp5-disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-primary:disabled{background:none;color:rgba(138,187,255,.5)}.bp5-dark .bp5-button.bp5-minimal.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-primary:disabled.bp5-active{background:rgba(45,114,210,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:hover,.bp5-button.bp5-minimal.bp5-intent-success:hover,.bp5-button.bp5-outlined.bp5-intent-success:hover,.bp5-html-select.bp5-minimal select.bp5-intent-success:hover,.bp5-select.bp5-minimal select.bp5-intent-success:hover{background:rgba(35,133,81,.15);color:#1c6e42}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:active,.bp5-button.bp5-minimal.bp5-intent-success.bp5-active,.bp5-button.bp5-minimal.bp5-intent-success:active,.bp5-button.bp5-outlined.bp5-intent-success.bp5-active,.bp5-button.bp5-outlined.bp5-intent-success:active,.bp5-html-select.bp5-minimal select.bp5-intent-success.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-success:active,.bp5-select.bp5-minimal select.bp5-intent-success.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-success:active{background:rgba(35,133,81,.3);color:#165a36}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success.bp5-disabled,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:disabled,.bp5-button.bp5-minimal.bp5-intent-success.bp5-disabled,.bp5-button.bp5-minimal.bp5-intent-success:disabled,.bp5-html-select.bp5-minimal select.bp5-intent-success.bp5-disabled,.bp5-html-select.bp5-minimal select.bp5-intent-success:disabled,.bp5-select.bp5-minimal select.bp5-intent-success.bp5-disabled,.bp5-select.bp5-minimal select.bp5-intent-success:disabled{background:none;color:rgba(28,110,66,.5)}.bp5-button.bp5-minimal.bp5-intent-success.bp5-disabled.bp5-active,.bp5-button.bp5-minimal.bp5-intent-success:disabled.bp5-active{background:rgba(35,133,81,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success .bp5-button-spinner .bp5-spinner-head,.bp5-button.bp5-minimal.bp5-intent-success .bp5-button-spinner .bp5-spinner-head,.bp5-button.bp5-outlined.bp5-intent-success .bp5-button-spinner .bp5-spinner-head,.bp5-html-select.bp5-minimal select.bp5-intent-success .bp5-button-spinner .bp5-spinner-head,.bp5-select.bp5-minimal select.bp5-intent-success .bp5-button-spinner .bp5-spinner-head{stroke:#1c6e42}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:hover,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-success:hover,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-success:hover,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-success:hover,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-success:hover,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-success:hover,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-success:hover{background:rgba(35,133,81,.2);color:#72ca9b}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-success.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-success:active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-success.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-success:active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-success.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-success:active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-success.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-success:active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-success.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-success:active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-success.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-success:active{background:rgba(35,133,81,.3);color:#7cd7a2}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success.bp5-disabled,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-success.bp5-disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-success:disabled,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-success.bp5-disabled,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-success:disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-success.bp5-disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-success:disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-success.bp5-disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-success:disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-success.bp5-disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-success:disabled{background:none;color:rgba(114,202,155,.5)}.bp5-dark .bp5-button.bp5-minimal.bp5-intent-success.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-success:disabled.bp5-active{background:rgba(35,133,81,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:hover,.bp5-button.bp5-minimal.bp5-intent-warning:hover,.bp5-button.bp5-outlined.bp5-intent-warning:hover,.bp5-html-select.bp5-minimal select.bp5-intent-warning:hover,.bp5-select.bp5-minimal select.bp5-intent-warning:hover{background:rgba(200,118,25,.15);color:#935610}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:active,.bp5-button.bp5-minimal.bp5-intent-warning.bp5-active,.bp5-button.bp5-minimal.bp5-intent-warning:active,.bp5-button.bp5-outlined.bp5-intent-warning.bp5-active,.bp5-button.bp5-outlined.bp5-intent-warning:active,.bp5-html-select.bp5-minimal select.bp5-intent-warning.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-warning:active,.bp5-select.bp5-minimal select.bp5-intent-warning.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-warning:active{background:rgba(200,118,25,.3);color:#77450d}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning.bp5-disabled,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:disabled,.bp5-button.bp5-minimal.bp5-intent-warning.bp5-disabled,.bp5-button.bp5-minimal.bp5-intent-warning:disabled,.bp5-html-select.bp5-minimal select.bp5-intent-warning.bp5-disabled,.bp5-html-select.bp5-minimal select.bp5-intent-warning:disabled,.bp5-select.bp5-minimal select.bp5-intent-warning.bp5-disabled,.bp5-select.bp5-minimal select.bp5-intent-warning:disabled{background:none;color:rgba(147,86,16,.5)}.bp5-button.bp5-minimal.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-button.bp5-minimal.bp5-intent-warning:disabled.bp5-active{background:rgba(200,118,25,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning .bp5-button-spinner .bp5-spinner-head,.bp5-button.bp5-minimal.bp5-intent-warning .bp5-button-spinner .bp5-spinner-head,.bp5-button.bp5-outlined.bp5-intent-warning .bp5-button-spinner .bp5-spinner-head,.bp5-html-select.bp5-minimal select.bp5-intent-warning .bp5-button-spinner .bp5-spinner-head,.bp5-select.bp5-minimal select.bp5-intent-warning .bp5-button-spinner .bp5-spinner-head{stroke:#935610}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:hover,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-warning:hover,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-warning:hover,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-warning:hover,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-warning:hover,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-warning:hover,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-warning:hover{background:rgba(200,118,25,.2);color:#fbb360}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-warning.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-warning:active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-warning.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-warning:active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-warning.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-warning:active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-warning.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-warning:active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-warning.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-warning:active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-warning.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-warning:active{background:rgba(200,118,25,.3);color:#f5c186}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning.bp5-disabled,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-warning.bp5-disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-warning:disabled,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-warning.bp5-disabled,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-warning:disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-warning.bp5-disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-warning:disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-warning.bp5-disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-warning:disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-warning.bp5-disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-warning:disabled{background:none;color:rgba(251,179,96,.5)}.bp5-dark .bp5-button.bp5-minimal.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-warning:disabled.bp5-active{background:rgba(200,118,25,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:hover,.bp5-button.bp5-minimal.bp5-intent-danger:hover,.bp5-button.bp5-outlined.bp5-intent-danger:hover,.bp5-html-select.bp5-minimal select.bp5-intent-danger:hover,.bp5-select.bp5-minimal select.bp5-intent-danger:hover{background:rgba(205,66,70,.15);color:#ac2f33}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:active,.bp5-button.bp5-minimal.bp5-intent-danger.bp5-active,.bp5-button.bp5-minimal.bp5-intent-danger:active,.bp5-button.bp5-outlined.bp5-intent-danger.bp5-active,.bp5-button.bp5-outlined.bp5-intent-danger:active,.bp5-html-select.bp5-minimal select.bp5-intent-danger.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-danger:active,.bp5-select.bp5-minimal select.bp5-intent-danger.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-danger:active{background:rgba(205,66,70,.3);color:#8e292c}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger.bp5-disabled,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:disabled,.bp5-button.bp5-minimal.bp5-intent-danger.bp5-disabled,.bp5-button.bp5-minimal.bp5-intent-danger:disabled,.bp5-html-select.bp5-minimal select.bp5-intent-danger.bp5-disabled,.bp5-html-select.bp5-minimal select.bp5-intent-danger:disabled,.bp5-select.bp5-minimal select.bp5-intent-danger.bp5-disabled,.bp5-select.bp5-minimal select.bp5-intent-danger:disabled{background:none;color:rgba(172,47,51,.5)}.bp5-button.bp5-minimal.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-button.bp5-minimal.bp5-intent-danger:disabled.bp5-active{background:rgba(205,66,70,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger .bp5-button-spinner .bp5-spinner-head,.bp5-button.bp5-minimal.bp5-intent-danger .bp5-button-spinner .bp5-spinner-head,.bp5-button.bp5-outlined.bp5-intent-danger .bp5-button-spinner .bp5-spinner-head,.bp5-html-select.bp5-minimal select.bp5-intent-danger .bp5-button-spinner .bp5-spinner-head,.bp5-select.bp5-minimal select.bp5-intent-danger .bp5-button-spinner .bp5-spinner-head{stroke:#ac2f33}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:hover,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-danger:hover,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-danger:hover,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-danger:hover,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-danger:hover,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-danger:hover,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-danger:hover{background:rgba(205,66,70,.2);color:#fa999c}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-danger.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-danger:active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-danger.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-danger:active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-danger.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-danger:active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-danger.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-danger:active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-danger.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-danger:active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-danger.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-danger:active{background:rgba(205,66,70,.3);color:#ffa1a4}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger.bp5-disabled,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-danger.bp5-disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-danger:disabled,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-danger.bp5-disabled,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-danger:disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-danger.bp5-disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-danger:disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-danger.bp5-disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-danger:disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-danger.bp5-disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-danger:disabled{background:none;color:rgba(250,153,156,.5)}.bp5-dark .bp5-button.bp5-minimal.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-danger:disabled.bp5-active{background:rgba(205,66,70,.3)}.bp5-button.bp5-outlined{background:none;border:1px solid rgba(28,33,39,.2);box-shadow:none;box-sizing:border-box}.bp5-card.bp5-dark,.bp5-dark .bp5-card,.bp5-dark .bp5-elevation-0,.bp5-elevation-0.bp5-dark{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2)}.bp5-button.bp5-outlined.bp5-disabled,.bp5-button.bp5-outlined.bp5-disabled:hover,.bp5-button.bp5-outlined:disabled,.bp5-button.bp5-outlined:disabled:hover{background:none;color:rgba(95,107,124,.6);cursor:not-allowed;border-color:rgba(95,107,124,.1)}.bp5-button.bp5-outlined.bp5-disabled.bp5-active,.bp5-button.bp5-outlined.bp5-disabled:hover.bp5-active,.bp5-button.bp5-outlined:disabled.bp5-active,.bp5-button.bp5-outlined:disabled:hover.bp5-active{background:rgba(143,153,168,.3)}.bp5-dark .bp5-button.bp5-outlined.bp5-active,.bp5-dark .bp5-button.bp5-outlined:active{background:rgba(143,153,168,.3)}.bp5-dark .bp5-button.bp5-outlined.bp5-disabled,.bp5-dark .bp5-button.bp5-outlined.bp5-disabled:hover,.bp5-dark .bp5-button.bp5-outlined:disabled,.bp5-dark .bp5-button.bp5-outlined:disabled:hover{background:none;color:rgba(171,179,191,.6);cursor:not-allowed;border-color:hsla(0,0%,100%,.2)}.bp5-dark .bp5-button.bp5-outlined.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-disabled:hover.bp5-active,.bp5-dark .bp5-button.bp5-outlined:disabled.bp5-active,.bp5-dark .bp5-button.bp5-outlined:disabled:hover.bp5-active{background:rgba(143,153,168,.3)}.bp5-button.bp5-outlined.bp5-intent-primary.bp5-disabled,.bp5-button.bp5-outlined.bp5-intent-primary:disabled{background:none;color:rgba(33,93,176,.5);border-color:rgba(33,93,176,.2)}.bp5-button.bp5-outlined.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-button.bp5-outlined.bp5-intent-primary:disabled.bp5-active{background:rgba(45,114,210,.3)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-primary{color:#8abbff;border-color:rgba(138,187,255,.6)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-primary.bp5-disabled,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-primary:disabled{background:none;color:rgba(138,187,255,.5);border-color:rgba(138,187,255,.2)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-primary:disabled.bp5-active{background:rgba(45,114,210,.3)}.bp5-button.bp5-outlined.bp5-intent-success.bp5-disabled,.bp5-button.bp5-outlined.bp5-intent-success:disabled{background:none;color:rgba(28,110,66,.5);border-color:rgba(28,110,66,.2)}.bp5-button.bp5-outlined.bp5-intent-success.bp5-disabled.bp5-active,.bp5-button.bp5-outlined.bp5-intent-success:disabled.bp5-active{background:rgba(35,133,81,.3)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-success{color:#72ca9b;border-color:rgba(114,202,155,.6)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-success.bp5-disabled,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-success:disabled{background:none;color:rgba(114,202,155,.5);border-color:rgba(114,202,155,.2)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-success.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-success:disabled.bp5-active{background:rgba(35,133,81,.3)}.bp5-button.bp5-outlined.bp5-intent-warning.bp5-disabled,.bp5-button.bp5-outlined.bp5-intent-warning:disabled{background:none;color:rgba(147,86,16,.5);border-color:rgba(147,86,16,.2)}.bp5-button.bp5-outlined.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-button.bp5-outlined.bp5-intent-warning:disabled.bp5-active{background:rgba(200,118,25,.3)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-warning{color:#fbb360;border-color:rgba(251,179,96,.6)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-warning.bp5-disabled,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-warning:disabled{background:none;color:rgba(251,179,96,.5);border-color:rgba(251,179,96,.2)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-warning:disabled.bp5-active{background:rgba(200,118,25,.3)}.bp5-button.bp5-outlined.bp5-intent-danger.bp5-disabled,.bp5-button.bp5-outlined.bp5-intent-danger:disabled{background:none;color:rgba(172,47,51,.5);border-color:rgba(172,47,51,.2)}.bp5-button.bp5-outlined.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-button.bp5-outlined.bp5-intent-danger:disabled.bp5-active{background:rgba(205,66,70,.3)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-danger{color:#fa999c;border-color:rgba(250,153,156,.6)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-danger.bp5-disabled,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-danger:disabled{background:none;color:rgba(250,153,156,.5);border-color:rgba(250,153,156,.2)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-danger:disabled.bp5-active{background:rgba(205,66,70,.3)}.bp5-dark .bp5-button.bp5-outlined{border-color:hsla(0,0%,100%,.4)}.bp5-button.bp5-outlined.bp5-intent-primary{border-color:rgba(33,93,176,.6)}.bp5-button.bp5-outlined.bp5-intent-success{border-color:rgba(28,110,66,.6)}.bp5-button.bp5-outlined.bp5-intent-warning{border-color:rgba(147,86,16,.6)}.bp5-button.bp5-outlined.bp5-intent-danger{color:#ac2f33;border-color:rgba(172,47,51,.6)}.bp5-button.bp5-intent-warning,.bp5-tag.bp5-intent-warning{background:#fbb360;color:#1c2127}.bp5-button.bp5-intent-warning:not(.bp5-disabled).bp5-icon>svg{fill:rgba(28,33,39,.7)}.bp5-button.bp5-intent-warning:not(.bp5-disabled):not(.bp5-minimal):not(.bp5-outlined):hover{background:#ec9a3c;color:#1c2127}.bp5-button.bp5-intent-warning:not(.bp5-disabled):not(.bp5-minimal):not(.bp5-outlined).bp5-active,.bp5-button.bp5-intent-warning:not(.bp5-disabled):not(.bp5-minimal):not(.bp5-outlined):active{background:#c87619;color:#1c2127}.bp5-button.bp5-intent-warning.bp5-disabled,.bp5-button.bp5-intent-warning:disabled{background:rgba(200,118,25,.5);color:rgba(28,33,39,.35)}.bp5-dark .bp5-button.bp5-intent-warning.bp5-disabled,.bp5-dark .bp5-button.bp5-intent-warning:disabled{color:rgba(28,33,39,.6)}.bp5-button.bp5-intent-warning.bp5-minimal,.bp5-button.bp5-intent-warning.bp5-outlined{background:none}.bp5-dark .bp5-button.bp5-intent-warning.bp5-minimal:not(.bp5-disabled).bp5-icon>svg,.bp5-dark .bp5-button.bp5-intent-warning.bp5-outlined:not(.bp5-disabled).bp5-icon>svg{fill:#fbb360}a.bp5-button{text-align:center;text-decoration:none;transition:none}.bp5-dark .bp5-tag-remove:active,.bp5-dark .bp5-tag-remove:hover,.bp5-dialog-step-viewed:not(.bp5-active) .bp5-dialog-step-title,.bp5-file-input.bp5-file-input-has-selection .bp5-file-upload-input,.bp5-html-select .bp5-icon:hover,.bp5-menu-item.bp5-active .bp5-menu-item-label,.bp5-menu-item:active .bp5-menu-item-label,.bp5-running-text table td,.bp5-select .bp5-icon:hover,.bp5-tag.bp5-intent-warning .bp5-tag-remove:active,.bp5-tag.bp5-intent-warning .bp5-tag-remove:hover,.bp5-tree-node-caret:hover,a.bp5-button,a.bp5-button:active,a.bp5-button:hover,table.bp5-html-table td{color:#1c2127}.bp5-callout.bp5-callout-icon>.bp5-icon:first-child,.bp5-callout[class*=bp5-icon-]:before{color:#5f6b7c;left:15px;position:absolute;top:17px}.bp5-button-text{flex:0 1 auto}.bp5-button-group .bp5-button{flex:0 0 auto;position:relative;z-index:4}.bp5-button-group .bp5-button:focus,.bp5-control-group .bp5-button:focus,.bp5-control-group .bp5-html-select select:focus,.bp5-control-group .bp5-select select:focus{z-index:5}.bp5-button-group .bp5-button:hover,.bp5-control-group .bp5-button:hover,.bp5-control-group .bp5-html-select select:hover,.bp5-control-group .bp5-select select:hover{z-index:6}.bp5-button-group .bp5-button.bp5-active,.bp5-button-group .bp5-button:active,.bp5-control-group .bp5-button:active,.bp5-control-group .bp5-html-select select:active,.bp5-control-group .bp5-select select:active{z-index:7}.bp5-button-group .bp5-button.bp5-disabled,.bp5-button-group .bp5-button:disabled,.bp5-control-group .bp5-button.bp5-disabled,.bp5-control-group .bp5-button:disabled,.bp5-control-group .bp5-button[readonly],.bp5-control-group .bp5-html-select select.bp5-disabled,.bp5-control-group .bp5-html-select select:disabled,.bp5-control-group .bp5-html-select select[readonly],.bp5-control-group .bp5-select select.bp5-disabled,.bp5-control-group .bp5-select select:disabled,.bp5-control-group .bp5-select select[readonly]{z-index:3}.bp5-button-group .bp5-button[class*=bp5-intent-],.bp5-control-group .bp5-button[class*=bp5-intent],.bp5-control-group .bp5-html-select select[class*=bp5-intent],.bp5-control-group .bp5-select select[class*=bp5-intent]{z-index:9}.bp5-button-group .bp5-button[class*=bp5-intent-]:focus,.bp5-control-group .bp5-button[class*=bp5-intent]:focus,.bp5-control-group .bp5-html-select select[class*=bp5-intent]:focus,.bp5-control-group .bp5-select select[class*=bp5-intent]:focus{z-index:10}.bp5-button-group .bp5-button[class*=bp5-intent-]:hover,.bp5-control-group .bp5-button[class*=bp5-intent]:hover,.bp5-control-group .bp5-html-select select[class*=bp5-intent]:hover,.bp5-control-group .bp5-select select[class*=bp5-intent]:hover{z-index:11}.bp5-button-group .bp5-button[class*=bp5-intent-].bp5-active,.bp5-button-group .bp5-button[class*=bp5-intent-]:active,.bp5-control-group .bp5-button[class*=bp5-intent]:active,.bp5-control-group .bp5-html-select select[class*=bp5-intent]:active,.bp5-control-group .bp5-select select[class*=bp5-intent]:active{z-index:12}.bp5-button-group .bp5-button[class*=bp5-intent-].bp5-disabled,.bp5-button-group .bp5-button[class*=bp5-intent-]:disabled,.bp5-control-group .bp5-button[class*=bp5-intent].bp5-disabled,.bp5-control-group .bp5-button[class*=bp5-intent]:disabled,.bp5-control-group .bp5-button[class*=bp5-intent][readonly],.bp5-control-group .bp5-html-select select[class*=bp5-intent].bp5-disabled,.bp5-control-group .bp5-html-select select[class*=bp5-intent]:disabled,.bp5-control-group .bp5-html-select select[class*=bp5-intent][readonly],.bp5-control-group .bp5-select select[class*=bp5-intent].bp5-disabled,.bp5-control-group .bp5-select select[class*=bp5-intent]:disabled,.bp5-control-group .bp5-select select[class*=bp5-intent][readonly]{z-index:8}.bp5-button-group:not(.bp5-minimal)>.bp5-button:not(:last-child),.bp5-button-group:not(.bp5-minimal)>.bp5-popover-target:not(:last-child) .bp5-button,.bp5-button-group:not(.bp5-minimal)>.bp5-popover-wrapper:not(:last-child) .bp5-button{border-bottom-right-radius:0;border-top-right-radius:0;margin-right:-1px}.bp5-button-group.bp5-minimal .bp5-button.bp5-disabled.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-disabled:hover.bp5-active,.bp5-button-group.bp5-minimal .bp5-button:disabled.bp5-active,.bp5-button-group.bp5-minimal .bp5-button:disabled:hover.bp5-active{background:rgba(143,153,168,.3)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button:active{background:rgba(143,153,168,.3)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-disabled.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-disabled:hover.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button:disabled.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button:disabled:hover.bp5-active{background:rgba(143,153,168,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:disabled.bp5-active{background:rgba(45,114,210,.3)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:disabled.bp5-active{background:rgba(45,114,210,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success.bp5-disabled.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:disabled.bp5-active{background:rgba(35,133,81,.3)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success.bp5-disabled.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:disabled.bp5-active{background:rgba(35,133,81,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:disabled.bp5-active{background:rgba(200,118,25,.3)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:disabled.bp5-active{background:rgba(200,118,25,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:disabled.bp5-active{background:rgba(205,66,70,.3)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:disabled.bp5-active{background:rgba(205,66,70,.3)}.bp5-button-group .bp5-popover-target,.bp5-button-group .bp5-popover-wrapper{display:flex;flex:1 1 auto}.bp5-button-group.bp5-vertical{align-items:stretch;flex-direction:column;vertical-align:top}.bp5-button-group.bp5-vertical.bp5-fill{height:100%;width:unset}.bp5-button-group.bp5-vertical .bp5-button{margin-right:0!important;width:100%}.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-button:first-child,.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-popover-target:first-child .bp5-button,.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-popover-wrapper:first-child .bp5-button{border-radius:2px 2px 0 0}.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-button:last-child,.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-popover-target:last-child .bp5-button,.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-popover-wrapper:last-child .bp5-button{border-radius:0 0 2px 2px}.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-button:not(:last-child),.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-popover-target:not(:last-child) .bp5-button,.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-popover-wrapper:not(:last-child) .bp5-button{margin-bottom:-1px}.bp5-callout{background-color:rgba(143,153,168,.15);border-radius:2px;font-size:14px;line-height:1.5;padding:15px;width:100%}.bp5-callout.bp5-callout-icon,.bp5-callout[class*=bp5-icon-],.bp5-control.bp5-switch:not(.bp5-align-right){padding-left:38px}.bp5-callout[class*=bp5-icon-]:before{font-size:16px;font-weight:400;height:16px;width:16px}.bp5-callout .bp5-heading{line-height:16px;margin-bottom:5px;margin-top:2px}.bp5-dark .bp5-callout{background-color:rgba(143,153,168,.2)}.bp5-callout.bp5-intent-primary,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-],.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover{background-color:rgba(45,114,210,.1);color:#215db0}.bp5-dark .bp5-callout.bp5-intent-primary,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-],.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover{background-color:rgba(45,114,210,.2);color:#8abbff}.bp5-callout.bp5-intent-success,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-success{background-color:rgba(35,133,81,.1);color:#1c6e42}.bp5-dark .bp5-callout.bp5-intent-success,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-success{background-color:rgba(35,133,81,.2);color:#72ca9b}.bp5-callout.bp5-intent-warning,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-warning{background-color:rgba(200,118,25,.1);color:#935610}.bp5-dark .bp5-callout.bp5-intent-warning,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-warning{background-color:rgba(200,118,25,.2);color:#fbb360}.bp5-callout.bp5-intent-danger,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-danger{background-color:rgba(205,66,70,.1);color:#ac2f33}.bp5-dark .bp5-callout.bp5-intent-danger,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-danger{background-color:rgba(205,66,70,.2);color:#fa999c}.bp5-callout.bp5-intent-primary a:hover,.bp5-tag.bp5-minimal.bp5-intent-primary .bp5-tag-remove:active,.bp5-tag.bp5-minimal.bp5-intent-primary .bp5-tag-remove:hover{color:#184a90}.bp5-dark .bp5-callout.bp5-intent-primary a:hover,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-primary .bp5-tag-remove:active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-primary .bp5-tag-remove:hover{color:#99c4ff}.bp5-running-text .bp5-callout{margin:20px 0}.bp5-card{background-color:#fff;border-radius:2px;padding:20px;transition:transform .2s cubic-bezier(.4,1,.75,.9),box-shadow .2s cubic-bezier(.4,1,.75,.9)}.bp5-card.bp5-dark,.bp5-dark .bp5-card{background-color:#2f343c}.bp5-elevation-1{box-shadow:0 0 0 1px rgba(17,20,24,.1),0 1px 1px rgba(17,20,24,.2)}.bp5-dark .bp5-elevation-1,.bp5-elevation-1.bp5-dark{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 1px 1px 0 rgba(17,20,24,.4)}.bp5-elevation-2{box-shadow:0 0 0 1px rgba(17,20,24,.1),0 1px 1px rgba(17,20,24,.2),0 2px 6px rgba(17,20,24,.2)}.bp5-dark .bp5-elevation-2,.bp5-elevation-2.bp5-dark{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 1px 1px rgba(17,20,24,.4),0 2px 6px rgba(17,20,24,.4)}.bp5-elevation-3,.bp5-submenu.bp5-popover>.bp5-popover-content{box-shadow:0 0 0 1px rgba(17,20,24,.1),0 2px 4px rgba(17,20,24,.2),0 8px 24px rgba(17,20,24,.2)}.bp5-dark .bp5-elevation-3,.bp5-elevation-3.bp5-dark{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 2px 4px rgba(17,20,24,.4),0 8px 24px rgba(17,20,24,.4)}.bp5-elevation-4{box-shadow:0 0 0 1px rgba(17,20,24,.1),0 4px 8px rgba(17,20,24,.2),0 18px 46px 6px rgba(17,20,24,.2)}.bp5-card.bp5-interactive:hover,.bp5-dialog{box-shadow:0 0 0 1px rgba(17,20,24,.1),0 2px 4px rgba(17,20,24,.2),0 8px 24px rgba(17,20,24,.2)}.bp5-dark .bp5-elevation-4,.bp5-elevation-4.bp5-dark{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 4px 8px rgba(17,20,24,.4),0 18px 46px 6px rgba(17,20,24,.4)}.bp5-card.bp5-interactive:hover{cursor:pointer}.bp5-card.bp5-interactive:hover.bp5-dark,.bp5-dark .bp5-card.bp5-interactive:hover{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 2px 4px rgba(17,20,24,.4),0 8px 24px rgba(17,20,24,.4)}.bp5-card.bp5-interactive:active{box-shadow:0 0 0 1px rgba(17,20,24,.1),0 1px 1px rgba(17,20,24,.2);opacity:.9;transition-duration:0}.bp5-card.bp5-interactive:active.bp5-dark,.bp5-dark .bp5-card.bp5-interactive:active{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 1px 1px 0 rgba(17,20,24,.4)}.bp5-collapse{height:0;overflow-y:hidden;transition:height .2s cubic-bezier(.4,1,.75,.9)}.bp5-collapse .bp5-collapse-body{transition:transform .2s cubic-bezier(.4,1,.75,.9)}.bp5-context-menu-virtual-target,.bp5-toast-container.bp5-toast-container-in-portal{position:fixed}.bp5-dialog-container{align-items:center;display:flex;justify-content:center;min-height:100%;opacity:1;transform:scale(1);-webkit-user-select:none;user-select:none;width:100%}.bp5-dialog-container.bp5-overlay-appear>.bp5-dialog,.bp5-dialog-container.bp5-overlay-enter>.bp5-dialog{opacity:0;transform:scale(.5)}.bp5-dialog-container.bp5-overlay-appear-active>.bp5-dialog,.bp5-dialog-container.bp5-overlay-enter-active>.bp5-dialog{opacity:1;transform:scale(1);transition:opacity .3s cubic-bezier(.54,1.12,.38,1.11) 0,transform .3s cubic-bezier(.54,1.12,.38,1.11) 0}.bp5-dialog-container.bp5-overlay-exit>.bp5-dialog{opacity:1;transform:scale(1)}.bp5-dialog-container.bp5-overlay-exit-active>.bp5-dialog{opacity:0;transform:scale(.5);transition:opacity .3s cubic-bezier(.54,1.12,.38,1.11) 0,transform .3s cubic-bezier(.54,1.12,.38,1.11) 0}.bp5-dialog{background:#f6f7f9;border-radius:4px;display:flex;flex-direction:column;margin:30px 0;pointer-events:all;-webkit-user-select:text;user-select:text;width:500px}.bp5-dialog:focus,.bp5-drawer:focus,.bp5-editable-text-input:focus,.bp5-overlay-backdrop:focus,.bp5-popover-transition-container:focus,.visual-node-editor :focus,body:not(.navigation-with-keyboard) :not(input):focus{outline:0}.bp5-dark .bp5-dialog,.bp5-dialog.bp5-dark{background:#252a31;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 2px 4px rgba(17,20,24,.4),0 8px 24px rgba(17,20,24,.4);color:#f6f7f9}.bp5-dialog-header{align-items:center;background:#fff;border-radius:4px 4px 0 0;box-shadow:0 1px 0 rgba(17,20,24,.15);display:flex;flex:0 0 auto;min-height:40px;padding:5px 5px 5px 15px;z-index:0}.bp5-dialog-header .bp5-icon,.bp5-dialog-header .bp5-icon-large{color:#5f6b7c;flex:0 0 auto;margin-left:-3px;margin-right:7.5px}.bp5-dialog-header .bp5-heading,.bp5-drawer-header .bp5-heading{flex:1 1 auto;line-height:inherit;margin:0}.bp5-dialog-header .bp5-heading:last-child{margin-right:15px}.bp5-dark .bp5-dialog-header{background:#2f343c;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2)}.bp5-dialog-body{flex:1 1 auto;margin:15px}.bp5-dialog-body-scroll-container{margin:0;max-height:70vh;overflow:auto;padding:15px}.bp5-dialog-footer{flex:0 0 auto;margin:15px}.bp5-dialog-footer-fixed{align-items:center;background-color:#fff;border-radius:0 0 4px 4px;border-top:1px solid rgba(17,20,24,.15);display:flex;gap:15px;justify-content:space-between;margin:0;padding:10px 10px 10px 15px}.bp5-dark .bp5-dialog-footer-fixed{background:#383e47;border-top:1px solid hsla(0,0%,100%,.2)}.bp5-dialog-footer-main-section{flex:1 0 auto}.bp5-dialog-footer-actions{display:flex;justify-content:flex-end}.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels:first-child .bp5-dialog-step-container:first-child,.bp5-multistep-dialog-panels:first-child .bp5-dialog-step-container:first-child{border-radius:4px 0 0}.bp5-multistep-dialog-panels:first-child .bp5-multistep-dialog-right-panel{border-top-right-radius:4px}.blogPostFooterDetailsFull_dOfN,.bp5-control-group.bp5-vertical,.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels{flex-direction:column}.bp5-multistep-dialog-nav-right .bp5-multistep-dialog-panels:first-child .bp5-dialog-step-container:first-child,.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels:first-child .bp5-dialog-step-container:last-child{border-radius:0 4px 0 0}.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels .bp5-multistep-dialog-left-panel{flex-direction:row}.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels .bp5-dialog-step-container:not(:first-child){border-left:1px solid rgba(17,20,24,.15)}.bp5-dark .bp5-multistep-dialog-nav-right .bp5-multistep-dialog-panels .bp5-multistep-dialog-right-panel,.bp5-dark .bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels .bp5-dialog-step-container{border-color:rgba(17,20,24,.4)}.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels .bp5-multistep-dialog-right-panel{border-left:none}.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels .bp5-multistep-dialog-footer,.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels .bp5-multistep-dialog-right-panel{border-radius:0 0 4px 4px}.bp5-multistep-dialog-nav-right .bp5-multistep-dialog-panels,.feature-strip:nth-child(2n) .feature-strip-inner{flex-direction:row-reverse}.bp5-multistep-dialog-nav-right .bp5-multistep-dialog-panels:first-child .bp5-multistep-dialog-right-panel{border-radius:4px 0 0 4px}.bp5-multistep-dialog-nav-right .bp5-multistep-dialog-panels .bp5-multistep-dialog-left-panel{border-radius:0 0 4px}.bp5-multistep-dialog-nav-right .bp5-multistep-dialog-panels .bp5-multistep-dialog-right-panel{border-left:none;border-radius:4px 0 0 4px;border-right:1px solid rgba(17,20,24,.15)}.bp5-multistep-dialog-nav-right .bp5-multistep-dialog-panels .bp5-dialog-footer{border-bottom-left-radius:0}.bp5-multistep-dialog-left-panel{display:flex;flex:1;flex-direction:column}.bp5-dark .bp5-multistep-dialog-left-panel{background:#252a31;border-bottom:1px solid hsla(0,0%,100%,.2);border-bottom-left-radius:4px;border-left:1px solid hsla(0,0%,100%,.2)}.bp5-multistep-dialog-right-panel{background-color:#f6f7f9;border-left:1px solid rgba(17,20,24,.15);border-radius:0 0 4px;flex:3;min-width:0}.bp5-dark .bp5-multistep-dialog-right-panel{background-color:#2f343c;border-bottom:1px solid hsla(0,0%,100%,.2);border-bottom-right-radius:4px;border-left:1px solid hsla(0,0%,100%,.2);border-right:1px solid hsla(0,0%,100%,.2)}.bp5-dialog-step-container{background-color:#f6f7f9;border-bottom:1px solid rgba(17,20,24,.15)}.bp5-dark .bp5-dialog-step-container{background:#2f343c;border-bottom:1px solid hsla(0,0%,100%,.2)}.bp5-dialog-step-container.bp5-dialog-step-viewed,.bp5-tag-input.bp5-active{background-color:#fff}.bp5-dark .bp5-dialog-step-container.bp5-dialog-step-viewed,.bp5-dark .bp5-dialog-step-viewed .bp5-dialog-step,.bp5-tag.bp5-interactive.bp5-active,.bp5-tag.bp5-interactive:active{background:#383e47}.bp5-dialog-step{align-items:center;border-radius:4px;cursor:not-allowed;display:flex;margin:4px;padding:6px 14px}.bp5-dark .bp5-dialog-step,.bp5-dark .bp5-dialog-step:hover,.bp5-dark .bp5-popover .bp5-popover-content,.bp5-popover.bp5-dark .bp5-popover-content{background:#2f343c}.bp5-dialog-step-viewed .bp5-dialog-step{background-color:#fff;cursor:pointer}.bp5-dialog-step:hover{background-color:#f6f7f9}.bp5-dialog-step-icon{align-items:center;background-color:rgba(95,107,124,.6);border-radius:50%;color:#fff;display:flex;height:25px;justify-content:center;width:25px}.bp5-dark .bp5-dialog-step-icon{background-color:rgba(171,179,191,.6)}.bp5-active.bp5-dialog-step-viewed .bp5-dialog-step-icon{background-color:#4c90f0}.bp5-dark .bp5-progress-bar .bp5-progress-meter,.bp5-dialog-step-viewed .bp5-dialog-step-icon{background-color:#8f99a8}.bp5-dialog-step-title{color:rgba(95,107,124,.6);flex:1;padding-left:10px}.bp5-active.bp5-dialog-step-viewed .bp5-dialog-step-title{color:#4c90f0}.bp5-drawer{background:#fff;box-shadow:0 0 0 1px rgba(17,20,24,.1),0 4px 8px rgba(17,20,24,.2),0 18px 46px 6px rgba(17,20,24,.2);display:flex;flex-direction:column;margin:0;padding:0}.bp5-drawer.bp5-position-top{height:50%;left:0;right:0;top:0}.bp5-drawer.bp5-position-top.bp5-overlay-appear,.bp5-drawer.bp5-position-top.bp5-overlay-enter{transform:translateY(-100%)}.bp5-drawer.bp5-position-bottom.bp5-overlay-appear-active,.bp5-drawer.bp5-position-bottom.bp5-overlay-enter-active,.bp5-drawer.bp5-position-top.bp5-overlay-appear-active,.bp5-drawer.bp5-position-top.bp5-overlay-enter-active{transform:translateY(0);transition:transform .2s cubic-bezier(.4,1,.75,.9) 0}.bp5-drawer.bp5-position-bottom.bp5-overlay-exit,.bp5-drawer.bp5-position-top.bp5-overlay-exit,.bp5-toast.bp5-toast-exit~.bp5-toast{transform:translateY(0)}.bp5-drawer.bp5-position-top.bp5-overlay-exit-active{transform:translateY(-100%);transition:transform .1s cubic-bezier(.4,1,.75,.9) 0}.bp5-drawer.bp5-position-bottom{bottom:0;height:50%;left:0;right:0}.bp5-drawer.bp5-position-bottom.bp5-overlay-appear,.bp5-drawer.bp5-position-bottom.bp5-overlay-enter{transform:translateY(100%)}.bp5-drawer.bp5-position-bottom.bp5-overlay-exit-active{transform:translateY(100%);transition:transform .1s cubic-bezier(.4,1,.75,.9) 0}.bp5-drawer.bp5-position-left{bottom:0;left:0;top:0;width:50%}.bp5-drawer.bp5-position-left.bp5-overlay-appear,.bp5-drawer.bp5-position-left.bp5-overlay-enter{transform:translateX(-100%)}.bp5-drawer.bp5-position-left.bp5-overlay-appear-active,.bp5-drawer.bp5-position-left.bp5-overlay-enter-active,.bp5-drawer.bp5-position-right.bp5-overlay-appear-active,.bp5-drawer.bp5-position-right.bp5-overlay-enter-active{transform:translateX(0);transition:transform .2s cubic-bezier(.4,1,.75,.9) 0}.bp5-drawer.bp5-position-left.bp5-overlay-exit,.bp5-drawer.bp5-position-right.bp5-overlay-exit{transform:translateX(0)}.bp5-drawer.bp5-position-left.bp5-overlay-exit-active{transform:translateX(-100%);transition:transform .1s cubic-bezier(.4,1,.75,.9) 0}.bp5-drawer.bp5-position-right{bottom:0;right:0;top:0;width:50%}.bp5-drawer.bp5-position-right.bp5-overlay-appear,.bp5-drawer.bp5-position-right.bp5-overlay-enter{transform:translateX(100%)}.bp5-drawer.bp5-position-right.bp5-overlay-exit-active{transform:translateX(100%);transition:transform .1s cubic-bezier(.4,1,.75,.9) 0}.bp5-dark .bp5-drawer,.bp5-drawer.bp5-dark{background:#383e47;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 2px 4px rgba(17,20,24,.4),0 8px 24px rgba(17,20,24,.4);color:#f6f7f9}.bp5-drawer-header{align-items:center;border-radius:0;box-shadow:0 1px 0 rgba(17,20,24,.15);display:flex;flex:0 0 auto;min-height:40px;padding:5px 5px 5px 20px;position:relative}.bp5-drawer-header .bp5-icon,.bp5-drawer-header .bp5-icon-large{color:#5f6b7c;flex:0 0 auto;margin-right:10px}.bp5-drawer-header .bp5-heading:last-child,.bp5-non-ideal-state.bp5-non-ideal-state-horizontal:before,.bp5-non-ideal-state.bp5-non-ideal-state-horizontal>*,.bp5-tab-list>:not(:last-child){margin-right:20px}.bp5-dark .bp5-drawer-header{box-shadow:0 1px 0 rgba(17,20,24,.4)}.bp5-drawer-body{flex:1 1 auto;line-height:18px;overflow:auto}.bp5-drawer-footer{box-shadow:inset 0 1px 0 rgba(17,20,24,.15);flex:0 0 auto;padding:10px 20px;position:relative}.bp5-dark .bp5-drawer-footer{box-shadow:inset 0 1px 0 rgba(17,20,24,.4)}.bp5-editable-text{cursor:text;display:inline-block;max-width:100%;position:relative;vertical-align:top;white-space:nowrap}.bp5-editable-text:before{border-radius:2px;bottom:-2px;content:"";left:-2px;position:absolute;right:-2px;top:-2px;transition:background-color .1s cubic-bezier(.4,1,.75,.9),box-shadow .1s cubic-bezier(.4,1,.75,.9)}.bp5-editable-text:hover:before{box-shadow:0 0 0 0 rgba(45,114,210,0),0 0 0 0 rgba(45,114,210,0),inset 0 0 0 1px rgba(17,20,24,.15)}.bp5-editable-text.bp5-editable-text-editing:before{background-color:#fff;box-shadow:inset 0 0 0 1px #2d72d2,0 0 0 2px rgba(45,114,210,.3),inset 0 1px 1px rgba(17,20,24,.2)}.bp5-editable-text.bp5-intent-primary .bp5-editable-text-content,.bp5-editable-text.bp5-intent-primary .bp5-editable-text-input,.bp5-editable-text.bp5-intent-primary .bp5-editable-text-input::placeholder{color:#2d72d2}.bp5-editable-text.bp5-intent-primary:hover:before{box-shadow:0 0 0 0 rgba(45,114,210,0),0 0 0 0 rgba(45,114,210,0),inset 0 0 0 1px rgba(45,114,210,.4)}.bp5-editable-text.bp5-intent-primary.bp5-editable-text-editing:before,.bp5-file-upload-input.bp5-active,.bp5-file-upload-input:focus,.bp5-input-group.bp5-intent-primary .bp5-input:focus,.bp5-input.bp5-active,.bp5-input.bp5-intent-primary:focus,.bp5-input:focus,.bp5-tag-input.bp5-active,.bp5-tag-input.bp5-active.bp5-intent-primary{box-shadow:inset 0 0 0 1px #2d72d2,0 0 0 2px rgba(45,114,210,.3),inset 0 1px 1px rgba(17,20,24,.2)}.bp5-editable-text.bp5-intent-success .bp5-editable-text-content,.bp5-editable-text.bp5-intent-success .bp5-editable-text-input,.bp5-editable-text.bp5-intent-success .bp5-editable-text-input::placeholder{color:#238551}.bp5-editable-text.bp5-intent-success:hover:before{box-shadow:0 0 0 0 rgba(35,133,81,0),0 0 0 0 rgba(35,133,81,0),inset 0 0 0 1px rgba(35,133,81,.4)}.bp5-editable-text.bp5-intent-success.bp5-editable-text-editing:before,.bp5-input-group.bp5-intent-success .bp5-input:focus,.bp5-input.bp5-intent-success:focus,.bp5-tag-input.bp5-active.bp5-intent-success{box-shadow:inset 0 0 0 1px #238551,0 0 0 2px rgba(35,133,81,.3),inset 0 1px 1px rgba(17,20,24,.2)}.bp5-editable-text.bp5-intent-warning .bp5-editable-text-content,.bp5-editable-text.bp5-intent-warning .bp5-editable-text-input,.bp5-editable-text.bp5-intent-warning .bp5-editable-text-input::placeholder{color:#c87619}.bp5-editable-text.bp5-intent-warning:hover:before{box-shadow:0 0 0 0 rgba(200,118,25,0),0 0 0 0 rgba(200,118,25,0),inset 0 0 0 1px rgba(200,118,25,.4)}.bp5-editable-text.bp5-intent-warning.bp5-editable-text-editing:before,.bp5-input-group.bp5-intent-warning .bp5-input:focus,.bp5-input.bp5-intent-warning:focus,.bp5-tag-input.bp5-active.bp5-intent-warning{box-shadow:inset 0 0 0 1px #c87619,0 0 0 2px rgba(200,118,25,.3),inset 0 1px 1px rgba(17,20,24,.2)}.bp5-editable-text.bp5-intent-danger .bp5-editable-text-content,.bp5-editable-text.bp5-intent-danger .bp5-editable-text-input,.bp5-editable-text.bp5-intent-danger .bp5-editable-text-input::placeholder{color:#cd4246}.bp5-editable-text.bp5-intent-danger:hover:before{box-shadow:0 0 0 0 rgba(205,66,70,0),0 0 0 0 rgba(205,66,70,0),inset 0 0 0 1px rgba(205,66,70,.4)}.bp5-editable-text.bp5-intent-danger.bp5-editable-text-editing:before,.bp5-input-group.bp5-intent-danger .bp5-input:focus,.bp5-input.bp5-intent-danger:focus,.bp5-tag-input.bp5-active.bp5-intent-danger{box-shadow:inset 0 0 0 1px #cd4246,0 0 0 2px rgba(205,66,70,.3),inset 0 1px 1px rgba(17,20,24,.2)}.bp5-dark .bp5-editable-text:hover:before{box-shadow:0 0 0 0 rgba(76,144,240,0),0 0 0 0 rgba(76,144,240,0),inset 0 0 0 1px hsla(0,0%,100%,.2)}.bp5-dark .bp5-editable-text.bp5-editable-text-editing:before{background-color:rgba(17,20,24,.3);box-shadow:inset 0 0 0 1px #4c90f0,0 0 0 2px rgba(76,144,240,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-editable-text.bp5-intent-primary .bp5-editable-text-content,.bp5-dark .bp5-editable-text.bp5-intent-primary .bp5-editable-text-input,.bp5-dark .bp5-editable-text.bp5-intent-primary .bp5-editable-text-input::placeholder{color:#8abbff}.bp5-dark .bp5-editable-text.bp5-intent-primary:hover:before{box-shadow:0 0 0 0 rgba(138,187,255,0),0 0 0 0 rgba(138,187,255,0),inset 0 0 0 1px rgba(138,187,255,.4)}.bp5-dark .bp5-editable-text.bp5-intent-primary.bp5-editable-text-editing:before{box-shadow:inset 0 0 0 1px #8abbff,0 0 0 2px rgba(138,187,255,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-editable-text.bp5-intent-success .bp5-editable-text-content,.bp5-dark .bp5-editable-text.bp5-intent-success .bp5-editable-text-input,.bp5-dark .bp5-editable-text.bp5-intent-success .bp5-editable-text-input::placeholder{color:#72ca9b}.bp5-dark .bp5-editable-text.bp5-intent-success:hover:before{box-shadow:0 0 0 0 rgba(114,202,155,0),0 0 0 0 rgba(114,202,155,0),inset 0 0 0 1px rgba(114,202,155,.4)}.bp5-dark .bp5-editable-text.bp5-intent-success.bp5-editable-text-editing:before{box-shadow:inset 0 0 0 1px #72ca9b,0 0 0 2px rgba(114,202,155,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-editable-text.bp5-intent-warning .bp5-editable-text-content,.bp5-dark .bp5-editable-text.bp5-intent-warning .bp5-editable-text-input,.bp5-dark .bp5-editable-text.bp5-intent-warning .bp5-editable-text-input::placeholder{color:#fbb360}.bp5-dark .bp5-editable-text.bp5-intent-warning:hover:before{box-shadow:0 0 0 0 rgba(251,179,96,0),0 0 0 0 rgba(251,179,96,0),inset 0 0 0 1px rgba(251,179,96,.4)}.bp5-dark .bp5-editable-text.bp5-intent-warning.bp5-editable-text-editing:before{box-shadow:inset 0 0 0 1px #fbb360,0 0 0 2px rgba(251,179,96,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-editable-text.bp5-intent-danger .bp5-editable-text-content,.bp5-dark .bp5-editable-text.bp5-intent-danger .bp5-editable-text-input,.bp5-dark .bp5-editable-text.bp5-intent-danger .bp5-editable-text-input::placeholder{color:#fa999c}.bp5-dark .bp5-editable-text.bp5-intent-danger:hover:before{box-shadow:0 0 0 0 rgba(250,153,156,0),0 0 0 0 rgba(250,153,156,0),inset 0 0 0 1px rgba(250,153,156,.4)}.bp5-dark .bp5-editable-text.bp5-intent-danger.bp5-editable-text-editing:before{box-shadow:inset 0 0 0 1px #fa999c,0 0 0 2px rgba(250,153,156,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-editable-text.bp5-disabled:before{box-shadow:none!important}.bp5-editable-text-content,.bp5-editable-text-input{color:inherit;display:inherit;font:inherit;letter-spacing:inherit;max-width:inherit;min-width:inherit;position:relative;resize:none;text-transform:inherit;vertical-align:top}.admonitionHeading_xHAi code,.bp5-control{text-transform:none}.bp5-editable-text-input{background:none;border:none;box-shadow:none;padding:0;white-space:pre-wrap;width:100%}.bp5-editable-text-input::placeholder{color:#5f6b7c;opacity:1}.bp5-editable-text-input::-ms-clear{display:none}.bp5-editable-text-content{overflow:hidden;padding-right:2px;text-overflow:ellipsis;white-space:pre}.bp5-editable-text-editing>.bp5-editable-text-content{left:0;position:absolute;visibility:hidden}.bp5-control,.bp5-file-input{cursor:pointer;position:relative}.bp5-editable-text.bp5-multiline,.bp5-icon>svg,.bp5-spinner svg,.bp5-submenu .bp5-popover-target,.bp5-submenu>.bp5-popover-wrapper,.flyde-flow-editor footer,.flyde-flow-editor header,.flyde-flow-editor main,.flyde-flow-editor nav,.flyde-flow-editor section,.tocCollapsibleContent_KxYB a,form,label.bp5-label:not(.bp5-inline) .bp5-popover-target{display:block}.bp5-editable-text.bp5-multiline .bp5-editable-text-content{word-wrap:break-word;overflow:auto;white-space:pre-wrap}.bp5-divider{border-bottom:1px solid rgba(17,20,24,.15);border-right:1px solid rgba(17,20,24,.15);margin:5px}.bp5-control-group{align-items:stretch;display:flex;flex-direction:row;transform:translateZ(0)}.bp5-control-group .bp5-input,.ins-view.inline-node-edited{z-index:2}.bp5-control-group .bp5-input:focus{z-index:14}.bp5-control-group .bp5-input-group[class*=bp5-intent] .bp5-input,.bp5-control-group .bp5-input[class*=bp5-intent]{z-index:13}.bp5-control-group .bp5-input-group[class*=bp5-intent] .bp5-input:focus,.bp5-control-group .bp5-input[class*=bp5-intent]:focus{z-index:15}.bp5-control-group .bp5-button,.bp5-control-group .bp5-html-select select,.bp5-control-group .bp5-select select{transform:translateZ(0);z-index:4}.bp5-control-group .bp5-input-group>.bp5-button,.bp5-control-group .bp5-input-group>.bp5-icon,.bp5-control-group .bp5-input-group>.bp5-input-action,.bp5-control-group .bp5-input-group>.bp5-input-left-container{z-index:16}.bp5-control-group .bp5-html-select:after,.bp5-control-group .bp5-html-select>.bp5-icon,.bp5-control-group .bp5-select:after,.bp5-control-group .bp5-select>.bp5-icon{z-index:17}.bp5-control-group .bp5-html-select:focus-within,.bp5-control-group .bp5-select:focus-within{z-index:5}.bp5-control-group:not(.bp5-vertical)>:not(:last-child){margin-right:2px}.bp5-control-group.bp5-fill,.bp5-file-input.bp5-fill,.bp5-html-select.bp5-fill,.bp5-html-select.bp5-fill select,.bp5-multi-select-popover.bp5-popover-match-target-width,.bp5-popover-target.bp5-fill,.bp5-popover.bp5-popover-match-target-width,.bp5-select-popover.bp5-popover-match-target-width,.bp5-select.bp5-fill,.bp5-select.bp5-fill select,.bp5-suggest-popover.bp5-popover-match-target-width{width:100%}.bp5-control-group.bp5-vertical>:not(:last-child){margin-bottom:2px}.bp5-control{display:block;margin-bottom:10px}.bp5-control input:checked~.bp5-control-indicator{background-color:#2d72d2;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2);color:#fff}.bp5-control:hover input:checked~.bp5-control-indicator{background-color:#215db0}.bp5-control input:not(:disabled):active:checked~.bp5-control-indicator{background:#184a90}.bp5-control input:disabled:checked~.bp5-control-indicator,.bp5-dark .bp5-control input:disabled:checked~.bp5-control-indicator{background:rgba(45,114,210,.5);box-shadow:none;color:hsla(0,0%,100%,.6)}.bp5-dark .bp5-control input:checked~.bp5-control-indicator{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1)}.bp5-dark .bp5-control:hover input:checked~.bp5-control-indicator{background-color:#215db0;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1)}.bp5-dark .bp5-control input:not(:disabled):active:checked~.bp5-control-indicator{background-color:#184a90;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1)}.bp5-control:not(.bp5-align-right){padding-left:26px}.bp5-control:not(.bp5-align-right) .bp5-control-indicator{margin-left:-26px}.bp5-control.bp5-align-right{padding-right:26px}.bp5-control.bp5-align-right .bp5-control-indicator{margin-right:-26px;float:right;margin-left:10px;margin-top:1px}.bp5-control.bp5-inline{display:inline-block;margin-right:20px}.bp5-control input{left:0;opacity:0;position:absolute;top:0;z-index:-1}.bp5-control .bp5-control-indicator{background-clip:padding-box;background-color:transparent;border:none;box-shadow:inset 0 0 0 1px #738091;cursor:pointer;display:inline-block;font-size:16px;height:1em;margin-right:10px;margin-top:-3px;position:relative;-webkit-user-select:none;user-select:none;vertical-align:middle;width:1em}.bp5-control .bp5-control-indicator:before{content:"";display:block;height:1em;width:1em}.bp5-control:hover .bp5-control-indicator,.bp5-dark .bp5-control:hover .bp5-control-indicator,.bp5-tree-node-content:hover{background-color:rgba(143,153,168,.15)}.bp5-control input:not(:disabled):active~.bp5-control-indicator{background:rgba(143,153,168,.3);box-shadow:inset 0 0 0 1px #738091}.bp5-control input:disabled~.bp5-control-indicator,.bp5-dark .bp5-control input:disabled~.bp5-control-indicator{background:rgba(143,153,168,.15);box-shadow:none;cursor:not-allowed}.bp5-control input:focus~.bp5-control-indicator{-moz-outline-radius:6px;outline:#2d72d2 solid 2px;outline-offset:2px}.bp5-control.bp5-large:not(.bp5-align-right),.bp5-input-group .bp5-input:not(:first-child){padding-left:30px}.bp5-control.bp5-large:not(.bp5-align-right) .bp5-control-indicator{margin-left:-30px}.bp5-control.bp5-large.bp5-align-right,.bp5-input-group .bp5-input:not(:last-child){padding-right:30px}.bp5-control.bp5-large.bp5-align-right .bp5-control-indicator{margin-right:-30px;margin-top:0}.bp5-control.bp5-large .bp5-control-indicator,.react-counter button{font-size:20px}.bp5-control.bp5-checkbox input:indeterminate~.bp5-control-indicator{background-color:#2d72d2;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2);color:#fff}.bp5-control.bp5-checkbox:hover input:indeterminate~.bp5-control-indicator{background-color:#215db0}.bp5-control.bp5-checkbox input:not(:disabled):active:indeterminate~.bp5-control-indicator{background:#184a90}.bp5-control.bp5-checkbox input:disabled:indeterminate~.bp5-control-indicator{background:rgba(45,114,210,.5);box-shadow:none;color:hsla(0,0%,100%,.6)}.bp5-dark .bp5-control.bp5-checkbox input:indeterminate~.bp5-control-indicator{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1)}.bp5-dark .bp5-control.bp5-checkbox:hover input:indeterminate~.bp5-control-indicator{background-color:#215db0;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1)}.bp5-dark .bp5-control.bp5-checkbox input:not(:disabled):active:indeterminate~.bp5-control-indicator{background-color:#184a90;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1)}.bp5-dark .bp5-control.bp5-checkbox input:disabled:indeterminate~.bp5-control-indicator{background:rgba(45,114,210,.5);box-shadow:none;color:hsla(0,0%,100%,.6)}.bp5-control.bp5-checkbox .bp5-control-indicator{border-radius:2px}.bp5-control.bp5-checkbox input:checked~.bp5-control-indicator:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 5c-.28 0-.53.11-.71.29L7 9.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42l3 3c.18.18.43.29.71.29s.53-.11.71-.29l5-5A1.003 1.003 0 0 0 12 5z' fill='%23fff'/%3E%3C/svg%3E")}.bp5-control.bp5-checkbox input:indeterminate~.bp5-control-indicator:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11 7H5c-.55 0-1 .45-1 1s.45 1 1 1h6c.55 0 1-.45 1-1s-.45-1-1-1z' fill='%23fff'/%3E%3C/svg%3E")}.bp5-control.bp5-radio .bp5-control-indicator{border-radius:50%}.bp5-control.bp5-radio input:checked~.bp5-control-indicator:before{background-image:radial-gradient(#fff,#fff 28%,transparent 32%)}.bp5-control.bp5-radio input:focus~.bp5-control-indicator{-moz-outline-radius:16px}.bp5-control.bp5-switch input~.bp5-control-indicator{background:rgba(143,153,168,.3);color:#1c2127}.bp5-control.bp5-switch:hover input~.bp5-control-indicator{background:rgba(143,153,168,.4)}.bp5-control.bp5-switch input:not(:disabled):active~.bp5-control-indicator{background:rgba(143,153,168,.5)}.bp5-control.bp5-switch input:disabled~.bp5-control-indicator{background:rgba(143,153,168,.15);color:rgba(95,107,124,.6)}.bp5-control.bp5-switch input:disabled~.bp5-control-indicator:before{background:hsla(0,0%,100%,.8);box-shadow:none}.bp5-control.bp5-switch input:checked~.bp5-control-indicator,.bp5-dark .bp5-control.bp5-switch input:checked~.bp5-control-indicator,.bp5-tag.bp5-intent-primary,.bp5-tooltip.bp5-intent-primary .bp5-popover-content{background:#2d72d2;color:#fff}.bp5-control.bp5-switch:hover input:checked~.bp5-control-indicator,.bp5-dark .bp5-control.bp5-switch:hover input:checked~.bp5-control-indicator{background:#215db0}.bp5-control.bp5-switch input:checked:not(:disabled):active~.bp5-control-indicator,.bp5-dark .bp5-control.bp5-switch input:checked:not(:disabled):active~.bp5-control-indicator{background:#184a90}.bp5-control.bp5-switch input:checked:disabled~.bp5-control-indicator{background:rgba(45,114,210,.5);color:hsla(0,0%,100%,.6)}.bp5-control.bp5-switch input:checked:disabled~.bp5-control-indicator:before{background:hsla(0,0%,100%,.5);box-shadow:none}.bp5-control.bp5-switch:not(.bp5-align-right) .bp5-control-indicator{margin-left:-38px}.bp5-control.bp5-switch.bp5-align-right{padding-right:38px}.bp5-control.bp5-switch.bp5-align-right .bp5-control-indicator{margin-right:-38px}.bp5-control.bp5-switch .bp5-control-indicator{border:none;border-radius:1.75em;box-shadow:none!important;min-width:1.75em;transition:background-color .1s cubic-bezier(.4,1,.75,.9);width:auto}.bp5-control.bp5-switch .bp5-control-indicator:before{background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(17,20,24,.5);height:calc(1em - 4px);left:0;margin:2px;position:absolute;transition:left .1s cubic-bezier(.4,1,.75,.9);width:calc(1em - 4px)}.bp5-file-upload-input,.bp5-input{-webkit-appearance:none;border:none;box-shadow:0 0 0 0 rgba(45,114,210,0),0 0 0 0 rgba(45,114,210,0),inset 0 0 0 1px rgba(17,20,24,.2),inset 0 1px 1px rgba(17,20,24,.5);height:30px;line-height:30px;transition:box-shadow .1s cubic-bezier(.4,1,.75,.9);font-weight:400;vertical-align:middle;font-size:14px;outline:0}.bp5-control.bp5-switch input:checked~.bp5-control-indicator:before{left:calc(100% - 1em)}.bp5-control.bp5-switch.bp5-large:not(.bp5-align-right){padding-left:45px}.bp5-control.bp5-switch.bp5-large:not(.bp5-align-right) .bp5-control-indicator{margin-left:-45px}.bp5-control.bp5-switch.bp5-large.bp5-align-right{padding-right:45px}.bp5-control.bp5-switch.bp5-large.bp5-align-right .bp5-control-indicator{margin-right:-45px}.bp5-dark .bp5-control.bp5-switch input~.bp5-control-indicator{background:rgba(17,20,24,.5);color:#f6f7f9}.bp5-dark .bp5-control.bp5-switch:hover input~.bp5-control-indicator{background:rgba(17,20,24,.8)}.bp5-dark .bp5-control.bp5-switch input:not(:disabled):active~.bp5-control-indicator{background:rgba(17,20,24,.9)}.bp5-dark .bp5-control.bp5-switch input:disabled~.bp5-control-indicator{background:rgba(143,153,168,.15);color:rgba(171,179,191,.6)}.bp5-dark .bp5-control.bp5-switch input:disabled~.bp5-control-indicator:before{background:rgba(171,179,191,.5);box-shadow:none}.bp5-dark .bp5-control.bp5-switch input:checked:disabled~.bp5-control-indicator{background:rgba(45,114,210,.5);color:rgba(171,179,191,.6)}.bp5-dark .bp5-control.bp5-switch input:checked~.bp5-control-indicator:before,.bp5-input,.bp5-menu,.feature-strip:nth-child(2n){background:#fff}.bp5-dark .bp5-control.bp5-switch input:checked:disabled~.bp5-control-indicator:before{background:hsla(0,0%,100%,.3);box-shadow:none}.bp5-dark .bp5-control.bp5-switch .bp5-control-indicator:before,.bp5-dark .bp5-tag.bp5-interactive:hover{background:#abb3bf}.bp5-control.bp5-switch .bp5-switch-inner-text{font-size:.7em;text-align:center}.bp5-control.bp5-switch .bp5-control-indicator-child:first-child{line-height:0;margin-left:.5em;margin-right:1.2em;visibility:hidden}.bp5-control.bp5-switch .bp5-control-indicator-child:last-child{line-height:1em;margin-left:1.2em;margin-right:.5em;visibility:visible}.bp5-control.bp5-switch input:checked~.bp5-control-indicator .bp5-control-indicator-child:first-child{line-height:1em;visibility:visible}.bp5-control.bp5-switch input:checked~.bp5-control-indicator .bp5-control-indicator-child:last-child{line-height:0;visibility:hidden}.bp5-dark .bp5-control .bp5-control-indicator{background-color:transparent;box-shadow:inset 0 0 0 1px #8f99a8}.bp5-dark .bp5-control input:focus~.bp5-control-indicator{outline:#8abbff solid 2px}.bp5-dark .bp5-control input:not(:disabled):active~.bp5-control-indicator{background:rgba(143,153,168,.3);box-shadow:inset 0 0 0 1px #8f99a8}.bp5-dark .bp5-control.bp5-checkbox input:disabled:checked~.bp5-control-indicator,.bp5-dark .bp5-control.bp5-checkbox input:disabled:indeterminate~.bp5-control-indicator{background:rgba(45,114,210,.5)}.bp5-file-input{display:inline-block;height:30px}.bp5-file-upload-input,.bp5-file-upload-input:after{position:absolute;top:0;right:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.bp5-file-input input{margin:0;min-width:200px;opacity:0}.bp5-file-input input.bp5-disabled+.bp5-file-upload-input,.bp5-file-input input:disabled+.bp5-file-upload-input,.bp5-file-upload-input.bp5-disabled,.bp5-file-upload-input:disabled,.bp5-input.bp5-disabled,.bp5-input:disabled{background:rgba(211,216,222,.5);box-shadow:none;color:rgba(95,107,124,.6);cursor:not-allowed;resize:none}.bp5-file-input input.bp5-disabled+.bp5-file-upload-input::placeholder,.bp5-file-input input:disabled+.bp5-file-upload-input::placeholder{color:rgba(95,107,124,.6)}.bp5-dark .bp5-file-input input.bp5-disabled+.bp5-file-upload-input,.bp5-dark .bp5-file-input input:disabled+.bp5-file-upload-input,.bp5-dark .bp5-file-upload-input.bp5-disabled,.bp5-dark .bp5-file-upload-input:disabled,.bp5-dark .bp5-input.bp5-disabled,.bp5-dark .bp5-input:disabled{background:rgba(64,72,84,.5);box-shadow:none;color:rgba(171,179,191,.6)}.bp5-file-upload-input:active:after,.bp5-file-upload-input:hover:after,.bp5-slider-handle:hover{box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-file-input.bp5-large,.bp5-large .bp5-file-input{height:40px}.bp5-file-input.bp5-small,.bp5-small .bp5-file-input{height:24px}.bp5-file-input .bp5-file-upload-input-custom-text:after{content:attr(bp5-button-text)}.bp5-file-upload-input{appearance:none;background:#fff;border-radius:2px;color:rgba(95,107,124,.6);left:0;padding:0 80px 0 10px;-webkit-user-select:none;user-select:none}.bp5-file-upload-input::placeholder{color:#5f6b7c;opacity:1}.bp5-file-upload-input.bp5-round,.bp5-file-upload-input[type=search],.bp5-input.bp5-round,.bp5-input[type=search]{border-radius:30px;box-sizing:border-box;padding-left:10px}.bp5-file-upload-input[readonly],.bp5-input[readonly]{box-shadow:inset 0 0 0 1px rgba(17,20,24,.15)}.bp5-file-upload-input.bp5-disabled::placeholder,.bp5-file-upload-input:disabled::placeholder{color:rgba(95,107,124,.6)}.bp5-file-upload-input:after{background-color:#f6f7f9;border-radius:2px;color:#1c2127;content:"Browse";line-height:24px;margin:3px;min-height:24px;min-width:24px;text-align:center;width:70px}.bp5-file-upload-input:hover:after{background-clip:padding-box;background-color:#edeff2}.bp5-file-upload-input:active:after{background-color:#dce0e5}.bp5-large .bp5-file-upload-input{font-size:16px;height:40px;line-height:40px;padding-right:95px}.bp5-input-group.bp5-large .bp5-input.bp5-round,.bp5-input-group.bp5-large .bp5-input[type=search],.bp5-input.bp5-large.bp5-round,.bp5-input.bp5-large[type=search],.bp5-large .bp5-file-upload-input.bp5-round,.bp5-large .bp5-file-upload-input[type=search]{padding:0 15px}.bp5-large .bp5-file-upload-input:after{line-height:30px;margin:5px;min-height:30px;min-width:30px;width:85px}.bp5-small .bp5-file-upload-input{font-size:12px;height:24px;line-height:24px;padding-left:8px;padding-right:65px}.bp5-input-group.bp5-small .bp5-input.bp5-round,.bp5-input-group.bp5-small .bp5-input[type=search],.bp5-input.bp5-small.bp5-round,.bp5-input.bp5-small[type=search],.bp5-small .bp5-file-upload-input.bp5-round,.bp5-small .bp5-file-upload-input[type=search]{padding:0 12px}.bp5-small .bp5-file-upload-input:after{line-height:20px;margin:2px;min-height:20px;min-width:20px;width:55px}.bp5-dark .bp5-file-upload-input{background:rgba(17,20,24,.3);box-shadow:0 0 0 0 rgba(76,144,240,0),0 0 0 0 rgba(76,144,240,0),0 0 0 0 rgba(76,144,240,0),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8;color:rgba(171,179,191,.6)}.bp5-dark .bp5-file-upload-input::placeholder{color:#abb3bf}.bp5-dark .bp5-file-upload-input:focus,.bp5-dark .bp5-input:focus{box-shadow:inset 0 0 0 1px #4c90f0,inset 0 0 0 1px #4c90f0,0 0 0 2px rgba(76,144,240,.3)}.bp5-dark .bp5-file-upload-input[readonly],.bp5-dark .bp5-input[readonly]{box-shadow:inset 0 0 0 1px rgba(17,20,24,.4)}.bp5-form-group{display:flex;flex-direction:column;margin:0 0 15px}.bp5-form-group .bp5-control{margin-top:7px}.bp5-form-group .bp5-form-group-sub-label,.bp5-form-group .bp5-form-helper-text{color:#5f6b7c;font-size:12px}.bp5-form-group.bp5-inline{align-items:flex-start;flex-direction:row}.bp5-form-group.bp5-inline.bp5-large label.bp5-label{line-height:40px;margin:0 10px 0 0}.bp5-form-group.bp5-inline label.bp5-label{line-height:30px;margin:0 10px 0 0}.bp5-form-group.bp5-disabled .bp5-form-group-sub-label,.bp5-form-group.bp5-disabled .bp5-form-helper-text,.bp5-form-group.bp5-disabled .bp5-label,.bp5-form-group.bp5-disabled .bp5-text-muted,.bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:disabled,.bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:disabled .bp5-icon,.bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:disabled .bp5-icon-large,.bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:disabled .bp5-icon-standard,.bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:disabled,.bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:disabled .bp5-icon,.bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:disabled .bp5-icon-large,.bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:disabled .bp5-icon-standard,.bp5-menu-item.bp5-disabled,.bp5-menu-item.bp5-disabled .bp5-menu-item-icon,.bp5-menu-item.bp5-disabled .bp5-menu-item-label,.bp5-menu-item.bp5-disabled .bp5-submenu-icon,.bp5-menu-item.bp5-disabled:before{color:rgba(95,107,124,.6)!important}.bp5-dark .bp5-form-group.bp5-intent-primary .bp5-form-group-sub-label,.bp5-dark .bp5-form-group.bp5-intent-primary .bp5-form-helper-text,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-primary,.bp5-dark .bp5-input-group.bp5-intent-primary>.bp5-icon,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-primary,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-] .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-] .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover:before,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-primary,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-primary{color:#8abbff}.bp5-dark .bp5-form-group.bp5-intent-success .bp5-form-group-sub-label,.bp5-dark .bp5-form-group.bp5-intent-success .bp5-form-helper-text,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-success,.bp5-dark .bp5-input-group.bp5-intent-success>.bp5-icon,.bp5-dark .bp5-menu-item.bp5-intent-success,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-success,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-success .bp5-tag-remove,.bp5-dark .bp5-tree .bp5-icon-large.bp5-intent-success,.bp5-dark .bp5-tree .bp5-icon-standard.bp5-intent-success,.bp5-dark .bp5-tree .bp5-icon.bp5-intent-success,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-success,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-success,.bp5-tooltip .bp5-icon-large.bp5-intent-success,.bp5-tooltip .bp5-icon-standard.bp5-intent-success,.bp5-tooltip .bp5-icon.bp5-intent-success{color:#72ca9b}.bp5-dark .bp5-form-group.bp5-intent-warning .bp5-form-group-sub-label,.bp5-dark .bp5-form-group.bp5-intent-warning .bp5-form-helper-text,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-warning,.bp5-dark .bp5-input-group.bp5-intent-warning>.bp5-icon,.bp5-dark .bp5-menu-item.bp5-intent-warning,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-warning,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-warning .bp5-tag-remove,.bp5-dark .bp5-tree .bp5-icon-large.bp5-intent-warning,.bp5-dark .bp5-tree .bp5-icon-standard.bp5-intent-warning,.bp5-dark .bp5-tree .bp5-icon.bp5-intent-warning,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-warning,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-warning,.bp5-tooltip .bp5-icon-large.bp5-intent-warning,.bp5-tooltip .bp5-icon-standard.bp5-intent-warning,.bp5-tooltip .bp5-icon.bp5-intent-warning{color:#fbb360}.bp5-dark .bp5-form-group.bp5-intent-danger .bp5-form-group-sub-label,.bp5-dark .bp5-form-group.bp5-intent-danger .bp5-form-helper-text,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-danger,.bp5-dark .bp5-input-group.bp5-intent-danger>.bp5-icon,.bp5-dark .bp5-menu-item.bp5-intent-danger,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-danger,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-danger .bp5-tag-remove,.bp5-dark .bp5-tree .bp5-icon-large.bp5-intent-danger,.bp5-dark .bp5-tree .bp5-icon-standard.bp5-intent-danger,.bp5-dark .bp5-tree .bp5-icon.bp5-intent-danger,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-danger,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-danger,.bp5-tooltip .bp5-icon-large.bp5-intent-danger,.bp5-tooltip .bp5-icon-standard.bp5-intent-danger,.bp5-tooltip .bp5-icon.bp5-intent-danger{color:#fa999c}.bp5-dark .bp5-form-group .bp5-form-helper-text,.bp5-dark .bp5-input-group .bp5-icon,.bp5-dark .bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:not(:hover):not(:focus),.bp5-dark .bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:not(:hover):not(:focus){color:#abb3bf}.bp5-dark .bp5-form-group.bp5-disabled .bp5-form-group-sub-label,.bp5-dark .bp5-form-group.bp5-disabled .bp5-form-helper-text,.bp5-dark .bp5-form-group.bp5-disabled .bp5-label,.bp5-dark .bp5-form-group.bp5-disabled .bp5-text-muted,.bp5-dark .bp5-menu-item.bp5-disabled,.bp5-dark .bp5-menu-item.bp5-disabled .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-disabled .bp5-menu-item-label,.bp5-dark .bp5-menu-item.bp5-disabled .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-disabled:before{color:rgba(171,179,191,.6)!important}.bp5-input-group{display:block;position:relative}.bp5-input-group .bp5-input{position:relative;width:100%}.bp5-input-group .bp5-input-action,.bp5-input-group>.bp5-button,.bp5-input-group>.bp5-icon,.bp5-input-group>.bp5-input-left-container{position:absolute;top:0}.bp5-input-group .bp5-input-action:first-child,.bp5-input-group>.bp5-button:first-child,.bp5-input-group>.bp5-icon:first-child,.bp5-input-group>.bp5-input-left-container:first-child{left:0}.bp5-input-group .bp5-input-action:last-child,.bp5-input-group>.bp5-button:last-child,.bp5-input-group>.bp5-icon:last-child,.bp5-input-group>.bp5-input-left-container:last-child{right:0}.bp5-input-group .bp5-button{margin:3px;min-height:24px;min-width:24px;padding:0 7px}.bp5-input-group>.bp5-icon:empty,.bp5-input-group>.bp5-input-left-container>.bp5-icon:empty{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:blueprint-icons-16,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:400;height:16px;line-height:1;width:16px}.bp5-input-group .bp5-input-action>.bp5-spinner,.bp5-input-group>.bp5-icon,.bp5-input-group>.bp5-input-left-container>.bp5-icon{margin:7px}.bp5-input-group .bp5-tag,.playground-container hr{margin:5px}.bp5-input-group.bp5-disabled .bp5-icon{color:rgba(95,107,124,.6)}.bp5-input-group.bp5-large .bp5-button{margin:5px;min-height:30px;min-width:30px}.bp5-input-group.bp5-large .bp5-input-action>.bp5-spinner,.bp5-input-group.bp5-large>.bp5-icon,.bp5-input-group.bp5-large>.bp5-input-left-container>.bp5-icon{margin:12px}.bp5-input-group.bp5-large .bp5-input,.bp5-input.bp5-large{font-size:16px;height:40px;line-height:40px}.bp5-input-group.bp5-large .bp5-input:not(:first-child){padding-left:40px}.bp5-input-group.bp5-large .bp5-input:not(:last-child){padding-right:40px}.bp5-input-group.bp5-small .bp5-button,.bp5-input-group.bp5-small .bp5-tag{margin:2px;min-height:20px;min-width:20px}.bp5-input-group.bp5-small .bp5-input-action>.bp5-spinner,.bp5-input-group.bp5-small>.bp5-icon,.bp5-input-group.bp5-small>.bp5-input-left-container>.bp5-icon{margin:4px}.bp5-input-group.bp5-small .bp5-input,.bp5-input.bp5-small{font-size:12px;height:24px;line-height:24px;padding-left:8px;padding-right:8px}.bp5-input-group.bp5-small .bp5-input:not(:first-child){padding-left:24px}.bp5-input-group.bp5-small .bp5-input:not(:last-child){padding-right:24px}.bp5-input-group.bp5-fill,.bp5-input.bp5-fill{flex:1 1 auto;width:100%}.bp5-input-group.bp5-round .bp5-button,.bp5-input-group.bp5-round .bp5-input,.bp5-input-group.bp5-round .bp5-tag{border-radius:30px}.bp5-input-group.bp5-intent-primary .bp5-input,.bp5-input.bp5-intent-primary{box-shadow:0 0 0 0 rgba(45,114,210,0),0 0 0 0 rgba(45,114,210,0),inset 0 0 0 1px #2d72d2,inset 0 0 0 1px rgba(17,20,24,.2),inset 0 1px 1px rgba(17,20,24,.5)}.bp5-input-group.bp5-intent-primary .bp5-input[readonly],.bp5-input.bp5-intent-primary[readonly]{box-shadow:inset 0 0 0 1px #2d72d2}.bp5-dark .bp5-input-group.bp5-intent-primary .bp5-input,.bp5-dark .bp5-input.bp5-intent-primary{box-shadow:0 0 0 0 rgba(76,144,240,0),0 0 0 0 rgba(76,144,240,0),0 0 0 0 rgba(76,144,240,0),inset 0 0 0 1px #4c90f0,inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-input-group.bp5-intent-primary .bp5-input:focus,.bp5-dark .bp5-input.bp5-intent-primary:focus{box-shadow:inset 0 0 0 1px #4c90f0,inset 0 0 0 1px #4c90f0,0 0 0 2px rgba(76,144,240,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-input-group.bp5-intent-primary .bp5-input[readonly],.bp5-dark .bp5-input.bp5-intent-primary[readonly]{box-shadow:inset 0 0 0 1px #4c90f0}.bp5-input-group.bp5-intent-success .bp5-input,.bp5-input.bp5-intent-success{box-shadow:0 0 0 0 rgba(35,133,81,0),0 0 0 0 rgba(35,133,81,0),inset 0 0 0 1px #238551,inset 0 0 0 1px rgba(17,20,24,.2),inset 0 1px 1px rgba(17,20,24,.5)}.bp5-input-group.bp5-intent-success .bp5-input[readonly],.bp5-input.bp5-intent-success[readonly]{box-shadow:inset 0 0 0 1px #238551}.bp5-dark .bp5-input-group.bp5-intent-success .bp5-input,.bp5-dark .bp5-input.bp5-intent-success{box-shadow:0 0 0 0 rgba(50,164,103,0),0 0 0 0 rgba(50,164,103,0),0 0 0 0 rgba(50,164,103,0),inset 0 0 0 1px #32a467,inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-input-group.bp5-intent-success .bp5-input:focus,.bp5-dark .bp5-input.bp5-intent-success:focus{box-shadow:inset 0 0 0 1px #32a467,inset 0 0 0 1px #32a467,0 0 0 2px rgba(50,164,103,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-input-group.bp5-intent-success .bp5-input[readonly],.bp5-dark .bp5-input.bp5-intent-success[readonly]{box-shadow:inset 0 0 0 1px #32a467}.bp5-input-group.bp5-intent-warning .bp5-input,.bp5-input.bp5-intent-warning{box-shadow:0 0 0 0 rgba(200,118,25,0),0 0 0 0 rgba(200,118,25,0),inset 0 0 0 1px #c87619,inset 0 0 0 1px rgba(17,20,24,.2),inset 0 1px 1px rgba(17,20,24,.5)}.bp5-input-group.bp5-intent-warning .bp5-input[readonly],.bp5-input.bp5-intent-warning[readonly]{box-shadow:inset 0 0 0 1px #c87619}.bp5-dark .bp5-input-group.bp5-intent-warning .bp5-input,.bp5-dark .bp5-input.bp5-intent-warning{box-shadow:0 0 0 0 rgba(236,154,60,0),0 0 0 0 rgba(236,154,60,0),0 0 0 0 rgba(236,154,60,0),inset 0 0 0 1px #ec9a3c,inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-input-group.bp5-intent-warning .bp5-input:focus,.bp5-dark .bp5-input.bp5-intent-warning:focus{box-shadow:inset 0 0 0 1px #ec9a3c,inset 0 0 0 1px #ec9a3c,0 0 0 2px rgba(236,154,60,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-input-group.bp5-intent-warning .bp5-input[readonly],.bp5-dark .bp5-input.bp5-intent-warning[readonly]{box-shadow:inset 0 0 0 1px #ec9a3c}.bp5-input-group.bp5-intent-danger .bp5-input,.bp5-input.bp5-intent-danger{box-shadow:0 0 0 0 rgba(205,66,70,0),0 0 0 0 rgba(205,66,70,0),inset 0 0 0 1px #cd4246,inset 0 0 0 1px rgba(17,20,24,.2),inset 0 1px 1px rgba(17,20,24,.5)}.bp5-input-group.bp5-intent-danger .bp5-input[readonly],.bp5-input.bp5-intent-danger[readonly]{box-shadow:inset 0 0 0 1px #cd4246}.bp5-dark .bp5-input-group.bp5-intent-danger .bp5-input,.bp5-dark .bp5-input.bp5-intent-danger{box-shadow:0 0 0 0 rgba(231,106,110,0),0 0 0 0 rgba(231,106,110,0),0 0 0 0 rgba(231,106,110,0),inset 0 0 0 1px #e76a6e,inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-input-group.bp5-intent-danger .bp5-input:focus,.bp5-dark .bp5-input.bp5-intent-danger:focus{box-shadow:inset 0 0 0 1px #e76a6e,inset 0 0 0 1px #e76a6e,0 0 0 2px rgba(231,106,110,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-input-group.bp5-intent-danger .bp5-input[readonly],.bp5-dark .bp5-input.bp5-intent-danger[readonly]{box-shadow:inset 0 0 0 1px #e76a6e}.bp5-input{appearance:none;border-radius:2px;color:#1c2127;padding:0 10px}.bp5-input::placeholder{color:#5f6b7c;opacity:1}.bp5-input.bp5-disabled::placeholder,.bp5-input:disabled::placeholder{color:rgba(95,107,124,.6)}.bp5-dark .bp5-input{background:rgba(17,20,24,.3);box-shadow:0 0 0 0 rgba(76,144,240,0),0 0 0 0 rgba(76,144,240,0),0 0 0 0 rgba(76,144,240,0),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8;color:#f6f7f9}.bp5-dark .bp5-input::placeholder{color:#abb3bf}.bp5-input::-ms-clear{display:none}@supports (-webkit-touch-callout:none){input.bp5-input.bp5-disabled,input.bp5-input:disabled{-webkit-text-fill-color:rgba(95,107,124,.6);opacity:1}.bp5-dark input.bp5-input.bp5-disabled,.bp5-dark input.bp5-input:disabled{-webkit-text-fill-color:rgba(171,179,191,.6)}}textarea.bp5-input{max-width:100%;padding:10px}textarea.bp5-input,textarea.bp5-input.bp5-large,textarea.bp5-input.bp5-small{height:auto;line-height:inherit}textarea.bp5-input.bp5-small{padding:8px}label.bp5-label{display:block;margin-bottom:15px;margin-top:0}label.bp5-label .bp5-html-select,label.bp5-label .bp5-input,label.bp5-label .bp5-popover-target,label.bp5-label .bp5-popover-wrapper,label.bp5-label .bp5-select,label.bp5-label .bp5-slider{display:block;margin-top:5px;text-transform:none}label.bp5-label .bp5-html-select select,label.bp5-label .bp5-select select{font-weight:400;vertical-align:top;width:100%}.bp5-dark .bp5-tooltip .bp5-text-disabled,.bp5-disabled.bp5-select:after,.bp5-html-select .bp5-disabled.bp5-icon,.bp5-select .bp5-disabled.bp5-icon,.bp5-tooltip.bp5-dark .bp5-text-disabled,label.bp5-label.bp5-disabled,label.bp5-label.bp5-disabled .bp5-text-muted{color:rgba(95,107,124,.6)}.bp5-tag-input.bp5-large .bp5-input-ghost,label.bp5-label.bp5-inline{line-height:30px}.bp5-select:after,span.bp5-icon-large,span.bp5-icon-standard,span.bp5-icon:empty{line-height:1;font-style:normal;font-weight:400}label.bp5-label.bp5-inline .bp5-html-select,label.bp5-label.bp5-inline .bp5-input,label.bp5-label.bp5-inline .bp5-input-group,label.bp5-label.bp5-inline .bp5-popover-wrapper,label.bp5-label.bp5-inline .bp5-select{display:inline-block;margin:0 0 0 5px;vertical-align:top}label.bp5-label.bp5-inline .bp5-button-group,label.bp5-label.bp5-inline .bp5-control-group{margin:0 0 0 5px}.bp5-slider-handle.bp5-end .bp5-slider-label,label.bp5-label.bp5-inline .bp5-input-group .bp5-input{margin-left:0}label.bp5-label.bp5-inline.bp5-large{line-height:40px}.bp5-numeric-input .bp5-button-group.bp5-vertical>.bp5-button{flex:1 1 11px;min-height:0;padding:0;width:24px}.bp5-numeric-input.bp5-large .bp5-button-group.bp5-vertical>.bp5-button{width:40px}.bp5-numeric-input.bp5-small .bp5-button-group.bp5-vertical>.bp5-button{width:24px}.bp5-html-select select,.bp5-select select{align-items:center;-moz-appearance:none;-webkit-appearance:none;background-color:#f6f7f9;border:none;border-radius:2px;color:#1c2127;cursor:pointer;display:inline-flex;flex-direction:row;font-size:14px;height:30px;justify-content:center;padding:0 25px 0 10px;text-align:left;vertical-align:middle;width:100%}.bp5-menu-item:before,.bp5-select:after,span.bp5-icon-standard{font-family:blueprint-icons-16,sans-serif;width:16px}.bp5-html-select select.bp5-disabled.bp5-active,.bp5-html-select select:disabled.bp5-active,.bp5-select select.bp5-disabled.bp5-active,.bp5-select select:disabled.bp5-active{background:rgba(211,216,222,.7)}.bp5-html-select.bp5-minimal select.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal select:disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-disabled.bp5-active,.bp5-select.bp5-minimal select:disabled.bp5-active{background:rgba(143,153,168,.3)}.bp5-dark .bp5-html-select.bp5-minimal select.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select:active,.bp5-dark .bp5-select.bp5-minimal select.bp5-active,.bp5-dark .bp5-select.bp5-minimal select:active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select:active,.bp5-select.bp5-minimal .bp5-dark select.bp5-active,.bp5-select.bp5-minimal .bp5-dark select:active{background:rgba(143,153,168,.3)}.bp5-dark .bp5-html-select.bp5-minimal select.bp5-disabled.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select:disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select:disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select:disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select:disabled.bp5-active{background:rgba(143,153,168,.3)}.bp5-html-select.bp5-minimal select.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-primary:disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-primary:disabled.bp5-active{background:rgba(45,114,210,.3)}.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-primary:disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-primary:disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-primary:disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-primary:disabled.bp5-active{background:rgba(45,114,210,.3)}.bp5-html-select.bp5-minimal select.bp5-intent-success.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-success:disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-success.bp5-disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-success:disabled.bp5-active{background:rgba(35,133,81,.3)}.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-success.bp5-disabled.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-success:disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-success.bp5-disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-success:disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-success.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-success:disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-success.bp5-disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-success:disabled.bp5-active{background:rgba(35,133,81,.3)}.bp5-html-select.bp5-minimal select.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-warning:disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-warning:disabled.bp5-active{background:rgba(200,118,25,.3)}.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-warning:disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-warning:disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-warning:disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-warning:disabled.bp5-active{background:rgba(200,118,25,.3)}.bp5-html-select.bp5-minimal select.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-danger:disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-danger:disabled.bp5-active{background:rgba(205,66,70,.3)}.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-danger:disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-danger:disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-danger:disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-danger:disabled.bp5-active{background:rgba(205,66,70,.3)}.bp5-html-select.bp5-large select,.bp5-select.bp5-large select{font-size:16px;height:40px;padding-right:35px}.bp5-dark .bp5-html-select select.bp5-disabled.bp5-active,.bp5-dark .bp5-html-select select:disabled.bp5-active,.bp5-dark .bp5-select select.bp5-disabled.bp5-active,.bp5-dark .bp5-select select:disabled.bp5-active{background:rgba(64,72,84,.7)}.bp5-html-select select:disabled,.bp5-select select:disabled{background-color:rgba(211,216,222,.5);box-shadow:none;color:rgba(95,107,124,.6);cursor:not-allowed}.bp5-html-select .bp5-icon,.bp5-select .bp5-icon,.bp5-select:after{color:#5f6b7c;pointer-events:none;position:absolute;right:7px;top:7px}.bp5-html-select,.bp5-select{display:inline-block;letter-spacing:normal;position:relative;vertical-align:middle}.bp5-html-select select::-ms-expand,.bp5-select select::-ms-expand{display:none}.bp5-dark .bp5-html-select .bp5-icon,.bp5-dark .bp5-html-select:after,.bp5-dark .bp5-menu-item .bp5-menu-item-icon,.bp5-dark .bp5-menu-item .bp5-menu-item-label,.bp5-dark .bp5-menu-item .bp5-submenu-icon,.bp5-dark .bp5-menu-item:before,.bp5-dark .bp5-menu-item:hover .bp5-menu-item-icon,.bp5-dark .bp5-menu-item:hover .bp5-submenu-icon,.bp5-dark .bp5-non-ideal-state,.bp5-dark .bp5-non-ideal-state .bp5-heading,.bp5-dark .bp5-select .bp5-icon,.bp5-dark .bp5-select:after,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]) .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]) .bp5-submenu-icon,.bp5-dark .bp5-tag-input .bp5-tag-input-icon,.bp5-dark .bp5-tag.bp5-minimal:not([class*=bp5-intent-]) .bp5-tag-remove,.bp5-tag-input.bp5-dark .bp5-tag-input-icon{color:#abb3bf}.bp5-html-select.bp5-large .bp5-icon,.bp5-html-select.bp5-large:after,.bp5-select.bp5-large .bp5-icon,.bp5-select.bp5-large:after{right:12px;top:12px}.bp5-dark .bp5-html-select option,.bp5-dark .bp5-select option{background-color:#2f343c;color:#f6f7f9}.bp5-select:after{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;content:"\f184";font-size:16px;font-variant:normal;height:16px}.bp5-running-text table,table.bp5-html-table{border-spacing:0;font-size:14px}.bp5-running-text table td,.bp5-running-text table th,table.bp5-html-table td,table.bp5-html-table th{padding:11px;text-align:left;vertical-align:top}.bp5-running-text table th,table.bp5-html-table th{color:#1c2127;font-weight:600}.bp5-running-text table tbody tr:first-child td,.bp5-running-text table tbody tr:first-child th,.bp5-running-text table tfoot tr:first-child td,.bp5-running-text table tfoot tr:first-child th,table.bp5-html-table tbody tr:first-child td,table.bp5-html-table tbody tr:first-child th,table.bp5-html-table tfoot tr:first-child td,table.bp5-html-table tfoot tr:first-child th,table.bp5-html-table.bp5-html-table-bordered tbody tr td,table.bp5-html-table.bp5-html-table-bordered tfoot tr td{box-shadow:inset 0 1px 0 0 rgba(17,20,24,.15)}.bp5-dark .bp5-running-text table tbody tr:first-child td,.bp5-dark .bp5-running-text table tbody tr:first-child th,.bp5-dark .bp5-running-text table tfoot tr:first-child td,.bp5-dark .bp5-running-text table tfoot tr:first-child th,.bp5-dark table.bp5-html-table tbody tr:first-child td,.bp5-dark table.bp5-html-table tbody tr:first-child th,.bp5-dark table.bp5-html-table tfoot tr:first-child td,.bp5-dark table.bp5-html-table tfoot tr:first-child th,.bp5-dark table.bp5-html-table.bp5-html-table-bordered tbody tr td,.bp5-dark table.bp5-html-table.bp5-html-table-bordered tfoot tr td,.bp5-running-text .bp5-dark table tbody tr:first-child td,.bp5-running-text .bp5-dark table tbody tr:first-child th,.bp5-running-text .bp5-dark table tfoot tr:first-child td,.bp5-running-text .bp5-dark table tfoot tr:first-child th{box-shadow:inset 0 1px 0 0 hsla(0,0%,100%,.2)}table.bp5-html-table.bp5-compact td,table.bp5-html-table.bp5-compact th{padding-bottom:6px;padding-top:6px}table.bp5-html-table.bp5-html-table-bordered th:not(:first-child),table.bp5-html-table.bp5-html-table-bordered.bp5-html-table-striped tbody tr:not(:first-child) td:not(:first-child){box-shadow:inset 1px 0 0 0 rgba(17,20,24,.15)}table.bp5-html-table.bp5-html-table-bordered tbody tr td:not(:first-child),table.bp5-html-table.bp5-html-table-bordered tfoot tr td:not(:first-child){box-shadow:inset 1px 1px 0 0 rgba(17,20,24,.15)}table.bp5-html-table.bp5-interactive tbody tr:hover td{background-color:rgba(143,153,168,.3);cursor:pointer}table.bp5-html-table.bp5-interactive tbody tr:active td{background-color:rgba(143,153,168,.35)}.bp5-dark table.bp5-html-table.bp5-html-table-striped tbody tr:nth-child(odd) td{background:rgba(95,107,124,.15)}.bp5-dark table.bp5-html-table.bp5-html-table-bordered th:not(:first-child),.bp5-dark table.bp5-html-table.bp5-html-table-bordered.bp5-html-table-striped tbody tr:not(:first-child) td{box-shadow:inset 1px 0 0 0 hsla(0,0%,100%,.2)}.bp5-dark table.bp5-html-table.bp5-html-table-bordered tbody tr td:not(:first-child),.bp5-dark table.bp5-html-table.bp5-html-table-bordered tfoot tr td:not(:first-child){box-shadow:inset 1px 1px 0 0 hsla(0,0%,100%,.2)}.bp5-dark table.bp5-html-table.bp5-interactive tbody tr:hover td{background-color:rgba(95,107,124,.3);cursor:pointer}.bp5-dark table.bp5-html-table.bp5-interactive tbody tr:active td{background-color:rgba(95,107,124,.4)}.bp5-key-combo{align-items:center;display:flex;flex-direction:row}.bp5-hotkey-dialog{padding-bottom:0;top:40px}.bp5-hotkey-dialog .bp5-dialog-body,.output-jsx>main li,.output-log>main li{margin:0;padding:0}.bp5-hotkey-column{margin:auto;max-height:80vh;overflow-y:auto;padding:30px}.bp5-hotkey-column .bp5-heading,.bp5-non-ideal-state:before,.bp5-non-ideal-state>*{margin-bottom:20px}.bp5-hotkey-column .bp5-heading:not(:first-child){margin-top:40px}.bp5-hotkey{align-items:center;display:flex;justify-content:space-between;margin-left:0;margin-right:0}.add-node-menu header,.bp5-hotkey:not(:last-child),.data-inspection-modal .main-wrapper .content-wrapper .info,.run-flow-modal .execution-delay-wrapper label{margin-bottom:10px}.bp5-icon{display:inline-block;flex:0 0 auto;vertical-align:text-bottom}.bp5-icon:not(:empty):before{content:""!important;content:unset!important}.bp5-dark .bp5-tag .bp5-icon-large,.bp5-dark .bp5-tag .bp5-icon-standard,.bp5-dark .bp5-tag>.bp5-icon,.bp5-icon>svg:not([fill]){fill:currentcolor}span.bp5-icon-standard{font-size:16px;height:16px}.bp5-large .bp5-menu-item:before,.bp5-large .bp5-tag-remove:empty:before,span.bp5-icon-large{font-family:blueprint-icons-20,sans-serif;font-size:20px}span.bp5-icon-large,span.bp5-icon-standard{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-variant:normal}span.bp5-icon-large{height:20px;width:20px}.home-page a,.output-jsx>main button{font-size:30px}span.bp5-icon:empty{font-family:blueprint-icons-20;font-size:inherit}span.bp5-icon:empty:before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.bp5-icon-add:before{content:"\f109"}.bp5-icon-add-clip:before{content:"\f101"}.bp5-icon-add-column-left:before{content:"\f102"}.bp5-icon-add-column-right:before{content:"\f103"}.bp5-icon-add-location:before{content:"\f104"}.bp5-icon-add-row-bottom:before{content:"\f105"}.bp5-icon-add-row-top:before{content:"\f106"}.bp5-icon-add-to-artifact:before{content:"\f107"}.bp5-icon-add-to-folder:before{content:"\f108"}.bp5-icon-aimpoints-target:before{content:"\f335"}.bp5-icon-airplane:before{content:"\f10a"}.bp5-icon-align-center:before{content:"\f10b"}.bp5-icon-align-justify:before{content:"\f10c"}.bp5-icon-align-left:before{content:"\f10d"}.bp5-icon-align-right:before{content:"\f10e"}.bp5-icon-alignment-bottom:before{content:"\f10f"}.bp5-icon-alignment-horizontal-center:before{content:"\f110"}.bp5-icon-alignment-left:before{content:"\f111"}.bp5-icon-alignment-right:before{content:"\f112"}.bp5-icon-alignment-top:before{content:"\f113"}.bp5-icon-alignment-vertical-center:before{content:"\f114"}.bp5-icon-ammunition:before{content:"\f342"}.bp5-icon-anchor:before{content:"\f330"}.bp5-icon-annotation:before{content:"\f115"}.bp5-icon-antenna:before{content:"\f116"}.bp5-icon-app-header:before{content:"\f117"}.bp5-icon-application:before{content:"\f118"}.bp5-icon-applications:before{content:"\f119"}.bp5-icon-archive:before{content:"\f11a"}.bp5-icon-area-of-interest:before{content:"\f11b"}.bp5-icon-array:before{content:"\f121"}.bp5-icon-array-boolean:before{content:"\f11c"}.bp5-icon-array-date:before{content:"\f11d"}.bp5-icon-array-floating-point:before{content:"\f32d"}.bp5-icon-array-numeric:before{content:"\f11e"}.bp5-icon-array-string:before{content:"\f11f"}.bp5-icon-array-timestamp:before{content:"\f120"}.bp5-icon-arrow-bottom-left:before{content:"\f122"}.bp5-icon-arrow-bottom-right:before{content:"\f123"}.bp5-icon-arrow-down:before{content:"\f124"}.bp5-icon-arrow-left:before{content:"\f125"}.bp5-icon-arrow-right:before{content:"\f126"}.bp5-icon-arrow-top-left:before{content:"\f127"}.bp5-icon-arrow-top-right:before{content:"\f128"}.bp5-icon-arrow-up:before{content:"\f129"}.bp5-icon-arrows-horizontal:before{content:"\f12a"}.bp5-icon-arrows-vertical:before{content:"\f12b"}.bp5-icon-asterisk:before{content:"\f12c"}.bp5-icon-at:before{content:"\f331"}.bp5-icon-automatic-updates:before{content:"\f12d"}.bp5-icon-axle:before{content:"\f338"}.bp5-icon-backlink:before{content:"\f12e"}.bp5-icon-badge:before{content:"\f12f"}.bp5-icon-ban-circle:before{content:"\f130"}.bp5-icon-bank-account:before{content:"\f131"}.bp5-icon-barcode:before{content:"\f132"}.bp5-icon-blank:before{content:"\f133"}.bp5-icon-blocked-person:before{content:"\f134"}.bp5-icon-bold:before{content:"\f135"}.bp5-icon-book:before{content:"\f136"}.bp5-icon-bookmark:before{content:"\f137"}.bp5-icon-box:before{content:"\f138"}.bp5-icon-briefcase:before{content:"\f139"}.bp5-icon-bring-data:before{content:"\f13a"}.bp5-icon-bug:before{content:"\f32e"}.bp5-icon-buggy:before{content:"\f13b"}.bp5-icon-build:before{content:"\f13c"}.bp5-icon-calculator:before{content:"\f13d"}.bp5-icon-calendar:before{content:"\f13e"}.bp5-icon-camera:before{content:"\f13f"}.bp5-icon-caret-down:before{content:"\f140"}.bp5-icon-caret-left:before{content:"\f141"}.bp5-icon-caret-right:before{content:"\f142"}.bp5-icon-caret-up:before{content:"\f143"}.bp5-icon-cargo-ship:before{content:"\f144"}.bp5-icon-cell-tower:before{content:"\f145"}.bp5-icon-changes:before{content:"\f146"}.bp5-icon-chart:before{content:"\f147"}.bp5-icon-chat:before{content:"\f148"}.bp5-icon-chevron-backward:before{content:"\f149"}.bp5-icon-chevron-down:before{content:"\f14a"}.bp5-icon-chevron-forward:before{content:"\f14b"}.bp5-icon-chevron-left:before{content:"\f14c"}.bp5-icon-chevron-right:before,.bp5-tree-node-caret.bp5-icon-standard:before{content:"\f14d"}.bp5-icon-chevron-up:before{content:"\f14e"}.bp5-icon-circle:before{content:"\f153"}.bp5-icon-circle-arrow-down:before{content:"\f14f"}.bp5-icon-circle-arrow-left:before{content:"\f150"}.bp5-icon-circle-arrow-right:before{content:"\f151"}.bp5-icon-circle-arrow-up:before{content:"\f152"}.bp5-icon-citation:before{content:"\f154"}.bp5-icon-clean:before{content:"\f155"}.bp5-icon-clip:before{content:"\f156"}.bp5-icon-clipboard:before{content:"\f157"}.bp5-icon-cloud:before{content:"\f15a"}.bp5-icon-cloud-download:before{content:"\f158"}.bp5-icon-cloud-upload:before{content:"\f159"}.bp5-icon-code:before{content:"\f15c"}.bp5-icon-code-block:before{content:"\f15b"}.bp5-icon-cog:before{content:"\f15d"}.bp5-icon-collapse-all:before{content:"\f15e"}.bp5-icon-color-fill:before{content:"\f328"}.bp5-icon-column-layout:before{content:"\f15f"}.bp5-icon-comment:before{content:"\f160"}.bp5-icon-comparison:before{content:"\f161"}.bp5-icon-compass:before{content:"\f162"}.bp5-icon-compressed:before{content:"\f163"}.bp5-icon-confirm:before{content:"\f164"}.bp5-icon-console:before{content:"\f165"}.bp5-icon-contrast:before{content:"\f166"}.bp5-icon-control:before{content:"\f167"}.bp5-icon-credit-card:before{content:"\f168"}.bp5-icon-cross:before{content:"\f169"}.bp5-icon-cross-circle:before{content:"\f336"}.bp5-icon-crown:before{content:"\f16a"}.bp5-icon-cube:before{content:"\f16d"}.bp5-icon-cube-add:before{content:"\f16b"}.bp5-icon-cube-remove:before{content:"\f16c"}.bp5-icon-curved-range-chart:before{content:"\f16e"}.bp5-icon-cut:before{content:"\f16f"}.bp5-icon-cycle:before{content:"\f170"}.bp5-icon-dashboard:before{content:"\f171"}.bp5-icon-data-connection:before{content:"\f172"}.bp5-icon-data-lineage:before{content:"\f173"}.bp5-icon-database:before{content:"\f174"}.bp5-icon-delete:before{content:"\f175"}.bp5-icon-delta:before{content:"\f176"}.bp5-icon-derive-column:before{content:"\f177"}.bp5-icon-desktop:before{content:"\f178"}.bp5-icon-detection:before{content:"\f341"}.bp5-icon-diagnosis:before{content:"\f179"}.bp5-icon-diagram-tree:before{content:"\f17a"}.bp5-icon-direction-left:before{content:"\f17b"}.bp5-icon-direction-right:before{content:"\f17c"}.bp5-icon-disable:before{content:"\f17d"}.bp5-icon-divide:before{content:"\f327"}.bp5-icon-document:before{content:"\f180"}.bp5-icon-document-open:before{content:"\f17e"}.bp5-icon-document-share:before{content:"\f17f"}.bp5-icon-dollar:before{content:"\f181"}.bp5-icon-dot:before{content:"\f182"}.bp5-icon-double-caret-horizontal:before{content:"\f183"}.bp5-icon-double-caret-vertical:before{content:"\f184"}.bp5-icon-double-chevron-down:before{content:"\f185"}.bp5-icon-double-chevron-left:before{content:"\f186"}.bp5-icon-double-chevron-right:before{content:"\f187"}.bp5-icon-double-chevron-up:before{content:"\f188"}.bp5-icon-doughnut-chart:before{content:"\f189"}.bp5-icon-download:before{content:"\f18a"}.bp5-icon-drag-handle-horizontal:before{content:"\f18b"}.bp5-icon-drag-handle-vertical:before{content:"\f18c"}.bp5-icon-draw:before{content:"\f18d"}.bp5-icon-drawer-left:before{content:"\f18f"}.bp5-icon-drawer-left-filled:before{content:"\f18e"}.bp5-icon-drawer-right:before{content:"\f191"}.bp5-icon-drawer-right-filled:before{content:"\f190"}.bp5-icon-drive-time:before{content:"\f192"}.bp5-icon-duplicate:before{content:"\f193"}.bp5-icon-edit:before{content:"\f194"}.bp5-icon-eject:before{content:"\f195"}.bp5-icon-emoji:before{content:"\f196"}.bp5-icon-endorsed:before{content:"\f197"}.bp5-icon-envelope:before{content:"\f198"}.bp5-icon-equals:before{content:"\f199"}.bp5-icon-eraser:before{content:"\f19a"}.bp5-icon-error:before{content:"\f19b"}.bp5-icon-euro:before{content:"\f19c"}.bp5-icon-exchange:before{content:"\f19d"}.bp5-icon-exclude-row:before{content:"\f19e"}.bp5-icon-expand-all:before{content:"\f19f"}.bp5-icon-export:before{content:"\f1a0"}.bp5-icon-eye-off:before{content:"\f1a1"}.bp5-icon-eye-on:before{content:"\f1a2"}.bp5-icon-eye-open:before{content:"\f1a3"}.bp5-icon-fast-backward:before{content:"\f1a4"}.bp5-icon-fast-forward:before{content:"\f1a5"}.bp5-icon-feed:before{content:"\f1a7"}.bp5-icon-feed-subscribed:before{content:"\f1a6"}.bp5-icon-film:before{content:"\f1a8"}.bp5-icon-filter:before{content:"\f1ad"}.bp5-icon-filter-keep:before{content:"\f1a9"}.bp5-icon-filter-list:before{content:"\f1aa"}.bp5-icon-filter-open:before{content:"\f1ab"}.bp5-icon-filter-remove:before{content:"\f1ac"}.bp5-icon-flag:before{content:"\f1ae"}.bp5-icon-flame:before{content:"\f1af"}.bp5-icon-flash:before{content:"\f1b0"}.bp5-icon-floating-point:before{content:"\f32c"}.bp5-icon-floppy-disk:before{content:"\f1b1"}.bp5-icon-flow-branch:before{content:"\f1b2"}.bp5-icon-flow-end:before{content:"\f1b3"}.bp5-icon-flow-linear:before{content:"\f1b4"}.bp5-icon-flow-review:before{content:"\f1b6"}.bp5-icon-flow-review-branch:before{content:"\f1b5"}.bp5-icon-flows:before{content:"\f1b7"}.bp5-icon-folder-close:before{content:"\f1b8"}.bp5-icon-folder-new:before{content:"\f1b9"}.bp5-icon-folder-open:before{content:"\f1ba"}.bp5-icon-folder-shared:before{content:"\f1bc"}.bp5-icon-folder-shared-open:before{content:"\f1bb"}.bp5-icon-follower:before{content:"\f1bd"}.bp5-icon-following:before{content:"\f1be"}.bp5-icon-font:before{content:"\f1bf"}.bp5-icon-fork:before{content:"\f1c0"}.bp5-icon-form:before{content:"\f1c1"}.bp5-icon-fuel:before{content:"\f323"}.bp5-icon-full-circle:before{content:"\f1c2"}.bp5-icon-full-stacked-chart:before{content:"\f1c3"}.bp5-icon-fullscreen:before{content:"\f1c4"}.bp5-icon-function:before{content:"\f1c5"}.bp5-icon-gantt-chart:before{content:"\f1c6"}.bp5-icon-geofence:before{content:"\f1c7"}.bp5-icon-geolocation:before{content:"\f1c8"}.bp5-icon-geosearch:before{content:"\f1c9"}.bp5-icon-git-branch:before{content:"\f1ca"}.bp5-icon-git-commit:before{content:"\f1cb"}.bp5-icon-git-merge:before{content:"\f1cc"}.bp5-icon-git-new-branch:before{content:"\f1cd"}.bp5-icon-git-pull:before{content:"\f1ce"}.bp5-icon-git-push:before{content:"\f1cf"}.bp5-icon-git-repo:before{content:"\f1d0"}.bp5-icon-glass:before{content:"\f1d1"}.bp5-icon-globe:before{content:"\f1d3"}.bp5-icon-globe-network:before{content:"\f1d2"}.bp5-icon-graph:before{content:"\f1d5"}.bp5-icon-graph-remove:before{content:"\f1d4"}.bp5-icon-greater-than:before{content:"\f1d7"}.bp5-icon-greater-than-or-equal-to:before{content:"\f1d6"}.bp5-icon-grid:before{content:"\f1d9"}.bp5-icon-grid-view:before{content:"\f1d8"}.bp5-icon-group-objects:before{content:"\f1da"}.bp5-icon-grouped-bar-chart:before{content:"\f1db"}.bp5-icon-hand:before{content:"\f1e0"}.bp5-icon-hand-down:before{content:"\f1dc"}.bp5-icon-hand-left:before{content:"\f1dd"}.bp5-icon-hand-right:before{content:"\f1de"}.bp5-icon-hand-up:before{content:"\f1df"}.bp5-icon-hat:before{content:"\f1e1"}.bp5-icon-header:before{content:"\f1e5"}.bp5-icon-header-one:before{content:"\f1e2"}.bp5-icon-header-three:before{content:"\f1e3"}.bp5-icon-header-two:before{content:"\f1e4"}.bp5-icon-headset:before{content:"\f1e6"}.bp5-icon-heart:before{content:"\f1e8"}.bp5-icon-heart-broken:before{content:"\f1e7"}.bp5-icon-heat-grid:before{content:"\f1e9"}.bp5-icon-heatmap:before{content:"\f1ea"}.bp5-icon-helicopter:before{content:"\f1eb"}.bp5-icon-help:before{content:"\f1ec"}.bp5-icon-helper-management:before{content:"\f1ed"}.bp5-icon-high-priority:before{content:"\f1ee"}.bp5-icon-high-voltage-pole:before{content:"\f333"}.bp5-icon-highlight:before{content:"\f1ef"}.bp5-icon-history:before{content:"\f1f0"}.bp5-icon-home:before{content:"\f1f1"}.bp5-icon-horizontal-bar-chart:before{content:"\f1f4"}.bp5-icon-horizontal-bar-chart-asc:before{content:"\f1f2"}.bp5-icon-horizontal-bar-chart-desc:before{content:"\f1f3"}.bp5-icon-horizontal-distribution:before{content:"\f1f5"}.bp5-icon-horizontal-inbetween:before{content:"\f329"}.bp5-icon-hurricane:before{content:"\f1f6"}.bp5-icon-id-number:before{content:"\f1f7"}.bp5-icon-image-rotate-left:before{content:"\f1f8"}.bp5-icon-image-rotate-right:before{content:"\f1f9"}.bp5-icon-import:before{content:"\f1fa"}.bp5-icon-inbox:before{content:"\f1ff"}.bp5-icon-inbox-filtered:before{content:"\f1fb"}.bp5-icon-inbox-geo:before{content:"\f1fc"}.bp5-icon-inbox-search:before{content:"\f1fd"}.bp5-icon-inbox-update:before{content:"\f1fe"}.bp5-icon-info-sign:before{content:"\f200"}.bp5-icon-inheritance:before{content:"\f201"}.bp5-icon-inherited-group:before{content:"\f202"}.bp5-icon-inner-join:before{content:"\f203"}.bp5-icon-insert:before{content:"\f204"}.bp5-icon-intelligence:before{content:"\f337"}.bp5-icon-intersection:before{content:"\f205"}.bp5-icon-ip-address:before{content:"\f206"}.bp5-icon-issue:before{content:"\f209"}.bp5-icon-issue-closed:before{content:"\f207"}.bp5-icon-issue-new:before{content:"\f208"}.bp5-icon-italic:before{content:"\f20a"}.bp5-icon-join-table:before{content:"\f20b"}.bp5-icon-key:before{content:"\f215"}.bp5-icon-key-backspace:before{content:"\f20c"}.bp5-icon-key-command:before{content:"\f20d"}.bp5-icon-key-control:before{content:"\f20e"}.bp5-icon-key-delete:before{content:"\f20f"}.bp5-icon-key-enter:before{content:"\f210"}.bp5-icon-key-escape:before{content:"\f211"}.bp5-icon-key-option:before{content:"\f212"}.bp5-icon-key-shift:before{content:"\f213"}.bp5-icon-key-tab:before{content:"\f214"}.bp5-icon-known-vehicle:before{content:"\f216"}.bp5-icon-lab-test:before{content:"\f217"}.bp5-icon-label:before{content:"\f218"}.bp5-icon-layer:before{content:"\f21a"}.bp5-icon-layer-outline:before{content:"\f219"}.bp5-icon-layers:before{content:"\f21b"}.bp5-icon-layout:before{content:"\f225"}.bp5-icon-layout-auto:before{content:"\f21c"}.bp5-icon-layout-balloon:before{content:"\f21d"}.bp5-icon-layout-circle:before{content:"\f21e"}.bp5-icon-layout-grid:before{content:"\f21f"}.bp5-icon-layout-group-by:before{content:"\f220"}.bp5-icon-layout-hierarchy:before{content:"\f221"}.bp5-icon-layout-linear:before{content:"\f222"}.bp5-icon-layout-skew-grid:before{content:"\f223"}.bp5-icon-layout-sorted-clusters:before{content:"\f224"}.bp5-icon-learning:before{content:"\f226"}.bp5-icon-left-join:before{content:"\f227"}.bp5-icon-lengthen-text:before{content:"\f33e"}.bp5-icon-less-than:before{content:"\f229"}.bp5-icon-less-than-or-equal-to:before{content:"\f228"}.bp5-icon-lifesaver:before{content:"\f22a"}.bp5-icon-lightbulb:before{content:"\f22b"}.bp5-icon-lightning:before{content:"\f22c"}.bp5-icon-link:before{content:"\f22d"}.bp5-icon-list:before{content:"\f230"}.bp5-icon-list-columns:before{content:"\f22e"}.bp5-icon-list-detail-view:before{content:"\f22f"}.bp5-icon-locate:before{content:"\f231"}.bp5-icon-lock:before{content:"\f232"}.bp5-icon-locomotive:before{content:"\f33b"}.bp5-icon-log-in:before{content:"\f233"}.bp5-icon-log-out:before{content:"\f234"}.bp5-icon-low-voltage-pole:before{content:"\f332"}.bp5-icon-manual:before{content:"\f235"}.bp5-icon-manually-entered-data:before{content:"\f236"}.bp5-icon-many-to-many:before{content:"\f237"}.bp5-icon-many-to-one:before{content:"\f238"}.bp5-icon-map:before{content:"\f23b"}.bp5-icon-map-create:before{content:"\f239"}.bp5-icon-map-marker:before{content:"\f23a"}.bp5-icon-maximize:before{content:"\f23c"}.bp5-icon-media:before{content:"\f23d"}.bp5-icon-menu:before{content:"\f240"}.bp5-icon-menu-closed:before{content:"\f23e"}.bp5-icon-menu-open:before{content:"\f23f"}.bp5-icon-merge-columns:before{content:"\f241"}.bp5-icon-merge-links:before{content:"\f242"}.bp5-icon-minimize:before{content:"\f243"}.bp5-icon-minus:before{content:"\f244"}.bp5-icon-mobile-phone:before{content:"\f245"}.bp5-icon-mobile-video:before{content:"\f246"}.bp5-icon-modal:before{content:"\f248"}.bp5-icon-modal-filled:before{content:"\f247"}.bp5-icon-model:before{content:"\f33d"}.bp5-icon-moon:before{content:"\f249"}.bp5-icon-more:before{content:"\f24a"}.bp5-icon-mountain:before{content:"\f24b"}.bp5-icon-move:before{content:"\f24c"}.bp5-icon-mugshot:before{content:"\f24d"}.bp5-icon-multi-select:before{content:"\f24e"}.bp5-icon-music:before{content:"\f24f"}.bp5-icon-nest:before{content:"\f250"}.bp5-icon-new-drawing:before{content:"\f251"}.bp5-icon-new-grid-item:before{content:"\f252"}.bp5-icon-new-layer:before{content:"\f253"}.bp5-icon-new-layers:before{content:"\f254"}.bp5-icon-new-link:before{content:"\f255"}.bp5-icon-new-object:before{content:"\f256"}.bp5-icon-new-person:before{content:"\f257"}.bp5-icon-new-prescription:before{content:"\f258"}.bp5-icon-new-text-box:before{content:"\f259"}.bp5-icon-ninja:before{content:"\f25a"}.bp5-icon-not-equal-to:before{content:"\f25b"}.bp5-icon-notifications:before{content:"\f25e"}.bp5-icon-notifications-snooze:before{content:"\f25c"}.bp5-icon-notifications-updated:before{content:"\f25d"}.bp5-icon-numbered-list:before{content:"\f25f"}.bp5-icon-numerical:before{content:"\f260"}.bp5-icon-office:before{content:"\f261"}.bp5-icon-offline:before{content:"\f262"}.bp5-icon-oil-field:before{content:"\f263"}.bp5-icon-one-column:before{content:"\f264"}.bp5-icon-one-to-many:before{content:"\f265"}.bp5-icon-one-to-one:before{content:"\f266"}.bp5-icon-open-application:before{content:"\f32b"}.bp5-icon-outdated:before{content:"\f267"}.bp5-icon-page-layout:before{content:"\f268"}.bp5-icon-panel-stats:before{content:"\f269"}.bp5-icon-panel-table:before{content:"\f26a"}.bp5-icon-paperclip:before{content:"\f26b"}.bp5-icon-paragraph:before{content:"\f26c"}.bp5-icon-path:before{content:"\f26e"}.bp5-icon-path-search:before{content:"\f26d"}.bp5-icon-pause:before{content:"\f26f"}.bp5-icon-people:before{content:"\f270"}.bp5-icon-percentage:before{content:"\f271"}.bp5-icon-person:before{content:"\f272"}.bp5-icon-phone:before{content:"\f273"}.bp5-icon-pie-chart:before{content:"\f274"}.bp5-icon-pin:before{content:"\f275"}.bp5-icon-pivot:before{content:"\f277"}.bp5-icon-pivot-table:before{content:"\f276"}.bp5-icon-play:before{content:"\f278"}.bp5-icon-playbook:before{content:"\f324"}.bp5-icon-plus:before{content:"\f279"}.bp5-icon-polygon-filter:before{content:"\f27a"}.bp5-icon-power:before{content:"\f27b"}.bp5-icon-predictive-analysis:before{content:"\f27c"}.bp5-icon-prescription:before{content:"\f27d"}.bp5-icon-presentation:before{content:"\f27e"}.bp5-icon-print:before{content:"\f27f"}.bp5-icon-projects:before{content:"\f280"}.bp5-icon-properties:before{content:"\f281"}.bp5-icon-property:before{content:"\f282"}.bp5-icon-publish-function:before{content:"\f283"}.bp5-icon-pulse:before{content:"\f284"}.bp5-icon-rain:before{content:"\f285"}.bp5-icon-random:before{content:"\f286"}.bp5-icon-record:before{content:"\f287"}.bp5-icon-rect-height:before{content:"\f325"}.bp5-icon-rect-width:before{content:"\f326"}.bp5-icon-rectangle:before{content:"\f321"}.bp5-icon-redo:before{content:"\f288"}.bp5-icon-refresh:before{content:"\f289"}.bp5-icon-regex:before{content:"\f32f"}.bp5-icon-regression-chart:before{content:"\f28a"}.bp5-icon-remove:before{content:"\f290"}.bp5-icon-remove-column:before{content:"\f28d"}.bp5-icon-remove-column-left:before{content:"\f28b"}.bp5-icon-remove-column-right:before{content:"\f28c"}.bp5-icon-remove-row-bottom:before{content:"\f28e"}.bp5-icon-remove-row-top:before{content:"\f28f"}.bp5-icon-repeat:before{content:"\f291"}.bp5-icon-reset:before{content:"\f292"}.bp5-icon-resolve:before{content:"\f293"}.bp5-icon-rig:before{content:"\f294"}.bp5-icon-right-join:before{content:"\f295"}.bp5-icon-ring:before{content:"\f296"}.bp5-icon-rocket:before{content:"\f298"}.bp5-icon-rocket-slant:before{content:"\f297"}.bp5-icon-rotate-document:before{content:"\f299"}.bp5-icon-rotate-page:before{content:"\f29a"}.bp5-icon-route:before{content:"\f29b"}.bp5-icon-satellite:before{content:"\f29c"}.bp5-icon-saved:before{content:"\f29d"}.bp5-icon-scatter-plot:before{content:"\f29e"}.bp5-icon-search:before{content:"\f2a2"}.bp5-icon-search-around:before{content:"\f29f"}.bp5-icon-search-template:before{content:"\f2a0"}.bp5-icon-search-text:before{content:"\f2a1"}.bp5-icon-segmented-control:before{content:"\f2a3"}.bp5-icon-select:before{content:"\f2a4"}.bp5-icon-selection:before{content:"\f2a5"}.bp5-icon-send-message:before{content:"\f2a6"}.bp5-icon-send-to:before{content:"\f2a9"}.bp5-icon-send-to-graph:before{content:"\f2a7"}.bp5-icon-send-to-map:before{content:"\f2a8"}.bp5-icon-sensor:before{content:"\f33c"}.bp5-icon-series-add:before{content:"\f2aa"}.bp5-icon-series-configuration:before{content:"\f2ab"}.bp5-icon-series-derived:before{content:"\f2ac"}.bp5-icon-series-filtered:before{content:"\f2ad"}.bp5-icon-series-search:before{content:"\f2ae"}.bp5-icon-settings:before{content:"\f2af"}.bp5-icon-shapes:before{content:"\f2b0"}.bp5-icon-share:before{content:"\f2b1"}.bp5-icon-shared-filter:before{content:"\f2b2"}.bp5-icon-shield:before{content:"\f2b3"}.bp5-icon-ship:before{content:"\f2b4"}.bp5-icon-shop:before{content:"\f2b5"}.bp5-icon-shopping-cart:before{content:"\f2b6"}.bp5-icon-shorten-text:before{content:"\f33f"}.bp5-icon-signal-search:before{content:"\f2b7"}.bp5-icon-sim-card:before{content:"\f2b8"}.bp5-icon-slash:before{content:"\f2b9"}.bp5-icon-small-cross:before{content:"\f2ba"}.bp5-icon-small-info-sign:before{content:"\f334"}.bp5-icon-small-minus:before{content:"\f2bb"}.bp5-icon-small-plus:before{content:"\f2bc"}.bp5-icon-small-square:before{content:"\f2bd"}.bp5-icon-small-tick:before{content:"\f2be"}.bp5-icon-snowflake:before{content:"\f2bf"}.bp5-icon-social-media:before{content:"\f2c0"}.bp5-icon-sort:before{content:"\f2c7"}.bp5-icon-sort-alphabetical:before{content:"\f2c2"}.bp5-icon-sort-alphabetical-desc:before{content:"\f2c1"}.bp5-icon-sort-asc:before{content:"\f2c3"}.bp5-icon-sort-desc:before{content:"\f2c4"}.bp5-icon-sort-numerical:before{content:"\f2c6"}.bp5-icon-sort-numerical-desc:before{content:"\f2c5"}.bp5-icon-spell-check:before{content:"\f340"}.bp5-icon-split-columns:before{content:"\f2c8"}.bp5-icon-square:before{content:"\f2c9"}.bp5-icon-stacked-chart:before{content:"\f2ca"}.bp5-icon-stadium-geometry:before{content:"\f2cb"}.bp5-icon-star:before{content:"\f2cd"}.bp5-icon-star-empty:before{content:"\f2cc"}.bp5-icon-step-backward:before{content:"\f2ce"}.bp5-icon-step-chart:before{content:"\f2cf"}.bp5-icon-step-forward:before{content:"\f2d0"}.bp5-icon-stop:before{content:"\f2d1"}.bp5-icon-stopwatch:before{content:"\f2d2"}.bp5-icon-strikethrough:before{content:"\f2d3"}.bp5-icon-style:before{content:"\f2d4"}.bp5-icon-subscript:before{content:"\f339"}.bp5-icon-superscript:before{content:"\f33a"}.bp5-icon-swap-horizontal:before{content:"\f2d5"}.bp5-icon-swap-vertical:before{content:"\f2d6"}.bp5-icon-switch:before{content:"\f2d7"}.bp5-icon-symbol-circle:before{content:"\f2d8"}.bp5-icon-symbol-cross:before{content:"\f2d9"}.bp5-icon-symbol-diamond:before{content:"\f2da"}.bp5-icon-symbol-rectangle:before{content:"\f322"}.bp5-icon-symbol-square:before{content:"\f2db"}.bp5-icon-symbol-triangle-down:before{content:"\f2dc"}.bp5-icon-symbol-triangle-up:before{content:"\f2dd"}.bp5-icon-syringe:before{content:"\f2de"}.bp5-icon-tag:before{content:"\f2df"}.bp5-icon-take-action:before{content:"\f2e0"}.bp5-icon-tank:before{content:"\f2e1"}.bp5-icon-target:before{content:"\f2e2"}.bp5-icon-taxi:before{content:"\f2e3"}.bp5-icon-temperature:before{content:"\f2e4"}.bp5-icon-text-highlight:before{content:"\f2e5"}.bp5-icon-th:before{content:"\f2ea"}.bp5-icon-th-derived:before{content:"\f2e6"}.bp5-icon-th-disconnect:before{content:"\f2e7"}.bp5-icon-th-filtered:before{content:"\f2e8"}.bp5-icon-th-list:before{content:"\f2e9"}.bp5-icon-third-party:before{content:"\f2eb"}.bp5-icon-thumbs-down:before{content:"\f2ec"}.bp5-icon-thumbs-up:before{content:"\f2ed"}.bp5-icon-tick:before{content:"\f2ef"}.bp5-icon-tick-circle:before{content:"\f2ee"}.bp5-icon-time:before{content:"\f2f0"}.bp5-icon-timeline-area-chart:before{content:"\f2f1"}.bp5-icon-timeline-bar-chart:before{content:"\f2f2"}.bp5-icon-timeline-events:before{content:"\f2f3"}.bp5-icon-timeline-line-chart:before{content:"\f2f4"}.bp5-icon-tint:before{content:"\f2f5"}.bp5-icon-torch:before{content:"\f2f6"}.bp5-icon-tractor:before{content:"\f2f7"}.bp5-icon-train:before{content:"\f2f8"}.bp5-icon-translate:before{content:"\f2f9"}.bp5-icon-trash:before{content:"\f2fa"}.bp5-icon-tree:before{content:"\f2fb"}.bp5-icon-trending-down:before{content:"\f2fc"}.bp5-icon-trending-up:before{content:"\f2fd"}.bp5-icon-truck:before{content:"\f2fe"}.bp5-icon-two-columns:before{content:"\f2ff"}.bp5-icon-unarchive:before{content:"\f300"}.bp5-icon-underline:before{content:"\f301"}.bp5-icon-undo:before{content:"\f302"}.bp5-icon-ungroup-objects:before{content:"\f303"}.bp5-icon-unknown-vehicle:before{content:"\f304"}.bp5-icon-unlock:before{content:"\f305"}.bp5-icon-unpin:before{content:"\f306"}.bp5-icon-unresolve:before{content:"\f307"}.bp5-icon-updated:before{content:"\f308"}.bp5-icon-upload:before{content:"\f309"}.bp5-icon-user:before{content:"\f30a"}.bp5-icon-variable:before{content:"\f30b"}.bp5-icon-vertical-bar-chart-asc:before{content:"\f30c"}.bp5-icon-vertical-bar-chart-desc:before{content:"\f30d"}.bp5-icon-vertical-distribution:before{content:"\f30e"}.bp5-icon-vertical-inbetween:before{content:"\f32a"}.bp5-icon-video:before{content:"\f30f"}.bp5-icon-virus:before{content:"\f310"}.bp5-icon-volume-down:before{content:"\f311"}.bp5-icon-volume-off:before{content:"\f312"}.bp5-icon-volume-up:before{content:"\f313"}.bp5-icon-walk:before{content:"\f314"}.bp5-icon-warning-sign:before{content:"\f315"}.bp5-icon-waterfall-chart:before{content:"\f316"}.bp5-icon-waves:before{content:"\f317"}.bp5-icon-widget:before{content:"\f31b"}.bp5-icon-widget-button:before{content:"\f318"}.bp5-icon-widget-footer:before{content:"\f319"}.bp5-icon-widget-header:before{content:"\f31a"}.bp5-icon-wind:before{content:"\f31c"}.bp5-icon-wrench:before{content:"\f31d"}.bp5-icon-zoom-in:before{content:"\f31e"}.bp5-icon-zoom-out:before{content:"\f31f"}.bp5-icon-zoom-to-fit:before{content:"\f320"}.bp5-menu-item:hover,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]){background-color:rgba(143,153,168,.15);color:inherit;cursor:pointer;text-decoration:none}.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-success,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-success,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-success{background-color:rgba(35,133,81,.1);color:#1c6e42}.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-success .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-success .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-success:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-success .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-success .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-success:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-success .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-success .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-success:before{color:inherit}.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-warning,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-warning,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-warning{background-color:rgba(200,118,25,.1);color:#935610}.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-warning .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-warning .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-warning:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-warning .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-warning .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-warning:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-warning .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-warning .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-warning:before{color:inherit}.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-danger,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-danger,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-danger{background-color:rgba(205,66,70,.1);color:#ac2f33}.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-danger .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-danger .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-danger:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-danger .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-danger .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-danger:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-danger .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-danger .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-danger:before{color:inherit}.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-success,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-success,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-success{background-color:rgba(35,133,81,.2);color:#72ca9b}.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-success:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-success:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-success:before{color:inherit}.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-warning,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-warning,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-warning{background-color:rgba(200,118,25,.2);color:#fbb360}.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-warning:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-warning:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-warning:before{color:inherit}.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-danger,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-danger,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-danger{background-color:rgba(205,66,70,.2);color:#fa999c}.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-danger:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-danger:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-danger:before{color:inherit}.bp5-menu{border-radius:2px;color:#1c2127;list-style:none;margin:0;min-width:180px;padding:5px;text-align:left}.bp5-menu-divider,.bp5-menu-header{border-top:1px solid rgba(17,20,24,.15);margin:5px}.bp5-menu-divider{display:block}.bp5-menu-item{align-items:flex-start;border-radius:2px;color:inherit;display:flex;flex-direction:row;line-height:20px;padding:5px 7px;text-decoration:none;-webkit-user-select:none;user-select:none}.bp5-menu-item>.bp5-fill{flex-grow:1;flex-shrink:1;word-break:break-word}.bp5-menu-item .bp5-menu-item-icon{display:flex;flex-direction:column;height:20px;justify-content:center}.bp5-menu-item .bp5-submenu-icon,.bp5-menu-item:before{margin-top:2px}.bp5-menu-item:hover.ns-selected{background-color:rgba(45,114,210,.1);color:#215db0}.bp5-menu-item:hover.ns-selected .bp5-menu-item-label{color:inherit}.bp5-menu-item:hover.ns-selected .bp5-menu-item-icon,.bp5-menu-item:hover.ns-selected .bp5-submenu-icon,.bp5-menu-item:hover.ns-selected:before{color:#215db0}.bp5-menu-item:hover.ns-selected.bp5-intent-success{background-color:rgba(35,133,81,.1);color:#1c6e42}.bp5-menu-item:hover.ns-selected.bp5-intent-success .bp5-menu-item-icon,.bp5-menu-item:hover.ns-selected.bp5-intent-success .bp5-submenu-icon,.bp5-menu-item:hover.ns-selected.bp5-intent-success:before{color:inherit}.bp5-menu-item:hover.ns-selected.bp5-intent-warning{background-color:rgba(200,118,25,.1);color:#935610}.bp5-menu-item:hover.ns-selected.bp5-intent-warning .bp5-menu-item-icon,.bp5-menu-item:hover.ns-selected.bp5-intent-warning .bp5-submenu-icon,.bp5-menu-item:hover.ns-selected.bp5-intent-warning:before{color:inherit}.bp5-menu-item:hover.ns-selected.bp5-intent-danger{background-color:rgba(205,66,70,.1);color:#ac2f33}.bp5-menu-item:hover.ns-selected.bp5-intent-danger .bp5-menu-item-icon,.bp5-menu-item:hover.ns-selected.bp5-intent-danger .bp5-submenu-icon,.bp5-menu-item:hover.ns-selected.bp5-intent-danger:before{color:inherit}.bp5-menu-item.bp5-active,.bp5-menu-item:active,.bp5-tree-node-content:active{background-color:rgba(143,153,168,.3)}.bp5-menu-item.bp5-selected,.bp5-menu-item.bp5-selected:active,.bp5-menu-item.bp5-selected:hover,.bp5-tag.bp5-minimal.bp5-intent-primary{background-color:rgba(45,114,210,.1);color:#215db0}.bp5-menu-item.bp5-selected .bp5-menu-item-label,.bp5-menu-item.bp5-selected:active .bp5-menu-item-label,.bp5-menu-item.bp5-selected:hover .bp5-menu-item-label{color:inherit}.bp5-dark .bp5-tooltip .bp5-icon-large.bp5-intent-primary,.bp5-dark .bp5-tooltip .bp5-icon-standard.bp5-intent-primary,.bp5-dark .bp5-tooltip .bp5-icon.bp5-intent-primary,.bp5-dark .bp5-tooltip a,.bp5-dark .bp5-tooltip a:hover,.bp5-menu-item.bp5-intent-primary,.bp5-menu-item.bp5-selected .bp5-menu-item-icon,.bp5-menu-item.bp5-selected .bp5-submenu-icon,.bp5-menu-item.bp5-selected:active .bp5-menu-item-icon,.bp5-menu-item.bp5-selected:active .bp5-submenu-icon,.bp5-menu-item.bp5-selected:active:before,.bp5-menu-item.bp5-selected:before,.bp5-menu-item.bp5-selected:hover .bp5-menu-item-icon,.bp5-menu-item.bp5-selected:hover .bp5-submenu-icon,.bp5-menu-item.bp5-selected:hover:before,.bp5-tab:not([aria-disabled=true]):hover,.bp5-tab[aria-selected=true],.bp5-tag.bp5-minimal.bp5-intent-primary .bp5-tag-remove,.bp5-tooltip.bp5-dark .bp5-icon-large.bp5-intent-primary,.bp5-tooltip.bp5-dark .bp5-icon-standard.bp5-intent-primary,.bp5-tooltip.bp5-dark .bp5-icon.bp5-intent-primary,.bp5-tooltip.bp5-dark a,.bp5-tooltip.bp5-dark a:hover{color:#215db0}.bp5-menu-item.bp5-selected.bp5-intent-success,.bp5-menu-item.bp5-selected:active.bp5-intent-success,.bp5-menu-item.bp5-selected:hover.bp5-intent-success{background-color:rgba(35,133,81,.1);color:#1c6e42}.bp5-menu-item.bp5-selected.bp5-intent-success .bp5-menu-item-icon,.bp5-menu-item.bp5-selected.bp5-intent-success .bp5-submenu-icon,.bp5-menu-item.bp5-selected.bp5-intent-success:before,.bp5-menu-item.bp5-selected:active.bp5-intent-success .bp5-menu-item-icon,.bp5-menu-item.bp5-selected:active.bp5-intent-success .bp5-submenu-icon,.bp5-menu-item.bp5-selected:active.bp5-intent-success:before,.bp5-menu-item.bp5-selected:hover.bp5-intent-success .bp5-menu-item-icon,.bp5-menu-item.bp5-selected:hover.bp5-intent-success .bp5-submenu-icon,.bp5-menu-item.bp5-selected:hover.bp5-intent-success:before{color:inherit}.bp5-menu-item.bp5-selected.bp5-intent-warning,.bp5-menu-item.bp5-selected:active.bp5-intent-warning,.bp5-menu-item.bp5-selected:hover.bp5-intent-warning{background-color:rgba(200,118,25,.1);color:#935610}.bp5-menu-item.bp5-selected.bp5-intent-warning .bp5-menu-item-icon,.bp5-menu-item.bp5-selected.bp5-intent-warning .bp5-submenu-icon,.bp5-menu-item.bp5-selected.bp5-intent-warning:before,.bp5-menu-item.bp5-selected:active.bp5-intent-warning .bp5-menu-item-icon,.bp5-menu-item.bp5-selected:active.bp5-intent-warning .bp5-submenu-icon,.bp5-menu-item.bp5-selected:active.bp5-intent-warning:before,.bp5-menu-item.bp5-selected:hover.bp5-intent-warning .bp5-menu-item-icon,.bp5-menu-item.bp5-selected:hover.bp5-intent-warning .bp5-submenu-icon,.bp5-menu-item.bp5-selected:hover.bp5-intent-warning:before{color:inherit}.bp5-menu-item.bp5-selected.bp5-intent-danger,.bp5-menu-item.bp5-selected:active.bp5-intent-danger,.bp5-menu-item.bp5-selected:hover.bp5-intent-danger{background-color:rgba(205,66,70,.1);color:#ac2f33}.bp5-menu-item.bp5-selected.bp5-intent-danger .bp5-menu-item-icon,.bp5-menu-item.bp5-selected.bp5-intent-danger .bp5-submenu-icon,.bp5-menu-item.bp5-selected.bp5-intent-danger:before,.bp5-menu-item.bp5-selected:active.bp5-intent-danger .bp5-menu-item-icon,.bp5-menu-item.bp5-selected:active.bp5-intent-danger .bp5-submenu-icon,.bp5-menu-item.bp5-selected:active.bp5-intent-danger:before,.bp5-menu-item.bp5-selected:hover.bp5-intent-danger .bp5-menu-item-icon,.bp5-menu-item.bp5-selected:hover.bp5-intent-danger .bp5-submenu-icon,.bp5-menu-item.bp5-selected:hover.bp5-intent-danger:before{color:inherit}.bp5-menu-item.bp5-disabled{background-color:inherit!important;cursor:not-allowed!important;outline:0!important}.bp5-dark .bp5-menu-item,.bp5-dark .bp5-menu-item:hover,.bp5-menu-item.bp5-intent-danger .bp5-menu-item-icon,.bp5-menu-item.bp5-intent-danger .bp5-menu-item-label,.bp5-menu-item.bp5-intent-danger .bp5-submenu-icon,.bp5-menu-item.bp5-intent-danger:before,.bp5-menu-item.bp5-intent-primary .bp5-menu-item-icon,.bp5-menu-item.bp5-intent-primary .bp5-menu-item-label,.bp5-menu-item.bp5-intent-primary .bp5-submenu-icon,.bp5-menu-item.bp5-intent-primary:before,.bp5-menu-item.bp5-intent-success .bp5-menu-item-icon,.bp5-menu-item.bp5-intent-success .bp5-menu-item-label,.bp5-menu-item.bp5-intent-success .bp5-submenu-icon,.bp5-menu-item.bp5-intent-success:before,.bp5-menu-item.bp5-intent-warning .bp5-menu-item-icon,.bp5-menu-item.bp5-intent-warning .bp5-menu-item-label,.bp5-menu-item.bp5-intent-warning .bp5-submenu-icon,.bp5-menu-item.bp5-intent-warning:before{color:inherit}.bp5-menu-item.bp5-intent-primary:hover{background-color:rgba(45,114,210,.1)}.bp5-menu-item.bp5-intent-primary.bp5-active,.bp5-menu-item.bp5-intent-primary:active,.bp5-tag.bp5-minimal.bp5-intent-primary.bp5-interactive:hover{background-color:rgba(45,114,210,.2);color:#184a90}.bp5-menu-item.bp5-intent-success:hover{background-color:rgba(35,133,81,.1)}.bp5-menu-item.bp5-intent-success.bp5-active,.bp5-menu-item.bp5-intent-success:active,.bp5-tag.bp5-minimal.bp5-intent-success.bp5-interactive:hover{background-color:rgba(35,133,81,.2);color:#165a36}.bp5-menu-item.bp5-intent-warning:hover{background-color:rgba(200,118,25,.1)}.bp5-menu-item.bp5-intent-warning.bp5-active,.bp5-menu-item.bp5-intent-warning:active,.bp5-tag.bp5-minimal.bp5-intent-warning.bp5-interactive:hover{background-color:rgba(200,118,25,.2);color:#77450d}.bp5-menu-item.bp5-intent-danger:hover{background-color:rgba(205,66,70,.1)}.bp5-menu-item.bp5-intent-danger.bp5-active,.bp5-menu-item.bp5-intent-danger:active,.bp5-tag.bp5-minimal.bp5-intent-danger.bp5-interactive:hover{background-color:rgba(205,66,70,.2);color:#8e292c}.bp5-menu-item:before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:16px;font-style:normal;font-variant:normal;font-weight:400;height:16px;line-height:1;margin-right:7px}.bp5-large .bp5-menu-item{font-size:16px;line-height:22px;padding:9px 7px}.bp5-large .bp5-menu-item .bp5-menu-item-icon{height:22px}.bp5-large .bp5-menu-item .bp5-submenu-icon,.bp5-large .bp5-menu-item:before{margin-top:3px}.bp5-large .bp5-menu-item:before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-variant:normal;font-weight:400;height:20px;line-height:1;margin-right:10px;width:20px}button.bp5-menu-item{background:none;border:none;text-align:left;width:100%}.bp5-menu-header{cursor:default;display:block;padding-left:2px}.bp5-menu-header:first-of-type{border-top:none}.bp5-menu-header>h6{word-wrap:normal;color:#1c2127;font-weight:600;line-height:17px;margin:0;overflow:hidden;padding:10px 7px 0 1px;text-overflow:ellipsis;white-space:nowrap}.bp5-large .bp5-menu-header>h6{font-size:18px;padding-bottom:5px;padding-top:15px}.bp5-dark .bp5-menu{background:#2f343c;color:#f6f7f9}.bp5-dark .bp5-menu-item:hover.ns-selected{background-color:rgba(45,114,210,.2);color:#8abbff}.bp5-dark .bp5-menu-item:hover.ns-selected .bp5-menu-item-icon,.bp5-dark .bp5-menu-item:hover.ns-selected .bp5-submenu-icon,.bp5-dark .bp5-menu-item:hover.ns-selected:before{color:#8abbff}.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-success{background-color:rgba(35,133,81,.2);color:#72ca9b}.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-success:before{color:inherit}.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-warning{background-color:rgba(200,118,25,.2);color:#fbb360}.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-warning:before{color:inherit}.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-danger{background-color:rgba(205,66,70,.2);color:#fa999c}.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-danger:before{color:inherit}.bp5-dark .bp5-menu-item.bp5-selected,.bp5-dark .bp5-menu-item.bp5-selected:active,.bp5-dark .bp5-menu-item.bp5-selected:hover,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-primary{background-color:rgba(45,114,210,.2);color:#8abbff}.bp5-dark .bp5-menu-item.bp5-intent-primary,.bp5-dark .bp5-menu-item.bp5-selected .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:active .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected:active .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:active:before,.bp5-dark .bp5-menu-item.bp5-selected:before,.bp5-dark .bp5-menu-item.bp5-selected:hover .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected:hover .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:hover:before,.bp5-dark .bp5-tab:not([aria-disabled=true]):hover,.bp5-dark .bp5-tab[aria-selected=true],.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-primary .bp5-tag-remove,.bp5-dark .bp5-tree .bp5-icon-large.bp5-intent-primary,.bp5-dark .bp5-tree .bp5-icon-standard.bp5-intent-primary,.bp5-dark .bp5-tree .bp5-icon.bp5-intent-primary,.bp5-tooltip .bp5-icon-large.bp5-intent-primary,.bp5-tooltip .bp5-icon-standard.bp5-intent-primary,.bp5-tooltip .bp5-icon.bp5-intent-primary,.bp5-tooltip a,.bp5-tooltip a:hover{color:#8abbff}.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-success,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-success,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-success{background-color:rgba(35,133,81,.2);color:#72ca9b}.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-success:before,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-success:before,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-success:before{color:inherit}.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-warning,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-warning,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-warning{background-color:rgba(200,118,25,.2);color:#fbb360}.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-warning:before,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-warning:before,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-warning:before{color:inherit}.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-danger,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-danger,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-danger{background-color:rgba(205,66,70,.2);color:#fa999c}.bp5-dark .bp5-menu-item.bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-intent-danger .bp5-menu-item-label,.bp5-dark .bp5-menu-item.bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-intent-danger:before,.bp5-dark .bp5-menu-item.bp5-intent-primary .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-intent-primary .bp5-menu-item-label,.bp5-dark .bp5-menu-item.bp5-intent-primary .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-intent-primary:before,.bp5-dark .bp5-menu-item.bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-intent-success .bp5-menu-item-label,.bp5-dark .bp5-menu-item.bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-intent-success:before,.bp5-dark .bp5-menu-item.bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-intent-warning .bp5-menu-item-label,.bp5-dark .bp5-menu-item.bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-intent-warning:before,.bp5-dark .bp5-popover .bp5-heading,.bp5-dark .bp5-popover .bp5-popover-content,.bp5-dark .bp5-tooltip a .bp5-icon,.bp5-dark .bp5-tooltip a .bp5-icon-large,.bp5-dark .bp5-tooltip a .bp5-icon-standard,.bp5-dark .bp5-tooltip a code,.bp5-popover .bp5-heading,.bp5-popover .bp5-popover-content,.bp5-popover.bp5-dark .bp5-heading,.bp5-popover.bp5-dark .bp5-popover-content,.bp5-tab a,.bp5-tag-remove .bp5-icon:first-child,.bp5-tooltip a .bp5-icon,.bp5-tooltip a .bp5-icon-large,.bp5-tooltip a .bp5-icon-standard,.bp5-tooltip a code,.bp5-tooltip.bp5-dark a .bp5-icon,.bp5-tooltip.bp5-dark a .bp5-icon-large,.bp5-tooltip.bp5-dark a .bp5-icon-standard,.bp5-tooltip.bp5-dark a code,a>.bp5-tooltip .bp5-code,a>.bp5-tooltip .bp5-running-text code{color:inherit}.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-danger:before,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-danger:before,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-danger:before{color:inherit}.bp5-dark .bp5-menu-item.bp5-intent-primary:hover{background-color:rgba(45,114,210,.2)}.bp5-dark .bp5-menu-item.bp5-intent-primary.bp5-active,.bp5-dark .bp5-menu-item.bp5-intent-primary:active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-primary.bp5-interactive:hover{background-color:rgba(45,114,210,.3);color:#99c4ff}.bp5-dark .bp5-menu-item.bp5-intent-success:hover{background-color:rgba(35,133,81,.2)}.bp5-dark .bp5-menu-item.bp5-intent-success.bp5-active,.bp5-dark .bp5-menu-item.bp5-intent-success:active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-success.bp5-interactive:hover{background-color:rgba(35,133,81,.3);color:#7cd7a2}.bp5-dark .bp5-menu-item.bp5-intent-warning:hover{background-color:rgba(200,118,25,.2)}.bp5-dark .bp5-menu-item.bp5-intent-warning.bp5-active,.bp5-dark .bp5-menu-item.bp5-intent-warning:active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-warning.bp5-interactive:hover{background-color:rgba(200,118,25,.3);color:#f5c186}.bp5-dark .bp5-menu-item.bp5-intent-danger:hover{background-color:rgba(205,66,70,.2)}.bp5-dark .bp5-menu-item.bp5-intent-danger.bp5-active,.bp5-dark .bp5-menu-item.bp5-intent-danger:active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-danger.bp5-interactive:hover{background-color:rgba(205,66,70,.3);color:#ffa1a4}.bp5-navbar{background-color:#fff;box-shadow:0 0 0 1px rgba(17,20,24,.1),0 1px 1px rgba(17,20,24,.2);height:50px;padding:0 15px;position:relative;width:100%;z-index:10}.bp5-dark .bp5-navbar,.bp5-dark .bp5-panel-stack-view,.bp5-dark .bp5-panel-stack2-view,.bp5-navbar.bp5-dark{background-color:#383e47}.bp5-navbar.bp5-dark{box-shadow:inset inset 0 0 0 1px hsla(0,0%,100%,.2),0 1px 1px 0 rgba(17,20,24,.4)}.bp5-dark .bp5-navbar{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 1px 1px 0 rgba(17,20,24,.4)}.bp5-navbar.bp5-fixed-top{left:0;position:fixed;right:0;top:0}.bp5-navbar-heading{font-size:16px;margin-right:15px}.bp5-navbar-group{align-items:center;display:flex;height:50px}.bp5-navbar-group.bp5-align-left{float:left}.bp5-navbar-group.bp5-align-right{float:right}.bp5-navbar-divider{border-left:1px solid rgba(17,20,24,.15);height:20px;margin:0 10px}.bp5-dark .bp5-navbar-divider{border-left-color:hsla(0,0%,100%,.2)}.bp5-non-ideal-state{align-items:center;color:#5f6b7c;display:flex;flex-direction:column;height:100%;justify-content:center;text-align:center;width:100%}.bp5-non-ideal-state>*{flex-grow:0;flex-shrink:0;max-width:400px}.bp5-non-ideal-state .bp5-heading{color:#5f6b7c;line-height:20px;margin-bottom:10px}.bp5-non-ideal-state.bp5-non-ideal-state-horizontal{display:flex;flex-direction:row;text-align:left}.bp5-non-ideal-state.bp5-non-ideal-state-horizontal>*{flex-grow:0;flex-shrink:0;margin-bottom:0}.bp5-panel-stack-header .bp5-heading,.bp5-panel-stack2-header .bp5-heading,kbd{margin:0 5px}.bp5-non-ideal-state-visual{color:#8f99a8}.bp5-non-ideal-state-visual .bp5-icon svg{fill-opacity:15%;overflow:visible}.bp5-non-ideal-state-visual .bp5-icon svg path{stroke:#8f99a8;stroke-opacity:50%;stroke-width:.5px}.bp5-dark .bp5-non-ideal-state-visual .bp5-icon svg{fill-opacity:20%}.bp5-overflow-list{display:flex;flex-wrap:nowrap;min-width:0}.bp5-overflow-list-spacer{flex-shrink:1;width:1px}.ins-view.inline-node-edited>.base-node-view .base-node-view-inner,body.bp5-overlay-open{overflow:hidden}.bp5-overlay{bottom:0;left:0;position:static;right:0;top:0;z-index:20}.bp5-overlay.bp5-overlay-container{overflow:hidden;position:fixed}.bp5-overlay-backdrop,.bp5-overlay.bp5-overlay-scroll-container{overflow:auto;position:fixed}.bp5-overlay-inline .bp5-overlay-backdrop,.bp5-overlay-inline .bp5-overlay-content,.bp5-overlay-scroll-container .bp5-overlay-content,.bp5-overlay.bp5-overlay-container.bp5-overlay-inline,.bp5-overlay.bp5-overlay-scroll-container.bp5-overlay-inline,.bp5-toast-container.bp5-toast-container-inline,.connection,.connections-view{position:absolute}.bp5-overlay.bp5-overlay-inline{display:inline;overflow:visible}.bp5-overlay-content{position:fixed;z-index:20}.bp5-overlay-backdrop{background-color:rgba(17,20,24,.7);bottom:0;left:0;opacity:1;right:0;top:0;-webkit-user-select:none;user-select:none;z-index:20}.bp5-overlay-backdrop.bp5-overlay-appear,.bp5-overlay-backdrop.bp5-overlay-enter,.bp5-popover-transition-container.bp5-popover-appear,.bp5-popover-transition-container.bp5-popover-enter{opacity:0}.bp5-overlay-backdrop.bp5-overlay-appear-active,.bp5-overlay-backdrop.bp5-overlay-enter-active{opacity:1;transition:opacity .2s cubic-bezier(.4,1,.75,.9) 0}.bp5-overlay-backdrop.bp5-overlay-exit,.bp5-popover-transition-container.bp5-popover-exit,.footerLogoLink_lMws:hover,.hash-link:focus,:hover>.hash-link{opacity:1}.bp5-overlay-backdrop.bp5-overlay-exit-active{opacity:0;transition:opacity .2s cubic-bezier(.4,1,.75,.9) 0}.bp5-panel-stack,.bp5-panel-stack2{overflow:hidden;position:relative}.bp5-panel-stack-header,.bp5-panel-stack2-header{align-items:center;box-shadow:0 1px rgba(17,20,24,.15);display:flex;flex-shrink:0;height:30px;z-index:1}.bp5-dark .bp5-panel-stack-header,.bp5-dark .bp5-panel-stack2-header{box-shadow:0 1px hsla(0,0%,100%,.2)}.bp5-panel-stack-header>span,.bp5-panel-stack2-header>span{align-items:stretch;display:flex;flex:1}.bp5-button.bp5-panel-stack-header-back,.bp5-button.bp5-panel-stack2-header-back{margin-left:5px;padding-left:0;white-space:nowrap}.bp5-button.bp5-panel-stack-header-back .bp5-icon,.bp5-button.bp5-panel-stack2-header-back .bp5-icon{margin:0 2px}.bp5-panel-stack-view,.bp5-panel-stack2-view{background-color:#fff;border-right:1px solid rgba(17,20,24,.15);bottom:0;display:flex;flex-direction:column;left:0;margin-right:-1px;overflow-y:auto;position:absolute;right:0;top:0;z-index:1}#__docusaurus-base-url-issue-banner-container,.bp5-omnibar .bp5-menu:empty,.bp5-panel-stack-view:nth-last-child(n+4),.bp5-panel-stack2-view:nth-last-child(n+4),.bp5-popover.bp5-minimal .bp5-popover-arrow,.bp5-tab-panel[aria-hidden=true],.docSidebarContainer_ac1n,.sidebarLogo_qeYn,.themedImage_jQx1,.visual-node-editor .inline-node-container .visual-node-editor .zoom-slider,[data-theme=dark] .lightToggleIcon_RZhG,[data-theme=light] .darkToggleIcon_ABkc,html[data-announcement-bar-initially-dismissed=true] .announcementBar_pUh_{display:none}.bp5-panel-stack-push .bp5-panel-stack-appear,.bp5-panel-stack-push .bp5-panel-stack-enter,.bp5-panel-stack2-push .bp5-panel-stack2-appear,.bp5-panel-stack2-push .bp5-panel-stack2-enter{opacity:0;transform:translateX(100%)}.bp5-panel-stack-pop .bp5-panel-stack-appear-active,.bp5-panel-stack-pop .bp5-panel-stack-enter-active,.bp5-panel-stack-push .bp5-panel-stack-appear-active,.bp5-panel-stack-push .bp5-panel-stack-enter-active,.bp5-panel-stack2-pop .bp5-panel-stack2-appear-active,.bp5-panel-stack2-pop .bp5-panel-stack2-enter-active,.bp5-panel-stack2-push .bp5-panel-stack2-appear-active,.bp5-panel-stack2-push .bp5-panel-stack2-enter-active{opacity:1;transform:translate(0);transition:transform .4s 0,opacity .4s 0}.bp5-panel-stack-pop .bp5-panel-stack-exit,.bp5-panel-stack-push .bp5-panel-stack-exit,.bp5-panel-stack2-pop .bp5-panel-stack2-exit,.bp5-panel-stack2-push .bp5-panel-stack2-exit{opacity:1;transform:translate(0)}.bp5-panel-stack-push .bp5-panel-stack-exit-active,.bp5-panel-stack2-push .bp5-panel-stack2-exit-active{transition:transform .4s 0,opacity .4s 0}.bp5-panel-stack-pop .bp5-panel-stack-appear,.bp5-panel-stack-pop .bp5-panel-stack-enter,.bp5-panel-stack-push .bp5-panel-stack-exit-active,.bp5-panel-stack2-pop .bp5-panel-stack2-appear,.bp5-panel-stack2-pop .bp5-panel-stack2-enter,.bp5-panel-stack2-push .bp5-panel-stack2-exit-active{opacity:0;transform:translateX(-50%)}.bp5-panel-stack-pop .bp5-panel-stack-exit-active,.bp5-panel-stack2-pop .bp5-panel-stack2-exit-active{opacity:0;transform:translateX(100%);transition:transform .4s 0,opacity .4s 0}.bp5-control-group .bp5-popover-target{border-radius:inherit}.bp5-submenu.bp5-popover{box-shadow:none;padding:0 5px}.bp5-dark .bp5-popover,.bp5-dark .bp5-submenu.bp5-popover>.bp5-popover-content,.bp5-popover.bp5-dark,.bp5-submenu.bp5-popover.bp5-dark>.bp5-popover-content{box-shadow:0 0 0 1px #5e6064,inset 0 0 0 1px hsla(0,0%,100%,.2),0 2px 4px rgba(17,20,24,.4),0 8px 24px rgba(17,20,24,.4)}.bp5-popover{border-radius:2px;box-shadow:0 0 0 1px rgba(17,20,24,.1),0 2px 4px rgba(17,20,24,.2),0 8px 24px rgba(17,20,24,.2);display:inline-block;transform:scale(1);z-index:20}.bp5-popover .bp5-popover-arrow{height:30px;position:absolute;width:30px}.bp5-popover .bp5-popover-arrow:before{height:20px;margin:5px;width:20px;box-shadow:1px 1px 6px rgba(17,20,24,.2)}.bp5-popover .bp5-popover-content{background:#fff;border-radius:2px;position:relative}.bp5-popover .bp5-popover-arrow-border,.bp5-tooltip .bp5-popover-arrow-border{fill:#111418;fill-opacity:.1}.bp5-popover .bp5-popover-arrow-fill,.bp5-tag .bp5-icon-large,.bp5-tag .bp5-icon-standard,.bp5-tag>.bp5-icon{fill:#fff}.bp5-popover-appear>.bp5-popover,.bp5-popover-enter>.bp5-popover{transform:scale(.3)}.bp5-popover-appear-active>.bp5-popover,.bp5-popover-enter-active>.bp5-popover{transform:scale(1);transition:transform .3s cubic-bezier(.54,1.12,.38,1.11) 0}.bp5-popover-appear>.bp5-popover.bp5-minimal.bp5-popover,.bp5-popover-enter>.bp5-popover.bp5-minimal.bp5-popover,.bp5-popover-exit>.bp5-popover,.bp5-popover-exit>.bp5-popover.bp5-minimal.bp5-popover,.bp5-popover-exit>.bp5-tooltip,.bp5-popover.bp5-minimal.bp5-popover{transform:scale(1)}.bp5-popover-exit-active>.bp5-popover{transform:scale(.3);transition:transform .3s cubic-bezier(.54,1.12,.38,1.11) 0}.bp5-popover.bp5-popover-content-sizing .bp5-popover-content{max-width:350px;padding:20px}.bp5-popover-target+.bp5-overlay .bp5-popover.bp5-popover-content-sizing{width:350px}.bp5-popover-appear-active>.bp5-popover.bp5-minimal.bp5-popover,.bp5-popover-appear-active>.bp5-tooltip,.bp5-popover-enter-active>.bp5-popover.bp5-minimal.bp5-popover,.bp5-popover-enter-active>.bp5-tooltip,.bp5-popover-exit-active>.bp5-popover.bp5-minimal.bp5-popover{transform:scale(1);transition:transform .1s cubic-bezier(.4,1,.75,.9) 0}.bp5-dark .bp5-popover .bp5-popover-arrow:before,.bp5-popover.bp5-dark .bp5-popover-arrow:before{box-shadow:0 0 0 1px #777a7e,1px 1px 6px rgba(17,20,24,.4)}.bp5-dark .bp5-popover .bp5-popover-arrow-border,.bp5-dark .bp5-tooltip .bp5-popover-arrow-border,.bp5-popover.bp5-dark .bp5-popover-arrow-border,.bp5-tooltip.bp5-dark .bp5-popover-arrow-border{fill:#111418;fill-opacity:.2}.bp5-dark .bp5-popover .bp5-popover-arrow-fill,.bp5-popover.bp5-dark .bp5-popover-arrow-fill{fill:#2f343c}.bp5-popover-arrow:before{border-radius:1px;content:"";display:block;position:absolute;transform:rotate(45deg)}.bp5-overlay-backdrop.bp5-popover-backdrop{background:hsla(0,0%,100%,0)}.bp5-popover-transition-container{display:flex;opacity:1;z-index:20}.bp5-popover-transition-container.bp5-popover-appear-active,.bp5-popover-transition-container.bp5-popover-enter-active{opacity:1;transition:opacity .1s cubic-bezier(.4,1,.75,.9) 0}.bp5-popover-transition-container.bp5-popover-exit-active{opacity:0;transition:opacity .1s cubic-bezier(.4,1,.75,.9) 0}.bp5-portal{left:0;position:absolute;right:0;top:0}@keyframes a{0%{background-position:0 0}to{background-position:30px 0}}.bp5-progress-bar{background:rgba(95,107,124,.2);border-radius:40px;display:block;height:8px;overflow:hidden;position:relative;width:100%}.bp5-progress-bar .bp5-progress-meter{background:linear-gradient(-45deg,hsla(0,0%,100%,.2) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.2) 0,hsla(0,0%,100%,.2) 75%,transparent 0);background-color:rgba(95,107,124,.8);background-size:30px 30px;border-radius:40px;height:100%;position:absolute;transition:width .2s cubic-bezier(.4,1,.75,.9);width:100%}.bp5-progress-bar:not(.bp5-no-animation):not(.bp5-no-stripes) .bp5-progress-meter{animation:.3s linear infinite reverse a}.bp5-progress-bar.bp5-no-stripes .bp5-progress-meter{background-image:none}.bp5-dark .bp5-progress-bar,.bp5-dark .bp5-slider-progress{background:rgba(17,20,24,.5)}.bp5-dark .bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content,.bp5-progress-bar.bp5-intent-primary .bp5-progress-meter,.bp5-slider-progress.bp5-intent-primary,.bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content{background-color:#2d72d2}.bp5-progress-bar.bp5-intent-success .bp5-progress-meter,.bp5-slider-progress.bp5-intent-success{background-color:#238551}.bp5-progress-bar.bp5-intent-warning .bp5-progress-meter,.bp5-slider-progress.bp5-intent-warning,.bp5-tag.bp5-intent-warning.bp5-interactive.bp5-active,.bp5-tag.bp5-intent-warning.bp5-interactive:active{background-color:#c87619}.bp5-progress-bar.bp5-intent-danger .bp5-progress-meter,.bp5-slider-progress.bp5-intent-danger{background-color:#cd4246}@keyframes b{0%{background:rgba(211,216,222,.2);border-color:rgba(211,216,222,.2)}to{background:rgba(95,107,124,.2);border-color:rgba(95,107,124,.2)}}.bp5-skeleton{animation:1s linear infinite alternate b;background:rgba(211,216,222,.2);background-clip:padding-box!important;border-color:rgba(211,216,222,.2)!important;border-radius:2px;box-shadow:none!important;color:transparent!important;cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none}.bp5-skeleton *,.bp5-skeleton:after,.bp5-skeleton:before{visibility:hidden!important}.bp5-slider{cursor:default;height:40px;min-width:150px;outline:0;position:relative;-webkit-user-select:none;user-select:none;width:100%}.bp5-dark .bp5-tag.bp5-minimal:not([class*=bp5-intent-]).bp5-interactive,.bp5-slider:hover,.bp5-tab,.bp5-tag-remove,.bp5-tag.bp5-interactive,.bp5-tag.bp5-minimal:not([class*=bp5-intent-]).bp5-interactive,.json-view .cursor-pointer{cursor:pointer}.bp5-slider:active{cursor:grabbing}.bp5-slider.bp5-disabled{cursor:not-allowed;opacity:.5}.bp5-slider.bp5-slider-unlabeled{height:16px}.bp5-slider-progress,.bp5-slider-track{height:6px;left:0;position:absolute;right:0;top:5px}.bp5-slider-track{border-radius:2px;overflow:hidden}.bp5-slider-progress{background:rgba(95,107,124,.2)}.bp5-slider-handle{background-color:#f6f7f9;border-radius:2px;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.1);box-shadow:0 0 0 1px rgba(17,20,24,.5),0 1px 1px rgba(17,20,24,.5);color:#1c2127;cursor:pointer;height:16px;left:0;position:absolute;top:0;width:16px}.bp5-slider-handle.bp5-disabled.bp5-active,.bp5-slider-handle.bp5-disabled.bp5-active:hover,.bp5-slider-handle:disabled.bp5-active,.bp5-slider-handle:disabled.bp5-active:hover{background:rgba(211,216,222,.7)}.bp5-slider-handle:hover{background-clip:padding-box;background-color:#edeff2;box-shadow:0 0 0 1px rgba(17,20,24,.5),0 1px 2px rgba(17,20,24,.6);cursor:grab;z-index:2}.bp5-slider-handle.bp5-active{background-color:#dce0e5;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2);box-shadow:inset 0 1px 1px rgba(17,20,24,.1),0 0 0 1px rgba(17,20,24,.5),0 1px 2px rgba(17,20,24,.2);cursor:grabbing}.bp5-disabled .bp5-slider-handle{background:#c5cbd3;box-shadow:none;pointer-events:none}.bp5-dark .bp5-slider-handle{background-color:#abb3bf;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1),0 1px 2px rgba(17,20,24,.2)}.bp5-dark .bp5-slider-handle:hover{background-color:#8f99a8;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1),0 1px 2px rgba(17,20,24,.4)}.bp5-dark .bp5-slider-handle.bp5-active{background-color:#738091;box-shadow:inset 0 1px 1px rgba(17,20,24,.1),inset 0 0 0 1px hsla(0,0%,100%,.1),0 1px 2px rgba(17,20,24,.4)}.bp5-dark .bp5-disabled .bp5-slider-handle{background:#5f6b7c;border-color:#5f6b7c;box-shadow:none}.bp5-slider-handle .bp5-slider-label{background:#404854;border-radius:2px;box-shadow:0 0 0 1px rgba(17,20,24,.1),0 2px 4px rgba(17,20,24,.2),0 8px 24px rgba(17,20,24,.2);color:#f6f7f9;margin-left:8px}.bp5-dark .bp5-slider-handle .bp5-slider-label{background:#e5e8eb;box-shadow:0 2px 4px rgba(17,20,24,.4),0 8px 24px rgba(17,20,24,.4);color:#404854}.bp5-slider-handle.bp5-end,.bp5-slider-handle.bp5-start{width:8px}.bp5-slider-handle.bp5-end{border-bottom-left-radius:0;border-top-left-radius:0;margin-left:8px}.bp5-slider-label{display:inline-block;font-size:12px;line-height:1;padding:2px 5px;position:absolute;transform:translate(-50%,20px);vertical-align:top}.bp5-tab,.bp5-tab-list{display:flex;position:relative}.bp5-slider.bp5-vertical{height:150px;min-width:40px;width:40px}.bp5-slider.bp5-vertical .bp5-slider-progress,.bp5-slider.bp5-vertical .bp5-slider-track{bottom:0;height:auto;left:5px;top:0;width:6px}.bp5-slider.bp5-vertical .bp5-slider-handle,.bp5-slider.bp5-vertical .bp5-slider-progress{top:auto}.bp5-slider.bp5-vertical .bp5-slider-label{transform:translate(20px,50%)}.bp5-slider.bp5-vertical .bp5-slider-handle .bp5-slider-label{margin-left:0;margin-top:-8px}.bp5-slider.bp5-vertical .bp5-slider-handle.bp5-end,.bp5-slider.bp5-vertical .bp5-slider-handle.bp5-start{height:8px;margin-left:0;width:16px}.bp5-slider.bp5-vertical .bp5-slider-handle.bp5-start{border-bottom-right-radius:2px;border-top-left-radius:0}.bp5-slider.bp5-vertical .bp5-slider-handle.bp5-start .bp5-slider-label{transform:translate(20px)}.bp5-slider.bp5-vertical .bp5-slider-handle.bp5-end{border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:2px;margin-bottom:8px}@keyframes c{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.bp5-spinner{align-items:center;display:flex;justify-content:center;overflow:visible;vertical-align:middle}.bp5-spinner path{fill-opacity:0}.bp5-spinner .bp5-spinner-head{stroke:rgba(95,107,124,.8);stroke-linecap:round;transform-origin:center;transition:stroke-dashoffset .2s cubic-bezier(.4,1,.75,.9)}.bp5-spinner .bp5-spinner-track{stroke:rgba(95,107,124,.2)}.bp5-spinner-animation{animation:.5s linear infinite c}.bp5-no-spin>.bp5-spinner-animation{animation:none}.bp5-dark .bp5-spinner .bp5-spinner-track{stroke:rgba(17,20,24,.5)}.bp5-spinner.bp5-intent-primary .bp5-spinner-head{stroke:#2d72d2}.bp5-spinner.bp5-intent-success .bp5-spinner-head{stroke:#238551}.bp5-spinner.bp5-intent-warning .bp5-spinner-head{stroke:#c87619}.bp5-spinner.bp5-intent-danger .bp5-spinner-head{stroke:#cd4246}.bp5-tabs.bp5-vertical>.bp5-tab-list{align-items:flex-start;flex-direction:column}.bp5-tabs.bp5-vertical>.bp5-tab-list .bp5-tab{align-items:center;border-radius:2px;display:flex;padding:0 10px;width:100%}.bp5-tabs.bp5-vertical>.bp5-tab-list .bp5-tab[aria-selected=true]{background-color:rgba(45,114,210,.2);box-shadow:none}.bp5-tabs.bp5-vertical>.bp5-tab-list .bp5-tab-indicator-wrapper .bp5-tab-indicator{background-color:rgba(45,114,210,.2);border-radius:2px;bottom:0;height:auto;left:0;right:0;top:0}.bp5-tabs.bp5-vertical>.bp5-tab-panel{margin-top:0;padding-left:20px}.bp5-tab-list{align-items:flex-end;border:none;flex:0 0 auto;list-style:none;margin:0;padding:0}.bp5-tab{word-wrap:normal;align-items:center;align-self:stretch;color:#1c2127;flex:0 0 auto;font-size:14px;line-height:30px;max-width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:top;white-space:nowrap}.bp5-tooltip.bp5-compact .bp5-code,.iconLanguage_nRYT{vertical-align:text-bottom}.bp5-tab a{display:block;text-decoration:none}.bp5-tab-indicator-wrapper~.bp5-tab{background-color:transparent!important;box-shadow:none!important}.bp5-tab[aria-selected=true]{border-radius:0;box-shadow:inset 0 -3px 0 #215db0}.bp5-tab:focus{-moz-outline-radius:0}.bp5-large>.bp5-tab{font-size:16px;line-height:40px}.bp5-tab-panel{margin-top:20px}.bp5-tab-indicator-wrapper{left:0;pointer-events:none;position:absolute;top:0;transform:translateX(0),translateY(0);transition:height .2s,transform .2s,width .2s;transition-timing-function:cubic-bezier(.4,1,.75,.9)}.bp5-tab-indicator-wrapper .bp5-tab-indicator{background-color:#215db0;bottom:0;height:3px;left:0;position:absolute;right:0}.bp5-tab-indicator-wrapper.bp5-no-animation{transition:none}.bp5-dark .bp5-tab[aria-selected=true]{box-shadow:inset 0 -3px 0 #8abbff}.bp5-dark .bp5-tab-indicator{background-color:#8abbff}.bp5-flex-expander{flex:1 1}.bp5-tag{align-items:center;background-color:#5f6b7c;border:none;border-radius:2px;box-shadow:none;color:#fff;display:inline-flex;flex-direction:row;font-size:12px;line-height:16px;max-width:100%;min-height:20px;min-width:20px;padding:2px 6px;position:relative}.bp5-dark .bp5-toast .bp5-button .bp5-icon,.bp5-tag-remove,.bp5-tag.bp5-intent-danger .bp5-tag-remove,.bp5-tag.bp5-intent-primary .bp5-tag-remove,.bp5-tag.bp5-intent-success .bp5-tag-remove,.bp5-toast.bp5-dark .bp5-button .bp5-icon,.bp5-toast.bp5-intent-danger .bp5-icon:first-child,.bp5-toast.bp5-intent-primary .bp5-icon:first-child,.bp5-toast.bp5-intent-success .bp5-icon:first-child,.bp5-toast[class*=bp5-intent-] a,.bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content .bp5-tree-node-caret:before{color:hsla(0,0%,100%,.7)}.bp5-tag:before,.bp5-tag>*,.pin:not(:last-of-type){margin-right:4px}.bp5-tag-input .bp5-tag.bp5-active,.bp5-tag:focus{-moz-outline-radius:6px;outline:rgba(45,114,210,.6) solid 2px;outline-offset:0}.bp5-tag.bp5-interactive:hover{background:#404854}.bp5-tag.bp5-round{border-radius:30px;padding-left:8px;padding-right:8px}.bp5-dark .bp5-tag{background-color:#c5cbd3;color:#1c2127}.bp5-dark .bp5-tag.bp5-interactive.bp5-active,.bp5-dark .bp5-tag.bp5-interactive:active{background:#8f99a8}.bp5-large .bp5-tag,.bp5-tag.bp5-large{font-size:14px;line-height:20px;min-height:30px;min-width:30px;padding:5px 10px}.bp5-large .bp5-tag.bp5-round,.bp5-tag.bp5-large.bp5-round{padding-left:12px;padding-right:12px}.bp5-tag.bp5-intent-primary.bp5-interactive:hover{background-color:#215db0}.bp5-tag.bp5-intent-primary.bp5-interactive.bp5-active,.bp5-tag.bp5-intent-primary.bp5-interactive:active{background-color:#184a90}.bp5-tag.bp5-intent-success,.bp5-tooltip.bp5-intent-success .bp5-popover-content{background:#238551;color:#fff}.bp5-tag.bp5-intent-success.bp5-interactive:hover{background-color:#1c6e42}.bp5-tag.bp5-intent-success.bp5-interactive.bp5-active,.bp5-tag.bp5-intent-success.bp5-interactive:active{background-color:#165a36}.bp5-tag.bp5-intent-warning.bp5-interactive:hover{background-color:#ec9a3c}.bp5-dark .bp5-tag-remove,.bp5-tag.bp5-intent-warning .bp5-tag-remove,.bp5-toast.bp5-intent-warning .bp5-icon:first-child{color:rgba(28,33,39,.7)}.bp5-tag.bp5-intent-danger,.bp5-tooltip.bp5-intent-danger .bp5-popover-content{background:#cd4246;color:#fff}.bp5-tag.bp5-intent-danger.bp5-interactive:hover{background-color:#ac2f33}.bp5-tag.bp5-intent-danger.bp5-interactive.bp5-active,.bp5-tag.bp5-intent-danger.bp5-interactive:active{background-color:#8e292c}.bp5-tag.bp5-minimal .bp5-icon-large,.bp5-tag.bp5-minimal .bp5-icon-standard,.bp5-tag.bp5-minimal>.bp5-icon{fill:#5f6b7c}.bp5-tag.bp5-minimal:not([class*=bp5-intent-]){background-color:rgba(143,153,168,.15);color:#1c2127}.bp5-tag.bp5-minimal:not([class*=bp5-intent-]).bp5-interactive:hover{background-color:rgba(143,153,168,.3);color:#111418}.bp5-tag.bp5-minimal:not([class*=bp5-intent-]).bp5-interactive.bp5-active,.bp5-tag.bp5-minimal:not([class*=bp5-intent-]).bp5-interactive:active{background-color:rgba(143,153,168,.35);color:#111418}.bp5-dark .bp5-tooltip .bp5-heading,.bp5-dark .bp5-tooltip .bp5-popover-content,.bp5-tag.bp5-minimal:not([class*=bp5-intent-]) .bp5-tag-remove:active,.bp5-tag.bp5-minimal:not([class*=bp5-intent-]) .bp5-tag-remove:hover,.bp5-tooltip.bp5-dark .bp5-heading,.bp5-tooltip.bp5-dark .bp5-popover-content{color:#404854}.bp5-dark .bp5-tag.bp5-minimal:not([class*=bp5-intent-]){background-color:rgba(143,153,168,.15);color:#f6f7f9}.bp5-dark .bp5-tag.bp5-minimal:not([class*=bp5-intent-]).bp5-interactive:hover{background-color:rgba(143,153,168,.3);color:#fff}.bp5-dark .bp5-tag.bp5-minimal:not([class*=bp5-intent-]).bp5-interactive.bp5-active,.bp5-dark .bp5-tag.bp5-minimal:not([class*=bp5-intent-]).bp5-interactive:active{background-color:rgba(143,153,168,.35);color:#fff}.bp5-dark .bp5-tag.bp5-minimal:not([class*=bp5-intent-]) .bp5-tag-remove:active,.bp5-dark .bp5-tag.bp5-minimal:not([class*=bp5-intent-]) .bp5-tag-remove:hover{color:#d3d8de}.bp5-tag.bp5-minimal.bp5-intent-primary .bp5-icon-large,.bp5-tag.bp5-minimal.bp5-intent-primary .bp5-icon-standard,.bp5-tag.bp5-minimal.bp5-intent-primary>.bp5-icon{fill:#215db0}.bp5-tag.bp5-minimal.bp5-intent-primary.bp5-interactive.bp5-active,.bp5-tag.bp5-minimal.bp5-intent-primary.bp5-interactive:active{background-color:rgba(45,114,210,.3);color:#184a90}.bp5-tag.bp5-minimal.bp5-intent-success{background-color:rgba(35,133,81,.1);color:#1c6e42}.bp5-tag.bp5-minimal.bp5-intent-success .bp5-icon-large,.bp5-tag.bp5-minimal.bp5-intent-success .bp5-icon-standard,.bp5-tag.bp5-minimal.bp5-intent-success>.bp5-icon{fill:#1c6e42}.bp5-tag.bp5-minimal.bp5-intent-success.bp5-interactive.bp5-active,.bp5-tag.bp5-minimal.bp5-intent-success.bp5-interactive:active{background-color:rgba(35,133,81,.3);color:#165a36}.bp5-tag.bp5-minimal.bp5-intent-success .bp5-tag-remove:active,.bp5-tag.bp5-minimal.bp5-intent-success .bp5-tag-remove:hover{color:#165a36}.bp5-tag.bp5-minimal.bp5-intent-warning{background-color:rgba(200,118,25,.1);color:#935610}.bp5-tag.bp5-minimal.bp5-intent-warning .bp5-icon-large,.bp5-tag.bp5-minimal.bp5-intent-warning .bp5-icon-standard,.bp5-tag.bp5-minimal.bp5-intent-warning>.bp5-icon{fill:#935610}.bp5-tag.bp5-minimal.bp5-intent-warning.bp5-interactive.bp5-active,.bp5-tag.bp5-minimal.bp5-intent-warning.bp5-interactive:active{background-color:rgba(200,118,25,.3);color:#77450d}.bp5-tag.bp5-minimal.bp5-intent-warning .bp5-tag-remove:active,.bp5-tag.bp5-minimal.bp5-intent-warning .bp5-tag-remove:hover{color:#77450d}.bp5-tag.bp5-minimal.bp5-intent-danger{background-color:rgba(205,66,70,.1);color:#ac2f33}.bp5-tag.bp5-minimal.bp5-intent-danger .bp5-icon-large,.bp5-tag.bp5-minimal.bp5-intent-danger .bp5-icon-standard,.bp5-tag.bp5-minimal.bp5-intent-danger>.bp5-icon{fill:#ac2f33}.bp5-tag.bp5-minimal.bp5-intent-danger.bp5-interactive.bp5-active,.bp5-tag.bp5-minimal.bp5-intent-danger.bp5-interactive:active{background-color:rgba(205,66,70,.3);color:#8e292c}.bp5-tag.bp5-minimal.bp5-intent-danger .bp5-tag-remove:active,.bp5-tag.bp5-minimal.bp5-intent-danger .bp5-tag-remove:hover{color:#8e292c}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-primary.bp5-interactive.bp5-active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-primary.bp5-interactive:active{background-color:rgba(45,114,210,.35);color:#99c4ff}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-success{background-color:rgba(35,133,81,.2);color:#72ca9b}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-success.bp5-interactive.bp5-active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-success.bp5-interactive:active{background-color:rgba(35,133,81,.35);color:#7cd7a2}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-success .bp5-tag-remove:active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-success .bp5-tag-remove:hover{color:#7cd7a2}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-warning{background-color:rgba(200,118,25,.2);color:#fbb360}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-warning.bp5-interactive.bp5-active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-warning.bp5-interactive:active{background-color:rgba(200,118,25,.35);color:#f5c186}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-warning .bp5-tag-remove:active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-warning .bp5-tag-remove:hover{color:#f5c186}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-danger{background-color:rgba(205,66,70,.2);color:#fa999c}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-danger.bp5-interactive.bp5-active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-danger.bp5-interactive:active{background-color:rgba(205,66,70,.35);color:#ffa1a4}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-danger .bp5-tag-remove:active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-danger .bp5-tag-remove:hover{color:#ffa1a4}.bp5-tag-remove{background:none;border:none;display:flex;margin-bottom:-2px;margin-right:-6px!important;margin-top:-2px;padding:2px 2px 2px 0}.bp5-tag-input,.bp5-tag-input .bp5-tag-input-values:first-child .bp5-input-ghost{padding-left:5px}.bp5-tag-remove:hover{background:none;text-decoration:none}.bp5-tag-remove:empty:before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;content:"\f2ba";font-family:blueprint-icons-16,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:400;height:16px;line-height:1;width:16px}.bp5-large .bp5-tag-remove{margin-right:-10px!important;padding:0 5px 0 0}.bp5-large .bp5-tag-remove:empty:before{font-style:normal;font-variant:normal;font-weight:400;height:20px;line-height:1;width:20px}.bp5-tag-input{align-items:flex-start;cursor:text;display:flex;flex-direction:row;height:auto;line-height:inherit;min-height:30px;padding-right:0}.bp5-tag-input .bp5-tag-input-icon{color:#5f6b7c;margin-left:2px;margin-right:7px;margin-top:7px}.bp5-tag-input .bp5-tag-input-values{align-items:center;align-self:stretch;display:flex;flex-direction:row;flex-wrap:wrap;margin-right:7px;margin-top:5px;min-width:0;position:relative}.bp5-tag-input .bp5-tag-input-values>*{flex-grow:0;flex-shrink:0;margin-bottom:5px}.bp5-tag-input .bp5-tag-input-values:first-child .bp5-tag~.bp5-input-ghost,.bp5-tree-node-content-0,:not(.containsTaskList_WAbI>li)>.containsTaskList_WAbI{padding-left:0}.bp5-tag-input .bp5-tag{overflow-wrap:break-word}.bp5-tag-input .bp5-input-ghost{flex:1 1 auto;line-height:20px;width:80px}.ins-view .ins-view-inner,.node-io-view .node-io-view-inner{line-height:1;max-width:400px;text-overflow:ellipsis;font-family:Inter,sans-serif;text-align:center;-webkit-font-smoothing:antialiased;white-space:nowrap}.bp5-tag-input .bp5-button,.bp5-tag-input .bp5-spinner{margin:3px 3px 3px 0}.bp5-tag-input.bp5-large{height:auto;min-height:40px}.bp5-tag-input.bp5-large .bp5-tag-input-icon{margin-left:5px;margin-top:10px}.bp5-tag-input.bp5-large .bp5-button{margin:5px 5px 5px 0;min-height:30px;min-width:30px;padding:5px 10px}.bp5-tag-input.bp5-large .bp5-spinner{margin:8px 8px 8px 0}.bp5-dark .bp5-tag-input .bp5-input-ghost::placeholder,.bp5-tag-input.bp5-dark .bp5-input-ghost::placeholder{color:#abb3bf}.bp5-dark .bp5-tag-input.bp5-active,.bp5-tag-input.bp5-dark.bp5-active{background-color:rgba(17,20,24,.3);box-shadow:inset 0 0 0 1px #4c90f0,inset 0 0 0 1px #4c90f0,0 0 0 2px rgba(76,144,240,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-tag-input.bp5-active.bp5-intent-primary,.bp5-tag-input.bp5-dark.bp5-active.bp5-intent-primary{box-shadow:inset 0 0 0 1px #4c90f0,0 0 0 2px rgba(76,144,240,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-tag-input.bp5-active.bp5-intent-success,.bp5-tag-input.bp5-dark.bp5-active.bp5-intent-success{box-shadow:inset 0 0 0 1px #32a467,0 0 0 2px rgba(50,164,103,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-tag-input.bp5-active.bp5-intent-warning,.bp5-tag-input.bp5-dark.bp5-active.bp5-intent-warning{box-shadow:inset 0 0 0 1px #ec9a3c,0 0 0 2px rgba(236,154,60,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-tag-input.bp5-active.bp5-intent-danger,.bp5-tag-input.bp5-dark.bp5-active.bp5-intent-danger{box-shadow:inset 0 0 0 1px #e76a6e,0 0 0 2px rgba(231,106,110,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-input-ghost{background:none;border:none;box-shadow:none;padding:0}.bp5-omnibar .bp5-input,.bp5-omnibar .bp5-menu{border-radius:0;background-color:transparent}.bp5-input-ghost::placeholder{color:#5f6b7c;opacity:1}.bp5-resizable-input-span{max-height:0;max-width:100%;min-width:80px;opacity:0;overflow:hidden;position:absolute;white-space:nowrap;z-index:-1}.bp5-omnibar,.bp5-omnibar.bp5-overlay-exit,.bp5-toast.bp5-toast-exit{filter:blur(0);opacity:1}.bp5-toast{align-items:flex-start;background-color:#fff;border-radius:2px;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 2px 4px rgba(17,20,24,.2),0 8px 24px rgba(17,20,24,.2);display:flex;margin:20px 0 0;max-width:500px;min-width:300px;pointer-events:all;position:relative!important}.bp5-toast.bp5-toast-appear,.bp5-toast.bp5-toast-appear~.bp5-toast,.bp5-toast.bp5-toast-enter,.bp5-toast.bp5-toast-enter~.bp5-toast{transform:translateY(-40px)}.bp5-toast.bp5-toast-appear-active,.bp5-toast.bp5-toast-appear-active~.bp5-toast,.bp5-toast.bp5-toast-enter-active,.bp5-toast.bp5-toast-enter-active~.bp5-toast{transform:translateY(0);transition:transform .3s cubic-bezier(.54,1.12,.38,1.11) 0}.bp5-toast.bp5-toast-exit-active{filter:blur(10px);opacity:0;transition:opacity .3s cubic-bezier(.4,1,.75,.9) 0,filter .3s cubic-bezier(.4,1,.75,.9) 0}.bp5-toast.bp5-toast-exit-active~.bp5-toast{transform:translateY(-40px);transition:transform .1s cubic-bezier(.4,1,.75,.9) 50ms}.bp5-toast .bp5-button-group{flex:0 0 auto;padding:5px 5px 5px 0}.bp5-toast>.bp5-icon{color:#5f6b7c;margin:12px 0 12px 12px}.instance-panel,.pin:not(:first-of-type){margin-left:4px}.bp5-dark .bp5-toast,.bp5-toast.bp5-dark{background-color:#404854;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 2px 4px rgba(17,20,24,.4),0 8px 24px rgba(17,20,24,.4)}.bp5-dark .bp5-toast>.bp5-icon,.bp5-dark .bp5-tree .bp5-icon,.bp5-dark .bp5-tree .bp5-icon-large,.bp5-dark .bp5-tree .bp5-icon-standard,.bp5-dark .bp5-tree-node-caret,.bp5-toast.bp5-dark>.bp5-icon,.bp5-tooltip .bp5-text-muted{color:#abb3bf}.bp5-toast.bp5-intent-primary{background-color:#2d72d2;color:#fff}.bp5-toast.bp5-intent-primary .bp5-button{background-color:#2d72d2!important;color:#fff!important}.bp5-toast.bp5-intent-primary .bp5-button:hover{background-color:#215db0!important;color:#fff!important}.bp5-toast.bp5-intent-primary .bp5-button:active{background-color:#184a90!important;color:#fff!important}.bp5-toast.bp5-intent-danger .bp5-button:focus,.bp5-toast.bp5-intent-primary .bp5-button:focus,.bp5-toast.bp5-intent-success .bp5-button:focus,.bp5-toast.bp5-intent-warning .bp5-button:focus{outline-color:hsla(0,0%,100%,.5)}.bp5-toast.bp5-intent-danger .bp5-button:last-child>.bp5-icon-cross,.bp5-toast.bp5-intent-primary .bp5-button:last-child>.bp5-icon-cross,.bp5-toast.bp5-intent-success .bp5-button:last-child>.bp5-icon-cross{color:hsla(0,0%,100%,.7)!important}.bp5-toast.bp5-intent-success{background-color:#238551;color:#fff}.bp5-toast.bp5-intent-success .bp5-button{background-color:#238551!important;color:#fff!important}.bp5-toast.bp5-intent-success .bp5-button:hover{background-color:#1c6e42!important;color:#fff!important}.bp5-toast.bp5-intent-success .bp5-button:active{background-color:#165a36!important;color:#fff!important}.bp5-toast.bp5-intent-warning{background-color:#fbb360;color:#1c2127}.bp5-toast.bp5-intent-warning .bp5-button{background-color:#fbb360!important;color:#1c2127!important}.bp5-toast.bp5-intent-warning .bp5-button:hover{background-color:#ec9a3c!important;color:#1c2127!important}.bp5-toast.bp5-intent-warning .bp5-button:active{background-color:#c87619!important;color:#1c2127!important}.bp5-toast.bp5-intent-warning .bp5-button:last-child>.bp5-icon-cross{color:rgba(28,33,39,.7)!important}.bp5-toast.bp5-intent-danger{background-color:#cd4246;color:#fff}.bp5-toast.bp5-intent-danger .bp5-button{background-color:#cd4246!important;color:#fff!important}.bp5-toast.bp5-intent-danger .bp5-button:hover{background-color:#ac2f33!important;color:#fff!important}.bp5-toast.bp5-intent-danger .bp5-button:active{background-color:#8e292c!important;color:#fff!important}.bp5-toast-message{flex:1 1 auto;padding:11px}.bp5-toast-container{align-items:center;display:flex!important;flex-direction:column;left:0;overflow:hidden;padding:0 20px 20px;pointer-events:none;right:0;z-index:40}.bp5-toast-container.bp5-toast-container-top,.visual-node-editor .node-inputs.node-inputs,.visual-node-editor .node-outputs.node-inputs{top:0}.bp5-toast-container.bp5-toast-container-bottom{bottom:0;flex-direction:column-reverse;top:auto}.bp5-toast-container-bottom .bp5-toast.bp5-toast-appear:not(.bp5-toast-appear-active),.bp5-toast-container-bottom .bp5-toast.bp5-toast-appear:not(.bp5-toast-appear-active)~.bp5-toast,.bp5-toast-container-bottom .bp5-toast.bp5-toast-enter:not(.bp5-toast-enter-active),.bp5-toast-container-bottom .bp5-toast.bp5-toast-enter:not(.bp5-toast-enter-active)~.bp5-toast,.bp5-toast-container-bottom .bp5-toast.bp5-toast-exit-active~.bp5-toast,.bp5-toast-container-bottom .bp5-toast.bp5-toast-leave-active~.bp5-toast{transform:translateY(60px)}.bp5-tooltip{box-shadow:0 0 0 1px rgba(17,20,24,.1),0 2px 4px rgba(17,20,24,.2),0 8px 24px rgba(17,20,24,.2);color:#f6f7f9;transform:scale(1)}.bp5-tooltip .bp5-popover-arrow{height:22px;position:absolute;width:22px}.bp5-tooltip .bp5-popover-arrow:before{height:14px;margin:4px;width:14px;box-shadow:1px 1px 6px rgba(17,20,24,.2)}.bp5-tooltip .bp5-popover-content{background:#404854;padding:10px 12px}.bp5-tooltip .bp5-popover-arrow-fill{fill:#404854}.bp5-popover-appear>.bp5-tooltip,.bp5-popover-enter>.bp5-tooltip{transform:scale(.8)}.bp5-popover-exit-active>.bp5-tooltip{transform:scale(.8);transition:transform .1s cubic-bezier(.4,1,.75,.9) 0}.bp5-tooltip.bp5-compact .bp5-popover-content{line-height:1rem;padding:5px 7px}.bp5-tooltip.bp5-popover-placement-top .bp5-popover-arrow{transform:translateY(-3px)}.bp5-tooltip.bp5-popover-placement-left .bp5-popover-arrow{transform:translateX(-3px)}.bp5-tooltip.bp5-popover-placement-bottom .bp5-popover-arrow{transform:translateY(3px)}.bp5-tooltip.bp5-popover-placement-right .bp5-popover-arrow{transform:translateX(3px)}.bp5-dark .bp5-tooltip,.bp5-tooltip.bp5-dark{box-shadow:0 2px 4px rgba(17,20,24,.4),0 8px 24px rgba(17,20,24,.4)}.bp5-dark .bp5-tooltip .bp5-popover-content,.bp5-tooltip.bp5-dark .bp5-popover-content{background:#e5e8eb}.bp5-dark .bp5-tooltip .bp5-popover-arrow:before,.bp5-tooltip.bp5-dark .bp5-popover-arrow:before{box-shadow:1px 1px 6px rgba(17,20,24,.4)}.bp5-dark .bp5-tooltip .bp5-popover-arrow-fill,.bp5-tooltip.bp5-dark .bp5-popover-arrow-fill{fill:#e5e8eb}.bp5-dark .bp5-tooltip .bp5-running-text hr,.bp5-tooltip.bp5-dark .bp5-running-text hr{border-color:rgba(17,20,24,.15)}.bp5-tree .bp5-icon-large.bp5-intent-primary,.bp5-tree .bp5-icon-standard.bp5-intent-primary,.bp5-tree .bp5-icon.bp5-intent-primary,a>.bp5-dark .bp5-tooltip .bp5-code,a>.bp5-dark .bp5-tooltip .bp5-running-text code,a>.bp5-tooltip.bp5-dark .bp5-code,a>.bp5-tooltip.bp5-dark .bp5-running-text code{color:#2d72d2}.bp5-tooltip.bp5-intent-primary .bp5-popover-arrow-fill{fill:#2d72d2}.bp5-tooltip.bp5-intent-success .bp5-popover-arrow-fill{fill:#238551}.bp5-tooltip.bp5-intent-warning .bp5-popover-content{background:#c87619;color:#fff}.bp5-tooltip.bp5-intent-warning .bp5-popover-arrow-fill{fill:#c87619}.bp5-tooltip.bp5-intent-danger .bp5-popover-arrow-fill{fill:#cd4246}.bp5-tooltip-indicator{border-bottom:1px dotted;cursor:help}.bp5-tree .bp5-icon-large.bp5-intent-success,.bp5-tree .bp5-icon-standard.bp5-intent-success,.bp5-tree .bp5-icon.bp5-intent-success{color:#238551}.bp5-tree .bp5-icon-large.bp5-intent-warning,.bp5-tree .bp5-icon-standard.bp5-intent-warning,.bp5-tree .bp5-icon.bp5-intent-warning{color:#c87619}.bp5-tree .bp5-icon-large.bp5-intent-danger,.bp5-tree .bp5-icon-standard.bp5-intent-danger,.bp5-tree .bp5-icon.bp5-intent-danger{color:#cd4246}.bp5-tree-root{background-color:transparent;cursor:default;padding-left:0;position:relative}.bp5-tree-node-content-1{padding-left:23px}.bp5-tree-node-content-2{padding-left:46px}.bp5-tree-node-content-3{padding-left:69px}.bp5-tree-node-content-4{padding-left:92px}.bp5-tree-node-content-5{padding-left:115px}.bp5-tree-node-content-6{padding-left:138px}.bp5-tree-node-content-7{padding-left:161px}.bp5-tree-node-content-8{padding-left:184px}.bp5-tree-node-content-9{padding-left:207px}.bp5-tree-node-content-10{padding-left:230px}.bp5-tree-node-content-11{padding-left:253px}.bp5-tree-node-content-12{padding-left:276px}.bp5-tree-node-content-13{padding-left:299px}.bp5-tree-node-content-14{padding-left:322px}.bp5-tree-node-content-15{padding-left:345px}.bp5-tree-node-content-16{padding-left:368px}.bp5-tree-node-content-17{padding-left:391px}.bp5-tree-node-content-18{padding-left:414px}.bp5-tree-node-content-19{padding-left:437px}.bp5-tree-node-content-20{padding-left:460px}.bp5-tree-node-content{align-items:center;background:none;display:flex;height:30px;padding-right:5px;width:100%}.bp5-tree-node-caret,.bp5-tree-node-caret-none{min-width:30px}.bp5-tree-node-caret{color:#5f6b7c;cursor:pointer;padding:7px;transform:rotate(0);transition:transform .2s cubic-bezier(.4,1,.75,.9)}.bp5-tree-node-icon{margin-right:7px;position:relative}.bp5-tree-node-label{word-wrap:normal;flex:1 1 auto;overflow:hidden;position:relative;text-overflow:ellipsis;-webkit-user-select:none;user-select:none;white-space:nowrap}.bp5-tree-node-label span,.tags__trG{display:inline}.bp5-tree-node-secondary-label{padding:0 5px;-webkit-user-select:none;user-select:none}.bp5-tree-node.bp5-disabled .bp5-tree-node-content{background-color:inherit;color:rgba(95,107,124,.6);cursor:not-allowed}.bp5-dark .bp5-tree-node-content:hover{background-color:rgba(95,107,124,.3)}.bp5-multi-select{min-width:150px}.bp5-multi-select-popover .bp5-menu,.bp5-suggest-popover .bp5-menu{max-height:300px;max-width:400px;overflow:auto}.bp5-multi-select-popover.bp5-popover-match-target-width .bp5-menu,.bp5-select-popover.bp5-popover-match-target-width .bp5-menu,.bp5-suggest-popover.bp5-popover-match-target-width .bp5-menu{max-width:none;min-width:0}.bp5-omnibar{background-color:#fff;border-radius:2px;box-shadow:0 0 0 1px rgba(17,20,24,.1),0 4px 8px rgba(17,20,24,.2),0 18px 46px 6px rgba(17,20,24,.2);left:calc(50% - 250px);top:20vh;width:500px;z-index:21}.bp5-omnibar.bp5-overlay-appear,.bp5-omnibar.bp5-overlay-enter{filter:blur(20px);opacity:0}.bp5-omnibar.bp5-overlay-appear-active,.bp5-omnibar.bp5-overlay-enter-active{filter:blur(0);opacity:1;transition:filter .2s cubic-bezier(.4,1,.75,.9) 0,opacity .2s cubic-bezier(.4,1,.75,.9) 0}.bp5-omnibar.bp5-overlay-exit-active{filter:blur(20px);opacity:0;transition:filter .2s cubic-bezier(.4,1,.75,.9) 0,opacity .2s cubic-bezier(.4,1,.75,.9) 0}.bp5-omnibar .bp5-menu{box-shadow:inset 0 1px 0 rgba(17,20,24,.15);max-height:calc(60vh - 40px);overflow:auto}.bp5-dark .bp5-omnibar,.bp5-omnibar.bp5-dark{background-color:#383e47;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 4px 8px rgba(17,20,24,.4),0 18px 46px 6px rgba(17,20,24,.4)}.bp5-omnibar-overlay .bp5-overlay-backdrop{background-color:rgba(17,20,24,.2)}.bp5-select-popover .bp5-popover-content{padding:5px}.bp5-select-popover .bp5-menu{max-height:300px;max-width:400px;overflow:auto;padding:0}.bp5-select-popover .bp5-menu:not(:first-child){padding-top:5px}@font-face{font-family:blueprint-icons-16;src:url(/assets/fonts/blueprint-icons-16-fe34be7b52fe280ae6fcd1a2c90c2ec5.ttf) format("truetype"),url(/assets/fonts/blueprint-icons-16-2669cc26a3ca40496c1a2fb0246b0ce7.eot#iefix) format("embedded-opentype"),url(/assets/fonts/blueprint-icons-16-5d3be7e91ef0bd98ba4349ec8a8ae419.woff2) format("woff2"),url(/assets/fonts/blueprint-icons-16-6908f1544dc20870cd80bd55f3b97d4e.woff) format("woff"),url(/assets/images/blueprint-icons-16-928936b25a7f631d44d6e20d402d0af2.svg#blueprint-icons-16) format("svg")}@font-face{font-family:blueprint-icons-20;src:url(/assets/fonts/blueprint-icons-20-cf3d85353267b1034956ca544495b97a.ttf) format("truetype"),url(/assets/fonts/blueprint-icons-20-7a9cd56e4f1468be3c5758d1832b02b0.eot#iefix) format("embedded-opentype"),url(/assets/fonts/blueprint-icons-20-c20dc60373b0a5fbfa7f6cd280f49bba.woff2) format("woff2"),url(/assets/fonts/blueprint-icons-20-6bafdea7cca3b5a2de42c4e73c456115.woff) format("woff"),url(/assets/images/blueprint-icons-20-69e09533623b64863cf5cc65034cf679.svg#blueprint-icons-20) format("svg")}.base-node-editor .form-row{display:flex;flex-direction:row;justify-content:space-between}.base-node-editor .form-row>div:not(:last-child){padding-right:10px}.base-node-editor .preview-wrapper{display:flex;justify-content:center}.manage-visual-node-view{color:pink}.omnibar-item .title{display:flex;font-weight:700;justify-content:space-between}.omnibar-item .title .extra{font-weight:400;opacity:.8}.omnibar-item.active .description{white-space:break-spaces}.data-inspection-modal{width:80%}.data-inspection-modal header input{margin:10px 0}.data-inspection-modal .main-wrapper{display:flex;flex-direction:row;gap:10px;max-height:80%}.data-inspection-modal .main-wrapper .samples-menu{flex:0;max-height:80vh;overflow:auto}.data-inspection-modal .main-wrapper .content-wrapper{flex:1;max-height:80vh;overflow:auto}.flyde-flow-editor{background-color:#fff;display:flex;flex:1;flex-direction:column;position:relative}.base-node-view,.base-node-view-wrapper{position:absolute;transform-origin:top left}.flyde-flow-editor>.visual-node-editor{flex:1;height:100%}.feature-strip .feature-strip-inner .image-container,.flyde-flow-editor>.breadcrumbs{flex-shrink:0}.base-node-view-vp-fixer{transform-origin:top left;will-change:transform}.base-node-view-wrapper{transition:background-color 3s ease-out,box-shadow 3s ease-out}.base-node-view-vp-fixer.display-mode,.base-node-view-vp-fixer.display-mode .base-node-view,.base-node-view-vp-fixer.display-mode .base-node-view-wrapper,.ins-view.display-mode{position:static}.base-node-view{display:inline-block;transition:box-shadow .5s ease-in-out;will-change:transform,width}.connection:hover polyline{stroke-width:3}.connection polyline,path.connection{fill:none;stroke-width:1.5;stroke-linecap:round;stroke:#525252;cursor:pointer}.actions-menu .icon-wrapper svg,.help-bubble svg{fill:currentColor}.connection polyline.hidden,path.connection.hidden{stroke:transparent}.connection polyline.hidden.parent-selected,path.connection.hidden.parent-selected{stroke-dasharray:8;stroke:#6c6c6c}.connection[data-runtime=active] path{stroke:#4bac00;box-shadow:5px 10px #888}.connection.delayed polyline,.connection.future-addition,.connection.future-removal,.connections-view .connection.delayed polyline{stroke-dasharray:6}.connection.future-addition path{stroke-width:2;stroke:rgba(0,125,198,.647)}.connection.future-removal path{stroke-width:2;stroke:rgba(198,0,0,.647)}.connection polyline:hover{stroke:#3bb8ff}.connections-view svg{overflow:visible;width:1px}.connections-view path{stroke-width:1.5;stroke-linecap:round;stroke:#a1a1aa}.connections-view path.future-add{stroke:rgba(0,125,198,.647)}.connections-view path.future-remove{stroke:rgba(198,0,0,.647)}.connections-view text.label{text-anchor:middle;font-size:14px}.instance-panel{background:#fff;border-left:1px solid #e2e2e2;box-shadow:0 4px 4px rgba(0,0,0,.25);box-sizing:border-box;display:flex;flex-direction:column;padding:20px 10px 100px;position:relative;-webkit-user-select:none;user-select:none;z-index:1}.ins-view,.layout-debugger{display:inline-block;will-change:transform,width}.instance-panel .instance-panel-inner{flex:1;height:100%;overflow:auto}.instance-panel:not(:hover) .resizer{opacity:.2}.instance-panel .resizer,.playground-container .handle{background:#aeaeae;bottom:0;cursor:col-resize;flex-grow:0;flex-shrink:0;height:100%;left:0;position:absolute;top:0;transition:opacity .05s linear;width:3px}.instance-panel .resizer:after,.playground-container .handle:after{background-color:#cecece;content:"";display:block;height:80%;left:1px;position:absolute;top:10%;width:1px}.ins-view .inputs,.ins-view .outputs{align-content:space-between;align-items:center;display:flex;justify-content:space-around;width:100%}.ins-view{position:absolute;transform-origin:top left;transition:box-shadow .15s ease-in-out;z-index:1}.ins-view.no-inputs{padding-top:15px}.ins-view.no-outputs{padding-bottom:15px}.ins-view .ins-view-inner{border:2px solid;border-radius:5px;cursor:pointer;font-size:16px;font-weight:600;overflow:hidden;padding:10px 30px;position:relative;transition:background-color .1s ease-in-out,box-shadow .2s ease-in-out;-webkit-user-select:none;user-select:none;z-index:1}.ins-view .ins-view-inner:not(.selected).closest,.ins-view .ins-view-inner:not(.selected):hover,.node-io-view .node-io-view-inner:not(.selected).closest,.node-io-view .node-io-view-inner:not(.selected):hover{border-style:dashed}.ins-view .ins-view-inner:not(.dark),.node-io-view .node-io-view-inner:not(.dark){background:#fff;border-color:#d1d5db;color:#000}.ins-view .ins-view-inner:not(.dark).closest:not(.selected),.node-io-view .node-io-view-inner:not(.dark).closest:not(.selected){border-color:#9ca3af}.ins-view .ins-view-inner:not(.dark):hover:not(.selected),.node-io-view .node-io-view-inner:not(.dark):hover:not(.selected){border-color:#4b5563}.ins-view .ins-view-inner:not(.dark).selected,.node-io-view .node-io-view-inner:not(.dark).selected{background:#fff;border-color:#1f2937;border-style:solid;transition:background-color .05s ease-in-out}.ins-view .ins-view-inner.dark,.node-io-view .node-io-view-inner.dark{background:#262626;border-color:#71717a;color:#fafafa}.ins-view .ins-view-inner.dark.closest:not(.selected),.node-io-view .node-io-view-inner.dark.closest:not(.selected){border-color:#a1a1aa}.ins-view .ins-view-inner.dark:hover:not(.selected),.node-io-view .node-io-view-inner.dark:hover:not(.selected){border-color:#d4d4d8}.ins-view .ins-view-inner.dark.selected,.node-io-view .node-io-view-inner.dark.selected{background:#18181b;border-color:#e4e4e7;border-style:solid;transition:background-color .05s ease-in-out}.ins-view .ins-view-inner .svg-inline--fa{color:var(--node-color);filter:brightness(.75)}.ins-view .ins-view-inner.size-small{font-size:14px;padding:6px 18px}.inline-editor-portal-root .inline-group-editor-container{background:#fff;box-shadow:0 0 10px 2px rgba(48,48,48,.15);display:flex;flex-direction:column;height:85%;left:10%;overflow:hidden;position:absolute;top:7.5%;width:80%;z-index:2}.inline-editor-portal-root .inline-group-editor-container>header{font-size:20px;font-weight:600;padding:4px 15px 3px;text-align:center;-webkit-user-select:none;user-select:none;z-index:1}.inline-editor-portal-root .inline-group-editor-container>.visual-node-editor{display:flex;flex:1;overflow:hidden;position:relative}.ins-view .pin{transition:transform .1s ease-in-out}.ins-view:not(:hover):not(.force-minimized-input) .pin.input.minimized:not(.selected){transform:translateY(calc(100% - 16px)) scaleY(0)}.ins-view:not(:hover):not(.force-minimized-output) .pin.output.minimized:not(.selected){transform:translateY(calc(-100% + 16px)) scaleY(0)}.__react_component_tooltip.instance-info-tooltip,.__react_component_tooltip.pin-info-tooltip{font-size:14px;max-width:400px}.layout-debugger{transition:box-shadow .5s ease-in-out;z-index:2}.layout-debugger,.layout-debugger .drag-sim,.layout-debugger .layout-debugger-zoom-wrapper{position:absolute;transform-origin:top left}.layout-debugger .layout-debugger-inner{background:pink;border:1px solid #fff;transform-origin:top left}.viewport-data{left:10px;position:absolute;top:10px}.pos-debugger{background:#000;color:#ff0;font-size:8px;position:absolute;z-index:2}.node-io-view .node-io-view-inner{border:2px solid;border-radius:2px;cursor:pointer;font-size:18px;font-weight:500;overflow:hidden;padding:6px 8px;position:relative;transition:background-color .1s ease-in-out,box-shadow .2s ease-in-out;-webkit-user-select:none;user-select:none;z-index:1}.node-io-view.input .node-io-view-inner{border:2px solid #83cff6}.node-io-view.output .node-io-view-inner{border:2px solid #86efac}.node-io-view.active .node-io-view-inner{background:#c8ffc7}.json-view{--json-property:#009033;--json-index:#676dff;--json-number:#676dff;--json-string:#b2762e;--json-boolean:#dc155e;--json-null:#dc155e;display:block}.json-view .json-view--property{color:var(--json-property)}.json-view .json-view--index{color:var(--json-index)}.json-view .json-view--number{color:var(--json-number)}.json-view .json-view--string{color:var(--json-string)}.json-view .json-view--boolean{color:var(--json-boolean)}.json-view .json-view--null{color:var(--json-null)}.json-view :is(.json-view--copy,.json-view--edit){cursor:pointer;display:none;height:1em;margin-left:4px;width:1em}.json-view .json-view--deleting{background-color:rgba(218,0,0,.067);outline:#da0000 solid 1px;text-decoration-line:line-through}.json-view .json-view--input{background:0 0;border:1px solid;border-radius:4px;font-size:87.5%;line-height:1.25;margin-left:4px;padding:0 4px;width:120px}:is(.json-view:hover,.json-view--pair:hover)>:is(.json-view--copy,.json-view--edit){display:inline-block}.json-view .jv-indent{padding-left:16px}.json-view .jv-chevron{cursor:pointer;display:inline-block;height:1em;opacity:.4;vertical-align:-20%;width:1em}.json-view .jv-button{background:0 0;border:none;cursor:pointer;outline:0}.add-node-menu-list-item .content>header .bp5-tag,.info-tooltip-icon{margin-left:5px}.pin{align-items:center;display:flex;flex-direction:column;position:relative;-webkit-user-select:none;user-select:none;z-index:0}.pin .wire{background:#6b7280;flex-grow:1;height:100%;min-height:10px;width:2px}.pin .pin-inner{border-radius:2px;border-style:solid;border-width:2px;cursor:pointer;flex-shrink:0;font-size:12px;font-weight:500;line-height:1;padding:2px 4px;white-space:nowrap;will-change:border}.pin .pin-inner:not(.dark){background:#fff;border-color:#d1d5db}.pin .pin-inner.dark{background:#262626;border-color:#374151;color:#fafafa}.pin .pin-inner .suffix{color:#595959;margin-left:3px}.pin.input .pin-inner,.pin.output .pin-inner,.pin[data-pin-id=__error] .pin-inner,.pin[data-pin-id=__trigger].input .pin-inner{-webkit-font-smoothing:antialiased}.pin.input .pin-inner:not(.dark){border-color:#83cff6}.pin.input .pin-inner.dark{border-color:#0a649a}.pin.input.closest:not(.selected) .pin-inner,.pin.input:hover:not(.selected) .pin-inner{border-color:#189bdc;border-style:dashed}.pin.input.selected .pin-inner:not(.dark){background:#f9fafb;border-color:#0b7dbe}.pin.input.selected .pin-inner.dark{background:#000;border-color:#83cff6}.pin.output{flex-direction:column-reverse}.pin.output .pin-inner:not(.dark){border-color:#86efac}.pin.output .pin-inner.dark{border-color:#15803d}.pin.output.closest:not(.selected) .pin-inner,.pin.output:hover:not(.selected) .pin-inner{border-color:#22c55e;border-style:dashed}.pin.output.selected .pin-inner:not(.dark){background:#f9fafb;border-color:#16a34a}.pin.output.selected .pin-inner.dark{background:#000;border-color:#86efac}.pin[data-pin-id=__trigger].input .pin-inner:not(.dark){border-color:#d8b4fe}.pin[data-pin-id=__trigger].input .pin-inner.dark{border-color:#7e22ce}.pin[data-pin-id=__trigger].input.closest:not(.selected) .pin-inner,.pin[data-pin-id=__trigger].input:hover:not(.selected) .pin-inner{border-color:#a855f7;border-style:dashed}.pin[data-pin-id=__trigger].input.selected .pin-inner:not(.dark){background:#f9fafb;border-color:#9333ea}.pin[data-pin-id=__trigger].input.selected .pin-inner.dark{background:#000;border-color:#d8b4fe}.pin[data-pin-id=__error] .pin-inner:not(.dark){border-color:#fca5a5}.pin[data-pin-id=__error] .pin-inner.dark{border-color:#b91c1c}.pin[data-pin-id=__error].closest:not(.selected) .pin-inner,.pin[data-pin-id=__error]:hover:not(.selected) .pin-inner{border-color:#ef4444;border-style:dashed}.pin[data-pin-id=__error].selected .pin-inner:not(.dark){background:#f9fafb;border-color:#dc2626}.pin[data-pin-id=__error].selected .pin-inner.dark{background:#000;border-color:#fca5a5}.pin.has-value.output .pin-inner{background:#ffe6de}.pin.const-value.input .pin-inner{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pin.const-value.input .pin-inner:not(.dark){background:#bbf7d0}.pin.const-value.input .pin-inner.dark{background:#166534}.pin.const-value.input .pin-inner .value{font-size:110%}.display-mode .pin-inner{font-size:8px}.quick-add-menu{position:absolute;transform:translateY(-35px)}.side-bar{background:#2f2f2f;box-shadow:inset -2px 4px 4px rgba(0,0,0,.25);display:flex;flex-direction:column;max-height:100vh;-webkit-user-select:none;user-select:none}.sidebar_U0ns,.tableOfContents_FRrT{max-height:calc(100vh - var(--ifm-navbar-height) - 2rem)}.side-bar .heading{background:#232323;color:#b2b2b2;font-size:14px;font-weight:700;margin-bottom:15px;margin-top:10px;padding:8px 15px}.side-bar .items{flex-shrink:0;overflow:auto}.side-bar .menu-item{color:#d9d9d9;cursor:pointer;font-size:12px;padding:8px 15px}.side-bar .menu-item.selected,.side-bar .menu-item:hover{background:hsla(0,0%,100%,.05)}.side-bar .menu-item .type{color:#646464;font-weight:500;margin-right:8px}.base-node-view-wrapper[data-runtime=processing] .ins-view-inner,.node-io-view-inner[data-runtime-queue],.pin-inner[data-runtime-queue]{animation:1.5s infinite d}.base-node-view-wrapper[data-runtime=processing] .ins-view-inner:not(.dark){--event-bg-color:#83cff6;--event-border-color:#189bdc}.base-node-view-wrapper[data-runtime=processing] .ins-view-inner.dark{--event-bg-color:#0a649a;--event-border-color:#189bdc}.base-node-view-wrapper[data-runtime=done] .ins-view-inner,.ins-view:not(.error-caught) .base-node-view-wrapper[data-runtime=error] .ins-view-inner,.node-io-view-inner[data-runtime=active]:not([data-runtime-queue]),.pin.error-pin.connected .pin-inner[data-runtime=active]:not([data-runtime-queue]),.pin:not(.error-pin) .pin-inner[data-runtime=active]:not([data-runtime-queue]){animation:6s e}.base-node-view-wrapper[data-runtime=done] .ins-view-inner:not(.dark),.ins-view.error-caught .base-node-view-wrapper[data-runtime=error] .ins-view-inner:not(.dark),.node-io-view-inner[data-runtime=active]:not([data-runtime-queue]):not(.dark),.pin.error-pin.connected .pin-inner[data-runtime=active]:not([data-runtime-queue]):not(.dark),.pin:not(.error-pin) .pin-inner[data-runtime=active]:not([data-runtime-queue]):not(.dark){--event-bg-color:#86efac;--event-border-color:#22c55e}.base-node-view-wrapper[data-runtime=done] .ins-view-inner.dark,.ins-view.error-caught .base-node-view-wrapper[data-runtime=error] .ins-view-inner.dark,.node-io-view-inner[data-runtime=active]:not([data-runtime-queue]).dark,.pin.error-pin.connected .pin-inner[data-runtime=active]:not([data-runtime-queue]).dark,.pin:not(.error-pin) .pin-inner[data-runtime=active]:not([data-runtime-queue]).dark{--event-bg-color:#15803d;--event-border-color:#22c55e}.ins-view:not(.error-caught) .base-node-view-wrapper[data-runtime=error] .ins-view-inner:not(.dark),.pin.error-pin:not(.connected) .pin-inner[data-runtime=active]:not(.dark){--event-bg-color:#fca5a5;--event-border-color:#ef4444}.ins-view:not(.error-caught) .base-node-view-wrapper[data-runtime=error] .ins-view-inner.dark,.pin.error-pin:not(.connected) .pin-inner[data-runtime=active].dark{--event-bg-color:#b91c1c;--event-border-color:#ef4444}.ins-view.error-caught .base-node-view-wrapper[data-runtime=error] .ins-view-inner,.main-instance-events-indicator[data-runtime=error]{animation:12s blink-error}.main-instance-events-indicator[data-runtime=processing]{animation:1.5s infinite d;background:#88f8ff}.main-instance-events-indicator[data-runtime=processing] .status-text:after{content:"Processing"}.main-instance-events-indicator[data-runtime=error] .status-text:after{content:"Error"}.main-instance-events-indicator[data-runtime=done]{animation:12s blink-done}.main-instance-events-indicator[data-runtime=done] .status-text:after{content:"Completed"}.pin.error-pin:not(.connected) .pin-inner[data-runtime=active]{animation:12s e}.node-io-view-inner[data-runtime-queue]:not(.dark),.pin-inner[data-runtime-queue]:not(.dark){--event-bg-color:#d8b4fe;--event-border-color:#a855f7}.node-io-view-inner[data-runtime-queue].dark,.pin-inner[data-runtime-queue].dark{--event-bg-color:#7e22ce;--event-border-color:#a855f7}@keyframes d{0%,to{background:var(--event-bg-color);border-color:var(--event-border-color);filter:brightness(1);transform:scale(.98)}50%{background:var(--event-bg-color);border-color:var(--event-border-color);filter:brightness(1.1);transform:scale(1.01)}}@keyframes e{3%{background-color:var(--event-bg-color);border-color:var(--event-border-color)}30%{background-color:var(--event-bg-color);border-color:var(--event-border-color);filter:brightness(1.2)}}.add-node-menu-list-item{align-items:center;display:flex;flex-direction:row;padding:5px 10px}.add-node-menu-list-item:not(:last-of-type){border-bottom:1px solid #ddd}.add-node-menu-list-item .content>header{align-items:center;display:flex;flex-direction:row;justify-content:space-between}.add-node-menu-list-item .content>header .id{flex:1;font-size:1.1em;font-weight:600}.add-node-menu-list-item aside{flex:0;margin-left:20px;visibility:hidden}.add-node-menu-list-item.selected:not(:hover){background:#015c8f;color:#fff}.add-node-menu-list-item:hover{background:#0082cd;color:#fff}.add-node-menu-list-item:hover aside{visibility:visible}.add-node-menu-results-summary{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;min-height:var(--heading-height);padding:10px}.add-node-menu{--max-height:65vh;--heading-height:45px;display:flex;width:85vw}.add-node-menu .content-wrapper{display:flex;flex-direction:row;height:var(--max-height)}.add-node-menu .content-wrapper .loader{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.add-node-menu .content-wrapper>aside{border:1px solid #ddd;flex:1;margin-right:10px;width:25%}.add-node-menu .content-wrapper>aside .filter-header{align-items:center;border-bottom:1px solid #ddd;display:flex;flex-direction:row;gap:10px;height:45px;line-height:0;padding:10px}.actions-menu .icon-wrapper,.add-node-menu .content-wrapper>aside .filter-header a{line-height:0}.add-node-menu .content-wrapper>aside .tree-container{max-height:calc(100% - 45px);overflow:auto}.add-node-menu .content-wrapper main{border:1px solid #ddd;flex:3}.add-node-menu .content-wrapper main .results{border-top:1px solid #ddd;max-height:calc(100% - 45px);overflow:auto}.add-node-menu .content-wrapper main .no-results{align-items:center;display:flex;flex-direction:column;gap:20px;height:100%;justify-content:center;padding:10px;text-align:center}.add-node-menu .content-wrapper main .no-results .add-node-menu-results-summary{gap:7px;justify-content:center}.add-node-menu .content-wrapper main .no-results .callout{max-width:300px}.prompt-ai-menu .progress-bar-container{margin:5px 10px}.run-flow-modal .execution-delay-wrapper{margin-top:20px;padding:0 40px}.actions-menu{align-items:center;border:1px solid #a1a1aa;border-radius:5px 0 0 5px;display:flex;flex-direction:column;overflow:clip;position:absolute;right:0;top:50%;transform:translateY(-50%);transition:opacity .05s ease-in-out,transform .05s ease-in-out;z-index:1}.actions-menu:not(:hover){transform-origin:center}.actions-menu .action-button{align-items:center;background:#fff;color:#525252;cursor:pointer;display:flex;height:40px;justify-content:center;width:40px}.actions-menu .action-button:hover{background:#f4f4f5}.actions-menu .action-button:active{transform:scale(.95)}.action-button-tooltip .hotkey,kbd{display:inline-block}kbd{background:#dedede;border-radius:3px;box-shadow:0 1px 1px rgba(0,0,0,.2),0 0 0 1px rgba(0,0,0,.1);color:#333;font-size:.8em;padding:2px 5px}.main-instance-events-indicator{border-radius:15px;bottom:max(10px,5%);color:#333;font-weight:600;left:50%;opacity:.8;position:absolute;transform:translateX(-50%);z-index:1}.main-instance-events-indicator .status-text:after{display:inline-block;font-size:12px;padding:2px 8px}.help-bubble{color:#0b70af;cursor:pointer}.help-bubble:hover{color:#008cdd}.help-bubble svg{height:40px;width:40px}.visual-node-editor{display:flex;z-index:0}.feature-strip,.visual-node-editor:not(.dark){background:#f3f4f6}.visual-node-editor.dark{background:#404040}.visual-node-editor>.side-bar{flex-grow:0;flex-shrink:0;overflow:hidden;position:relative;white-space:nowrap;width:40px;z-index:1}.visual-node-editor>.side-bar.expanded{width:250px}.visual-node-editor>main{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='1' fill=',BCDCF' fill-opacity='.2' fill-rule='evenodd'/%3E%3C/svg%3E");flex:1;overflow:hidden}.visual-node-editor.dark>main{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='1' fill='A0A0A' fill-opacity='.8' fill-rule='evenodd'/%3E%3C/svg%3E")}.visual-node-editor .node-inputs,.visual-node-editor .node-outputs{align-content:space-between;display:flex;justify-content:space-around;left:50%;margin:0 auto;position:absolute;transform:translateX(-50%);width:60%;z-index:1}.visual-node-editor .node-inputs.node-outputs,.visual-node-editor .node-outputs.node-outputs{bottom:0}.visual-node-editor .selection-box{background:rgba(101,200,255,.5);border:1px solid #f7f7f7;opacity:.7;position:absolute;z-index:2}.visual-node-editor .edit-group-modal{background:rgba(39,54,62,.95);border:1px solid #787878;border-radius:5px;bottom:5vh;box-sizing:border-box;display:flex;flex-direction:column;height:90vh;left:10vw;position:fixed;top:5vh;width:80vw;z-index:3}.visual-node-editor .edit-group-modal>header{align-items:center;background:#2f2f2f;border-radius:5px 5px 0 0;color:#fff;display:flex;flex-grow:0;flex-shrink:0;font-size:12px;font-weight:300;padding:8px 20px}.visual-node-editor .edit-group-modal>main{display:flex;flex:1;overflow:auto;position:relative}.visual-node-editor .viewport-controls-and-help{align-items:center;bottom:10px;display:flex;gap:5px;height:30px;position:absolute;right:20px;-webkit-user-select:none;user-select:none;z-index:2}.visual-node-editor .viewport-controls-and-help .bp5-slider{height:16px;width:150px}.visual-node-editor .temp{bottom:20px;position:absolute;right:250px}.visual-node-editor .inline-node-container{border:1px solid gray;display:flex;flex-direction:column;height:80%;left:10%;overflow:hidden;position:absolute;top:10%;width:80%;z-index:2}.visual-node-editor .inline-node-container>header{background:#fff;padding:10px 5px}.visual-node-editor .inline-node-container .visual-node-editor{display:flex;flex:1}.visual-node-editor .debug-info{background:rgba(166,0,0,.5);border-radius:5px;color:#fff;font-family:monospace;font-size:12px;left:20px;padding:10px;position:absolute;top:20px;z-index:1}.react-resizable-handle{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgd2lkdGg9IjYiIGhlaWdodD0iNiI+PHBhdGggZD0iTTYgNkgwVjQuMmg0LjJWMEg2djZaIiBvcGFjaXR5PSIuMzAyIi8+PC9zdmc+");background-origin:content-box;background-position:100% 100%;background-repeat:no-repeat;box-sizing:border-box;height:20px;padding:0 3px 3px 0;position:absolute;width:20px}.react-resizable-handle-sw{bottom:0;cursor:sw-resize;left:0;transform:rotate(90deg)}.react-resizable-handle-se{bottom:0;cursor:se-resize;right:0}.react-resizable-handle-nw{cursor:nw-resize;left:0;top:0;transform:rotate(180deg)}.react-resizable-handle-ne{cursor:ne-resize;right:0;top:0;transform:rotate(270deg)}.react-resizable-handle-e,.react-resizable-handle-w{cursor:ew-resize;margin-top:-10px;top:50%}.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-resizable-handle-n,.react-resizable-handle-s{cursor:ns-resize;left:50%;margin-left:-10px}.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-resizable-handle-s{bottom:0;transform:rotate(45deg)}body{margin:0;padding:0;font-size:16px;line-height:1.5}.bp5-button,.bp5-control,.bp5-input,body{font-family:Inter,sans-serif}.home-page{flex:1;padding:50px;width:100%}.home-page a{display:block;margin:20px auto;text-align:center}.skipToContent_zaHc{background-color:var(--ifm-background-surface-color);color:var(--ifm-color-emphasis-900);left:100%;padding:calc(var(--ifm-global-spacing)/2) var(--ifm-global-spacing);position:fixed;top:1rem;z-index:calc(var(--ifm-z-index-fixed) + 1)}.skipToContent_zaHc:focus{box-shadow:var(--ifm-global-shadow-md);left:1rem}.closeButton_n1uY{line-height:0;padding:0}.content_W3Qu{font-size:85%;padding:5px 0;text-align:center}.content_W3Qu a{color:inherit;text-decoration:underline}.announcementBar_pUh_{align-items:center;background-color:var(--ifm-color-white);border-bottom:1px solid var(--ifm-color-emphasis-100);color:var(--ifm-color-black);display:flex;height:var(--docusaurus-announcement-bar-height)}.announcementBarPlaceholder_Pb6Q{flex:0 0 10px}.announcementBarClose_MFWf{align-self:stretch;flex:0 0 30px}.toggle_BTcr{height:2rem;width:2rem}.toggleButton__N08{align-items:center;border-radius:50%;display:flex;height:100%;justify-content:center;transition:background var(--ifm-transition-fast);width:100%}.toggleButton__N08:hover{background:var(--ifm-color-emphasis-200)}.darkNavbarColorModeToggle_jWiB:hover{background:var(--ifm-color-gray-800)}[data-theme=dark] .themedImage--dark_Qruz,[data-theme=light] .themedImage--light_wmDU{display:initial}.iconExternalLink_BV0h{margin-left:.3rem}.iconLanguage_nRYT{margin-right:5px}.navbarHideable_nVcN{transition:transform var(--ifm-transition-fast) ease}.navbarHidden_moai{transform:translate3d(0,calc(-100% - 2px),0)}.errorBoundaryError_Jdse{color:red;white-space:pre-wrap}.footerLogoLink_lMws{opacity:.5;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.mainWrapper_aymX{display:flex;flex:1 0 auto;flex-direction:column}.docusaurus-mt-lg{margin-top:3rem}#__docusaurus{display:flex;flex-direction:column;min-height:100%}.sidebar_U0ns{overflow-y:auto;position:sticky;top:calc(var(--ifm-navbar-height) + 2rem)}.sidebarItemTitle_iAor{font-size:var(--ifm-h3-font-size);font-weight:var(--ifm-font-weight-bold)}.container_TLel,.sidebarItemList_ghTL{font-size:.9rem}.sidebarItem_e8Uj{margin-top:.7rem}.sidebarItemLink_ei87{color:var(--ifm-font-color-base);display:block}.sidebarItemLinkActive_CRO7{color:var(--ifm-color-primary)!important}.backToTopButton_pSAI{background-color:var(--ifm-color-emphasis-200);border-radius:50%;bottom:1.3rem;box-shadow:var(--ifm-global-shadow-lw);height:3rem;opacity:0;position:fixed;right:1.3rem;transform:scale(0);transition:all var(--ifm-transition-fast) var(--ifm-transition-timing-default);visibility:hidden;width:3rem;z-index:calc(var(--ifm-z-index-fixed) - 1)}.backToTopButton_pSAI:after{background-color:var(--ifm-color-emphasis-1000);content:" ";display:inline-block;height:100%;-webkit-mask:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem no-repeat;mask:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem no-repeat;width:100%}.backToTopButtonShow_MEEL{opacity:1;transform:scale(1);visibility:visible}[data-theme=dark]:root{--docusaurus-collapse-button-bg:hsla(0,0%,100%,.05);--docusaurus-collapse-button-bg-hover:hsla(0,0%,100%,.1)}.collapseSidebarButton_Dma2{display:none;margin:0}.docPage_ShNT{flex:1 0}.docsWrapper_B99u{display:flex;flex:1 0 auto}.authorCol_PGqe{flex-grow:1!important;max-width:inherit!important}.imageOnlyAuthorRow_CcAN{display:flex;flex-flow:row wrap}.imageOnlyAuthorCol_7a2K{margin-left:.3rem;margin-right:.3rem}.flyde-flow-editor_AAD4{color:#000;position:absolute}._hj_feedback_container_Af03{--hjFeedbackAccentColor:var(--ifm-color-primary)}.hero{--ifm-hero-text-color:#f8f8f8;overflow:hidden;padding:0;position:relative}.hero .container{display:flex;flex-direction:row;gap:0;padding:2rem}.feature-strip .feature-strip-inner,.features-strip{margin:0 auto;max-width:var(--ifm-container-width-xl);padding:2rem 3rem}.hero .container .content-wrapper{flex:4;padding-right:2rem;padding-top:2rem;text-align:left}.hero .container .content-wrapper .hero__title{font-size:3.5rem;font-weight:600;margin:0}.hero .container .content-wrapper .hero__subtitle{font-size:1.2rem;margin:10px 0}.hero .container .content-wrapper .buttons-container{display:flex;flex-direction:row;gap:.5rem;margin:10px auto}.hero .container .example-container{display:flex;flex:5;flex-direction:column;height:30rem;max-width:800px;min-height:25rem}.hero .container .example-container .example-tip{color:#efefef;display:inline-flex;flex-wrap:wrap;font-size:.8rem;margin:10px 0;text-align:right}.hero .container .example-container .example-actions{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;gap:6px;justify-content:center;margin-top:10px}.hero .container .example-container .example-actions button{font-size:12px;padding:3px 6px}.hero .container .github-star{align-items:center;border:1px solid #efefef;border-radius:50px;color:#efefef;cursor:pointer;display:inline-flex;font-size:.8rem;gap:5px;justify-self:flex-start;margin-bottom:5px;padding:4px 12px}.hero .container .github-star svg{transform:rotate(0);transform-origin:center center;transition:transform .2s ease-in-out;height:18px;width:18px}.hero .container .github-star:hover{background:#efefef;color:#0b2d46}.hero .container .github-star:hover svg{transform:rotate(72deg)}.hero .container .github-star>span{line-height:1}.hero .gradient{-webkit-text-fill-color:transparent;background:linear-gradient(90deg,#ffebe6,#a4deff);-webkit-background-clip:text;font-weight:800}.hero--primary{--ifm-hero-background-color:#182732}.hero-example .actions-menu,.mobile-warning{display:none}.features-strip{align-items:center;display:flex;flex-direction:row;font-size:1.5rem;font-weight:500;gap:4rem;justify-content:center}.features-strip .feature-highlight{align-items:center;display:inline-flex;flex-direction:row}.features-strip .feature-highlight:not(:last-child):after{background:#0d557f;border-radius:50%;content:"";display:inline-block;height:5px;margin-left:4rem;width:5px}.features-strip .feature-highlight a{color:#101010;text-decoration:none}.feature-strip .feature-strip-inner{display:flex;flex-direction:row;gap:3rem}.feature-strip .feature-strip-inner .content-container h3{font-size:2rem;font-weight:600;margin-bottom:20px}.feature-strip .feature-strip-inner .image-caption{color:#1f2937;flex-wrap:wrap;font-size:.8rem;font-style:italic}.font-thin{font-weight:300}.hero-example{border:1px solid #5e5e5e;box-shadow:0 0 0 2px rgba(0,0,0,.1),0 3px 8px rgba(0,0,0,.8);display:flex;flex-direction:column;height:28rem;position:relative;z-index:1}.hero-example>main{flex:1}.hero-example .flow-wrapper{display:flex;flex:1}.hero-example .buttons-container{align-items:center;display:flex;gap:8px;justify-content:center;margin:20px 0;z-index:1}.hero-example .buttons-container .gh-stars-wrapper{display:flex}.hero-example .terminal-emulator{background:#161616;color:#fff;flex:1;font-size:.8rem;padding:3px 8px}.hero-example .flyde-hero-example-wrapper{border:1px solid #d9d9d9;border-radius:5px;box-shadow:-1px 1px 12px 3px hsla(0,0%,49%,.17);display:flex;flex-direction:row;max-width:100%;overflow:hidden}.hero-example .nudge{animation:4s -2s infinite f;transform-origin:center center}@keyframes f{0%,46%,to{background-color:var(--ifm-color-success);transform:translateY(0)}48%{background:var(--ifm-color-success-light);transform:translateY(0) rotate(3deg)}50%{background:var(--ifm-color-success-light);transform:translateY(0) rotate(0)}52%{background:var(--ifm-color-success-light);transform:translateY(0) rotate(-3deg)}54%{background-color:var(--ifm-color-success);transform:translateY(0) rotate(0)}}.hero-example .code-terminal-wrapper{display:flex;flex:0;flex-direction:column;min-width:340px}.hero-example .code-wrapper{display:flex;flex:1;flex-direction:column;text-align:left}.hero-example .code-wrapper>span{border-radius:0!important;flex:1}.hero-example .code-wrapper>span code{background-color:inherit;border:0;border-radius:0;font-family:inherit;font-size:inherit;padding:inherit}.hero-example .terminal-wrapper{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;height:100px;overflow:auto}.hero-example .flyde-flow-editor{flex:1;flex-shrink:0}.hero-example .code-example{flex:1;font-size:14px}.hero-example .viewport-controls-and-help{display:none!important}.hero-example .hero-example__tabs{display:flex;flex-direction:row;flex-grow:0;flex-shrink:0;width:100%}.hero-example .hero-example__tabs .file-tag{flex:1}.hero-example .file-tag{background-color:#383838;border-right:1px solid #4f4f4f;color:#ccc;cursor:pointer;display:block;flex:0;font-size:12px;padding:0 5px;text-align:center;width:100%}.hero-example .file-tag:hover{background-color:#4f4f4f}.hero-example .file-tag.selected{background-color:#4f4f4f;color:#fff}.flyde-flow-editor{color:#000!important;overflow:hidden}.flyde-flow-editor a,.flyde-flow-editor b,.flyde-flow-editor blockquote,.flyde-flow-editor body,.flyde-flow-editor canvas,.flyde-flow-editor caption,.flyde-flow-editor code,.flyde-flow-editor div,.flyde-flow-editor em,.flyde-flow-editor embed,.flyde-flow-editor fieldset,.flyde-flow-editor figure,.flyde-flow-editor footer,.flyde-flow-editor form,.flyde-flow-editor h1,.flyde-flow-editor h2,.flyde-flow-editor h3,.flyde-flow-editor h4,.flyde-flow-editor h5,.flyde-flow-editor h6,.flyde-flow-editor header,.flyde-flow-editor html,.flyde-flow-editor i,.flyde-flow-editor iframe,.flyde-flow-editor img,.flyde-flow-editor label,.flyde-flow-editor li,.flyde-flow-editor main,.flyde-flow-editor nav,.flyde-flow-editor object,.flyde-flow-editor ol,.flyde-flow-editor p,.flyde-flow-editor pre,.flyde-flow-editor section,.flyde-flow-editor small,.flyde-flow-editor span,.flyde-flow-editor strike,.flyde-flow-editor strong,.flyde-flow-editor sub,.flyde-flow-editor sup,.flyde-flow-editor table,.flyde-flow-editor tbody,.flyde-flow-editor td,.flyde-flow-editor tfoot,.flyde-flow-editor th,.flyde-flow-editor thead,.flyde-flow-editor tr,.flyde-flow-editor tt,.flyde-flow-editor u,.flyde-flow-editor ul,.flyde-flow-editor video{-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:none;text-size-adjust:none;border:0;font-size:100%;font:inherit;margin:0;padding:0;text-rendering:optimizeLegibility;vertical-align:baseline}.containsTaskList_WAbI,.flyde-flow-editor ol,.flyde-flow-editor ul{list-style:none}.flyde-flow-editor blockquote,.flyde-flow-editor q{quotes:none}.flyde-flow-editor blockquote:after,.flyde-flow-editor blockquote:before,.flyde-flow-editor q:after,.flyde-flow-editor q:before{content:"";content:none}.flyde-flow-editor table{border-collapse:collapse;border-spacing:0}.flyde-flow-editor input{-webkit-appearance:none;border-radius:0}input.input{background-color:var(--ifm-button-background-color);border:1px solid var(--ifm-color-primary);border-radius:var(--ifm-button-border-radius);color:var(--ifm-color-primary);cursor:pointer;display:inline-block;font-size:calc(.875rem*var(--ifm-button-size-multiplier));font-weight:var(--ifm-button-font-weight);line-height:1.5;padding:calc(var(--ifm-button-padding-vertical)*var(--ifm-button-size-multiplier)) calc(var(--ifm-button-padding-horizontal)*var(--ifm-button-size-multiplier));text-align:center;-webkit-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.react-counter span{font-size:50px;font-weight:600}.integration-points{display:inline-block;text-align:left;width:300px}.hero__subtitle{font-size:1.2rem;margin:0 auto 20px;max-width:80%}.hero__subtitle a{color:#fff;font-weight:700}.bp3-overlay{z-index:201}.examples__menu{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;list-style:none;margin-top:20px}.examples__menu>li{font-size:18px;font-weight:700}.examples__menu>li a{color:#fff}.playground-container{margin:0 auto;max-width:1200px;padding:2rem 0;position:relative}.playground-container .playground-description,.playground-container .playground-extra{font-size:1.25rem;margin-bottom:10px;padding:1rem}.playground-container h2,.playground-hero h1{font-size:2rem}.playground-container .emit-btn{margin:10px 5px}.playground-container>header{margin:0 auto;max-width:var(--ifm-container-width);text-align:center}.playground-container .playground{border:1px solid #ccc;display:flex;flex-direction:row;margin:10px 0;max-height:500px}.playground-container .playground .flow-container{border-right:1px solid #ccc;flex:1;position:relative}.playground-container .playground .flow-container .delay-container{align-content:space-between;align-items:center;background:#fff;border:1px solid #dedede;display:flex;font-size:14px;gap:20px;padding:5px 10px;position:absolute;right:20px;top:0;z-index:1}.playground-container .output-container{display:flex;flex:0 0;position:relative;-webkit-user-select:none;user-select:none}.playground-hero{padding:.5rem 0}.playground-hero .hero__subtitle{font-size:1.25rem;margin-bottom:5px}.mobile-warning{background:#fff3cd;padding:15px 10px;text-align:center}.star-hint{align-items:center;flex-wrap:wrap;font-style:italic;gap:.1rem .5rem}.output-jsx,.output-log{background:#fafafa;display:flex;flex:1;flex-direction:column}.output-jsx header,.output-log header{border-bottom:1px solid #dfdfdf;color:#202020;display:flex;font-size:18px;font-weight:600;margin-bottom:2px;padding:5px 20px}.buttonGroup_bqVd button,.codeBlockContainer_Qk81{background:var(--prism-background-color);color:var(--prism-color)}.output-jsx header .clear-btn,.output-log header .clear-btn{margin-left:auto}.output-jsx>main,.output-log>main{overflow:auto}.output-jsx .empty-state,.output-log .empty-state{color:#9e9e9e;font-size:16px;font-weight:300;padding:10px 20px}.output-jsx .log-item,.output-log .log-item{align-items:center;display:flex;padding:3px 20px}.output-jsx .log-item:hover,.output-log .log-item:hover{background-color:#efefef}.output-jsx .log-item>main,.output-log .log-item>main{-webkit-box-orient:vertical;-webkit-line-clamp:3;display:-webkit-box;flex:1;margin-right:5px;overflow:hidden}.output-jsx .log-item>aside,.output-log .log-item>aside{color:#9e9e9e;font-size:12px;font-weight:600}.output-jsx>main{align-items:center;display:flex;flex-direction:row;justify-content:center;padding:20px}.output-jsx>main span{display:inline-block;font-size:40px;margin:0 20px;min-width:50px;text-align:center}.codeBlockContainer_Qk81{border-radius:var(--ifm-code-border-radius);box-shadow:var(--ifm-global-shadow-lw);margin-bottom:var(--ifm-leading)}.codeBlockContent_vYKs{border-radius:inherit;direction:ltr;position:relative}.codeBlockTitle_mI_w{border-bottom:1px solid var(--ifm-color-emphasis-300);border-top-left-radius:inherit;border-top-right-radius:inherit;font-size:var(--ifm-code-font-size);font-weight:500;padding:.75rem var(--ifm-pre-padding)}.codeBlock_jioO{--ifm-pre-background:var(--prism-background-color);margin:0;padding:0}.codeBlockTitle_mI_w+.codeBlockContent_vYKs .codeBlock_jioO{border-top-left-radius:0;border-top-right-radius:0}.codeBlockLines_UkX9{float:left;font:inherit;min-width:100%;padding:var(--ifm-pre-padding)}.codeBlockLinesWithNumbering_IjB6{display:table;padding:var(--ifm-pre-padding) 0}.buttonGroup_bqVd{column-gap:.2rem;display:flex;position:absolute;right:calc(var(--ifm-pre-padding)/2);top:calc(var(--ifm-pre-padding)/2)}.buttonGroup_bqVd button{align-items:center;border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-global-radius);display:flex;line-height:0;opacity:0;padding:.4rem;transition:opacity var(--ifm-transition-fast) ease-in-out}.buttonGroup_bqVd button:focus-visible,.buttonGroup_bqVd button:hover{opacity:1!important}.theme-code-block:hover .buttonGroup_bqVd button{opacity:.4}.iconEdit__QoF{margin-right:.3em;vertical-align:sub}:where(:root){--docusaurus-highlighted-code-line-bg:#484d5b}:where([data-theme=dark]){--docusaurus-highlighted-code-line-bg:#646464}.theme-code-block-highlighted-line{background-color:var(--docusaurus-highlighted-code-line-bg);display:block;margin:0 calc(var(--ifm-pre-padding)*-1);padding:0 var(--ifm-pre-padding)}.codeLine_VTf7{counter-increment:a;display:table-row}.codeLineNumber_VYTV{background:var(--ifm-pre-background);display:table-cell;left:0;overflow-wrap:normal;padding:0 var(--ifm-pre-padding);position:sticky;text-align:right;width:1%}.codeLineNumber_VYTV:before{content:counter(a);opacity:.4}.codeLineContent_B5jd{padding-right:var(--ifm-pre-padding)}.tag_tu_C{border:1px solid var(--docusaurus-tag-list-border);transition:border var(--ifm-transition-fast)}.tag_tu_C:hover{--docusaurus-tag-list-border:var(--ifm-link-color);text-decoration:none}.tagRegular_GinR{border-radius:var(--ifm-global-radius);font-size:90%;padding:.2rem .5rem .3rem}.tagWithCount_HiRh{align-items:center;border-left:0;display:flex;padding:0 .5rem 0 1rem;position:relative}.tag_Jiem,.tag_uUOe{display:inline-block}.tagWithCount_HiRh:after,.tagWithCount_HiRh:before{border:1px solid var(--docusaurus-tag-list-border);content:"";position:absolute;top:50%;transition:inherit}.tagWithCount_HiRh:before{border-bottom:0;border-right:0;height:1.18rem;right:100%;transform:translate(50%,-50%) rotate(-45deg);width:1.18rem}.tagWithCount_HiRh:after{border-radius:50%;height:.5rem;left:0;transform:translateY(-50%);width:.5rem}.tagWithCount_HiRh span{background:var(--ifm-color-secondary);border-radius:var(--ifm-global-radius);color:var(--ifm-color-black);font-size:.7rem;line-height:1.2;margin-left:.3rem;padding:.1rem .4rem}.tag_Jiem{margin:.5rem .5rem 0 1rem}.theme-code-block:hover .copyButtonCopied_fVO4{opacity:1!important}.copyButtonIcons_yZMg{height:1.125rem;position:relative;width:1.125rem}.copyButtonIcon_demY,.copyButtonSuccessIcon_h29Q{fill:currentColor;height:inherit;left:0;opacity:inherit;position:absolute;top:0;transition:all var(--ifm-transition-fast) ease;width:inherit}.copyButtonSuccessIcon_h29Q{color:#00d600;left:50%;opacity:0;top:50%;transform:translate(-50%,-50%) scale(.33)}.copyButtonCopied_fVO4 .copyButtonIcon_demY{opacity:0;transform:scale(.33)}.copyButtonCopied_fVO4 .copyButtonSuccessIcon_h29Q{opacity:1;transform:translate(-50%,-50%) scale(1);transition-delay:75ms}.tag_uUOe{margin:0 .4rem .5rem 0}.lastUpdated_Bn0j{font-size:smaller;font-style:italic;margin-top:.2rem}.tocCollapsibleButton_okIV{align-items:center;display:flex;font-size:inherit;justify-content:space-between;padding:.4rem .8rem;width:100%}.tocCollapsibleButton_okIV:after{background:var(--ifm-menu-link-sublist-icon) 50% 50%/2rem 2rem no-repeat;content:"";filter:var(--ifm-menu-link-sublist-icon-filter);height:1.25rem;transform:rotate(180deg);transition:transform var(--ifm-transition-fast);width:1.25rem}.tocCollapsibleButtonExpanded_SUqg:after,.tocCollapsibleExpanded_gaPT{transform:none}.tocCollapsible_W5RM{background-color:var(--ifm-menu-color-background-active);border-radius:var(--ifm-global-radius);margin:1rem 0}.tocCollapsibleContent_KxYB>ul{border-left:none;border-top:1px solid var(--ifm-color-emphasis-300);font-size:15px;padding:.2rem 0}.tocCollapsibleContent_KxYB ul li{margin:.4rem .8rem}.wordWrapButtonIcon_Xcrc{height:1.2rem;width:1.2rem}.details_jMJo{--docusaurus-details-summary-arrow-size:0.38rem;--docusaurus-details-transition:transform 200ms ease;--docusaurus-details-decoration-color:grey}.details_jMJo>summary{cursor:pointer;list-style:none;padding-left:1rem;position:relative}.details_jMJo>summary::-webkit-details-marker{display:none}.details_jMJo>summary:before{border-color:transparent transparent transparent var(--docusaurus-details-decoration-color);border-style:solid;border-width:var(--docusaurus-details-summary-arrow-size);content:"";left:0;position:absolute;top:.45rem;transform:rotate(0);transform-origin:calc(var(--docusaurus-details-summary-arrow-size)/2) 50%;transition:var(--docusaurus-details-transition)}.collapsibleContent_yVEW{border-top:1px solid var(--docusaurus-details-decoration-color);margin-top:1rem;padding-top:1rem}.details_qBk2{--docusaurus-details-decoration-color:var(--ifm-alert-border-color);--docusaurus-details-transition:transform var(--ifm-transition-fast) ease;border:1px solid var(--ifm-alert-border-color);margin:0 0 var(--ifm-spacing-vertical)}.anchorWithStickyNavbar_BHx1{scroll-margin-top:calc(var(--ifm-navbar-height) + .5rem)}.anchorWithHideOnScrollNavbar_drPl{scroll-margin-top:.5rem}.hash-link{opacity:0;padding-left:.5rem;transition:opacity var(--ifm-transition-fast);-webkit-user-select:none;user-select:none}.hash-link:before{content:"#"}.img_HiZU{height:auto}.admonition_FWSL{margin-bottom:1em}.admonitionHeading_xHAi{font:var(--ifm-heading-font-weight) var(--ifm-h5-font-size)/var(--ifm-heading-line-height) var(--ifm-heading-font-family);margin-bottom:.3rem;text-transform:uppercase}.admonitionIcon_Pe6H{display:inline-block;margin-right:.4em;vertical-align:middle}.admonitionIcon_Pe6H svg{fill:var(--ifm-alert-foreground-color);display:inline-block;height:1.6em;width:1.6em}.tableOfContents_FRrT{overflow-y:auto;position:sticky;top:calc(var(--ifm-navbar-height) + 1rem)}.breadcrumbHomeIcon_CVBs{height:1.1rem;position:relative;top:1px;vertical-align:top;width:1.1rem}.breadcrumbsContainer_SHjg{--ifm-breadcrumb-size-multiplier:0.8;margin-bottom:.8rem}.mdxPageWrapper_lX39{justify-content:center}@media (min-width:997px){.collapseSidebarButton_Dma2,.expandButton_nIzW{background-color:var(--docusaurus-collapse-button-bg)}:root{--docusaurus-announcement-bar-height:30px}.announcementBarClose_MFWf,.announcementBarPlaceholder_Pb6Q{flex-basis:50px}.searchBox_qRf7{padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.collapseSidebarButton_Dma2{border:1px solid var(--ifm-toc-border-color);border-radius:0;bottom:0;display:block!important;height:40px;position:sticky}.collapseSidebarButtonIcon_JH0A{margin-top:4px;transform:rotate(180deg)}.expandButtonIcon_jX6N,[dir=rtl] .collapseSidebarButtonIcon_JH0A{transform:rotate(0)}.collapseSidebarButton_Dma2:focus,.collapseSidebarButton_Dma2:hover,.expandButton_nIzW:focus,.expandButton_nIzW:hover{background-color:var(--docusaurus-collapse-button-bg-hover)}.menuHtmlItem_IXyI{padding:var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal)}.menu_HbpM{flex-grow:1;padding:.5rem}@supports (scrollbar-gutter:stable){.menu_HbpM{padding:.5rem 0 .5rem .5rem;scrollbar-gutter:stable}}.menuWithAnnouncementBar_Xvae{margin-bottom:var(--docusaurus-announcement-bar-height)}.sidebar_x9W1{display:flex;flex-direction:column;height:100%;padding-top:var(--ifm-navbar-height);width:var(--doc-sidebar-width)}.sidebarWithHideableNavbar_Ltvs{padding-top:0}.sidebarHidden_vtNZ{opacity:0;visibility:hidden}.sidebarLogo_qeYn{align-items:center;color:inherit!important;display:flex!important;margin:0 var(--ifm-navbar-padding-horizontal);max-height:var(--ifm-navbar-height);min-height:var(--ifm-navbar-height);text-decoration:none!important}.sidebarLogo_qeYn img{height:2rem;margin-right:.5rem}.expandButton_nIzW{align-items:center;display:flex;height:100%;justify-content:center;position:absolute;right:0;top:0;transition:background-color var(--ifm-transition-fast) ease;width:100%}[dir=rtl] .expandButtonIcon_jX6N{transform:rotate(180deg)}.docSidebarContainer_ac1n{border-right:1px solid var(--ifm-toc-border-color);-webkit-clip-path:inset(0);clip-path:inset(0);display:block;margin-top:calc(var(--ifm-navbar-height)*-1);transition:width var(--ifm-transition-fast) ease;width:var(--doc-sidebar-width);will-change:width}.docSidebarContainerHidden_p2RU{cursor:pointer;width:var(--doc-sidebar-hidden-width)}.sidebarViewport_E9NN{height:100%;max-height:100vh;position:sticky;top:0}.docMainContainer_L3kR{flex-grow:1;max-width:calc(100% - var(--doc-sidebar-width))}.docMainContainerEnhanced_UwZt{max-width:calc(100% - var(--doc-sidebar-hidden-width))}.docItemWrapperEnhanced_CFce{max-width:calc(var(--ifm-container-width) + var(--doc-sidebar-width))!important}.lastUpdated_Bn0j{text-align:right}.tocMobile_pObj{display:none}.docItemCol_geY3{max-width:75%!important}}@media (min-width:1440px){.container{max-width:var(--ifm-container-width-xl)}}@media only screen and (max-width:1440px){.hero .container{padding:2rem 1rem}.features-strip{gap:2rem}.features-strip .feature-highlight:after{margin-left:2rem!important}}@media only screen and (max-width:1140px){.hero .container{flex-direction:column;gap:20px;max-width:800px}.hero .container .example-container{min-height:45rem}.features-strip{font-size:1.2rem}.feature-strip .feature-strip-inner{flex-direction:column-reverse!important}}@media (max-width:996px){.col{--ifm-col-width:100%;flex-basis:var(--ifm-col-width);margin-left:0}.footer{--ifm-footer-padding-horizontal:0}.colorModeToggle_BLUn,.footer__link-separator,.navbar__item,.sidebar_U0ns,.tableOfContents_FRrT{display:none}.footer__col{margin-bottom:calc(var(--ifm-spacing-vertical)*3)}.footer__link-item{display:block}.hero{padding-left:0;padding-right:0}.navbar>.container,.navbar>.container-fluid{padding:0}.navbar__toggle{display:inherit}.navbar__search-input{width:9rem}.pills--block,.tabs--block{flex-direction:column}.searchBox_qRf7{position:absolute;right:var(--ifm-navbar-padding-horizontal)}.docItemContainer_xriO{padding:0 .3rem}}@media only screen and (max-width:600px){.features-strip{flex-direction:column;font-size:1.2rem;gap:.8rem;padding:1rem .25rem}.features-strip .feature-highlight{flex-direction:column!important;justify-content:center}.features-strip .feature-highlight:after{height:3px!important;margin-left:0!important;margin-top:.8rem!important;width:3px!important}.hero .container{padding-left:1.5rem;padding-top:1rem}.hero .container .content-wrapper{padding-right:0}.hero .container .content-wrapper .hero__title{font-size:2.75rem}.hero .container .example-container{min-height:35rem}.home-page-main-content{padding-top:120px}.hero__title{font-size:2rem}.hero__subtitle{font-size:1.2rem}.mobile-warning{display:block}}@media (max-width:576px){.markdown h1:first-child{--ifm-h1-font-size:2rem}.markdown>h2{--ifm-h2-font-size:1.5rem}.markdown>h3{--ifm-h3-font-size:1.25rem}.title_PlBF{font-size:2rem}}@media (forced-colors:active) and (prefers-color-scheme:dark){.bp5-button.bp5-intent-danger,.bp5-button.bp5-intent-primary,.bp5-button.bp5-intent-success,.bp5-button.bp5-intent-warning,.bp5-code-block,.bp5-dark .bp5-tooltip .bp5-code-block,.bp5-dark .bp5-tooltip .bp5-running-text pre,.bp5-running-text pre,.bp5-tooltip.bp5-dark .bp5-code-block,.bp5-tooltip.bp5-dark .bp5-running-text pre{border:1px solid buttonborder;box-shadow:none}.bp5-button.bp5-intent-warning:not(.bp5-disabled):not(.bp5-minimal):not(.bp5-outlined).bp5-active,.bp5-button.bp5-intent-warning:not(.bp5-disabled):not(.bp5-minimal):not(.bp5-outlined):active,.bp5-button:not([class*=bp5-intent-]).bp5-active,.bp5-button:not([class*=bp5-intent-]):active,.bp5-control.bp5-switch:hover input:checked~.bp5-control-indicator,.bp5-dark .bp5-control.bp5-switch:hover input:checked~.bp5-control-indicator,.bp5-file-upload-input:active:after,.bp5-html-select select.bp5-active,.bp5-html-select select:active,.bp5-select select.bp5-active,.bp5-select select:active,.bp5-slider-handle.bp5-active,.bp5-slider-handle:active{background:highlight}.bp5-button:not([class*=bp5-intent-]),.bp5-callout,.bp5-callout.bp5-intent-danger,.bp5-callout.bp5-intent-primary,.bp5-callout.bp5-intent-success,.bp5-callout.bp5-intent-warning,.bp5-card,.bp5-control .bp5-control-indicator,.bp5-dark .bp5-control input:checked~.bp5-control-indicator,.bp5-dialog,.bp5-editable-text:not(.bp5-disabled):before,.bp5-elevation-0,.bp5-elevation-1,.bp5-elevation-2,.bp5-elevation-3,.bp5-elevation-4{border:1px solid buttonborder}.bp5-button.bp5-intent-danger.bp5-disabled,.bp5-button.bp5-intent-danger:disabled,.bp5-button.bp5-intent-primary.bp5-disabled,.bp5-button.bp5-intent-primary:disabled,.bp5-button.bp5-intent-success.bp5-disabled,.bp5-button.bp5-intent-success:disabled,.bp5-button.bp5-intent-warning.bp5-disabled,.bp5-button.bp5-intent-warning:disabled{border-color:graytext;color:graytext}.bp5-button-group.bp5-minimal:not(:first-child){border-bottom-left-radius:0;border-left:none;border-top-left-radius:0}.bp5-button-group.bp5-minimal:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0;margin-right:-1px}.bp5-card,.bp5-popover{box-shadow:none}.bp5-dialog-header,.bp5-drawer-header,.bp5-drawer.bp5-position-top{border-bottom:1px solid buttonborder}.bp5-drawer.bp5-position-bottom,table.bp5-html-table.bp5-html-table-bordered tbody tr td,table.bp5-html-table.bp5-html-table-bordered tfoot tr td{border-top:1px solid buttonborder}.bp5-drawer.bp5-position-left{border-right:1px solid buttonborder}.bp5-drawer.bp5-position-right,table.bp5-html-table.bp5-html-table-bordered th:not(:first-child){border-left:1px solid buttonborder}.bp5-control input:checked~.bp5-control-indicator{background-color:highlight;border:1px solid highlight}.bp5-control:hover input:checked~.bp5-control-indicator{background-color:highlight}.bp5-control input:disabled:checked~.bp5-control-indicator{background-color:graytext;border-color:graytext}.bp5-control .bp5-control-indicator:before{margin-left:-1px;margin-top:-1px}.bp5-control.bp5-checkbox input:indeterminate~.bp5-control-indicator{background-color:highlight;border:1px solid highlight}.bp5-control.bp5-checkbox:hover input:indeterminate~.bp5-control-indicator{background-color:highlight}.bp5-control.bp5-checkbox input:disabled:indeterminate~.bp5-control-indicator{background-color:graytext;border-color:graytext}.bp5-dark .bp5-control.bp5-checkbox input:indeterminate~.bp5-control-indicator{border:1px solid buttonborder}.bp5-control.bp5-checkbox input:checked:not(:disabled)~.bp5-control-indicator:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 5c-.28 0-.53.11-.71.29L7 9.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42l3 3c.18.18.43.29.71.29s.53-.11.71-.29l5-5A1.003 1.003 0 0 0 12 5z' fill='%23111418'/%3E%3C/svg%3E")}.bp5-control.bp5-checkbox input:indeterminate:not(:disabled)~.bp5-control-indicator:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11 7H5c-.55 0-1 .45-1 1s.45 1 1 1h6c.55 0 1-.45 1-1s-.45-1-1-1z' fill='%23111418'/%3E%3C/svg%3E")}.bp5-control.bp5-checkbox input:disabled~.bp5-control-indicator,.bp5-control.bp5-radio input:disabled~.bp5-control-indicator,.bp5-control.bp5-switch input:not(:checked):disabled~.bp5-control-indicator,.bp5-control.bp5-switch input:not(:checked):disabled~.bp5-control-indicator:before,.bp5-dark .bp5-control.bp5-switch input:not(:checked):disabled~.bp5-control-indicator,.bp5-dark .bp5-control.bp5-switch input:not(:checked):disabled~.bp5-control-indicator:before{border-color:graytext}.bp5-control.bp5-radio input:checked~.bp5-control-indicator:before{background:highlight;height:12px;margin-left:1px;margin-top:1px;width:12px}.bp5-control.bp5-radio input:checked:disabled~.bp5-control-indicator:before{background:graytext}.bp5-control.bp5-switch input:checked~.bp5-control-indicator,.bp5-dark .bp5-control.bp5-switch input:checked~.bp5-control-indicator{background:highlight;border:1px solid buttonborder}.bp5-control.bp5-switch input:checked:disabled~.bp5-control-indicator,.bp5-dark .bp5-control.bp5-switch input:checked:disabled~.bp5-control-indicator{background-color:graytext}.bp5-control.bp5-switch .bp5-control-indicator:before{border:1px solid buttonborder;margin-top:1px}.bp5-control.bp5-switch .bp5-control-indicator,.bp5-dark .bp5-popover,.bp5-dark .bp5-tooltip,.bp5-file-upload-input,.bp5-html-select select,.bp5-input,.bp5-navbar,.bp5-popover,.bp5-popover.bp5-dark,.bp5-select select,.bp5-slider-handle,.bp5-tag,.bp5-tooltip,.bp5-tooltip.bp5-dark{border:1px solid buttonborder}table.bp5-html-table.bp5-html-table-bordered tbody tr td:not(:first-child),table.bp5-html-table.bp5-html-table-bordered tfoot tr td:not(:first-child){border-left:1px solid buttonborder;border-top:1px solid buttonborder}.bp5-dark .bp5-menu-item.bp5-selected,.bp5-dark .bp5-menu-item.bp5-selected:active,.bp5-dark .bp5-menu-item.bp5-selected:hover,.bp5-dark .bp5-menu-item:hover.ns-selected,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-],.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover,.bp5-menu-item.bp5-selected,.bp5-menu-item.bp5-selected:active,.bp5-menu-item.bp5-selected:hover,.bp5-menu-item:hover.ns-selected,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-],.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover,table.bp5-html-table.bp5-interactive tbody tr:active td,table.bp5-html-table.bp5-interactive tbody tr:hover td{background-color:highlight}.bp5-dark .bp5-popover .bp5-popover-arrow-fill,.bp5-dark .bp5-tooltip .bp5-popover-arrow-fill,.bp5-popover .bp5-popover-arrow-fill,.bp5-popover.bp5-dark .bp5-popover-arrow-fill,.bp5-tooltip .bp5-popover-arrow-fill,.bp5-tooltip.bp5-dark .bp5-popover-arrow-fill,.bp5-tooltip.bp5-intent-danger .bp5-popover-arrow-fill,.bp5-tooltip.bp5-intent-primary .bp5-popover-arrow-fill,.bp5-tooltip.bp5-intent-success .bp5-popover-arrow-fill,.bp5-tooltip.bp5-intent-warning .bp5-popover-arrow-fill{fill:buttonborder}.bp5-slider-progress{background:ButtonText}.bp5-tabs.bp5-vertical>.bp5-tab-list .bp5-tab[aria-selected=true]{background-color:highlight;color:#111418}.bp5-dark .bp5-tab[aria-disabled=true],.bp5-tab[aria-disabled=true]{color:graytext}.bp5-dark .bp5-tab:not([aria-disabled=true]):hover,.bp5-dark .bp5-tab[aria-selected=true],.bp5-tab:not([aria-disabled=true]):hover,.bp5-tab[aria-selected=true]{color:highlight}.bp5-dark .bp5-tab-indicator,.bp5-tab-indicator-wrapper .bp5-tab-indicator{background-color:highlight}}@media (hover:hover){.backToTopButton_pSAI:hover{background-color:var(--ifm-color-emphasis-300)}}@media (pointer:fine){.thin-scrollbar{scrollbar-width:thin}.thin-scrollbar::-webkit-scrollbar{height:var(--ifm-scrollbar-size);width:var(--ifm-scrollbar-size)}.thin-scrollbar::-webkit-scrollbar-track{background:var(--ifm-scrollbar-track-background-color);border-radius:10px}.thin-scrollbar::-webkit-scrollbar-thumb{background:var(--ifm-scrollbar-thumb-background-color);border-radius:10px}.thin-scrollbar::-webkit-scrollbar-thumb:hover{background:var(--ifm-scrollbar-thumb-hover-background-color)}}@media (prefers-reduced-motion:reduce){:root{--ifm-transition-fast:0ms;--ifm-transition-slow:0ms}}@media print{.announcementBar_pUh_,.footer,.menu,.navbar,.pagination-nav,.table-of-contents,.tocMobile_pObj{display:none}.tabs{page-break-inside:avoid}.codeBlockLines_UkX9{white-space:pre-wrap}} \ No newline at end of file +@charset "UTF-8";@import url(https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700);*,.flyde-flow-editor *,.flyde-flow-editor :after,.flyde-flow-editor :before,html{box-sizing:border-box}.col,.container{padding:0 var(--ifm-spacing-horizontal);width:100%}.markdown>h2,.markdown>h3,.markdown>h4,.markdown>h5,.markdown>h6{margin-bottom:calc(var(--ifm-heading-vertical-rhythm-bottom)*var(--ifm-leading))}pre,table{overflow:auto}blockquote,pre{margin:0 0 var(--ifm-spacing-vertical)}.breadcrumbs__link,.button{transition-timing-function:var(--ifm-transition-timing-default)}.button,code{vertical-align:middle}.button--outline.button--active,.button--outline:active,.button--outline:hover,:root{--ifm-button-color:var(--ifm-font-color-base-inverse)}.menu__link:hover,a{transition:color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.navbar--dark,:root{--ifm-navbar-link-hover-color:var(--ifm-color-primary)}.menu,.navbar-sidebar{overflow-x:hidden}:root,html[data-theme=dark]{--ifm-color-emphasis-500:var(--ifm-color-gray-500)}.markdown li,body{word-wrap:break-word}.toggleButton__N08,html{-webkit-tap-highlight-color:transparent}:root{--ifm-color-scheme:light;--ifm-dark-value:10%;--ifm-darker-value:15%;--ifm-darkest-value:30%;--ifm-light-value:15%;--ifm-lighter-value:30%;--ifm-lightest-value:50%;--ifm-contrast-background-value:90%;--ifm-contrast-foreground-value:70%;--ifm-contrast-background-dark-value:70%;--ifm-contrast-foreground-dark-value:90%;--ifm-color-primary:#3578e5;--ifm-color-secondary:#ebedf0;--ifm-color-success:#00a400;--ifm-color-info:#54c7ec;--ifm-color-warning:#ffba00;--ifm-color-danger:#fa383e;--ifm-color-primary-dark:#306cce;--ifm-color-primary-darker:#2d66c3;--ifm-color-primary-darkest:#2554a0;--ifm-color-primary-light:#538ce9;--ifm-color-primary-lighter:#72a1ed;--ifm-color-primary-lightest:#9abcf2;--ifm-color-primary-contrast-background:#ebf2fc;--ifm-color-primary-contrast-foreground:#102445;--ifm-color-secondary-dark:#d4d5d8;--ifm-color-secondary-darker:#c8c9cc;--ifm-color-secondary-darkest:#a4a6a8;--ifm-color-secondary-light:#eef0f2;--ifm-color-secondary-lighter:#f1f2f5;--ifm-color-secondary-lightest:#f5f6f8;--ifm-color-secondary-contrast-background:#fdfdfe;--ifm-color-secondary-contrast-foreground:#474748;--ifm-color-success-dark:#009400;--ifm-color-success-darker:#008b00;--ifm-color-success-darkest:#007300;--ifm-color-success-light:#26b226;--ifm-color-success-lighter:#4dbf4d;--ifm-color-success-lightest:#80d280;--ifm-color-success-contrast-background:#e6f6e6;--ifm-color-success-contrast-foreground:#003100;--ifm-color-info-dark:#4cb3d4;--ifm-color-info-darker:#47a9c9;--ifm-color-info-darkest:#3b8ba5;--ifm-color-info-light:#6ecfef;--ifm-color-info-lighter:#87d8f2;--ifm-color-info-lightest:#aae3f6;--ifm-color-info-contrast-background:#eef9fd;--ifm-color-info-contrast-foreground:#193c47;--ifm-color-warning-dark:#e6a700;--ifm-color-warning-darker:#d99e00;--ifm-color-warning-darkest:#b38200;--ifm-color-warning-light:#ffc426;--ifm-color-warning-lighter:#ffcf4d;--ifm-color-warning-lightest:#ffdd80;--ifm-color-warning-contrast-background:#fff8e6;--ifm-color-warning-contrast-foreground:#4d3800;--ifm-color-danger-dark:#e13238;--ifm-color-danger-darker:#d53035;--ifm-color-danger-darkest:#af272b;--ifm-color-danger-light:#fb565b;--ifm-color-danger-lighter:#fb7478;--ifm-color-danger-lightest:#fd9c9f;--ifm-color-danger-contrast-background:#ffebec;--ifm-color-danger-contrast-foreground:#4b1113;--ifm-color-white:#fff;--ifm-color-black:#000;--ifm-color-gray-0:var(--ifm-color-white);--ifm-color-gray-100:#f5f6f7;--ifm-color-gray-200:#ebedf0;--ifm-color-gray-300:#dadde1;--ifm-color-gray-400:#ccd0d5;--ifm-color-gray-500:#bec3c9;--ifm-color-gray-600:#8d949e;--ifm-color-gray-700:#606770;--ifm-color-gray-800:#444950;--ifm-color-gray-900:#1c1e21;--ifm-color-gray-1000:var(--ifm-color-black);--ifm-color-emphasis-0:var(--ifm-color-gray-0);--ifm-color-emphasis-100:var(--ifm-color-gray-100);--ifm-color-emphasis-200:var(--ifm-color-gray-200);--ifm-color-emphasis-300:var(--ifm-color-gray-300);--ifm-color-emphasis-400:var(--ifm-color-gray-400);--ifm-color-emphasis-600:var(--ifm-color-gray-600);--ifm-color-emphasis-700:var(--ifm-color-gray-700);--ifm-color-emphasis-800:var(--ifm-color-gray-800);--ifm-color-emphasis-900:var(--ifm-color-gray-900);--ifm-color-emphasis-1000:var(--ifm-color-gray-1000);--ifm-color-content:var(--ifm-color-emphasis-900);--ifm-color-content-inverse:var(--ifm-color-emphasis-0);--ifm-color-content-secondary:#525860;--ifm-background-color:transparent;--ifm-background-surface-color:var(--ifm-color-content-inverse);--ifm-global-border-width:1px;--ifm-global-radius:0.4rem;--ifm-hover-overlay:rgba(0,0,0,.05);--ifm-font-color-base:var(--ifm-color-content);--ifm-font-color-base-inverse:var(--ifm-color-content-inverse);--ifm-font-color-secondary:var(--ifm-color-content-secondary);--ifm-font-family-base:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ifm-font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--ifm-font-size-base:100%;--ifm-font-weight-light:300;--ifm-font-weight-normal:400;--ifm-font-weight-semibold:500;--ifm-font-weight-bold:700;--ifm-font-weight-base:var(--ifm-font-weight-normal);--ifm-line-height-base:1.65;--ifm-global-spacing:1rem;--ifm-spacing-vertical:var(--ifm-global-spacing);--ifm-spacing-horizontal:var(--ifm-global-spacing);--ifm-transition-fast:200ms;--ifm-transition-slow:400ms;--ifm-transition-timing-default:cubic-bezier(0.08,0.52,0.52,1);--ifm-global-shadow-lw:0 1px 2px 0 rgba(0,0,0,.1);--ifm-global-shadow-md:0 5px 40px rgba(0,0,0,.2);--ifm-global-shadow-tl:0 12px 28px 0 rgba(0,0,0,.2),0 2px 4px 0 rgba(0,0,0,.1);--ifm-z-index-dropdown:100;--ifm-z-index-fixed:200;--ifm-z-index-overlay:400;--ifm-container-width:1140px;--ifm-container-width-xl:1320px;--ifm-code-background:#f6f7f8;--ifm-code-border-radius:var(--ifm-global-radius);--ifm-code-font-size:90%;--ifm-code-padding-horizontal:0.1rem;--ifm-code-padding-vertical:0.1rem;--ifm-pre-background:var(--ifm-code-background);--ifm-pre-border-radius:var(--ifm-code-border-radius);--ifm-pre-color:inherit;--ifm-pre-line-height:1.45;--ifm-pre-padding:1rem;--ifm-heading-color:inherit;--ifm-heading-margin-top:0;--ifm-heading-margin-bottom:var(--ifm-spacing-vertical);--ifm-heading-font-family:var(--ifm-font-family-base);--ifm-heading-font-weight:var(--ifm-font-weight-bold);--ifm-heading-line-height:1.25;--ifm-h1-font-size:2rem;--ifm-h2-font-size:1.5rem;--ifm-h3-font-size:1.25rem;--ifm-h4-font-size:1rem;--ifm-h5-font-size:0.875rem;--ifm-h6-font-size:0.85rem;--ifm-image-alignment-padding:1.25rem;--ifm-leading-desktop:1.25;--ifm-leading:calc(var(--ifm-leading-desktop)*1rem);--ifm-list-left-padding:2rem;--ifm-list-margin:1rem;--ifm-list-item-margin:0.25rem;--ifm-list-paragraph-margin:1rem;--ifm-table-cell-padding:0.75rem;--ifm-table-background:transparent;--ifm-table-stripe-background:rgba(0,0,0,.03);--ifm-table-border-width:1px;--ifm-table-border-color:var(--ifm-color-emphasis-300);--ifm-table-head-background:inherit;--ifm-table-head-color:inherit;--ifm-table-head-font-weight:var(--ifm-font-weight-bold);--ifm-table-cell-color:inherit;--ifm-link-color:var(--ifm-color-primary);--ifm-link-decoration:none;--ifm-link-hover-color:var(--ifm-link-color);--ifm-link-hover-decoration:underline;--ifm-paragraph-margin-bottom:var(--ifm-leading);--ifm-blockquote-font-size:var(--ifm-font-size-base);--ifm-blockquote-border-left-width:2px;--ifm-blockquote-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-blockquote-padding-vertical:0;--ifm-blockquote-shadow:none;--ifm-blockquote-color:var(--ifm-color-emphasis-800);--ifm-blockquote-border-color:var(--ifm-color-emphasis-300);--ifm-hr-background-color:var(--ifm-color-emphasis-500);--ifm-hr-height:1px;--ifm-hr-margin-vertical:1.5rem;--ifm-scrollbar-size:7px;--ifm-scrollbar-track-background-color:#f1f1f1;--ifm-scrollbar-thumb-background-color:silver;--ifm-scrollbar-thumb-hover-background-color:#a7a7a7;--ifm-alert-background-color:inherit;--ifm-alert-border-color:inherit;--ifm-alert-border-radius:var(--ifm-global-radius);--ifm-alert-border-width:0px;--ifm-alert-border-left-width:5px;--ifm-alert-color:var(--ifm-font-color-base);--ifm-alert-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-alert-padding-vertical:var(--ifm-spacing-vertical);--ifm-alert-shadow:var(--ifm-global-shadow-lw);--ifm-avatar-intro-margin:1rem;--ifm-avatar-intro-alignment:inherit;--ifm-avatar-photo-size:3rem;--ifm-badge-background-color:inherit;--ifm-badge-border-color:inherit;--ifm-badge-border-radius:var(--ifm-global-radius);--ifm-badge-border-width:var(--ifm-global-border-width);--ifm-badge-color:var(--ifm-color-white);--ifm-badge-padding-horizontal:calc(var(--ifm-spacing-horizontal)*0.5);--ifm-badge-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-breadcrumb-border-radius:1.5rem;--ifm-breadcrumb-spacing:0.5rem;--ifm-breadcrumb-color-active:var(--ifm-color-primary);--ifm-breadcrumb-item-background-active:var(--ifm-hover-overlay);--ifm-breadcrumb-padding-horizontal:0.8rem;--ifm-breadcrumb-padding-vertical:0.4rem;--ifm-breadcrumb-size-multiplier:1;--ifm-breadcrumb-separator:url('data:image/svg+xml;utf8,');--ifm-breadcrumb-separator-filter:none;--ifm-breadcrumb-separator-size:0.5rem;--ifm-breadcrumb-separator-size-multiplier:1.25;--ifm-button-background-color:inherit;--ifm-button-border-color:var(--ifm-button-background-color);--ifm-button-border-width:var(--ifm-global-border-width);--ifm-button-font-weight:var(--ifm-font-weight-bold);--ifm-button-padding-horizontal:1.5rem;--ifm-button-padding-vertical:0.375rem;--ifm-button-size-multiplier:1;--ifm-button-transition-duration:var(--ifm-transition-fast);--ifm-button-border-radius:calc(var(--ifm-global-radius)*var(--ifm-button-size-multiplier));--ifm-button-group-spacing:2px;--ifm-card-background-color:var(--ifm-background-surface-color);--ifm-card-border-radius:calc(var(--ifm-global-radius)*2);--ifm-card-horizontal-spacing:var(--ifm-global-spacing);--ifm-card-vertical-spacing:var(--ifm-global-spacing);--ifm-toc-border-color:var(--ifm-color-emphasis-300);--ifm-toc-link-color:var(--ifm-color-content-secondary);--ifm-toc-padding-vertical:0.5rem;--ifm-toc-padding-horizontal:0.5rem;--ifm-dropdown-background-color:var(--ifm-background-surface-color);--ifm-dropdown-font-weight:var(--ifm-font-weight-semibold);--ifm-dropdown-link-color:var(--ifm-font-color-base);--ifm-dropdown-hover-background-color:var(--ifm-hover-overlay);--ifm-footer-background-color:var(--ifm-color-emphasis-100);--ifm-footer-color:inherit;--ifm-footer-link-color:var(--ifm-color-emphasis-700);--ifm-footer-link-hover-color:var(--ifm-color-primary);--ifm-footer-link-horizontal-spacing:0.5rem;--ifm-footer-padding-horizontal:calc(var(--ifm-spacing-horizontal)*2);--ifm-footer-padding-vertical:calc(var(--ifm-spacing-vertical)*2);--ifm-footer-title-color:inherit;--ifm-footer-logo-max-width:min(30rem,90vw);--ifm-hero-background-color:var(--ifm-background-surface-color);--ifm-hero-text-color:var(--ifm-color-emphasis-800);--ifm-menu-color:var(--ifm-color-emphasis-700);--ifm-menu-color-active:var(--ifm-color-primary);--ifm-menu-color-background-active:var(--ifm-hover-overlay);--ifm-menu-color-background-hover:var(--ifm-hover-overlay);--ifm-menu-link-padding-horizontal:0.75rem;--ifm-menu-link-padding-vertical:0.375rem;--ifm-menu-link-sublist-icon:url('data:image/svg+xml;utf8,');--ifm-menu-link-sublist-icon-filter:none;--ifm-navbar-background-color:var(--ifm-background-surface-color);--ifm-navbar-height:3.75rem;--ifm-navbar-item-padding-horizontal:0.75rem;--ifm-navbar-item-padding-vertical:0.25rem;--ifm-navbar-link-color:var(--ifm-font-color-base);--ifm-navbar-link-active-color:var(--ifm-link-color);--ifm-navbar-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-navbar-padding-vertical:calc(var(--ifm-spacing-vertical)*0.5);--ifm-navbar-shadow:var(--ifm-global-shadow-lw);--ifm-navbar-search-input-background-color:var(--ifm-color-emphasis-200);--ifm-navbar-search-input-color:var(--ifm-color-emphasis-800);--ifm-navbar-search-input-placeholder-color:var(--ifm-color-emphasis-500);--ifm-navbar-search-input-icon:url('data:image/svg+xml;utf8,');--ifm-navbar-sidebar-width:83vw;--ifm-pagination-border-radius:var(--ifm-global-radius);--ifm-pagination-color-active:var(--ifm-color-primary);--ifm-pagination-font-size:1rem;--ifm-pagination-item-active-background:var(--ifm-hover-overlay);--ifm-pagination-page-spacing:0.2em;--ifm-pagination-padding-horizontal:calc(var(--ifm-spacing-horizontal)*1);--ifm-pagination-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-pagination-nav-border-radius:var(--ifm-global-radius);--ifm-pagination-nav-color-hover:var(--ifm-color-primary);--ifm-pills-color-active:var(--ifm-color-primary);--ifm-pills-color-background-active:var(--ifm-hover-overlay);--ifm-pills-spacing:0.125rem;--ifm-tabs-color:var(--ifm-font-color-secondary);--ifm-tabs-color-active:var(--ifm-color-primary);--ifm-tabs-color-active-border:var(--ifm-tabs-color-active);--ifm-tabs-padding-horizontal:1rem;--ifm-tabs-padding-vertical:1rem;--docusaurus-progress-bar-color:var(--ifm-color-primary);--ifm-color-primary:#007ec6;--ifm-color-primary-dark:#00659f;--ifm-color-primary-darker:#00507e;--ifm-color-primary-darkest:#003b5d;--ifm-color-primary-light:#0085d2;--ifm-color-primary-lighter:#30a7ec;--ifm-color-primary-lightest:#72cbff;--ifm-code-font-size:95%;--docusaurus-highlighted-code-line-bg:rgba(0,0,0,.1);--docusaurus-announcement-bar-height:auto;--docusaurus-collapse-button-bg:transparent;--docusaurus-collapse-button-bg-hover:rgba(0,0,0,.1);--doc-sidebar-width:300px;--doc-sidebar-hidden-width:30px;--docusaurus-tag-list-border:var(--ifm-color-emphasis-300)}.badge--danger,.badge--info,.badge--primary,.badge--secondary,.badge--success,.badge--warning{--ifm-badge-border-color:var(--ifm-badge-background-color)}.button--link,.button--outline{--ifm-button-background-color:transparent}html{-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;text-size-adjust:100%;background-color:var(--ifm-background-color);color:var(--ifm-font-color-base);color-scheme:var(--ifm-color-scheme);font:var(--ifm-font-size-base)/var(--ifm-line-height-base) var(--ifm-font-family-base);text-rendering:optimizelegibility}iframe{border:0;color-scheme:auto}.container{margin:0 auto;max-width:var(--ifm-container-width)}.container--fluid{max-width:inherit}.row{display:flex;flex-wrap:wrap;margin:0 calc(var(--ifm-spacing-horizontal)*-1)}.margin-bottom--none,.margin-vert--none,.markdown>:last-child{margin-bottom:0!important}.margin-top--none,.margin-vert--none{margin-top:0!important}.row--no-gutters{margin-left:0;margin-right:0}.margin-horiz--none,.margin-right--none{margin-right:0!important}.row--no-gutters>.col{padding-left:0;padding-right:0}.bp5-toast-container.bp5-toast-container-left,.row--align-top{align-items:flex-start}.bp5-toast-container.bp5-toast-container-right,.row--align-bottom{align-items:flex-end}.menuExternalLink_o9JJ,.row--align-center{align-items:center}.row--align-stretch{align-items:stretch}.row--align-baseline{align-items:baseline}.col{--ifm-col-width:100%;flex:1 0;margin-left:0;max-width:var(--ifm-col-width)}.padding-bottom--none,.padding-vert--none{padding-bottom:0!important}.padding-top--none,.padding-vert--none{padding-top:0!important}.padding-horiz--none,.padding-left--none{padding-left:0!important}.padding-horiz--none,.padding-right--none{padding-right:0!important}.col[class*=col--]{flex:0 0 var(--ifm-col-width)}.col--1{--ifm-col-width:8.33333%}.col--offset-1{margin-left:8.33333%}.col--2{--ifm-col-width:16.66667%}.col--offset-2{margin-left:16.66667%}.col--3{--ifm-col-width:25%}.col--offset-3{margin-left:25%}.col--4{--ifm-col-width:33.33333%}.col--offset-4{margin-left:33.33333%}.col--5{--ifm-col-width:41.66667%}.col--offset-5{margin-left:41.66667%}.col--6{--ifm-col-width:50%}.col--offset-6{margin-left:50%}.col--7{--ifm-col-width:58.33333%}.col--offset-7{margin-left:58.33333%}.col--8{--ifm-col-width:66.66667%}.col--offset-8{margin-left:66.66667%}.col--9{--ifm-col-width:75%}.col--offset-9{margin-left:75%}.col--10{--ifm-col-width:83.33333%}.col--offset-10{margin-left:83.33333%}.col--11{--ifm-col-width:91.66667%}.col--offset-11{margin-left:91.66667%}.col--12{--ifm-col-width:100%}.col--offset-12{margin-left:100%}.margin-horiz--none,.margin-left--none{margin-left:0!important}.bp5-popover.bp5-minimal,.margin--none{margin:0!important}.margin-bottom--xs,.margin-vert--xs{margin-bottom:.25rem!important}.margin-top--xs,.margin-vert--xs{margin-top:.25rem!important}.margin-horiz--xs,.margin-left--xs{margin-left:.25rem!important}.margin-horiz--xs,.margin-right--xs{margin-right:.25rem!important}.margin--xs{margin:.25rem!important}.margin-bottom--sm,.margin-vert--sm{margin-bottom:.5rem!important}.margin-top--sm,.margin-vert--sm{margin-top:.5rem!important}.margin-horiz--sm,.margin-left--sm{margin-left:.5rem!important}.margin-horiz--sm,.margin-right--sm{margin-right:.5rem!important}.margin--sm{margin:.5rem!important}.margin-bottom--md,.margin-vert--md{margin-bottom:1rem!important}.margin-top--md,.margin-vert--md{margin-top:1rem!important}.margin-horiz--md,.margin-left--md{margin-left:1rem!important}.margin-horiz--md,.margin-right--md{margin-right:1rem!important}.margin--md{margin:1rem!important}.margin-bottom--lg,.margin-vert--lg{margin-bottom:2rem!important}.margin-top--lg,.margin-vert--lg{margin-top:2rem!important}.margin-horiz--lg,.margin-left--lg{margin-left:2rem!important}.margin-horiz--lg,.margin-right--lg{margin-right:2rem!important}.margin--lg{margin:2rem!important}.margin-bottom--xl,.margin-vert--xl{margin-bottom:5rem!important}.margin-top--xl,.margin-vert--xl{margin-top:5rem!important}.margin-horiz--xl,.margin-left--xl{margin-left:5rem!important}.margin-horiz--xl,.margin-right--xl{margin-right:5rem!important}.margin--xl{margin:5rem!important}.bp5-button:empty,.padding--none{padding:0!important}.padding-bottom--xs,.padding-vert--xs{padding-bottom:.25rem!important}.padding-top--xs,.padding-vert--xs{padding-top:.25rem!important}.padding-horiz--xs,.padding-left--xs{padding-left:.25rem!important}.padding-horiz--xs,.padding-right--xs{padding-right:.25rem!important}.padding--xs{padding:.25rem!important}.padding-bottom--sm,.padding-vert--sm{padding-bottom:.5rem!important}.padding-top--sm,.padding-vert--sm{padding-top:.5rem!important}.padding-horiz--sm,.padding-left--sm{padding-left:.5rem!important}.padding-horiz--sm,.padding-right--sm{padding-right:.5rem!important}.padding--sm{padding:.5rem!important}.padding-bottom--md,.padding-vert--md{padding-bottom:1rem!important}.padding-top--md,.padding-vert--md{padding-top:1rem!important}.padding-horiz--md,.padding-left--md{padding-left:1rem!important}.padding-horiz--md,.padding-right--md{padding-right:1rem!important}.padding--md{padding:1rem!important}.padding-bottom--lg,.padding-vert--lg{padding-bottom:2rem!important}.padding-top--lg,.padding-vert--lg{padding-top:2rem!important}.padding-horiz--lg,.padding-left--lg{padding-left:2rem!important}.padding-horiz--lg,.padding-right--lg{padding-right:2rem!important}.padding--lg{padding:2rem!important}.padding-bottom--xl,.padding-vert--xl{padding-bottom:5rem!important}.padding-top--xl,.padding-vert--xl{padding-top:5rem!important}.padding-horiz--xl,.padding-left--xl{padding-left:5rem!important}.padding-horiz--xl,.padding-right--xl{padding-right:5rem!important}.padding--xl{padding:5rem!important}code{background-color:var(--ifm-code-background);border:.1rem solid rgba(0,0,0,.1);border-radius:var(--ifm-code-border-radius);font-family:var(--ifm-font-family-monospace);font-size:var(--ifm-code-font-size);padding:var(--ifm-code-padding-vertical) var(--ifm-code-padding-horizontal)}pre{background-color:var(--ifm-pre-background);border-radius:var(--ifm-pre-border-radius);color:var(--ifm-pre-color);font:var(--ifm-code-font-size)/var(--ifm-pre-line-height) var(--ifm-font-family-monospace);padding:var(--ifm-pre-padding)}.clean-btn,pre code{border:none;padding:0}pre code{background-color:transparent;font-size:100%;line-height:inherit}kbd{background-color:var(--ifm-color-emphasis-0);border:1px solid var(--ifm-color-emphasis-400);box-shadow:inset 0 -1px 0 var(--ifm-color-emphasis-400);color:var(--ifm-color-emphasis-800);font:80% var(--ifm-font-family-monospace)}h1,h2,h3,h4,h5,h6{color:var(--ifm-heading-color);font-family:var(--ifm-heading-font-family);font-weight:var(--ifm-heading-font-weight);line-height:var(--ifm-heading-line-height);margin:var(--ifm-heading-margin-top) 0 var(--ifm-heading-margin-bottom) 0}h1{font-size:var(--ifm-h1-font-size)}h2{font-size:var(--ifm-h2-font-size)}h3{font-size:var(--ifm-h3-font-size)}h4{font-size:var(--ifm-h4-font-size)}h5{font-size:var(--ifm-h5-font-size)}h6{font-size:var(--ifm-h6-font-size)}img{max-width:100%}img[align=right]{padding-left:var(--image-alignment-padding)}img[align=left]{padding-right:var(--image-alignment-padding)}.markdown{--ifm-h1-vertical-rhythm-top:3;--ifm-h2-vertical-rhythm-top:2;--ifm-h3-vertical-rhythm-top:1.5;--ifm-heading-vertical-rhythm-top:1.25;--ifm-h1-vertical-rhythm-bottom:1.25;--ifm-heading-vertical-rhythm-bottom:1}.markdown:after,.markdown:before{content:"";display:table}.markdown:after{clear:both}.markdown h1:first-child{--ifm-h1-font-size:3rem;margin-bottom:calc(var(--ifm-h1-vertical-rhythm-bottom)*var(--ifm-leading))}.markdown>h2{--ifm-h2-font-size:2rem;margin-top:calc(var(--ifm-h2-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h3{--ifm-h3-font-size:1.5rem;margin-top:calc(var(--ifm-h3-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h4,.markdown>h5,.markdown>h6{margin-top:calc(var(--ifm-heading-vertical-rhythm-top)*var(--ifm-leading))}.markdown>p,.markdown>pre,.markdown>ul{margin-bottom:var(--ifm-leading)}.markdown li>p{margin-top:var(--ifm-list-paragraph-margin)}.markdown li+li{margin-top:var(--ifm-list-item-margin)}ol,ul{margin:0 0 var(--ifm-list-margin);padding-left:var(--ifm-list-left-padding)}ol ol,ul ol{list-style-type:lower-roman}ol ol,ol ul,ul ol,ul ul{margin:0}ol ol ol,ol ul ol,ul ol ol,ul ul ol{list-style-type:lower-alpha}table{border-collapse:collapse;display:block;margin-bottom:var(--ifm-spacing-vertical)}table thead tr{border-bottom:2px solid var(--ifm-table-border-color)}table thead,table tr:nth-child(2n){background-color:var(--ifm-table-stripe-background)}table tr{background-color:var(--ifm-table-background);border-top:var(--ifm-table-border-width) solid var(--ifm-table-border-color)}table td,table th{border:var(--ifm-table-border-width) solid var(--ifm-table-border-color);padding:var(--ifm-table-cell-padding)}table th{background-color:var(--ifm-table-head-background);color:var(--ifm-table-head-color);font-weight:var(--ifm-table-head-font-weight)}table td{color:var(--ifm-table-cell-color)}strong{font-weight:var(--ifm-font-weight-bold)}a{color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration);text-decoration:none}a:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.button:hover,.text--no-decoration,.text--no-decoration:hover,a:not([href]){text-decoration:none}p{margin:0 0 var(--ifm-paragraph-margin-bottom);margin-bottom:10px;margin-top:0}blockquote{border-left:var(--ifm-blockquote-border-left-width) solid var(--ifm-blockquote-border-color);box-shadow:var(--ifm-blockquote-shadow);color:var(--ifm-blockquote-color);font-size:var(--ifm-blockquote-font-size);padding:var(--ifm-blockquote-padding-vertical) var(--ifm-blockquote-padding-horizontal)}blockquote>:first-child{margin-top:0}blockquote>:last-child{margin-bottom:0}hr{background-color:var(--ifm-hr-background-color);border:0;height:var(--ifm-hr-height);margin:var(--ifm-hr-margin-vertical) 0}.shadow--lw{box-shadow:var(--ifm-global-shadow-lw)!important}.shadow--md{box-shadow:var(--ifm-global-shadow-md)!important}.shadow--tl{box-shadow:var(--ifm-global-shadow-tl)!important}.text--primary,.wordWrapButtonEnabled_VB_4 .wordWrapButtonIcon_Xcrc{color:var(--ifm-color-primary)}.text--secondary{color:var(--ifm-color-secondary)}.text--success{color:var(--ifm-color-success)}.text--info{color:var(--ifm-color-info)}.text--warning{color:var(--ifm-color-warning)}.text--danger{color:var(--ifm-color-danger)}.text--center{text-align:center}.bp5-align-left .bp5-button,.bp5-button-group.bp5-align-left .bp5-button,.bp5-button.bp5-align-left,.text--left{text-align:left}.text--justify{text-align:justify}.bp5-align-right .bp5-button,.bp5-button.bp5-align-right,.bp5-rtl,.text--right{text-align:right}.text--capitalize{text-transform:capitalize}.text--lowercase{text-transform:lowercase}.alert__heading,.text--uppercase{text-transform:uppercase}.text--light{font-weight:var(--ifm-font-weight-light)}.text--normal{font-weight:var(--ifm-font-weight-normal)}.text--semibold{font-weight:var(--ifm-font-weight-semibold)}.text--bold{font-weight:var(--ifm-font-weight-bold)}.text--italic{font-style:italic}.text--truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text--break{word-wrap:break-word!important;word-break:break-word!important}.clean-btn{background:none;color:inherit;cursor:pointer;font-family:inherit}.alert,.alert .close{color:var(--ifm-alert-foreground-color)}.clean-list{list-style:none;padding-left:0}.alert--primary{--ifm-alert-background-color:var(--ifm-color-primary-contrast-background);--ifm-alert-background-color-highlight:rgba(53,120,229,.15);--ifm-alert-foreground-color:var(--ifm-color-primary-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-primary-dark)}.alert--secondary{--ifm-alert-background-color:var(--ifm-color-secondary-contrast-background);--ifm-alert-background-color-highlight:rgba(235,237,240,.15);--ifm-alert-foreground-color:var(--ifm-color-secondary-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-secondary-dark)}.alert--success{--ifm-alert-background-color:var(--ifm-color-success-contrast-background);--ifm-alert-background-color-highlight:rgba(0,164,0,.15);--ifm-alert-foreground-color:var(--ifm-color-success-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-success-dark)}.alert--info{--ifm-alert-background-color:var(--ifm-color-info-contrast-background);--ifm-alert-background-color-highlight:rgba(84,199,236,.15);--ifm-alert-foreground-color:var(--ifm-color-info-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-info-dark)}.alert--warning{--ifm-alert-background-color:var(--ifm-color-warning-contrast-background);--ifm-alert-background-color-highlight:rgba(255,186,0,.15);--ifm-alert-foreground-color:var(--ifm-color-warning-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-warning-dark)}.alert--danger{--ifm-alert-background-color:var(--ifm-color-danger-contrast-background);--ifm-alert-background-color-highlight:rgba(250,56,62,.15);--ifm-alert-foreground-color:var(--ifm-color-danger-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-danger-dark)}.alert{--ifm-code-background:var(--ifm-alert-background-color-highlight);--ifm-link-color:var(--ifm-alert-foreground-color);--ifm-link-hover-color:var(--ifm-alert-foreground-color);--ifm-link-decoration:underline;--ifm-tabs-color:var(--ifm-alert-foreground-color);--ifm-tabs-color-active:var(--ifm-alert-foreground-color);--ifm-tabs-color-active-border:var(--ifm-alert-border-color);background-color:var(--ifm-alert-background-color);border:var(--ifm-alert-border-width) solid var(--ifm-alert-border-color);border-left-width:var(--ifm-alert-border-left-width);border-radius:var(--ifm-alert-border-radius);box-shadow:var(--ifm-alert-shadow);padding:var(--ifm-alert-padding-vertical) var(--ifm-alert-padding-horizontal)}.alert__heading{align-items:center;display:flex;font:700 var(--ifm-h5-font-size)/var(--ifm-heading-line-height) var(--ifm-heading-font-family);margin-bottom:.5rem}.alert__icon{display:inline-flex;margin-right:.4em}.alert__icon svg{fill:var(--ifm-alert-foreground-color);stroke:var(--ifm-alert-foreground-color);stroke-width:0}.alert .close{margin:calc(var(--ifm-alert-padding-vertical)*-1) calc(var(--ifm-alert-padding-horizontal)*-1) 0 0;opacity:.75}.bp5-control.bp5-radio input:checked:disabled~.bp5-control-indicator:before,.close{opacity:.5}.alert .close:focus,.alert .close:hover{opacity:1}.alert a{text-decoration-color:var(--ifm-alert-border-color)}.alert a:hover{text-decoration-thickness:2px}.avatar{column-gap:var(--ifm-avatar-intro-margin);display:flex}.avatar__photo{border-radius:50%;display:block;height:var(--ifm-avatar-photo-size);overflow:hidden;width:var(--ifm-avatar-photo-size)}.bp5-tabs:not(.bp5-vertical) .bp5-tab-indicator-wrapper,.bp5-tabs:not(.bp5-vertical).bp5-fill,.bp5-tabs:not(.bp5-vertical).bp5-fill .bp5-tab-list,.card--full-height,.navbar__logo img,body,html{height:100%}.avatar__photo--sm{--ifm-avatar-photo-size:2rem}.avatar__photo--lg{--ifm-avatar-photo-size:4rem}.avatar__photo--xl{--ifm-avatar-photo-size:6rem}.avatar__intro{display:flex;flex:1 1;flex-direction:column;justify-content:center;text-align:var(--ifm-avatar-intro-alignment)}.badge,.breadcrumbs__item,.breadcrumbs__link,.button,.dropdown>.navbar__link:after,span.bp5-popover-target{display:inline-block}.avatar__name{font:700 var(--ifm-h4-font-size)/var(--ifm-heading-line-height) var(--ifm-font-family-base)}.avatar__subtitle{margin-top:.25rem}.avatar--vertical{--ifm-avatar-intro-alignment:center;--ifm-avatar-intro-margin:0.5rem;align-items:center;flex-direction:column}.badge{background-color:var(--ifm-badge-background-color);border:var(--ifm-badge-border-width) solid var(--ifm-badge-border-color);border-radius:var(--ifm-badge-border-radius);color:var(--ifm-badge-color);font-size:75%;font-weight:var(--ifm-font-weight-bold);line-height:1;padding:var(--ifm-badge-padding-vertical) var(--ifm-badge-padding-horizontal)}.badge--primary{--ifm-badge-background-color:var(--ifm-color-primary)}.badge--secondary{--ifm-badge-background-color:var(--ifm-color-secondary);color:var(--ifm-color-black)}.breadcrumbs__link,.button.button--secondary.button--outline:not(.button--active):not(:hover){color:var(--ifm-font-color-base)}.badge--success{--ifm-badge-background-color:var(--ifm-color-success)}.badge--info{--ifm-badge-background-color:var(--ifm-color-info)}.badge--warning{--ifm-badge-background-color:var(--ifm-color-warning)}.badge--danger{--ifm-badge-background-color:var(--ifm-color-danger)}.breadcrumbs{margin-bottom:0;padding-left:0}.breadcrumbs__item:not(:last-child):after{background:var(--ifm-breadcrumb-separator) center;content:" ";display:inline-block;filter:var(--ifm-breadcrumb-separator-filter);height:calc(var(--ifm-breadcrumb-separator-size)*var(--ifm-breadcrumb-size-multiplier)*var(--ifm-breadcrumb-separator-size-multiplier));margin:0 var(--ifm-breadcrumb-spacing);opacity:.5;width:calc(var(--ifm-breadcrumb-separator-size)*var(--ifm-breadcrumb-size-multiplier)*var(--ifm-breadcrumb-separator-size-multiplier))}.breadcrumbs__item--active .breadcrumbs__link{background:var(--ifm-breadcrumb-item-background-active);color:var(--ifm-breadcrumb-color-active)}.breadcrumbs__link{border-radius:var(--ifm-breadcrumb-border-radius);font-size:calc(1rem*var(--ifm-breadcrumb-size-multiplier));padding:calc(var(--ifm-breadcrumb-padding-vertical)*var(--ifm-breadcrumb-size-multiplier)) calc(var(--ifm-breadcrumb-padding-horizontal)*var(--ifm-breadcrumb-size-multiplier));transition-duration:var(--ifm-transition-fast);transition-property:background,color}.breadcrumbs__link:link:hover,.breadcrumbs__link:visited:hover,area[href].breadcrumbs__link:hover{background:var(--ifm-breadcrumb-item-background-active);text-decoration:none}.breadcrumbs__link:any-link:hover{background:var(--ifm-breadcrumb-item-background-active);text-decoration:none}.breadcrumbs--sm{--ifm-breadcrumb-size-multiplier:0.8}.breadcrumbs--lg{--ifm-breadcrumb-size-multiplier:1.2}.button{background-color:var(--ifm-button-background-color);border:var(--ifm-button-border-width) solid var(--ifm-button-border-color);border-radius:var(--ifm-button-border-radius);cursor:pointer;font-size:calc(.875rem*var(--ifm-button-size-multiplier));font-weight:var(--ifm-button-font-weight);line-height:1.5;padding:calc(var(--ifm-button-padding-vertical)*var(--ifm-button-size-multiplier)) calc(var(--ifm-button-padding-horizontal)*var(--ifm-button-size-multiplier));text-align:center;transition-duration:var(--ifm-button-transition-duration);transition-property:color,background,border-color;-webkit-user-select:none;user-select:none;white-space:nowrap}.button,.button:hover{color:var(--ifm-button-color)}.button--outline{--ifm-button-color:var(--ifm-button-border-color)}.button--outline:hover{--ifm-button-background-color:var(--ifm-button-border-color)}.button--link{--ifm-button-border-color:transparent;color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration)}.button--link.button--active,.button--link:active,.button--link:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.button.disabled,.button:disabled,.button[disabled]{opacity:.65;pointer-events:none}.button--sm{--ifm-button-size-multiplier:0.8}.button--lg{--ifm-button-size-multiplier:1.35}.button--block{display:block;width:100%}.button.button--secondary{color:var(--ifm-color-gray-900)}:where(.button--primary){--ifm-button-background-color:var(--ifm-color-primary);--ifm-button-border-color:var(--ifm-color-primary)}:where(.button--primary):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-primary-dark);--ifm-button-border-color:var(--ifm-color-primary-dark)}.button--primary.button--active,.button--primary:active{--ifm-button-background-color:var(--ifm-color-primary-darker);--ifm-button-border-color:var(--ifm-color-primary-darker)}:where(.button--secondary){--ifm-button-background-color:var(--ifm-color-secondary);--ifm-button-border-color:var(--ifm-color-secondary)}:where(.button--secondary):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-secondary-dark);--ifm-button-border-color:var(--ifm-color-secondary-dark)}.button--secondary.button--active,.button--secondary:active{--ifm-button-background-color:var(--ifm-color-secondary-darker);--ifm-button-border-color:var(--ifm-color-secondary-darker)}:where(.button--success){--ifm-button-background-color:var(--ifm-color-success);--ifm-button-border-color:var(--ifm-color-success)}:where(.button--success):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-success-dark);--ifm-button-border-color:var(--ifm-color-success-dark)}.button--success.button--active,.button--success:active{--ifm-button-background-color:var(--ifm-color-success-darker);--ifm-button-border-color:var(--ifm-color-success-darker)}:where(.button--info){--ifm-button-background-color:var(--ifm-color-info);--ifm-button-border-color:var(--ifm-color-info)}:where(.button--info):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-info-dark);--ifm-button-border-color:var(--ifm-color-info-dark)}.button--info.button--active,.button--info:active{--ifm-button-background-color:var(--ifm-color-info-darker);--ifm-button-border-color:var(--ifm-color-info-darker)}:where(.button--warning){--ifm-button-background-color:var(--ifm-color-warning);--ifm-button-border-color:var(--ifm-color-warning)}:where(.button--warning):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-warning-dark);--ifm-button-border-color:var(--ifm-color-warning-dark)}.button--warning.button--active,.button--warning:active{--ifm-button-background-color:var(--ifm-color-warning-darker);--ifm-button-border-color:var(--ifm-color-warning-darker)}:where(.button--danger){--ifm-button-background-color:var(--ifm-color-danger);--ifm-button-border-color:var(--ifm-color-danger)}:where(.button--danger):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-danger-dark);--ifm-button-border-color:var(--ifm-color-danger-dark)}.button--danger.button--active,.button--danger:active{--ifm-button-background-color:var(--ifm-color-danger-darker);--ifm-button-border-color:var(--ifm-color-danger-darker)}.button-group{display:inline-flex;gap:var(--ifm-button-group-spacing)}.bp5-button-group:not(.bp5-minimal)>.bp5-button:not(:first-child),.bp5-button-group:not(.bp5-minimal)>.bp5-popover-target:not(:first-child) .bp5-button,.bp5-button-group:not(.bp5-minimal)>.bp5-popover-wrapper:not(:first-child) .bp5-button,.bp5-control-group .bp5-numeric-input:not(:first-child) .bp5-input-group,.button-group>.button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.bp5-slider-handle.bp5-start,.button-group>.button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.button-group--block{display:flex;justify-content:stretch}.bp5-hotkey-dialog .bp5-hotkey-label,.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels .bp5-dialog-step-container,.button-group--block>.button{flex-grow:1}.card{background-color:var(--ifm-card-background-color);border-radius:var(--ifm-card-border-radius);box-shadow:var(--ifm-global-shadow-lw);display:flex;flex-direction:column;overflow:hidden}.card__image{padding-top:var(--ifm-card-vertical-spacing)}.bp5-large .bp5-menu-header:first-of-type>h6,.bp5-menu-header:first-of-type>h6,.card__image:first-child{padding-top:0}.card__body,.card__footer,.card__header{padding:var(--ifm-card-vertical-spacing) var(--ifm-card-horizontal-spacing)}.card__body:not(:last-child),.card__footer:not(:last-child),.card__header:not(:last-child){padding-bottom:0}.card__body>:last-child,.card__footer>:last-child,.card__header>:last-child{margin-bottom:0}.card__footer{margin-top:auto}.table-of-contents{font-size:.8rem;margin-bottom:0;padding:var(--ifm-toc-padding-vertical) 0}.table-of-contents,.table-of-contents ul{list-style:none;padding-left:var(--ifm-toc-padding-horizontal)}.table-of-contents li{margin:var(--ifm-toc-padding-vertical) var(--ifm-toc-padding-horizontal)}.table-of-contents__left-border{border-left:1px solid var(--ifm-toc-border-color)}.table-of-contents__link{color:var(--ifm-toc-link-color);display:block}.table-of-contents__link--active,.table-of-contents__link--active code,.table-of-contents__link:hover,.table-of-contents__link:hover code{color:var(--ifm-color-primary);text-decoration:none}.bp5-callout.bp5-intent-primary a,a:hover{text-decoration:underline}.close{color:var(--ifm-color-black);float:right;font-size:1.5rem;font-weight:var(--ifm-font-weight-bold);line-height:1;padding:1rem;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.close:hover,.pin.optional:not(.connected) .pin-inner{opacity:.7}.base-node-view.dragged,.close:focus,.ins-view .ins-view-inner.dragged,.ins-view.dragged,.json-view .jv-chevron:hover,.node-io-view .node-io-view-inner.dragged,.theme-code-block-highlighted-line .codeLineNumber_VYTV:before{opacity:.8}.dropdown{display:inline-flex;font-weight:var(--ifm-dropdown-font-weight);position:relative;vertical-align:top}.dropdown--hoverable:hover .dropdown__menu,.dropdown--show .dropdown__menu{opacity:1;pointer-events:all;transform:translateY(-1px);visibility:visible}#nprogress,.bp5-dialog-container,.bp5-overlay:not(.bp5-overlay-open),.bp5-popover-transition-container.bp5-popover-leave .bp5-popover-content,.dropdown__menu,.navbar__item.dropdown .navbar__link:not([href]),.node-preview{pointer-events:none}.dropdown--right .dropdown__menu{left:inherit;right:0}.dropdown--nocaret .navbar__link:after{content:none!important}.dropdown__menu{background-color:var(--ifm-dropdown-background-color);border-radius:var(--ifm-global-radius);box-shadow:var(--ifm-global-shadow-md);left:0;list-style:none;max-height:80vh;min-width:10rem;opacity:0;overflow-y:auto;padding:.5rem;position:absolute;top:calc(100% - var(--ifm-navbar-item-padding-vertical) + .3rem);transform:translateY(-.625rem);transition-duration:var(--ifm-transition-fast);transition-property:opacity,transform,visibility;transition-timing-function:var(--ifm-transition-timing-default);visibility:hidden;z-index:var(--ifm-z-index-dropdown)}.menu__caret,.menu__link,.menu__list-item-collapsible{border-radius:.25rem;transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.dropdown__link{border-radius:.25rem;color:var(--ifm-dropdown-link-color);display:block;font-size:.875rem;margin-top:.2rem;padding:.25rem .5rem;white-space:nowrap}.dropdown__link--active,.dropdown__link:hover{background-color:var(--ifm-dropdown-hover-background-color);color:var(--ifm-dropdown-link-color);text-decoration:none}.dropdown__link--active,.dropdown__link--active:hover{--ifm-dropdown-link-color:var(--ifm-link-color)}.dropdown>.navbar__link:after{border-color:currentcolor transparent;border-style:solid;border-width:.4em .4em 0;content:"";margin-left:.3em;position:relative;top:2px;transform:translateY(-50%)}.footer{background-color:var(--ifm-footer-background-color);color:var(--ifm-footer-color);padding:var(--ifm-footer-padding-vertical) var(--ifm-footer-padding-horizontal)}.footer--dark{--ifm-footer-background-color:#303846;--ifm-footer-color:var(--ifm-footer-link-color);--ifm-footer-link-color:var(--ifm-color-secondary);--ifm-footer-title-color:var(--ifm-color-white)}.footer__links{margin-bottom:1rem}.footer__link-item{color:var(--ifm-footer-link-color);line-height:2}.footer__link-item:hover{color:var(--ifm-footer-link-hover-color)}.footer__link-separator{margin:0 var(--ifm-footer-link-horizontal-spacing)}.footer__logo{margin-top:1rem;max-width:var(--ifm-footer-logo-max-width)}.footer__title{color:var(--ifm-footer-title-color);font:700 var(--ifm-h4-font-size)/var(--ifm-heading-line-height) var(--ifm-font-family-base);margin-bottom:var(--ifm-heading-margin-bottom)}.menu,.navbar__link{font-weight:var(--ifm-font-weight-semibold)}.bp5-code,.bp5-code-block,.bp5-monospace-text,.bp5-running-text code,.bp5-running-text pre{font-family:monospace;text-transform:none}.bp5-button[class*=bp5-icon-]:before,.bp5-callout[class*=bp5-icon-]:before{line-height:1;font-family:blueprint-icons-16,sans-serif;font-style:normal;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-variant:normal}.docItemContainer_QBgl article>:first-child,.docItemContainer_QBgl header+*,.footer__item,label.bp5-label .bp5-control-group>.bp5-button-group,label.bp5-label .bp5-control-group>.bp5-html-select,label.bp5-label .bp5-control-group>.bp5-input,label.bp5-label .bp5-control-group>.bp5-popover-wrapper,label.bp5-label .bp5-control-group>.bp5-select,label.bp5-label .bp5-control-group>.bp5-slider{margin-top:0}.admonitionContent_Esg6>:last-child,.bp5-callout .bp5-heading:last-child,.bp5-non-ideal-state .bp5-heading:only-child,.bp5-non-ideal-state:empty:before,.bp5-non-ideal-state>:last-child,.bp5-select-popover .bp5-input-group,.collapsibleContent_yVEW>:last-child,.footer__items{margin-bottom:0}.bp5-input-group .bp5-button:empty,.bp5-list-unstyled li,.codeBlockStandalone_qlgt,[type=checkbox]{padding:0}.hero{align-items:center;background-color:var(--ifm-hero-background-color);color:var(--ifm-hero-text-color);display:flex}.hero--primary{--ifm-hero-background-color:var(--ifm-color-primary);--ifm-hero-text-color:var(--ifm-font-color-base-inverse)}.hero--dark{--ifm-hero-background-color:#303846;--ifm-hero-text-color:var(--ifm-color-white)}.hero__title,.title_PlBF{font-size:3rem}.bp5-tree-node-list,.menu__list{list-style:none;margin:0;padding-left:0}.menu__caret,.menu__link{padding:var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal)}.menu__list .menu__list{flex:0 0 100%;margin-top:.25rem;padding-left:var(--ifm-menu-link-padding-horizontal)}.menu__list-item:not(:first-child){margin-top:.25rem}.menu__list-item--collapsed .menu__list{height:0;overflow:hidden}.bp5-tree-node-caret.bp5-tree-node-caret-open,.details_jMJo[data-collapsed=false].isBrowser_YMID>summary:before,.details_jMJo[open]:not(.isBrowser_YMID)>summary:before,.menu__list-item--collapsed .menu__caret:before,.menu__list-item--collapsed .menu__link--sublist:after{transform:rotate(90deg)}.menu__list-item-collapsible{display:flex;flex-wrap:wrap;position:relative}.menu__caret:hover,.menu__link:hover,.menu__list-item-collapsible--active,.menu__list-item-collapsible:hover{background:var(--ifm-menu-color-background-hover)}.menu__list-item-collapsible .menu__link--active,.menu__list-item-collapsible .menu__link:hover{background:none!important}.menu__caret,.menu__link{align-items:center;display:flex}.navbar-sidebar,.navbar-sidebar__backdrop{opacity:0;transition-duration:var(--ifm-transition-fast);transition-timing-function:ease-in-out;left:0;bottom:0;top:0}.menu__link{color:var(--ifm-menu-color);flex:1;line-height:1.25}.menu__link:hover{color:var(--ifm-menu-color);text-decoration:none}.menu__caret:before,.menu__link--sublist-caret:after{content:"";filter:var(--ifm-menu-link-sublist-icon-filter);height:1.25rem;transform:rotate(180deg);transition:transform var(--ifm-transition-fast) linear;width:1.25rem}.menu__link--sublist-caret:after{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem;margin-left:auto;min-width:1.25rem}.menu__link--active,.menu__link--active:hover{color:var(--ifm-menu-color-active)}.navbar__brand,.navbar__link{color:var(--ifm-navbar-link-color)}.menu__link--active:not(.menu__link--sublist){background-color:var(--ifm-menu-color-background-active)}.menu__caret:before{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem}.navbar--dark,html[data-theme=dark]{--ifm-menu-link-sublist-icon-filter:invert(100%) sepia(94%) saturate(17%) hue-rotate(223deg) brightness(104%) contrast(98%)}.navbar{background-color:var(--ifm-navbar-background-color);box-shadow:var(--ifm-navbar-shadow);height:var(--ifm-navbar-height);padding:var(--ifm-navbar-padding-vertical) var(--ifm-navbar-padding-horizontal)}.bp5-alert-body,.bp5-multistep-dialog-panels,.bp5-tabs.bp5-vertical,.navbar,.navbar>.container,.navbar>.container-fluid{display:flex}.navbar--fixed-top{position:sticky;top:0;z-index:var(--ifm-z-index-fixed)}.navbar__inner{display:flex;flex-wrap:wrap;justify-content:space-between;width:100%}.navbar__brand{align-items:center;display:flex;margin-right:1rem;min-width:0}.navbar__brand:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.announcementBarContent_Jcns,.bp5-button-group .bp5-button.bp5-fill,.bp5-button-group.bp5-align-left .bp5-button-text,.bp5-button-group.bp5-align-right .bp5-button-text,.bp5-button-group.bp5-fill .bp5-button:not(.bp5-fixed),.bp5-button.bp5-align-left .bp5-button-text,.bp5-button.bp5-align-right .bp5-button-text,.bp5-control-group.bp5-fill>:not(.bp5-fixed),.bp5-control-group>.bp5-fill,.navbar__title{flex:1 1 auto}.navbar__toggle{display:none;margin-right:.5rem}.navbar__logo{flex:0 0 auto;height:2rem;margin-right:.5rem}.navbar__items{align-items:center;display:flex;flex:1;min-width:0}.navbar__items--center{flex:0 0 auto}.navbar__items--center .navbar__brand,label.bp5-label.bp5-inline .bp5-control-group>.bp5-button-group,label.bp5-label.bp5-inline .bp5-control-group>.bp5-html-select,label.bp5-label.bp5-inline .bp5-control-group>.bp5-input,label.bp5-label.bp5-inline .bp5-control-group>.bp5-popover-wrapper,label.bp5-label.bp5-inline .bp5-control-group>.bp5-select,label.bp5-label.bp5-inline .bp5-control-group>.bp5-slider{margin:0}.add-node-menu-list-item .content,.base-node-editor .form-row>div,.hero .container .hero-example,.navbar__items--center+.navbar__items--right,.visual-node-editor .edit-group-modal>header .text-wrapper{flex:1}.navbar__items--right{flex:0 0 auto;justify-content:flex-end}.navbar__items--right>:last-child{padding-right:0}.navbar__item{display:inline-block;padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.navbar__link--active,.navbar__link:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.navbar--dark,.navbar--primary{--ifm-menu-color:var(--ifm-color-gray-300);--ifm-navbar-link-color:var(--ifm-color-gray-100);--ifm-navbar-search-input-background-color:hsla(0,0%,100%,.1);--ifm-navbar-search-input-placeholder-color:hsla(0,0%,100%,.5);color:var(--ifm-color-white)}.navbar--dark{--ifm-navbar-background-color:#242526;--ifm-menu-color-background-active:hsla(0,0%,100%,.05);--ifm-navbar-search-input-color:var(--ifm-color-white)}.navbar--primary{--ifm-navbar-background-color:var(--ifm-color-primary);--ifm-navbar-link-hover-color:var(--ifm-color-white);--ifm-menu-color-active:var(--ifm-color-white);--ifm-navbar-search-input-color:var(--ifm-color-emphasis-500)}.navbar__search-input{-webkit-appearance:none;appearance:none;background:var(--ifm-navbar-search-input-background-color) var(--ifm-navbar-search-input-icon) no-repeat .75rem center/1rem 1rem;border:none;border-radius:2rem;color:var(--ifm-navbar-search-input-color);cursor:text;display:inline-block;font-size:.9rem;height:2rem;padding:0 .5rem 0 2.25rem;width:12.5rem}.navbar__search-input::placeholder{color:var(--ifm-navbar-search-input-placeholder-color)}.navbar-sidebar{background-color:var(--ifm-navbar-background-color);box-shadow:var(--ifm-global-shadow-md);position:fixed;transform:translate3d(-100%,0,0);transition-property:opacity,visibility,transform;visibility:hidden;width:var(--ifm-navbar-sidebar-width)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar__items{transform:translateZ(0)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar--show .navbar-sidebar__backdrop{opacity:1;visibility:visible}.navbar-sidebar__backdrop{background-color:rgba(0,0,0,.6);position:fixed;right:0;transition-property:opacity,visibility;visibility:hidden}.navbar-sidebar__brand{align-items:center;box-shadow:var(--ifm-navbar-shadow);display:flex;flex:1;height:var(--ifm-navbar-height);padding:var(--ifm-navbar-padding-vertical) var(--ifm-navbar-padding-horizontal)}.navbar-sidebar__items{display:flex;height:calc(100% - var(--ifm-navbar-height));transition:transform var(--ifm-transition-fast) ease-in-out}.navbar-sidebar__items--show-secondary{transform:translate3d(calc((var(--ifm-navbar-sidebar-width))*-1),0,0)}.navbar-sidebar__item{flex-shrink:0;padding:.5rem;width:calc(var(--ifm-navbar-sidebar-width))}.navbar-sidebar__back{background:var(--ifm-menu-color-background-active);font-size:15px;font-weight:var(--ifm-button-font-weight);margin:0 0 .2rem -.5rem;padding:.6rem 1.5rem;position:relative;text-align:left;top:-.5rem;width:calc(100% + 1rem)}.navbar-sidebar__close{display:flex;margin-left:auto}.pagination{column-gap:var(--ifm-pagination-page-spacing);display:flex;font-size:var(--ifm-pagination-font-size);padding-left:0}.pagination--sm{--ifm-pagination-font-size:0.8rem;--ifm-pagination-padding-horizontal:0.8rem;--ifm-pagination-padding-vertical:0.2rem}.pagination--lg{--ifm-pagination-font-size:1.2rem;--ifm-pagination-padding-horizontal:1.2rem;--ifm-pagination-padding-vertical:0.3rem}.bp5-button-group,.pagination__item,.star-hint,.star-hint .star-wrapper{display:inline-flex}.pagination__item>span{padding:var(--ifm-pagination-padding-vertical)}.pagination__item--active .pagination__link{color:var(--ifm-pagination-color-active)}.pagination__item--active .pagination__link,.pagination__item:not(.pagination__item--active):hover .pagination__link{background:var(--ifm-pagination-item-active-background)}.pagination__item--disabled,.pagination__item[disabled]{opacity:.25;pointer-events:none}.pagination__link{border-radius:var(--ifm-pagination-border-radius);color:var(--ifm-font-color-base);display:inline-block;padding:var(--ifm-pagination-padding-vertical) var(--ifm-pagination-padding-horizontal);transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.bp5-breadcrumb:hover,.pagination__link:hover,.sidebarItemLink_ei87:hover{text-decoration:none}.pagination-nav{grid-gap:var(--ifm-spacing-horizontal);display:grid;gap:var(--ifm-spacing-horizontal);grid-template-columns:repeat(2,1fr)}.pagination-nav__link{border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-pagination-nav-border-radius);display:block;height:100%;line-height:var(--ifm-heading-line-height);padding:var(--ifm-global-spacing);transition:border-color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pagination-nav__link:hover{border-color:var(--ifm-pagination-nav-color-hover);text-decoration:none}.pagination-nav__link--next{grid-column:2/3;text-align:right}.pagination-nav__label{font-size:var(--ifm-h4-font-size);font-weight:var(--ifm-heading-font-weight);word-break:break-word}.pagination-nav__link--prev .pagination-nav__label:before{content:"« "}.pagination-nav__link--next .pagination-nav__label:after{content:" »"}.pagination-nav__sublabel{color:var(--ifm-color-content-secondary);font-size:var(--ifm-h5-font-size);font-weight:var(--ifm-font-weight-semibold);margin-bottom:.25rem}.pills__item,.tabs{font-weight:var(--ifm-font-weight-bold)}.pills{display:flex;gap:var(--ifm-pills-spacing);padding-left:0}.pills__item,video{display:inline-block}.pills__item{border-radius:.5rem;cursor:pointer;padding:.25rem 1rem;transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pills__item--active{color:var(--ifm-pills-color-active)}.pills__item--active,.pills__item:not(.pills__item--active):hover{background:var(--ifm-pills-color-background-active)}.pills--block{justify-content:stretch}.pills--block .pills__item{flex-grow:1;text-align:center}.tabs{color:var(--ifm-tabs-color);display:flex;margin-bottom:0;overflow-x:auto;padding-left:0}.bp5-dialog-header .bp5-heading,.bp5-drawer-header .bp5-heading,.bp5-text-overflow-ellipsis,.omnibar-item .description{word-wrap:normal;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.tabs__item{border-bottom:3px solid transparent;border-radius:var(--ifm-global-radius);cursor:pointer;display:inline-flex;padding:var(--ifm-tabs-padding-vertical) var(--ifm-tabs-padding-horizontal);transition:background-color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.tabs__item--active{border-bottom-color:var(--ifm-tabs-color-active-border);border-bottom-left-radius:0;border-bottom-right-radius:0;color:var(--ifm-tabs-color-active)}.tabs__item:hover{background-color:var(--ifm-hover-overlay)}.tabs--block{justify-content:stretch}.tabs--block .tabs__item{flex-grow:1;justify-content:center}html[data-theme=dark]{--ifm-color-scheme:dark;--ifm-color-emphasis-0:var(--ifm-color-gray-1000);--ifm-color-emphasis-100:var(--ifm-color-gray-900);--ifm-color-emphasis-200:var(--ifm-color-gray-800);--ifm-color-emphasis-300:var(--ifm-color-gray-700);--ifm-color-emphasis-400:var(--ifm-color-gray-600);--ifm-color-emphasis-600:var(--ifm-color-gray-400);--ifm-color-emphasis-700:var(--ifm-color-gray-300);--ifm-color-emphasis-800:var(--ifm-color-gray-200);--ifm-color-emphasis-900:var(--ifm-color-gray-100);--ifm-color-emphasis-1000:var(--ifm-color-gray-0);--ifm-background-color:#1b1b1d;--ifm-background-surface-color:#242526;--ifm-hover-overlay:hsla(0,0%,100%,.05);--ifm-color-content:#e3e3e3;--ifm-color-content-secondary:#fff;--ifm-breadcrumb-separator-filter:invert(64%) sepia(11%) saturate(0%) hue-rotate(149deg) brightness(99%) contrast(95%);--ifm-code-background:hsla(0,0%,100%,.1);--ifm-scrollbar-track-background-color:#444;--ifm-scrollbar-thumb-background-color:#686868;--ifm-scrollbar-thumb-hover-background-color:#7a7a7a;--ifm-table-stripe-background:hsla(0,0%,100%,.07);--ifm-toc-border-color:var(--ifm-color-emphasis-200);--ifm-color-primary-contrast-background:#102445;--ifm-color-primary-contrast-foreground:#ebf2fc;--ifm-color-secondary-contrast-background:#474748;--ifm-color-secondary-contrast-foreground:#fdfdfe;--ifm-color-success-contrast-background:#003100;--ifm-color-success-contrast-foreground:#e6f6e6;--ifm-color-info-contrast-background:#193c47;--ifm-color-info-contrast-foreground:#eef9fd;--ifm-color-warning-contrast-background:#4d3800;--ifm-color-warning-contrast-foreground:#fff8e6;--ifm-color-danger-contrast-background:#4b1113;--ifm-color-danger-contrast-foreground:#ffebec}#nprogress .bar{background:var(--docusaurus-progress-bar-color);height:2px;left:0;position:fixed;top:0;width:100%;z-index:1031}#nprogress .peg{box-shadow:0 0 10px var(--docusaurus-progress-bar-color),0 0 5px var(--docusaurus-progress-bar-color);height:100%;opacity:1;position:absolute;right:0;transform:rotate(3deg) translateY(-4px);width:100px}[data-theme=dark]{--ifm-color-primary:#25c2a0;--ifm-color-primary-dark:#21af90;--ifm-color-primary-darker:#1fa588;--ifm-color-primary-darkest:#1a8870;--ifm-color-primary-light:#29d5b0;--ifm-color-primary-lighter:#32d8b4;--ifm-color-primary-lightest:#4fddbf;--docusaurus-highlighted-code-line-bg:rgba(0,0,0,.3)}mark{background-color:#d7f0ff}video{height:100%;left:0;right:0;z-index:0}.videos-container{display:flex;filter:blur(1px);height:100%;object-fit:cover;opacity:.1;position:absolute}.bp5-button.bp5-loading,.bp5-callout,.bp5-control-group .bp5-button,.bp5-control-group .bp5-html-select,.bp5-control-group .bp5-input,.bp5-control-group .bp5-select,.react-resizable{position:relative}.bp5-control-group .bp5-input.bp5-disabled,.bp5-control-group .bp5-input:disabled,.bp5-control-group .bp5-input[readonly],.bp5-input-group>.bp5-icon,.bp5-input-group>.bp5-input-left-container,.bp5-slider-handle:focus,.container{z-index:1}*,:after,:before{box-sizing:inherit}body{color:#1c2127;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,blueprint-icons-16,sans-serif;font-weight:400;letter-spacing:0;text-transform:none}.bp5-heading,strong{font-weight:600}.bp5-text-small,small{font-size:12px}::selection{background:rgba(125,188,255,.6)}.bp5-breadcrumb,.bp5-breadcrumbs-collapsed,.bp5-button .bp5-icon,.bp5-button .bp5-icon-large,.bp5-button .bp5-icon-standard,.bp5-dark .bp5-tooltip .bp5-text-muted,.bp5-editable-text-placeholder>.bp5-editable-text-content,.bp5-html-select .bp5-icon,.bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:not(:hover):not(:focus),.bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:not(:hover):not(:focus) .bp5-icon,.bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:not(:hover):not(:focus) .bp5-icon-large,.bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:not(:hover):not(:focus) .bp5-icon-standard,.bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:not(:hover):not(:focus),.bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:not(:hover):not(:focus) .bp5-icon,.bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:not(:hover):not(:focus) .bp5-icon-large,.bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:not(:hover):not(:focus) .bp5-icon-standard,.bp5-input-group>.bp5-icon,.bp5-input-group>.bp5-input-left-container>.bp5-icon,.bp5-menu-item .bp5-menu-item-icon,.bp5-menu-item .bp5-menu-item-label,.bp5-menu-item .bp5-submenu-icon,.bp5-menu-item:before,.bp5-select .bp5-icon,.bp5-tag.bp5-minimal:not([class*=bp5-intent-]) .bp5-tag-remove,.bp5-text-muted,.bp5-tooltip.bp5-dark .bp5-text-muted,.bp5-tree .bp5-icon,.bp5-tree .bp5-icon-large,.bp5-tree .bp5-icon-standard{color:#5f6b7c}.bp5-text-disabled,a.bp5-button.bp5-disabled{color:rgba(95,107,124,.6)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary,.bp5-button.bp5-minimal.bp5-intent-primary,.bp5-button.bp5-outlined.bp5-intent-primary,.bp5-callout.bp5-intent-primary .bp5-heading,.bp5-callout.bp5-intent-primary>.bp5-icon:first-child,.bp5-callout.bp5-intent-primary[class*=bp5-icon-]:before,.bp5-form-group.bp5-intent-primary .bp5-form-group-sub-label,.bp5-form-group.bp5-intent-primary .bp5-form-helper-text,.bp5-html-select.bp5-minimal select.bp5-intent-primary,.bp5-icon-large.bp5-intent-primary,.bp5-icon-standard.bp5-intent-primary,.bp5-icon.bp5-intent-primary,.bp5-input-group.bp5-intent-primary>.bp5-icon,.bp5-select.bp5-minimal select.bp5-intent-primary,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-] .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-] .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover:before,a,a:hover{color:#215db0}.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]),.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-danger:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-success:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-warning:before,.bp5-dark a .bp5-icon,.bp5-dark a .bp5-icon-large,.bp5-dark a .bp5-icon-standard,.bp5-dark a code,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected .bp5-menu-item-label,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-danger .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-danger .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-danger:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-success .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-success .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-success:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-warning .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-warning .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-warning:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-] .bp5-menu-item-label,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active .bp5-menu-item-label,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover .bp5-menu-item-label,a .bp5-icon,a .bp5-icon-large,a .bp5-icon-standard,a code,a>.bp5-dark .bp5-code,a>.bp5-dark .bp5-running-text code{color:inherit}.bp5-code,.bp5-dark .bp5-tooltip .bp5-code,.bp5-dark .bp5-tooltip .bp5-running-text code,.bp5-running-text code,.bp5-tooltip.bp5-dark .bp5-code,.bp5-tooltip.bp5-dark .bp5-running-text code{background:hsla(0,0%,100%,.7);box-shadow:inset 0 0 0 1px rgba(17,20,24,.2);color:#5f6b7c}a>.bp5-code,a>.bp5-running-text code{color:#2d72d2}.bp5-code-block,.bp5-dark .bp5-tooltip .bp5-code-block,.bp5-dark .bp5-tooltip .bp5-running-text pre,.bp5-running-text pre,.bp5-tooltip.bp5-dark .bp5-code-block,.bp5-tooltip.bp5-dark .bp5-running-text pre{background:hsla(0,0%,100%,.7);box-shadow:inset 0 0 0 1px rgba(17,20,24,.15);color:#1c2127}.bp5-code-block>code,.bp5-dark .bp5-code-block>code,.bp5-dark .bp5-running-text pre>code,.bp5-dark .bp5-tooltip .bp5-code-block>code,.bp5-dark .bp5-tooltip .bp5-running-text pre>code,.bp5-running-text pre>code,.bp5-tooltip .bp5-code-block>code,.bp5-tooltip .bp5-running-text pre>code,.bp5-tooltip.bp5-dark .bp5-code-block>code,.bp5-tooltip.bp5-dark .bp5-running-text pre>code{background:none;box-shadow:none;color:inherit}.bp5-dark .bp5-tooltip .bp5-key,.bp5-dark .bp5-tooltip .bp5-running-text kbd,.bp5-key,.bp5-running-text kbd,.bp5-tooltip.bp5-dark .bp5-key,.bp5-tooltip.bp5-dark .bp5-running-text kbd{background:#fff;box-shadow:0 0 0 1px rgba(17,20,24,.1),0 1px 1px rgba(17,20,24,.2);color:#5f6b7c}.bp5-card,.bp5-elevation-0{box-shadow:0 0 0 1px rgba(17,20,24,.15)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success,.bp5-button.bp5-minimal.bp5-intent-success,.bp5-button.bp5-outlined.bp5-intent-success,.bp5-callout.bp5-intent-success .bp5-heading,.bp5-callout.bp5-intent-success>.bp5-icon:first-child,.bp5-callout.bp5-intent-success[class*=bp5-icon-]:before,.bp5-dark .bp5-tooltip .bp5-icon-large.bp5-intent-success,.bp5-dark .bp5-tooltip .bp5-icon-standard.bp5-intent-success,.bp5-dark .bp5-tooltip .bp5-icon.bp5-intent-success,.bp5-form-group.bp5-intent-success .bp5-form-group-sub-label,.bp5-form-group.bp5-intent-success .bp5-form-helper-text,.bp5-html-select.bp5-minimal select.bp5-intent-success,.bp5-icon-large.bp5-intent-success,.bp5-icon-standard.bp5-intent-success,.bp5-icon.bp5-intent-success,.bp5-input-group.bp5-intent-success>.bp5-icon,.bp5-menu-item.bp5-intent-success,.bp5-select.bp5-minimal select.bp5-intent-success,.bp5-tag.bp5-minimal.bp5-intent-success .bp5-tag-remove,.bp5-tooltip.bp5-dark .bp5-icon-large.bp5-intent-success,.bp5-tooltip.bp5-dark .bp5-icon-standard.bp5-intent-success,.bp5-tooltip.bp5-dark .bp5-icon.bp5-intent-success{color:#1c6e42}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning,.bp5-button.bp5-minimal.bp5-intent-warning,.bp5-button.bp5-outlined.bp5-intent-warning,.bp5-callout.bp5-intent-warning .bp5-heading,.bp5-callout.bp5-intent-warning>.bp5-icon:first-child,.bp5-callout.bp5-intent-warning[class*=bp5-icon-]:before,.bp5-dark .bp5-tooltip .bp5-icon-large.bp5-intent-warning,.bp5-dark .bp5-tooltip .bp5-icon-standard.bp5-intent-warning,.bp5-dark .bp5-tooltip .bp5-icon.bp5-intent-warning,.bp5-form-group.bp5-intent-warning .bp5-form-group-sub-label,.bp5-form-group.bp5-intent-warning .bp5-form-helper-text,.bp5-html-select.bp5-minimal select.bp5-intent-warning,.bp5-icon-large.bp5-intent-warning,.bp5-icon-standard.bp5-intent-warning,.bp5-icon.bp5-intent-warning,.bp5-input-group.bp5-intent-warning>.bp5-icon,.bp5-menu-item.bp5-intent-warning,.bp5-select.bp5-minimal select.bp5-intent-warning,.bp5-tag.bp5-minimal.bp5-intent-warning .bp5-tag-remove,.bp5-tooltip.bp5-dark .bp5-icon-large.bp5-intent-warning,.bp5-tooltip.bp5-dark .bp5-icon-standard.bp5-intent-warning,.bp5-tooltip.bp5-dark .bp5-icon.bp5-intent-warning{color:#935610}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger,.bp5-button.bp5-minimal.bp5-intent-danger,.bp5-callout.bp5-intent-danger .bp5-heading,.bp5-callout.bp5-intent-danger>.bp5-icon:first-child,.bp5-callout.bp5-intent-danger[class*=bp5-icon-]:before,.bp5-dark .bp5-tooltip .bp5-icon-large.bp5-intent-danger,.bp5-dark .bp5-tooltip .bp5-icon-standard.bp5-intent-danger,.bp5-dark .bp5-tooltip .bp5-icon.bp5-intent-danger,.bp5-form-group.bp5-intent-danger .bp5-form-group-sub-label,.bp5-form-group.bp5-intent-danger .bp5-form-helper-text,.bp5-html-select.bp5-minimal select.bp5-intent-danger,.bp5-icon-large.bp5-intent-danger,.bp5-icon-standard.bp5-intent-danger,.bp5-icon.bp5-intent-danger,.bp5-input-group.bp5-intent-danger>.bp5-icon,.bp5-menu-item.bp5-intent-danger,.bp5-select.bp5-minimal select.bp5-intent-danger,.bp5-tag.bp5-minimal.bp5-intent-danger .bp5-tag-remove,.bp5-tooltip.bp5-dark .bp5-icon-large.bp5-intent-danger,.bp5-tooltip.bp5-dark .bp5-icon-standard.bp5-intent-danger,.bp5-tooltip.bp5-dark .bp5-icon.bp5-intent-danger{color:#ac2f33}.bp5-heading{color:#1c2127;margin:0 0 10px;padding:0}.bp5-dark,.bp5-dark .bp5-breadcrumb-current,.bp5-dark .bp5-button:not([class*=bp5-intent-]).bp5-active,.bp5-dark .bp5-button:not([class*=bp5-intent-]):active,.bp5-dark .bp5-button:not([class*=bp5-intent-]):hover,.bp5-dark .bp5-control,.bp5-dark .bp5-dialog-step-viewed:not(.bp5-active) .bp5-dialog-step-title,.bp5-dark .bp5-file-input.bp5-file-input-has-selection .bp5-file-upload-input,.bp5-dark .bp5-heading,.bp5-dark .bp5-html-select .bp5-icon:hover,.bp5-dark .bp5-html-select select.bp5-active,.bp5-dark .bp5-html-select select:active,.bp5-dark .bp5-html-select select:hover,.bp5-dark .bp5-menu-header>h6,.bp5-dark .bp5-menu-item.bp5-active .bp5-menu-item-label,.bp5-dark .bp5-menu-item:active .bp5-menu-item-label,.bp5-dark .bp5-running-text h1,.bp5-dark .bp5-running-text h2,.bp5-dark .bp5-running-text h3,.bp5-dark .bp5-running-text h4,.bp5-dark .bp5-running-text h5,.bp5-dark .bp5-running-text h6,.bp5-dark .bp5-running-text table td,.bp5-dark .bp5-running-text table th,.bp5-dark .bp5-select .bp5-icon:hover,.bp5-dark .bp5-select select.bp5-active,.bp5-dark .bp5-select select:active,.bp5-dark .bp5-select select:hover,.bp5-dark .bp5-tab,.bp5-dark .bp5-tag-input .bp5-input-ghost,.bp5-dark .bp5-tree-node-caret:hover,.bp5-dark label.bp5-label,.bp5-dark table.bp5-html-table td,.bp5-dark table.bp5-html-table th,.bp5-running-text .bp5-dark table td,.bp5-running-text .bp5-dark table th,.bp5-tag-input.bp5-dark .bp5-input-ghost,.bp5-tooltip .bp5-heading,.bp5-tooltip .bp5-popover-content{color:#f6f7f9}.bp5-running-text h1,h1.bp5-heading{font-size:36px;line-height:40px}.bp5-running-text h2,h2.bp5-heading{font-size:28px;line-height:32px}.bp5-running-text h3,h3.bp5-heading{font-size:22px;line-height:25px}.bp5-running-text h4,h4.bp5-heading{font-size:18px;line-height:21px}.bp5-running-text h5,h5.bp5-heading{font-size:16px;line-height:19px}.bp5-running-text h6,h6.bp5-heading{font-size:14px;line-height:16px}.bp5-ui-text{font-size:14px;font-weight:400;letter-spacing:0;line-height:1.28581;text-transform:none}.bp5-running-text{font-size:14px;line-height:1.5}.bp5-running-text h1,.bp5-running-text h2,.bp5-running-text h3,.bp5-running-text h4,.bp5-running-text h5,.bp5-running-text h6{color:#1c2127;font-weight:600;margin-bottom:20px;margin-top:40px}.bp5-running-text hr{border:none;border-bottom:1px solid rgba(17,20,24,.15);margin:20px 0}.bp5-running-text p{margin:0 0 10px;padding:0}.bp5-control.bp5-large,.bp5-text-large{font-size:16px}a:hover{cursor:pointer}.bp5-code,.bp5-running-text code{border-radius:2px;font-size:smaller;padding:2px 5px}.bp5-code-block,.bp5-running-text pre{word-wrap:break-word;border-radius:2px;display:block;font-size:13px;line-height:1.4;margin:10px 0;padding:13px 15px 12px;word-break:break-all}.bp5-alert-contents,.bp5-toast-message{word-break:break-word}.bp5-code-block>code,.bp5-running-text pre>code{font-size:inherit;padding:0}.bp5-key,.bp5-running-text kbd{align-items:center;border-radius:2px;display:inline-flex;font-family:inherit;font-size:12px;height:24px;justify-content:center;line-height:24px;min-width:24px;padding:2px 4px;vertical-align:middle}.bp5-breadcrumb .bp5-icon,.bp5-key .bp5-icon,.bp5-key .bp5-icon-large,.bp5-key .bp5-icon-standard,.bp5-key-combo:before,.bp5-key-combo>*,.bp5-running-text kbd .bp5-icon,.bp5-running-text kbd .bp5-icon-large,.bp5-running-text kbd .bp5-icon-standard,.bp5-tag-input .bp5-tag-input-values:before,.bp5-tag-input .bp5-tag-input-values>*,.fib-btn,input.input{margin-right:5px}.bp5-blockquote,.bp5-running-text blockquote{border-left:4px solid rgba(171,179,191,.5);margin:0 0 10px;padding:0 20px}.bp5-dark .bp5-blockquote,.bp5-dark .bp5-running-text blockquote,.bp5-running-text .bp5-dark blockquote{border-color:rgba(115,128,145,.5)}.bp5-list,.bp5-running-text ol,.bp5-running-text ul{margin:10px 0;padding-left:30px}.bp5-form-group .bp5-form-group-sub-label,.bp5-form-group label.bp5-label,.bp5-list li:not(:last-child),.bp5-running-text ol li:not(:last-child),.bp5-running-text ul li:not(:last-child){margin-bottom:5px}.bp5-form-group .bp5-form-helper-text,.bp5-label .bp5-menu,.bp5-list ol,.bp5-list ul,.bp5-running-text ol ol,.bp5-running-text ol ul,.bp5-running-text ul ol,.bp5-running-text ul ul,label.bp5-label .bp5-button-group,label.bp5-label .bp5-control-group{margin-top:5px}.bp5-list-unstyled,.output-jsx>main ul,.output-log>main ul{list-style:none;margin:0;padding:0}.bp5-dark{color-scheme:dark}.bp5-dark .bp5-breadcrumb,.bp5-dark .bp5-breadcrumbs-collapsed,.bp5-dark .bp5-button:not([class*=bp5-intent-]) .bp5-icon-large:not([class*=bp5-intent-]),.bp5-dark .bp5-button:not([class*=bp5-intent-]) .bp5-icon-standard:not([class*=bp5-intent-]),.bp5-dark .bp5-button:not([class*=bp5-intent-]) .bp5-icon:not([class*=bp5-intent-]),.bp5-dark .bp5-button:not([class*=bp5-intent-])[class*=bp5-icon-]:before,.bp5-dark .bp5-callout.bp5-callout-icon>.bp5-icon:first-child,.bp5-dark .bp5-callout[class*=bp5-icon-]:before,.bp5-dark .bp5-dialog-header .bp5-icon,.bp5-dark .bp5-dialog-header .bp5-icon-large,.bp5-dark .bp5-drawer-header .bp5-icon,.bp5-dark .bp5-drawer-header .bp5-icon-large,.bp5-dark .bp5-editable-text-placeholder>.bp5-editable-text-content,.bp5-dark .bp5-text-muted{color:#abb3bf}.bp5-dark .bp5-breadcrumb.bp5-disabled,.bp5-dark .bp5-control.bp5-disabled,.bp5-dark .bp5-dialog-step-title,.bp5-dark .bp5-html-select option:disabled,.bp5-dark .bp5-input-group.bp5-disabled .bp5-icon,.bp5-dark .bp5-select option:disabled,.bp5-dark .bp5-tab[aria-disabled=true],.bp5-dark .bp5-text-disabled,.bp5-dark label.bp5-label.bp5-disabled,.bp5-dark label.bp5-label.bp5-disabled .bp5-text-muted,.bp5-tooltip .bp5-text-disabled{color:rgba(171,179,191,.6)}.bp5-dark .bp5-divider,.bp5-dark .bp5-menu-divider,.bp5-dark .bp5-menu-header,.bp5-dark .bp5-running-text hr,.bp5-tooltip .bp5-running-text hr{border-color:hsla(0,0%,100%,.2)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-primary,.bp5-dark .bp5-callout.bp5-intent-primary .bp5-heading,.bp5-dark .bp5-callout.bp5-intent-primary>.bp5-icon:first-child,.bp5-dark .bp5-callout.bp5-intent-primary[class*=bp5-icon-]:before,.bp5-dark .bp5-icon-large.bp5-intent-primary,.bp5-dark .bp5-icon-standard.bp5-intent-primary,.bp5-dark .bp5-icon.bp5-intent-primary,.bp5-dark a,.bp5-dark a:hover{color:#8abbff}.bp5-dark .bp5-code,.bp5-dark .bp5-running-text code,.bp5-tooltip .bp5-code,.bp5-tooltip .bp5-running-text code{background:rgba(17,20,24,.3);box-shadow:inset 0 0 0 1px rgba(17,20,24,.4);color:#abb3bf}.bp5-dark .bp5-code-block,.bp5-dark .bp5-running-text pre,.bp5-tooltip .bp5-code-block,.bp5-tooltip .bp5-running-text pre{background:rgba(17,20,24,.3);box-shadow:inset 0 0 0 1px rgba(17,20,24,.4);color:#f6f7f9}.bp5-dark .bp5-key,.bp5-dark .bp5-running-text kbd,.bp5-tooltip .bp5-key,.bp5-tooltip .bp5-running-text kbd{background:#383e47;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 1px 1px 0 rgba(17,20,24,.4);color:#abb3bf}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-success,.bp5-dark .bp5-callout.bp5-intent-success .bp5-heading,.bp5-dark .bp5-callout.bp5-intent-success>.bp5-icon:first-child,.bp5-dark .bp5-callout.bp5-intent-success[class*=bp5-icon-]:before,.bp5-dark .bp5-icon-large.bp5-intent-success,.bp5-dark .bp5-icon-standard.bp5-intent-success,.bp5-dark .bp5-icon.bp5-intent-success{color:#72ca9b}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-warning,.bp5-dark .bp5-callout.bp5-intent-warning .bp5-heading,.bp5-dark .bp5-callout.bp5-intent-warning>.bp5-icon:first-child,.bp5-dark .bp5-callout.bp5-intent-warning[class*=bp5-icon-]:before,.bp5-dark .bp5-icon-large.bp5-intent-warning,.bp5-dark .bp5-icon-standard.bp5-intent-warning,.bp5-dark .bp5-icon.bp5-intent-warning{color:#fbb360}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-danger,.bp5-dark .bp5-callout.bp5-intent-danger .bp5-heading,.bp5-dark .bp5-callout.bp5-intent-danger>.bp5-icon:first-child,.bp5-dark .bp5-callout.bp5-intent-danger[class*=bp5-icon-]:before,.bp5-dark .bp5-icon-large.bp5-intent-danger,.bp5-dark .bp5-icon-standard.bp5-intent-danger,.bp5-dark .bp5-icon.bp5-intent-danger{color:#fa999c}:focus{-moz-outline-radius:6px;outline:rgba(45,114,210,.6) solid 2px;outline-offset:2px}.bp5-focus-disabled :focus:not(.bp5-focus-style-manager-ignore *),.bp5-focus-disabled :focus:not(.bp5-focus-style-manager-ignore *)~.bp5-control-indicator,.bp5-input-ghost:focus{outline:0!important}.bp5-alert{max-width:400px;padding:20px}.bp5-alert-body .bp5-icon{font-size:40px;margin-right:20px;margin-top:0}.bp5-alert-footer{display:flex;flex-direction:row-reverse;margin-top:10px}.bp5-alert-footer .bp5-button,.bp5-dialog-footer-actions .bp5-button{margin-left:10px}.bp5-breadcrumbs{cursor:default;flex-wrap:wrap;height:30px;list-style:none;margin:0;padding:0}.bp5-breadcrumbs,.bp5-breadcrumbs>li,.bp5-tree-node-secondary-label .bp5-popover-target,.bp5-tree-node-secondary-label .bp5-popover-wrapper{align-items:center;display:flex}.bp5-breadcrumbs>li:after{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='m10.71 7.29-4-4a1.003 1.003 0 0 0-1.42 1.42L8.59 8 5.3 11.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71l4-4c.18-.18.29-.43.29-.71 0-.28-.11-.53-.29-.71z' fill='%235f6b7c'/%3E%3C/svg%3E");content:"";display:block;height:16px;margin:0 5px;width:16px}.bp5-breadcrumbs>li:last-of-type:after,.bp5-collapse .bp5-collapse-body[aria-hidden=true]{display:none}.bp5-breadcrumb,.bp5-breadcrumb-current,.bp5-breadcrumbs-collapsed{align-items:center;display:inline-flex;font-size:16px}.bp5-breadcrumb.bp5-disabled,.bp5-control.bp5-disabled,.bp5-tab[aria-disabled=true],.bp5-tree-node.bp5-disabled .bp5-tree-node-caret,.bp5-tree-node.bp5-disabled .bp5-tree-node-icon{color:rgba(95,107,124,.6);cursor:not-allowed}.bp5-breadcrumb-current{color:inherit;font-weight:600}.bp5-breadcrumb-current .bp5-input{font-size:inherit;font-weight:inherit;vertical-align:baseline}.bp5-breadcrumbs-collapsed{background:rgba(143,153,168,.15);border:none;border-radius:2px;cursor:pointer;margin-right:2px;padding:1px 5px;vertical-align:text-bottom}.bp5-breadcrumbs-collapsed:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 6.03a2 2 0 1 0 0 4 2 2 0 1 0 0-4zm12 0a2 2 0 1 0 0 4 2 2 0 1 0 0-4zm-6 0a2 2 0 1 0 0 4 2 2 0 1 0 0-4z' fill='%235f6b7c'/%3E%3C/svg%3E") 50% no-repeat;content:"";display:block;height:16px;width:16px}.bp5-breadcrumbs-collapsed:hover{background:rgba(143,153,168,.3);color:#1c2127;text-decoration:none}.bp5-dark .bp5-breadcrumbs>li:after{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='m10.71 7.29-4-4a1.003 1.003 0 0 0-1.42 1.42L8.59 8 5.3 11.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71l4-4c.18-.18.29-.43.29-.71 0-.28-.11-.53-.29-.71z' fill='%23abb3bf'/%3E%3C/svg%3E");color:#abb3bf}.bp5-dark .bp5-breadcrumbs-collapsed{background:rgba(143,153,168,.2)}.bp5-dark .bp5-breadcrumbs-collapsed:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 6.03a2 2 0 1 0 0 4 2 2 0 1 0 0-4zm12 0a2 2 0 1 0 0 4 2 2 0 1 0 0-4zm-6 0a2 2 0 1 0 0 4 2 2 0 1 0 0-4z' fill='%23abb3bf'/%3E%3C/svg%3E") 50% no-repeat}.bp5-dark .bp5-breadcrumbs-collapsed:hover{background:rgba(143,153,168,.3);color:#f6f7f9}.bp5-button{align-items:center;border:none;border-radius:2px;cursor:pointer;display:inline-flex;flex-direction:row;font-size:14px;justify-content:center;min-height:30px;min-width:30px;padding:5px 10px;text-align:left;vertical-align:middle}.bp5-button>*,.bp5-control-group>*,.bp5-html-select select>*,.bp5-key-combo>*,.bp5-menu-item>*,.bp5-select select>*,.bp5-tag-input>*,.bp5-tag>*{flex-grow:0;flex-shrink:0}.bp5-button>.bp5-fill,.bp5-control-group>.bp5-fill,.bp5-html-select select>.bp5-fill,.bp5-key-combo>.bp5-fill,.bp5-non-ideal-state.bp5-non-ideal-state-horizontal>.bp5-fill,.bp5-non-ideal-state>.bp5-fill,.bp5-select select>.bp5-fill,.bp5-tag-input .bp5-tag-input-values>.bp5-fill,.bp5-tag-input>.bp5-tag-input-values,.bp5-tag>.bp5-fill{flex-grow:1;flex-shrink:1}.bp5-button:before,.bp5-button>*,.bp5-html-select select:before,.bp5-html-select select>*,.bp5-large .bp5-tag:before,.bp5-large .bp5-tag>*,.bp5-menu-item:before,.bp5-menu-item>*,.bp5-select select:before,.bp5-select select>*,.bp5-tab-icon,.bp5-tag.bp5-large:before,.bp5-tag.bp5-large>*{margin-right:7px}.bp5-button.bp5-large:empty:before,.bp5-button.bp5-large>:last-child,.bp5-button:empty:before,.bp5-button>:last-child,.bp5-html-select select:empty:before,.bp5-html-select select>:last-child,.bp5-key-combo:empty:before,.bp5-key-combo>:last-child,.bp5-large .bp5-button:empty:before,.bp5-large .bp5-button>:last-child,.bp5-large .bp5-tag:empty:before,.bp5-large .bp5-tag>:last-child,.bp5-menu-item:empty:before,.bp5-menu-item>:last-child,.bp5-non-ideal-state.bp5-non-ideal-state-horizontal:empty:before,.bp5-non-ideal-state.bp5-non-ideal-state-horizontal>:last-child,.bp5-select select:empty:before,.bp5-select select>:last-child,.bp5-tag-input .bp5-tag-input-values:empty:before,.bp5-tag-input .bp5-tag-input-values>:last-child,.bp5-tag-input.bp5-large:empty:before,.bp5-tag-input.bp5-large>:last-child,.bp5-tag.bp5-large:empty:before,.bp5-tag.bp5-large>:last-child,.bp5-tag:empty:before,.bp5-tag>:last-child{margin-right:0}.bp5-button.bp5-disabled,.bp5-button:disabled,.bp5-input-group.bp5-disabled,.bp5-tag-input .bp5-input-ghost.bp5-disabled,.bp5-tag-input .bp5-input-ghost:disabled,.toggleButtonDisabled_FVOf{cursor:not-allowed}.bp5-button-group.bp5-fill,.bp5-button.bp5-fill,.bp5-tag.bp5-fill,.docMainContainer_L3kR,.docPage_ShNT{display:flex;width:100%}.bp5-button:not([class*=bp5-intent-]){background-color:#f6f7f9;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.1);color:#1c2127}.bp5-button:not([class*=bp5-intent-]):hover,.bp5-html-select select:hover,.bp5-select select:hover{background-clip:padding-box;background-color:#edeff2;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button:not([class*=bp5-intent-]).bp5-active,.bp5-button:not([class*=bp5-intent-]):active,.bp5-html-select select.bp5-active,.bp5-html-select select:active,.bp5-select select.bp5-active,.bp5-select select:active,.bp5-slider-handle.bp5-active,.bp5-slider-handle:active{background-color:#dce0e5;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button:not([class*=bp5-intent-]).bp5-disabled,.bp5-button:not([class*=bp5-intent-]):disabled,.bp5-file-input input.bp5-disabled+.bp5-file-upload-input:after,.bp5-file-input input:disabled+.bp5-file-upload-input:after,.bp5-html-select select.bp5-disabled,.bp5-html-select select:disabled,.bp5-select select.bp5-disabled,.bp5-select select:disabled,.bp5-slider-handle.bp5-disabled,.bp5-slider-handle:disabled{background-color:rgba(211,216,222,.5);box-shadow:none;color:rgba(95,107,124,.6);cursor:not-allowed;outline:0}.bp5-button.bp5-intent-danger,.bp5-button.bp5-intent-primary,.bp5-button.bp5-intent-success,.bp5-button.bp5-intent-warning,.bp5-file-upload-input:after,.bp5-html-select select,.bp5-select select{box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.1)}.bp5-button:not([class*=bp5-intent-]).bp5-disabled.bp5-active,.bp5-button:not([class*=bp5-intent-]).bp5-disabled.bp5-active:hover,.bp5-button:not([class*=bp5-intent-]):disabled.bp5-active,.bp5-button:not([class*=bp5-intent-]):disabled.bp5-active:hover{background:rgba(211,216,222,.7)}.bp5-button.bp5-intent-primary{background-color:#2d72d2;color:#fff}.add-node-menu-list-item.selected:not(:hover) .source,.bp5-button.bp5-intent-danger.bp5-active,.bp5-button.bp5-intent-danger:active,.bp5-button.bp5-intent-danger:hover,.bp5-button.bp5-intent-primary.bp5-active,.bp5-button.bp5-intent-primary:active,.bp5-button.bp5-intent-primary:hover,.bp5-button.bp5-intent-success.bp5-active,.bp5-button.bp5-intent-success:active,.bp5-button.bp5-intent-success:hover,.bp5-button.bp5-intent-warning.bp5-active,.bp5-button.bp5-intent-warning:active,.bp5-button.bp5-intent-warning:hover,.bp5-dark .bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content .bp5-icon,.bp5-dark .bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content .bp5-icon-large,.bp5-dark .bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content .bp5-icon-standard,.bp5-tag-remove:active,.bp5-tag-remove:hover,.bp5-tag.bp5-intent-danger .bp5-tag-remove:active,.bp5-tag.bp5-intent-danger .bp5-tag-remove:hover,.bp5-tag.bp5-intent-primary .bp5-tag-remove:active,.bp5-tag.bp5-intent-primary .bp5-tag-remove:hover,.bp5-tag.bp5-intent-success .bp5-tag-remove:active,.bp5-tag.bp5-intent-success .bp5-tag-remove:hover,.bp5-toast[class*=bp5-intent-] a:hover,.bp5-toast[class*=bp5-intent-]>.bp5-icon,.bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content,.bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content .bp5-icon,.bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content .bp5-icon-large,.bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content .bp5-icon-standard,.bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content .bp5-tree-node-caret:hover:before{color:#fff}.bp5-button.bp5-intent-primary:hover{background-color:#215db0;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button.bp5-intent-primary.bp5-active,.bp5-button.bp5-intent-primary:active{background-color:#184a90;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button.bp5-intent-primary.bp5-disabled,.bp5-button.bp5-intent-primary:disabled{background-color:rgba(45,114,210,.5);border-color:transparent;box-shadow:none;color:hsla(0,0%,100%,.6)}.bp5-button.bp5-intent-success{background-color:#238551;color:#fff}.bp5-button.bp5-intent-success:hover{background-color:#1c6e42;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button.bp5-intent-success.bp5-active,.bp5-button.bp5-intent-success:active{background-color:#165a36;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button.bp5-intent-success.bp5-disabled,.bp5-button.bp5-intent-success:disabled{background-color:rgba(35,133,81,.5);border-color:transparent;box-shadow:none;color:hsla(0,0%,100%,.6)}.bp5-button.bp5-intent-warning:hover{background-color:#935610;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button.bp5-intent-warning.bp5-active,.bp5-button.bp5-intent-warning:active{background-color:#77450d;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button.bp5-intent-warning.bp5-disabled,.bp5-button.bp5-intent-warning:disabled{border-color:transparent;box-shadow:none}.bp5-button.bp5-intent-danger{background-color:#cd4246;color:#fff}.bp5-button.bp5-intent-danger:hover{background-color:#ac2f33;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button.bp5-intent-danger.bp5-active,.bp5-button.bp5-intent-danger:active{background-color:#8e292c;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-button.bp5-intent-danger.bp5-disabled,.bp5-button.bp5-intent-danger:disabled{background-color:rgba(205,66,70,.5);border-color:transparent;box-shadow:none;color:hsla(0,0%,100%,.6)}.bp5-button[class*=bp5-intent-] .bp5-button-spinner .bp5-spinner-head{stroke:#fff}.bp5-button.bp5-large,.bp5-large .bp5-button{font-size:16px;min-height:40px;min-width:40px;padding:5px 15px}.bp5-button.bp5-large:before,.bp5-button.bp5-large>*,.bp5-large .bp5-button:before,.bp5-large .bp5-button>*,.bp5-tag-input.bp5-large:before,.bp5-tag-input.bp5-large>*{margin-right:10px}.bp5-button.bp5-small,.bp5-small .bp5-button,.bp5-tag-input .bp5-button{min-height:24px;min-width:24px;padding:0 7px}.bp5-button.bp5-loading>:not(.bp5-button-spinner),.bp5-button.bp5-loading[class*=bp5-icon-]:before{visibility:hidden}.bp5-button.bp5-loading .bp5-button-spinner{margin:0;position:absolute}.bp5-button[class*=bp5-icon-]:before{color:#5f6b7c;font-size:16px;font-weight:400;height:16px;width:16px}.bp5-button .bp5-icon-large.bp5-align-right,.bp5-button .bp5-icon-standard.bp5-align-right,.bp5-button .bp5-icon.bp5-align-right,.bp5-tab-tag{margin-left:7px}.bp5-button .bp5-icon:first-child:last-child,.bp5-button .bp5-spinner+.bp5-icon:last-child{margin:0 -7px}.bp5-dark .bp5-button:not([class*=bp5-intent-]),.bp5-dark .bp5-file-upload-input:after,.bp5-dark .bp5-html-select select,.bp5-dark .bp5-select select{background-color:#383e47;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1),0 1px 2px rgba(17,20,24,.2);color:#f6f7f9}.bp5-dark .bp5-button:not([class*=bp5-intent-]):hover,.bp5-dark .bp5-file-upload-input:hover:after,.bp5-dark .bp5-html-select select:hover,.bp5-dark .bp5-select select:hover{background-color:#2f343c;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1),0 1px 2px rgba(17,20,24,.4)}.bp5-dark .bp5-button:not([class*=bp5-intent-]).bp5-active,.bp5-dark .bp5-button:not([class*=bp5-intent-]):active,.bp5-dark .bp5-file-upload-input:active:after,.bp5-dark .bp5-html-select select.bp5-active,.bp5-dark .bp5-html-select select:active,.bp5-dark .bp5-select select.bp5-active,.bp5-dark .bp5-select select:active{background-color:#1c2127;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1),0 1px 2px rgba(17,20,24,.4)}.bp5-dark .bp5-button:not([class*=bp5-intent-]).bp5-disabled,.bp5-dark .bp5-button:not([class*=bp5-intent-]):disabled,.bp5-dark .bp5-file-input input.bp5-disabled+.bp5-file-upload-input:after,.bp5-dark .bp5-file-input input:disabled+.bp5-file-upload-input:after,.bp5-dark .bp5-html-select select.bp5-disabled,.bp5-dark .bp5-html-select select:disabled,.bp5-dark .bp5-select select.bp5-disabled,.bp5-dark .bp5-select select:disabled{background-color:rgba(64,72,84,.5);box-shadow:none;color:rgba(171,179,191,.6)}.bp5-dark .bp5-button:not([class*=bp5-intent-]).bp5-disabled.bp5-active,.bp5-dark .bp5-button:not([class*=bp5-intent-]):disabled.bp5-active{background:rgba(64,72,84,.7)}.bp5-dark .bp5-button:not([class*=bp5-intent-]) .bp5-button-spinner .bp5-spinner-head,.bp5-dark .bp5-html-select select .bp5-button-spinner .bp5-spinner-head,.bp5-dark .bp5-select select .bp5-button-spinner .bp5-spinner-head{stroke:#8f99a8;background:rgba(17,20,24,.5)}.bp5-dark .bp5-button[class*=bp5-intent-],.bp5-dark .bp5-button[class*=bp5-intent-]:hover{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1),0 1px 2px rgba(17,20,24,.2)}.bp5-dark .bp5-button[class*=bp5-intent-].bp5-active,.bp5-dark .bp5-button[class*=bp5-intent-]:active{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1),0 1px 2px rgba(17,20,24,.4)}.bp5-dark .bp5-button[class*=bp5-intent-].bp5-disabled,.bp5-dark .bp5-button[class*=bp5-intent-]:disabled{box-shadow:none;color:hsla(0,0%,100%,.3)}.bp5-dark .bp5-button[class*=bp5-intent-] .bp5-button-spinner .bp5-spinner-head,.bp5-dark .bp5-spinner .bp5-spinner-head{stroke:#8f99a8}.bp5-button.bp5-disabled .bp5-icon,.bp5-button.bp5-disabled .bp5-icon-large,.bp5-button.bp5-disabled .bp5-icon-standard,.bp5-button.bp5-disabled:before,.bp5-button:disabled .bp5-icon,.bp5-button:disabled .bp5-icon-large,.bp5-button:disabled .bp5-icon-standard,.bp5-button:disabled:before,.bp5-button[class*=bp5-intent-] .bp5-icon,.bp5-button[class*=bp5-intent-] .bp5-icon-large,.bp5-button[class*=bp5-intent-] .bp5-icon-standard,.bp5-button[class*=bp5-intent-]:before{color:inherit!important}.bp5-button-group.bp5-minimal .bp5-button,.bp5-button.bp5-minimal,.bp5-html-select.bp5-minimal select,.bp5-select.bp5-minimal select{background:none;box-shadow:none}.bp5-button-group.bp5-minimal .bp5-button:hover,.bp5-button.bp5-minimal:hover,.bp5-button.bp5-outlined:hover,.bp5-html-select.bp5-minimal select:hover,.bp5-select.bp5-minimal select:hover{background:rgba(143,153,168,.15);box-shadow:none;color:#1c2127;text-decoration:none}.bp5-button-group.bp5-minimal .bp5-button.bp5-active,.bp5-button-group.bp5-minimal .bp5-button:active,.bp5-button.bp5-minimal.bp5-active,.bp5-button.bp5-minimal:active,.bp5-button.bp5-outlined.bp5-active,.bp5-button.bp5-outlined:active,.bp5-html-select.bp5-minimal select.bp5-active,.bp5-html-select.bp5-minimal select:active,.bp5-select.bp5-minimal select.bp5-active,.bp5-select.bp5-minimal select:active{background:rgba(143,153,168,.3);box-shadow:none;color:#1c2127}.bp5-button-group.bp5-minimal .bp5-button.bp5-disabled,.bp5-button-group.bp5-minimal .bp5-button.bp5-disabled:hover,.bp5-button-group.bp5-minimal .bp5-button:disabled,.bp5-button-group.bp5-minimal .bp5-button:disabled:hover,.bp5-button.bp5-minimal.bp5-disabled,.bp5-button.bp5-minimal.bp5-disabled:hover,.bp5-button.bp5-minimal:disabled,.bp5-button.bp5-minimal:disabled:hover,.bp5-html-select.bp5-minimal select.bp5-disabled,.bp5-html-select.bp5-minimal select:disabled,.bp5-select.bp5-minimal select.bp5-disabled,.bp5-select.bp5-minimal select:disabled{background:none;color:rgba(95,107,124,.6);cursor:not-allowed}.bp5-button.bp5-minimal.bp5-disabled.bp5-active,.bp5-button.bp5-minimal.bp5-disabled:hover.bp5-active,.bp5-button.bp5-minimal:disabled.bp5-active,.bp5-button.bp5-minimal:disabled:hover.bp5-active{background:rgba(143,153,168,.3)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button:active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button:hover,.bp5-dark .bp5-button.bp5-minimal,.bp5-dark .bp5-button.bp5-minimal.bp5-active,.bp5-dark .bp5-button.bp5-minimal:active,.bp5-dark .bp5-button.bp5-minimal:hover,.bp5-dark .bp5-button.bp5-outlined,.bp5-dark .bp5-button.bp5-outlined.bp5-active,.bp5-dark .bp5-button.bp5-outlined:active,.bp5-dark .bp5-button.bp5-outlined:hover,.bp5-dark .bp5-html-select.bp5-minimal select,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select:active,.bp5-dark .bp5-html-select.bp5-minimal select:hover,.bp5-dark .bp5-select.bp5-minimal select,.bp5-dark .bp5-select.bp5-minimal select.bp5-active,.bp5-dark .bp5-select.bp5-minimal select:active,.bp5-dark .bp5-select.bp5-minimal select:hover,.bp5-html-select.bp5-minimal .bp5-dark select,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select:active,.bp5-html-select.bp5-minimal .bp5-dark select:hover,.bp5-select.bp5-minimal .bp5-dark select,.bp5-select.bp5-minimal .bp5-dark select.bp5-active,.bp5-select.bp5-minimal .bp5-dark select:active,.bp5-select.bp5-minimal .bp5-dark select:hover{background:none;box-shadow:none;color:#fff}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button:hover,.bp5-dark .bp5-button.bp5-minimal:hover,.bp5-dark .bp5-button.bp5-outlined:hover,.bp5-dark .bp5-html-select.bp5-minimal select:hover,.bp5-dark .bp5-select.bp5-minimal select:hover,.bp5-html-select.bp5-minimal .bp5-dark select:hover,.bp5-select.bp5-minimal .bp5-dark select:hover,table.bp5-html-table.bp5-html-table-striped tbody tr:nth-child(odd) td{background:rgba(143,153,168,.15)}.bp5-dark .bp5-button.bp5-minimal.bp5-active,.bp5-dark .bp5-button.bp5-minimal:active{background:rgba(143,153,168,.3)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-disabled,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-disabled:hover,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button:disabled,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button:disabled:hover,.bp5-dark .bp5-button.bp5-minimal.bp5-disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-disabled:hover,.bp5-dark .bp5-button.bp5-minimal:disabled,.bp5-dark .bp5-button.bp5-minimal:disabled:hover,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-disabled,.bp5-dark .bp5-html-select.bp5-minimal select:disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-disabled,.bp5-dark .bp5-select.bp5-minimal select:disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-disabled,.bp5-html-select.bp5-minimal .bp5-dark select:disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-disabled,.bp5-select.bp5-minimal .bp5-dark select:disabled{background:none;color:rgba(171,179,191,.6);cursor:not-allowed}.bp5-dark .bp5-button.bp5-minimal.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-disabled:hover.bp5-active,.bp5-dark .bp5-button.bp5-minimal:disabled.bp5-active,.bp5-dark .bp5-button.bp5-minimal:disabled:hover.bp5-active{background:rgba(143,153,168,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:hover,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:hover,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:hover,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:hover,.bp5-button.bp5-minimal.bp5-intent-danger.bp5-active,.bp5-button.bp5-minimal.bp5-intent-danger:active,.bp5-button.bp5-minimal.bp5-intent-danger:hover,.bp5-button.bp5-minimal.bp5-intent-primary.bp5-active,.bp5-button.bp5-minimal.bp5-intent-primary:active,.bp5-button.bp5-minimal.bp5-intent-primary:hover,.bp5-button.bp5-minimal.bp5-intent-success.bp5-active,.bp5-button.bp5-minimal.bp5-intent-success:active,.bp5-button.bp5-minimal.bp5-intent-success:hover,.bp5-button.bp5-minimal.bp5-intent-warning.bp5-active,.bp5-button.bp5-minimal.bp5-intent-warning:active,.bp5-button.bp5-minimal.bp5-intent-warning:hover,.bp5-button.bp5-outlined.bp5-intent-danger.bp5-active,.bp5-button.bp5-outlined.bp5-intent-danger:active,.bp5-button.bp5-outlined.bp5-intent-danger:hover,.bp5-button.bp5-outlined.bp5-intent-primary.bp5-active,.bp5-button.bp5-outlined.bp5-intent-primary:active,.bp5-button.bp5-outlined.bp5-intent-primary:hover,.bp5-button.bp5-outlined.bp5-intent-success.bp5-active,.bp5-button.bp5-outlined.bp5-intent-success:active,.bp5-button.bp5-outlined.bp5-intent-success:hover,.bp5-button.bp5-outlined.bp5-intent-warning.bp5-active,.bp5-button.bp5-outlined.bp5-intent-warning:active,.bp5-button.bp5-outlined.bp5-intent-warning:hover,.bp5-dark .bp5-editable-text.bp5-disabled:before,.bp5-dark .bp5-input-group.bp5-intent-danger .bp5-input.bp5-disabled,.bp5-dark .bp5-input-group.bp5-intent-danger .bp5-input:disabled,.bp5-dark .bp5-input-group.bp5-intent-primary .bp5-input.bp5-disabled,.bp5-dark .bp5-input-group.bp5-intent-primary .bp5-input:disabled,.bp5-dark .bp5-input-group.bp5-intent-success .bp5-input.bp5-disabled,.bp5-dark .bp5-input-group.bp5-intent-success .bp5-input:disabled,.bp5-dark .bp5-input-group.bp5-intent-warning .bp5-input.bp5-disabled,.bp5-dark .bp5-input-group.bp5-intent-warning .bp5-input:disabled,.bp5-dark .bp5-input.bp5-intent-danger.bp5-disabled,.bp5-dark .bp5-input.bp5-intent-danger:disabled,.bp5-dark .bp5-input.bp5-intent-primary.bp5-disabled,.bp5-dark .bp5-input.bp5-intent-primary:disabled,.bp5-dark .bp5-input.bp5-intent-success.bp5-disabled,.bp5-dark .bp5-input.bp5-intent-success:disabled,.bp5-dark .bp5-input.bp5-intent-warning.bp5-disabled,.bp5-dark .bp5-input.bp5-intent-warning:disabled,.bp5-dark .bp5-submenu.bp5-popover,.bp5-dark table.bp5-html-table.bp5-html-table-bordered.bp5-html-table-striped tbody tr:not(:first-child) td:first-child,.bp5-disabled .bp5-slider-handle .bp5-slider-label,.bp5-html-select.bp5-minimal select.bp5-intent-danger.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-danger:active,.bp5-html-select.bp5-minimal select.bp5-intent-danger:hover,.bp5-html-select.bp5-minimal select.bp5-intent-primary.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-primary:active,.bp5-html-select.bp5-minimal select.bp5-intent-primary:hover,.bp5-html-select.bp5-minimal select.bp5-intent-success.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-success:active,.bp5-html-select.bp5-minimal select.bp5-intent-success:hover,.bp5-html-select.bp5-minimal select.bp5-intent-warning.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-warning:active,.bp5-html-select.bp5-minimal select.bp5-intent-warning:hover,.bp5-input-group.bp5-intent-danger .bp5-input.bp5-disabled,.bp5-input-group.bp5-intent-danger .bp5-input:disabled,.bp5-input-group.bp5-intent-primary .bp5-input.bp5-disabled,.bp5-input-group.bp5-intent-primary .bp5-input:disabled,.bp5-input-group.bp5-intent-success .bp5-input.bp5-disabled,.bp5-input-group.bp5-intent-success .bp5-input:disabled,.bp5-input-group.bp5-intent-warning .bp5-input.bp5-disabled,.bp5-input-group.bp5-intent-warning .bp5-input:disabled,.bp5-input.bp5-intent-danger.bp5-disabled,.bp5-input.bp5-intent-danger:disabled,.bp5-input.bp5-intent-primary.bp5-disabled,.bp5-input.bp5-intent-primary:disabled,.bp5-input.bp5-intent-success.bp5-disabled,.bp5-input.bp5-intent-success:disabled,.bp5-input.bp5-intent-warning.bp5-disabled,.bp5-input.bp5-intent-warning:disabled,.bp5-omnibar .bp5-input,.bp5-omnibar .bp5-input:focus,.bp5-select.bp5-minimal select.bp5-intent-danger.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-danger:active,.bp5-select.bp5-minimal select.bp5-intent-danger:hover,.bp5-select.bp5-minimal select.bp5-intent-primary.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-primary:active,.bp5-select.bp5-minimal select.bp5-intent-primary:hover,.bp5-select.bp5-minimal select.bp5-intent-success.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-success:active,.bp5-select.bp5-minimal select.bp5-intent-success:hover,.bp5-select.bp5-minimal select.bp5-intent-warning.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-warning:active,.bp5-select.bp5-minimal select.bp5-intent-warning:hover,.bp5-submenu.bp5-popover.bp5-dark,.visual-node-editor .inline-node-container .visual-node-editor>main,table.bp5-html-table.bp5-html-table-bordered.bp5-html-table-striped tbody tr:not(:first-child) td{box-shadow:none}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:hover,.bp5-button.bp5-minimal.bp5-intent-primary:hover,.bp5-button.bp5-outlined.bp5-intent-primary:hover,.bp5-html-select.bp5-minimal select.bp5-intent-primary:hover,.bp5-select.bp5-minimal select.bp5-intent-primary:hover{background:rgba(45,114,210,.15);color:#215db0}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:active,.bp5-button.bp5-minimal.bp5-intent-primary.bp5-active,.bp5-button.bp5-minimal.bp5-intent-primary:active,.bp5-button.bp5-outlined.bp5-intent-primary.bp5-active,.bp5-button.bp5-outlined.bp5-intent-primary:active,.bp5-html-select.bp5-minimal select.bp5-intent-primary.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-primary:active,.bp5-select.bp5-minimal select.bp5-intent-primary.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-primary:active{background:rgba(45,114,210,.3);color:#184a90}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary.bp5-disabled,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:disabled,.bp5-button.bp5-minimal.bp5-intent-primary.bp5-disabled,.bp5-button.bp5-minimal.bp5-intent-primary:disabled,.bp5-html-select.bp5-minimal select.bp5-intent-primary.bp5-disabled,.bp5-html-select.bp5-minimal select.bp5-intent-primary:disabled,.bp5-select.bp5-minimal select.bp5-intent-primary.bp5-disabled,.bp5-select.bp5-minimal select.bp5-intent-primary:disabled{background:none;color:rgba(33,93,176,.5)}.bp5-button.bp5-minimal.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-button.bp5-minimal.bp5-intent-primary:disabled.bp5-active{background:rgba(45,114,210,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary .bp5-button-spinner .bp5-spinner-head,.bp5-button.bp5-minimal.bp5-intent-primary .bp5-button-spinner .bp5-spinner-head,.bp5-button.bp5-outlined.bp5-intent-primary .bp5-button-spinner .bp5-spinner-head,.bp5-html-select.bp5-minimal select.bp5-intent-primary .bp5-button-spinner .bp5-spinner-head,.bp5-select.bp5-minimal select.bp5-intent-primary .bp5-button-spinner .bp5-spinner-head{stroke:#215db0}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:hover,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-primary:hover,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-primary:hover,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-primary:hover,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-primary:hover,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-primary:hover,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-primary:hover{background:rgba(45,114,210,.2);color:#8abbff}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-primary.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-primary:active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-primary.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-primary:active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-primary.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-primary:active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-primary.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-primary:active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-primary.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-primary:active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-primary.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-primary:active{background:rgba(45,114,210,.3);color:#99c4ff}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary.bp5-disabled,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-primary.bp5-disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-primary:disabled,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-primary.bp5-disabled,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-primary:disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-primary.bp5-disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-primary:disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-primary.bp5-disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-primary:disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-primary.bp5-disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-primary:disabled{background:none;color:rgba(138,187,255,.5)}.bp5-dark .bp5-button.bp5-minimal.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-primary:disabled.bp5-active{background:rgba(45,114,210,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:hover,.bp5-button.bp5-minimal.bp5-intent-success:hover,.bp5-button.bp5-outlined.bp5-intent-success:hover,.bp5-html-select.bp5-minimal select.bp5-intent-success:hover,.bp5-select.bp5-minimal select.bp5-intent-success:hover{background:rgba(35,133,81,.15);color:#1c6e42}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:active,.bp5-button.bp5-minimal.bp5-intent-success.bp5-active,.bp5-button.bp5-minimal.bp5-intent-success:active,.bp5-button.bp5-outlined.bp5-intent-success.bp5-active,.bp5-button.bp5-outlined.bp5-intent-success:active,.bp5-html-select.bp5-minimal select.bp5-intent-success.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-success:active,.bp5-select.bp5-minimal select.bp5-intent-success.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-success:active{background:rgba(35,133,81,.3);color:#165a36}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success.bp5-disabled,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:disabled,.bp5-button.bp5-minimal.bp5-intent-success.bp5-disabled,.bp5-button.bp5-minimal.bp5-intent-success:disabled,.bp5-html-select.bp5-minimal select.bp5-intent-success.bp5-disabled,.bp5-html-select.bp5-minimal select.bp5-intent-success:disabled,.bp5-select.bp5-minimal select.bp5-intent-success.bp5-disabled,.bp5-select.bp5-minimal select.bp5-intent-success:disabled{background:none;color:rgba(28,110,66,.5)}.bp5-button.bp5-minimal.bp5-intent-success.bp5-disabled.bp5-active,.bp5-button.bp5-minimal.bp5-intent-success:disabled.bp5-active{background:rgba(35,133,81,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success .bp5-button-spinner .bp5-spinner-head,.bp5-button.bp5-minimal.bp5-intent-success .bp5-button-spinner .bp5-spinner-head,.bp5-button.bp5-outlined.bp5-intent-success .bp5-button-spinner .bp5-spinner-head,.bp5-html-select.bp5-minimal select.bp5-intent-success .bp5-button-spinner .bp5-spinner-head,.bp5-select.bp5-minimal select.bp5-intent-success .bp5-button-spinner .bp5-spinner-head{stroke:#1c6e42}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:hover,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-success:hover,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-success:hover,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-success:hover,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-success:hover,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-success:hover,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-success:hover{background:rgba(35,133,81,.2);color:#72ca9b}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-success.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-success:active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-success.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-success:active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-success.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-success:active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-success.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-success:active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-success.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-success:active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-success.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-success:active{background:rgba(35,133,81,.3);color:#7cd7a2}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success.bp5-disabled,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-success.bp5-disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-success:disabled,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-success.bp5-disabled,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-success:disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-success.bp5-disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-success:disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-success.bp5-disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-success:disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-success.bp5-disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-success:disabled{background:none;color:rgba(114,202,155,.5)}.bp5-dark .bp5-button.bp5-minimal.bp5-intent-success.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-success:disabled.bp5-active{background:rgba(35,133,81,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:hover,.bp5-button.bp5-minimal.bp5-intent-warning:hover,.bp5-button.bp5-outlined.bp5-intent-warning:hover,.bp5-html-select.bp5-minimal select.bp5-intent-warning:hover,.bp5-select.bp5-minimal select.bp5-intent-warning:hover{background:rgba(200,118,25,.15);color:#935610}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:active,.bp5-button.bp5-minimal.bp5-intent-warning.bp5-active,.bp5-button.bp5-minimal.bp5-intent-warning:active,.bp5-button.bp5-outlined.bp5-intent-warning.bp5-active,.bp5-button.bp5-outlined.bp5-intent-warning:active,.bp5-html-select.bp5-minimal select.bp5-intent-warning.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-warning:active,.bp5-select.bp5-minimal select.bp5-intent-warning.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-warning:active{background:rgba(200,118,25,.3);color:#77450d}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning.bp5-disabled,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:disabled,.bp5-button.bp5-minimal.bp5-intent-warning.bp5-disabled,.bp5-button.bp5-minimal.bp5-intent-warning:disabled,.bp5-html-select.bp5-minimal select.bp5-intent-warning.bp5-disabled,.bp5-html-select.bp5-minimal select.bp5-intent-warning:disabled,.bp5-select.bp5-minimal select.bp5-intent-warning.bp5-disabled,.bp5-select.bp5-minimal select.bp5-intent-warning:disabled{background:none;color:rgba(147,86,16,.5)}.bp5-button.bp5-minimal.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-button.bp5-minimal.bp5-intent-warning:disabled.bp5-active{background:rgba(200,118,25,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning .bp5-button-spinner .bp5-spinner-head,.bp5-button.bp5-minimal.bp5-intent-warning .bp5-button-spinner .bp5-spinner-head,.bp5-button.bp5-outlined.bp5-intent-warning .bp5-button-spinner .bp5-spinner-head,.bp5-html-select.bp5-minimal select.bp5-intent-warning .bp5-button-spinner .bp5-spinner-head,.bp5-select.bp5-minimal select.bp5-intent-warning .bp5-button-spinner .bp5-spinner-head{stroke:#935610}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:hover,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-warning:hover,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-warning:hover,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-warning:hover,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-warning:hover,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-warning:hover,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-warning:hover{background:rgba(200,118,25,.2);color:#fbb360}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-warning.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-warning:active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-warning.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-warning:active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-warning.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-warning:active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-warning.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-warning:active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-warning.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-warning:active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-warning.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-warning:active{background:rgba(200,118,25,.3);color:#f5c186}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning.bp5-disabled,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-warning.bp5-disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-warning:disabled,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-warning.bp5-disabled,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-warning:disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-warning.bp5-disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-warning:disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-warning.bp5-disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-warning:disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-warning.bp5-disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-warning:disabled{background:none;color:rgba(251,179,96,.5)}.bp5-dark .bp5-button.bp5-minimal.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-warning:disabled.bp5-active{background:rgba(200,118,25,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:hover,.bp5-button.bp5-minimal.bp5-intent-danger:hover,.bp5-button.bp5-outlined.bp5-intent-danger:hover,.bp5-html-select.bp5-minimal select.bp5-intent-danger:hover,.bp5-select.bp5-minimal select.bp5-intent-danger:hover{background:rgba(205,66,70,.15);color:#ac2f33}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:active,.bp5-button.bp5-minimal.bp5-intent-danger.bp5-active,.bp5-button.bp5-minimal.bp5-intent-danger:active,.bp5-button.bp5-outlined.bp5-intent-danger.bp5-active,.bp5-button.bp5-outlined.bp5-intent-danger:active,.bp5-html-select.bp5-minimal select.bp5-intent-danger.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-danger:active,.bp5-select.bp5-minimal select.bp5-intent-danger.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-danger:active{background:rgba(205,66,70,.3);color:#8e292c}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger.bp5-disabled,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:disabled,.bp5-button.bp5-minimal.bp5-intent-danger.bp5-disabled,.bp5-button.bp5-minimal.bp5-intent-danger:disabled,.bp5-html-select.bp5-minimal select.bp5-intent-danger.bp5-disabled,.bp5-html-select.bp5-minimal select.bp5-intent-danger:disabled,.bp5-select.bp5-minimal select.bp5-intent-danger.bp5-disabled,.bp5-select.bp5-minimal select.bp5-intent-danger:disabled{background:none;color:rgba(172,47,51,.5)}.bp5-button.bp5-minimal.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-button.bp5-minimal.bp5-intent-danger:disabled.bp5-active{background:rgba(205,66,70,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger .bp5-button-spinner .bp5-spinner-head,.bp5-button.bp5-minimal.bp5-intent-danger .bp5-button-spinner .bp5-spinner-head,.bp5-button.bp5-outlined.bp5-intent-danger .bp5-button-spinner .bp5-spinner-head,.bp5-html-select.bp5-minimal select.bp5-intent-danger .bp5-button-spinner .bp5-spinner-head,.bp5-select.bp5-minimal select.bp5-intent-danger .bp5-button-spinner .bp5-spinner-head{stroke:#ac2f33}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:hover,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-danger:hover,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-danger:hover,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-danger:hover,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-danger:hover,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-danger:hover,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-danger:hover{background:rgba(205,66,70,.2);color:#fa999c}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-danger.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-danger:active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-danger.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-danger:active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-danger.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-danger:active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-danger.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-danger:active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-danger.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-danger:active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-danger.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-danger:active{background:rgba(205,66,70,.3);color:#ffa1a4}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger.bp5-disabled,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-danger.bp5-disabled,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-danger:disabled,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-danger.bp5-disabled,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-danger:disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-danger.bp5-disabled,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-danger:disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-danger.bp5-disabled,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-danger:disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-danger.bp5-disabled,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-danger:disabled{background:none;color:rgba(250,153,156,.5)}.bp5-dark .bp5-button.bp5-minimal.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-minimal.bp5-intent-danger:disabled.bp5-active{background:rgba(205,66,70,.3)}.bp5-button.bp5-outlined{background:none;border:1px solid rgba(28,33,39,.2);box-shadow:none;box-sizing:border-box}.bp5-card.bp5-dark,.bp5-dark .bp5-card,.bp5-dark .bp5-elevation-0,.bp5-elevation-0.bp5-dark{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2)}.bp5-button.bp5-outlined.bp5-disabled,.bp5-button.bp5-outlined.bp5-disabled:hover,.bp5-button.bp5-outlined:disabled,.bp5-button.bp5-outlined:disabled:hover{background:none;color:rgba(95,107,124,.6);cursor:not-allowed;border-color:rgba(95,107,124,.1)}.bp5-button.bp5-outlined.bp5-disabled.bp5-active,.bp5-button.bp5-outlined.bp5-disabled:hover.bp5-active,.bp5-button.bp5-outlined:disabled.bp5-active,.bp5-button.bp5-outlined:disabled:hover.bp5-active{background:rgba(143,153,168,.3)}.bp5-dark .bp5-button.bp5-outlined.bp5-active,.bp5-dark .bp5-button.bp5-outlined:active{background:rgba(143,153,168,.3)}.bp5-dark .bp5-button.bp5-outlined.bp5-disabled,.bp5-dark .bp5-button.bp5-outlined.bp5-disabled:hover,.bp5-dark .bp5-button.bp5-outlined:disabled,.bp5-dark .bp5-button.bp5-outlined:disabled:hover{background:none;color:rgba(171,179,191,.6);cursor:not-allowed;border-color:hsla(0,0%,100%,.2)}.bp5-dark .bp5-button.bp5-outlined.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-disabled:hover.bp5-active,.bp5-dark .bp5-button.bp5-outlined:disabled.bp5-active,.bp5-dark .bp5-button.bp5-outlined:disabled:hover.bp5-active{background:rgba(143,153,168,.3)}.bp5-button.bp5-outlined.bp5-intent-primary.bp5-disabled,.bp5-button.bp5-outlined.bp5-intent-primary:disabled{background:none;color:rgba(33,93,176,.5);border-color:rgba(33,93,176,.2)}.bp5-button.bp5-outlined.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-button.bp5-outlined.bp5-intent-primary:disabled.bp5-active{background:rgba(45,114,210,.3)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-primary{color:#8abbff;border-color:rgba(138,187,255,.6)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-primary.bp5-disabled,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-primary:disabled{background:none;color:rgba(138,187,255,.5);border-color:rgba(138,187,255,.2)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-primary:disabled.bp5-active{background:rgba(45,114,210,.3)}.bp5-button.bp5-outlined.bp5-intent-success.bp5-disabled,.bp5-button.bp5-outlined.bp5-intent-success:disabled{background:none;color:rgba(28,110,66,.5);border-color:rgba(28,110,66,.2)}.bp5-button.bp5-outlined.bp5-intent-success.bp5-disabled.bp5-active,.bp5-button.bp5-outlined.bp5-intent-success:disabled.bp5-active{background:rgba(35,133,81,.3)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-success{color:#72ca9b;border-color:rgba(114,202,155,.6)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-success.bp5-disabled,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-success:disabled{background:none;color:rgba(114,202,155,.5);border-color:rgba(114,202,155,.2)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-success.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-success:disabled.bp5-active{background:rgba(35,133,81,.3)}.bp5-button.bp5-outlined.bp5-intent-warning.bp5-disabled,.bp5-button.bp5-outlined.bp5-intent-warning:disabled{background:none;color:rgba(147,86,16,.5);border-color:rgba(147,86,16,.2)}.bp5-button.bp5-outlined.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-button.bp5-outlined.bp5-intent-warning:disabled.bp5-active{background:rgba(200,118,25,.3)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-warning{color:#fbb360;border-color:rgba(251,179,96,.6)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-warning.bp5-disabled,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-warning:disabled{background:none;color:rgba(251,179,96,.5);border-color:rgba(251,179,96,.2)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-warning:disabled.bp5-active{background:rgba(200,118,25,.3)}.bp5-button.bp5-outlined.bp5-intent-danger.bp5-disabled,.bp5-button.bp5-outlined.bp5-intent-danger:disabled{background:none;color:rgba(172,47,51,.5);border-color:rgba(172,47,51,.2)}.bp5-button.bp5-outlined.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-button.bp5-outlined.bp5-intent-danger:disabled.bp5-active{background:rgba(205,66,70,.3)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-danger{color:#fa999c;border-color:rgba(250,153,156,.6)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-danger.bp5-disabled,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-danger:disabled{background:none;color:rgba(250,153,156,.5);border-color:rgba(250,153,156,.2)}.bp5-dark .bp5-button.bp5-outlined.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-dark .bp5-button.bp5-outlined.bp5-intent-danger:disabled.bp5-active{background:rgba(205,66,70,.3)}.bp5-dark .bp5-button.bp5-outlined{border-color:hsla(0,0%,100%,.4)}.bp5-button.bp5-outlined.bp5-intent-primary{border-color:rgba(33,93,176,.6)}.bp5-button.bp5-outlined.bp5-intent-success{border-color:rgba(28,110,66,.6)}.bp5-button.bp5-outlined.bp5-intent-warning{border-color:rgba(147,86,16,.6)}.bp5-button.bp5-outlined.bp5-intent-danger{color:#ac2f33;border-color:rgba(172,47,51,.6)}.bp5-button.bp5-intent-warning,.bp5-tag.bp5-intent-warning{background:#fbb360;color:#1c2127}.bp5-button.bp5-intent-warning:not(.bp5-disabled).bp5-icon>svg{fill:rgba(28,33,39,.7)}.bp5-button.bp5-intent-warning:not(.bp5-disabled):not(.bp5-minimal):not(.bp5-outlined):hover{background:#ec9a3c;color:#1c2127}.bp5-button.bp5-intent-warning:not(.bp5-disabled):not(.bp5-minimal):not(.bp5-outlined).bp5-active,.bp5-button.bp5-intent-warning:not(.bp5-disabled):not(.bp5-minimal):not(.bp5-outlined):active{background:#c87619;color:#1c2127}.bp5-button.bp5-intent-warning.bp5-disabled,.bp5-button.bp5-intent-warning:disabled{background:rgba(200,118,25,.5);color:rgba(28,33,39,.35)}.bp5-dark .bp5-button.bp5-intent-warning.bp5-disabled,.bp5-dark .bp5-button.bp5-intent-warning:disabled{color:rgba(28,33,39,.6)}.bp5-button.bp5-intent-warning.bp5-minimal,.bp5-button.bp5-intent-warning.bp5-outlined{background:none}.bp5-dark .bp5-button.bp5-intent-warning.bp5-minimal:not(.bp5-disabled).bp5-icon>svg,.bp5-dark .bp5-button.bp5-intent-warning.bp5-outlined:not(.bp5-disabled).bp5-icon>svg{fill:#fbb360}a.bp5-button{text-align:center;text-decoration:none;transition:none}.bp5-dark .bp5-tag-remove:active,.bp5-dark .bp5-tag-remove:hover,.bp5-dialog-step-viewed:not(.bp5-active) .bp5-dialog-step-title,.bp5-file-input.bp5-file-input-has-selection .bp5-file-upload-input,.bp5-html-select .bp5-icon:hover,.bp5-menu-item.bp5-active .bp5-menu-item-label,.bp5-menu-item:active .bp5-menu-item-label,.bp5-running-text table td,.bp5-select .bp5-icon:hover,.bp5-tag.bp5-intent-warning .bp5-tag-remove:active,.bp5-tag.bp5-intent-warning .bp5-tag-remove:hover,.bp5-tree-node-caret:hover,a.bp5-button,a.bp5-button:active,a.bp5-button:hover,table.bp5-html-table td{color:#1c2127}.bp5-callout.bp5-callout-icon>.bp5-icon:first-child,.bp5-callout[class*=bp5-icon-]:before{color:#5f6b7c;left:15px;position:absolute;top:17px}.bp5-button-text{flex:0 1 auto}.bp5-button-group .bp5-button{flex:0 0 auto;position:relative;z-index:4}.bp5-button-group .bp5-button:focus,.bp5-control-group .bp5-button:focus,.bp5-control-group .bp5-html-select select:focus,.bp5-control-group .bp5-select select:focus{z-index:5}.bp5-button-group .bp5-button:hover,.bp5-control-group .bp5-button:hover,.bp5-control-group .bp5-html-select select:hover,.bp5-control-group .bp5-select select:hover{z-index:6}.bp5-button-group .bp5-button.bp5-active,.bp5-button-group .bp5-button:active,.bp5-control-group .bp5-button:active,.bp5-control-group .bp5-html-select select:active,.bp5-control-group .bp5-select select:active{z-index:7}.bp5-button-group .bp5-button.bp5-disabled,.bp5-button-group .bp5-button:disabled,.bp5-control-group .bp5-button.bp5-disabled,.bp5-control-group .bp5-button:disabled,.bp5-control-group .bp5-button[readonly],.bp5-control-group .bp5-html-select select.bp5-disabled,.bp5-control-group .bp5-html-select select:disabled,.bp5-control-group .bp5-html-select select[readonly],.bp5-control-group .bp5-select select.bp5-disabled,.bp5-control-group .bp5-select select:disabled,.bp5-control-group .bp5-select select[readonly]{z-index:3}.bp5-button-group .bp5-button[class*=bp5-intent-],.bp5-control-group .bp5-button[class*=bp5-intent],.bp5-control-group .bp5-html-select select[class*=bp5-intent],.bp5-control-group .bp5-select select[class*=bp5-intent]{z-index:9}.bp5-button-group .bp5-button[class*=bp5-intent-]:focus,.bp5-control-group .bp5-button[class*=bp5-intent]:focus,.bp5-control-group .bp5-html-select select[class*=bp5-intent]:focus,.bp5-control-group .bp5-select select[class*=bp5-intent]:focus{z-index:10}.bp5-button-group .bp5-button[class*=bp5-intent-]:hover,.bp5-control-group .bp5-button[class*=bp5-intent]:hover,.bp5-control-group .bp5-html-select select[class*=bp5-intent]:hover,.bp5-control-group .bp5-select select[class*=bp5-intent]:hover{z-index:11}.bp5-button-group .bp5-button[class*=bp5-intent-].bp5-active,.bp5-button-group .bp5-button[class*=bp5-intent-]:active,.bp5-control-group .bp5-button[class*=bp5-intent]:active,.bp5-control-group .bp5-html-select select[class*=bp5-intent]:active,.bp5-control-group .bp5-select select[class*=bp5-intent]:active{z-index:12}.bp5-button-group .bp5-button[class*=bp5-intent-].bp5-disabled,.bp5-button-group .bp5-button[class*=bp5-intent-]:disabled,.bp5-control-group .bp5-button[class*=bp5-intent].bp5-disabled,.bp5-control-group .bp5-button[class*=bp5-intent]:disabled,.bp5-control-group .bp5-button[class*=bp5-intent][readonly],.bp5-control-group .bp5-html-select select[class*=bp5-intent].bp5-disabled,.bp5-control-group .bp5-html-select select[class*=bp5-intent]:disabled,.bp5-control-group .bp5-html-select select[class*=bp5-intent][readonly],.bp5-control-group .bp5-select select[class*=bp5-intent].bp5-disabled,.bp5-control-group .bp5-select select[class*=bp5-intent]:disabled,.bp5-control-group .bp5-select select[class*=bp5-intent][readonly]{z-index:8}.bp5-button-group:not(.bp5-minimal)>.bp5-button:not(:last-child),.bp5-button-group:not(.bp5-minimal)>.bp5-popover-target:not(:last-child) .bp5-button,.bp5-button-group:not(.bp5-minimal)>.bp5-popover-wrapper:not(:last-child) .bp5-button{border-bottom-right-radius:0;border-top-right-radius:0;margin-right:-1px}.bp5-button-group.bp5-minimal .bp5-button.bp5-disabled.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-disabled:hover.bp5-active,.bp5-button-group.bp5-minimal .bp5-button:disabled.bp5-active,.bp5-button-group.bp5-minimal .bp5-button:disabled:hover.bp5-active{background:rgba(143,153,168,.3)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button:active{background:rgba(143,153,168,.3)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-disabled.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-disabled:hover.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button:disabled.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button:disabled:hover.bp5-active{background:rgba(143,153,168,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:disabled.bp5-active{background:rgba(45,114,210,.3)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-primary:disabled.bp5-active{background:rgba(45,114,210,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success.bp5-disabled.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:disabled.bp5-active{background:rgba(35,133,81,.3)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success.bp5-disabled.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-success:disabled.bp5-active{background:rgba(35,133,81,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:disabled.bp5-active{background:rgba(200,118,25,.3)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-warning:disabled.bp5-active{background:rgba(200,118,25,.3)}.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:disabled.bp5-active{background:rgba(205,66,70,.3)}.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-dark .bp5-button-group.bp5-minimal .bp5-button.bp5-intent-danger:disabled.bp5-active{background:rgba(205,66,70,.3)}.bp5-button-group .bp5-popover-target,.bp5-button-group .bp5-popover-wrapper{display:flex;flex:1 1 auto}.bp5-button-group.bp5-vertical{align-items:stretch;flex-direction:column;vertical-align:top}.bp5-button-group.bp5-vertical.bp5-fill{height:100%;width:unset}.bp5-button-group.bp5-vertical .bp5-button{margin-right:0!important;width:100%}.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-button:first-child,.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-popover-target:first-child .bp5-button,.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-popover-wrapper:first-child .bp5-button{border-radius:2px 2px 0 0}.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-button:last-child,.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-popover-target:last-child .bp5-button,.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-popover-wrapper:last-child .bp5-button{border-radius:0 0 2px 2px}.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-button:not(:last-child),.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-popover-target:not(:last-child) .bp5-button,.bp5-button-group.bp5-vertical:not(.bp5-minimal)>.bp5-popover-wrapper:not(:last-child) .bp5-button{margin-bottom:-1px}.bp5-callout{background-color:rgba(143,153,168,.15);border-radius:2px;font-size:14px;line-height:1.5;padding:15px;width:100%}.bp5-callout.bp5-callout-icon,.bp5-callout[class*=bp5-icon-],.bp5-control.bp5-switch:not(.bp5-align-right){padding-left:38px}.bp5-callout[class*=bp5-icon-]:before{font-size:16px;font-weight:400;height:16px;width:16px}.bp5-callout .bp5-heading{line-height:16px;margin-bottom:5px;margin-top:2px}.bp5-dark .bp5-callout{background-color:rgba(143,153,168,.2)}.bp5-callout.bp5-intent-primary,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-],.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover{background-color:rgba(45,114,210,.1);color:#215db0}.bp5-dark .bp5-callout.bp5-intent-primary,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-],.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover{background-color:rgba(45,114,210,.2);color:#8abbff}.bp5-callout.bp5-intent-success,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-success{background-color:rgba(35,133,81,.1);color:#1c6e42}.bp5-dark .bp5-callout.bp5-intent-success,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-success{background-color:rgba(35,133,81,.2);color:#72ca9b}.bp5-callout.bp5-intent-warning,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-warning{background-color:rgba(200,118,25,.1);color:#935610}.bp5-dark .bp5-callout.bp5-intent-warning,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-warning{background-color:rgba(200,118,25,.2);color:#fbb360}.bp5-callout.bp5-intent-danger,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-danger{background-color:rgba(205,66,70,.1);color:#ac2f33}.bp5-dark .bp5-callout.bp5-intent-danger,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected.bp5-intent-danger{background-color:rgba(205,66,70,.2);color:#fa999c}.bp5-callout.bp5-intent-primary a:hover,.bp5-tag.bp5-minimal.bp5-intent-primary .bp5-tag-remove:active,.bp5-tag.bp5-minimal.bp5-intent-primary .bp5-tag-remove:hover{color:#184a90}.bp5-dark .bp5-callout.bp5-intent-primary a:hover,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-primary .bp5-tag-remove:active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-primary .bp5-tag-remove:hover{color:#99c4ff}.bp5-running-text .bp5-callout{margin:20px 0}.bp5-card{background-color:#fff;border-radius:2px;padding:20px;transition:transform .2s cubic-bezier(.4,1,.75,.9),box-shadow .2s cubic-bezier(.4,1,.75,.9)}.bp5-card.bp5-dark,.bp5-dark .bp5-card{background-color:#2f343c}.bp5-elevation-1{box-shadow:0 0 0 1px rgba(17,20,24,.1),0 1px 1px rgba(17,20,24,.2)}.bp5-dark .bp5-elevation-1,.bp5-elevation-1.bp5-dark{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 1px 1px 0 rgba(17,20,24,.4)}.bp5-elevation-2{box-shadow:0 0 0 1px rgba(17,20,24,.1),0 1px 1px rgba(17,20,24,.2),0 2px 6px rgba(17,20,24,.2)}.bp5-dark .bp5-elevation-2,.bp5-elevation-2.bp5-dark{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 1px 1px rgba(17,20,24,.4),0 2px 6px rgba(17,20,24,.4)}.bp5-elevation-3,.bp5-submenu.bp5-popover>.bp5-popover-content{box-shadow:0 0 0 1px rgba(17,20,24,.1),0 2px 4px rgba(17,20,24,.2),0 8px 24px rgba(17,20,24,.2)}.bp5-dark .bp5-elevation-3,.bp5-elevation-3.bp5-dark{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 2px 4px rgba(17,20,24,.4),0 8px 24px rgba(17,20,24,.4)}.bp5-elevation-4{box-shadow:0 0 0 1px rgba(17,20,24,.1),0 4px 8px rgba(17,20,24,.2),0 18px 46px 6px rgba(17,20,24,.2)}.bp5-card.bp5-interactive:hover,.bp5-dialog{box-shadow:0 0 0 1px rgba(17,20,24,.1),0 2px 4px rgba(17,20,24,.2),0 8px 24px rgba(17,20,24,.2)}.bp5-dark .bp5-elevation-4,.bp5-elevation-4.bp5-dark{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 4px 8px rgba(17,20,24,.4),0 18px 46px 6px rgba(17,20,24,.4)}.bp5-card.bp5-interactive:hover{cursor:pointer}.bp5-card.bp5-interactive:hover.bp5-dark,.bp5-dark .bp5-card.bp5-interactive:hover{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 2px 4px rgba(17,20,24,.4),0 8px 24px rgba(17,20,24,.4)}.bp5-card.bp5-interactive:active{box-shadow:0 0 0 1px rgba(17,20,24,.1),0 1px 1px rgba(17,20,24,.2);opacity:.9;transition-duration:0}.bp5-card.bp5-interactive:active.bp5-dark,.bp5-dark .bp5-card.bp5-interactive:active{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 1px 1px 0 rgba(17,20,24,.4)}.bp5-collapse{height:0;overflow-y:hidden;transition:height .2s cubic-bezier(.4,1,.75,.9)}.bp5-collapse .bp5-collapse-body{transition:transform .2s cubic-bezier(.4,1,.75,.9)}.bp5-context-menu-virtual-target,.bp5-toast-container.bp5-toast-container-in-portal{position:fixed}.bp5-dialog-container{align-items:center;display:flex;justify-content:center;min-height:100%;opacity:1;transform:scale(1);-webkit-user-select:none;user-select:none;width:100%}.bp5-dialog-container.bp5-overlay-appear>.bp5-dialog,.bp5-dialog-container.bp5-overlay-enter>.bp5-dialog{opacity:0;transform:scale(.5)}.bp5-dialog-container.bp5-overlay-appear-active>.bp5-dialog,.bp5-dialog-container.bp5-overlay-enter-active>.bp5-dialog{opacity:1;transform:scale(1);transition:opacity .3s cubic-bezier(.54,1.12,.38,1.11) 0,transform .3s cubic-bezier(.54,1.12,.38,1.11) 0}.bp5-dialog-container.bp5-overlay-exit>.bp5-dialog{opacity:1;transform:scale(1)}.bp5-dialog-container.bp5-overlay-exit-active>.bp5-dialog{opacity:0;transform:scale(.5);transition:opacity .3s cubic-bezier(.54,1.12,.38,1.11) 0,transform .3s cubic-bezier(.54,1.12,.38,1.11) 0}.bp5-dialog{background:#f6f7f9;border-radius:4px;display:flex;flex-direction:column;margin:30px 0;pointer-events:all;-webkit-user-select:text;user-select:text;width:500px}.bp5-dialog:focus,.bp5-drawer:focus,.bp5-editable-text-input:focus,.bp5-overlay-backdrop:focus,.bp5-popover-transition-container:focus,.visual-node-editor :focus,body:not(.navigation-with-keyboard) :not(input):focus{outline:0}.bp5-dark .bp5-dialog,.bp5-dialog.bp5-dark{background:#252a31;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 2px 4px rgba(17,20,24,.4),0 8px 24px rgba(17,20,24,.4);color:#f6f7f9}.bp5-dialog-header{align-items:center;background:#fff;border-radius:4px 4px 0 0;box-shadow:0 1px 0 rgba(17,20,24,.15);display:flex;flex:0 0 auto;min-height:40px;padding:5px 5px 5px 15px;z-index:0}.bp5-dialog-header .bp5-icon,.bp5-dialog-header .bp5-icon-large{color:#5f6b7c;flex:0 0 auto;margin-left:-3px;margin-right:7.5px}.bp5-dialog-header .bp5-heading,.bp5-drawer-header .bp5-heading{flex:1 1 auto;line-height:inherit;margin:0}.bp5-dialog-header .bp5-heading:last-child{margin-right:15px}.bp5-dark .bp5-dialog-header{background:#2f343c;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2)}.bp5-dialog-body{flex:1 1 auto;margin:15px}.bp5-dialog-body-scroll-container{margin:0;max-height:70vh;overflow:auto;padding:15px}.bp5-dialog-footer{flex:0 0 auto;margin:15px}.bp5-dialog-footer-fixed{align-items:center;background-color:#fff;border-radius:0 0 4px 4px;border-top:1px solid rgba(17,20,24,.15);display:flex;gap:15px;justify-content:space-between;margin:0;padding:10px 10px 10px 15px}.bp5-dark .bp5-dialog-footer-fixed{background:#383e47;border-top:1px solid hsla(0,0%,100%,.2)}.bp5-dialog-footer-main-section{flex:1 0 auto}.bp5-dialog-footer-actions{display:flex;justify-content:flex-end}.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels:first-child .bp5-dialog-step-container:first-child,.bp5-multistep-dialog-panels:first-child .bp5-dialog-step-container:first-child{border-radius:4px 0 0}.bp5-multistep-dialog-panels:first-child .bp5-multistep-dialog-right-panel{border-top-right-radius:4px}.blogPostFooterDetailsFull_dOfN,.bp5-control-group.bp5-vertical,.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels{flex-direction:column}.bp5-multistep-dialog-nav-right .bp5-multistep-dialog-panels:first-child .bp5-dialog-step-container:first-child,.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels:first-child .bp5-dialog-step-container:last-child{border-radius:0 4px 0 0}.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels .bp5-multistep-dialog-left-panel{flex-direction:row}.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels .bp5-dialog-step-container:not(:first-child){border-left:1px solid rgba(17,20,24,.15)}.bp5-dark .bp5-multistep-dialog-nav-right .bp5-multistep-dialog-panels .bp5-multistep-dialog-right-panel,.bp5-dark .bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels .bp5-dialog-step-container{border-color:rgba(17,20,24,.4)}.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels .bp5-multistep-dialog-right-panel{border-left:none}.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels .bp5-multistep-dialog-footer,.bp5-multistep-dialog-nav-top .bp5-multistep-dialog-panels .bp5-multistep-dialog-right-panel{border-radius:0 0 4px 4px}.bp5-multistep-dialog-nav-right .bp5-multistep-dialog-panels,.feature-strip:nth-child(2n) .feature-strip-inner{flex-direction:row-reverse}.bp5-multistep-dialog-nav-right .bp5-multistep-dialog-panels:first-child .bp5-multistep-dialog-right-panel{border-radius:4px 0 0 4px}.bp5-multistep-dialog-nav-right .bp5-multistep-dialog-panels .bp5-multistep-dialog-left-panel{border-radius:0 0 4px}.bp5-multistep-dialog-nav-right .bp5-multistep-dialog-panels .bp5-multistep-dialog-right-panel{border-left:none;border-radius:4px 0 0 4px;border-right:1px solid rgba(17,20,24,.15)}.bp5-multistep-dialog-nav-right .bp5-multistep-dialog-panels .bp5-dialog-footer{border-bottom-left-radius:0}.bp5-multistep-dialog-left-panel{display:flex;flex:1;flex-direction:column}.bp5-dark .bp5-multistep-dialog-left-panel{background:#252a31;border-bottom:1px solid hsla(0,0%,100%,.2);border-bottom-left-radius:4px;border-left:1px solid hsla(0,0%,100%,.2)}.bp5-multistep-dialog-right-panel{background-color:#f6f7f9;border-left:1px solid rgba(17,20,24,.15);border-radius:0 0 4px;flex:3;min-width:0}.bp5-dark .bp5-multistep-dialog-right-panel{background-color:#2f343c;border-bottom:1px solid hsla(0,0%,100%,.2);border-bottom-right-radius:4px;border-left:1px solid hsla(0,0%,100%,.2);border-right:1px solid hsla(0,0%,100%,.2)}.bp5-dialog-step-container{background-color:#f6f7f9;border-bottom:1px solid rgba(17,20,24,.15)}.bp5-dark .bp5-dialog-step-container{background:#2f343c;border-bottom:1px solid hsla(0,0%,100%,.2)}.bp5-dialog-step-container.bp5-dialog-step-viewed,.bp5-tag-input.bp5-active{background-color:#fff}.bp5-dark .bp5-dialog-step-container.bp5-dialog-step-viewed,.bp5-dark .bp5-dialog-step-viewed .bp5-dialog-step,.bp5-tag.bp5-interactive.bp5-active,.bp5-tag.bp5-interactive:active{background:#383e47}.bp5-dialog-step{align-items:center;border-radius:4px;cursor:not-allowed;display:flex;margin:4px;padding:6px 14px}.bp5-dark .bp5-dialog-step,.bp5-dark .bp5-dialog-step:hover,.bp5-dark .bp5-popover .bp5-popover-content,.bp5-popover.bp5-dark .bp5-popover-content{background:#2f343c}.bp5-dialog-step-viewed .bp5-dialog-step{background-color:#fff;cursor:pointer}.bp5-dialog-step:hover{background-color:#f6f7f9}.bp5-dialog-step-icon{align-items:center;background-color:rgba(95,107,124,.6);border-radius:50%;color:#fff;display:flex;height:25px;justify-content:center;width:25px}.bp5-dark .bp5-dialog-step-icon{background-color:rgba(171,179,191,.6)}.bp5-active.bp5-dialog-step-viewed .bp5-dialog-step-icon{background-color:#4c90f0}.bp5-dark .bp5-progress-bar .bp5-progress-meter,.bp5-dialog-step-viewed .bp5-dialog-step-icon{background-color:#8f99a8}.bp5-dialog-step-title{color:rgba(95,107,124,.6);flex:1;padding-left:10px}.bp5-active.bp5-dialog-step-viewed .bp5-dialog-step-title{color:#4c90f0}.bp5-drawer{background:#fff;box-shadow:0 0 0 1px rgba(17,20,24,.1),0 4px 8px rgba(17,20,24,.2),0 18px 46px 6px rgba(17,20,24,.2);display:flex;flex-direction:column;margin:0;padding:0}.bp5-drawer.bp5-position-top{height:50%;left:0;right:0;top:0}.bp5-drawer.bp5-position-top.bp5-overlay-appear,.bp5-drawer.bp5-position-top.bp5-overlay-enter{transform:translateY(-100%)}.bp5-drawer.bp5-position-bottom.bp5-overlay-appear-active,.bp5-drawer.bp5-position-bottom.bp5-overlay-enter-active,.bp5-drawer.bp5-position-top.bp5-overlay-appear-active,.bp5-drawer.bp5-position-top.bp5-overlay-enter-active{transform:translateY(0);transition:transform .2s cubic-bezier(.4,1,.75,.9) 0}.bp5-drawer.bp5-position-bottom.bp5-overlay-exit,.bp5-drawer.bp5-position-top.bp5-overlay-exit,.bp5-toast.bp5-toast-exit~.bp5-toast{transform:translateY(0)}.bp5-drawer.bp5-position-top.bp5-overlay-exit-active{transform:translateY(-100%);transition:transform .1s cubic-bezier(.4,1,.75,.9) 0}.bp5-drawer.bp5-position-bottom{bottom:0;height:50%;left:0;right:0}.bp5-drawer.bp5-position-bottom.bp5-overlay-appear,.bp5-drawer.bp5-position-bottom.bp5-overlay-enter{transform:translateY(100%)}.bp5-drawer.bp5-position-bottom.bp5-overlay-exit-active{transform:translateY(100%);transition:transform .1s cubic-bezier(.4,1,.75,.9) 0}.bp5-drawer.bp5-position-left{bottom:0;left:0;top:0;width:50%}.bp5-drawer.bp5-position-left.bp5-overlay-appear,.bp5-drawer.bp5-position-left.bp5-overlay-enter{transform:translateX(-100%)}.bp5-drawer.bp5-position-left.bp5-overlay-appear-active,.bp5-drawer.bp5-position-left.bp5-overlay-enter-active,.bp5-drawer.bp5-position-right.bp5-overlay-appear-active,.bp5-drawer.bp5-position-right.bp5-overlay-enter-active{transform:translateX(0);transition:transform .2s cubic-bezier(.4,1,.75,.9) 0}.bp5-drawer.bp5-position-left.bp5-overlay-exit,.bp5-drawer.bp5-position-right.bp5-overlay-exit{transform:translateX(0)}.bp5-drawer.bp5-position-left.bp5-overlay-exit-active{transform:translateX(-100%);transition:transform .1s cubic-bezier(.4,1,.75,.9) 0}.bp5-drawer.bp5-position-right{bottom:0;right:0;top:0;width:50%}.bp5-drawer.bp5-position-right.bp5-overlay-appear,.bp5-drawer.bp5-position-right.bp5-overlay-enter{transform:translateX(100%)}.bp5-drawer.bp5-position-right.bp5-overlay-exit-active{transform:translateX(100%);transition:transform .1s cubic-bezier(.4,1,.75,.9) 0}.bp5-dark .bp5-drawer,.bp5-drawer.bp5-dark{background:#383e47;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 2px 4px rgba(17,20,24,.4),0 8px 24px rgba(17,20,24,.4);color:#f6f7f9}.bp5-drawer-header{align-items:center;border-radius:0;box-shadow:0 1px 0 rgba(17,20,24,.15);display:flex;flex:0 0 auto;min-height:40px;padding:5px 5px 5px 20px;position:relative}.bp5-drawer-header .bp5-icon,.bp5-drawer-header .bp5-icon-large{color:#5f6b7c;flex:0 0 auto;margin-right:10px}.bp5-drawer-header .bp5-heading:last-child,.bp5-non-ideal-state.bp5-non-ideal-state-horizontal:before,.bp5-non-ideal-state.bp5-non-ideal-state-horizontal>*,.bp5-tab-list>:not(:last-child){margin-right:20px}.bp5-dark .bp5-drawer-header{box-shadow:0 1px 0 rgba(17,20,24,.4)}.bp5-drawer-body{flex:1 1 auto;line-height:18px;overflow:auto}.bp5-drawer-footer{box-shadow:inset 0 1px 0 rgba(17,20,24,.15);flex:0 0 auto;padding:10px 20px;position:relative}.bp5-dark .bp5-drawer-footer{box-shadow:inset 0 1px 0 rgba(17,20,24,.4)}.bp5-editable-text{cursor:text;display:inline-block;max-width:100%;position:relative;vertical-align:top;white-space:nowrap}.bp5-editable-text:before{border-radius:2px;bottom:-2px;content:"";left:-2px;position:absolute;right:-2px;top:-2px;transition:background-color .1s cubic-bezier(.4,1,.75,.9),box-shadow .1s cubic-bezier(.4,1,.75,.9)}.bp5-editable-text:hover:before{box-shadow:0 0 0 0 rgba(45,114,210,0),0 0 0 0 rgba(45,114,210,0),inset 0 0 0 1px rgba(17,20,24,.15)}.bp5-editable-text.bp5-editable-text-editing:before{background-color:#fff;box-shadow:inset 0 0 0 1px #2d72d2,0 0 0 2px rgba(45,114,210,.3),inset 0 1px 1px rgba(17,20,24,.2)}.bp5-editable-text.bp5-intent-primary .bp5-editable-text-content,.bp5-editable-text.bp5-intent-primary .bp5-editable-text-input,.bp5-editable-text.bp5-intent-primary .bp5-editable-text-input::placeholder{color:#2d72d2}.bp5-editable-text.bp5-intent-primary:hover:before{box-shadow:0 0 0 0 rgba(45,114,210,0),0 0 0 0 rgba(45,114,210,0),inset 0 0 0 1px rgba(45,114,210,.4)}.bp5-editable-text.bp5-intent-primary.bp5-editable-text-editing:before,.bp5-file-upload-input.bp5-active,.bp5-file-upload-input:focus,.bp5-input-group.bp5-intent-primary .bp5-input:focus,.bp5-input.bp5-active,.bp5-input.bp5-intent-primary:focus,.bp5-input:focus,.bp5-tag-input.bp5-active,.bp5-tag-input.bp5-active.bp5-intent-primary{box-shadow:inset 0 0 0 1px #2d72d2,0 0 0 2px rgba(45,114,210,.3),inset 0 1px 1px rgba(17,20,24,.2)}.bp5-editable-text.bp5-intent-success .bp5-editable-text-content,.bp5-editable-text.bp5-intent-success .bp5-editable-text-input,.bp5-editable-text.bp5-intent-success .bp5-editable-text-input::placeholder{color:#238551}.bp5-editable-text.bp5-intent-success:hover:before{box-shadow:0 0 0 0 rgba(35,133,81,0),0 0 0 0 rgba(35,133,81,0),inset 0 0 0 1px rgba(35,133,81,.4)}.bp5-editable-text.bp5-intent-success.bp5-editable-text-editing:before,.bp5-input-group.bp5-intent-success .bp5-input:focus,.bp5-input.bp5-intent-success:focus,.bp5-tag-input.bp5-active.bp5-intent-success{box-shadow:inset 0 0 0 1px #238551,0 0 0 2px rgba(35,133,81,.3),inset 0 1px 1px rgba(17,20,24,.2)}.bp5-editable-text.bp5-intent-warning .bp5-editable-text-content,.bp5-editable-text.bp5-intent-warning .bp5-editable-text-input,.bp5-editable-text.bp5-intent-warning .bp5-editable-text-input::placeholder{color:#c87619}.bp5-editable-text.bp5-intent-warning:hover:before{box-shadow:0 0 0 0 rgba(200,118,25,0),0 0 0 0 rgba(200,118,25,0),inset 0 0 0 1px rgba(200,118,25,.4)}.bp5-editable-text.bp5-intent-warning.bp5-editable-text-editing:before,.bp5-input-group.bp5-intent-warning .bp5-input:focus,.bp5-input.bp5-intent-warning:focus,.bp5-tag-input.bp5-active.bp5-intent-warning{box-shadow:inset 0 0 0 1px #c87619,0 0 0 2px rgba(200,118,25,.3),inset 0 1px 1px rgba(17,20,24,.2)}.bp5-editable-text.bp5-intent-danger .bp5-editable-text-content,.bp5-editable-text.bp5-intent-danger .bp5-editable-text-input,.bp5-editable-text.bp5-intent-danger .bp5-editable-text-input::placeholder{color:#cd4246}.bp5-editable-text.bp5-intent-danger:hover:before{box-shadow:0 0 0 0 rgba(205,66,70,0),0 0 0 0 rgba(205,66,70,0),inset 0 0 0 1px rgba(205,66,70,.4)}.bp5-editable-text.bp5-intent-danger.bp5-editable-text-editing:before,.bp5-input-group.bp5-intent-danger .bp5-input:focus,.bp5-input.bp5-intent-danger:focus,.bp5-tag-input.bp5-active.bp5-intent-danger{box-shadow:inset 0 0 0 1px #cd4246,0 0 0 2px rgba(205,66,70,.3),inset 0 1px 1px rgba(17,20,24,.2)}.bp5-dark .bp5-editable-text:hover:before{box-shadow:0 0 0 0 rgba(76,144,240,0),0 0 0 0 rgba(76,144,240,0),inset 0 0 0 1px hsla(0,0%,100%,.2)}.bp5-dark .bp5-editable-text.bp5-editable-text-editing:before{background-color:rgba(17,20,24,.3);box-shadow:inset 0 0 0 1px #4c90f0,0 0 0 2px rgba(76,144,240,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-editable-text.bp5-intent-primary .bp5-editable-text-content,.bp5-dark .bp5-editable-text.bp5-intent-primary .bp5-editable-text-input,.bp5-dark .bp5-editable-text.bp5-intent-primary .bp5-editable-text-input::placeholder{color:#8abbff}.bp5-dark .bp5-editable-text.bp5-intent-primary:hover:before{box-shadow:0 0 0 0 rgba(138,187,255,0),0 0 0 0 rgba(138,187,255,0),inset 0 0 0 1px rgba(138,187,255,.4)}.bp5-dark .bp5-editable-text.bp5-intent-primary.bp5-editable-text-editing:before{box-shadow:inset 0 0 0 1px #8abbff,0 0 0 2px rgba(138,187,255,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-editable-text.bp5-intent-success .bp5-editable-text-content,.bp5-dark .bp5-editable-text.bp5-intent-success .bp5-editable-text-input,.bp5-dark .bp5-editable-text.bp5-intent-success .bp5-editable-text-input::placeholder{color:#72ca9b}.bp5-dark .bp5-editable-text.bp5-intent-success:hover:before{box-shadow:0 0 0 0 rgba(114,202,155,0),0 0 0 0 rgba(114,202,155,0),inset 0 0 0 1px rgba(114,202,155,.4)}.bp5-dark .bp5-editable-text.bp5-intent-success.bp5-editable-text-editing:before{box-shadow:inset 0 0 0 1px #72ca9b,0 0 0 2px rgba(114,202,155,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-editable-text.bp5-intent-warning .bp5-editable-text-content,.bp5-dark .bp5-editable-text.bp5-intent-warning .bp5-editable-text-input,.bp5-dark .bp5-editable-text.bp5-intent-warning .bp5-editable-text-input::placeholder{color:#fbb360}.bp5-dark .bp5-editable-text.bp5-intent-warning:hover:before{box-shadow:0 0 0 0 rgba(251,179,96,0),0 0 0 0 rgba(251,179,96,0),inset 0 0 0 1px rgba(251,179,96,.4)}.bp5-dark .bp5-editable-text.bp5-intent-warning.bp5-editable-text-editing:before{box-shadow:inset 0 0 0 1px #fbb360,0 0 0 2px rgba(251,179,96,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-editable-text.bp5-intent-danger .bp5-editable-text-content,.bp5-dark .bp5-editable-text.bp5-intent-danger .bp5-editable-text-input,.bp5-dark .bp5-editable-text.bp5-intent-danger .bp5-editable-text-input::placeholder{color:#fa999c}.bp5-dark .bp5-editable-text.bp5-intent-danger:hover:before{box-shadow:0 0 0 0 rgba(250,153,156,0),0 0 0 0 rgba(250,153,156,0),inset 0 0 0 1px rgba(250,153,156,.4)}.bp5-dark .bp5-editable-text.bp5-intent-danger.bp5-editable-text-editing:before{box-shadow:inset 0 0 0 1px #fa999c,0 0 0 2px rgba(250,153,156,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-editable-text.bp5-disabled:before{box-shadow:none!important}.bp5-editable-text-content,.bp5-editable-text-input{color:inherit;display:inherit;font:inherit;letter-spacing:inherit;max-width:inherit;min-width:inherit;position:relative;resize:none;text-transform:inherit;vertical-align:top}.admonitionHeading_xHAi code,.bp5-control{text-transform:none}.bp5-editable-text-input{background:none;border:none;box-shadow:none;padding:0;white-space:pre-wrap;width:100%}.bp5-editable-text-input::placeholder{color:#5f6b7c;opacity:1}.bp5-editable-text-input::-ms-clear{display:none}.bp5-editable-text-content{overflow:hidden;padding-right:2px;text-overflow:ellipsis;white-space:pre}.bp5-editable-text-editing>.bp5-editable-text-content{left:0;position:absolute;visibility:hidden}.bp5-control,.bp5-file-input{cursor:pointer;position:relative}.bp5-editable-text.bp5-multiline,.bp5-icon>svg,.bp5-spinner svg,.bp5-submenu .bp5-popover-target,.bp5-submenu>.bp5-popover-wrapper,.flyde-flow-editor footer,.flyde-flow-editor header,.flyde-flow-editor main,.flyde-flow-editor nav,.flyde-flow-editor section,.tocCollapsibleContent_KxYB a,form,label.bp5-label:not(.bp5-inline) .bp5-popover-target{display:block}.bp5-editable-text.bp5-multiline .bp5-editable-text-content{word-wrap:break-word;overflow:auto;white-space:pre-wrap}.bp5-divider{border-bottom:1px solid rgba(17,20,24,.15);border-right:1px solid rgba(17,20,24,.15);margin:5px}.bp5-control-group{align-items:stretch;display:flex;flex-direction:row;transform:translateZ(0)}.bp5-control-group .bp5-input,.ins-view.inline-node-edited{z-index:2}.bp5-control-group .bp5-input:focus{z-index:14}.bp5-control-group .bp5-input-group[class*=bp5-intent] .bp5-input,.bp5-control-group .bp5-input[class*=bp5-intent]{z-index:13}.bp5-control-group .bp5-input-group[class*=bp5-intent] .bp5-input:focus,.bp5-control-group .bp5-input[class*=bp5-intent]:focus{z-index:15}.bp5-control-group .bp5-button,.bp5-control-group .bp5-html-select select,.bp5-control-group .bp5-select select{transform:translateZ(0);z-index:4}.bp5-control-group .bp5-input-group>.bp5-button,.bp5-control-group .bp5-input-group>.bp5-icon,.bp5-control-group .bp5-input-group>.bp5-input-action,.bp5-control-group .bp5-input-group>.bp5-input-left-container{z-index:16}.bp5-control-group .bp5-html-select:after,.bp5-control-group .bp5-html-select>.bp5-icon,.bp5-control-group .bp5-select:after,.bp5-control-group .bp5-select>.bp5-icon{z-index:17}.bp5-control-group .bp5-html-select:focus-within,.bp5-control-group .bp5-select:focus-within{z-index:5}.bp5-control-group:not(.bp5-vertical)>:not(:last-child){margin-right:2px}.bp5-control-group.bp5-fill,.bp5-file-input.bp5-fill,.bp5-html-select.bp5-fill,.bp5-html-select.bp5-fill select,.bp5-multi-select-popover.bp5-popover-match-target-width,.bp5-popover-target.bp5-fill,.bp5-popover.bp5-popover-match-target-width,.bp5-select-popover.bp5-popover-match-target-width,.bp5-select.bp5-fill,.bp5-select.bp5-fill select,.bp5-suggest-popover.bp5-popover-match-target-width{width:100%}.bp5-control-group.bp5-vertical>:not(:last-child){margin-bottom:2px}.bp5-control{display:block;margin-bottom:10px}.bp5-control input:checked~.bp5-control-indicator{background-color:#2d72d2;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2);color:#fff}.bp5-control:hover input:checked~.bp5-control-indicator{background-color:#215db0}.bp5-control input:not(:disabled):active:checked~.bp5-control-indicator{background:#184a90}.bp5-control input:disabled:checked~.bp5-control-indicator,.bp5-dark .bp5-control input:disabled:checked~.bp5-control-indicator{background:rgba(45,114,210,.5);box-shadow:none;color:hsla(0,0%,100%,.6)}.bp5-dark .bp5-control input:checked~.bp5-control-indicator{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1)}.bp5-dark .bp5-control:hover input:checked~.bp5-control-indicator{background-color:#215db0;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1)}.bp5-dark .bp5-control input:not(:disabled):active:checked~.bp5-control-indicator{background-color:#184a90;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1)}.bp5-control:not(.bp5-align-right){padding-left:26px}.bp5-control:not(.bp5-align-right) .bp5-control-indicator{margin-left:-26px}.bp5-control.bp5-align-right{padding-right:26px}.bp5-control.bp5-align-right .bp5-control-indicator{margin-right:-26px;float:right;margin-left:10px;margin-top:1px}.bp5-control.bp5-inline{display:inline-block;margin-right:20px}.bp5-control input{left:0;opacity:0;position:absolute;top:0;z-index:-1}.bp5-control .bp5-control-indicator{background-clip:padding-box;background-color:transparent;border:none;box-shadow:inset 0 0 0 1px #738091;cursor:pointer;display:inline-block;font-size:16px;height:1em;margin-right:10px;margin-top:-3px;position:relative;-webkit-user-select:none;user-select:none;vertical-align:middle;width:1em}.bp5-control .bp5-control-indicator:before{content:"";display:block;height:1em;width:1em}.bp5-control:hover .bp5-control-indicator,.bp5-dark .bp5-control:hover .bp5-control-indicator,.bp5-tree-node-content:hover{background-color:rgba(143,153,168,.15)}.bp5-control input:not(:disabled):active~.bp5-control-indicator{background:rgba(143,153,168,.3);box-shadow:inset 0 0 0 1px #738091}.bp5-control input:disabled~.bp5-control-indicator,.bp5-dark .bp5-control input:disabled~.bp5-control-indicator{background:rgba(143,153,168,.15);box-shadow:none;cursor:not-allowed}.bp5-control input:focus~.bp5-control-indicator{-moz-outline-radius:6px;outline:#2d72d2 solid 2px;outline-offset:2px}.bp5-control.bp5-large:not(.bp5-align-right),.bp5-input-group .bp5-input:not(:first-child){padding-left:30px}.bp5-control.bp5-large:not(.bp5-align-right) .bp5-control-indicator{margin-left:-30px}.bp5-control.bp5-large.bp5-align-right,.bp5-input-group .bp5-input:not(:last-child){padding-right:30px}.bp5-control.bp5-large.bp5-align-right .bp5-control-indicator{margin-right:-30px;margin-top:0}.bp5-control.bp5-large .bp5-control-indicator,.react-counter button{font-size:20px}.bp5-control.bp5-checkbox input:indeterminate~.bp5-control-indicator{background-color:#2d72d2;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2);color:#fff}.bp5-control.bp5-checkbox:hover input:indeterminate~.bp5-control-indicator{background-color:#215db0}.bp5-control.bp5-checkbox input:not(:disabled):active:indeterminate~.bp5-control-indicator{background:#184a90}.bp5-control.bp5-checkbox input:disabled:indeterminate~.bp5-control-indicator{background:rgba(45,114,210,.5);box-shadow:none;color:hsla(0,0%,100%,.6)}.bp5-dark .bp5-control.bp5-checkbox input:indeterminate~.bp5-control-indicator{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1)}.bp5-dark .bp5-control.bp5-checkbox:hover input:indeterminate~.bp5-control-indicator{background-color:#215db0;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1)}.bp5-dark .bp5-control.bp5-checkbox input:not(:disabled):active:indeterminate~.bp5-control-indicator{background-color:#184a90;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1)}.bp5-dark .bp5-control.bp5-checkbox input:disabled:indeterminate~.bp5-control-indicator{background:rgba(45,114,210,.5);box-shadow:none;color:hsla(0,0%,100%,.6)}.bp5-control.bp5-checkbox .bp5-control-indicator{border-radius:2px}.bp5-control.bp5-checkbox input:checked~.bp5-control-indicator:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 5c-.28 0-.53.11-.71.29L7 9.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42l3 3c.18.18.43.29.71.29s.53-.11.71-.29l5-5A1.003 1.003 0 0 0 12 5z' fill='%23fff'/%3E%3C/svg%3E")}.bp5-control.bp5-checkbox input:indeterminate~.bp5-control-indicator:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11 7H5c-.55 0-1 .45-1 1s.45 1 1 1h6c.55 0 1-.45 1-1s-.45-1-1-1z' fill='%23fff'/%3E%3C/svg%3E")}.bp5-control.bp5-radio .bp5-control-indicator{border-radius:50%}.bp5-control.bp5-radio input:checked~.bp5-control-indicator:before{background-image:radial-gradient(#fff,#fff 28%,transparent 32%)}.bp5-control.bp5-radio input:focus~.bp5-control-indicator{-moz-outline-radius:16px}.bp5-control.bp5-switch input~.bp5-control-indicator{background:rgba(143,153,168,.3);color:#1c2127}.bp5-control.bp5-switch:hover input~.bp5-control-indicator{background:rgba(143,153,168,.4)}.bp5-control.bp5-switch input:not(:disabled):active~.bp5-control-indicator{background:rgba(143,153,168,.5)}.bp5-control.bp5-switch input:disabled~.bp5-control-indicator{background:rgba(143,153,168,.15);color:rgba(95,107,124,.6)}.bp5-control.bp5-switch input:disabled~.bp5-control-indicator:before{background:hsla(0,0%,100%,.8);box-shadow:none}.bp5-control.bp5-switch input:checked~.bp5-control-indicator,.bp5-dark .bp5-control.bp5-switch input:checked~.bp5-control-indicator,.bp5-tag.bp5-intent-primary,.bp5-tooltip.bp5-intent-primary .bp5-popover-content{background:#2d72d2;color:#fff}.bp5-control.bp5-switch:hover input:checked~.bp5-control-indicator,.bp5-dark .bp5-control.bp5-switch:hover input:checked~.bp5-control-indicator{background:#215db0}.bp5-control.bp5-switch input:checked:not(:disabled):active~.bp5-control-indicator,.bp5-dark .bp5-control.bp5-switch input:checked:not(:disabled):active~.bp5-control-indicator{background:#184a90}.bp5-control.bp5-switch input:checked:disabled~.bp5-control-indicator{background:rgba(45,114,210,.5);color:hsla(0,0%,100%,.6)}.bp5-control.bp5-switch input:checked:disabled~.bp5-control-indicator:before{background:hsla(0,0%,100%,.5);box-shadow:none}.bp5-control.bp5-switch:not(.bp5-align-right) .bp5-control-indicator{margin-left:-38px}.bp5-control.bp5-switch.bp5-align-right{padding-right:38px}.bp5-control.bp5-switch.bp5-align-right .bp5-control-indicator{margin-right:-38px}.bp5-control.bp5-switch .bp5-control-indicator{border:none;border-radius:1.75em;box-shadow:none!important;min-width:1.75em;transition:background-color .1s cubic-bezier(.4,1,.75,.9);width:auto}.bp5-control.bp5-switch .bp5-control-indicator:before{background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(17,20,24,.5);height:calc(1em - 4px);left:0;margin:2px;position:absolute;transition:left .1s cubic-bezier(.4,1,.75,.9);width:calc(1em - 4px)}.bp5-file-upload-input,.bp5-input{-webkit-appearance:none;border:none;box-shadow:0 0 0 0 rgba(45,114,210,0),0 0 0 0 rgba(45,114,210,0),inset 0 0 0 1px rgba(17,20,24,.2),inset 0 1px 1px rgba(17,20,24,.5);height:30px;line-height:30px;transition:box-shadow .1s cubic-bezier(.4,1,.75,.9);font-weight:400;vertical-align:middle;font-size:14px;outline:0}.bp5-control.bp5-switch input:checked~.bp5-control-indicator:before{left:calc(100% - 1em)}.bp5-control.bp5-switch.bp5-large:not(.bp5-align-right){padding-left:45px}.bp5-control.bp5-switch.bp5-large:not(.bp5-align-right) .bp5-control-indicator{margin-left:-45px}.bp5-control.bp5-switch.bp5-large.bp5-align-right{padding-right:45px}.bp5-control.bp5-switch.bp5-large.bp5-align-right .bp5-control-indicator{margin-right:-45px}.bp5-dark .bp5-control.bp5-switch input~.bp5-control-indicator{background:rgba(17,20,24,.5);color:#f6f7f9}.bp5-dark .bp5-control.bp5-switch:hover input~.bp5-control-indicator{background:rgba(17,20,24,.8)}.bp5-dark .bp5-control.bp5-switch input:not(:disabled):active~.bp5-control-indicator{background:rgba(17,20,24,.9)}.bp5-dark .bp5-control.bp5-switch input:disabled~.bp5-control-indicator{background:rgba(143,153,168,.15);color:rgba(171,179,191,.6)}.bp5-dark .bp5-control.bp5-switch input:disabled~.bp5-control-indicator:before{background:rgba(171,179,191,.5);box-shadow:none}.bp5-dark .bp5-control.bp5-switch input:checked:disabled~.bp5-control-indicator{background:rgba(45,114,210,.5);color:rgba(171,179,191,.6)}.bp5-dark .bp5-control.bp5-switch input:checked~.bp5-control-indicator:before,.bp5-input,.bp5-menu,.feature-strip:nth-child(2n){background:#fff}.bp5-dark .bp5-control.bp5-switch input:checked:disabled~.bp5-control-indicator:before{background:hsla(0,0%,100%,.3);box-shadow:none}.bp5-dark .bp5-control.bp5-switch .bp5-control-indicator:before,.bp5-dark .bp5-tag.bp5-interactive:hover{background:#abb3bf}.bp5-control.bp5-switch .bp5-switch-inner-text{font-size:.7em;text-align:center}.bp5-control.bp5-switch .bp5-control-indicator-child:first-child{line-height:0;margin-left:.5em;margin-right:1.2em;visibility:hidden}.bp5-control.bp5-switch .bp5-control-indicator-child:last-child{line-height:1em;margin-left:1.2em;margin-right:.5em;visibility:visible}.bp5-control.bp5-switch input:checked~.bp5-control-indicator .bp5-control-indicator-child:first-child{line-height:1em;visibility:visible}.bp5-control.bp5-switch input:checked~.bp5-control-indicator .bp5-control-indicator-child:last-child{line-height:0;visibility:hidden}.bp5-dark .bp5-control .bp5-control-indicator{background-color:transparent;box-shadow:inset 0 0 0 1px #8f99a8}.bp5-dark .bp5-control input:focus~.bp5-control-indicator{outline:#8abbff solid 2px}.bp5-dark .bp5-control input:not(:disabled):active~.bp5-control-indicator{background:rgba(143,153,168,.3);box-shadow:inset 0 0 0 1px #8f99a8}.bp5-dark .bp5-control.bp5-checkbox input:disabled:checked~.bp5-control-indicator,.bp5-dark .bp5-control.bp5-checkbox input:disabled:indeterminate~.bp5-control-indicator{background:rgba(45,114,210,.5)}.bp5-file-input{display:inline-block;height:30px}.bp5-file-upload-input,.bp5-file-upload-input:after{position:absolute;top:0;right:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.bp5-file-input input{margin:0;min-width:200px;opacity:0}.bp5-file-input input.bp5-disabled+.bp5-file-upload-input,.bp5-file-input input:disabled+.bp5-file-upload-input,.bp5-file-upload-input.bp5-disabled,.bp5-file-upload-input:disabled,.bp5-input.bp5-disabled,.bp5-input:disabled{background:rgba(211,216,222,.5);box-shadow:none;color:rgba(95,107,124,.6);cursor:not-allowed;resize:none}.bp5-file-input input.bp5-disabled+.bp5-file-upload-input::placeholder,.bp5-file-input input:disabled+.bp5-file-upload-input::placeholder{color:rgba(95,107,124,.6)}.bp5-dark .bp5-file-input input.bp5-disabled+.bp5-file-upload-input,.bp5-dark .bp5-file-input input:disabled+.bp5-file-upload-input,.bp5-dark .bp5-file-upload-input.bp5-disabled,.bp5-dark .bp5-file-upload-input:disabled,.bp5-dark .bp5-input.bp5-disabled,.bp5-dark .bp5-input:disabled{background:rgba(64,72,84,.5);box-shadow:none;color:rgba(171,179,191,.6)}.bp5-file-upload-input:active:after,.bp5-file-upload-input:hover:after,.bp5-slider-handle:hover{box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2)}.bp5-file-input.bp5-large,.bp5-large .bp5-file-input{height:40px}.bp5-file-input.bp5-small,.bp5-small .bp5-file-input{height:24px}.bp5-file-input .bp5-file-upload-input-custom-text:after{content:attr(bp5-button-text)}.bp5-file-upload-input{appearance:none;background:#fff;border-radius:2px;color:rgba(95,107,124,.6);left:0;padding:0 80px 0 10px;-webkit-user-select:none;user-select:none}.bp5-file-upload-input::placeholder{color:#5f6b7c;opacity:1}.bp5-file-upload-input.bp5-round,.bp5-file-upload-input[type=search],.bp5-input.bp5-round,.bp5-input[type=search]{border-radius:30px;box-sizing:border-box;padding-left:10px}.bp5-file-upload-input[readonly],.bp5-input[readonly]{box-shadow:inset 0 0 0 1px rgba(17,20,24,.15)}.bp5-file-upload-input.bp5-disabled::placeholder,.bp5-file-upload-input:disabled::placeholder{color:rgba(95,107,124,.6)}.bp5-file-upload-input:after{background-color:#f6f7f9;border-radius:2px;color:#1c2127;content:"Browse";line-height:24px;margin:3px;min-height:24px;min-width:24px;text-align:center;width:70px}.bp5-file-upload-input:hover:after{background-clip:padding-box;background-color:#edeff2}.bp5-file-upload-input:active:after{background-color:#dce0e5}.bp5-large .bp5-file-upload-input{font-size:16px;height:40px;line-height:40px;padding-right:95px}.bp5-input-group.bp5-large .bp5-input.bp5-round,.bp5-input-group.bp5-large .bp5-input[type=search],.bp5-input.bp5-large.bp5-round,.bp5-input.bp5-large[type=search],.bp5-large .bp5-file-upload-input.bp5-round,.bp5-large .bp5-file-upload-input[type=search]{padding:0 15px}.bp5-large .bp5-file-upload-input:after{line-height:30px;margin:5px;min-height:30px;min-width:30px;width:85px}.bp5-small .bp5-file-upload-input{font-size:12px;height:24px;line-height:24px;padding-left:8px;padding-right:65px}.bp5-input-group.bp5-small .bp5-input.bp5-round,.bp5-input-group.bp5-small .bp5-input[type=search],.bp5-input.bp5-small.bp5-round,.bp5-input.bp5-small[type=search],.bp5-small .bp5-file-upload-input.bp5-round,.bp5-small .bp5-file-upload-input[type=search]{padding:0 12px}.bp5-small .bp5-file-upload-input:after{line-height:20px;margin:2px;min-height:20px;min-width:20px;width:55px}.bp5-dark .bp5-file-upload-input{background:rgba(17,20,24,.3);box-shadow:0 0 0 0 rgba(76,144,240,0),0 0 0 0 rgba(76,144,240,0),0 0 0 0 rgba(76,144,240,0),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8;color:rgba(171,179,191,.6)}.bp5-dark .bp5-file-upload-input::placeholder{color:#abb3bf}.bp5-dark .bp5-file-upload-input:focus,.bp5-dark .bp5-input:focus{box-shadow:inset 0 0 0 1px #4c90f0,inset 0 0 0 1px #4c90f0,0 0 0 2px rgba(76,144,240,.3)}.bp5-dark .bp5-file-upload-input[readonly],.bp5-dark .bp5-input[readonly]{box-shadow:inset 0 0 0 1px rgba(17,20,24,.4)}.bp5-form-group{display:flex;flex-direction:column;margin:0 0 15px}.bp5-form-group .bp5-control{margin-top:7px}.bp5-form-group .bp5-form-group-sub-label,.bp5-form-group .bp5-form-helper-text{color:#5f6b7c;font-size:12px}.bp5-form-group.bp5-inline{align-items:flex-start;flex-direction:row}.bp5-form-group.bp5-inline.bp5-large label.bp5-label{line-height:40px;margin:0 10px 0 0}.bp5-form-group.bp5-inline label.bp5-label{line-height:30px;margin:0 10px 0 0}.bp5-form-group.bp5-disabled .bp5-form-group-sub-label,.bp5-form-group.bp5-disabled .bp5-form-helper-text,.bp5-form-group.bp5-disabled .bp5-label,.bp5-form-group.bp5-disabled .bp5-text-muted,.bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:disabled,.bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:disabled .bp5-icon,.bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:disabled .bp5-icon-large,.bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:disabled .bp5-icon-standard,.bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:disabled,.bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:disabled .bp5-icon,.bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:disabled .bp5-icon-large,.bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:disabled .bp5-icon-standard,.bp5-menu-item.bp5-disabled,.bp5-menu-item.bp5-disabled .bp5-menu-item-icon,.bp5-menu-item.bp5-disabled .bp5-menu-item-label,.bp5-menu-item.bp5-disabled .bp5-submenu-icon,.bp5-menu-item.bp5-disabled:before{color:rgba(95,107,124,.6)!important}.bp5-dark .bp5-form-group.bp5-intent-primary .bp5-form-group-sub-label,.bp5-dark .bp5-form-group.bp5-intent-primary .bp5-form-helper-text,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-primary,.bp5-dark .bp5-input-group.bp5-intent-primary>.bp5-icon,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-primary,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-] .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-] .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover:before,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-primary,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-primary{color:#8abbff}.bp5-dark .bp5-form-group.bp5-intent-success .bp5-form-group-sub-label,.bp5-dark .bp5-form-group.bp5-intent-success .bp5-form-helper-text,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-success,.bp5-dark .bp5-input-group.bp5-intent-success>.bp5-icon,.bp5-dark .bp5-menu-item.bp5-intent-success,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-success,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-success .bp5-tag-remove,.bp5-dark .bp5-tree .bp5-icon-large.bp5-intent-success,.bp5-dark .bp5-tree .bp5-icon-standard.bp5-intent-success,.bp5-dark .bp5-tree .bp5-icon.bp5-intent-success,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-success,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-success,.bp5-tooltip .bp5-icon-large.bp5-intent-success,.bp5-tooltip .bp5-icon-standard.bp5-intent-success,.bp5-tooltip .bp5-icon.bp5-intent-success{color:#72ca9b}.bp5-dark .bp5-form-group.bp5-intent-warning .bp5-form-group-sub-label,.bp5-dark .bp5-form-group.bp5-intent-warning .bp5-form-helper-text,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-warning,.bp5-dark .bp5-input-group.bp5-intent-warning>.bp5-icon,.bp5-dark .bp5-menu-item.bp5-intent-warning,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-warning,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-warning .bp5-tag-remove,.bp5-dark .bp5-tree .bp5-icon-large.bp5-intent-warning,.bp5-dark .bp5-tree .bp5-icon-standard.bp5-intent-warning,.bp5-dark .bp5-tree .bp5-icon.bp5-intent-warning,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-warning,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-warning,.bp5-tooltip .bp5-icon-large.bp5-intent-warning,.bp5-tooltip .bp5-icon-standard.bp5-intent-warning,.bp5-tooltip .bp5-icon.bp5-intent-warning{color:#fbb360}.bp5-dark .bp5-form-group.bp5-intent-danger .bp5-form-group-sub-label,.bp5-dark .bp5-form-group.bp5-intent-danger .bp5-form-helper-text,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-danger,.bp5-dark .bp5-input-group.bp5-intent-danger>.bp5-icon,.bp5-dark .bp5-menu-item.bp5-intent-danger,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-danger,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-danger .bp5-tag-remove,.bp5-dark .bp5-tree .bp5-icon-large.bp5-intent-danger,.bp5-dark .bp5-tree .bp5-icon-standard.bp5-intent-danger,.bp5-dark .bp5-tree .bp5-icon.bp5-intent-danger,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-danger,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-danger,.bp5-tooltip .bp5-icon-large.bp5-intent-danger,.bp5-tooltip .bp5-icon-standard.bp5-intent-danger,.bp5-tooltip .bp5-icon.bp5-intent-danger{color:#fa999c}.bp5-dark .bp5-form-group .bp5-form-helper-text,.bp5-dark .bp5-input-group .bp5-icon,.bp5-dark .bp5-input-group .bp5-input:not(:focus)+.bp5-button.bp5-minimal:not(:hover):not(:focus),.bp5-dark .bp5-input-group .bp5-input:not(:focus)+.bp5-input-action .bp5-button.bp5-minimal:not(:hover):not(:focus){color:#abb3bf}.bp5-dark .bp5-form-group.bp5-disabled .bp5-form-group-sub-label,.bp5-dark .bp5-form-group.bp5-disabled .bp5-form-helper-text,.bp5-dark .bp5-form-group.bp5-disabled .bp5-label,.bp5-dark .bp5-form-group.bp5-disabled .bp5-text-muted,.bp5-dark .bp5-menu-item.bp5-disabled,.bp5-dark .bp5-menu-item.bp5-disabled .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-disabled .bp5-menu-item-label,.bp5-dark .bp5-menu-item.bp5-disabled .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-disabled:before{color:rgba(171,179,191,.6)!important}.bp5-input-group{display:block;position:relative}.bp5-input-group .bp5-input{position:relative;width:100%}.bp5-input-group .bp5-input-action,.bp5-input-group>.bp5-button,.bp5-input-group>.bp5-icon,.bp5-input-group>.bp5-input-left-container{position:absolute;top:0}.bp5-input-group .bp5-input-action:first-child,.bp5-input-group>.bp5-button:first-child,.bp5-input-group>.bp5-icon:first-child,.bp5-input-group>.bp5-input-left-container:first-child{left:0}.bp5-input-group .bp5-input-action:last-child,.bp5-input-group>.bp5-button:last-child,.bp5-input-group>.bp5-icon:last-child,.bp5-input-group>.bp5-input-left-container:last-child{right:0}.bp5-input-group .bp5-button{margin:3px;min-height:24px;min-width:24px;padding:0 7px}.bp5-input-group>.bp5-icon:empty,.bp5-input-group>.bp5-input-left-container>.bp5-icon:empty{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:blueprint-icons-16,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:400;height:16px;line-height:1;width:16px}.bp5-input-group .bp5-input-action>.bp5-spinner,.bp5-input-group>.bp5-icon,.bp5-input-group>.bp5-input-left-container>.bp5-icon{margin:7px}.bp5-input-group .bp5-tag,.playground-container hr{margin:5px}.bp5-input-group.bp5-disabled .bp5-icon{color:rgba(95,107,124,.6)}.bp5-input-group.bp5-large .bp5-button{margin:5px;min-height:30px;min-width:30px}.bp5-input-group.bp5-large .bp5-input-action>.bp5-spinner,.bp5-input-group.bp5-large>.bp5-icon,.bp5-input-group.bp5-large>.bp5-input-left-container>.bp5-icon{margin:12px}.bp5-input-group.bp5-large .bp5-input,.bp5-input.bp5-large{font-size:16px;height:40px;line-height:40px}.bp5-input-group.bp5-large .bp5-input:not(:first-child){padding-left:40px}.bp5-input-group.bp5-large .bp5-input:not(:last-child){padding-right:40px}.bp5-input-group.bp5-small .bp5-button,.bp5-input-group.bp5-small .bp5-tag{margin:2px;min-height:20px;min-width:20px}.bp5-input-group.bp5-small .bp5-input-action>.bp5-spinner,.bp5-input-group.bp5-small>.bp5-icon,.bp5-input-group.bp5-small>.bp5-input-left-container>.bp5-icon{margin:4px}.bp5-input-group.bp5-small .bp5-input,.bp5-input.bp5-small{font-size:12px;height:24px;line-height:24px;padding-left:8px;padding-right:8px}.bp5-input-group.bp5-small .bp5-input:not(:first-child){padding-left:24px}.bp5-input-group.bp5-small .bp5-input:not(:last-child){padding-right:24px}.bp5-input-group.bp5-fill,.bp5-input.bp5-fill{flex:1 1 auto;width:100%}.bp5-input-group.bp5-round .bp5-button,.bp5-input-group.bp5-round .bp5-input,.bp5-input-group.bp5-round .bp5-tag{border-radius:30px}.bp5-input-group.bp5-intent-primary .bp5-input,.bp5-input.bp5-intent-primary{box-shadow:0 0 0 0 rgba(45,114,210,0),0 0 0 0 rgba(45,114,210,0),inset 0 0 0 1px #2d72d2,inset 0 0 0 1px rgba(17,20,24,.2),inset 0 1px 1px rgba(17,20,24,.5)}.bp5-input-group.bp5-intent-primary .bp5-input[readonly],.bp5-input.bp5-intent-primary[readonly]{box-shadow:inset 0 0 0 1px #2d72d2}.bp5-dark .bp5-input-group.bp5-intent-primary .bp5-input,.bp5-dark .bp5-input.bp5-intent-primary{box-shadow:0 0 0 0 rgba(76,144,240,0),0 0 0 0 rgba(76,144,240,0),0 0 0 0 rgba(76,144,240,0),inset 0 0 0 1px #4c90f0,inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-input-group.bp5-intent-primary .bp5-input:focus,.bp5-dark .bp5-input.bp5-intent-primary:focus{box-shadow:inset 0 0 0 1px #4c90f0,inset 0 0 0 1px #4c90f0,0 0 0 2px rgba(76,144,240,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-input-group.bp5-intent-primary .bp5-input[readonly],.bp5-dark .bp5-input.bp5-intent-primary[readonly]{box-shadow:inset 0 0 0 1px #4c90f0}.bp5-input-group.bp5-intent-success .bp5-input,.bp5-input.bp5-intent-success{box-shadow:0 0 0 0 rgba(35,133,81,0),0 0 0 0 rgba(35,133,81,0),inset 0 0 0 1px #238551,inset 0 0 0 1px rgba(17,20,24,.2),inset 0 1px 1px rgba(17,20,24,.5)}.bp5-input-group.bp5-intent-success .bp5-input[readonly],.bp5-input.bp5-intent-success[readonly]{box-shadow:inset 0 0 0 1px #238551}.bp5-dark .bp5-input-group.bp5-intent-success .bp5-input,.bp5-dark .bp5-input.bp5-intent-success{box-shadow:0 0 0 0 rgba(50,164,103,0),0 0 0 0 rgba(50,164,103,0),0 0 0 0 rgba(50,164,103,0),inset 0 0 0 1px #32a467,inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-input-group.bp5-intent-success .bp5-input:focus,.bp5-dark .bp5-input.bp5-intent-success:focus{box-shadow:inset 0 0 0 1px #32a467,inset 0 0 0 1px #32a467,0 0 0 2px rgba(50,164,103,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-input-group.bp5-intent-success .bp5-input[readonly],.bp5-dark .bp5-input.bp5-intent-success[readonly]{box-shadow:inset 0 0 0 1px #32a467}.bp5-input-group.bp5-intent-warning .bp5-input,.bp5-input.bp5-intent-warning{box-shadow:0 0 0 0 rgba(200,118,25,0),0 0 0 0 rgba(200,118,25,0),inset 0 0 0 1px #c87619,inset 0 0 0 1px rgba(17,20,24,.2),inset 0 1px 1px rgba(17,20,24,.5)}.bp5-input-group.bp5-intent-warning .bp5-input[readonly],.bp5-input.bp5-intent-warning[readonly]{box-shadow:inset 0 0 0 1px #c87619}.bp5-dark .bp5-input-group.bp5-intent-warning .bp5-input,.bp5-dark .bp5-input.bp5-intent-warning{box-shadow:0 0 0 0 rgba(236,154,60,0),0 0 0 0 rgba(236,154,60,0),0 0 0 0 rgba(236,154,60,0),inset 0 0 0 1px #ec9a3c,inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-input-group.bp5-intent-warning .bp5-input:focus,.bp5-dark .bp5-input.bp5-intent-warning:focus{box-shadow:inset 0 0 0 1px #ec9a3c,inset 0 0 0 1px #ec9a3c,0 0 0 2px rgba(236,154,60,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-input-group.bp5-intent-warning .bp5-input[readonly],.bp5-dark .bp5-input.bp5-intent-warning[readonly]{box-shadow:inset 0 0 0 1px #ec9a3c}.bp5-input-group.bp5-intent-danger .bp5-input,.bp5-input.bp5-intent-danger{box-shadow:0 0 0 0 rgba(205,66,70,0),0 0 0 0 rgba(205,66,70,0),inset 0 0 0 1px #cd4246,inset 0 0 0 1px rgba(17,20,24,.2),inset 0 1px 1px rgba(17,20,24,.5)}.bp5-input-group.bp5-intent-danger .bp5-input[readonly],.bp5-input.bp5-intent-danger[readonly]{box-shadow:inset 0 0 0 1px #cd4246}.bp5-dark .bp5-input-group.bp5-intent-danger .bp5-input,.bp5-dark .bp5-input.bp5-intent-danger{box-shadow:0 0 0 0 rgba(231,106,110,0),0 0 0 0 rgba(231,106,110,0),0 0 0 0 rgba(231,106,110,0),inset 0 0 0 1px #e76a6e,inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-input-group.bp5-intent-danger .bp5-input:focus,.bp5-dark .bp5-input.bp5-intent-danger:focus{box-shadow:inset 0 0 0 1px #e76a6e,inset 0 0 0 1px #e76a6e,0 0 0 2px rgba(231,106,110,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-input-group.bp5-intent-danger .bp5-input[readonly],.bp5-dark .bp5-input.bp5-intent-danger[readonly]{box-shadow:inset 0 0 0 1px #e76a6e}.bp5-input{appearance:none;border-radius:2px;color:#1c2127;padding:0 10px}.bp5-input::placeholder{color:#5f6b7c;opacity:1}.bp5-input.bp5-disabled::placeholder,.bp5-input:disabled::placeholder{color:rgba(95,107,124,.6)}.bp5-dark .bp5-input{background:rgba(17,20,24,.3);box-shadow:0 0 0 0 rgba(76,144,240,0),0 0 0 0 rgba(76,144,240,0),0 0 0 0 rgba(76,144,240,0),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8;color:#f6f7f9}.bp5-dark .bp5-input::placeholder{color:#abb3bf}.bp5-input::-ms-clear{display:none}@supports (-webkit-touch-callout:none){input.bp5-input.bp5-disabled,input.bp5-input:disabled{-webkit-text-fill-color:rgba(95,107,124,.6);opacity:1}.bp5-dark input.bp5-input.bp5-disabled,.bp5-dark input.bp5-input:disabled{-webkit-text-fill-color:rgba(171,179,191,.6)}}textarea.bp5-input{max-width:100%;padding:10px}textarea.bp5-input,textarea.bp5-input.bp5-large,textarea.bp5-input.bp5-small{height:auto;line-height:inherit}textarea.bp5-input.bp5-small{padding:8px}label.bp5-label{display:block;margin-bottom:15px;margin-top:0}label.bp5-label .bp5-html-select,label.bp5-label .bp5-input,label.bp5-label .bp5-popover-target,label.bp5-label .bp5-popover-wrapper,label.bp5-label .bp5-select,label.bp5-label .bp5-slider{display:block;margin-top:5px;text-transform:none}label.bp5-label .bp5-html-select select,label.bp5-label .bp5-select select{font-weight:400;vertical-align:top;width:100%}.bp5-dark .bp5-tooltip .bp5-text-disabled,.bp5-disabled.bp5-select:after,.bp5-html-select .bp5-disabled.bp5-icon,.bp5-select .bp5-disabled.bp5-icon,.bp5-tooltip.bp5-dark .bp5-text-disabled,label.bp5-label.bp5-disabled,label.bp5-label.bp5-disabled .bp5-text-muted{color:rgba(95,107,124,.6)}.bp5-tag-input.bp5-large .bp5-input-ghost,label.bp5-label.bp5-inline{line-height:30px}.bp5-select:after,span.bp5-icon-large,span.bp5-icon-standard,span.bp5-icon:empty{line-height:1;font-style:normal;font-weight:400}label.bp5-label.bp5-inline .bp5-html-select,label.bp5-label.bp5-inline .bp5-input,label.bp5-label.bp5-inline .bp5-input-group,label.bp5-label.bp5-inline .bp5-popover-wrapper,label.bp5-label.bp5-inline .bp5-select{display:inline-block;margin:0 0 0 5px;vertical-align:top}label.bp5-label.bp5-inline .bp5-button-group,label.bp5-label.bp5-inline .bp5-control-group{margin:0 0 0 5px}.bp5-slider-handle.bp5-end .bp5-slider-label,label.bp5-label.bp5-inline .bp5-input-group .bp5-input{margin-left:0}label.bp5-label.bp5-inline.bp5-large{line-height:40px}.bp5-numeric-input .bp5-button-group.bp5-vertical>.bp5-button{flex:1 1 11px;min-height:0;padding:0;width:24px}.bp5-numeric-input.bp5-large .bp5-button-group.bp5-vertical>.bp5-button{width:40px}.bp5-numeric-input.bp5-small .bp5-button-group.bp5-vertical>.bp5-button{width:24px}.bp5-html-select select,.bp5-select select{align-items:center;-moz-appearance:none;-webkit-appearance:none;background-color:#f6f7f9;border:none;border-radius:2px;color:#1c2127;cursor:pointer;display:inline-flex;flex-direction:row;font-size:14px;height:30px;justify-content:center;padding:0 25px 0 10px;text-align:left;vertical-align:middle;width:100%}.bp5-menu-item:before,.bp5-select:after,span.bp5-icon-standard{font-family:blueprint-icons-16,sans-serif;width:16px}.bp5-html-select select.bp5-disabled.bp5-active,.bp5-html-select select:disabled.bp5-active,.bp5-select select.bp5-disabled.bp5-active,.bp5-select select:disabled.bp5-active{background:rgba(211,216,222,.7)}.bp5-html-select.bp5-minimal select.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal select:disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-disabled.bp5-active,.bp5-select.bp5-minimal select:disabled.bp5-active{background:rgba(143,153,168,.3)}.bp5-dark .bp5-html-select.bp5-minimal select.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select:active,.bp5-dark .bp5-select.bp5-minimal select.bp5-active,.bp5-dark .bp5-select.bp5-minimal select:active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select:active,.bp5-select.bp5-minimal .bp5-dark select.bp5-active,.bp5-select.bp5-minimal .bp5-dark select:active{background:rgba(143,153,168,.3)}.bp5-dark .bp5-html-select.bp5-minimal select.bp5-disabled.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select:disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select:disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select:disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select:disabled.bp5-active{background:rgba(143,153,168,.3)}.bp5-html-select.bp5-minimal select.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-primary:disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-primary:disabled.bp5-active{background:rgba(45,114,210,.3)}.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-primary:disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-primary:disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-primary:disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-primary.bp5-disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-primary:disabled.bp5-active{background:rgba(45,114,210,.3)}.bp5-html-select.bp5-minimal select.bp5-intent-success.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-success:disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-success.bp5-disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-success:disabled.bp5-active{background:rgba(35,133,81,.3)}.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-success.bp5-disabled.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-success:disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-success.bp5-disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-success:disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-success.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-success:disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-success.bp5-disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-success:disabled.bp5-active{background:rgba(35,133,81,.3)}.bp5-html-select.bp5-minimal select.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-warning:disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-warning:disabled.bp5-active{background:rgba(200,118,25,.3)}.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-warning:disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-warning:disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-warning:disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-warning.bp5-disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-warning:disabled.bp5-active{background:rgba(200,118,25,.3)}.bp5-html-select.bp5-minimal select.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal select.bp5-intent-danger:disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-select.bp5-minimal select.bp5-intent-danger:disabled.bp5-active{background:rgba(205,66,70,.3)}.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-dark .bp5-html-select.bp5-minimal select.bp5-intent-danger:disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-dark .bp5-select.bp5-minimal select.bp5-intent-danger:disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-html-select.bp5-minimal .bp5-dark select.bp5-intent-danger:disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-danger.bp5-disabled.bp5-active,.bp5-select.bp5-minimal .bp5-dark select.bp5-intent-danger:disabled.bp5-active{background:rgba(205,66,70,.3)}.bp5-html-select.bp5-large select,.bp5-select.bp5-large select{font-size:16px;height:40px;padding-right:35px}.bp5-dark .bp5-html-select select.bp5-disabled.bp5-active,.bp5-dark .bp5-html-select select:disabled.bp5-active,.bp5-dark .bp5-select select.bp5-disabled.bp5-active,.bp5-dark .bp5-select select:disabled.bp5-active{background:rgba(64,72,84,.7)}.bp5-html-select select:disabled,.bp5-select select:disabled{background-color:rgba(211,216,222,.5);box-shadow:none;color:rgba(95,107,124,.6);cursor:not-allowed}.bp5-html-select .bp5-icon,.bp5-select .bp5-icon,.bp5-select:after{color:#5f6b7c;pointer-events:none;position:absolute;right:7px;top:7px}.bp5-html-select,.bp5-select{display:inline-block;letter-spacing:normal;position:relative;vertical-align:middle}.bp5-html-select select::-ms-expand,.bp5-select select::-ms-expand{display:none}.bp5-dark .bp5-html-select .bp5-icon,.bp5-dark .bp5-html-select:after,.bp5-dark .bp5-menu-item .bp5-menu-item-icon,.bp5-dark .bp5-menu-item .bp5-menu-item-label,.bp5-dark .bp5-menu-item .bp5-submenu-icon,.bp5-dark .bp5-menu-item:before,.bp5-dark .bp5-menu-item:hover .bp5-menu-item-icon,.bp5-dark .bp5-menu-item:hover .bp5-submenu-icon,.bp5-dark .bp5-non-ideal-state,.bp5-dark .bp5-non-ideal-state .bp5-heading,.bp5-dark .bp5-select .bp5-icon,.bp5-dark .bp5-select:after,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]) .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]) .bp5-submenu-icon,.bp5-dark .bp5-tag-input .bp5-tag-input-icon,.bp5-dark .bp5-tag.bp5-minimal:not([class*=bp5-intent-]) .bp5-tag-remove,.bp5-tag-input.bp5-dark .bp5-tag-input-icon{color:#abb3bf}.bp5-html-select.bp5-large .bp5-icon,.bp5-html-select.bp5-large:after,.bp5-select.bp5-large .bp5-icon,.bp5-select.bp5-large:after{right:12px;top:12px}.bp5-dark .bp5-html-select option,.bp5-dark .bp5-select option{background-color:#2f343c;color:#f6f7f9}.bp5-select:after{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;content:"\f184";font-size:16px;font-variant:normal;height:16px}.bp5-running-text table,table.bp5-html-table{border-spacing:0;font-size:14px}.bp5-running-text table td,.bp5-running-text table th,table.bp5-html-table td,table.bp5-html-table th{padding:11px;text-align:left;vertical-align:top}.bp5-running-text table th,table.bp5-html-table th{color:#1c2127;font-weight:600}.bp5-running-text table tbody tr:first-child td,.bp5-running-text table tbody tr:first-child th,.bp5-running-text table tfoot tr:first-child td,.bp5-running-text table tfoot tr:first-child th,table.bp5-html-table tbody tr:first-child td,table.bp5-html-table tbody tr:first-child th,table.bp5-html-table tfoot tr:first-child td,table.bp5-html-table tfoot tr:first-child th,table.bp5-html-table.bp5-html-table-bordered tbody tr td,table.bp5-html-table.bp5-html-table-bordered tfoot tr td{box-shadow:inset 0 1px 0 0 rgba(17,20,24,.15)}.bp5-dark .bp5-running-text table tbody tr:first-child td,.bp5-dark .bp5-running-text table tbody tr:first-child th,.bp5-dark .bp5-running-text table tfoot tr:first-child td,.bp5-dark .bp5-running-text table tfoot tr:first-child th,.bp5-dark table.bp5-html-table tbody tr:first-child td,.bp5-dark table.bp5-html-table tbody tr:first-child th,.bp5-dark table.bp5-html-table tfoot tr:first-child td,.bp5-dark table.bp5-html-table tfoot tr:first-child th,.bp5-dark table.bp5-html-table.bp5-html-table-bordered tbody tr td,.bp5-dark table.bp5-html-table.bp5-html-table-bordered tfoot tr td,.bp5-running-text .bp5-dark table tbody tr:first-child td,.bp5-running-text .bp5-dark table tbody tr:first-child th,.bp5-running-text .bp5-dark table tfoot tr:first-child td,.bp5-running-text .bp5-dark table tfoot tr:first-child th{box-shadow:inset 0 1px 0 0 hsla(0,0%,100%,.2)}table.bp5-html-table.bp5-compact td,table.bp5-html-table.bp5-compact th{padding-bottom:6px;padding-top:6px}table.bp5-html-table.bp5-html-table-bordered th:not(:first-child),table.bp5-html-table.bp5-html-table-bordered.bp5-html-table-striped tbody tr:not(:first-child) td:not(:first-child){box-shadow:inset 1px 0 0 0 rgba(17,20,24,.15)}table.bp5-html-table.bp5-html-table-bordered tbody tr td:not(:first-child),table.bp5-html-table.bp5-html-table-bordered tfoot tr td:not(:first-child){box-shadow:inset 1px 1px 0 0 rgba(17,20,24,.15)}table.bp5-html-table.bp5-interactive tbody tr:hover td{background-color:rgba(143,153,168,.3);cursor:pointer}table.bp5-html-table.bp5-interactive tbody tr:active td{background-color:rgba(143,153,168,.35)}.bp5-dark table.bp5-html-table.bp5-html-table-striped tbody tr:nth-child(odd) td{background:rgba(95,107,124,.15)}.bp5-dark table.bp5-html-table.bp5-html-table-bordered th:not(:first-child),.bp5-dark table.bp5-html-table.bp5-html-table-bordered.bp5-html-table-striped tbody tr:not(:first-child) td{box-shadow:inset 1px 0 0 0 hsla(0,0%,100%,.2)}.bp5-dark table.bp5-html-table.bp5-html-table-bordered tbody tr td:not(:first-child),.bp5-dark table.bp5-html-table.bp5-html-table-bordered tfoot tr td:not(:first-child){box-shadow:inset 1px 1px 0 0 hsla(0,0%,100%,.2)}.bp5-dark table.bp5-html-table.bp5-interactive tbody tr:hover td{background-color:rgba(95,107,124,.3);cursor:pointer}.bp5-dark table.bp5-html-table.bp5-interactive tbody tr:active td{background-color:rgba(95,107,124,.4)}.bp5-key-combo{align-items:center;display:flex;flex-direction:row}.bp5-hotkey-dialog{padding-bottom:0;top:40px}.bp5-hotkey-dialog .bp5-dialog-body,.output-jsx>main li,.output-log>main li{margin:0;padding:0}.bp5-hotkey-column{margin:auto;max-height:80vh;overflow-y:auto;padding:30px}.bp5-hotkey-column .bp5-heading,.bp5-non-ideal-state:before,.bp5-non-ideal-state>*{margin-bottom:20px}.bp5-hotkey-column .bp5-heading:not(:first-child){margin-top:40px}.bp5-hotkey{align-items:center;display:flex;justify-content:space-between;margin-left:0;margin-right:0}.add-node-menu header,.bp5-hotkey:not(:last-child),.data-inspection-modal .main-wrapper .content-wrapper .info,.run-flow-modal .execution-delay-wrapper label{margin-bottom:10px}.bp5-icon{display:inline-block;flex:0 0 auto;vertical-align:text-bottom}.bp5-icon:not(:empty):before{content:""!important;content:unset!important}.bp5-dark .bp5-tag .bp5-icon-large,.bp5-dark .bp5-tag .bp5-icon-standard,.bp5-dark .bp5-tag>.bp5-icon,.bp5-icon>svg:not([fill]){fill:currentcolor}span.bp5-icon-standard{font-size:16px;height:16px}.bp5-large .bp5-menu-item:before,.bp5-large .bp5-tag-remove:empty:before,span.bp5-icon-large{font-family:blueprint-icons-20,sans-serif;font-size:20px}span.bp5-icon-large,span.bp5-icon-standard{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-variant:normal}span.bp5-icon-large{height:20px;width:20px}.home-page a,.output-jsx>main button{font-size:30px}span.bp5-icon:empty{font-family:blueprint-icons-20;font-size:inherit}span.bp5-icon:empty:before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.bp5-icon-add:before{content:"\f109"}.bp5-icon-add-clip:before{content:"\f101"}.bp5-icon-add-column-left:before{content:"\f102"}.bp5-icon-add-column-right:before{content:"\f103"}.bp5-icon-add-location:before{content:"\f104"}.bp5-icon-add-row-bottom:before{content:"\f105"}.bp5-icon-add-row-top:before{content:"\f106"}.bp5-icon-add-to-artifact:before{content:"\f107"}.bp5-icon-add-to-folder:before{content:"\f108"}.bp5-icon-aimpoints-target:before{content:"\f335"}.bp5-icon-airplane:before{content:"\f10a"}.bp5-icon-align-center:before{content:"\f10b"}.bp5-icon-align-justify:before{content:"\f10c"}.bp5-icon-align-left:before{content:"\f10d"}.bp5-icon-align-right:before{content:"\f10e"}.bp5-icon-alignment-bottom:before{content:"\f10f"}.bp5-icon-alignment-horizontal-center:before{content:"\f110"}.bp5-icon-alignment-left:before{content:"\f111"}.bp5-icon-alignment-right:before{content:"\f112"}.bp5-icon-alignment-top:before{content:"\f113"}.bp5-icon-alignment-vertical-center:before{content:"\f114"}.bp5-icon-ammunition:before{content:"\f342"}.bp5-icon-anchor:before{content:"\f330"}.bp5-icon-annotation:before{content:"\f115"}.bp5-icon-antenna:before{content:"\f116"}.bp5-icon-app-header:before{content:"\f117"}.bp5-icon-application:before{content:"\f118"}.bp5-icon-applications:before{content:"\f119"}.bp5-icon-archive:before{content:"\f11a"}.bp5-icon-area-of-interest:before{content:"\f11b"}.bp5-icon-array:before{content:"\f121"}.bp5-icon-array-boolean:before{content:"\f11c"}.bp5-icon-array-date:before{content:"\f11d"}.bp5-icon-array-floating-point:before{content:"\f32d"}.bp5-icon-array-numeric:before{content:"\f11e"}.bp5-icon-array-string:before{content:"\f11f"}.bp5-icon-array-timestamp:before{content:"\f120"}.bp5-icon-arrow-bottom-left:before{content:"\f122"}.bp5-icon-arrow-bottom-right:before{content:"\f123"}.bp5-icon-arrow-down:before{content:"\f124"}.bp5-icon-arrow-left:before{content:"\f125"}.bp5-icon-arrow-right:before{content:"\f126"}.bp5-icon-arrow-top-left:before{content:"\f127"}.bp5-icon-arrow-top-right:before{content:"\f128"}.bp5-icon-arrow-up:before{content:"\f129"}.bp5-icon-arrows-horizontal:before{content:"\f12a"}.bp5-icon-arrows-vertical:before{content:"\f12b"}.bp5-icon-asterisk:before{content:"\f12c"}.bp5-icon-at:before{content:"\f331"}.bp5-icon-automatic-updates:before{content:"\f12d"}.bp5-icon-axle:before{content:"\f338"}.bp5-icon-backlink:before{content:"\f12e"}.bp5-icon-badge:before{content:"\f12f"}.bp5-icon-ban-circle:before{content:"\f130"}.bp5-icon-bank-account:before{content:"\f131"}.bp5-icon-barcode:before{content:"\f132"}.bp5-icon-blank:before{content:"\f133"}.bp5-icon-blocked-person:before{content:"\f134"}.bp5-icon-bold:before{content:"\f135"}.bp5-icon-book:before{content:"\f136"}.bp5-icon-bookmark:before{content:"\f137"}.bp5-icon-box:before{content:"\f138"}.bp5-icon-briefcase:before{content:"\f139"}.bp5-icon-bring-data:before{content:"\f13a"}.bp5-icon-bug:before{content:"\f32e"}.bp5-icon-buggy:before{content:"\f13b"}.bp5-icon-build:before{content:"\f13c"}.bp5-icon-calculator:before{content:"\f13d"}.bp5-icon-calendar:before{content:"\f13e"}.bp5-icon-camera:before{content:"\f13f"}.bp5-icon-caret-down:before{content:"\f140"}.bp5-icon-caret-left:before{content:"\f141"}.bp5-icon-caret-right:before{content:"\f142"}.bp5-icon-caret-up:before{content:"\f143"}.bp5-icon-cargo-ship:before{content:"\f144"}.bp5-icon-cell-tower:before{content:"\f145"}.bp5-icon-changes:before{content:"\f146"}.bp5-icon-chart:before{content:"\f147"}.bp5-icon-chat:before{content:"\f148"}.bp5-icon-chevron-backward:before{content:"\f149"}.bp5-icon-chevron-down:before{content:"\f14a"}.bp5-icon-chevron-forward:before{content:"\f14b"}.bp5-icon-chevron-left:before{content:"\f14c"}.bp5-icon-chevron-right:before,.bp5-tree-node-caret.bp5-icon-standard:before{content:"\f14d"}.bp5-icon-chevron-up:before{content:"\f14e"}.bp5-icon-circle:before{content:"\f153"}.bp5-icon-circle-arrow-down:before{content:"\f14f"}.bp5-icon-circle-arrow-left:before{content:"\f150"}.bp5-icon-circle-arrow-right:before{content:"\f151"}.bp5-icon-circle-arrow-up:before{content:"\f152"}.bp5-icon-citation:before{content:"\f154"}.bp5-icon-clean:before{content:"\f155"}.bp5-icon-clip:before{content:"\f156"}.bp5-icon-clipboard:before{content:"\f157"}.bp5-icon-cloud:before{content:"\f15a"}.bp5-icon-cloud-download:before{content:"\f158"}.bp5-icon-cloud-upload:before{content:"\f159"}.bp5-icon-code:before{content:"\f15c"}.bp5-icon-code-block:before{content:"\f15b"}.bp5-icon-cog:before{content:"\f15d"}.bp5-icon-collapse-all:before{content:"\f15e"}.bp5-icon-color-fill:before{content:"\f328"}.bp5-icon-column-layout:before{content:"\f15f"}.bp5-icon-comment:before{content:"\f160"}.bp5-icon-comparison:before{content:"\f161"}.bp5-icon-compass:before{content:"\f162"}.bp5-icon-compressed:before{content:"\f163"}.bp5-icon-confirm:before{content:"\f164"}.bp5-icon-console:before{content:"\f165"}.bp5-icon-contrast:before{content:"\f166"}.bp5-icon-control:before{content:"\f167"}.bp5-icon-credit-card:before{content:"\f168"}.bp5-icon-cross:before{content:"\f169"}.bp5-icon-cross-circle:before{content:"\f336"}.bp5-icon-crown:before{content:"\f16a"}.bp5-icon-cube:before{content:"\f16d"}.bp5-icon-cube-add:before{content:"\f16b"}.bp5-icon-cube-remove:before{content:"\f16c"}.bp5-icon-curved-range-chart:before{content:"\f16e"}.bp5-icon-cut:before{content:"\f16f"}.bp5-icon-cycle:before{content:"\f170"}.bp5-icon-dashboard:before{content:"\f171"}.bp5-icon-data-connection:before{content:"\f172"}.bp5-icon-data-lineage:before{content:"\f173"}.bp5-icon-database:before{content:"\f174"}.bp5-icon-delete:before{content:"\f175"}.bp5-icon-delta:before{content:"\f176"}.bp5-icon-derive-column:before{content:"\f177"}.bp5-icon-desktop:before{content:"\f178"}.bp5-icon-detection:before{content:"\f341"}.bp5-icon-diagnosis:before{content:"\f179"}.bp5-icon-diagram-tree:before{content:"\f17a"}.bp5-icon-direction-left:before{content:"\f17b"}.bp5-icon-direction-right:before{content:"\f17c"}.bp5-icon-disable:before{content:"\f17d"}.bp5-icon-divide:before{content:"\f327"}.bp5-icon-document:before{content:"\f180"}.bp5-icon-document-open:before{content:"\f17e"}.bp5-icon-document-share:before{content:"\f17f"}.bp5-icon-dollar:before{content:"\f181"}.bp5-icon-dot:before{content:"\f182"}.bp5-icon-double-caret-horizontal:before{content:"\f183"}.bp5-icon-double-caret-vertical:before{content:"\f184"}.bp5-icon-double-chevron-down:before{content:"\f185"}.bp5-icon-double-chevron-left:before{content:"\f186"}.bp5-icon-double-chevron-right:before{content:"\f187"}.bp5-icon-double-chevron-up:before{content:"\f188"}.bp5-icon-doughnut-chart:before{content:"\f189"}.bp5-icon-download:before{content:"\f18a"}.bp5-icon-drag-handle-horizontal:before{content:"\f18b"}.bp5-icon-drag-handle-vertical:before{content:"\f18c"}.bp5-icon-draw:before{content:"\f18d"}.bp5-icon-drawer-left:before{content:"\f18f"}.bp5-icon-drawer-left-filled:before{content:"\f18e"}.bp5-icon-drawer-right:before{content:"\f191"}.bp5-icon-drawer-right-filled:before{content:"\f190"}.bp5-icon-drive-time:before{content:"\f192"}.bp5-icon-duplicate:before{content:"\f193"}.bp5-icon-edit:before{content:"\f194"}.bp5-icon-eject:before{content:"\f195"}.bp5-icon-emoji:before{content:"\f196"}.bp5-icon-endorsed:before{content:"\f197"}.bp5-icon-envelope:before{content:"\f198"}.bp5-icon-equals:before{content:"\f199"}.bp5-icon-eraser:before{content:"\f19a"}.bp5-icon-error:before{content:"\f19b"}.bp5-icon-euro:before{content:"\f19c"}.bp5-icon-exchange:before{content:"\f19d"}.bp5-icon-exclude-row:before{content:"\f19e"}.bp5-icon-expand-all:before{content:"\f19f"}.bp5-icon-export:before{content:"\f1a0"}.bp5-icon-eye-off:before{content:"\f1a1"}.bp5-icon-eye-on:before{content:"\f1a2"}.bp5-icon-eye-open:before{content:"\f1a3"}.bp5-icon-fast-backward:before{content:"\f1a4"}.bp5-icon-fast-forward:before{content:"\f1a5"}.bp5-icon-feed:before{content:"\f1a7"}.bp5-icon-feed-subscribed:before{content:"\f1a6"}.bp5-icon-film:before{content:"\f1a8"}.bp5-icon-filter:before{content:"\f1ad"}.bp5-icon-filter-keep:before{content:"\f1a9"}.bp5-icon-filter-list:before{content:"\f1aa"}.bp5-icon-filter-open:before{content:"\f1ab"}.bp5-icon-filter-remove:before{content:"\f1ac"}.bp5-icon-flag:before{content:"\f1ae"}.bp5-icon-flame:before{content:"\f1af"}.bp5-icon-flash:before{content:"\f1b0"}.bp5-icon-floating-point:before{content:"\f32c"}.bp5-icon-floppy-disk:before{content:"\f1b1"}.bp5-icon-flow-branch:before{content:"\f1b2"}.bp5-icon-flow-end:before{content:"\f1b3"}.bp5-icon-flow-linear:before{content:"\f1b4"}.bp5-icon-flow-review:before{content:"\f1b6"}.bp5-icon-flow-review-branch:before{content:"\f1b5"}.bp5-icon-flows:before{content:"\f1b7"}.bp5-icon-folder-close:before{content:"\f1b8"}.bp5-icon-folder-new:before{content:"\f1b9"}.bp5-icon-folder-open:before{content:"\f1ba"}.bp5-icon-folder-shared:before{content:"\f1bc"}.bp5-icon-folder-shared-open:before{content:"\f1bb"}.bp5-icon-follower:before{content:"\f1bd"}.bp5-icon-following:before{content:"\f1be"}.bp5-icon-font:before{content:"\f1bf"}.bp5-icon-fork:before{content:"\f1c0"}.bp5-icon-form:before{content:"\f1c1"}.bp5-icon-fuel:before{content:"\f323"}.bp5-icon-full-circle:before{content:"\f1c2"}.bp5-icon-full-stacked-chart:before{content:"\f1c3"}.bp5-icon-fullscreen:before{content:"\f1c4"}.bp5-icon-function:before{content:"\f1c5"}.bp5-icon-gantt-chart:before{content:"\f1c6"}.bp5-icon-geofence:before{content:"\f1c7"}.bp5-icon-geolocation:before{content:"\f1c8"}.bp5-icon-geosearch:before{content:"\f1c9"}.bp5-icon-git-branch:before{content:"\f1ca"}.bp5-icon-git-commit:before{content:"\f1cb"}.bp5-icon-git-merge:before{content:"\f1cc"}.bp5-icon-git-new-branch:before{content:"\f1cd"}.bp5-icon-git-pull:before{content:"\f1ce"}.bp5-icon-git-push:before{content:"\f1cf"}.bp5-icon-git-repo:before{content:"\f1d0"}.bp5-icon-glass:before{content:"\f1d1"}.bp5-icon-globe:before{content:"\f1d3"}.bp5-icon-globe-network:before{content:"\f1d2"}.bp5-icon-graph:before{content:"\f1d5"}.bp5-icon-graph-remove:before{content:"\f1d4"}.bp5-icon-greater-than:before{content:"\f1d7"}.bp5-icon-greater-than-or-equal-to:before{content:"\f1d6"}.bp5-icon-grid:before{content:"\f1d9"}.bp5-icon-grid-view:before{content:"\f1d8"}.bp5-icon-group-objects:before{content:"\f1da"}.bp5-icon-grouped-bar-chart:before{content:"\f1db"}.bp5-icon-hand:before{content:"\f1e0"}.bp5-icon-hand-down:before{content:"\f1dc"}.bp5-icon-hand-left:before{content:"\f1dd"}.bp5-icon-hand-right:before{content:"\f1de"}.bp5-icon-hand-up:before{content:"\f1df"}.bp5-icon-hat:before{content:"\f1e1"}.bp5-icon-header:before{content:"\f1e5"}.bp5-icon-header-one:before{content:"\f1e2"}.bp5-icon-header-three:before{content:"\f1e3"}.bp5-icon-header-two:before{content:"\f1e4"}.bp5-icon-headset:before{content:"\f1e6"}.bp5-icon-heart:before{content:"\f1e8"}.bp5-icon-heart-broken:before{content:"\f1e7"}.bp5-icon-heat-grid:before{content:"\f1e9"}.bp5-icon-heatmap:before{content:"\f1ea"}.bp5-icon-helicopter:before{content:"\f1eb"}.bp5-icon-help:before{content:"\f1ec"}.bp5-icon-helper-management:before{content:"\f1ed"}.bp5-icon-high-priority:before{content:"\f1ee"}.bp5-icon-high-voltage-pole:before{content:"\f333"}.bp5-icon-highlight:before{content:"\f1ef"}.bp5-icon-history:before{content:"\f1f0"}.bp5-icon-home:before{content:"\f1f1"}.bp5-icon-horizontal-bar-chart:before{content:"\f1f4"}.bp5-icon-horizontal-bar-chart-asc:before{content:"\f1f2"}.bp5-icon-horizontal-bar-chart-desc:before{content:"\f1f3"}.bp5-icon-horizontal-distribution:before{content:"\f1f5"}.bp5-icon-horizontal-inbetween:before{content:"\f329"}.bp5-icon-hurricane:before{content:"\f1f6"}.bp5-icon-id-number:before{content:"\f1f7"}.bp5-icon-image-rotate-left:before{content:"\f1f8"}.bp5-icon-image-rotate-right:before{content:"\f1f9"}.bp5-icon-import:before{content:"\f1fa"}.bp5-icon-inbox:before{content:"\f1ff"}.bp5-icon-inbox-filtered:before{content:"\f1fb"}.bp5-icon-inbox-geo:before{content:"\f1fc"}.bp5-icon-inbox-search:before{content:"\f1fd"}.bp5-icon-inbox-update:before{content:"\f1fe"}.bp5-icon-info-sign:before{content:"\f200"}.bp5-icon-inheritance:before{content:"\f201"}.bp5-icon-inherited-group:before{content:"\f202"}.bp5-icon-inner-join:before{content:"\f203"}.bp5-icon-insert:before{content:"\f204"}.bp5-icon-intelligence:before{content:"\f337"}.bp5-icon-intersection:before{content:"\f205"}.bp5-icon-ip-address:before{content:"\f206"}.bp5-icon-issue:before{content:"\f209"}.bp5-icon-issue-closed:before{content:"\f207"}.bp5-icon-issue-new:before{content:"\f208"}.bp5-icon-italic:before{content:"\f20a"}.bp5-icon-join-table:before{content:"\f20b"}.bp5-icon-key:before{content:"\f215"}.bp5-icon-key-backspace:before{content:"\f20c"}.bp5-icon-key-command:before{content:"\f20d"}.bp5-icon-key-control:before{content:"\f20e"}.bp5-icon-key-delete:before{content:"\f20f"}.bp5-icon-key-enter:before{content:"\f210"}.bp5-icon-key-escape:before{content:"\f211"}.bp5-icon-key-option:before{content:"\f212"}.bp5-icon-key-shift:before{content:"\f213"}.bp5-icon-key-tab:before{content:"\f214"}.bp5-icon-known-vehicle:before{content:"\f216"}.bp5-icon-lab-test:before{content:"\f217"}.bp5-icon-label:before{content:"\f218"}.bp5-icon-layer:before{content:"\f21a"}.bp5-icon-layer-outline:before{content:"\f219"}.bp5-icon-layers:before{content:"\f21b"}.bp5-icon-layout:before{content:"\f225"}.bp5-icon-layout-auto:before{content:"\f21c"}.bp5-icon-layout-balloon:before{content:"\f21d"}.bp5-icon-layout-circle:before{content:"\f21e"}.bp5-icon-layout-grid:before{content:"\f21f"}.bp5-icon-layout-group-by:before{content:"\f220"}.bp5-icon-layout-hierarchy:before{content:"\f221"}.bp5-icon-layout-linear:before{content:"\f222"}.bp5-icon-layout-skew-grid:before{content:"\f223"}.bp5-icon-layout-sorted-clusters:before{content:"\f224"}.bp5-icon-learning:before{content:"\f226"}.bp5-icon-left-join:before{content:"\f227"}.bp5-icon-lengthen-text:before{content:"\f33e"}.bp5-icon-less-than:before{content:"\f229"}.bp5-icon-less-than-or-equal-to:before{content:"\f228"}.bp5-icon-lifesaver:before{content:"\f22a"}.bp5-icon-lightbulb:before{content:"\f22b"}.bp5-icon-lightning:before{content:"\f22c"}.bp5-icon-link:before{content:"\f22d"}.bp5-icon-list:before{content:"\f230"}.bp5-icon-list-columns:before{content:"\f22e"}.bp5-icon-list-detail-view:before{content:"\f22f"}.bp5-icon-locate:before{content:"\f231"}.bp5-icon-lock:before{content:"\f232"}.bp5-icon-locomotive:before{content:"\f33b"}.bp5-icon-log-in:before{content:"\f233"}.bp5-icon-log-out:before{content:"\f234"}.bp5-icon-low-voltage-pole:before{content:"\f332"}.bp5-icon-manual:before{content:"\f235"}.bp5-icon-manually-entered-data:before{content:"\f236"}.bp5-icon-many-to-many:before{content:"\f237"}.bp5-icon-many-to-one:before{content:"\f238"}.bp5-icon-map:before{content:"\f23b"}.bp5-icon-map-create:before{content:"\f239"}.bp5-icon-map-marker:before{content:"\f23a"}.bp5-icon-maximize:before{content:"\f23c"}.bp5-icon-media:before{content:"\f23d"}.bp5-icon-menu:before{content:"\f240"}.bp5-icon-menu-closed:before{content:"\f23e"}.bp5-icon-menu-open:before{content:"\f23f"}.bp5-icon-merge-columns:before{content:"\f241"}.bp5-icon-merge-links:before{content:"\f242"}.bp5-icon-minimize:before{content:"\f243"}.bp5-icon-minus:before{content:"\f244"}.bp5-icon-mobile-phone:before{content:"\f245"}.bp5-icon-mobile-video:before{content:"\f246"}.bp5-icon-modal:before{content:"\f248"}.bp5-icon-modal-filled:before{content:"\f247"}.bp5-icon-model:before{content:"\f33d"}.bp5-icon-moon:before{content:"\f249"}.bp5-icon-more:before{content:"\f24a"}.bp5-icon-mountain:before{content:"\f24b"}.bp5-icon-move:before{content:"\f24c"}.bp5-icon-mugshot:before{content:"\f24d"}.bp5-icon-multi-select:before{content:"\f24e"}.bp5-icon-music:before{content:"\f24f"}.bp5-icon-nest:before{content:"\f250"}.bp5-icon-new-drawing:before{content:"\f251"}.bp5-icon-new-grid-item:before{content:"\f252"}.bp5-icon-new-layer:before{content:"\f253"}.bp5-icon-new-layers:before{content:"\f254"}.bp5-icon-new-link:before{content:"\f255"}.bp5-icon-new-object:before{content:"\f256"}.bp5-icon-new-person:before{content:"\f257"}.bp5-icon-new-prescription:before{content:"\f258"}.bp5-icon-new-text-box:before{content:"\f259"}.bp5-icon-ninja:before{content:"\f25a"}.bp5-icon-not-equal-to:before{content:"\f25b"}.bp5-icon-notifications:before{content:"\f25e"}.bp5-icon-notifications-snooze:before{content:"\f25c"}.bp5-icon-notifications-updated:before{content:"\f25d"}.bp5-icon-numbered-list:before{content:"\f25f"}.bp5-icon-numerical:before{content:"\f260"}.bp5-icon-office:before{content:"\f261"}.bp5-icon-offline:before{content:"\f262"}.bp5-icon-oil-field:before{content:"\f263"}.bp5-icon-one-column:before{content:"\f264"}.bp5-icon-one-to-many:before{content:"\f265"}.bp5-icon-one-to-one:before{content:"\f266"}.bp5-icon-open-application:before{content:"\f32b"}.bp5-icon-outdated:before{content:"\f267"}.bp5-icon-page-layout:before{content:"\f268"}.bp5-icon-panel-stats:before{content:"\f269"}.bp5-icon-panel-table:before{content:"\f26a"}.bp5-icon-paperclip:before{content:"\f26b"}.bp5-icon-paragraph:before{content:"\f26c"}.bp5-icon-path:before{content:"\f26e"}.bp5-icon-path-search:before{content:"\f26d"}.bp5-icon-pause:before{content:"\f26f"}.bp5-icon-people:before{content:"\f270"}.bp5-icon-percentage:before{content:"\f271"}.bp5-icon-person:before{content:"\f272"}.bp5-icon-phone:before{content:"\f273"}.bp5-icon-pie-chart:before{content:"\f274"}.bp5-icon-pin:before{content:"\f275"}.bp5-icon-pivot:before{content:"\f277"}.bp5-icon-pivot-table:before{content:"\f276"}.bp5-icon-play:before{content:"\f278"}.bp5-icon-playbook:before{content:"\f324"}.bp5-icon-plus:before{content:"\f279"}.bp5-icon-polygon-filter:before{content:"\f27a"}.bp5-icon-power:before{content:"\f27b"}.bp5-icon-predictive-analysis:before{content:"\f27c"}.bp5-icon-prescription:before{content:"\f27d"}.bp5-icon-presentation:before{content:"\f27e"}.bp5-icon-print:before{content:"\f27f"}.bp5-icon-projects:before{content:"\f280"}.bp5-icon-properties:before{content:"\f281"}.bp5-icon-property:before{content:"\f282"}.bp5-icon-publish-function:before{content:"\f283"}.bp5-icon-pulse:before{content:"\f284"}.bp5-icon-rain:before{content:"\f285"}.bp5-icon-random:before{content:"\f286"}.bp5-icon-record:before{content:"\f287"}.bp5-icon-rect-height:before{content:"\f325"}.bp5-icon-rect-width:before{content:"\f326"}.bp5-icon-rectangle:before{content:"\f321"}.bp5-icon-redo:before{content:"\f288"}.bp5-icon-refresh:before{content:"\f289"}.bp5-icon-regex:before{content:"\f32f"}.bp5-icon-regression-chart:before{content:"\f28a"}.bp5-icon-remove:before{content:"\f290"}.bp5-icon-remove-column:before{content:"\f28d"}.bp5-icon-remove-column-left:before{content:"\f28b"}.bp5-icon-remove-column-right:before{content:"\f28c"}.bp5-icon-remove-row-bottom:before{content:"\f28e"}.bp5-icon-remove-row-top:before{content:"\f28f"}.bp5-icon-repeat:before{content:"\f291"}.bp5-icon-reset:before{content:"\f292"}.bp5-icon-resolve:before{content:"\f293"}.bp5-icon-rig:before{content:"\f294"}.bp5-icon-right-join:before{content:"\f295"}.bp5-icon-ring:before{content:"\f296"}.bp5-icon-rocket:before{content:"\f298"}.bp5-icon-rocket-slant:before{content:"\f297"}.bp5-icon-rotate-document:before{content:"\f299"}.bp5-icon-rotate-page:before{content:"\f29a"}.bp5-icon-route:before{content:"\f29b"}.bp5-icon-satellite:before{content:"\f29c"}.bp5-icon-saved:before{content:"\f29d"}.bp5-icon-scatter-plot:before{content:"\f29e"}.bp5-icon-search:before{content:"\f2a2"}.bp5-icon-search-around:before{content:"\f29f"}.bp5-icon-search-template:before{content:"\f2a0"}.bp5-icon-search-text:before{content:"\f2a1"}.bp5-icon-segmented-control:before{content:"\f2a3"}.bp5-icon-select:before{content:"\f2a4"}.bp5-icon-selection:before{content:"\f2a5"}.bp5-icon-send-message:before{content:"\f2a6"}.bp5-icon-send-to:before{content:"\f2a9"}.bp5-icon-send-to-graph:before{content:"\f2a7"}.bp5-icon-send-to-map:before{content:"\f2a8"}.bp5-icon-sensor:before{content:"\f33c"}.bp5-icon-series-add:before{content:"\f2aa"}.bp5-icon-series-configuration:before{content:"\f2ab"}.bp5-icon-series-derived:before{content:"\f2ac"}.bp5-icon-series-filtered:before{content:"\f2ad"}.bp5-icon-series-search:before{content:"\f2ae"}.bp5-icon-settings:before{content:"\f2af"}.bp5-icon-shapes:before{content:"\f2b0"}.bp5-icon-share:before{content:"\f2b1"}.bp5-icon-shared-filter:before{content:"\f2b2"}.bp5-icon-shield:before{content:"\f2b3"}.bp5-icon-ship:before{content:"\f2b4"}.bp5-icon-shop:before{content:"\f2b5"}.bp5-icon-shopping-cart:before{content:"\f2b6"}.bp5-icon-shorten-text:before{content:"\f33f"}.bp5-icon-signal-search:before{content:"\f2b7"}.bp5-icon-sim-card:before{content:"\f2b8"}.bp5-icon-slash:before{content:"\f2b9"}.bp5-icon-small-cross:before{content:"\f2ba"}.bp5-icon-small-info-sign:before{content:"\f334"}.bp5-icon-small-minus:before{content:"\f2bb"}.bp5-icon-small-plus:before{content:"\f2bc"}.bp5-icon-small-square:before{content:"\f2bd"}.bp5-icon-small-tick:before{content:"\f2be"}.bp5-icon-snowflake:before{content:"\f2bf"}.bp5-icon-social-media:before{content:"\f2c0"}.bp5-icon-sort:before{content:"\f2c7"}.bp5-icon-sort-alphabetical:before{content:"\f2c2"}.bp5-icon-sort-alphabetical-desc:before{content:"\f2c1"}.bp5-icon-sort-asc:before{content:"\f2c3"}.bp5-icon-sort-desc:before{content:"\f2c4"}.bp5-icon-sort-numerical:before{content:"\f2c6"}.bp5-icon-sort-numerical-desc:before{content:"\f2c5"}.bp5-icon-spell-check:before{content:"\f340"}.bp5-icon-split-columns:before{content:"\f2c8"}.bp5-icon-square:before{content:"\f2c9"}.bp5-icon-stacked-chart:before{content:"\f2ca"}.bp5-icon-stadium-geometry:before{content:"\f2cb"}.bp5-icon-star:before{content:"\f2cd"}.bp5-icon-star-empty:before{content:"\f2cc"}.bp5-icon-step-backward:before{content:"\f2ce"}.bp5-icon-step-chart:before{content:"\f2cf"}.bp5-icon-step-forward:before{content:"\f2d0"}.bp5-icon-stop:before{content:"\f2d1"}.bp5-icon-stopwatch:before{content:"\f2d2"}.bp5-icon-strikethrough:before{content:"\f2d3"}.bp5-icon-style:before{content:"\f2d4"}.bp5-icon-subscript:before{content:"\f339"}.bp5-icon-superscript:before{content:"\f33a"}.bp5-icon-swap-horizontal:before{content:"\f2d5"}.bp5-icon-swap-vertical:before{content:"\f2d6"}.bp5-icon-switch:before{content:"\f2d7"}.bp5-icon-symbol-circle:before{content:"\f2d8"}.bp5-icon-symbol-cross:before{content:"\f2d9"}.bp5-icon-symbol-diamond:before{content:"\f2da"}.bp5-icon-symbol-rectangle:before{content:"\f322"}.bp5-icon-symbol-square:before{content:"\f2db"}.bp5-icon-symbol-triangle-down:before{content:"\f2dc"}.bp5-icon-symbol-triangle-up:before{content:"\f2dd"}.bp5-icon-syringe:before{content:"\f2de"}.bp5-icon-tag:before{content:"\f2df"}.bp5-icon-take-action:before{content:"\f2e0"}.bp5-icon-tank:before{content:"\f2e1"}.bp5-icon-target:before{content:"\f2e2"}.bp5-icon-taxi:before{content:"\f2e3"}.bp5-icon-temperature:before{content:"\f2e4"}.bp5-icon-text-highlight:before{content:"\f2e5"}.bp5-icon-th:before{content:"\f2ea"}.bp5-icon-th-derived:before{content:"\f2e6"}.bp5-icon-th-disconnect:before{content:"\f2e7"}.bp5-icon-th-filtered:before{content:"\f2e8"}.bp5-icon-th-list:before{content:"\f2e9"}.bp5-icon-third-party:before{content:"\f2eb"}.bp5-icon-thumbs-down:before{content:"\f2ec"}.bp5-icon-thumbs-up:before{content:"\f2ed"}.bp5-icon-tick:before{content:"\f2ef"}.bp5-icon-tick-circle:before{content:"\f2ee"}.bp5-icon-time:before{content:"\f2f0"}.bp5-icon-timeline-area-chart:before{content:"\f2f1"}.bp5-icon-timeline-bar-chart:before{content:"\f2f2"}.bp5-icon-timeline-events:before{content:"\f2f3"}.bp5-icon-timeline-line-chart:before{content:"\f2f4"}.bp5-icon-tint:before{content:"\f2f5"}.bp5-icon-torch:before{content:"\f2f6"}.bp5-icon-tractor:before{content:"\f2f7"}.bp5-icon-train:before{content:"\f2f8"}.bp5-icon-translate:before{content:"\f2f9"}.bp5-icon-trash:before{content:"\f2fa"}.bp5-icon-tree:before{content:"\f2fb"}.bp5-icon-trending-down:before{content:"\f2fc"}.bp5-icon-trending-up:before{content:"\f2fd"}.bp5-icon-truck:before{content:"\f2fe"}.bp5-icon-two-columns:before{content:"\f2ff"}.bp5-icon-unarchive:before{content:"\f300"}.bp5-icon-underline:before{content:"\f301"}.bp5-icon-undo:before{content:"\f302"}.bp5-icon-ungroup-objects:before{content:"\f303"}.bp5-icon-unknown-vehicle:before{content:"\f304"}.bp5-icon-unlock:before{content:"\f305"}.bp5-icon-unpin:before{content:"\f306"}.bp5-icon-unresolve:before{content:"\f307"}.bp5-icon-updated:before{content:"\f308"}.bp5-icon-upload:before{content:"\f309"}.bp5-icon-user:before{content:"\f30a"}.bp5-icon-variable:before{content:"\f30b"}.bp5-icon-vertical-bar-chart-asc:before{content:"\f30c"}.bp5-icon-vertical-bar-chart-desc:before{content:"\f30d"}.bp5-icon-vertical-distribution:before{content:"\f30e"}.bp5-icon-vertical-inbetween:before{content:"\f32a"}.bp5-icon-video:before{content:"\f30f"}.bp5-icon-virus:before{content:"\f310"}.bp5-icon-volume-down:before{content:"\f311"}.bp5-icon-volume-off:before{content:"\f312"}.bp5-icon-volume-up:before{content:"\f313"}.bp5-icon-walk:before{content:"\f314"}.bp5-icon-warning-sign:before{content:"\f315"}.bp5-icon-waterfall-chart:before{content:"\f316"}.bp5-icon-waves:before{content:"\f317"}.bp5-icon-widget:before{content:"\f31b"}.bp5-icon-widget-button:before{content:"\f318"}.bp5-icon-widget-footer:before{content:"\f319"}.bp5-icon-widget-header:before{content:"\f31a"}.bp5-icon-wind:before{content:"\f31c"}.bp5-icon-wrench:before{content:"\f31d"}.bp5-icon-zoom-in:before{content:"\f31e"}.bp5-icon-zoom-out:before{content:"\f31f"}.bp5-icon-zoom-to-fit:before{content:"\f320"}.bp5-menu-item:hover,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]){background-color:rgba(143,153,168,.15);color:inherit;cursor:pointer;text-decoration:none}.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-success,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-success,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-success{background-color:rgba(35,133,81,.1);color:#1c6e42}.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-success .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-success .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-success:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-success .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-success .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-success:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-success .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-success .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-success:before{color:inherit}.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-warning,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-warning,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-warning{background-color:rgba(200,118,25,.1);color:#935610}.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-warning .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-warning .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-warning:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-warning .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-warning .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-warning:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-warning .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-warning .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-warning:before{color:inherit}.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-danger,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-danger,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-danger{background-color:rgba(205,66,70,.1);color:#ac2f33}.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-danger .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-danger .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-danger:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-danger .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-danger .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-danger:before,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-danger .bp5-menu-item-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-danger .bp5-submenu-icon,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-danger:before{color:inherit}.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-success,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-success,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-success{background-color:rgba(35,133,81,.2);color:#72ca9b}.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-success:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-success:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-success:before{color:inherit}.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-warning,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-warning,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-warning{background-color:rgba(200,118,25,.2);color:#fbb360}.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-warning:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-warning:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-warning:before{color:inherit}.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-danger,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-danger,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-danger{background-color:rgba(205,66,70,.2);color:#fa999c}.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-].bp5-intent-danger:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active.bp5-intent-danger:before,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover.bp5-intent-danger:before{color:inherit}.bp5-menu{border-radius:2px;color:#1c2127;list-style:none;margin:0;min-width:180px;padding:5px;text-align:left}.bp5-menu-divider,.bp5-menu-header{border-top:1px solid rgba(17,20,24,.15);margin:5px}.bp5-menu-divider{display:block}.bp5-menu-item{align-items:flex-start;border-radius:2px;color:inherit;display:flex;flex-direction:row;line-height:20px;padding:5px 7px;text-decoration:none;-webkit-user-select:none;user-select:none}.bp5-menu-item>.bp5-fill{flex-grow:1;flex-shrink:1;word-break:break-word}.bp5-menu-item .bp5-menu-item-icon{display:flex;flex-direction:column;height:20px;justify-content:center}.bp5-menu-item .bp5-submenu-icon,.bp5-menu-item:before{margin-top:2px}.bp5-menu-item:hover.ns-selected{background-color:rgba(45,114,210,.1);color:#215db0}.bp5-menu-item:hover.ns-selected .bp5-menu-item-label{color:inherit}.bp5-menu-item:hover.ns-selected .bp5-menu-item-icon,.bp5-menu-item:hover.ns-selected .bp5-submenu-icon,.bp5-menu-item:hover.ns-selected:before{color:#215db0}.bp5-menu-item:hover.ns-selected.bp5-intent-success{background-color:rgba(35,133,81,.1);color:#1c6e42}.bp5-menu-item:hover.ns-selected.bp5-intent-success .bp5-menu-item-icon,.bp5-menu-item:hover.ns-selected.bp5-intent-success .bp5-submenu-icon,.bp5-menu-item:hover.ns-selected.bp5-intent-success:before{color:inherit}.bp5-menu-item:hover.ns-selected.bp5-intent-warning{background-color:rgba(200,118,25,.1);color:#935610}.bp5-menu-item:hover.ns-selected.bp5-intent-warning .bp5-menu-item-icon,.bp5-menu-item:hover.ns-selected.bp5-intent-warning .bp5-submenu-icon,.bp5-menu-item:hover.ns-selected.bp5-intent-warning:before{color:inherit}.bp5-menu-item:hover.ns-selected.bp5-intent-danger{background-color:rgba(205,66,70,.1);color:#ac2f33}.bp5-menu-item:hover.ns-selected.bp5-intent-danger .bp5-menu-item-icon,.bp5-menu-item:hover.ns-selected.bp5-intent-danger .bp5-submenu-icon,.bp5-menu-item:hover.ns-selected.bp5-intent-danger:before{color:inherit}.bp5-menu-item.bp5-active,.bp5-menu-item:active,.bp5-tree-node-content:active{background-color:rgba(143,153,168,.3)}.bp5-menu-item.bp5-selected,.bp5-menu-item.bp5-selected:active,.bp5-menu-item.bp5-selected:hover,.bp5-tag.bp5-minimal.bp5-intent-primary{background-color:rgba(45,114,210,.1);color:#215db0}.bp5-menu-item.bp5-selected .bp5-menu-item-label,.bp5-menu-item.bp5-selected:active .bp5-menu-item-label,.bp5-menu-item.bp5-selected:hover .bp5-menu-item-label{color:inherit}.bp5-dark .bp5-tooltip .bp5-icon-large.bp5-intent-primary,.bp5-dark .bp5-tooltip .bp5-icon-standard.bp5-intent-primary,.bp5-dark .bp5-tooltip .bp5-icon.bp5-intent-primary,.bp5-dark .bp5-tooltip a,.bp5-dark .bp5-tooltip a:hover,.bp5-menu-item.bp5-intent-primary,.bp5-menu-item.bp5-selected .bp5-menu-item-icon,.bp5-menu-item.bp5-selected .bp5-submenu-icon,.bp5-menu-item.bp5-selected:active .bp5-menu-item-icon,.bp5-menu-item.bp5-selected:active .bp5-submenu-icon,.bp5-menu-item.bp5-selected:active:before,.bp5-menu-item.bp5-selected:before,.bp5-menu-item.bp5-selected:hover .bp5-menu-item-icon,.bp5-menu-item.bp5-selected:hover .bp5-submenu-icon,.bp5-menu-item.bp5-selected:hover:before,.bp5-tab:not([aria-disabled=true]):hover,.bp5-tab[aria-selected=true],.bp5-tag.bp5-minimal.bp5-intent-primary .bp5-tag-remove,.bp5-tooltip.bp5-dark .bp5-icon-large.bp5-intent-primary,.bp5-tooltip.bp5-dark .bp5-icon-standard.bp5-intent-primary,.bp5-tooltip.bp5-dark .bp5-icon.bp5-intent-primary,.bp5-tooltip.bp5-dark a,.bp5-tooltip.bp5-dark a:hover{color:#215db0}.bp5-menu-item.bp5-selected.bp5-intent-success,.bp5-menu-item.bp5-selected:active.bp5-intent-success,.bp5-menu-item.bp5-selected:hover.bp5-intent-success{background-color:rgba(35,133,81,.1);color:#1c6e42}.bp5-menu-item.bp5-selected.bp5-intent-success .bp5-menu-item-icon,.bp5-menu-item.bp5-selected.bp5-intent-success .bp5-submenu-icon,.bp5-menu-item.bp5-selected.bp5-intent-success:before,.bp5-menu-item.bp5-selected:active.bp5-intent-success .bp5-menu-item-icon,.bp5-menu-item.bp5-selected:active.bp5-intent-success .bp5-submenu-icon,.bp5-menu-item.bp5-selected:active.bp5-intent-success:before,.bp5-menu-item.bp5-selected:hover.bp5-intent-success .bp5-menu-item-icon,.bp5-menu-item.bp5-selected:hover.bp5-intent-success .bp5-submenu-icon,.bp5-menu-item.bp5-selected:hover.bp5-intent-success:before{color:inherit}.bp5-menu-item.bp5-selected.bp5-intent-warning,.bp5-menu-item.bp5-selected:active.bp5-intent-warning,.bp5-menu-item.bp5-selected:hover.bp5-intent-warning{background-color:rgba(200,118,25,.1);color:#935610}.bp5-menu-item.bp5-selected.bp5-intent-warning .bp5-menu-item-icon,.bp5-menu-item.bp5-selected.bp5-intent-warning .bp5-submenu-icon,.bp5-menu-item.bp5-selected.bp5-intent-warning:before,.bp5-menu-item.bp5-selected:active.bp5-intent-warning .bp5-menu-item-icon,.bp5-menu-item.bp5-selected:active.bp5-intent-warning .bp5-submenu-icon,.bp5-menu-item.bp5-selected:active.bp5-intent-warning:before,.bp5-menu-item.bp5-selected:hover.bp5-intent-warning .bp5-menu-item-icon,.bp5-menu-item.bp5-selected:hover.bp5-intent-warning .bp5-submenu-icon,.bp5-menu-item.bp5-selected:hover.bp5-intent-warning:before{color:inherit}.bp5-menu-item.bp5-selected.bp5-intent-danger,.bp5-menu-item.bp5-selected:active.bp5-intent-danger,.bp5-menu-item.bp5-selected:hover.bp5-intent-danger{background-color:rgba(205,66,70,.1);color:#ac2f33}.bp5-menu-item.bp5-selected.bp5-intent-danger .bp5-menu-item-icon,.bp5-menu-item.bp5-selected.bp5-intent-danger .bp5-submenu-icon,.bp5-menu-item.bp5-selected.bp5-intent-danger:before,.bp5-menu-item.bp5-selected:active.bp5-intent-danger .bp5-menu-item-icon,.bp5-menu-item.bp5-selected:active.bp5-intent-danger .bp5-submenu-icon,.bp5-menu-item.bp5-selected:active.bp5-intent-danger:before,.bp5-menu-item.bp5-selected:hover.bp5-intent-danger .bp5-menu-item-icon,.bp5-menu-item.bp5-selected:hover.bp5-intent-danger .bp5-submenu-icon,.bp5-menu-item.bp5-selected:hover.bp5-intent-danger:before{color:inherit}.bp5-menu-item.bp5-disabled{background-color:inherit!important;cursor:not-allowed!important;outline:0!important}.bp5-dark .bp5-menu-item,.bp5-dark .bp5-menu-item:hover,.bp5-menu-item.bp5-intent-danger .bp5-menu-item-icon,.bp5-menu-item.bp5-intent-danger .bp5-menu-item-label,.bp5-menu-item.bp5-intent-danger .bp5-submenu-icon,.bp5-menu-item.bp5-intent-danger:before,.bp5-menu-item.bp5-intent-primary .bp5-menu-item-icon,.bp5-menu-item.bp5-intent-primary .bp5-menu-item-label,.bp5-menu-item.bp5-intent-primary .bp5-submenu-icon,.bp5-menu-item.bp5-intent-primary:before,.bp5-menu-item.bp5-intent-success .bp5-menu-item-icon,.bp5-menu-item.bp5-intent-success .bp5-menu-item-label,.bp5-menu-item.bp5-intent-success .bp5-submenu-icon,.bp5-menu-item.bp5-intent-success:before,.bp5-menu-item.bp5-intent-warning .bp5-menu-item-icon,.bp5-menu-item.bp5-intent-warning .bp5-menu-item-label,.bp5-menu-item.bp5-intent-warning .bp5-submenu-icon,.bp5-menu-item.bp5-intent-warning:before{color:inherit}.bp5-menu-item.bp5-intent-primary:hover{background-color:rgba(45,114,210,.1)}.bp5-menu-item.bp5-intent-primary.bp5-active,.bp5-menu-item.bp5-intent-primary:active,.bp5-tag.bp5-minimal.bp5-intent-primary.bp5-interactive:hover{background-color:rgba(45,114,210,.2);color:#184a90}.bp5-menu-item.bp5-intent-success:hover{background-color:rgba(35,133,81,.1)}.bp5-menu-item.bp5-intent-success.bp5-active,.bp5-menu-item.bp5-intent-success:active,.bp5-tag.bp5-minimal.bp5-intent-success.bp5-interactive:hover{background-color:rgba(35,133,81,.2);color:#165a36}.bp5-menu-item.bp5-intent-warning:hover{background-color:rgba(200,118,25,.1)}.bp5-menu-item.bp5-intent-warning.bp5-active,.bp5-menu-item.bp5-intent-warning:active,.bp5-tag.bp5-minimal.bp5-intent-warning.bp5-interactive:hover{background-color:rgba(200,118,25,.2);color:#77450d}.bp5-menu-item.bp5-intent-danger:hover{background-color:rgba(205,66,70,.1)}.bp5-menu-item.bp5-intent-danger.bp5-active,.bp5-menu-item.bp5-intent-danger:active,.bp5-tag.bp5-minimal.bp5-intent-danger.bp5-interactive:hover{background-color:rgba(205,66,70,.2);color:#8e292c}.bp5-menu-item:before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:16px;font-style:normal;font-variant:normal;font-weight:400;height:16px;line-height:1;margin-right:7px}.bp5-large .bp5-menu-item{font-size:16px;line-height:22px;padding:9px 7px}.bp5-large .bp5-menu-item .bp5-menu-item-icon{height:22px}.bp5-large .bp5-menu-item .bp5-submenu-icon,.bp5-large .bp5-menu-item:before{margin-top:3px}.bp5-large .bp5-menu-item:before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-variant:normal;font-weight:400;height:20px;line-height:1;margin-right:10px;width:20px}button.bp5-menu-item{background:none;border:none;text-align:left;width:100%}.bp5-menu-header{cursor:default;display:block;padding-left:2px}.bp5-menu-header:first-of-type{border-top:none}.bp5-menu-header>h6{word-wrap:normal;color:#1c2127;font-weight:600;line-height:17px;margin:0;overflow:hidden;padding:10px 7px 0 1px;text-overflow:ellipsis;white-space:nowrap}.bp5-large .bp5-menu-header>h6{font-size:18px;padding-bottom:5px;padding-top:15px}.bp5-dark .bp5-menu{background:#2f343c;color:#f6f7f9}.bp5-dark .bp5-menu-item:hover.ns-selected{background-color:rgba(45,114,210,.2);color:#8abbff}.bp5-dark .bp5-menu-item:hover.ns-selected .bp5-menu-item-icon,.bp5-dark .bp5-menu-item:hover.ns-selected .bp5-submenu-icon,.bp5-dark .bp5-menu-item:hover.ns-selected:before{color:#8abbff}.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-success{background-color:rgba(35,133,81,.2);color:#72ca9b}.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-success:before{color:inherit}.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-warning{background-color:rgba(200,118,25,.2);color:#fbb360}.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-warning:before{color:inherit}.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-danger{background-color:rgba(205,66,70,.2);color:#fa999c}.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-menu-item:hover.ns-selected.bp5-intent-danger:before{color:inherit}.bp5-dark .bp5-menu-item.bp5-selected,.bp5-dark .bp5-menu-item.bp5-selected:active,.bp5-dark .bp5-menu-item.bp5-selected:hover,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-primary{background-color:rgba(45,114,210,.2);color:#8abbff}.bp5-dark .bp5-menu-item.bp5-intent-primary,.bp5-dark .bp5-menu-item.bp5-selected .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:active .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected:active .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:active:before,.bp5-dark .bp5-menu-item.bp5-selected:before,.bp5-dark .bp5-menu-item.bp5-selected:hover .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected:hover .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:hover:before,.bp5-dark .bp5-tab:not([aria-disabled=true]):hover,.bp5-dark .bp5-tab[aria-selected=true],.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-primary .bp5-tag-remove,.bp5-dark .bp5-tree .bp5-icon-large.bp5-intent-primary,.bp5-dark .bp5-tree .bp5-icon-standard.bp5-intent-primary,.bp5-dark .bp5-tree .bp5-icon.bp5-intent-primary,.bp5-tooltip .bp5-icon-large.bp5-intent-primary,.bp5-tooltip .bp5-icon-standard.bp5-intent-primary,.bp5-tooltip .bp5-icon.bp5-intent-primary,.bp5-tooltip a,.bp5-tooltip a:hover{color:#8abbff}.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-success,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-success,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-success{background-color:rgba(35,133,81,.2);color:#72ca9b}.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-success:before,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-success:before,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-success:before{color:inherit}.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-warning,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-warning,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-warning{background-color:rgba(200,118,25,.2);color:#fbb360}.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-warning:before,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-warning:before,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-warning:before{color:inherit}.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-danger,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-danger,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-danger{background-color:rgba(205,66,70,.2);color:#fa999c}.bp5-dark .bp5-menu-item.bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-intent-danger .bp5-menu-item-label,.bp5-dark .bp5-menu-item.bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-intent-danger:before,.bp5-dark .bp5-menu-item.bp5-intent-primary .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-intent-primary .bp5-menu-item-label,.bp5-dark .bp5-menu-item.bp5-intent-primary .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-intent-primary:before,.bp5-dark .bp5-menu-item.bp5-intent-success .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-intent-success .bp5-menu-item-label,.bp5-dark .bp5-menu-item.bp5-intent-success .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-intent-success:before,.bp5-dark .bp5-menu-item.bp5-intent-warning .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-intent-warning .bp5-menu-item-label,.bp5-dark .bp5-menu-item.bp5-intent-warning .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-intent-warning:before,.bp5-dark .bp5-popover .bp5-heading,.bp5-dark .bp5-popover .bp5-popover-content,.bp5-dark .bp5-tooltip a .bp5-icon,.bp5-dark .bp5-tooltip a .bp5-icon-large,.bp5-dark .bp5-tooltip a .bp5-icon-standard,.bp5-dark .bp5-tooltip a code,.bp5-popover .bp5-heading,.bp5-popover .bp5-popover-content,.bp5-popover.bp5-dark .bp5-heading,.bp5-popover.bp5-dark .bp5-popover-content,.bp5-tab a,.bp5-tag-remove .bp5-icon:first-child,.bp5-tooltip a .bp5-icon,.bp5-tooltip a .bp5-icon-large,.bp5-tooltip a .bp5-icon-standard,.bp5-tooltip a code,.bp5-tooltip.bp5-dark a .bp5-icon,.bp5-tooltip.bp5-dark a .bp5-icon-large,.bp5-tooltip.bp5-dark a .bp5-icon-standard,.bp5-tooltip.bp5-dark a code,a>.bp5-tooltip .bp5-code,a>.bp5-tooltip .bp5-running-text code{color:inherit}.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected.bp5-intent-danger:before,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:active.bp5-intent-danger:before,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-danger .bp5-menu-item-icon,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-danger .bp5-submenu-icon,.bp5-dark .bp5-menu-item.bp5-selected:hover.bp5-intent-danger:before{color:inherit}.bp5-dark .bp5-menu-item.bp5-intent-primary:hover{background-color:rgba(45,114,210,.2)}.bp5-dark .bp5-menu-item.bp5-intent-primary.bp5-active,.bp5-dark .bp5-menu-item.bp5-intent-primary:active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-primary.bp5-interactive:hover{background-color:rgba(45,114,210,.3);color:#99c4ff}.bp5-dark .bp5-menu-item.bp5-intent-success:hover{background-color:rgba(35,133,81,.2)}.bp5-dark .bp5-menu-item.bp5-intent-success.bp5-active,.bp5-dark .bp5-menu-item.bp5-intent-success:active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-success.bp5-interactive:hover{background-color:rgba(35,133,81,.3);color:#7cd7a2}.bp5-dark .bp5-menu-item.bp5-intent-warning:hover{background-color:rgba(200,118,25,.2)}.bp5-dark .bp5-menu-item.bp5-intent-warning.bp5-active,.bp5-dark .bp5-menu-item.bp5-intent-warning:active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-warning.bp5-interactive:hover{background-color:rgba(200,118,25,.3);color:#f5c186}.bp5-dark .bp5-menu-item.bp5-intent-danger:hover{background-color:rgba(205,66,70,.2)}.bp5-dark .bp5-menu-item.bp5-intent-danger.bp5-active,.bp5-dark .bp5-menu-item.bp5-intent-danger:active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-danger.bp5-interactive:hover{background-color:rgba(205,66,70,.3);color:#ffa1a4}.bp5-navbar{background-color:#fff;box-shadow:0 0 0 1px rgba(17,20,24,.1),0 1px 1px rgba(17,20,24,.2);height:50px;padding:0 15px;position:relative;width:100%;z-index:10}.bp5-dark .bp5-navbar,.bp5-dark .bp5-panel-stack-view,.bp5-dark .bp5-panel-stack2-view,.bp5-navbar.bp5-dark{background-color:#383e47}.bp5-navbar.bp5-dark{box-shadow:inset inset 0 0 0 1px hsla(0,0%,100%,.2),0 1px 1px 0 rgba(17,20,24,.4)}.bp5-dark .bp5-navbar{box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 1px 1px 0 rgba(17,20,24,.4)}.bp5-navbar.bp5-fixed-top{left:0;position:fixed;right:0;top:0}.bp5-navbar-heading{font-size:16px;margin-right:15px}.bp5-navbar-group{align-items:center;display:flex;height:50px}.bp5-navbar-group.bp5-align-left{float:left}.bp5-navbar-group.bp5-align-right{float:right}.bp5-navbar-divider{border-left:1px solid rgba(17,20,24,.15);height:20px;margin:0 10px}.bp5-dark .bp5-navbar-divider{border-left-color:hsla(0,0%,100%,.2)}.bp5-non-ideal-state{align-items:center;color:#5f6b7c;display:flex;flex-direction:column;height:100%;justify-content:center;text-align:center;width:100%}.bp5-non-ideal-state>*{flex-grow:0;flex-shrink:0;max-width:400px}.bp5-non-ideal-state .bp5-heading{color:#5f6b7c;line-height:20px;margin-bottom:10px}.bp5-non-ideal-state.bp5-non-ideal-state-horizontal{display:flex;flex-direction:row;text-align:left}.bp5-non-ideal-state.bp5-non-ideal-state-horizontal>*{flex-grow:0;flex-shrink:0;margin-bottom:0}.bp5-panel-stack-header .bp5-heading,.bp5-panel-stack2-header .bp5-heading,kbd{margin:0 5px}.bp5-non-ideal-state-visual{color:#8f99a8}.bp5-non-ideal-state-visual .bp5-icon svg{fill-opacity:15%;overflow:visible}.bp5-non-ideal-state-visual .bp5-icon svg path{stroke:#8f99a8;stroke-opacity:50%;stroke-width:.5px}.bp5-dark .bp5-non-ideal-state-visual .bp5-icon svg{fill-opacity:20%}.bp5-overflow-list{display:flex;flex-wrap:nowrap;min-width:0}.bp5-overflow-list-spacer{flex-shrink:1;width:1px}.ins-view.inline-node-edited>.base-node-view .base-node-view-inner,body.bp5-overlay-open{overflow:hidden}.bp5-overlay{bottom:0;left:0;position:static;right:0;top:0;z-index:20}.bp5-overlay.bp5-overlay-container{overflow:hidden;position:fixed}.bp5-overlay-backdrop,.bp5-overlay.bp5-overlay-scroll-container{overflow:auto;position:fixed}.bp5-overlay-inline .bp5-overlay-backdrop,.bp5-overlay-inline .bp5-overlay-content,.bp5-overlay-scroll-container .bp5-overlay-content,.bp5-overlay.bp5-overlay-container.bp5-overlay-inline,.bp5-overlay.bp5-overlay-scroll-container.bp5-overlay-inline,.bp5-toast-container.bp5-toast-container-inline,.connection{position:absolute}.bp5-overlay.bp5-overlay-inline{display:inline;overflow:visible}.bp5-overlay-content{position:fixed;z-index:20}.bp5-overlay-backdrop{background-color:rgba(17,20,24,.7);bottom:0;left:0;opacity:1;right:0;top:0;-webkit-user-select:none;user-select:none;z-index:20}.bp5-overlay-backdrop.bp5-overlay-appear,.bp5-overlay-backdrop.bp5-overlay-enter,.bp5-popover-transition-container.bp5-popover-appear,.bp5-popover-transition-container.bp5-popover-enter{opacity:0}.bp5-overlay-backdrop.bp5-overlay-appear-active,.bp5-overlay-backdrop.bp5-overlay-enter-active{opacity:1;transition:opacity .2s cubic-bezier(.4,1,.75,.9) 0}.bp5-overlay-backdrop.bp5-overlay-exit,.bp5-popover-transition-container.bp5-popover-exit,.footerLogoLink_lMws:hover,.hash-link:focus,:hover>.hash-link{opacity:1}.bp5-overlay-backdrop.bp5-overlay-exit-active{opacity:0;transition:opacity .2s cubic-bezier(.4,1,.75,.9) 0}.bp5-panel-stack,.bp5-panel-stack2{overflow:hidden;position:relative}.bp5-panel-stack-header,.bp5-panel-stack2-header{align-items:center;box-shadow:0 1px rgba(17,20,24,.15);display:flex;flex-shrink:0;height:30px;z-index:1}.bp5-dark .bp5-panel-stack-header,.bp5-dark .bp5-panel-stack2-header{box-shadow:0 1px hsla(0,0%,100%,.2)}.bp5-panel-stack-header>span,.bp5-panel-stack2-header>span{align-items:stretch;display:flex;flex:1}.bp5-button.bp5-panel-stack-header-back,.bp5-button.bp5-panel-stack2-header-back{margin-left:5px;padding-left:0;white-space:nowrap}.bp5-button.bp5-panel-stack-header-back .bp5-icon,.bp5-button.bp5-panel-stack2-header-back .bp5-icon{margin:0 2px}.bp5-panel-stack-view,.bp5-panel-stack2-view{background-color:#fff;border-right:1px solid rgba(17,20,24,.15);bottom:0;display:flex;flex-direction:column;left:0;margin-right:-1px;overflow-y:auto;position:absolute;right:0;top:0;z-index:1}#__docusaurus-base-url-issue-banner-container,.bp5-omnibar .bp5-menu:empty,.bp5-panel-stack-view:nth-last-child(n+4),.bp5-panel-stack2-view:nth-last-child(n+4),.bp5-popover.bp5-minimal .bp5-popover-arrow,.bp5-tab-panel[aria-hidden=true],.docSidebarContainer_ac1n,.sidebarLogo_qeYn,.themedImage_jQx1,.visual-node-editor .inline-node-container .visual-node-editor .zoom-slider,[data-theme=dark] .lightToggleIcon_RZhG,[data-theme=light] .darkToggleIcon_ABkc,html[data-announcement-bar-initially-dismissed=true] .announcementBar_pUh_{display:none}.bp5-panel-stack-push .bp5-panel-stack-appear,.bp5-panel-stack-push .bp5-panel-stack-enter,.bp5-panel-stack2-push .bp5-panel-stack2-appear,.bp5-panel-stack2-push .bp5-panel-stack2-enter{opacity:0;transform:translateX(100%)}.bp5-panel-stack-pop .bp5-panel-stack-appear-active,.bp5-panel-stack-pop .bp5-panel-stack-enter-active,.bp5-panel-stack-push .bp5-panel-stack-appear-active,.bp5-panel-stack-push .bp5-panel-stack-enter-active,.bp5-panel-stack2-pop .bp5-panel-stack2-appear-active,.bp5-panel-stack2-pop .bp5-panel-stack2-enter-active,.bp5-panel-stack2-push .bp5-panel-stack2-appear-active,.bp5-panel-stack2-push .bp5-panel-stack2-enter-active{opacity:1;transform:translate(0);transition:transform .4s 0,opacity .4s 0}.bp5-panel-stack-pop .bp5-panel-stack-exit,.bp5-panel-stack-push .bp5-panel-stack-exit,.bp5-panel-stack2-pop .bp5-panel-stack2-exit,.bp5-panel-stack2-push .bp5-panel-stack2-exit{opacity:1;transform:translate(0)}.bp5-panel-stack-push .bp5-panel-stack-exit-active,.bp5-panel-stack2-push .bp5-panel-stack2-exit-active{transition:transform .4s 0,opacity .4s 0}.bp5-panel-stack-pop .bp5-panel-stack-appear,.bp5-panel-stack-pop .bp5-panel-stack-enter,.bp5-panel-stack-push .bp5-panel-stack-exit-active,.bp5-panel-stack2-pop .bp5-panel-stack2-appear,.bp5-panel-stack2-pop .bp5-panel-stack2-enter,.bp5-panel-stack2-push .bp5-panel-stack2-exit-active{opacity:0;transform:translateX(-50%)}.bp5-panel-stack-pop .bp5-panel-stack-exit-active,.bp5-panel-stack2-pop .bp5-panel-stack2-exit-active{opacity:0;transform:translateX(100%);transition:transform .4s 0,opacity .4s 0}.bp5-control-group .bp5-popover-target{border-radius:inherit}.bp5-submenu.bp5-popover{box-shadow:none;padding:0 5px}.bp5-dark .bp5-popover,.bp5-dark .bp5-submenu.bp5-popover>.bp5-popover-content,.bp5-popover.bp5-dark,.bp5-submenu.bp5-popover.bp5-dark>.bp5-popover-content{box-shadow:0 0 0 1px #5e6064,inset 0 0 0 1px hsla(0,0%,100%,.2),0 2px 4px rgba(17,20,24,.4),0 8px 24px rgba(17,20,24,.4)}.bp5-popover{border-radius:2px;box-shadow:0 0 0 1px rgba(17,20,24,.1),0 2px 4px rgba(17,20,24,.2),0 8px 24px rgba(17,20,24,.2);display:inline-block;transform:scale(1);z-index:20}.bp5-popover .bp5-popover-arrow{height:30px;position:absolute;width:30px}.bp5-popover .bp5-popover-arrow:before{height:20px;margin:5px;width:20px;box-shadow:1px 1px 6px rgba(17,20,24,.2)}.bp5-popover .bp5-popover-content{background:#fff;border-radius:2px;position:relative}.bp5-popover .bp5-popover-arrow-border,.bp5-tooltip .bp5-popover-arrow-border{fill:#111418;fill-opacity:.1}.bp5-popover .bp5-popover-arrow-fill,.bp5-tag .bp5-icon-large,.bp5-tag .bp5-icon-standard,.bp5-tag>.bp5-icon{fill:#fff}.bp5-popover-appear>.bp5-popover,.bp5-popover-enter>.bp5-popover{transform:scale(.3)}.bp5-popover-appear-active>.bp5-popover,.bp5-popover-enter-active>.bp5-popover{transform:scale(1);transition:transform .3s cubic-bezier(.54,1.12,.38,1.11) 0}.bp5-popover-appear>.bp5-popover.bp5-minimal.bp5-popover,.bp5-popover-enter>.bp5-popover.bp5-minimal.bp5-popover,.bp5-popover-exit>.bp5-popover,.bp5-popover-exit>.bp5-popover.bp5-minimal.bp5-popover,.bp5-popover-exit>.bp5-tooltip,.bp5-popover.bp5-minimal.bp5-popover{transform:scale(1)}.bp5-popover-exit-active>.bp5-popover{transform:scale(.3);transition:transform .3s cubic-bezier(.54,1.12,.38,1.11) 0}.bp5-popover.bp5-popover-content-sizing .bp5-popover-content{max-width:350px;padding:20px}.bp5-popover-target+.bp5-overlay .bp5-popover.bp5-popover-content-sizing{width:350px}.bp5-popover-appear-active>.bp5-popover.bp5-minimal.bp5-popover,.bp5-popover-appear-active>.bp5-tooltip,.bp5-popover-enter-active>.bp5-popover.bp5-minimal.bp5-popover,.bp5-popover-enter-active>.bp5-tooltip,.bp5-popover-exit-active>.bp5-popover.bp5-minimal.bp5-popover{transform:scale(1);transition:transform .1s cubic-bezier(.4,1,.75,.9) 0}.bp5-dark .bp5-popover .bp5-popover-arrow:before,.bp5-popover.bp5-dark .bp5-popover-arrow:before{box-shadow:0 0 0 1px #777a7e,1px 1px 6px rgba(17,20,24,.4)}.bp5-dark .bp5-popover .bp5-popover-arrow-border,.bp5-dark .bp5-tooltip .bp5-popover-arrow-border,.bp5-popover.bp5-dark .bp5-popover-arrow-border,.bp5-tooltip.bp5-dark .bp5-popover-arrow-border{fill:#111418;fill-opacity:.2}.bp5-dark .bp5-popover .bp5-popover-arrow-fill,.bp5-popover.bp5-dark .bp5-popover-arrow-fill{fill:#2f343c}.bp5-popover-arrow:before{border-radius:1px;content:"";display:block;position:absolute;transform:rotate(45deg)}.bp5-overlay-backdrop.bp5-popover-backdrop{background:hsla(0,0%,100%,0)}.bp5-popover-transition-container{display:flex;opacity:1;z-index:20}.bp5-popover-transition-container.bp5-popover-appear-active,.bp5-popover-transition-container.bp5-popover-enter-active{opacity:1;transition:opacity .1s cubic-bezier(.4,1,.75,.9) 0}.bp5-popover-transition-container.bp5-popover-exit-active{opacity:0;transition:opacity .1s cubic-bezier(.4,1,.75,.9) 0}.bp5-portal{left:0;position:absolute;right:0;top:0}@keyframes a{0%{background-position:0 0}to{background-position:30px 0}}.bp5-progress-bar{background:rgba(95,107,124,.2);border-radius:40px;display:block;height:8px;overflow:hidden;position:relative;width:100%}.bp5-progress-bar .bp5-progress-meter{background:linear-gradient(-45deg,hsla(0,0%,100%,.2) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.2) 0,hsla(0,0%,100%,.2) 75%,transparent 0);background-color:rgba(95,107,124,.8);background-size:30px 30px;border-radius:40px;height:100%;position:absolute;transition:width .2s cubic-bezier(.4,1,.75,.9);width:100%}.bp5-progress-bar:not(.bp5-no-animation):not(.bp5-no-stripes) .bp5-progress-meter{animation:.3s linear infinite reverse a}.bp5-progress-bar.bp5-no-stripes .bp5-progress-meter{background-image:none}.bp5-dark .bp5-progress-bar,.bp5-dark .bp5-slider-progress{background:rgba(17,20,24,.5)}.bp5-dark .bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content,.bp5-progress-bar.bp5-intent-primary .bp5-progress-meter,.bp5-slider-progress.bp5-intent-primary,.bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content{background-color:#2d72d2}.bp5-progress-bar.bp5-intent-success .bp5-progress-meter,.bp5-slider-progress.bp5-intent-success{background-color:#238551}.bp5-progress-bar.bp5-intent-warning .bp5-progress-meter,.bp5-slider-progress.bp5-intent-warning,.bp5-tag.bp5-intent-warning.bp5-interactive.bp5-active,.bp5-tag.bp5-intent-warning.bp5-interactive:active{background-color:#c87619}.bp5-progress-bar.bp5-intent-danger .bp5-progress-meter,.bp5-slider-progress.bp5-intent-danger{background-color:#cd4246}@keyframes b{0%{background:rgba(211,216,222,.2);border-color:rgba(211,216,222,.2)}to{background:rgba(95,107,124,.2);border-color:rgba(95,107,124,.2)}}.bp5-skeleton{animation:1s linear infinite alternate b;background:rgba(211,216,222,.2);background-clip:padding-box!important;border-color:rgba(211,216,222,.2)!important;border-radius:2px;box-shadow:none!important;color:transparent!important;cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none}.bp5-skeleton *,.bp5-skeleton:after,.bp5-skeleton:before{visibility:hidden!important}.bp5-slider{cursor:default;height:40px;min-width:150px;outline:0;position:relative;-webkit-user-select:none;user-select:none;width:100%}.bp5-dark .bp5-tag.bp5-minimal:not([class*=bp5-intent-]).bp5-interactive,.bp5-slider:hover,.bp5-tab,.bp5-tag-remove,.bp5-tag.bp5-interactive,.bp5-tag.bp5-minimal:not([class*=bp5-intent-]).bp5-interactive,.json-view .cursor-pointer{cursor:pointer}.bp5-slider:active{cursor:grabbing}.bp5-slider.bp5-disabled{cursor:not-allowed;opacity:.5}.bp5-slider.bp5-slider-unlabeled{height:16px}.bp5-slider-progress,.bp5-slider-track{height:6px;left:0;position:absolute;right:0;top:5px}.bp5-slider-track{border-radius:2px;overflow:hidden}.bp5-slider-progress{background:rgba(95,107,124,.2)}.bp5-slider-handle{background-color:#f6f7f9;border-radius:2px;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.1);box-shadow:0 0 0 1px rgba(17,20,24,.5),0 1px 1px rgba(17,20,24,.5);color:#1c2127;cursor:pointer;height:16px;left:0;position:absolute;top:0;width:16px}.bp5-slider-handle.bp5-disabled.bp5-active,.bp5-slider-handle.bp5-disabled.bp5-active:hover,.bp5-slider-handle:disabled.bp5-active,.bp5-slider-handle:disabled.bp5-active:hover{background:rgba(211,216,222,.7)}.bp5-slider-handle:hover{background-clip:padding-box;background-color:#edeff2;box-shadow:0 0 0 1px rgba(17,20,24,.5),0 1px 2px rgba(17,20,24,.6);cursor:grab;z-index:2}.bp5-slider-handle.bp5-active{background-color:#dce0e5;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 1px 2px rgba(17,20,24,.2);box-shadow:inset 0 1px 1px rgba(17,20,24,.1),0 0 0 1px rgba(17,20,24,.5),0 1px 2px rgba(17,20,24,.2);cursor:grabbing}.bp5-disabled .bp5-slider-handle{background:#c5cbd3;box-shadow:none;pointer-events:none}.bp5-dark .bp5-slider-handle{background-color:#abb3bf;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1),0 1px 2px rgba(17,20,24,.2)}.bp5-dark .bp5-slider-handle:hover{background-color:#8f99a8;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1),0 1px 2px rgba(17,20,24,.4)}.bp5-dark .bp5-slider-handle.bp5-active{background-color:#738091;box-shadow:inset 0 1px 1px rgba(17,20,24,.1),inset 0 0 0 1px hsla(0,0%,100%,.1),0 1px 2px rgba(17,20,24,.4)}.bp5-dark .bp5-disabled .bp5-slider-handle{background:#5f6b7c;border-color:#5f6b7c;box-shadow:none}.bp5-slider-handle .bp5-slider-label{background:#404854;border-radius:2px;box-shadow:0 0 0 1px rgba(17,20,24,.1),0 2px 4px rgba(17,20,24,.2),0 8px 24px rgba(17,20,24,.2);color:#f6f7f9;margin-left:8px}.bp5-dark .bp5-slider-handle .bp5-slider-label{background:#e5e8eb;box-shadow:0 2px 4px rgba(17,20,24,.4),0 8px 24px rgba(17,20,24,.4);color:#404854}.bp5-slider-handle.bp5-end,.bp5-slider-handle.bp5-start{width:8px}.bp5-slider-handle.bp5-end{border-bottom-left-radius:0;border-top-left-radius:0;margin-left:8px}.bp5-slider-label{display:inline-block;font-size:12px;line-height:1;padding:2px 5px;position:absolute;transform:translate(-50%,20px);vertical-align:top}.bp5-tab,.bp5-tab-list{display:flex;position:relative}.bp5-slider.bp5-vertical{height:150px;min-width:40px;width:40px}.bp5-slider.bp5-vertical .bp5-slider-progress,.bp5-slider.bp5-vertical .bp5-slider-track{bottom:0;height:auto;left:5px;top:0;width:6px}.bp5-slider.bp5-vertical .bp5-slider-handle,.bp5-slider.bp5-vertical .bp5-slider-progress{top:auto}.bp5-slider.bp5-vertical .bp5-slider-label{transform:translate(20px,50%)}.bp5-slider.bp5-vertical .bp5-slider-handle .bp5-slider-label{margin-left:0;margin-top:-8px}.bp5-slider.bp5-vertical .bp5-slider-handle.bp5-end,.bp5-slider.bp5-vertical .bp5-slider-handle.bp5-start{height:8px;margin-left:0;width:16px}.bp5-slider.bp5-vertical .bp5-slider-handle.bp5-start{border-bottom-right-radius:2px;border-top-left-radius:0}.bp5-slider.bp5-vertical .bp5-slider-handle.bp5-start .bp5-slider-label{transform:translate(20px)}.bp5-slider.bp5-vertical .bp5-slider-handle.bp5-end{border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:2px;margin-bottom:8px}@keyframes c{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.bp5-spinner{align-items:center;display:flex;justify-content:center;overflow:visible;vertical-align:middle}.bp5-spinner path{fill-opacity:0}.bp5-spinner .bp5-spinner-head{stroke:rgba(95,107,124,.8);stroke-linecap:round;transform-origin:center;transition:stroke-dashoffset .2s cubic-bezier(.4,1,.75,.9)}.bp5-spinner .bp5-spinner-track{stroke:rgba(95,107,124,.2)}.bp5-spinner-animation{animation:.5s linear infinite c}.bp5-no-spin>.bp5-spinner-animation{animation:none}.bp5-dark .bp5-spinner .bp5-spinner-track{stroke:rgba(17,20,24,.5)}.bp5-spinner.bp5-intent-primary .bp5-spinner-head{stroke:#2d72d2}.bp5-spinner.bp5-intent-success .bp5-spinner-head{stroke:#238551}.bp5-spinner.bp5-intent-warning .bp5-spinner-head{stroke:#c87619}.bp5-spinner.bp5-intent-danger .bp5-spinner-head{stroke:#cd4246}.bp5-tabs.bp5-vertical>.bp5-tab-list{align-items:flex-start;flex-direction:column}.bp5-tabs.bp5-vertical>.bp5-tab-list .bp5-tab{align-items:center;border-radius:2px;display:flex;padding:0 10px;width:100%}.bp5-tabs.bp5-vertical>.bp5-tab-list .bp5-tab[aria-selected=true]{background-color:rgba(45,114,210,.2);box-shadow:none}.bp5-tabs.bp5-vertical>.bp5-tab-list .bp5-tab-indicator-wrapper .bp5-tab-indicator{background-color:rgba(45,114,210,.2);border-radius:2px;bottom:0;height:auto;left:0;right:0;top:0}.bp5-tabs.bp5-vertical>.bp5-tab-panel{margin-top:0;padding-left:20px}.bp5-tab-list{align-items:flex-end;border:none;flex:0 0 auto;list-style:none;margin:0;padding:0}.bp5-tab{word-wrap:normal;align-items:center;align-self:stretch;color:#1c2127;flex:0 0 auto;font-size:14px;line-height:30px;max-width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:top;white-space:nowrap}.bp5-tooltip.bp5-compact .bp5-code,.iconLanguage_nRYT{vertical-align:text-bottom}.bp5-tab a{display:block;text-decoration:none}.bp5-tab-indicator-wrapper~.bp5-tab{background-color:transparent!important;box-shadow:none!important}.bp5-tab[aria-selected=true]{border-radius:0;box-shadow:inset 0 -3px 0 #215db0}.bp5-tab:focus{-moz-outline-radius:0}.bp5-large>.bp5-tab{font-size:16px;line-height:40px}.bp5-tab-panel{margin-top:20px}.bp5-tab-indicator-wrapper{left:0;pointer-events:none;position:absolute;top:0;transform:translateX(0),translateY(0);transition:height .2s,transform .2s,width .2s;transition-timing-function:cubic-bezier(.4,1,.75,.9)}.bp5-tab-indicator-wrapper .bp5-tab-indicator{background-color:#215db0;bottom:0;height:3px;left:0;position:absolute;right:0}.bp5-tab-indicator-wrapper.bp5-no-animation{transition:none}.bp5-dark .bp5-tab[aria-selected=true]{box-shadow:inset 0 -3px 0 #8abbff}.bp5-dark .bp5-tab-indicator{background-color:#8abbff}.bp5-flex-expander{flex:1 1}.bp5-tag{align-items:center;background-color:#5f6b7c;border:none;border-radius:2px;box-shadow:none;color:#fff;display:inline-flex;flex-direction:row;font-size:12px;line-height:16px;max-width:100%;min-height:20px;min-width:20px;padding:2px 6px;position:relative}.bp5-dark .bp5-toast .bp5-button .bp5-icon,.bp5-tag-remove,.bp5-tag.bp5-intent-danger .bp5-tag-remove,.bp5-tag.bp5-intent-primary .bp5-tag-remove,.bp5-tag.bp5-intent-success .bp5-tag-remove,.bp5-toast.bp5-dark .bp5-button .bp5-icon,.bp5-toast.bp5-intent-danger .bp5-icon:first-child,.bp5-toast.bp5-intent-primary .bp5-icon:first-child,.bp5-toast.bp5-intent-success .bp5-icon:first-child,.bp5-toast[class*=bp5-intent-] a,.bp5-tree-node.bp5-tree-node-selected>.bp5-tree-node-content .bp5-tree-node-caret:before{color:hsla(0,0%,100%,.7)}.bp5-tag:before,.bp5-tag>*,.pin:not(:last-of-type){margin-right:4px}.bp5-tag-input .bp5-tag.bp5-active,.bp5-tag:focus{-moz-outline-radius:6px;outline:rgba(45,114,210,.6) solid 2px;outline-offset:0}.bp5-tag.bp5-interactive:hover{background:#404854}.bp5-tag.bp5-round{border-radius:30px;padding-left:8px;padding-right:8px}.bp5-dark .bp5-tag{background-color:#c5cbd3;color:#1c2127}.bp5-dark .bp5-tag.bp5-interactive.bp5-active,.bp5-dark .bp5-tag.bp5-interactive:active{background:#8f99a8}.bp5-large .bp5-tag,.bp5-tag.bp5-large{font-size:14px;line-height:20px;min-height:30px;min-width:30px;padding:5px 10px}.bp5-large .bp5-tag.bp5-round,.bp5-tag.bp5-large.bp5-round{padding-left:12px;padding-right:12px}.bp5-tag.bp5-intent-primary.bp5-interactive:hover{background-color:#215db0}.bp5-tag.bp5-intent-primary.bp5-interactive.bp5-active,.bp5-tag.bp5-intent-primary.bp5-interactive:active{background-color:#184a90}.bp5-tag.bp5-intent-success,.bp5-tooltip.bp5-intent-success .bp5-popover-content{background:#238551;color:#fff}.bp5-tag.bp5-intent-success.bp5-interactive:hover{background-color:#1c6e42}.bp5-tag.bp5-intent-success.bp5-interactive.bp5-active,.bp5-tag.bp5-intent-success.bp5-interactive:active{background-color:#165a36}.bp5-tag.bp5-intent-warning.bp5-interactive:hover{background-color:#ec9a3c}.bp5-dark .bp5-tag-remove,.bp5-tag.bp5-intent-warning .bp5-tag-remove,.bp5-toast.bp5-intent-warning .bp5-icon:first-child{color:rgba(28,33,39,.7)}.bp5-tag.bp5-intent-danger,.bp5-tooltip.bp5-intent-danger .bp5-popover-content{background:#cd4246;color:#fff}.bp5-tag.bp5-intent-danger.bp5-interactive:hover{background-color:#ac2f33}.bp5-tag.bp5-intent-danger.bp5-interactive.bp5-active,.bp5-tag.bp5-intent-danger.bp5-interactive:active{background-color:#8e292c}.bp5-tag.bp5-minimal .bp5-icon-large,.bp5-tag.bp5-minimal .bp5-icon-standard,.bp5-tag.bp5-minimal>.bp5-icon{fill:#5f6b7c}.bp5-tag.bp5-minimal:not([class*=bp5-intent-]){background-color:rgba(143,153,168,.15);color:#1c2127}.bp5-tag.bp5-minimal:not([class*=bp5-intent-]).bp5-interactive:hover{background-color:rgba(143,153,168,.3);color:#111418}.bp5-tag.bp5-minimal:not([class*=bp5-intent-]).bp5-interactive.bp5-active,.bp5-tag.bp5-minimal:not([class*=bp5-intent-]).bp5-interactive:active{background-color:rgba(143,153,168,.35);color:#111418}.bp5-dark .bp5-tooltip .bp5-heading,.bp5-dark .bp5-tooltip .bp5-popover-content,.bp5-tag.bp5-minimal:not([class*=bp5-intent-]) .bp5-tag-remove:active,.bp5-tag.bp5-minimal:not([class*=bp5-intent-]) .bp5-tag-remove:hover,.bp5-tooltip.bp5-dark .bp5-heading,.bp5-tooltip.bp5-dark .bp5-popover-content{color:#404854}.bp5-dark .bp5-tag.bp5-minimal:not([class*=bp5-intent-]){background-color:rgba(143,153,168,.15);color:#f6f7f9}.bp5-dark .bp5-tag.bp5-minimal:not([class*=bp5-intent-]).bp5-interactive:hover{background-color:rgba(143,153,168,.3);color:#fff}.bp5-dark .bp5-tag.bp5-minimal:not([class*=bp5-intent-]).bp5-interactive.bp5-active,.bp5-dark .bp5-tag.bp5-minimal:not([class*=bp5-intent-]).bp5-interactive:active{background-color:rgba(143,153,168,.35);color:#fff}.bp5-dark .bp5-tag.bp5-minimal:not([class*=bp5-intent-]) .bp5-tag-remove:active,.bp5-dark .bp5-tag.bp5-minimal:not([class*=bp5-intent-]) .bp5-tag-remove:hover{color:#d3d8de}.bp5-tag.bp5-minimal.bp5-intent-primary .bp5-icon-large,.bp5-tag.bp5-minimal.bp5-intent-primary .bp5-icon-standard,.bp5-tag.bp5-minimal.bp5-intent-primary>.bp5-icon{fill:#215db0}.bp5-tag.bp5-minimal.bp5-intent-primary.bp5-interactive.bp5-active,.bp5-tag.bp5-minimal.bp5-intent-primary.bp5-interactive:active{background-color:rgba(45,114,210,.3);color:#184a90}.bp5-tag.bp5-minimal.bp5-intent-success{background-color:rgba(35,133,81,.1);color:#1c6e42}.bp5-tag.bp5-minimal.bp5-intent-success .bp5-icon-large,.bp5-tag.bp5-minimal.bp5-intent-success .bp5-icon-standard,.bp5-tag.bp5-minimal.bp5-intent-success>.bp5-icon{fill:#1c6e42}.bp5-tag.bp5-minimal.bp5-intent-success.bp5-interactive.bp5-active,.bp5-tag.bp5-minimal.bp5-intent-success.bp5-interactive:active{background-color:rgba(35,133,81,.3);color:#165a36}.bp5-tag.bp5-minimal.bp5-intent-success .bp5-tag-remove:active,.bp5-tag.bp5-minimal.bp5-intent-success .bp5-tag-remove:hover{color:#165a36}.bp5-tag.bp5-minimal.bp5-intent-warning{background-color:rgba(200,118,25,.1);color:#935610}.bp5-tag.bp5-minimal.bp5-intent-warning .bp5-icon-large,.bp5-tag.bp5-minimal.bp5-intent-warning .bp5-icon-standard,.bp5-tag.bp5-minimal.bp5-intent-warning>.bp5-icon{fill:#935610}.bp5-tag.bp5-minimal.bp5-intent-warning.bp5-interactive.bp5-active,.bp5-tag.bp5-minimal.bp5-intent-warning.bp5-interactive:active{background-color:rgba(200,118,25,.3);color:#77450d}.bp5-tag.bp5-minimal.bp5-intent-warning .bp5-tag-remove:active,.bp5-tag.bp5-minimal.bp5-intent-warning .bp5-tag-remove:hover{color:#77450d}.bp5-tag.bp5-minimal.bp5-intent-danger{background-color:rgba(205,66,70,.1);color:#ac2f33}.bp5-tag.bp5-minimal.bp5-intent-danger .bp5-icon-large,.bp5-tag.bp5-minimal.bp5-intent-danger .bp5-icon-standard,.bp5-tag.bp5-minimal.bp5-intent-danger>.bp5-icon{fill:#ac2f33}.bp5-tag.bp5-minimal.bp5-intent-danger.bp5-interactive.bp5-active,.bp5-tag.bp5-minimal.bp5-intent-danger.bp5-interactive:active{background-color:rgba(205,66,70,.3);color:#8e292c}.bp5-tag.bp5-minimal.bp5-intent-danger .bp5-tag-remove:active,.bp5-tag.bp5-minimal.bp5-intent-danger .bp5-tag-remove:hover{color:#8e292c}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-primary.bp5-interactive.bp5-active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-primary.bp5-interactive:active{background-color:rgba(45,114,210,.35);color:#99c4ff}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-success{background-color:rgba(35,133,81,.2);color:#72ca9b}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-success.bp5-interactive.bp5-active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-success.bp5-interactive:active{background-color:rgba(35,133,81,.35);color:#7cd7a2}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-success .bp5-tag-remove:active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-success .bp5-tag-remove:hover{color:#7cd7a2}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-warning{background-color:rgba(200,118,25,.2);color:#fbb360}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-warning.bp5-interactive.bp5-active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-warning.bp5-interactive:active{background-color:rgba(200,118,25,.35);color:#f5c186}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-warning .bp5-tag-remove:active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-warning .bp5-tag-remove:hover{color:#f5c186}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-danger{background-color:rgba(205,66,70,.2);color:#fa999c}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-danger.bp5-interactive.bp5-active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-danger.bp5-interactive:active{background-color:rgba(205,66,70,.35);color:#ffa1a4}.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-danger .bp5-tag-remove:active,.bp5-dark .bp5-tag.bp5-minimal.bp5-intent-danger .bp5-tag-remove:hover{color:#ffa1a4}.bp5-tag-remove{background:none;border:none;display:flex;margin-bottom:-2px;margin-right:-6px!important;margin-top:-2px;padding:2px 2px 2px 0}.bp5-tag-input,.bp5-tag-input .bp5-tag-input-values:first-child .bp5-input-ghost{padding-left:5px}.bp5-tag-remove:hover{background:none;text-decoration:none}.bp5-tag-remove:empty:before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;content:"\f2ba";font-family:blueprint-icons-16,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:400;height:16px;line-height:1;width:16px}.bp5-large .bp5-tag-remove{margin-right:-10px!important;padding:0 5px 0 0}.bp5-large .bp5-tag-remove:empty:before{font-style:normal;font-variant:normal;font-weight:400;height:20px;line-height:1;width:20px}.bp5-tag-input{align-items:flex-start;cursor:text;display:flex;flex-direction:row;height:auto;line-height:inherit;min-height:30px;padding-right:0}.bp5-tag-input .bp5-tag-input-icon{color:#5f6b7c;margin-left:2px;margin-right:7px;margin-top:7px}.bp5-tag-input .bp5-tag-input-values{align-items:center;align-self:stretch;display:flex;flex-direction:row;flex-wrap:wrap;margin-right:7px;margin-top:5px;min-width:0;position:relative}.bp5-tag-input .bp5-tag-input-values>*{flex-grow:0;flex-shrink:0;margin-bottom:5px}.bp5-tag-input .bp5-tag-input-values:first-child .bp5-tag~.bp5-input-ghost,.bp5-tree-node-content-0,:not(.containsTaskList_WAbI>li)>.containsTaskList_WAbI{padding-left:0}.bp5-tag-input .bp5-tag{overflow-wrap:break-word}.bp5-tag-input .bp5-input-ghost{flex:1 1 auto;line-height:20px;width:80px}.ins-view .ins-view-inner,.node-io-view .node-io-view-inner{line-height:1;max-width:400px;text-overflow:ellipsis;font-family:Inter,sans-serif;text-align:center;-webkit-font-smoothing:antialiased;white-space:nowrap}.bp5-tag-input .bp5-button,.bp5-tag-input .bp5-spinner{margin:3px 3px 3px 0}.bp5-tag-input.bp5-large{height:auto;min-height:40px}.bp5-tag-input.bp5-large .bp5-tag-input-icon{margin-left:5px;margin-top:10px}.bp5-tag-input.bp5-large .bp5-button{margin:5px 5px 5px 0;min-height:30px;min-width:30px;padding:5px 10px}.bp5-tag-input.bp5-large .bp5-spinner{margin:8px 8px 8px 0}.bp5-dark .bp5-tag-input .bp5-input-ghost::placeholder,.bp5-tag-input.bp5-dark .bp5-input-ghost::placeholder{color:#abb3bf}.bp5-dark .bp5-tag-input.bp5-active,.bp5-tag-input.bp5-dark.bp5-active{background-color:rgba(17,20,24,.3);box-shadow:inset 0 0 0 1px #4c90f0,inset 0 0 0 1px #4c90f0,0 0 0 2px rgba(76,144,240,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-tag-input.bp5-active.bp5-intent-primary,.bp5-tag-input.bp5-dark.bp5-active.bp5-intent-primary{box-shadow:inset 0 0 0 1px #4c90f0,0 0 0 2px rgba(76,144,240,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-tag-input.bp5-active.bp5-intent-success,.bp5-tag-input.bp5-dark.bp5-active.bp5-intent-success{box-shadow:inset 0 0 0 1px #32a467,0 0 0 2px rgba(50,164,103,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-tag-input.bp5-active.bp5-intent-warning,.bp5-tag-input.bp5-dark.bp5-active.bp5-intent-warning{box-shadow:inset 0 0 0 1px #ec9a3c,0 0 0 2px rgba(236,154,60,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-dark .bp5-tag-input.bp5-active.bp5-intent-danger,.bp5-tag-input.bp5-dark.bp5-active.bp5-intent-danger{box-shadow:inset 0 0 0 1px #e76a6e,0 0 0 2px rgba(231,106,110,.3),inset 0 0 0 1px hsla(0,0%,100%,.2),inset 0 -1px 1px 0 #8f99a8}.bp5-input-ghost{background:none;border:none;box-shadow:none;padding:0}.bp5-omnibar .bp5-input,.bp5-omnibar .bp5-menu{border-radius:0;background-color:transparent}.bp5-input-ghost::placeholder{color:#5f6b7c;opacity:1}.bp5-resizable-input-span{max-height:0;max-width:100%;min-width:80px;opacity:0;overflow:hidden;position:absolute;white-space:nowrap;z-index:-1}.bp5-omnibar,.bp5-omnibar.bp5-overlay-exit,.bp5-toast.bp5-toast-exit{filter:blur(0);opacity:1}.bp5-toast{align-items:flex-start;background-color:#fff;border-radius:2px;box-shadow:inset 0 0 0 1px rgba(17,20,24,.2),0 2px 4px rgba(17,20,24,.2),0 8px 24px rgba(17,20,24,.2);display:flex;margin:20px 0 0;max-width:500px;min-width:300px;pointer-events:all;position:relative!important}.bp5-toast.bp5-toast-appear,.bp5-toast.bp5-toast-appear~.bp5-toast,.bp5-toast.bp5-toast-enter,.bp5-toast.bp5-toast-enter~.bp5-toast{transform:translateY(-40px)}.bp5-toast.bp5-toast-appear-active,.bp5-toast.bp5-toast-appear-active~.bp5-toast,.bp5-toast.bp5-toast-enter-active,.bp5-toast.bp5-toast-enter-active~.bp5-toast{transform:translateY(0);transition:transform .3s cubic-bezier(.54,1.12,.38,1.11) 0}.bp5-toast.bp5-toast-exit-active{filter:blur(10px);opacity:0;transition:opacity .3s cubic-bezier(.4,1,.75,.9) 0,filter .3s cubic-bezier(.4,1,.75,.9) 0}.bp5-toast.bp5-toast-exit-active~.bp5-toast{transform:translateY(-40px);transition:transform .1s cubic-bezier(.4,1,.75,.9) 50ms}.bp5-toast .bp5-button-group{flex:0 0 auto;padding:5px 5px 5px 0}.bp5-toast>.bp5-icon{color:#5f6b7c;margin:12px 0 12px 12px}.instance-panel,.pin:not(:first-of-type){margin-left:4px}.bp5-dark .bp5-toast,.bp5-toast.bp5-dark{background-color:#404854;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 2px 4px rgba(17,20,24,.4),0 8px 24px rgba(17,20,24,.4)}.bp5-dark .bp5-toast>.bp5-icon,.bp5-dark .bp5-tree .bp5-icon,.bp5-dark .bp5-tree .bp5-icon-large,.bp5-dark .bp5-tree .bp5-icon-standard,.bp5-dark .bp5-tree-node-caret,.bp5-toast.bp5-dark>.bp5-icon,.bp5-tooltip .bp5-text-muted{color:#abb3bf}.bp5-toast.bp5-intent-primary{background-color:#2d72d2;color:#fff}.bp5-toast.bp5-intent-primary .bp5-button{background-color:#2d72d2!important;color:#fff!important}.bp5-toast.bp5-intent-primary .bp5-button:hover{background-color:#215db0!important;color:#fff!important}.bp5-toast.bp5-intent-primary .bp5-button:active{background-color:#184a90!important;color:#fff!important}.bp5-toast.bp5-intent-danger .bp5-button:focus,.bp5-toast.bp5-intent-primary .bp5-button:focus,.bp5-toast.bp5-intent-success .bp5-button:focus,.bp5-toast.bp5-intent-warning .bp5-button:focus{outline-color:hsla(0,0%,100%,.5)}.bp5-toast.bp5-intent-danger .bp5-button:last-child>.bp5-icon-cross,.bp5-toast.bp5-intent-primary .bp5-button:last-child>.bp5-icon-cross,.bp5-toast.bp5-intent-success .bp5-button:last-child>.bp5-icon-cross{color:hsla(0,0%,100%,.7)!important}.bp5-toast.bp5-intent-success{background-color:#238551;color:#fff}.bp5-toast.bp5-intent-success .bp5-button{background-color:#238551!important;color:#fff!important}.bp5-toast.bp5-intent-success .bp5-button:hover{background-color:#1c6e42!important;color:#fff!important}.bp5-toast.bp5-intent-success .bp5-button:active{background-color:#165a36!important;color:#fff!important}.bp5-toast.bp5-intent-warning{background-color:#fbb360;color:#1c2127}.bp5-toast.bp5-intent-warning .bp5-button{background-color:#fbb360!important;color:#1c2127!important}.bp5-toast.bp5-intent-warning .bp5-button:hover{background-color:#ec9a3c!important;color:#1c2127!important}.bp5-toast.bp5-intent-warning .bp5-button:active{background-color:#c87619!important;color:#1c2127!important}.bp5-toast.bp5-intent-warning .bp5-button:last-child>.bp5-icon-cross{color:rgba(28,33,39,.7)!important}.bp5-toast.bp5-intent-danger{background-color:#cd4246;color:#fff}.bp5-toast.bp5-intent-danger .bp5-button{background-color:#cd4246!important;color:#fff!important}.bp5-toast.bp5-intent-danger .bp5-button:hover{background-color:#ac2f33!important;color:#fff!important}.bp5-toast.bp5-intent-danger .bp5-button:active{background-color:#8e292c!important;color:#fff!important}.bp5-toast-message{flex:1 1 auto;padding:11px}.bp5-toast-container{align-items:center;display:flex!important;flex-direction:column;left:0;overflow:hidden;padding:0 20px 20px;pointer-events:none;right:0;z-index:40}.bp5-toast-container.bp5-toast-container-top,.visual-node-editor .node-inputs.node-inputs,.visual-node-editor .node-outputs.node-inputs{top:0}.bp5-toast-container.bp5-toast-container-bottom{bottom:0;flex-direction:column-reverse;top:auto}.bp5-toast-container-bottom .bp5-toast.bp5-toast-appear:not(.bp5-toast-appear-active),.bp5-toast-container-bottom .bp5-toast.bp5-toast-appear:not(.bp5-toast-appear-active)~.bp5-toast,.bp5-toast-container-bottom .bp5-toast.bp5-toast-enter:not(.bp5-toast-enter-active),.bp5-toast-container-bottom .bp5-toast.bp5-toast-enter:not(.bp5-toast-enter-active)~.bp5-toast,.bp5-toast-container-bottom .bp5-toast.bp5-toast-exit-active~.bp5-toast,.bp5-toast-container-bottom .bp5-toast.bp5-toast-leave-active~.bp5-toast{transform:translateY(60px)}.bp5-tooltip{box-shadow:0 0 0 1px rgba(17,20,24,.1),0 2px 4px rgba(17,20,24,.2),0 8px 24px rgba(17,20,24,.2);color:#f6f7f9;transform:scale(1)}.bp5-tooltip .bp5-popover-arrow{height:22px;position:absolute;width:22px}.bp5-tooltip .bp5-popover-arrow:before{height:14px;margin:4px;width:14px;box-shadow:1px 1px 6px rgba(17,20,24,.2)}.bp5-tooltip .bp5-popover-content{background:#404854;padding:10px 12px}.bp5-tooltip .bp5-popover-arrow-fill{fill:#404854}.bp5-popover-appear>.bp5-tooltip,.bp5-popover-enter>.bp5-tooltip{transform:scale(.8)}.bp5-popover-exit-active>.bp5-tooltip{transform:scale(.8);transition:transform .1s cubic-bezier(.4,1,.75,.9) 0}.bp5-tooltip.bp5-compact .bp5-popover-content{line-height:1rem;padding:5px 7px}.bp5-tooltip.bp5-popover-placement-top .bp5-popover-arrow{transform:translateY(-3px)}.bp5-tooltip.bp5-popover-placement-left .bp5-popover-arrow{transform:translateX(-3px)}.bp5-tooltip.bp5-popover-placement-bottom .bp5-popover-arrow{transform:translateY(3px)}.bp5-tooltip.bp5-popover-placement-right .bp5-popover-arrow{transform:translateX(3px)}.bp5-dark .bp5-tooltip,.bp5-tooltip.bp5-dark{box-shadow:0 2px 4px rgba(17,20,24,.4),0 8px 24px rgba(17,20,24,.4)}.bp5-dark .bp5-tooltip .bp5-popover-content,.bp5-tooltip.bp5-dark .bp5-popover-content{background:#e5e8eb}.bp5-dark .bp5-tooltip .bp5-popover-arrow:before,.bp5-tooltip.bp5-dark .bp5-popover-arrow:before{box-shadow:1px 1px 6px rgba(17,20,24,.4)}.bp5-dark .bp5-tooltip .bp5-popover-arrow-fill,.bp5-tooltip.bp5-dark .bp5-popover-arrow-fill{fill:#e5e8eb}.bp5-dark .bp5-tooltip .bp5-running-text hr,.bp5-tooltip.bp5-dark .bp5-running-text hr{border-color:rgba(17,20,24,.15)}.bp5-tree .bp5-icon-large.bp5-intent-primary,.bp5-tree .bp5-icon-standard.bp5-intent-primary,.bp5-tree .bp5-icon.bp5-intent-primary,a>.bp5-dark .bp5-tooltip .bp5-code,a>.bp5-dark .bp5-tooltip .bp5-running-text code,a>.bp5-tooltip.bp5-dark .bp5-code,a>.bp5-tooltip.bp5-dark .bp5-running-text code{color:#2d72d2}.bp5-tooltip.bp5-intent-primary .bp5-popover-arrow-fill{fill:#2d72d2}.bp5-tooltip.bp5-intent-success .bp5-popover-arrow-fill{fill:#238551}.bp5-tooltip.bp5-intent-warning .bp5-popover-content{background:#c87619;color:#fff}.bp5-tooltip.bp5-intent-warning .bp5-popover-arrow-fill{fill:#c87619}.bp5-tooltip.bp5-intent-danger .bp5-popover-arrow-fill{fill:#cd4246}.bp5-tooltip-indicator{border-bottom:1px dotted;cursor:help}.bp5-tree .bp5-icon-large.bp5-intent-success,.bp5-tree .bp5-icon-standard.bp5-intent-success,.bp5-tree .bp5-icon.bp5-intent-success{color:#238551}.bp5-tree .bp5-icon-large.bp5-intent-warning,.bp5-tree .bp5-icon-standard.bp5-intent-warning,.bp5-tree .bp5-icon.bp5-intent-warning{color:#c87619}.bp5-tree .bp5-icon-large.bp5-intent-danger,.bp5-tree .bp5-icon-standard.bp5-intent-danger,.bp5-tree .bp5-icon.bp5-intent-danger{color:#cd4246}.bp5-tree-root{background-color:transparent;cursor:default;padding-left:0;position:relative}.bp5-tree-node-content-1{padding-left:23px}.bp5-tree-node-content-2{padding-left:46px}.bp5-tree-node-content-3{padding-left:69px}.bp5-tree-node-content-4{padding-left:92px}.bp5-tree-node-content-5{padding-left:115px}.bp5-tree-node-content-6{padding-left:138px}.bp5-tree-node-content-7{padding-left:161px}.bp5-tree-node-content-8{padding-left:184px}.bp5-tree-node-content-9{padding-left:207px}.bp5-tree-node-content-10{padding-left:230px}.bp5-tree-node-content-11{padding-left:253px}.bp5-tree-node-content-12{padding-left:276px}.bp5-tree-node-content-13{padding-left:299px}.bp5-tree-node-content-14{padding-left:322px}.bp5-tree-node-content-15{padding-left:345px}.bp5-tree-node-content-16{padding-left:368px}.bp5-tree-node-content-17{padding-left:391px}.bp5-tree-node-content-18{padding-left:414px}.bp5-tree-node-content-19{padding-left:437px}.bp5-tree-node-content-20{padding-left:460px}.bp5-tree-node-content{align-items:center;background:none;display:flex;height:30px;padding-right:5px;width:100%}.bp5-tree-node-caret,.bp5-tree-node-caret-none{min-width:30px}.bp5-tree-node-caret{color:#5f6b7c;cursor:pointer;padding:7px;transform:rotate(0);transition:transform .2s cubic-bezier(.4,1,.75,.9)}.base-node-view,.base-node-view-vp-fixer,.base-node-view-wrapper,.ins-view{transform-origin:top left}.bp5-tree-node-icon{margin-right:7px;position:relative}.bp5-tree-node-label{word-wrap:normal;flex:1 1 auto;overflow:hidden;position:relative;text-overflow:ellipsis;-webkit-user-select:none;user-select:none;white-space:nowrap}.bp5-tree-node-label span,.tags__trG{display:inline}.bp5-tree-node-secondary-label{padding:0 5px;-webkit-user-select:none;user-select:none}.bp5-tree-node.bp5-disabled .bp5-tree-node-content{background-color:inherit;color:rgba(95,107,124,.6);cursor:not-allowed}.bp5-dark .bp5-tree-node-content:hover{background-color:rgba(95,107,124,.3)}.bp5-multi-select{min-width:150px}.bp5-multi-select-popover .bp5-menu,.bp5-suggest-popover .bp5-menu{max-height:300px;max-width:400px;overflow:auto}.bp5-multi-select-popover.bp5-popover-match-target-width .bp5-menu,.bp5-select-popover.bp5-popover-match-target-width .bp5-menu,.bp5-suggest-popover.bp5-popover-match-target-width .bp5-menu{max-width:none;min-width:0}.bp5-omnibar{background-color:#fff;border-radius:2px;box-shadow:0 0 0 1px rgba(17,20,24,.1),0 4px 8px rgba(17,20,24,.2),0 18px 46px 6px rgba(17,20,24,.2);left:calc(50% - 250px);top:20vh;width:500px;z-index:21}.bp5-omnibar.bp5-overlay-appear,.bp5-omnibar.bp5-overlay-enter{filter:blur(20px);opacity:0}.bp5-omnibar.bp5-overlay-appear-active,.bp5-omnibar.bp5-overlay-enter-active{filter:blur(0);opacity:1;transition:filter .2s cubic-bezier(.4,1,.75,.9) 0,opacity .2s cubic-bezier(.4,1,.75,.9) 0}.bp5-omnibar.bp5-overlay-exit-active{filter:blur(20px);opacity:0;transition:filter .2s cubic-bezier(.4,1,.75,.9) 0,opacity .2s cubic-bezier(.4,1,.75,.9) 0}.bp5-omnibar .bp5-menu{box-shadow:inset 0 1px 0 rgba(17,20,24,.15);max-height:calc(60vh - 40px);overflow:auto}.bp5-dark .bp5-omnibar,.bp5-omnibar.bp5-dark{background-color:#383e47;box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.2),0 4px 8px rgba(17,20,24,.4),0 18px 46px 6px rgba(17,20,24,.4)}.bp5-omnibar-overlay .bp5-overlay-backdrop{background-color:rgba(17,20,24,.2)}.bp5-select-popover .bp5-popover-content{padding:5px}.bp5-select-popover .bp5-menu{max-height:300px;max-width:400px;overflow:auto;padding:0}.bp5-select-popover .bp5-menu:not(:first-child){padding-top:5px}@font-face{font-family:blueprint-icons-16;src:url(/assets/fonts/blueprint-icons-16-fe34be7b52fe280ae6fcd1a2c90c2ec5.ttf) format("truetype"),url(/assets/fonts/blueprint-icons-16-2669cc26a3ca40496c1a2fb0246b0ce7.eot#iefix) format("embedded-opentype"),url(/assets/fonts/blueprint-icons-16-5d3be7e91ef0bd98ba4349ec8a8ae419.woff2) format("woff2"),url(/assets/fonts/blueprint-icons-16-6908f1544dc20870cd80bd55f3b97d4e.woff) format("woff"),url(/assets/images/blueprint-icons-16-928936b25a7f631d44d6e20d402d0af2.svg#blueprint-icons-16) format("svg")}@font-face{font-family:blueprint-icons-20;src:url(/assets/fonts/blueprint-icons-20-cf3d85353267b1034956ca544495b97a.ttf) format("truetype"),url(/assets/fonts/blueprint-icons-20-7a9cd56e4f1468be3c5758d1832b02b0.eot#iefix) format("embedded-opentype"),url(/assets/fonts/blueprint-icons-20-c20dc60373b0a5fbfa7f6cd280f49bba.woff2) format("woff2"),url(/assets/fonts/blueprint-icons-20-6bafdea7cca3b5a2de42c4e73c456115.woff) format("woff"),url(/assets/images/blueprint-icons-20-69e09533623b64863cf5cc65034cf679.svg#blueprint-icons-20) format("svg")}.base-node-editor .form-row{display:flex;flex-direction:row;justify-content:space-between}.base-node-editor .form-row>div:not(:last-child){padding-right:10px}.base-node-editor .preview-wrapper{display:flex;justify-content:center}.manage-visual-node-view{color:pink}.omnibar-item .title{display:flex;font-weight:700;justify-content:space-between}.omnibar-item .title .extra{font-weight:400;opacity:.8}.omnibar-item.active .description{white-space:break-spaces}.data-inspection-modal{width:80%}.data-inspection-modal header input{margin:10px 0}.data-inspection-modal .main-wrapper{display:flex;flex-direction:row;gap:10px;max-height:80%}.data-inspection-modal .main-wrapper .samples-menu{flex:0;max-height:80vh;overflow:auto}.data-inspection-modal .main-wrapper .content-wrapper{flex:1;max-height:80vh;overflow:auto}.flyde-flow-editor{background-color:#fff;display:flex;flex:1;flex-direction:column;position:relative}.flyde-flow-editor>.visual-node-editor{flex:1;height:100%}.feature-strip .feature-strip-inner .image-container,.flyde-flow-editor>.breadcrumbs{flex-shrink:0}.base-node-view-vp-fixer{will-change:transform}.base-node-view-wrapper{position:absolute;transition:background-color 3s ease-out,box-shadow 3s ease-out}.base-node-view-vp-fixer.display-mode,.base-node-view-vp-fixer.display-mode .base-node-view,.base-node-view-vp-fixer.display-mode .base-node-view-wrapper,.ins-view.display-mode{position:static}.base-node-view{display:inline-block;position:absolute;transition:box-shadow .5s ease-in-out;will-change:transform,width}.connection:hover polyline{stroke-width:3}.connection polyline,path.connection{fill:none;stroke-width:1.5;stroke-linecap:round;stroke:#525252;cursor:pointer}.actions-menu .icon-wrapper svg,.help-bubble svg{fill:currentColor}.connection polyline.hidden,path.connection.hidden{stroke:transparent}.connection polyline.hidden.parent-selected,path.connection.hidden.parent-selected{stroke-dasharray:8;stroke:#6c6c6c}.connection[data-runtime=active] path{stroke:#4bac00;box-shadow:5px 10px #888}.connection.delayed polyline,.connection.future-addition,.connection.future-removal,.connections-view .connection.delayed polyline{stroke-dasharray:6}.connection.future-addition path{stroke-width:2;stroke:rgba(0,125,198,.647)}.connection.future-removal path{stroke-width:2;stroke:rgba(198,0,0,.647)}.connection polyline:hover{stroke:#3bb8ff}.connections-view{height:100%;pointer-events:none;position:absolute;width:100%}.connections-view path{stroke-width:1.5;stroke-linecap:round;stroke:#a1a1aa}.connections-view path.future-add{stroke:rgba(0,125,198,.647)}.connections-view path.future-remove{stroke:rgba(198,0,0,.647)}.connections-view text.label{text-anchor:middle;font-size:14px}.instance-panel{background:#fff;border-left:1px solid #e2e2e2;box-shadow:0 4px 4px rgba(0,0,0,.25);box-sizing:border-box;display:flex;flex-direction:column;padding:20px 10px 100px;position:relative;-webkit-user-select:none;user-select:none;z-index:1}.ins-view,.layout-debugger{display:inline-block;will-change:transform,width}.instance-panel .instance-panel-inner{flex:1;height:100%;overflow:auto}.instance-panel:not(:hover) .resizer{opacity:.2}.instance-panel .resizer,.playground-container .handle{background:#aeaeae;bottom:0;cursor:col-resize;flex-grow:0;flex-shrink:0;height:100%;left:0;position:absolute;top:0;transition:opacity .05s linear;width:3px}.instance-panel .resizer:after,.playground-container .handle:after{background-color:#cecece;content:"";display:block;height:80%;left:1px;position:absolute;top:10%;width:1px}.ins-view .inputs,.ins-view .outputs{align-content:space-between;align-items:center;display:flex;justify-content:space-around;width:100%}.ins-view{position:absolute;transition:box-shadow .15s ease-in-out;z-index:1}.ins-view.no-inputs{padding-top:15px}.ins-view.no-outputs{padding-bottom:15px}.ins-view .ins-view-inner{border:2px solid;border-radius:5px;cursor:pointer;font-size:16px;font-weight:600;overflow:hidden;padding:10px 30px;position:relative;transition:background-color .1s ease-in-out,box-shadow .2s ease-in-out;-webkit-user-select:none;user-select:none;z-index:1}.ins-view .ins-view-inner:not(.selected).closest,.ins-view .ins-view-inner:not(.selected):hover,.node-io-view .node-io-view-inner:not(.selected).closest,.node-io-view .node-io-view-inner:not(.selected):hover{border-style:dashed}.ins-view .ins-view-inner:not(.dark),.node-io-view .node-io-view-inner:not(.dark){background:#fff;border-color:#d1d5db;color:#000}.ins-view .ins-view-inner:not(.dark).closest:not(.selected),.node-io-view .node-io-view-inner:not(.dark).closest:not(.selected){border-color:#9ca3af}.ins-view .ins-view-inner:not(.dark):hover:not(.selected),.node-io-view .node-io-view-inner:not(.dark):hover:not(.selected){border-color:#4b5563}.ins-view .ins-view-inner:not(.dark).selected,.node-io-view .node-io-view-inner:not(.dark).selected{background:#fff;border-color:#1f2937;border-style:solid;transition:background-color .05s ease-in-out}.ins-view .ins-view-inner.dark,.node-io-view .node-io-view-inner.dark{background:#262626;border-color:#71717a;color:#fafafa}.ins-view .ins-view-inner.dark.closest:not(.selected),.node-io-view .node-io-view-inner.dark.closest:not(.selected){border-color:#a1a1aa}.ins-view .ins-view-inner.dark:hover:not(.selected),.node-io-view .node-io-view-inner.dark:hover:not(.selected){border-color:#d4d4d8}.ins-view .ins-view-inner.dark.selected,.node-io-view .node-io-view-inner.dark.selected{background:#18181b;border-color:#e4e4e7;border-style:solid;transition:background-color .05s ease-in-out}.ins-view .ins-view-inner .svg-inline--fa{color:var(--node-color);filter:brightness(.75)}.ins-view .ins-view-inner.size-small{font-size:14px;padding:6px 18px}.inline-editor-portal-root .inline-group-editor-container{background:#fff;box-shadow:0 0 10px 2px rgba(48,48,48,.15);display:flex;flex-direction:column;height:85%;left:10%;overflow:hidden;position:absolute;top:7.5%;width:80%;z-index:2}.inline-editor-portal-root .inline-group-editor-container>header{font-size:20px;font-weight:600;padding:4px 15px 3px;text-align:center;-webkit-user-select:none;user-select:none;z-index:1}.inline-editor-portal-root .inline-group-editor-container>.visual-node-editor{display:flex;flex:1;overflow:hidden;position:relative}.ins-view .pin{transition:transform .1s ease-in-out}.ins-view:not(:hover):not(.force-minimized-input) .pin.input.minimized:not(.selected){transform:translateY(calc(100% - 16px)) scaleY(0)}.ins-view:not(:hover):not(.force-minimized-output) .pin.output.minimized:not(.selected){transform:translateY(calc(-100% + 16px)) scaleY(0)}.__react_component_tooltip.instance-info-tooltip,.__react_component_tooltip.pin-info-tooltip{font-size:14px;max-width:400px}.layout-debugger{transition:box-shadow .5s ease-in-out;z-index:2}.layout-debugger,.layout-debugger .drag-sim,.layout-debugger .layout-debugger-zoom-wrapper{position:absolute;transform-origin:top left}.layout-debugger .layout-debugger-inner{background:pink;border:1px solid #fff;transform-origin:top left}.viewport-data{left:10px;position:absolute;top:10px}.pos-debugger{background:#000;color:#ff0;font-size:8px;position:absolute;z-index:2}.node-io-view .node-io-view-inner{border:2px solid;border-radius:2px;cursor:pointer;font-size:18px;font-weight:500;overflow:hidden;padding:6px 8px;position:relative;transition:background-color .1s ease-in-out,box-shadow .2s ease-in-out;-webkit-user-select:none;user-select:none;z-index:1}.node-io-view.input .node-io-view-inner{border:2px solid #83cff6}.node-io-view.output .node-io-view-inner{border:2px solid #86efac}.node-io-view.active .node-io-view-inner{background:#c8ffc7}.json-view{--json-property:#009033;--json-index:#676dff;--json-number:#676dff;--json-string:#b2762e;--json-boolean:#dc155e;--json-null:#dc155e;display:block}.json-view .json-view--property{color:var(--json-property)}.json-view .json-view--index{color:var(--json-index)}.json-view .json-view--number{color:var(--json-number)}.json-view .json-view--string{color:var(--json-string)}.json-view .json-view--boolean{color:var(--json-boolean)}.json-view .json-view--null{color:var(--json-null)}.json-view :is(.json-view--copy,.json-view--edit){cursor:pointer;display:none;height:1em;margin-left:4px;width:1em}.json-view .json-view--deleting{background-color:rgba(218,0,0,.067);outline:#da0000 solid 1px;text-decoration-line:line-through}.json-view .json-view--input{background:0 0;border:1px solid;border-radius:4px;font-size:87.5%;line-height:1.25;margin-left:4px;padding:0 4px;width:120px}:is(.json-view:hover,.json-view--pair:hover)>:is(.json-view--copy,.json-view--edit){display:inline-block}.json-view .jv-indent{padding-left:16px}.json-view .jv-chevron{cursor:pointer;display:inline-block;height:1em;opacity:.4;vertical-align:-20%;width:1em}.json-view .jv-button{background:0 0;border:none;cursor:pointer;outline:0}.add-node-menu-list-item .content>header .bp5-tag,.info-tooltip-icon{margin-left:5px}.pin{align-items:center;display:flex;flex-direction:column;position:relative;-webkit-user-select:none;user-select:none;z-index:0}.pin .wire{background:#6b7280;flex-grow:1;height:100%;min-height:10px;width:2px}.pin .pin-inner{border-radius:2px;border-style:solid;border-width:2px;cursor:pointer;flex-shrink:0;font-size:12px;font-weight:500;line-height:1;padding:2px 4px;white-space:nowrap;will-change:border}.pin .pin-inner:not(.dark){background:#fff;border-color:#d1d5db}.pin .pin-inner.dark{background:#262626;border-color:#374151;color:#fafafa}.pin .pin-inner .suffix{color:#595959;margin-left:3px}.pin.input .pin-inner,.pin.output .pin-inner,.pin[data-pin-id=__error] .pin-inner,.pin[data-pin-id=__trigger].input .pin-inner{-webkit-font-smoothing:antialiased}.pin.input .pin-inner:not(.dark){border-color:#83cff6}.pin.input .pin-inner.dark{border-color:#0a649a}.pin.input.closest:not(.selected) .pin-inner,.pin.input:hover:not(.selected) .pin-inner{border-color:#189bdc;border-style:dashed}.pin.input.selected .pin-inner:not(.dark){background:#f9fafb;border-color:#0b7dbe}.pin.input.selected .pin-inner.dark{background:#000;border-color:#83cff6}.pin.output{flex-direction:column-reverse}.pin.output .pin-inner:not(.dark){border-color:#86efac}.pin.output .pin-inner.dark{border-color:#15803d}.pin.output.closest:not(.selected) .pin-inner,.pin.output:hover:not(.selected) .pin-inner{border-color:#22c55e;border-style:dashed}.pin.output.selected .pin-inner:not(.dark){background:#f9fafb;border-color:#16a34a}.pin.output.selected .pin-inner.dark{background:#000;border-color:#86efac}.pin[data-pin-id=__trigger].input .pin-inner:not(.dark){border-color:#d8b4fe}.pin[data-pin-id=__trigger].input .pin-inner.dark{border-color:#7e22ce}.pin[data-pin-id=__trigger].input.closest:not(.selected) .pin-inner,.pin[data-pin-id=__trigger].input:hover:not(.selected) .pin-inner{border-color:#a855f7;border-style:dashed}.pin[data-pin-id=__trigger].input.selected .pin-inner:not(.dark){background:#f9fafb;border-color:#9333ea}.pin[data-pin-id=__trigger].input.selected .pin-inner.dark{background:#000;border-color:#d8b4fe}.pin[data-pin-id=__error] .pin-inner:not(.dark){border-color:#fca5a5}.pin[data-pin-id=__error] .pin-inner.dark{border-color:#b91c1c}.pin[data-pin-id=__error].closest:not(.selected) .pin-inner,.pin[data-pin-id=__error]:hover:not(.selected) .pin-inner{border-color:#ef4444;border-style:dashed}.pin[data-pin-id=__error].selected .pin-inner:not(.dark){background:#f9fafb;border-color:#dc2626}.pin[data-pin-id=__error].selected .pin-inner.dark{background:#000;border-color:#fca5a5}.pin.has-value.output .pin-inner{background:#ffe6de}.pin.const-value.input .pin-inner{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pin.const-value.input .pin-inner:not(.dark){background:#bbf7d0}.pin.const-value.input .pin-inner.dark{background:#166534}.pin.const-value.input .pin-inner .value{font-size:110%}.display-mode .pin-inner{font-size:8px}.quick-add-menu{position:absolute;transform:translateY(-35px)}.side-bar{background:#2f2f2f;box-shadow:inset -2px 4px 4px rgba(0,0,0,.25);display:flex;flex-direction:column;max-height:100vh;-webkit-user-select:none;user-select:none}.sidebar_U0ns,.tableOfContents_FRrT{max-height:calc(100vh - var(--ifm-navbar-height) - 2rem)}.side-bar .heading{background:#232323;color:#b2b2b2;font-size:14px;font-weight:700;margin-bottom:15px;margin-top:10px;padding:8px 15px}.side-bar .items{flex-shrink:0;overflow:auto}.side-bar .menu-item{color:#d9d9d9;cursor:pointer;font-size:12px;padding:8px 15px}.side-bar .menu-item.selected,.side-bar .menu-item:hover{background:hsla(0,0%,100%,.05)}.side-bar .menu-item .type{color:#646464;font-weight:500;margin-right:8px}.base-node-view-wrapper[data-runtime=processing] .ins-view-inner,.node-io-view-inner[data-runtime-queue],.pin-inner[data-runtime-queue]{animation:1.5s infinite d}.base-node-view-wrapper[data-runtime=processing] .ins-view-inner:not(.dark){--event-bg-color:#83cff6;--event-border-color:#189bdc}.base-node-view-wrapper[data-runtime=processing] .ins-view-inner.dark{--event-bg-color:#0a649a;--event-border-color:#189bdc}.base-node-view-wrapper[data-runtime=done] .ins-view-inner,.ins-view:not(.error-caught) .base-node-view-wrapper[data-runtime=error] .ins-view-inner,.node-io-view-inner[data-runtime=active]:not([data-runtime-queue]),.pin.error-pin.connected .pin-inner[data-runtime=active]:not([data-runtime-queue]),.pin:not(.error-pin) .pin-inner[data-runtime=active]:not([data-runtime-queue]){animation:6s e}.base-node-view-wrapper[data-runtime=done] .ins-view-inner:not(.dark),.ins-view.error-caught .base-node-view-wrapper[data-runtime=error] .ins-view-inner:not(.dark),.node-io-view-inner[data-runtime=active]:not([data-runtime-queue]):not(.dark),.pin.error-pin.connected .pin-inner[data-runtime=active]:not([data-runtime-queue]):not(.dark),.pin:not(.error-pin) .pin-inner[data-runtime=active]:not([data-runtime-queue]):not(.dark){--event-bg-color:#86efac;--event-border-color:#22c55e}.base-node-view-wrapper[data-runtime=done] .ins-view-inner.dark,.ins-view.error-caught .base-node-view-wrapper[data-runtime=error] .ins-view-inner.dark,.node-io-view-inner[data-runtime=active]:not([data-runtime-queue]).dark,.pin.error-pin.connected .pin-inner[data-runtime=active]:not([data-runtime-queue]).dark,.pin:not(.error-pin) .pin-inner[data-runtime=active]:not([data-runtime-queue]).dark{--event-bg-color:#15803d;--event-border-color:#22c55e}.ins-view:not(.error-caught) .base-node-view-wrapper[data-runtime=error] .ins-view-inner:not(.dark),.pin.error-pin:not(.connected) .pin-inner[data-runtime=active]:not(.dark){--event-bg-color:#fca5a5;--event-border-color:#ef4444}.ins-view:not(.error-caught) .base-node-view-wrapper[data-runtime=error] .ins-view-inner.dark,.pin.error-pin:not(.connected) .pin-inner[data-runtime=active].dark{--event-bg-color:#b91c1c;--event-border-color:#ef4444}.ins-view.error-caught .base-node-view-wrapper[data-runtime=error] .ins-view-inner,.main-instance-events-indicator[data-runtime=error]{animation:12s blink-error}.main-instance-events-indicator[data-runtime=processing]{animation:1.5s infinite d;background:#88f8ff}.main-instance-events-indicator[data-runtime=processing] .status-text:after{content:"Processing"}.main-instance-events-indicator[data-runtime=error] .status-text:after{content:"Error"}.main-instance-events-indicator[data-runtime=done]{animation:12s blink-done}.main-instance-events-indicator[data-runtime=done] .status-text:after{content:"Completed"}.pin.error-pin:not(.connected) .pin-inner[data-runtime=active]{animation:12s e}.node-io-view-inner[data-runtime-queue]:not(.dark),.pin-inner[data-runtime-queue]:not(.dark){--event-bg-color:#d8b4fe;--event-border-color:#a855f7}.node-io-view-inner[data-runtime-queue].dark,.pin-inner[data-runtime-queue].dark{--event-bg-color:#7e22ce;--event-border-color:#a855f7}@keyframes d{0%,to{background:var(--event-bg-color);border-color:var(--event-border-color);filter:brightness(1);transform:scale(.98)}50%{background:var(--event-bg-color);border-color:var(--event-border-color);filter:brightness(1.1);transform:scale(1.01)}}@keyframes e{3%{background-color:var(--event-bg-color);border-color:var(--event-border-color)}30%{background-color:var(--event-bg-color);border-color:var(--event-border-color);filter:brightness(1.2)}}.add-node-menu-list-item{align-items:center;display:flex;flex-direction:row;padding:5px 10px}.add-node-menu-list-item:not(:last-of-type){border-bottom:1px solid #ddd}.add-node-menu-list-item .content>header{align-items:center;display:flex;flex-direction:row;justify-content:space-between}.add-node-menu-list-item .content>header .id{flex:1;font-size:1.1em;font-weight:600}.add-node-menu-list-item aside{flex:0;margin-left:20px;visibility:hidden}.add-node-menu-list-item.selected:not(:hover){background:#015c8f;color:#fff}.add-node-menu-list-item:hover{background:#0082cd;color:#fff}.add-node-menu-list-item:hover aside{visibility:visible}.add-node-menu-results-summary{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;min-height:var(--heading-height);padding:10px}.add-node-menu{--max-height:65vh;--heading-height:45px;display:flex;width:85vw}.add-node-menu .content-wrapper{display:flex;flex-direction:row;height:var(--max-height)}.add-node-menu .content-wrapper .loader{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.add-node-menu .content-wrapper>aside{border:1px solid #ddd;flex:1;margin-right:10px;width:25%}.add-node-menu .content-wrapper>aside .filter-header{align-items:center;border-bottom:1px solid #ddd;display:flex;flex-direction:row;gap:10px;height:45px;line-height:0;padding:10px}.actions-menu .icon-wrapper,.add-node-menu .content-wrapper>aside .filter-header a{line-height:0}.add-node-menu .content-wrapper>aside .tree-container{max-height:calc(100% - 45px);overflow:auto}.add-node-menu .content-wrapper main{border:1px solid #ddd;flex:3}.add-node-menu .content-wrapper main .results{border-top:1px solid #ddd;max-height:calc(100% - 45px);overflow:auto}.add-node-menu .content-wrapper main .no-results{align-items:center;display:flex;flex-direction:column;gap:20px;height:100%;justify-content:center;padding:10px;text-align:center}.add-node-menu .content-wrapper main .no-results .add-node-menu-results-summary{gap:7px;justify-content:center}.add-node-menu .content-wrapper main .no-results .callout{max-width:300px}.prompt-ai-menu .progress-bar-container{margin:5px 10px}.run-flow-modal .execution-delay-wrapper{margin-top:20px;padding:0 40px}.actions-menu{align-items:center;border:1px solid #a1a1aa;border-radius:5px 0 0 5px;display:flex;flex-direction:column;overflow:clip;position:absolute;right:0;top:50%;transform:translateY(-50%);transition:opacity .05s ease-in-out,transform .05s ease-in-out;z-index:1}.actions-menu:not(:hover){transform-origin:center}.actions-menu .action-button{align-items:center;background:#fff;color:#525252;cursor:pointer;display:flex;height:40px;justify-content:center;width:40px}.actions-menu .action-button:hover{background:#f4f4f5}.actions-menu .action-button:active{transform:scale(.95)}.action-button-tooltip .hotkey,kbd{display:inline-block}kbd{background:#dedede;border-radius:3px;box-shadow:0 1px 1px rgba(0,0,0,.2),0 0 0 1px rgba(0,0,0,.1);color:#333;font-size:.8em;padding:2px 5px}.main-instance-events-indicator{border-radius:15px;bottom:max(10px,5%);color:#333;font-weight:600;left:50%;opacity:.8;position:absolute;transform:translateX(-50%);z-index:1}.main-instance-events-indicator .status-text:after{display:inline-block;font-size:12px;padding:2px 8px}.help-bubble{color:#0b70af;cursor:pointer}.help-bubble:hover{color:#008cdd}.help-bubble svg{height:40px;width:40px}.visual-node-editor{display:flex;z-index:0}.feature-strip,.visual-node-editor:not(.dark){background:#f3f4f6}.visual-node-editor.dark{background:#404040}.visual-node-editor>.side-bar{flex-grow:0;flex-shrink:0;overflow:hidden;position:relative;white-space:nowrap;width:40px;z-index:1}.visual-node-editor>.side-bar.expanded{width:250px}.visual-node-editor>main{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='1' fill=',BCDCF' fill-opacity='.2' fill-rule='evenodd'/%3E%3C/svg%3E");flex:1;overflow:hidden}.visual-node-editor.dark>main{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='1' fill='A0A0A' fill-opacity='.8' fill-rule='evenodd'/%3E%3C/svg%3E")}.visual-node-editor .node-inputs,.visual-node-editor .node-outputs{align-content:space-between;display:flex;justify-content:space-around;left:50%;margin:0 auto;position:absolute;transform:translateX(-50%);width:60%;z-index:1}.visual-node-editor .node-inputs.node-outputs,.visual-node-editor .node-outputs.node-outputs{bottom:0}.visual-node-editor .selection-box{background:rgba(101,200,255,.5);border:1px solid #f7f7f7;opacity:.7;position:absolute;z-index:2}.visual-node-editor .edit-group-modal{background:rgba(39,54,62,.95);border:1px solid #787878;border-radius:5px;bottom:5vh;box-sizing:border-box;display:flex;flex-direction:column;height:90vh;left:10vw;position:fixed;top:5vh;width:80vw;z-index:3}.visual-node-editor .edit-group-modal>header{align-items:center;background:#2f2f2f;border-radius:5px 5px 0 0;color:#fff;display:flex;flex-grow:0;flex-shrink:0;font-size:12px;font-weight:300;padding:8px 20px}.visual-node-editor .edit-group-modal>main{display:flex;flex:1;overflow:auto;position:relative}.visual-node-editor .viewport-controls-and-help{align-items:center;bottom:10px;display:flex;gap:5px;height:30px;position:absolute;right:20px;-webkit-user-select:none;user-select:none;z-index:2}.visual-node-editor .viewport-controls-and-help .bp5-slider{height:16px;width:150px}.visual-node-editor .temp{bottom:20px;position:absolute;right:250px}.visual-node-editor .inline-node-container{border:1px solid gray;display:flex;flex-direction:column;height:80%;left:10%;overflow:hidden;position:absolute;top:10%;width:80%;z-index:2}.visual-node-editor .inline-node-container>header{background:#fff;padding:10px 5px}.visual-node-editor .inline-node-container .visual-node-editor{display:flex;flex:1}.visual-node-editor .debug-info{background:rgba(166,0,0,.5);border-radius:5px;color:#fff;font-family:monospace;font-size:12px;left:20px;padding:10px;position:absolute;top:20px;z-index:1}.react-resizable-handle{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgd2lkdGg9IjYiIGhlaWdodD0iNiI+PHBhdGggZD0iTTYgNkgwVjQuMmg0LjJWMEg2djZaIiBvcGFjaXR5PSIuMzAyIi8+PC9zdmc+");background-origin:content-box;background-position:100% 100%;background-repeat:no-repeat;box-sizing:border-box;height:20px;padding:0 3px 3px 0;position:absolute;width:20px}.react-resizable-handle-sw{bottom:0;cursor:sw-resize;left:0;transform:rotate(90deg)}.react-resizable-handle-se{bottom:0;cursor:se-resize;right:0}.react-resizable-handle-nw{cursor:nw-resize;left:0;top:0;transform:rotate(180deg)}.react-resizable-handle-ne{cursor:ne-resize;right:0;top:0;transform:rotate(270deg)}.react-resizable-handle-e,.react-resizable-handle-w{cursor:ew-resize;margin-top:-10px;top:50%}.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-resizable-handle-n,.react-resizable-handle-s{cursor:ns-resize;left:50%;margin-left:-10px}.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-resizable-handle-s{bottom:0;transform:rotate(45deg)}body{margin:0;padding:0;font-size:16px;line-height:1.5}.bp5-button,.bp5-control,.bp5-input,body{font-family:Inter,sans-serif}.home-page{flex:1;padding:50px;width:100%}.home-page a{display:block;margin:20px auto;text-align:center}.skipToContent_zaHc{background-color:var(--ifm-background-surface-color);color:var(--ifm-color-emphasis-900);left:100%;padding:calc(var(--ifm-global-spacing)/2) var(--ifm-global-spacing);position:fixed;top:1rem;z-index:calc(var(--ifm-z-index-fixed) + 1)}.skipToContent_zaHc:focus{box-shadow:var(--ifm-global-shadow-md);left:1rem}.closeButton_n1uY{line-height:0;padding:0}.content_W3Qu{font-size:85%;padding:5px 0;text-align:center}.content_W3Qu a{color:inherit;text-decoration:underline}.announcementBar_pUh_{align-items:center;background-color:var(--ifm-color-white);border-bottom:1px solid var(--ifm-color-emphasis-100);color:var(--ifm-color-black);display:flex;height:var(--docusaurus-announcement-bar-height)}.announcementBarPlaceholder_Pb6Q{flex:0 0 10px}.announcementBarClose_MFWf{align-self:stretch;flex:0 0 30px}.toggle_BTcr{height:2rem;width:2rem}.toggleButton__N08{align-items:center;border-radius:50%;display:flex;height:100%;justify-content:center;transition:background var(--ifm-transition-fast);width:100%}.toggleButton__N08:hover{background:var(--ifm-color-emphasis-200)}.darkNavbarColorModeToggle_jWiB:hover{background:var(--ifm-color-gray-800)}[data-theme=dark] .themedImage--dark_Qruz,[data-theme=light] .themedImage--light_wmDU{display:initial}.iconExternalLink_BV0h{margin-left:.3rem}.iconLanguage_nRYT{margin-right:5px}.navbarHideable_nVcN{transition:transform var(--ifm-transition-fast) ease}.navbarHidden_moai{transform:translate3d(0,calc(-100% - 2px),0)}.errorBoundaryError_Jdse{color:red;white-space:pre-wrap}.footerLogoLink_lMws{opacity:.5;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.mainWrapper_aymX{display:flex;flex:1 0 auto;flex-direction:column}.docusaurus-mt-lg{margin-top:3rem}#__docusaurus{display:flex;flex-direction:column;min-height:100%}.sidebar_U0ns{overflow-y:auto;position:sticky;top:calc(var(--ifm-navbar-height) + 2rem)}.sidebarItemTitle_iAor{font-size:var(--ifm-h3-font-size);font-weight:var(--ifm-font-weight-bold)}.container_TLel,.sidebarItemList_ghTL{font-size:.9rem}.sidebarItem_e8Uj{margin-top:.7rem}.sidebarItemLink_ei87{color:var(--ifm-font-color-base);display:block}.sidebarItemLinkActive_CRO7{color:var(--ifm-color-primary)!important}.backToTopButton_pSAI{background-color:var(--ifm-color-emphasis-200);border-radius:50%;bottom:1.3rem;box-shadow:var(--ifm-global-shadow-lw);height:3rem;opacity:0;position:fixed;right:1.3rem;transform:scale(0);transition:all var(--ifm-transition-fast) var(--ifm-transition-timing-default);visibility:hidden;width:3rem;z-index:calc(var(--ifm-z-index-fixed) - 1)}.backToTopButton_pSAI:after{background-color:var(--ifm-color-emphasis-1000);content:" ";display:inline-block;height:100%;-webkit-mask:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem no-repeat;mask:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem no-repeat;width:100%}.backToTopButtonShow_MEEL{opacity:1;transform:scale(1);visibility:visible}[data-theme=dark]:root{--docusaurus-collapse-button-bg:hsla(0,0%,100%,.05);--docusaurus-collapse-button-bg-hover:hsla(0,0%,100%,.1)}.collapseSidebarButton_Dma2{display:none;margin:0}.docPage_ShNT{flex:1 0}.docsWrapper_B99u{display:flex;flex:1 0 auto}.authorCol_PGqe{flex-grow:1!important;max-width:inherit!important}.imageOnlyAuthorRow_CcAN{display:flex;flex-flow:row wrap}.imageOnlyAuthorCol_7a2K{margin-left:.3rem;margin-right:.3rem}.flyde-flow-editor_AAD4{color:#000;position:absolute}._hj_feedback_container_Af03{--hjFeedbackAccentColor:var(--ifm-color-primary)}.hero{--ifm-hero-text-color:#f8f8f8;overflow:hidden;padding:0;position:relative}.hero .container{display:flex;flex-direction:row;gap:0;padding:2rem}.feature-strip .feature-strip-inner,.features-strip{margin:0 auto;max-width:var(--ifm-container-width-xl);padding:2rem 3rem}.hero .container .content-wrapper{flex:4;padding-right:2rem;padding-top:2rem;text-align:left}.hero .container .content-wrapper .hero__title{font-size:3.5rem;font-weight:600;margin:0}.hero .container .content-wrapper .hero__subtitle{font-size:1.2rem;margin:10px 0}.hero .container .content-wrapper .buttons-container{display:flex;flex-direction:row;gap:.5rem;margin:10px auto}.hero .container .example-container{display:flex;flex:5;flex-direction:column;height:30rem;max-width:800px;min-height:25rem}.hero .container .example-container .example-tip{color:#efefef;display:inline-flex;flex-wrap:wrap;font-size:.8rem;margin:10px 0;text-align:right}.hero .container .example-container .example-actions{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;gap:6px;justify-content:center;margin-top:10px}.hero .container .example-container .example-actions button{font-size:12px;padding:3px 6px}.hero .container .github-star{align-items:center;border:1px solid #efefef;border-radius:50px;color:#efefef;cursor:pointer;display:inline-flex;font-size:.8rem;gap:5px;justify-self:flex-start;margin-bottom:5px;padding:4px 12px}.hero .container .github-star svg{transform:rotate(0);transform-origin:center center;transition:transform .2s ease-in-out;height:18px;width:18px}.hero .container .github-star:hover{background:#efefef;color:#0b2d46}.hero .container .github-star:hover svg{transform:rotate(72deg)}.hero .container .github-star>span{line-height:1}.hero .gradient{-webkit-text-fill-color:transparent;background:linear-gradient(90deg,#ffebe6,#a4deff);-webkit-background-clip:text;font-weight:800}.hero--primary{--ifm-hero-background-color:#182732}.hero-example .actions-menu,.mobile-warning{display:none}.features-strip{align-items:center;display:flex;flex-direction:row;font-size:1.5rem;font-weight:500;gap:4rem;justify-content:center}.features-strip .feature-highlight{align-items:center;display:inline-flex;flex-direction:row}.features-strip .feature-highlight:not(:last-child):after{background:#0d557f;border-radius:50%;content:"";display:inline-block;height:5px;margin-left:4rem;width:5px}.features-strip .feature-highlight a{color:#101010;text-decoration:none}.feature-strip .feature-strip-inner{display:flex;flex-direction:row;gap:3rem}.feature-strip .feature-strip-inner .content-container h3{font-size:2rem;font-weight:600;margin-bottom:20px}.feature-strip .feature-strip-inner .image-caption{color:#1f2937;flex-wrap:wrap;font-size:.8rem;font-style:italic}.font-thin{font-weight:300}.hero-example{border:1px solid #5e5e5e;box-shadow:0 0 0 2px rgba(0,0,0,.1),0 3px 8px rgba(0,0,0,.8);display:flex;flex-direction:column;height:28rem;position:relative;z-index:1}.hero-example>main{flex:1}.hero-example .flow-wrapper{display:flex;flex:1}.hero-example .buttons-container{align-items:center;display:flex;gap:8px;justify-content:center;margin:20px 0;z-index:1}.hero-example .buttons-container .gh-stars-wrapper{display:flex}.hero-example .terminal-emulator{background:#161616;color:#fff;flex:1;font-size:.8rem;padding:3px 8px}.hero-example .flyde-hero-example-wrapper{border:1px solid #d9d9d9;border-radius:5px;box-shadow:-1px 1px 12px 3px hsla(0,0%,49%,.17);display:flex;flex-direction:row;max-width:100%;overflow:hidden}.hero-example .nudge{animation:4s -2s infinite f;transform-origin:center center}@keyframes f{0%,46%,to{background-color:var(--ifm-color-success);transform:translateY(0)}48%{background:var(--ifm-color-success-light);transform:translateY(0) rotate(3deg)}50%{background:var(--ifm-color-success-light);transform:translateY(0) rotate(0)}52%{background:var(--ifm-color-success-light);transform:translateY(0) rotate(-3deg)}54%{background-color:var(--ifm-color-success);transform:translateY(0) rotate(0)}}.hero-example .code-terminal-wrapper{display:flex;flex:0;flex-direction:column;min-width:340px}.hero-example .code-wrapper{display:flex;flex:1;flex-direction:column;text-align:left}.hero-example .code-wrapper>span{border-radius:0!important;flex:1}.hero-example .code-wrapper>span code{background-color:inherit;border:0;border-radius:0;font-family:inherit;font-size:inherit;padding:inherit}.hero-example .terminal-wrapper{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;height:100px;overflow:auto}.hero-example .flyde-flow-editor{flex:1;flex-shrink:0}.hero-example .code-example{flex:1;font-size:14px}.hero-example .viewport-controls-and-help{display:none!important}.hero-example .hero-example__tabs{display:flex;flex-direction:row;flex-grow:0;flex-shrink:0;width:100%}.hero-example .hero-example__tabs .file-tag{flex:1}.hero-example .file-tag{background-color:#383838;border-right:1px solid #4f4f4f;color:#ccc;cursor:pointer;display:block;flex:0;font-size:12px;padding:0 5px;text-align:center;width:100%}.hero-example .file-tag:hover{background-color:#4f4f4f}.hero-example .file-tag.selected{background-color:#4f4f4f;color:#fff}.flyde-flow-editor{color:#000!important;overflow:hidden}.flyde-flow-editor a,.flyde-flow-editor b,.flyde-flow-editor blockquote,.flyde-flow-editor body,.flyde-flow-editor canvas,.flyde-flow-editor caption,.flyde-flow-editor code,.flyde-flow-editor div,.flyde-flow-editor em,.flyde-flow-editor embed,.flyde-flow-editor fieldset,.flyde-flow-editor figure,.flyde-flow-editor footer,.flyde-flow-editor form,.flyde-flow-editor h1,.flyde-flow-editor h2,.flyde-flow-editor h3,.flyde-flow-editor h4,.flyde-flow-editor h5,.flyde-flow-editor h6,.flyde-flow-editor header,.flyde-flow-editor html,.flyde-flow-editor i,.flyde-flow-editor iframe,.flyde-flow-editor img,.flyde-flow-editor label,.flyde-flow-editor li,.flyde-flow-editor main,.flyde-flow-editor nav,.flyde-flow-editor object,.flyde-flow-editor ol,.flyde-flow-editor p,.flyde-flow-editor pre,.flyde-flow-editor section,.flyde-flow-editor small,.flyde-flow-editor span,.flyde-flow-editor strike,.flyde-flow-editor strong,.flyde-flow-editor sub,.flyde-flow-editor sup,.flyde-flow-editor table,.flyde-flow-editor tbody,.flyde-flow-editor td,.flyde-flow-editor tfoot,.flyde-flow-editor th,.flyde-flow-editor thead,.flyde-flow-editor tr,.flyde-flow-editor tt,.flyde-flow-editor u,.flyde-flow-editor ul,.flyde-flow-editor video{-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:none;text-size-adjust:none;border:0;font-size:100%;font:inherit;margin:0;padding:0;text-rendering:optimizeLegibility;vertical-align:baseline}.containsTaskList_WAbI,.flyde-flow-editor ol,.flyde-flow-editor ul{list-style:none}.flyde-flow-editor blockquote,.flyde-flow-editor q{quotes:none}.flyde-flow-editor blockquote:after,.flyde-flow-editor blockquote:before,.flyde-flow-editor q:after,.flyde-flow-editor q:before{content:"";content:none}.flyde-flow-editor table{border-collapse:collapse;border-spacing:0}.flyde-flow-editor input{-webkit-appearance:none;border-radius:0}input.input{background-color:var(--ifm-button-background-color);border:1px solid var(--ifm-color-primary);border-radius:var(--ifm-button-border-radius);color:var(--ifm-color-primary);cursor:pointer;display:inline-block;font-size:calc(.875rem*var(--ifm-button-size-multiplier));font-weight:var(--ifm-button-font-weight);line-height:1.5;padding:calc(var(--ifm-button-padding-vertical)*var(--ifm-button-size-multiplier)) calc(var(--ifm-button-padding-horizontal)*var(--ifm-button-size-multiplier));text-align:center;-webkit-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.react-counter span{font-size:50px;font-weight:600}.integration-points{display:inline-block;text-align:left;width:300px}.hero__subtitle{font-size:1.2rem;margin:0 auto 20px;max-width:80%}.hero__subtitle a{color:#fff;font-weight:700}.bp3-overlay{z-index:201}.examples__menu{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;list-style:none;margin-top:20px}.examples__menu>li{font-size:18px;font-weight:700}.examples__menu>li a{color:#fff}.playground-container{margin:0 auto;max-width:1200px;padding:2rem 0;position:relative}.playground-container .playground-description,.playground-container .playground-extra{font-size:1.25rem;margin-bottom:10px;padding:1rem}.playground-container h2,.playground-hero h1{font-size:2rem}.playground-container .emit-btn{margin:10px 5px}.playground-container>header{margin:0 auto;max-width:var(--ifm-container-width);text-align:center}.playground-container .playground{border:1px solid #ccc;display:flex;flex-direction:row;margin:10px 0;max-height:500px}.playground-container .playground .flow-container{border-right:1px solid #ccc;flex:1;position:relative}.playground-container .playground .flow-container .delay-container{align-content:space-between;align-items:center;background:#fff;border:1px solid #dedede;display:flex;font-size:14px;gap:20px;padding:5px 10px;position:absolute;right:20px;top:0;z-index:1}.playground-container .output-container{display:flex;flex:0 0;position:relative;-webkit-user-select:none;user-select:none}.playground-hero{padding:.5rem 0}.playground-hero .hero__subtitle{font-size:1.25rem;margin-bottom:5px}.mobile-warning{background:#fff3cd;padding:15px 10px;text-align:center}.star-hint{align-items:center;flex-wrap:wrap;font-style:italic;gap:.1rem .5rem}.output-jsx,.output-log{background:#fafafa;display:flex;flex:1;flex-direction:column}.output-jsx header,.output-log header{border-bottom:1px solid #dfdfdf;color:#202020;display:flex;font-size:18px;font-weight:600;margin-bottom:2px;padding:5px 20px}.buttonGroup_bqVd button,.codeBlockContainer_Qk81{background:var(--prism-background-color);color:var(--prism-color)}.output-jsx header .clear-btn,.output-log header .clear-btn{margin-left:auto}.output-jsx>main,.output-log>main{overflow:auto}.output-jsx .empty-state,.output-log .empty-state{color:#9e9e9e;font-size:16px;font-weight:300;padding:10px 20px}.output-jsx .log-item,.output-log .log-item{align-items:center;display:flex;padding:3px 20px}.output-jsx .log-item:hover,.output-log .log-item:hover{background-color:#efefef}.output-jsx .log-item>main,.output-log .log-item>main{-webkit-box-orient:vertical;-webkit-line-clamp:3;display:-webkit-box;flex:1;margin-right:5px;overflow:hidden}.output-jsx .log-item>aside,.output-log .log-item>aside{color:#9e9e9e;font-size:12px;font-weight:600}.output-jsx>main{align-items:center;display:flex;flex-direction:row;justify-content:center;padding:20px}.output-jsx>main span{display:inline-block;font-size:40px;margin:0 20px;min-width:50px;text-align:center}.codeBlockContainer_Qk81{border-radius:var(--ifm-code-border-radius);box-shadow:var(--ifm-global-shadow-lw);margin-bottom:var(--ifm-leading)}.codeBlockContent_vYKs{border-radius:inherit;direction:ltr;position:relative}.codeBlockTitle_mI_w{border-bottom:1px solid var(--ifm-color-emphasis-300);border-top-left-radius:inherit;border-top-right-radius:inherit;font-size:var(--ifm-code-font-size);font-weight:500;padding:.75rem var(--ifm-pre-padding)}.codeBlock_jioO{--ifm-pre-background:var(--prism-background-color);margin:0;padding:0}.codeBlockTitle_mI_w+.codeBlockContent_vYKs .codeBlock_jioO{border-top-left-radius:0;border-top-right-radius:0}.codeBlockLines_UkX9{float:left;font:inherit;min-width:100%;padding:var(--ifm-pre-padding)}.codeBlockLinesWithNumbering_IjB6{display:table;padding:var(--ifm-pre-padding) 0}.buttonGroup_bqVd{column-gap:.2rem;display:flex;position:absolute;right:calc(var(--ifm-pre-padding)/2);top:calc(var(--ifm-pre-padding)/2)}.buttonGroup_bqVd button{align-items:center;border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-global-radius);display:flex;line-height:0;opacity:0;padding:.4rem;transition:opacity var(--ifm-transition-fast) ease-in-out}.buttonGroup_bqVd button:focus-visible,.buttonGroup_bqVd button:hover{opacity:1!important}.theme-code-block:hover .buttonGroup_bqVd button{opacity:.4}.iconEdit__QoF{margin-right:.3em;vertical-align:sub}:where(:root){--docusaurus-highlighted-code-line-bg:#484d5b}:where([data-theme=dark]){--docusaurus-highlighted-code-line-bg:#646464}.theme-code-block-highlighted-line{background-color:var(--docusaurus-highlighted-code-line-bg);display:block;margin:0 calc(var(--ifm-pre-padding)*-1);padding:0 var(--ifm-pre-padding)}.codeLine_VTf7{counter-increment:a;display:table-row}.codeLineNumber_VYTV{background:var(--ifm-pre-background);display:table-cell;left:0;overflow-wrap:normal;padding:0 var(--ifm-pre-padding);position:sticky;text-align:right;width:1%}.codeLineNumber_VYTV:before{content:counter(a);opacity:.4}.codeLineContent_B5jd{padding-right:var(--ifm-pre-padding)}.tag_tu_C{border:1px solid var(--docusaurus-tag-list-border);transition:border var(--ifm-transition-fast)}.tag_tu_C:hover{--docusaurus-tag-list-border:var(--ifm-link-color);text-decoration:none}.tagRegular_GinR{border-radius:var(--ifm-global-radius);font-size:90%;padding:.2rem .5rem .3rem}.tagWithCount_HiRh{align-items:center;border-left:0;display:flex;padding:0 .5rem 0 1rem;position:relative}.tag_Jiem,.tag_uUOe{display:inline-block}.tagWithCount_HiRh:after,.tagWithCount_HiRh:before{border:1px solid var(--docusaurus-tag-list-border);content:"";position:absolute;top:50%;transition:inherit}.tagWithCount_HiRh:before{border-bottom:0;border-right:0;height:1.18rem;right:100%;transform:translate(50%,-50%) rotate(-45deg);width:1.18rem}.tagWithCount_HiRh:after{border-radius:50%;height:.5rem;left:0;transform:translateY(-50%);width:.5rem}.tagWithCount_HiRh span{background:var(--ifm-color-secondary);border-radius:var(--ifm-global-radius);color:var(--ifm-color-black);font-size:.7rem;line-height:1.2;margin-left:.3rem;padding:.1rem .4rem}.tag_Jiem{margin:.5rem .5rem 0 1rem}.theme-code-block:hover .copyButtonCopied_fVO4{opacity:1!important}.copyButtonIcons_yZMg{height:1.125rem;position:relative;width:1.125rem}.copyButtonIcon_demY,.copyButtonSuccessIcon_h29Q{fill:currentColor;height:inherit;left:0;opacity:inherit;position:absolute;top:0;transition:all var(--ifm-transition-fast) ease;width:inherit}.copyButtonSuccessIcon_h29Q{color:#00d600;left:50%;opacity:0;top:50%;transform:translate(-50%,-50%) scale(.33)}.copyButtonCopied_fVO4 .copyButtonIcon_demY{opacity:0;transform:scale(.33)}.copyButtonCopied_fVO4 .copyButtonSuccessIcon_h29Q{opacity:1;transform:translate(-50%,-50%) scale(1);transition-delay:75ms}.tag_uUOe{margin:0 .4rem .5rem 0}.lastUpdated_Bn0j{font-size:smaller;font-style:italic;margin-top:.2rem}.tocCollapsibleButton_okIV{align-items:center;display:flex;font-size:inherit;justify-content:space-between;padding:.4rem .8rem;width:100%}.tocCollapsibleButton_okIV:after{background:var(--ifm-menu-link-sublist-icon) 50% 50%/2rem 2rem no-repeat;content:"";filter:var(--ifm-menu-link-sublist-icon-filter);height:1.25rem;transform:rotate(180deg);transition:transform var(--ifm-transition-fast);width:1.25rem}.tocCollapsibleButtonExpanded_SUqg:after,.tocCollapsibleExpanded_gaPT{transform:none}.tocCollapsible_W5RM{background-color:var(--ifm-menu-color-background-active);border-radius:var(--ifm-global-radius);margin:1rem 0}.tocCollapsibleContent_KxYB>ul{border-left:none;border-top:1px solid var(--ifm-color-emphasis-300);font-size:15px;padding:.2rem 0}.tocCollapsibleContent_KxYB ul li{margin:.4rem .8rem}.wordWrapButtonIcon_Xcrc{height:1.2rem;width:1.2rem}.details_jMJo{--docusaurus-details-summary-arrow-size:0.38rem;--docusaurus-details-transition:transform 200ms ease;--docusaurus-details-decoration-color:grey}.details_jMJo>summary{cursor:pointer;list-style:none;padding-left:1rem;position:relative}.details_jMJo>summary::-webkit-details-marker{display:none}.details_jMJo>summary:before{border-color:transparent transparent transparent var(--docusaurus-details-decoration-color);border-style:solid;border-width:var(--docusaurus-details-summary-arrow-size);content:"";left:0;position:absolute;top:.45rem;transform:rotate(0);transform-origin:calc(var(--docusaurus-details-summary-arrow-size)/2) 50%;transition:var(--docusaurus-details-transition)}.collapsibleContent_yVEW{border-top:1px solid var(--docusaurus-details-decoration-color);margin-top:1rem;padding-top:1rem}.details_qBk2{--docusaurus-details-decoration-color:var(--ifm-alert-border-color);--docusaurus-details-transition:transform var(--ifm-transition-fast) ease;border:1px solid var(--ifm-alert-border-color);margin:0 0 var(--ifm-spacing-vertical)}.anchorWithStickyNavbar_BHx1{scroll-margin-top:calc(var(--ifm-navbar-height) + .5rem)}.anchorWithHideOnScrollNavbar_drPl{scroll-margin-top:.5rem}.hash-link{opacity:0;padding-left:.5rem;transition:opacity var(--ifm-transition-fast);-webkit-user-select:none;user-select:none}.hash-link:before{content:"#"}.img_HiZU{height:auto}.admonition_FWSL{margin-bottom:1em}.admonitionHeading_xHAi{font:var(--ifm-heading-font-weight) var(--ifm-h5-font-size)/var(--ifm-heading-line-height) var(--ifm-heading-font-family);margin-bottom:.3rem;text-transform:uppercase}.admonitionIcon_Pe6H{display:inline-block;margin-right:.4em;vertical-align:middle}.admonitionIcon_Pe6H svg{fill:var(--ifm-alert-foreground-color);display:inline-block;height:1.6em;width:1.6em}.tableOfContents_FRrT{overflow-y:auto;position:sticky;top:calc(var(--ifm-navbar-height) + 1rem)}.breadcrumbHomeIcon_CVBs{height:1.1rem;position:relative;top:1px;vertical-align:top;width:1.1rem}.breadcrumbsContainer_SHjg{--ifm-breadcrumb-size-multiplier:0.8;margin-bottom:.8rem}.mdxPageWrapper_lX39{justify-content:center}@media (min-width:997px){.collapseSidebarButton_Dma2,.expandButton_nIzW{background-color:var(--docusaurus-collapse-button-bg)}:root{--docusaurus-announcement-bar-height:30px}.announcementBarClose_MFWf,.announcementBarPlaceholder_Pb6Q{flex-basis:50px}.searchBox_qRf7{padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.collapseSidebarButton_Dma2{border:1px solid var(--ifm-toc-border-color);border-radius:0;bottom:0;display:block!important;height:40px;position:sticky}.collapseSidebarButtonIcon_JH0A{margin-top:4px;transform:rotate(180deg)}.expandButtonIcon_jX6N,[dir=rtl] .collapseSidebarButtonIcon_JH0A{transform:rotate(0)}.collapseSidebarButton_Dma2:focus,.collapseSidebarButton_Dma2:hover,.expandButton_nIzW:focus,.expandButton_nIzW:hover{background-color:var(--docusaurus-collapse-button-bg-hover)}.menuHtmlItem_IXyI{padding:var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal)}.menu_HbpM{flex-grow:1;padding:.5rem}@supports (scrollbar-gutter:stable){.menu_HbpM{padding:.5rem 0 .5rem .5rem;scrollbar-gutter:stable}}.menuWithAnnouncementBar_Xvae{margin-bottom:var(--docusaurus-announcement-bar-height)}.sidebar_x9W1{display:flex;flex-direction:column;height:100%;padding-top:var(--ifm-navbar-height);width:var(--doc-sidebar-width)}.sidebarWithHideableNavbar_Ltvs{padding-top:0}.sidebarHidden_vtNZ{opacity:0;visibility:hidden}.sidebarLogo_qeYn{align-items:center;color:inherit!important;display:flex!important;margin:0 var(--ifm-navbar-padding-horizontal);max-height:var(--ifm-navbar-height);min-height:var(--ifm-navbar-height);text-decoration:none!important}.sidebarLogo_qeYn img{height:2rem;margin-right:.5rem}.expandButton_nIzW{align-items:center;display:flex;height:100%;justify-content:center;position:absolute;right:0;top:0;transition:background-color var(--ifm-transition-fast) ease;width:100%}[dir=rtl] .expandButtonIcon_jX6N{transform:rotate(180deg)}.docSidebarContainer_ac1n{border-right:1px solid var(--ifm-toc-border-color);-webkit-clip-path:inset(0);clip-path:inset(0);display:block;margin-top:calc(var(--ifm-navbar-height)*-1);transition:width var(--ifm-transition-fast) ease;width:var(--doc-sidebar-width);will-change:width}.docSidebarContainerHidden_p2RU{cursor:pointer;width:var(--doc-sidebar-hidden-width)}.sidebarViewport_E9NN{height:100%;max-height:100vh;position:sticky;top:0}.docMainContainer_L3kR{flex-grow:1;max-width:calc(100% - var(--doc-sidebar-width))}.docMainContainerEnhanced_UwZt{max-width:calc(100% - var(--doc-sidebar-hidden-width))}.docItemWrapperEnhanced_CFce{max-width:calc(var(--ifm-container-width) + var(--doc-sidebar-width))!important}.lastUpdated_Bn0j{text-align:right}.tocMobile_pObj{display:none}.docItemCol_geY3{max-width:75%!important}}@media (min-width:1440px){.container{max-width:var(--ifm-container-width-xl)}}@media only screen and (max-width:1440px){.hero .container{padding:2rem 1rem}.features-strip{gap:2rem}.features-strip .feature-highlight:after{margin-left:2rem!important}}@media only screen and (max-width:1140px){.hero .container{flex-direction:column;gap:20px;max-width:800px}.hero .container .example-container{min-height:45rem}.features-strip{font-size:1.2rem}.feature-strip .feature-strip-inner{flex-direction:column-reverse!important}}@media (max-width:996px){.col{--ifm-col-width:100%;flex-basis:var(--ifm-col-width);margin-left:0}.footer{--ifm-footer-padding-horizontal:0}.colorModeToggle_BLUn,.footer__link-separator,.navbar__item,.sidebar_U0ns,.tableOfContents_FRrT{display:none}.footer__col{margin-bottom:calc(var(--ifm-spacing-vertical)*3)}.footer__link-item{display:block}.hero{padding-left:0;padding-right:0}.navbar>.container,.navbar>.container-fluid{padding:0}.navbar__toggle{display:inherit}.navbar__search-input{width:9rem}.pills--block,.tabs--block{flex-direction:column}.searchBox_qRf7{position:absolute;right:var(--ifm-navbar-padding-horizontal)}.docItemContainer_xriO{padding:0 .3rem}}@media only screen and (max-width:600px){.features-strip{flex-direction:column;font-size:1.2rem;gap:.8rem;padding:1rem .25rem}.features-strip .feature-highlight{flex-direction:column!important;justify-content:center}.features-strip .feature-highlight:after{height:3px!important;margin-left:0!important;margin-top:.8rem!important;width:3px!important}.hero .container{padding-left:1.5rem;padding-top:1rem}.hero .container .content-wrapper{padding-right:0}.hero .container .content-wrapper .hero__title{font-size:2.75rem}.hero .container .example-container{min-height:35rem}.home-page-main-content{padding-top:120px}.hero__title{font-size:2rem}.hero__subtitle{font-size:1.2rem}.mobile-warning{display:block}}@media (max-width:576px){.markdown h1:first-child{--ifm-h1-font-size:2rem}.markdown>h2{--ifm-h2-font-size:1.5rem}.markdown>h3{--ifm-h3-font-size:1.25rem}.title_PlBF{font-size:2rem}}@media (forced-colors:active) and (prefers-color-scheme:dark){.bp5-button.bp5-intent-danger,.bp5-button.bp5-intent-primary,.bp5-button.bp5-intent-success,.bp5-button.bp5-intent-warning,.bp5-code-block,.bp5-dark .bp5-tooltip .bp5-code-block,.bp5-dark .bp5-tooltip .bp5-running-text pre,.bp5-running-text pre,.bp5-tooltip.bp5-dark .bp5-code-block,.bp5-tooltip.bp5-dark .bp5-running-text pre{border:1px solid buttonborder;box-shadow:none}.bp5-button.bp5-intent-warning:not(.bp5-disabled):not(.bp5-minimal):not(.bp5-outlined).bp5-active,.bp5-button.bp5-intent-warning:not(.bp5-disabled):not(.bp5-minimal):not(.bp5-outlined):active,.bp5-button:not([class*=bp5-intent-]).bp5-active,.bp5-button:not([class*=bp5-intent-]):active,.bp5-control.bp5-switch:hover input:checked~.bp5-control-indicator,.bp5-dark .bp5-control.bp5-switch:hover input:checked~.bp5-control-indicator,.bp5-file-upload-input:active:after,.bp5-html-select select.bp5-active,.bp5-html-select select:active,.bp5-select select.bp5-active,.bp5-select select:active,.bp5-slider-handle.bp5-active,.bp5-slider-handle:active{background:highlight}.bp5-button:not([class*=bp5-intent-]),.bp5-callout,.bp5-callout.bp5-intent-danger,.bp5-callout.bp5-intent-primary,.bp5-callout.bp5-intent-success,.bp5-callout.bp5-intent-warning,.bp5-card,.bp5-control .bp5-control-indicator,.bp5-dark .bp5-control input:checked~.bp5-control-indicator,.bp5-dialog,.bp5-editable-text:not(.bp5-disabled):before,.bp5-elevation-0,.bp5-elevation-1,.bp5-elevation-2,.bp5-elevation-3,.bp5-elevation-4{border:1px solid buttonborder}.bp5-button.bp5-intent-danger.bp5-disabled,.bp5-button.bp5-intent-danger:disabled,.bp5-button.bp5-intent-primary.bp5-disabled,.bp5-button.bp5-intent-primary:disabled,.bp5-button.bp5-intent-success.bp5-disabled,.bp5-button.bp5-intent-success:disabled,.bp5-button.bp5-intent-warning.bp5-disabled,.bp5-button.bp5-intent-warning:disabled{border-color:graytext;color:graytext}.bp5-button-group.bp5-minimal:not(:first-child){border-bottom-left-radius:0;border-left:none;border-top-left-radius:0}.bp5-button-group.bp5-minimal:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0;margin-right:-1px}.bp5-card,.bp5-popover{box-shadow:none}.bp5-dialog-header,.bp5-drawer-header,.bp5-drawer.bp5-position-top{border-bottom:1px solid buttonborder}.bp5-drawer.bp5-position-bottom,table.bp5-html-table.bp5-html-table-bordered tbody tr td,table.bp5-html-table.bp5-html-table-bordered tfoot tr td{border-top:1px solid buttonborder}.bp5-drawer.bp5-position-left{border-right:1px solid buttonborder}.bp5-drawer.bp5-position-right,table.bp5-html-table.bp5-html-table-bordered th:not(:first-child){border-left:1px solid buttonborder}.bp5-control input:checked~.bp5-control-indicator{background-color:highlight;border:1px solid highlight}.bp5-control:hover input:checked~.bp5-control-indicator{background-color:highlight}.bp5-control input:disabled:checked~.bp5-control-indicator{background-color:graytext;border-color:graytext}.bp5-control .bp5-control-indicator:before{margin-left:-1px;margin-top:-1px}.bp5-control.bp5-checkbox input:indeterminate~.bp5-control-indicator{background-color:highlight;border:1px solid highlight}.bp5-control.bp5-checkbox:hover input:indeterminate~.bp5-control-indicator{background-color:highlight}.bp5-control.bp5-checkbox input:disabled:indeterminate~.bp5-control-indicator{background-color:graytext;border-color:graytext}.bp5-dark .bp5-control.bp5-checkbox input:indeterminate~.bp5-control-indicator{border:1px solid buttonborder}.bp5-control.bp5-checkbox input:checked:not(:disabled)~.bp5-control-indicator:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 5c-.28 0-.53.11-.71.29L7 9.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42l3 3c.18.18.43.29.71.29s.53-.11.71-.29l5-5A1.003 1.003 0 0 0 12 5z' fill='%23111418'/%3E%3C/svg%3E")}.bp5-control.bp5-checkbox input:indeterminate:not(:disabled)~.bp5-control-indicator:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11 7H5c-.55 0-1 .45-1 1s.45 1 1 1h6c.55 0 1-.45 1-1s-.45-1-1-1z' fill='%23111418'/%3E%3C/svg%3E")}.bp5-control.bp5-checkbox input:disabled~.bp5-control-indicator,.bp5-control.bp5-radio input:disabled~.bp5-control-indicator,.bp5-control.bp5-switch input:not(:checked):disabled~.bp5-control-indicator,.bp5-control.bp5-switch input:not(:checked):disabled~.bp5-control-indicator:before,.bp5-dark .bp5-control.bp5-switch input:not(:checked):disabled~.bp5-control-indicator,.bp5-dark .bp5-control.bp5-switch input:not(:checked):disabled~.bp5-control-indicator:before{border-color:graytext}.bp5-control.bp5-radio input:checked~.bp5-control-indicator:before{background:highlight;height:12px;margin-left:1px;margin-top:1px;width:12px}.bp5-control.bp5-radio input:checked:disabled~.bp5-control-indicator:before{background:graytext}.bp5-control.bp5-switch input:checked~.bp5-control-indicator,.bp5-dark .bp5-control.bp5-switch input:checked~.bp5-control-indicator{background:highlight;border:1px solid buttonborder}.bp5-control.bp5-switch input:checked:disabled~.bp5-control-indicator,.bp5-dark .bp5-control.bp5-switch input:checked:disabled~.bp5-control-indicator{background-color:graytext}.bp5-control.bp5-switch .bp5-control-indicator:before{border:1px solid buttonborder;margin-top:1px}.bp5-control.bp5-switch .bp5-control-indicator,.bp5-dark .bp5-popover,.bp5-dark .bp5-tooltip,.bp5-file-upload-input,.bp5-html-select select,.bp5-input,.bp5-navbar,.bp5-popover,.bp5-popover.bp5-dark,.bp5-select select,.bp5-slider-handle,.bp5-tag,.bp5-tooltip,.bp5-tooltip.bp5-dark{border:1px solid buttonborder}table.bp5-html-table.bp5-html-table-bordered tbody tr td:not(:first-child),table.bp5-html-table.bp5-html-table-bordered tfoot tr td:not(:first-child){border-left:1px solid buttonborder;border-top:1px solid buttonborder}.bp5-dark .bp5-menu-item.bp5-selected,.bp5-dark .bp5-menu-item.bp5-selected:active,.bp5-dark .bp5-menu-item.bp5-selected:hover,.bp5-dark .bp5-menu-item:hover.ns-selected,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-],.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active,.bp5-dark .bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover,.bp5-menu-item.bp5-selected,.bp5-menu-item.bp5-selected:active,.bp5-menu-item.bp5-selected:hover,.bp5-menu-item:hover.ns-selected,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item:not([class*=bp5-intent-]).ns-selected,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-],.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:active,.bp5-submenu .bp5-popover-target.bp5-popover-open>.bp5-menu-item[class*=bp5-intent-]:hover,table.bp5-html-table.bp5-interactive tbody tr:active td,table.bp5-html-table.bp5-interactive tbody tr:hover td{background-color:highlight}.bp5-dark .bp5-popover .bp5-popover-arrow-fill,.bp5-dark .bp5-tooltip .bp5-popover-arrow-fill,.bp5-popover .bp5-popover-arrow-fill,.bp5-popover.bp5-dark .bp5-popover-arrow-fill,.bp5-tooltip .bp5-popover-arrow-fill,.bp5-tooltip.bp5-dark .bp5-popover-arrow-fill,.bp5-tooltip.bp5-intent-danger .bp5-popover-arrow-fill,.bp5-tooltip.bp5-intent-primary .bp5-popover-arrow-fill,.bp5-tooltip.bp5-intent-success .bp5-popover-arrow-fill,.bp5-tooltip.bp5-intent-warning .bp5-popover-arrow-fill{fill:buttonborder}.bp5-slider-progress{background:ButtonText}.bp5-tabs.bp5-vertical>.bp5-tab-list .bp5-tab[aria-selected=true]{background-color:highlight;color:#111418}.bp5-dark .bp5-tab[aria-disabled=true],.bp5-tab[aria-disabled=true]{color:graytext}.bp5-dark .bp5-tab:not([aria-disabled=true]):hover,.bp5-dark .bp5-tab[aria-selected=true],.bp5-tab:not([aria-disabled=true]):hover,.bp5-tab[aria-selected=true]{color:highlight}.bp5-dark .bp5-tab-indicator,.bp5-tab-indicator-wrapper .bp5-tab-indicator{background-color:highlight}}@media (hover:hover){.backToTopButton_pSAI:hover{background-color:var(--ifm-color-emphasis-300)}}@media (pointer:fine){.thin-scrollbar{scrollbar-width:thin}.thin-scrollbar::-webkit-scrollbar{height:var(--ifm-scrollbar-size);width:var(--ifm-scrollbar-size)}.thin-scrollbar::-webkit-scrollbar-track{background:var(--ifm-scrollbar-track-background-color);border-radius:10px}.thin-scrollbar::-webkit-scrollbar-thumb{background:var(--ifm-scrollbar-thumb-background-color);border-radius:10px}.thin-scrollbar::-webkit-scrollbar-thumb:hover{background:var(--ifm-scrollbar-thumb-hover-background-color)}}@media (prefers-reduced-motion:reduce){:root{--ifm-transition-fast:0ms;--ifm-transition-slow:0ms}}@media print{.announcementBar_pUh_,.footer,.menu,.navbar,.pagination-nav,.table-of-contents,.tocMobile_pObj{display:none}.tabs{page-break-inside:avoid}.codeBlockLines_UkX9{white-space:pre-wrap}} \ No newline at end of file diff --git a/assets/js/0f8300a0.368f7932.js b/assets/js/0f8300a0.40bf21f8.js similarity index 65% rename from assets/js/0f8300a0.368f7932.js rename to assets/js/0f8300a0.40bf21f8.js index 788d9fdfc..b35e03a7e 100644 --- a/assets/js/0f8300a0.368f7932.js +++ b/assets/js/0f8300a0.40bf21f8.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5884],{19121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cappedArrayDebounce=void 0;t.cappedArrayDebounce=function(e,t,n,o){void 0===o&&(o=500);let i=[],s=null,r=null;return{addItem:a=>{clearTimeout(s),i.push(a),r||(r=setTimeout((()=>{e(i),clearTimeout(s),r=null}),o)),i.length>=n?(e(i),clearTimeout(r),r=null,i=[]):s=setTimeout((()=>{e(i),clearTimeout(r),r=null,i=[]}),t)},flush:()=>{i.length&&(e(i),i=[],clearTimeout(r))},pendingItems:()=>i.length}}},59792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.dataShaper=t.DataShapeType=void 0,function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.ARRAY=3]="ARRAY",e[e.OBJECT=4]="OBJECT",e[e.NULL=5]="NULL",e[e.UNSUPPORTED=6]="UNSUPPORTED"}(n=t.DataShapeType||(t.DataShapeType={}));const o={string:n.STRING,number:n.NUMBER,boolean:n.BOOLEAN,object:n.OBJECT,array:n.ARRAY,null:n.NULL,symbol:n.UNSUPPORTED,undefined:n.UNSUPPORTED,function:n.UNSUPPORTED,bigint:n.UNSUPPORTED};t.dataShaper=function(e,n,i){void 0===n&&(n=5),void 0===i&&(i=5);const s=null===(r=e)?"null":typeof r;var r,a;if("object"===s){if(Array.isArray(e))return n>1?e.filter(((e,t)=>t(0,t.dataShaper)(e,n-1,i))):o.array;if(n>1){const o={};for(const s in e)o[s]=(0,t.dataShaper)(e[s],n-1,i);return a=o,Object.keys(a).sort().reduce(((e,t)=>(e[t]=a[t],e)),{})}return o.object}return o[s]}},23046:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.debugLogger=void 0;const i=(0,o(n(55899)).default)("flyde");t.debugLogger=e=>i.extend(e)},24331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullInsIdPath=void 0,t.fullInsIdPath=function(e,t){if(!e)throw new Error("insId is not defined");return t?`${t}.${e}`:e}},34459:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hashFlow=t.hashNode=void 0;const i=o(n(68805)),s=n(30292),r=e=>(0,i.default)(e);t.hashNode=function(e,t){var n;void 0===t&&(t=!0);const{id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l}=e,c={id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l};if((0,s.isVisualNode)(e)){const{instances:n,connections:o,inputsPosition:i,outputsPosition:s}=e,a=n.map((e=>{const{pos:t,...n}=e;return n})),u=t?{}:{inputsPosition:i,outputsPosition:s},l=t?a:n;l.sort(((e,t)=>e.id.localeCompare(t.id)));const d=[...o];d.sort(((e,t)=>{const n=`${e.from.insId}.${e.from.pinId}`,o=`${t.from.insId}.${t.from.pinId}`;return n.localeCompare(o)}));const p=JSON.stringify({instancesToUse:l,conns:d,...c,maybeIoPos:u});return r(p)}if((0,s.isInlineValueNode)(e)){const{customViewCode:t}=e,o=null!==(n=e.fnCode)&&void 0!==n?n:e.runFnRawCode,i=JSON.stringify({fnCode:o,customViewCode:t,...c});return r(i)}throw new Error("Hashing code nodes unsupported")};t.hashFlow=e=>{const{node:n,imports:o}=e,i=(0,t.hashNode)(n,!1),s=Object.entries(null!=o?o:{}).sort(((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)})).map((e=>{let[t,n]=e;return[t,n.sort()]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{}),a=JSON.stringify(s);return r(i+a)}},86873:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DepGraph=void 0,i(n(3172),t),i(n(59962),t),i(n(23046),t),i(n(19121),t),i(n(59962),t),i(n(34459),t),i(n(39043),t),i(n(59792),t),i(n(24331),t),t.DepGraph=n(60359).DepGraph},3172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testDataCreator=void 0;t.testDataCreator=e=>function(t){void 0===t&&(t={});return{..."function"==typeof e?e():e,...t}}},59962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplePluralize=t.eventually=t.delay=t.noop=t.removeDupes=t.ensure=t.isOptionalType=t.callFnOrFnPromise=t.isPromise=t.isDefined=t.containsAll=t.shuffle=t.randomInts=t.repeat=t.pickRandom=t.randomPos=t.randomInt=t.pickSecond=t.pickFirst=t.fromEntries=t.entries=t.okeys=t.values=t.keys=t.filterOMap=t.mapOMap=t.middlePos=t.calcCenter=t.intersectRect=void 0;t.intersectRect=(e,t)=>{const n=e.x+e.w,o=t.x+t.w;return!(t.x>n||oe.y+e.h||t.y+t.h{let{w:t,h:n,x:o,y:i}=e;return{x:o+t/2,y:i+n/2}};t.middlePos=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});t.mapOMap=(e,n)=>(0,t.entries)(e).map((e=>{let[t,o]=e;return[t,n(t,o)]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.filterOMap=(e,n)=>(0,t.entries)(e).filter((e=>{let[t,o]=e;return n(t,o)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.keys=e=>Object.keys(e);t.values=e=>Object.values(e),t.okeys=t.keys;t.entries=e=>(0,t.okeys)(e).map((t=>[t,e[t]]));t.fromEntries=e=>e.reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.pickFirst=e=>e[0];t.pickSecond=e=>e[1];t.randomInt=function(e,t){void 0===t&&(t=0);const n=Math.random();return t+Math.floor((e-t)*n)};t.randomPos=function(e,n){void 0===e&&(e=1e3),void 0===n&&(n=0);return{x:(0,t.randomInt)(e,n),y:(0,t.randomInt)(e,n)}};t.pickRandom=e=>e[(0,t.randomInt)(e.length)];t.repeat=(e,t)=>"x".repeat(e).split("").map(((e,n)=>t(n)));t.randomInts=function(e,n,o){return void 0===n&&(n=100),void 0===o&&(o=0),(0,t.repeat)(e,(()=>(0,t.randomInt)(n,o)))};t.shuffle=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t};t.containsAll=(e,t)=>t.every((t=>e.includes(t)));t.isDefined=e=>void 0!==e;t.isPromise=e=>e&&"function"==typeof e.then;t.callFnOrFnPromise=(e,n)=>{if(!(0,t.isDefined)(e))return;const o=e=>{try{e()}catch(t){console.error(n,t)}};"function"==typeof e?o(e):Promise.resolve(e).then((e=>{"function"==typeof e&&o(e)}))};t.isOptionalType=e=>/\?$/.test(e);t.ensure=(e,t)=>{if(void 0===e)throw new Error(t||"Undefined value passed");return e};t.removeDupes=e=>Array.from(new Set(e));t.noop=()=>{};t.delay=e=>new Promise((t=>setTimeout(t,e)));t.eventually=async function(e,n,o,i){if(void 0===n&&(n=1e3),void 0===o&&(o=100),void 0===i&&(i=new Set),n<0){const e=Array.from(i).reduce(((e,t,n)=>`${e}\n\t\t${n+1}. ${t}`),"");throw new Error(`[Eventually timeout exceeded after: timeout with error]: ${e}`)}try{await e()}catch(s){const r=Date.now();await(0,t.delay)(o);const a=Date.now()-r;return i.add(null==s?void 0:s.message),(0,t.eventually)(e,n-a,o,i)}},t.simplePluralize=function(e,t){return`${e} ${t}${1!==e?"s":""}`}},39043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileObjectTemplate=t.compileStringTemplate=void 0;t.compileStringTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=new RegExp("\\$\\{"+e+"\\}","g");n=n.replace(i,o)})),n};t.compileObjectTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=JSON.stringify(o),s=new RegExp('"\\$\\$\\{'+e+'\\}"',"g"),r=new RegExp("\\$\\{"+e+"\\}","g"),a="string"==typeof o?o.replace(/"/g,((e,t,n)=>"\\"!==n[t-1]?'\\"':n[t])):o;n=n.replace(s,i).replace(r,a).replace(/\n/g,"\\n")})),JSON.parse(n)}},69150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connection=t.connectionData=t.connectionDataEquals=t.connectionNodeEquals=t.connectionNode=t.externalConnectionNode=t.isInternalConnection=t.isExternalConnection=t.isInternalConnectionNode=t.isExternalConnectionNode=t.getNodeOutputs=t.getOutputName=t.getInputName=t.getNodeInputs=t.TRIGGER_PIN_ID=t.ERROR_PIN_ID=t.THIS_INS_ID=void 0;const o=n(30292);t.THIS_INS_ID="__this",t.ERROR_PIN_ID="__error",t.TRIGGER_PIN_ID="__trigger";t.getNodeInputs=e=>({...e.inputs,[t.TRIGGER_PIN_ID]:(0,o.nodeInput)()});t.getInputName=e=>e===t.TRIGGER_PIN_ID?"Trigger Node":e;t.getOutputName=e=>e===t.ERROR_PIN_ID?"Error":e;t.getNodeOutputs=e=>({...e.outputs,[t.ERROR_PIN_ID]:(0,o.nodeOutput)()});t.isExternalConnectionNode=e=>e&&e.insId===t.THIS_INS_ID;t.isInternalConnectionNode=e=>e.insId!==t.THIS_INS_ID;t.isExternalConnection=e=>{let{from:n,to:o}=e;return(0,t.isExternalConnectionNode)(n)||(0,t.isExternalConnectionNode)(o)};t.isInternalConnection=e=>!(0,t.isExternalConnection)(e);t.externalConnectionNode=e=>({insId:t.THIS_INS_ID,pinId:e});t.connectionNode=(e,t)=>({insId:e,pinId:t});t.connectionNodeEquals=(e,t)=>e.insId===t.insId&&e.pinId===t.pinId;t.connectionDataEquals=(e,n)=>!(!e||!n)&&((0,t.connectionNodeEquals)(e.from,n.from)&&(0,t.connectionNodeEquals)(e.to,n.to)),t.connectionData=function(e,n,o){const i="string"==typeof e?e.split("."):e,s="string"==typeof n?n.split("."):n;if(i.length>2||s.length>2)throw new Error(`invalid source or target to connection data - ${e} / ${n}`);return{from:2===i.length?(0,t.connectionNode)(i[0],i[1]):(0,t.externalConnectionNode)(i[0]),to:2===s.length?(0,t.connectionNode)(s[0],s[1]):(0,t.externalConnectionNode)(s[0]),delayed:o}};t.connection=function(e,t,n){return void 0===n&&(n=!1),{from:e,to:t,delayed:n}}},6775:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;const s=n(30292),r=n(47025),a=n(86873),u=n(69150);i(n(69150),t);t.connect=function(e,t,n,o,i,l,c,d){void 0===n&&(n={}),void 0===i&&(i={}),void 0===l&&(l=a.noop),void 0===c&&(c={}),void 0===d&&(d={});const{id:p,connections:f,instances:m}=e,v=p||"connected-node"+(0,a.randomInt)(999);return{inputs:e.inputs,outputs:e.outputs,id:v,completionOutputs:e.completionOutputs,reactiveInputs:e.reactiveInputs,run:(p,h)=>{let g=[];const I=new a.DepGraph({}),y=new Map,b=new Map,C=new Map,_=new Map,x=new Map,N=new Map;let w;const j=new Set;m.forEach((e=>{const n=(0,s.getNode)(e,t),o=e.id;y.set(e,o),b.set(o,e),I.addNode(o);const i=Object.keys(n.inputs),r=Object.keys(n.outputs),a={},l={};i.forEach((t=>{const n=(e.inputConfig||{})[t]||(0,s.queueInputPinConfig)();(0,s.isStaticInputPinConfig)(n)?a[t]=(0,s.staticNodeInput)(n.value):a[t]=(0,s.dynamicNodeInput)({config:n})})),a[u.TRIGGER_PIN_ID]=(0,s.dynamicNodeInput)({config:(0,s.queueInputPinConfig)()});if(f.some((t=>(0,u.isInternalConnectionNode)(t.to)&&t.to.insId===e.id&&t.to.pinId===u.TRIGGER_PIN_ID))&&e.inputConfig&&e.inputConfig[u.TRIGGER_PIN_ID])throw"Trigger connection can not be configured";r.forEach((e=>{const t=(0,s.dynamicOutput)();l[e]=t}));f.some((t=>(0,u.isInternalConnectionNode)(t.from)&&t.from.insId===e.id&&t.from.pinId===u.ERROR_PIN_ID))&&(l[u.ERROR_PIN_ID]=(0,s.dynamicOutput)()),C.set(o,a),_.set(o,l)}));const O=new Set;return f.forEach((n=>{const{from:o,to:i}=n,{insId:r,pinId:a}=o,{insId:l,pinId:c}=i,d=_.get(r),p=C.get(l);if((0,u.isInternalConnectionNode)(i)&&O.add(`${i.insId}.${i.pinId}`),(0,u.isExternalConnection)(n)){if((0,u.isExternalConnectionNode)(o)){const e=null==p?void 0:p[i.pinId];if(!e)throw new Error(`Input ${i.pinId} of instance ${l} not found`);const t=x.get(o.pinId)||[];t.push(e),x.set(o.pinId,t)}else{let e=null==d?void 0:d[o.pinId];if(!e)throw new Error(`Output ${o.pinId} of instance ${r} not found`);const t=N.get(i.pinId)||[];t.push(e),N.set(i.pinId,t)}return}if(!d)throw new Error(`No outputs found for instance [${r}]`);if(!p)throw b.has(l)?new Error(`No inputs found for instance [${l}]`):new Error(`Instance with id [${l}] does not exist!`);const f=d[a];if(!f)throw new Error(`Output source - [${a}] not found in node [${v}]`);const m=p[c],h=b.get(r);if(!h&&r!==u.THIS_INS_ID)throw new Error(`Instance [${r}] does not exist! failed to connect [${o}] -> [${i}]`);const y=(h?(0,s.getNode)(h,t):e).outputs[a];if(y&&y.delayed||n.delayed||r!==u.THIS_INS_ID&&l!==u.THIS_INS_ID&&I.addDependency(r,l),!m)throw new Error(`Target arg - [${i}] not found in node [${v}]`);const w=f.subscribe((async e=>{if(!(0,s.isDynamicInput)(m))throw console.info(m),new Error(`Impossible state listening to non dynamic input - ${l}.${c}`);m.subject.next(e)}));g.push((()=>w.unsubscribe()))})),(0,a.okeys)(h).forEach((e=>{(N.get(e)||[]).forEach((t=>{const n=t.subscribe((async t=>{if(!h[e])throw new Error(`Impossible state - output ${e} does not exist`);h[e].next(t)}));g.push((()=>n.unsubscribe()))}))})),I.overallOrder().map((e=>b.get(e))).forEach((e=>{const a=C.get(e.id),u=_.get(e.id),p=(0,s.getNode)(e,t);if(!a)throw new Error(`Unexpected error - args not found when running ${e}`);if(!u)throw new Error(`Unexpected error - outputs not found when running ${e}`);for(const t in a){const n=e.inputConfig[t];O.has(`${e.id}.${t}`)||(0,s.isStaticInputPinConfig)(n)||delete a[t]}const f=(0,r.execute)({node:p,inputs:a,outputs:u,resolvedDeps:t,_debugger:n,insId:e.id,extraContext:d,mainState:i,ancestorsInsIds:o,onBubbleError:l,onCompleted:()=>{return t=e.id,j.delete(t),void(0===j.size&&w&&w());var t},onStarted:()=>{return t=e.id,void j.add(t);var t},env:c});g.push(f)})),Object.keys(p).forEach((async e=>{(x.get(e)||[]).forEach((t=>{const n=p[e];if(!(0,s.isDynamicInput)(t))throw new Error(`Unsure what to do with key ${e}, input: ${t} of ins ${o}`);(0,a.isDefined)(n)&&t.subject.next(n)}))})),void 0===e.completionOutputs&&j.size>0?new Promise((e=>{w=e})):()=>g.forEach((e=>{try{e()}catch(t){console.error("error unsubscribing",t)}}))}}}},26488:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MINOR_DEBUGGER_EVENT_TYPES=t.MAJOR_DEBUGGER_EVENT_TYPES=t.DebuggerEventType=void 0,function(e){e.INPUT_CHANGE="i",e.OUTPUT_CHANGE="o",e.PROCESSING_CHANGE="pc",e.ERROR="err",e.INPUTS_STATE_CHANGE="isc"}(n=t.DebuggerEventType||(t.DebuggerEventType={})),t.MAJOR_DEBUGGER_EVENT_TYPES=[n.INPUT_CHANGE,n.OUTPUT_CHANGE,n.ERROR],t.MINOR_DEBUGGER_EVENT_TYPES=[n.PROCESSING_CHANGE,n.INPUTS_STATE_CHANGE]},43686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatEvent=void 0;const o=n(26488);t.formatEvent=function(e){var t,n,i;const s=[e.insId,...null!==(n=null===(t=e.ancestorsInsIds)||void 0===t?void 0:t.split("."))&&void 0!==n?n:[]];(null===(i=e.ancestorsInsIds)||void 0===i?void 0:i.length)>0&&e.ancestorsInsIds;const r=`Node <${e.nodeId}> `,a=`(${s.join(" -> ")})`;return`${r} - ${function(e){switch(e.type){case o.DebuggerEventType.PROCESSING_CHANGE:return e.val?"started processing":"stopped processing";case o.DebuggerEventType.INPUT_CHANGE:return`Input pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.OUTPUT_CHANGE:return`Output pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.INPUTS_STATE_CHANGE:return`Inputs queue size changed to ${Object.entries(e.val).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join(", ")}`;case o.DebuggerEventType.ERROR:return`Error: ${e.val}`}}(e)} ${a}`}},99896:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26488),t),i(n(43686),t)},47025:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.GLOBAL_STATE_NS=t.ROOT_INS_ID=t.INPUTS_STATE_SUFFIX=t.INNER_STATE_SUFFIX=void 0;const s=n(62600),r=n(87794);i(n(99896),t);const a=n(30292),u=n(6775),l=n(84479),c=n(86873),d=n(23046),p=n(30292),f=n(99896),m=n(79804);t.INNER_STATE_SUFFIX="_inner",t.INPUTS_STATE_SUFFIX="_inputs";t.ROOT_INS_ID="__root",t.GLOBAL_STATE_NS="____global";t.execute=e=>{let{node:n,inputs:o,outputs:i,resolvedDeps:v,_debugger:h={},insId:g=t.ROOT_INS_ID,extraContext:I={},mainState:y={},ancestorsInsIds:b,onBubbleError:C=s.noop,env:_={},onCompleted:x=s.noop,onStarted:N=s.noop}=e;const w=[];y[t.GLOBAL_STATE_NS]||(y[t.GLOBAL_STATE_NS]=new Map);const j={...I,ENV:_},O=(0,m.customNodesToNodesCollection)(v,j),P=e=>{const t=e instanceof a.NodeInstanceError?e:new a.NodeInstanceError(e,(0,c.fullInsIdPath)(g,b),n.id);h.onEvent&&h.onEvent({type:f.DebuggerEventType.ERROR,val:t,insId:g,ancestorsInsIds:b,nodeId:n.id}),i[u.ERROR_PIN_ID]?i[u.ERROR_PIN_ID].next(t):C(t)},E=(e=>(0,a.isVisualNode)(e)?(0,u.connect)(e,O,h,(0,c.fullInsIdPath)(g,b),y,P,_,I):(0,a.isInlineValueNode)(e)?(0,m.inlineValueNodeToNode)(e,j):e)(n),D=h.onEvent||s.noop,S={},M={};(0,c.entries)(o).forEach((e=>{let[t,o]=e;if((0,a.isDynamicInput)(o)){const e=(0,a.dynamicNodeInput)({config:o.config}),i=o.subject.subscribe((async o=>{const i=D({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o,ancestorsInsIds:b,nodeId:n.id});if(i){const t=await i.valuePromise;e.subject.next(t)}else h.debugDelay&&await(0,c.delay)(h.debugDelay),e.subject.next(o)}));w.push((()=>i.unsubscribe())),M[t]=e}else{D({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o.config.value,ancestorsInsIds:b,nodeId:n.id});const e=(0,a.staticNodeInput)((0,a.getStaticValue)(o.config.value,O,g));M[t]=e}})),(0,c.entries)(i).forEach((e=>{let[t,o]=e;const i=(0,a.dynamicOutput)(),s=i.subscribe((async e=>{const i=D({type:f.DebuggerEventType.OUTPUT_CHANGE,insId:g,pinId:t,val:e,ancestorsInsIds:b,nodeId:n.id});if(i){const e=await i.valuePromise;o.next(e)}else o.next(e)}));w.push((()=>s.unsubscribe())),S[t]=i}));const T=(e=>{var n,o;const{node:i,inputs:u,outputs:m,resolvedDeps:v,_debugger:h,insId:g,ancestorsInsIds:I,mainState:y,onError:b,onStarted:C,onCompleted:_,env:x,extraContext:N}=e,{run:w,fn:j}=i,O=(0,d.debugLogger)("core"),P=[];let E;const D=(null==h?void 0:h.onEvent)||s.noop,S=(0,c.fullInsIdPath)(g,I),M=`${S}${t.INNER_STATE_SUFFIX}`,T=`${S}${t.INPUTS_STATE_SUFFIX}`,k=O.extend(S),R=y[t.GLOBAL_STATE_NS];y[M]||(y[M]=new Map),y[T]||(y[T]=new Map);let V=null!==(n=y[T])&&void 0!==n?n:new Map;const A=()=>{const e=Array.from(V.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:(0,a.isQueueInputPinConfig)(u[n].config)?null==o?void 0:o.length:1}}),{});D({type:f.DebuggerEventType.INPUTS_STATE_CHANGE,val:e,insId:g,ancestorsInsIds:I,nodeId:i.id})},$={execute:(e,n,o,i)=>(0,t.execute)({node:e,inputs:n,outputs:o,resolvedDeps:v,_debugger:h,insId:i,onCompleted:_,onStarted:C}),insId:g,state:null!==(o=y[M])&&void 0!==o?o:new Map,onCleanup:e=>{P.push(e)},onError:e=>{b(e)},context:null!=N?N:{},ancestorsInsIds:I,globalState:R};let z,H=!1;const G=(i.reactiveInputs||[]).filter((e=>{var t;return!(0,p.isStaticInputPinConfig)(null===(t=u[e])||void 0===t?void 0:t.config)})),L=()=>{var e;null===(e=y[M])||void 0===e||e.clear(),(0,c.keys)(y).filter((e=>e.startsWith(`${S}.`))).forEach((e=>{y[e]=new Map}))},F=e=>{const t=(null==e?void 0:e.key)&&G.includes(null==e?void 0:e.key);if(H&&!t);else{const o=H&&t;if((0,l.isNodeStateValid)(u,V,i)||o){let t;if(H){if(!e)throw new Error("Unexpected state, got reactive node while not processing and not valid");const n=(0,l.pullValueForExecution)(e.key,u[e.key],V,x);t={...z,[e.key]:n},A()}else t=(0,l.pullValuesForExecution)(u,V,x),z=t,A();let o=new Set,s={};if(H=!0,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),i.completionOutputs){const e=i.completionOutputs.map((e=>e.split("+"))).reduce(((e,t)=>(t.forEach((n=>{e.set(n,t)})),e)),new Map);(0,c.entries)(m).forEach((t=>{let[n,a]=t;a.pipe((0,r.first)()).subscribe((t=>{o.add(n),s[n]=t;let r=e.get(n);r&&(r.splice(r.indexOf(n),1),0===r.length&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_&&_(s),L(),(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),E=void 0,o.clear(),s={},(0,l.hasNewSignificantValues)(u,V,x,i.id)&&F()))}))}))}else(0,c.entries)(m).forEach((e=>{let[t,n]=e;n.subscribe((e=>{s[t]=e}))}));try{k("Running node %s with values %o",i.id,t),C&&C(),E=(null!=j?j:w)(t,m,$),(0,c.isPromise)(E)?E.then((()=>{void 0===i.completionOutputs&&_&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_(s),L(),(0,l.hasNewSignificantValues)(u,V,x,i.id)&&F())})).catch((e=>{b(e),H=!1,k("Error in node %s - value %e",i.id,e),D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id})})):void 0===i.completionOutputs&&_&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_(s),L())}catch(n){b(n),H=!1,k("Error in node %s - value %e",i.id,n),D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id})}const d=G.find((e=>u[e]&&(0,l.peekValueForExecution)(e,u[e],V,x,i.id)));if(d){const e=(0,l.peekValueForExecution)(d,u[d],V,x,i.id);F({key:d,value:e})}else{const e=(0,c.entries)(u).find((e=>{let[t,n]=e;const o=(0,a.isQueueInputPinConfig)(n.config),s=(0,l.peekValueForExecution)(t,n,V,x,i.id);return!!o&&(0,c.isDefined)(s)}));if(e){const[t,n]=e,o=(0,l.peekValueForExecution)(t,n,V,x,i.id);F({key:t,value:o})}}}}};F();const B=(0,l.subscribeInputsToState)(u,V,((e,t)=>{O("Got input %s - value is [%o]",e,t),A();try{F({key:e,value:t})}catch(n){b(n)}}));return P.push(B),()=>{(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),P.forEach((e=>e()))}})({node:E,inputs:M,outputs:S,resolvedDeps:O,_debugger:h,insId:g,mainState:y,ancestorsInsIds:b,onError:P,onBubbleError:C,env:_,extraContext:I,onCompleted:x,onStarted:N});return()=>{w.forEach((e=>e())),T()}}},84479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeInputsToState=t.isNodeStateValid=t.hasNewSignificantValues=t.peekValuesForExecution=t.pullValuesForExecution=t.pullValueForExecution=t.peekValueForExecution=void 0;const o=n(30292),i=n(86873),s=n(6775),r=(e,t)=>{const n=(0,o.extractStaticValue)(e);if((0,o.isEnvValue)(n)){return((e,t)=>{const n=e.split(".");let o={...t};for(let s of n){if(!o||!(0,i.isDefined)(o[s])||null===o[s])throw new Error(`Cannot find key ${e} inside obj ${t}`);o=o[s]}return o})((0,o.getEnvKeyFromValue)(n),t)}return n};t.peekValueForExecution=(e,t,n,i,s)=>{const a=n.get(e);let u;if(!t)throw new Error(`Trying to peek value of inexsting input in key "${e}" in node "${s}"`);return u=(0,o.isStaticInput)(t)?r(t,i):(0,o.isQueueInputPinConfig)(t.config)?a?[...a].shift():void 0:a,u};t.pullValueForExecution=(e,t,n,i)=>{const s=n.get(e);let a;return(0,o.isStaticInput)(t)?a=r(t,i):(0,o.isQueueInputPinConfig)(t.config)?(a=(s||[]).shift(),n.set(e,s)):(a=s,(0,o.isStickyInputPinConfig)(t.config)||n.delete(e)),a};t.pullValuesForExecution=(e,n,o)=>(0,i.entries)(e).reduce(((e,i)=>{let[s,r]=i;return e[s]=(0,t.pullValueForExecution)(s,r,n,o),e}),{});t.peekValuesForExecution=(e,n,o,s)=>(0,i.entries)(e).reduce(((e,i)=>{let[r,a]=i;return e[r]=(0,t.peekValueForExecution)(r,a,n,o,s),e}),{});t.hasNewSignificantValues=(e,n,s,r)=>(0,i.entries)(e).some((e=>{let[a,u]=e;const l=(0,o.isQueueInputPinConfig)(u.config),c=(0,t.peekValueForExecution)(a,u,n,s,r);return(0,i.isDefined)(c)&&l}));t.isNodeStateValid=(e,t,n)=>{const r=(0,i.keys)(e),a=(0,i.keys)(n.inputs).filter((e=>{var t;const o=null===(t=n.inputs[e])||void 0===t?void 0:t.mode;return!o||"required"===o}));r.includes(s.TRIGGER_PIN_ID)&&a.push(s.TRIGGER_PIN_ID);return!!(0,i.containsAll)(r,a)&&(0,i.entries)(e).filter((e=>{let[t]=e;return!!n.inputs[t]||t===s.TRIGGER_PIN_ID})).every((e=>{let[s,r]=e;var a;const u=t.get(s);return"optional"===((null===(a=n.inputs[s])||void 0===a?void 0:a.mode)||"required")||(!!(0,o.isStaticInput)(r)||((0,o.isQueueInputPinConfig)(r.config)?(0,i.isDefined)(u)&&u.length>0:(0,i.isDefined)(u)))}))};t.subscribeInputsToState=(e,t,n)=>{const s=[];return(0,i.entries)(e).forEach((e=>{let[i,r]=e;if(!r)return;if((0,o.isStaticInput)(r))return;const a=r.subject.subscribe((e=>{if((0,o.isQueueInputPinConfig)(r.config)){const o=t.get(i)||[];if(!Array.isArray(o))throw new Error(`impossible state - state of key ${i} is set but not an array`);o.push(e),t.set(i,o),n(i,e)}else t.set(i,e),n(i,e)}));s.push((()=>a.unsubscribe()))})),()=>s.forEach((e=>e()))}},5474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flydeFlowSchema=void 0;const o=n(29022),i=o.z.record(o.z.string(),o.z.string().or(o.z.array(o.z.string()))),s=o.z.strictObject({x:o.z.number(),y:o.z.number()}),r=o.z.discriminatedUnion("mode",[o.z.strictObject({mode:o.z.literal("static"),value:o.z.any()}),o.z.strictObject({mode:o.z.literal("queue")}),o.z.strictObject({mode:o.z.literal("sticky")})]),a=o.z.object({size:o.z.optional(o.z.enum(["small","regular","large"])),icon:o.z.optional(o.z.any()),color:o.z.optional(o.z.string()),cssOverride:o.z.optional(o.z.record(o.z.string()))}),u=o.z.object({pos:s.default({x:0,y:0}),id:o.z.string(),inputConfig:o.z.optional(o.z.record(o.z.string(),r)).default({}),visibleInputs:o.z.optional(o.z.array(o.z.string())),visibleOutputs:o.z.optional(o.z.array(o.z.string())),nodeId:o.z.optional(o.z.string()),node:o.z.optional(o.z.any()),style:o.z.optional(a)}).refine((e=>e.node||e.nodeId),{message:"Instance must have either an inline node or refer to a nodeId"}),l=o.z.union([o.z.string(),o.z.object({mode:o.z.enum(["required","optional","required-if-connected"]),type:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),defaultValue:o.z.optional(o.z.any())})]),c=o.z.object({type:o.z.optional(o.z.string()),optional:o.z.optional(o.z.boolean()),delayed:o.z.optional(o.z.boolean()),description:o.z.optional(o.z.string())}),d=o.z.object({id:o.z.optional(o.z.string()),inputs:o.z.record(o.z.string(),l),outputs:o.z.record(o.z.string(),c),inputsPosition:o.z.optional(o.z.record(o.z.string(),s)),outputsPosition:o.z.optional(o.z.record(o.z.string(),s)),customViewCode:o.z.optional(o.z.string()),dataBuilderSource:o.z.optional(o.z.string()),templateType:o.z.optional(o.z.string()),completionOutputs:o.z.optional(o.z.array(o.z.string())),reactiveInputs:o.z.optional(o.z.array(o.z.string())),defaultStyle:o.z.optional(a),description:o.z.optional(o.z.string()),searchKeywords:o.z.optional(o.z.array(o.z.string()))}),p=o.z.object({instances:o.z.array(u),connections:o.z.array(o.z.strictObject({from:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),to:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),delayed:o.z.optional(o.z.boolean()),hidden:o.z.optional(o.z.boolean())}))}).and(d);t.flydeFlowSchema=o.z.strictObject({imports:o.z.optional(i).default({}),node:p})},74762:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticValueVisualNode=void 0,i(n(86873),t);const s=n(30292);i(n(6775),t),i(n(47025),t),i(n(10418),t),i(n(30292),t),i(n(3320),t),i(n(79804),t),i(n(5474),t);t.isStaticValueVisualNode=e=>!!e&&!!(0,s.maybeGetStaticValueNodeId)(`${e}`)},87093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fakeVm=t.VM=t.VMScript=void 0;const o=n(86873);class i{constructor(e){this.script=e}}t.VMScript=i;class s{constructor(e){this.context=e}run(e){const t=(0,o.okeys)(this.context.sandbox),n=Object.values(this.context.sandbox);Function(...t,e.script)(...n)}}t.VM=s,t.fakeVm={VMScript:i,VM:s}},28145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVM2Instance=void 0;const o=n(87093);t.getVM2Instance=()=>o.fakeVm},79804:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.customNodesToNodesCollection=t.inlineValueNodeToNode=void 0;const i=o(n(18706)),s=n(86873),r=n(30292),a=(0,n(28145).getVM2Instance)();t.inlineValueNodeToNode=function(e,t){void 0===t&&(t={});const{runFnRawCode:n,...o}=e,u=(0,s.debugLogger)(`code-node:${e.id}`),l=`\n try {\n ${n}\n } catch (e) {\n adv.onError(e);\n }\n `,c=new a.VMScript(l),d={...o,run:(n,o,l)=>{const d=new a.VM({sandbox:{inputs:n,outputs:o,setInterval:setInterval,clearInterval:clearInterval,setTimeout:setTimeout,clearTimeout:clearTimeout,encodeURIComponent:encodeURIComponent,adv:l,log:function(){for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeWithDependencies=void 0;const o=n(30292),i=n(74762),s=n(88270);t.getNodeWithDependencies=function(e,n,r){if(void 0===r&&(r=[]),(0,o.isInlineValueNode)(e))return[e];if(r.includes(e.id))return[];const a=(0,i.removeDupes)(e.instances.filter((e=>(0,s.isRefNodeInstance)(e))).map((e=>e.nodeId)).filter((e=>n[e])));return[e,...a.flatMap((e=>{var t;return null!==(t=n[e])&&void 0!==t?t:[]})).reduce(((e,o)=>[...e,...(0,t.getNodeWithDependencies)(o,n,[...r,...a])]),[])]}},30292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88270),t),i(n(43069),t),i(n(79426),t),i(n(44535),t),i(n(18063),t),i(n(20359),t)},18063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeInstanceError=void 0;class n extends Error{constructor(e,t,n){let o="Unknown error";o="string"==typeof e?e:e instanceof Error?e.message:null!==e&&"object"==typeof e?JSON.stringify(e):String(e),super(`${o} (insId: ${t}, nodeId: ${n})`),this.name=this.constructor.name,this.message=`${o} (insId: ${t}, nodeId: ${n})`,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.fullInsIdsPath=t,this.nodeId=n}}t.NodeInstanceError=n},88270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInsId=t.NodeInstance=t.isRefNodeInstance=t.isInlineNodeInstance=t.inlineNodeInstance=t.nodeInstance=void 0;const o=n(36618);t.nodeInstance=(e,t,n,o)=>({id:e,nodeId:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.inlineNodeInstance=(e,t,n,o)=>({id:e,node:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.isInlineNodeInstance=e=>!!e.node;t.isRefNodeInstance=e=>!(0,t.isInlineNodeInstance)(e);t.NodeInstance=(e,t,n,o)=>({id:e,nodeId:t.id,inputConfig:n||{},pos:o||{x:0,y:0}});t.createInsId=e=>`${e.id}-${(0,o.slug)()}`},43069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvKeyFromValue=t.toEnvValue=t.isEnvValue=t.extractStaticValue=t.isStaticInput=t.isDynamicInput=t.staticNodeInput=t.dynamicNodeInputs=t.dynamicNodeInput=t.dynamicOutput=t.nodeOutputs=t.nodeOutput=t.nodeInputs=t.isInputPinOptional=t.nodeInput=void 0;const o=n(62600),i=n(30292),s=n(86873),r=n(79426);t.nodeInput=function(e){return void 0===e&&(e="required"),{mode:e}};t.isInputPinOptional=e=>"optional"===e.mode;t.nodeInputs=(e,n)=>(0,s.repeat)(e,(e=>(0,t.nodeInput)((null==n?void 0:n[e])||"required")));t.nodeOutput=function(e){return void 0===e&&(e=!1),{delayed:e}};t.nodeOutputs=e=>(0,s.repeat)(e,(()=>(0,t.nodeOutput)()));t.dynamicOutput=()=>new o.Subject,t.dynamicNodeInput=(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})));t.dynamicNodeInputs=function(e){return void 0===e&&(e=10),(0,s.repeat)(e,(()=>(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})))()))};t.staticNodeInput=e=>({config:(0,r.staticInputPinConfig)(e)});t.isDynamicInput=e=>{const t=e;return t&&t.subject&&!!t.subject.next};t.isStaticInput=e=>(0,i.isStaticInputPinConfig)(null==e?void 0:e.config);t.extractStaticValue=e=>{if((0,t.isStaticInput)(e))return e.config.value;throw new Error("Cannot extract static value from non static arg")};t.isEnvValue=e=>"string"==typeof e&&e.startsWith("$ENV.");t.toEnvValue=e=>`$ENV.${e}`;t.getEnvKeyFromValue=e=>"string"==typeof e?e.replace(/^\$ENV\./,""):e},20359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeFromFunction=t.getNodeDef=t.getNode=t.getStaticValue=t.maybeGetStaticValueNodeId=t.fromSimplified=t.inlineValueNode=t.codeNode=t.visualNode=t.isInlineValueNode=t.isVisualNode=t.isCodeNode=t.isBaseNode=t.InlineValueNodeType=void 0;const o=n(86873),i=n(88270),s=n(43069);!function(e){e.VALUE="value",e.FUNCTION="function"}(t.InlineValueNodeType||(t.InlineValueNodeType={}));t.isBaseNode=e=>e&&e.id&&e.inputs&&e.outputs;t.isCodeNode=e=>(0,t.isBaseNode)(e)&&"function"==typeof e.run;t.isVisualNode=e=>!!e.instances;t.isInlineValueNode=e=>(0,o.isDefined)(e)&&(0,o.isDefined)(e.runFnRawCode),t.visualNode=(0,o.testDataCreator)({id:"visual-node",inputs:{},outputs:{},instances:[],connections:[],outputsPosition:{},inputsPosition:{}}),t.codeNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},run:o.noop}),t.inlineValueNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},runFnRawCode:""});t.fromSimplified=e=>{let{run:t,inputTypes:n,outputTypes:i,id:s}=e;return{id:s,inputs:(0,o.entries)(n).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),outputs:(0,o.entries)(i).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),run:t}};t.maybeGetStaticValueNodeId=e=>{const t="string"==typeof e&&e.match(/^__node\:(.*)/);if(t){return t[1]}return null};t.getStaticValue=(e,n,o)=>{const i=(0,t.maybeGetStaticValueNodeId)(e);if(i){const e=n[i];if(!e)throw new Error(`Instance ${o} referrer to a node reference ${i} that does not exist`);return e}return e};t.getNode=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw new Error(`Node with id ${n} not found`);return o};t.getNodeDef=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw console.error(`Node with id ${n} not found`),new Error(`Node with id ${n} not found`);return o};t.codeFromFunction=e=>{let{id:t,fn:n,inputNames:o,outputName:i,defaultStyle:r}=e;return{id:t,inputs:o.reduce(((e,t)=>({...e,[t]:(0,s.nodeInput)()})),{}),outputs:{[i]:(0,s.nodeOutput)()},run:(e,t)=>{const s=o.map((t=>e[t])),r=t[i],a=n(...s);return Promise.resolve(a).then((e=>null==r?void 0:r.next(e)))},completionOutputs:[i],defaultStyle:r}}},44535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nodeFromSimpleFunction=void 0,t.nodeFromSimpleFunction=function(e){var t;return{...e,id:e.id,description:e.description,namespace:e.namespace,inputs:e.inputs?e.inputs.reduce(((e,t)=>{let{name:n,description:o,mode:i,defaultValue:s}=t;return{...e,[n]:{description:o,mode:null!=i?i:"required",defaultValue:s}}}),{}):{},outputs:e.output?{[e.output.name]:{description:e.output.description}}:{},defaultStyle:{icon:e.icon,size:e.size},run:null!==(t=e.fullRunFn)&&void 0!==t?t:async function(t,n,o){var i,s;const r=(null!==(i=e.inputs)&&void 0!==i?i:[]).map((e=>{let{name:n}=e;return t[n]}));try{const t=await Promise.resolve(e.run(...r));e.output&&(null===(s=n[e.output.name])||void 0===s||s.next(t))}catch(a){console.error("Error in node",a),o.onError(a)}},customViewCode:e.customViewCode}}},79426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticInputPinConfig=t.isStickyInputPinConfig=t.isQueueInputPinConfig=t.staticInputPinConfig=t.stickyInputPinConfig=t.queueInputPinConfig=t.INPUT_MODES=void 0,t.INPUT_MODES=["queue","sticky","static"];t.queueInputPinConfig=()=>({mode:"queue"});t.stickyInputPinConfig=()=>({mode:"sticky"});t.staticInputPinConfig=e=>({mode:"static",value:e});t.isQueueInputPinConfig=e=>"queue"===e.mode;t.isStickyInputPinConfig=e=>!!e&&"sticky"===e.mode,t.isStaticInputPinConfig=function(e){return!!e&&"static"===e.mode}},10418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedExecute=void 0;const o=n(74762),i=n(47025);t.simplifiedExecute=function(e,t,n,s,r){void 0===r&&(r={});const a=(0,o.keys)(e.outputs),u=Object.keys(n).reduce(((e,t)=>{const i=n[t];return{...e,[t]:(0,o.isDynamicInput)(i)?i:(0,o.staticNodeInput)(i)}}),{}),l=a.reduce(((e,t)=>{const n=(0,o.dynamicOutput)();return s&&n.subscribe((e=>{s(t,e)})),{...e,[t]:n}}),{});return(0,i.execute)({node:e,inputs:u,outputs:l,resolvedDeps:t,onBubbleError:e=>{throw e},...r})}},25779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodePreview=void 0;const o=n(35250),i=n(74762),s=n(86553);t.NodePreview=e=>{let{node:t}=e;const n={node:t,instance:(0,i.nodeInstance)("bob",t.id,{}),connections:[],viewPort:{pos:{x:0,y:0},zoom:1},resolvedDeps:{},connectionsPerInput:{},onUngroup:i.noop,onDblClick:i.noop,onDragEnd:i.noop,onDragMove:i.noop,onDragStart:i.noop,onPinClick:i.noop,onPinDblClick:i.noop,onSelect:i.noop,onTogglePinBreakpoint:i.noop,onTogglePinLog:i.noop,onToggleSticky:i.noop,displayMode:!0,onInspectPin:i.noop,onDetachConstValue:i.noop,onCopyConstValue:i.noop,onPasteConstValue:i.noop,ancestorsInsIds:"",onChangeVisibleInputs:i.noop,onChangeVisibleOutputs:i.noop,onConvertConstToEnv:i.noop,forceShowMinimized:"both",onExtractInlineNode:i.noop,onCloseInlineEditor:i.noop,isConnectedInstanceSelected:!1,inlineEditorPortalDomNode:null,onChangeStyle:i.noop,onDeleteInstance:i.noop,onGroupSelected:i.noop,onSetDisplayName:i.noop,hadError:!1,queuedInputsData:{},onPinMouseDown:i.noop,onPinMouseUp:i.noop};return(0,o.jsx)("div",{className:"node-preview",children:(0,o.jsx)(s.InstanceView,{...n})})}},30653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDarkMode=t.DarkModeProvider=void 0;const o=n(70079),i=(0,o.createContext)(!0);t.DarkModeProvider=i.Provider;t.useDarkMode=()=>(0,o.useContext)(i)},29183:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataInspectionModal=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=n(74089),p=n(83938),f=n(17102),m=n(98158);t.DataInspectionModal=e=>{var t;const{onRequestHistory:n}=(0,m.useDebuggerContext)(),{item:o}=e,[i,s]=c.default.useState(),[r,v]=c.default.useState(0),[h,g]=c.default.useState(""),[I,y]=c.default.useState(),[b]=(0,d.useDebounce)(h,300);(0,c.useEffect)((()=>{y(null==i?void 0:i.lastSamples.filter((e=>"object"==typeof e.val?JSON.stringify(e.val).includes(b):e.val.toString().includes(b)))),v(0)}),[null==i?void 0:i.lastSamples,b]),c.default.useEffect((()=>{!async function(){var e,t;const i=await n(o.insId,null===(e=o.pin)||void 0===e?void 0:e.id,null===(t=o.pin)||void 0===t?void 0:t.type);s(i)}()}),[o,n]);const C=e=>{const t=e.val;return"object"==typeof t?(0,a.jsx)(p.BrowserOnlyReactJson,{src:t}):(0,a.jsx)(u.Code,{children:t.toString()})},_=`"${o.insId}" ${(null===(t=o.pin)||void 0===t?void 0:t.id)?`(${o.pin.id})`:""}`;return(0,a.jsx)(u.Dialog,{isOpen:!0,title:`Inspecting data for instance ${_}`,onClose:e.onClose,canEscapeKeyClose:!1,className:"data-inspection-modal",children:(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{children:[i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("em",{children:[_," called ",i.total," time(s)"]}),i.total>10&&(0,a.jsx)("span",{children:"Showing last 10 samples"})]}):null,(0,a.jsx)("input",{className:"bp5-input bp5-small bp5-fill",type:"search",placeholder:"Search for values",dir:"auto",onChange:e=>g(e.target.value),value:h}),b.length>0&&(0,a.jsxs)("span",{children:["Showing ",null==I?void 0:I.length," of ",i.lastSamples.length," ",'samples matching query "',b,'"']})]}),(0,a.jsx)("main",{className:"main-wrapper",children:(()=>{if(!i)return(0,a.jsx)(f.Loader,{});if(0===i.total)return(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",(0,a.jsx)("em",{children:o.insId})," ",o.pin?(0,a.jsxs)(c.default.Fragment,{children:["and pin ",(0,a.jsx)("em",{children:o.pin.id})]}):null,". Make sure debugger is running and your program was triggered."]});const e=null==I?void 0:I[r];return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Card,{className:"content-wrapper",children:[e?(0,a.jsxs)("div",{className:"info",children:[(0,a.jsxs)("div",{children:["Showing sample ",r," of event from"," ",(0,a.jsx)("strong",{children:(0,d.timeAgo)(e.time)})," (",new Date(e.time).toLocaleString(),")"]}),(0,a.jsxs)("div",{children:["Instance: ",(0,a.jsx)("strong",{children:e.insId}),", Pin id:"," ",(0,a.jsx)("strong",{children:e.pinId})," "]}),(0,a.jsx)("div",{children:"Value:"})]}):null,C(e)]}),(0,a.jsx)(u.Menu,{className:"samples-menu",children:I.map(((e,t)=>{const n=e.pinId,o=`${i.total-t}. from pin "${n}"`;return(0,a.jsx)(u.MenuItem,{text:o,onClick:()=>v(t)},t)}))})]}):i.lastSamples.length>0&&h.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",children:['No data found for search query "',h,'"']}):(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",o.insId," ",o.pin?`and ${o.pin.id}`:"",". Make sure a debugger is connected and your program was triggered."]})})()})]})})})}},40471:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29183),t)},98158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebuggerContext=t.DebuggerContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({onRequestHistory:()=>Promise.reject(new Error("Not implemented"))});t.DebuggerContextProvider=i.Provider;t.useDebuggerContext=()=>(0,o.useContext)(i)},86125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDependenciesContext=t.DependenciesContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({resolvedDependencies:{},onImportNode:()=>Promise.reject(new Error("Not implemented")),onRequestImportables:()=>Promise.reject(new Error("Not implemented"))});t.DependenciesContextProvider=i.Provider;t.useDependenciesContext=()=>(0,o.useContext)(i)},97106:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FlowEditor=void 0;const u=n(35250),l=s(n(70079)),c=n(74762),d=n(63521),p=a(n(53865)),f=n(68120),m=n(7047),v=n(84472),h=n(82232),g=n(49283),I=n(43490),y=n(68840),b=n(78087),C=n(20079),_=n(60190),x=n(40471),N=n(98158),w=n(86125),j=n(30653),O=n(77852);r(n(43490),t),r(n(98158),t),r(n(86125),t),y.library.add(b.fab,C.fas);const P=["select","drag-move","order-step"];t.FlowEditor=l.memo(l.forwardRef(((e,t)=>{const{state:n,onChangeEditorState:o}=e,{resolvedDependencies:i,onImportNode:s}=(0,w.useDependenciesContext)(),[r,a]=l.useState([]),[y,b]=l.useState([]),{flow:C,boardData:E}=n,D=n.flow.node,[S,M]=l.useState({}),[T,k]=l.useState(new Set),{debuggerClient:R}=(0,N.useDebuggerContext)();l.useEffect((()=>{if(R)return R.onBatchedEvents((e=>{e.forEach((e=>{e.type===c.DebuggerEventType.INPUTS_STATE_CHANGE&&(console.log("INPUTS_STATE_CHANGE",e.insId,e.val),M((t=>({...t,[e.insId]:e.val})))),e.type===c.DebuggerEventType.ERROR&&k((t=>{const n=new Set(t);return n.add(e.insId),n}))}))}))}),[R]);const{openFile:V,reportEvent:A}=(0,I.usePorts)(),$=l.useCallback(((e,t)=>{console.info("onChangeFlow",t.type),"functional"===t.type&&(a([{flow:{...n.flow,...e}},...r.slice(0,50)]),b([])),o((t=>({...t,flow:{...t.flow,...e}})))}),[o,n.flow,r]),[z,H]=l.useState({instances:[],connections:[]}),[G,L]=l.useState(!1),F=l.useCallback((()=>L(!1)),[]),B=l.useCallback((()=>L(!0)),[]),q=l.useCallback((e=>{o((t=>({...t,boardData:{...t.boardData,...e}})))}),[o]);l.useEffect((()=>{q({selected:[],viewPort:d.defaultViewPort,from:void 0,to:void 0,lastMousePos:{x:0,y:0}})}),[D.id]),(0,f.useHotkeys)("cmd+z",(e=>{b([...y,n]);const[t,...i]=r;t&&(o((e=>({...e,...t}))),a(i)),e.preventDefault()}),{text:"Undo last change",group:"Editing"},[n,r,y]);const U=l.useCallback(((e,t)=>{P.some((e=>t.message.includes(e)))||b([]),$({node:e},t)}),[$]),W=l.useCallback((e=>{V({absPath:e.source.path})}),[V]),Z=l.useCallback((function(e,t){void 0===t&&(t=-1*d.NODE_HEIGHT*1.5);const n=(0,m.createNewNodeInstance)(e,t,E.lastMousePos,i);if(n){const e=(0,p.default)(C,(e=>{const t=e.node;if(!(0,c.isVisualNode)(t))throw new Error("Impossible state, adding node to non visual node");t.instances.push(n)}));return $(e,(0,h.functionalChange)("add-node")),F(),n}}),[E.lastMousePos,C,$,F,i]),J=l.useCallback((async e=>{switch(e.type){case g.OmniBarCmdType.ADD:return A("addNode",{nodeId:e.data,source:"omnibar"}),Z(e.data);case g.OmniBarCmdType.ADD_VALUE:{const e=t.current;null==e||e.requestNewInlineValue();break}case g.OmniBarCmdType.IMPORT:{await s(e.data,{pos:E.lastMousePos});const t=(0,_.vAdd)({x:0,y:0},E.lastMousePos),n=(0,m.createNewNodeInstance)(e.data.node,0,t,i),o=(0,p.default)(C,(e=>{e.node.instances.push(n)}));$(o,(0,h.functionalChange)("add-imported-node")),A("addNode",{nodeId:e.data.node.id,source:"omnibar"});break}default:v.AppToaster.show({intent:"warning",message:"Not supported yet"})}F()}),[F,A,Z,t,s,E.lastMousePos,i,C,$]),[Y,K]=l.useState(),Q=l.useCallback((()=>K(void 0)),[]),X=l.useCallback(((e,t)=>{K({insId:e,pin:t})}),[]),{isDarkMode:ee}=(0,O.useDarkMode)();return(0,u.jsx)("div",{className:"flyde-flow-editor",children:(()=>{var n;if((0,c.isInlineValueNode)(D))throw new Error("Impossible state");return(0,u.jsx)(j.DarkModeProvider,{value:null!==(n=e.darkMode)&&void 0!==n?n:ee,children:(0,u.jsxs)(l.Fragment,{children:[Y?(0,u.jsx)(x.DataInspectionModal,{item:Y,onClose:Q}):null,(0,u.jsx)(d.VisualNodeEditor,{currentInsId:c.ROOT_INS_ID,ref:t,boardData:E,onChangeBoardData:q,node:D,onGoToNodeDef:W,onChangeNode:U,resolvedDependencies:i,clipboardData:z,onCopy:H,nodeIoEditable:!D.id.startsWith("Trigger"),onInspectPin:X,onShowOmnibar:B,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:S,initialPadding:e.initialPadding,instancesWithErrors:T,disableScrolling:e.disableScrolling},D.id),G?(0,u.jsx)(g.Omnibar,{flow:C,resolvedNodes:i,onCommand:J,visible:G,onClose:F}):null]})})})()})})))},9001:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeEditor=t.renderCreateIOOption=void 0;const i=n(35250),s=o(n(70079)),r=n(74762),a=n(50382),u=o(n(53865)),l=n(70457),c=n(25779);t.renderCreateIOOption=(e,t,n)=>(0,i.jsx)(a.MenuItem,{icon:"add",text:`Create "${e}"`,active:t,onClick:n,shouldDismissPopover:!1});const d=l.MultiSelect.ofType();t.BaseNodeEditor=e=>{var n,o;const{node:l,onChange:p}=e,f=(0,r.entries)(l.inputs),m=f.filter((e=>{let[,t]=e;return"required"===t.mode})).map((e=>{let[t]=e;return t})),v=f.filter((e=>{let[,t]=e;return"optional"===t.mode})).map((e=>{let[t]=e;return t})),h=f.filter((e=>{let[,t]=e;return"required-if-connected"===t.mode})).map((e=>{let[t]=e;return t})),[g,I]=s.default.useState(!1),y=(0,r.okeys)(l.outputs),b=s.default.useCallback((e=>{p({...l,id:e})}),[l,p]),C=s.default.useCallback((e=>{let t=e?e.split(","):void 0;"[]"===e&&(t=[]),p({...l,completionOutputs:t})}),[l,p]),_=s.default.useCallback((e=>{let t=e?e.split(","):void 0;p({...l,reactiveInputs:t})}),[l,p]),x=s.default.useCallback(((e,t)=>{const n=(0,u.default)(l,(n=>{n.inputs[e]=(0,r.nodeInput)(t)}));p(n)}),[l,p]),N=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.inputs[e]}));p(t)}),[l,p]),w=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{t.outputs[e]=(0,r.nodeOutput)()}));p(t)}),[l,p]),j=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.outputs[e]}));p(t)}),[l,p]);return(0,i.jsxs)("div",{className:"base-node-editor",children:[(0,i.jsx)("div",{className:"form-row",children:(0,i.jsx)(a.FormGroup,{label:"Node Name",labelFor:"text-input",labelInfo:"(required)",children:(0,i.jsx)(a.InputGroup,{id:"node-name",disabled:e.idDisabled,placeholder:"Node ID",value:l.id,onChange:e=>b(e.target.value)})})}),(0,i.jsx)(a.FormGroup,{label:"Required Inputs",children:(0,i.jsx)(d,{selectedItems:m,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),!0!==e.hiddenOutputs?(0,i.jsx)(a.FormGroup,{label:"Outputs",children:(0,i.jsx)(d,{selectedItems:y,placeholder:"Enter output names here",items:[],tagRenderer:e=>e,onItemSelect:w,onRemove:j,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}):null,(0,i.jsx)(a.Checkbox,{checked:g,onChange:e=>I(e.target.checked),children:"Show advanced options"}),(0,i.jsxs)(a.Collapse,{isOpen:g,children:[(0,i.jsx)(a.FormGroup,{label:"Optional Inputs",children:(0,i.jsx)(d,{selectedItems:v,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"optional"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Required-if-connected Inputs",children:(0,i.jsx)(d,{selectedItems:h,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required-if-connected"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Completion Outputs",children:(0,i.jsx)(a.InputGroup,{id:"completion-outputs",placeholder:"completion outputs",value:(null===(n=l.completionOutputs)||void 0===n?void 0:n.join(","))||"",onChange:e=>C(e.target.value)})}),(0,i.jsx)(a.FormGroup,{label:"Reactive Inputs",children:(0,i.jsx)(a.InputGroup,{id:"reactive-inputs",placeholder:"Reactive inputs",value:(null===(o=l.reactiveInputs)||void 0===o?void 0:o.join(","))||"",onChange:e=>_(e.target.value)})})]}),(0,i.jsx)(a.FormGroup,{label:"Preview",children:(0,i.jsx)("div",{className:"preview-wrapper",children:(0,i.jsx)(c.NodePreview,{node:l})})})]})}},82232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metaChange=t.functionalChange=void 0;t.functionalChange=e=>({type:"functional",message:e});t.metaChange=function(e){return void 0===e&&(e="n/a"),{type:"meta",message:e}}},41032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safelyGetNodeDef=t.loadingDef=void 0;const o=n(74762);t.loadingDef={id:"Loading",inputs:{},outputs:{}};t.safelyGetNodeDef=(e,n)=>{try{return(0,o.getNodeDef)(e,n)}catch(i){const n="string"==typeof e?e:e.nodeId;return{...t.loadingDef,id:n}}}},72125:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCodeModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(68371),f=n(74762),m=n(31745),v="`Result is ${inputs.a + inputs.b}`";t.InlineCodeModal=u.memo((function(e){const{initialValue:t,initialType:n}=e,[o,i]=u.useState((0,f.isDefined)(t)?t:v),[s,r]=u.useState(n||f.InlineValueNodeType.VALUE),h=(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:['You can add variables to by referrencing the "inputs" object.',(0,a.jsx)("br",{})," For example:",(0,a.jsx)(c.Code,{children:"`Hello {inputs.name}`"}),' will expose an input pin named "name"']}),(0,a.jsxs)("p",{children:["You can also use ternery expressions, arithmetic operators and more!",(0,a.jsx)("br",{}),"For example:",(0,a.jsx)(c.Code,{children:"inputs.a > inputs.b ? inputs.a + 42 : Math.random() * inputs.b"})]})]}),g=(0,a.jsxs)("span",{children:["Type in any valid JS value, such as ",(0,a.jsx)(c.Code,{children:"true"}),", ",(0,a.jsx)(c.Code,{children:"42"}),","," ",(0,a.jsx)(c.Code,{children:'["bob", "alice", "dave"]'}),".",(0,a.jsx)("br",{})," Dynamic inputs may also be used"]}),I=(0,a.jsxs)("span",{children:["Write any JS code and return a value.",(0,a.jsx)("br",{})," The returned value will be the output.",(0,a.jsx)("br",{})," Example:",(0,a.jsx)(c.Code,{children:"const a = inputs.a; const b = inputs.b; return Math.floor(a/b);"})]}),y=(0,p.getVariables)(o);return u.useEffect((()=>{o===v&&s===f.InlineValueNodeType.FUNCTION&&i(`return ${v}`),o===`return ${v}`&&s===f.InlineValueNodeType.VALUE&&i(v)}),[o,s]),(0,a.jsxs)(c.Dialog,{isOpen:!0,title:"Inline Value / Code",onClose:e.onCancel,className:"inline-code-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:t=>{"Enter"===t.key&&t.metaKey&&e.onSubmit(s,o)},tabIndex:0,children:[(0,a.jsxs)(c.RadioGroup,{inline:!0,onChange:e=>r(e.target.value),selectedValue:s,children:[(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Value ",(0,a.jsx)(m.InfoTooltip,{content:g})]}),value:f.InlineValueNodeType.VALUE}),(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Function ",(0,a.jsx)(m.InfoTooltip,{content:I})]}),value:f.InlineValueNodeType.FUNCTION})]}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"javascript",value:o,onChange:e=>i(e||""),onMount:e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})}}),(()=>{const e=o.includes("return");return e&&s===f.InlineValueNodeType.VALUE?(0,a.jsx)(c.Callout,{intent:c.Intent.WARNING,children:'When using the "value" type you are not expected to return anything'}):e||s!==f.InlineValueNodeType.FUNCTION?null:(0,a.jsxs)(c.Callout,{intent:c.Intent.DANGER,children:['When using the "function" type you are expected to'," ",(0,a.jsx)(c.Code,{children:"return"})," a value.",(0,a.jsx)("br",{}),"Example: ",(0,a.jsx)(c.Code,{children:"return 42 + Date.now();"})]})})(),(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Input pins detected:"," ",y.length?y.map((e=>(0,a.jsx)(c.Code,{children:e},e))):"None",(0,a.jsx)(m.InfoTooltip,{content:h})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:e.onCancel,children:"Cancel"}),(0,a.jsx)(c.Button,{onClick:()=>e.onSubmit(s,o),intent:c.Intent.PRIMARY,className:"save-btn",children:"Save"})]})})]})}))},18594:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(72125),t)},68371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInlineValueNode=t.getVariables=void 0;const o=n(74762),i=n(74762);t.getVariables=e=>(e.match(/inputs\.([a-zA-Z]\w*)/g)||[]).map((e=>e.replace(/inputs\./,"")));t.createInlineValueNode=e=>{let{code:n,customView:s,nodeId:r,type:a}=e;const u=(0,t.getVariables)(n).reduce(((e,t)=>({...e,[t]:(0,o.nodeInput)()})),{}),l={value:(0,o.nodeOutput)()},c=a===o.InlineValueNodeType.FUNCTION?`const result = (function() { ${n}}());\n Promise.resolve(result).then(val => outputs.value.next(val))`:`const result = (${n}); Promise.resolve(result).then(val => outputs.value.next(val))`,d=btoa(n);return(0,i.inlineValueNode)({id:r||`Inline Code ${(0,o.randomInt)(99999)}`,inputs:u,outputs:l,runFnRawCode:c,customViewCode:s||n,dataBuilderSource:d,templateType:a,completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline "+(a===o.InlineValueNodeType.VALUE?"value":"function")})}},49283:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Omnibar=t.OmniBarCmdType=void 0;const a=n(35250),u=s(n(70079)),l=n(70457),c=n(74762),d=n(50382),p=r(n(26372));var f;!function(e){e.ADD="add",e.ADD_VALUE="add-value",e.IMPORT="import"}(f=t.OmniBarCmdType||(t.OmniBarCmdType={}));const m=[];t.Omnibar=e=>{const{resolvedNodes:t}=e,[n,o]=u.useState(""),[i,s]=u.useState(null),[r,v]=u.useState([]);u.useEffect((()=>{const e=(0,c.keys)(t).map((e=>({title:`${t[e].id}`,cmd:{type:f.ADD,data:e},extra:"current flow"}))),n=r.map((e=>({title:`${e.node.id}`,description:e.node.description,cmd:{type:f.IMPORT,data:e},extra:`${e.module}`}))),o={title:"Add inline value or code",suggestOnEmpty:!0,cmd:{type:f.ADD_VALUE}},i=[...m,...n,o,...e];s(i)}),[t,r]),u.useEffect((()=>{e.onRequestImportables&&e.onRequestImportables(n).then((e=>{v(e)}))}),[e,n]);const h=u.useCallback(((e,t)=>{let{handleClick:n,modifiers:o,query:i,index:s}=t;if(!o.matchesPredicate)return null;const r=`${e.title}`;return(0,a.jsx)(d.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,a.jsxs)("div",{className:(0,p.default)("omnibar-item",{active:o.active}),children:[(0,a.jsxs)("div",{className:"title",children:[r," ",e.extra?(0,a.jsx)("span",{className:"extra",children:e.extra}):null]}),e.description?(0,a.jsx)("div",{className:"description",children:e.description}):null]})},s)}),[]),g=u.useCallback(((e,t)=>{const n=e.toLowerCase().split("").map((e=>{return`${t=e,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*`;var t})).join(""),o=new RegExp(n);return!!t.title.toLowerCase().match(o)}),[]),I=u.useCallback((t=>{e.onCommand(t.cmd),e.onClose()}),[e]);return i?(0,a.jsx)(l.Omnibar,{query:n,onQueryChange:o,onClose:e.onClose,noResults:(0,a.jsx)(d.MenuItem,{disabled:!0,text:"No results."}),itemPredicate:g,isOpen:e.visible,items:i,initialContent:void 0,onItemSelect:I,itemRenderer:h,inputProps:{placeholder:"Search for nodes or commands.."}}):null}},60698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43490:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31874),t)},31874:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.usePorts=t.useConfirm=t.usePrompt=t.PortsContext=t.defaultPorts=void 0;const s=n(70079),r=n(74762),a=n(84472);i(n(60698),t);const u=e=>async()=>{console.warn(`${e} Not implemented`),(0,a.toastMsg)("Feature not implemented in this context yet","warning")};t.defaultPorts={prompt:async e=>{let{text:t,defaultValue:n}=e;return prompt(`${t}`,n)},openFile:async e=>{},confirm:async e=>{let{text:t}=e;return confirm(t)},readFlow:u("readFlow"),setFlow:u("setFlow"),resolveDeps:u("resolveDeps"),getImportables:u("getImportables"),onExternalFlowChange:u("onExternalFlowChange"),onInstallRuntimeRequest:u("onInstallRuntimeRequest"),onRunFlow:u("onRunFlow"),onStopFlow:u("onStopFlow"),reportEvent:r.noop,generateNodeFromPrompt:u("generateNodeFromPrompt"),hasOpenAiToken:()=>Promise.resolve(!1)},t.PortsContext=(0,s.createContext)(t.defaultPorts);t.usePrompt=()=>{const e=(0,s.useContext)(t.PortsContext).prompt;return(t,n)=>e({text:t,defaultValue:n})};t.useConfirm=()=>{const e=(0,s.useContext)(t.PortsContext).confirm;return t=>e({text:t})};t.usePorts=()=>(0,s.useContext)(t.PortsContext)},65758:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelected=void 0;const i=n(74762),s=o(n(53865)),r=n(22513);t.groupSelected=async(e,t,n,o,a)=>{const{instances:u,connections:l}=t,c=u.filter((t=>e.includes(t.id))),d=l.filter((t=>{let{from:n,to:o}=t;return-1!==e.indexOf(n.insId)||-1!==e.indexOf(o.insId)}));if(!c.length)throw new Error("visual without selections");const{visualNode:p,renamedInputs:f,renamedOutputs:m}=await(0,r.createGroup)(c,d,n,a),v=c.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),u[0].pos),h="ref"===o?(0,i.nodeInstance)((0,i.createInsId)(p),p.id,{},v):(0,i.inlineNodeInstance)((0,i.createInsId)(p),p,{},v),g=u.filter((t=>-1===e.indexOf(t.id))),I=l.map((e=>{const t=`${e.from.insId}.${e.from.pinId}`,n=`${e.to.insId}.${e.to.pinId}`;return f[n]?{...e,to:{insId:h.id,pinId:f[n]}}:m[t]?{...e,from:{insId:h.id,pinId:m[t]}}:e})).filter((t=>-1===e.indexOf(t.from.insId)&&-1===e.indexOf(t.to.insId)));return{newNode:p,currentNode:(0,s.default)(t,(e=>{e.instances=[...g,h],e.connections=I}))}}},74089:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(97106),t),i(n(18420),t),i(n(90680),t),i(n(84472),t),i(n(17102),t),i(n(82232),t),i(n(25779),t),i(n(25804),t),i(n(9958),t),i(n(68120),t),i(n(94651),t),i(n(73470),t),i(n(94007),t),i(n(60190),t),i(n(9001),t),i(n(7047),t),i(n(23386),t)},31745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoTooltip=void 0;const o=n(35250),i=n(50382),s=n(50382),r=n(44470),a=n(50382);t.InfoTooltip=e=>{const{content:t}=e;return(0,o.jsx)(s.Tooltip,{content:t,placement:"top",className:"info-tooltip",children:(0,o.jsx)(i.Icon,{icon:(0,o.jsx)(r.InfoSign,{className:a.Classes.INTENT_PRIMARY}),intent:i.Intent.SUCCESS,className:"info-tooltip-icon"})})}},83938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserOnlyReactJson=void 0;const o=n(35250);t.BrowserOnlyReactJson=e=>{if("undefined"==typeof window)return null;const t=n(73541).Z;return(0,o.jsx)(t,{...e})}},94651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsValueRenderer=void 0;const o=n(35250),i=n(74762),s=n(83938);t.AnalyticsValueRenderer=e=>{let{val:t}=e;try{const e=JSON.parse(t),n="object"==typeof e?e:{value:e},r=e&&[e.type,e.key,e.props,e.ref].every(i.isDefined),a=r?{jsxValue:e}:n;return(0,o.jsx)(s.BrowserOnlyReactJson,{src:a,collapseStringsAfterLength:50,collapsed:r})}catch(n){return(0,o.jsx)(s.BrowserOnlyReactJson,{src:{value:t},collapseStringsAfterLength:50})}}},22513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=void 0;const o=n(74762),i=n(74762),s=n(60190),r=n(88593);t.createGroup=async(e,t,n,a)=>{if(0===e.length)throw new Error("cannot create group without instances");const u=e.map((e=>e.id)),l=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return!t&&n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.to,e.to)))===t)),c=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return t&&!n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.from,e.from)))===t));let d={},p={},f={},m={};const v=[],h={};for(const o of l){const e=`${o.to.insId}.${o.to.pinId}`,t=`${o.from.insId}.${o.from.pinId}`,n=o.to.pinId;if(f[t]){v.push({from:(0,i.externalConnectionNode)(f[t]),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)});continue}const r=h[n]?await a(`Name this input (${n} of ${o.to.insId}) is already taken:`)||`i${(0,s.rnd)()}`:n;d[e]=r,f[t]=r,v.push({from:(0,i.externalConnectionNode)(r),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)}),h[r]=(0,i.nodeInput)()}const g={};for(const r of c){const e=`${r.to.insId}.${r.to.pinId}`,t=`${r.from.insId}.${r.from.pinId}`,n=r.from.pinId;if(m[e]){v.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(m[e])});continue}const u=g[n]?await a(`Name this output (${n} of ${r.from.insId} is already taken:`)||`i${(0,s.rnd)()}`:n;p[t]=u,m[e]=u,v.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(u)}),g[u]=(0,o.nodeOutput)()}e.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),e[0].pos);const I=t.filter((e=>u.includes(e.from.insId)&&u.includes(e.to.insId)));return{visualNode:{id:n,inputs:h,outputs:g,instances:e,defaultStyle:{size:"large",color:(0,o.pickRandom)(r.nodeStylePresetColors.map((e=>e.color)))},inputsPosition:(0,o.okeys)(h).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:0}})),{}),outputsPosition:(0,o.okeys)(g).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:400}})),{}),connections:[...I,...v],completionOutputs:(0,o.okeys)(g)},renamedInputs:d,renamedOutputs:p}}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightText=void 0;const o=n(35250);function i(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}t.highlightText=(e,t)=>{let n=0;const s=t.split(/\s+/).filter((e=>e.length>0)).map(i);if(0===s.length)return[e];const r=new RegExp(s.join("|"),"gi"),a=[];for(;;){const t=r.exec(e);if(!t)break;const i=t[0].length,s=e.slice(n,r.lastIndex-i);s.length>0&&a.push(s),n=r.lastIndex,a.push((0,o.jsx)("strong",{children:t[0]},n))}const u=e.slice(n);return u.length>0&&a.push(u),a}},17102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Loader=void 0;const o=n(35250);t.Loader=()=>(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)("svg",{width:"38",height:"38",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:"#007ec6",children:(0,o.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,o.jsxs)("g",{transform:"translate(1 1)",strokeWidth:"2",children:[(0,o.jsx)("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),(0,o.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:(0,o.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})})})},23386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;const o=n(74762);t.logger=(0,o.debugLogger)("editor")},561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadMonaco=void 0;const o=n(51848),i=n(23386);let s=!1;t.preloadMonaco=()=>{s||o.loader.init().then((()=>{(0,i.logger)("monaco preloaded"),s=!0}))}},68120:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHotkeys=t.currentHotkeys=void 0;const i=o(n(45240)),s=n(70079);t.currentHotkeys=new Map,t.useHotkeys=function(e,n,o,r,a){void 0===r&&(r=[]);const u=(0,s.useCallback)((function(){a&&!a.current||n(...arguments)}),[...r,n]);(0,s.useEffect)((()=>((0,i.default)(e,{},u),t.currentHotkeys.set(e,o),()=>{t.currentHotkeys.delete(e),i.default.unbind(e,u)})),[e,u,o])}},94007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeSessionStorage=t.safeLocalStorage=void 0,t.safeLocalStorage={getItem:function(){try{return localStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return localStorage.setItem(...arguments)}catch(e){return null}}},t.safeSessionStorage={getItem:function(){try{return sessionStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return sessionStorage.setItem(...arguments)}catch(e){return null}}}},90680:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocalStorage=t.useResizePref=t.userPreferences=t.useUserPref=void 0;const r=s(n(70079)),a=n(18420),u=n(94007);t.useUserPref=(e,n)=>{const[o,i]=r.useState((()=>{const o=t.userPreferences.getItem(e);return(0,a.isDefined)(o)?o:n}));r.useEffect((()=>{const o=t.userPreferences.getItem(e),s=(0,a.isDefined)(o)?o:n;i(s)}),[e]);return[o,n=>{t.userPreferences.setItem(e,n),i(n)}]},t.userPreferences=(()=>{const e=e=>`up.${e}`;return{getItem:t=>{const n=u.safeLocalStorage.getItem(e(t))||"",o=u.safeSessionStorage.getItem(e(t))||"";try{return JSON.parse(o||n).value}catch(i){return}},setItem:function(t,n,o){void 0===o&&(o=!1);const i=o?sessionStorage:u.safeLocalStorage;try{const o=JSON.stringify({value:n});return i.setItem(e(t),o),!0}catch(s){return console.error("Error saving user preference",s),!1}}}})();t.useResizePref=(e,n)=>{const o=`resize.${e}`;return(0,t.useUserPref)(o,n)};const l=e=>{const t=u.safeLocalStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch(n){return null}};t.useLocalStorage=(e,t)=>{const[n,o]=r.useState(l(e)||t),i=r.useCallback((t=>{u.safeLocalStorage.setItem(e,JSON.stringify({value:t})),o(t)}),[e]);return r.useEffect((()=>{l(e)||u.safeLocalStorage.setItem(e,JSON.stringify({value:t}))}),[e,t,i]),[n,i]}},60190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.totalEnergy=t.itrPhysics=t.hookes=t.coulombs=t.vToStr=t.vNorm=t.vLen=t.vSub=t.vAdd=t.vDiv=t.vMul=t.vZero=t.rnd=t.vec=t.size=void 0;t.size=(e,t)=>({width:e,height:t});t.vec=(e,t)=>({x:e,y:t});t.rnd=function(e,t){return void 0===e&&(e=100),void 0===t&&(t=0),Math.floor(Math.random()*(e-t))+t},t.vZero={x:0,y:0};t.vMul=(e,t)=>{let{x:n,y:o}=e;return{x:n*t,y:o*t}};t.vDiv=(e,n)=>{let{x:o,y:i}=e;return(0,t.vMul)({x:o,y:i},1/n)};t.vAdd=(e,t)=>({x:e.x+t.x,y:e.y+t.y});t.vSub=(e,n)=>(0,t.vAdd)(e,(0,t.vMul)(n,-1));t.vLen=e=>{let{x:t,y:n}=e;return Math.sqrt(t*t+n*n)};t.vNorm=e=>(0,t.vDiv)(e,(0,t.vLen)(e)||1);t.vToStr=e=>{let{x:t,y:n}=e;return`${t.toFixed(1)},${n.toFixed(1)}`};t.coulombs=(e,n,o)=>{const i=(0,t.vLen)((0,t.vSub)(e.p,n.p));if(0===i){const i=(0,t.vec)(2*Math.random()-1,2*Math.random()-1),s=e.m*n.m/Math.pow(10,2);return(0,t.vMul)(i,s*o)}{const s=(0,t.vNorm)((0,t.vSub)(n.p,e.p)),r=e.m*n.m/Math.pow(i+.1,2);return(0,t.vMul)(s,r*o)}};t.hookes=(e,n,o,i,s)=>{const r=(0,t.vLen)((0,t.vSub)(e.p,n.p)),a=(0,t.vNorm)((0,t.vSub)(e.p,n.p));let u=0;return ri&&(u=i-r),(0,t.vMul)(a,s*u)};t.itrPhysics=(e,n)=>{const{p:o,v:i,f:s,m:r}=n,a=(0,t.vDiv)(s,r),u=e/1e3,l=(0,t.vAdd)((0,t.vMul)(a,u),i),c=(0,t.vAdd)((0,t.vMul)(l,u),o);return{...n,p:c,v:l,f:(0,t.vec)(0,0)}};t.totalEnergy=e=>e.reduce(((e,n)=>{const o=(0,t.vLen)(n.v);return e+.5*n.m*o*o}),0)},84472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateToast=t.toastMsg=t.AppToaster=void 0;const o=n(50382);t.AppToaster=(()=>{try{return o.OverlayToaster.create({className:"app-toaster",position:o.Position.BOTTOM_RIGHT})}catch(e){return{}}})();t.toastMsg=(e,n,o)=>t.AppToaster.show({message:e,intent:n,timeout:o});t.updateToast=(e,n,o)=>t.AppToaster.show({message:n,intent:o},e)},18420:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultAnd=t.isLocal=t.fullTime=t.timeAgoFromDt=t.timeAgo=t.toString=t.isDefined=t.set=t.createOmap=t.toOmap=t.values=t.keys=t.entries=void 0;const i=n(7047),s=n(74762),r=o(n(73136));t.entries=e=>Object.keys(e).map((t=>[t,e[t]]));t.keys=e=>Object.keys(e);t.values=e=>Object.keys(e).map((t=>e[t]));t.toOmap=e=>Array.from(e.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.createOmap=function(e){return void 0===e&&(e=[]),e.reduce(((e,t)=>({...e,[t[0]]:t[1]})),{})};t.set=(e,t,n)=>{e[t]=n};t.isDefined=e=>void 0!==e;t.toString=e=>{const t=typeof e;if(""===e)return"(empty string)";if((0,i.isJsxValue)(e))return"JSX Value";if((0,s.isStaticValueVisualNode)(e))return"Embedded Node";if((0,s.isEnvValue)(e))return(0,s.getEnvKeyFromValue)(e);if("object"===t)try{const t=JSON.stringify(e);return"{}"===t?"Empty object":t}catch(n){return"Object (cannot stringify)"}return`${e}`};t.timeAgo=e=>(0,r.default)(new Date(e)).fromNow();t.timeAgoFromDt=e=>(0,r.default)(Date.now()-e).fromNow();t.fullTime=e=>(0,r.default)(new Date(e)).toString();t.isLocal=()=>location.href.includes(":300");t.preventDefaultAnd=e=>t=>{t.preventDefault(),e(t)}},67181:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ActionButton=t.ActionsMenu=t.ActionType=void 0;const r=n(35250),a=n(50382),u=n(50382),l=n(74762),c=s(n(70079)),d=n(86125),p=n(43490),f=n(68120),m=n(90680),v=n(84472),h=n(9971),g=n(47749),I=n(46334),y=n(47230),b=n(41032);var C;!function(e){e.AddNode="add-node",e.RemoveNode="remove-node",e.Group="group",e.UnGroup="un-group",e.AddInlineValue="add-inline-value",e.Inspect="inspect",e.Run="run",e.AI="ai"}(C=t.ActionType||(t.ActionType={}));t.ActionsMenu=e=>{const{onAction:n,selectedInstances:o,resolvedNodes:i,node:s,from:u,to:g,hotkeysEnabled:x,showRunFlowOptions:N}=e,{onRequestImportables:w}=(0,d.useDependenciesContext)(),[j,O]=c.default.useState(!1),[P,E]=c.default.useState(!1),[D,S]=c.default.useState(!1),[M,T]=c.default.useState(null),[k,R]=(0,m.useLocalStorage)("hideHotkeyHintMap",{}),V=(0,c.useCallback)((()=>{O(!1)}),[]),{onRunFlow:A,generateNodeFromPrompt:$,reportEvent:z}=(0,p.usePorts)(),H=(0,c.useCallback)(((e,t)=>(E(!1),A(e,t))),[A]),G=[];if(G.push(C.AddNode),G.push(C.AddInlineValue),1===o.length){const e=s.instances.find((e=>e.id===o[0]));if(e)try{const t=(0,b.safelyGetNodeDef)(e,i);(0,l.isVisualNode)(t)&&G.push(C.UnGroup)}catch(U){console.error(`Could not find node with id ${o[0]} - ${U}`)}else console.error(`Could not find instance with id ${o[0]}`)}N&&G.push(C.Run),o.length>0&&G.push(C.Group),(1===o.length||u||g)&&G.push(C.Inspect),o.length>0&&G.push(C.RemoveNode),G.push(C.AI);const L=(0,c.useCallback)(((e,t)=>{R({...k,[e]:!0}),v.AppToaster.dismiss(t)}),[k,R]),F=(0,c.useCallback)(((e,t)=>{const{hotkey:o}=_[e];if("click"===t.type&&o&&!k[o]){const t=(0,v.toastMsg)((0,r.jsxs)(r.Fragment,{children:["Did you know? you can also use the hotkey"," ",(0,r.jsx)("kbd",{className:"hotkey",children:o})," to"," ",_[e].text.replace(/^[A-Z]/,(e=>e.toLowerCase())),(0,r.jsxs)(a.Button,{minimal:!0,small:!0,onClick:()=>L(o,t),children:[" ","Don't show again"," "]})]}),"none",3e3)}switch(e){case C.AddNode:O(!0);break;case C.Run:!async function(){E(!0)}();break;case C.AI:S(!0);break;default:n({type:e,data:void 0})}}),[k,n,L,s.inputs]);Object.entries(_).forEach((e=>{let[t,n]=e;n.hotkey&&(0,f.useHotkeys)(n.hotkey,(e=>{e.preventDefault(),G.includes(t)&&(F(t,e),R({...k,[n.hotkey]:!0}))}),{text:n.text,group:"Action menu hotkeys"},[G],x)}));const B=(0,c.useCallback)((e=>{n({type:C.AddNode,data:{importableNode:e}})}),[n]),q=(0,c.useCallback)((async e=>{const t=Date.now();T(t);try{z("generateNodeFromPrompt:start",{promptLength:e.length});const o=await $({prompt:e}),{inputs:i,outputs:s}=o.importableNode.node,r=Date.now()-t;z("generateNodeFromPrompt:success",{totalTime:r,inputs:Object.keys(i),outputs:Object.keys(s)}),T(null),n({type:C.AI,data:o}),S(!1)}catch(U){T(null),v.AppToaster.show({message:"Failed to generate node",intent:"danger"}),z("generateNodeFromPrompt:failure",{error:U.message})}}),[$,n,z]);return(0,r.jsxs)("div",{className:"actions-menu",children:[G.map((e=>(0,r.jsx)(t.ActionButton,{type:e,onClick:F},e))),j?(0,r.jsx)(h.AddNodeMenu,{onRequestImportables:w,onAddNode:B,onClose:V}):null,P?(0,r.jsx)(y.RunFlowModal,{onClose:()=>E(!1),onRun:H,node:s}):null,D?(0,r.jsx)(I.PromptAIMenu,{onClose:()=>{S(!1),T(null)},onSubmit:q,submitting:null!==M,submitTime:M}):null]})};const _={[C.AddNode]:{icon:g.addNodeIcon,text:'Open the "add node" menu',hotkey:"a"},[C.RemoveNode]:{icon:g.removeNodeIcon,text:"Remove selected instances",hotkey:"backspace"},[C.Group]:{icon:g.groupIcon,text:"Group selection into a new node",hotkey:"g"},[C.UnGroup]:{icon:g.ungroupIcon,text:"Ungroup selected visual node"},[C.Inspect]:{icon:g.inspectIcon,text:"Inspect data",hotkey:"i"},[C.AddInlineValue]:{icon:g.pencilIcon,text:"Add value / inline function",hotkey:"v"},[C.Run]:{icon:g.playIcon,text:"Run flow",hotkey:"r"},[C.AI]:{icon:g.starIcon,text:"Generate new code node using AI \u2728"}},x={icon:"",text:"N/A",hotkey:void 0};t.ActionButton=e=>{var t;const{onClick:n,type:o}=e,i=(0,c.useCallback)((e=>n(o,e)),[n,o]),s=null!==(t=_[o])&&void 0!==t?t:x,a=s.hotkey?(0,r.jsxs)("span",{children:[s.text," ",(0,r.jsx)("kbd",{className:"hotkey",children:s.hotkey})]}):s.text;return(0,r.jsx)("div",{className:"action-button",onClick:i,"data-type":o,children:(0,r.jsx)(u.Tooltip,{hoverOpenDelay:100,content:a,className:"icon-wrapper",popoverClassName:"action-button-tooltip",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s.icon}})})})}},40149:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenu=t.AddNodeMenuFilterTree=void 0;const a=n(35250),u=n(50382),l=n(74762),c=r(n(26372)),d=s(n(70079)),p=n(43490),f=n(31745),m=n(17102),v=n(87935),h=n(74657),g=n(44470);t.AddNodeMenuFilterTree=u.Tree.ofType();function I(e,t,n){return[...e.external.map((e=>({id:e.module,label:e.module,hasCaret:!0,nodeData:{type:"external",module:e.module},isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module,isExpanded:n.has(e.module),childNodes:e.namespaces.map((o=>({id:`${e.module}/${o}`,label:o,hasCaret:!1,isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module&&t.namespace===o,isExpanded:n.has(`${e.module}/${o}`),nodeData:{type:"external",module:e.module,namespace:o}})))}))),{id:"internal",label:"Current Project",nodeData:{type:"internal"},isExpanded:n.has("internal"),hasCaret:!0,isSelected:"internal"===t.type,childNodes:e.internal.files.map((e=>({id:e,label:e,isSelected:"internal"===t.type&&t.file===e,hasCaret:!1,isExpanded:n.has(e),nodeData:{type:"internal",file:e}})))}]}function y(e){return/\.flyde(\.[jt]s)?$/.test(e.module)}t.AddNodeMenu=e=>{const{onRequestImportables:n,onAddNode:o,onClose:i}=e,[s,r]=d.default.useState(),[b,C]=d.default.useState([]),[_,x]=d.default.useState(new Set),[N,w]=d.default.useState(""),[j,O]=d.default.useState({type:"all"}),[P,E]=d.default.useState(null),[D,S]=d.default.useState(null),[M,T]=d.default.useState(null),k=(0,d.useCallback)((e=>{_.add(e.id),x(new Set(_))}),[_]),R=(0,d.useCallback)((e=>{_.delete(e.id),x(new Set(_))}),[_]),V=(0,d.useCallback)((e=>{o(e),i()}),[o,i]),{onInstallRuntimeRequest:A,reportEvent:$}=(0,p.usePorts)();(0,d.useEffect)((()=>{$("addNodeMenuOpen",{})}),[$]),(0,d.useEffect)((()=>{S(null==s?void 0:s.flatMap((e=>{var t,n,o;if(j)if("external"===j.type){if((e.module!==j.module||j.namespace)&&e.node.namespace!==j.namespace)return[]}else if("internal"===j.type&&(!y(e)||j.file&&e.module!==j.file))return[];if(N){const i=`${null!==(n=null===(t=e.node.searchKeywords)||void 0===t?void 0:t.join(" "))&&void 0!==n?n:[]} ${e.node.id} ${null!==(o=e.node.namespace)&&void 0!==o?o:""} ${e.node.description}`.toLowerCase().indexOf(N.toLowerCase());return-1===i?[]:[{importable:e,score:i}]}return[{importable:e,score:1}]})).sort(((e,t)=>e.score-t.score)).map((e=>{let{importable:t}=e;return t})))}),[s,j,N]),(0,d.useEffect)((()=>{n().then((e=>{let{importables:t,errors:n}=e;C(n);const o=t.filter((e=>!y(e))).reduce(((e,t)=>{var n,o,i;null!==(n=e[i=t.module])&&void 0!==n||(e[i]=[]);const s=null!==(o=t.node.namespace)&&void 0!==o?o:"";return e[t.module].includes(s)||e[t.module].push(s),e}),{}),i=t.filter(y).map((e=>e.module));E({external:Object.entries(o).map((e=>{let[t,n]=e;return{module:t,namespaces:n}})),internal:{files:i}}),r(t),x(new Set(["internal",...Object.keys(o)]))}))}),[n]);const z=(0,d.useCallback)((e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),D&&!M)return void T(D["ArrowDown"===e.key?0:D.length-1]);if(D&&M){const t=D.findIndex((e=>e===M));let n="ArrowDown"===e.key?t+1:t-1;n=n<0?D.length-1:n,n=n>=D.length?0:n,T(D[n])}break;case"Enter":M&&V(M)}}),[D,M,V]),H=(0,d.useCallback)((e=>{let{nodeData:t}=e;JSON.stringify(t)===JSON.stringify(j)?"external"===t.type?t.namespace?O({type:"external",module:t.module}):O({type:"all"}):"internal"===t.type&&(t.file?O({type:"internal"}):O({type:"all"})):O(t)}),[j]),G=!s||s.some((e=>e.module.includes("@flyde/stdlib"))),L=(0,d.useCallback)((()=>{A(),i()}),[i,A]);return(0,a.jsx)(u.Dialog,{isOpen:!0,title:"Add Node Menu",onClose:e.onClose,className:"add-node-menu",isCloseButtonShown:!0,children:(0,a.jsxs)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),children:[(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"bp5-input-group",children:[(0,a.jsx)(g.Search,{}),(0,a.jsx)("input",{className:"bp5-input",type:"search",placeholder:"Search input",dir:"auto",autoFocus:!0,onChange:e=>w(e.target.value),value:N,onKeyDown:z})]}),G?null:(0,a.jsxs)(u.Callout,{intent:u.Intent.NONE,style:{marginTop:10},children:["Using built-in @flyde/stdlib. It's recommended to explicitly install it instead."," ",(0,a.jsx)(u.Button,{minimal:!0,small:!0,intent:u.Intent.PRIMARY,onClick:L,children:"Click here to install it using npm/yarn"})]})]}),(0,a.jsx)("div",{className:"content-wrapper",children:s?(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsxs)("aside",{children:[(0,a.jsxs)("div",{className:"filter-header",children:["Filter by package"," ",(0,a.jsx)(u.Tooltip,{content:(0,a.jsxs)("span",{children:["Click to learn more about how packages work in Flyde"," "]}),hoverCloseDelay:1500,children:(0,a.jsx)("a",{target:"_blank",href:"https://www.flyde.dev/docs/packages",rel:"noreferrer",children:(0,a.jsx)(u.Icon,{icon:(0,a.jsx)(g.Help,{}),intent:"primary",iconSize:12})})})]}),(0,a.jsx)("div",{className:"tree-container",children:(0,a.jsx)(t.AddNodeMenuFilterTree,{contents:I(P,j,_),onNodeCollapse:R,onNodeExpand:k,onNodeClick:H,className:u.Classes.ELEVATION_0})})]}),(0,a.jsx)("main",{children:D?0===D.length?(0,a.jsxs)("div",{className:"no-results",children:[(0,a.jsx)(h.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:O,query:N,onChangeQuery:w,resultsCount:D.length}),(0,a.jsxs)(u.Callout,{className:"callout",intent:"primary",children:["Can't find a suitable node? Create one yourself!"," ",(0,a.jsx)("a",{href:"https://www.flyde.dev/docs/code-nodes",target:"_blank",rel:"noreferrer",children:"Learn more"})]})]}):(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsx)(h.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:O,query:N,onChangeQuery:w,resultsCount:D.length}),(0,a.jsx)("div",{className:"results",children:D.map((e=>(0,a.jsx)(v.AddNodeMenuListItem,{importableNode:e,onAdd:V,selected:(null==M?void 0:M.node)===e.node,onSelect:T,onSetFilter:O},e.node.id+e.node.namespace+e.module)))})]}):(0,a.jsx)(m.Loader,{})})]}):(0,a.jsx)(m.Loader,{})}),b.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",style:{marginTop:"10px"},children:["Found ",(0,l.simplePluralize)(b.length,"corrupt flow"),(0,a.jsx)(f.InfoTooltip,{content:b.map((e=>{let{path:t,message:n}=e;return`${t}: ${n}`})).join(", ")})," "]}):null]})})}},8470:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuListItem=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079));t.AddNodeMenuListItem=e=>{const{importableNode:t,onSetFilter:n,onAdd:o,onSelect:i}=e,{node:s,module:r}=t,{id:d,description:p}=s,f=c.default.useRef(null);c.default.useEffect((()=>{e.selected&&f.current&&f.current.scrollIntoView({block:"center"})}),[e.selected]);const m=(0,c.useCallback)((()=>{o(t)}),[o,t]),v=(0,c.useCallback)((()=>{i(t)}),[i,t]);return(0,a.jsxs)("div",{className:(0,l.default)("add-node-menu-list-item",{selected:e.selected}),ref:f,onClick:v,children:[(0,a.jsxs)("div",{className:"content",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("span",{className:"id",children:d}),(0,a.jsxs)(u.Tag,{interactive:!0,onClick:()=>n({type:"external",module:r,namespace:s.namespace}),className:"source",minimal:!0,children:[r,s.namespace?` / ${s.namespace}`:null]})]}),(0,a.jsx)("div",{className:"description",children:p||(0,a.jsx)("em",{children:"No description"})})]}),(0,a.jsx)("aside",{children:(0,a.jsx)(u.Button,{onClick:m,children:"Add"})})]})}},87935:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8470),t)},88671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuResultsSummary=void 0;const o=n(35250),i=n(50382);t.AddNodeMenuResultsSummary=e=>{const{resultsCount:t,query:n,filter:s,onChangeFilter:r,onChangeQuery:a}=e;return(0,o.jsxs)("div",{className:"add-node-menu-results-summary",children:[t?`Showing ${t} result${t>1?"s":""}`:"No results found","\xa0",n?(0,o.jsxs)(o.Fragment,{children:["matching query\xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>a(""),children:['"',n,'"']})]}):null,"all"===s.type?null:"external"===s.type?(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["package ",s.module,s.namespace?` / ${s.namespace}`:null]})]}):(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["\xa0this project ",s.file?` / ${s.file}`:null]})]})]})}},74657:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88671),t)},9971:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40149),t)},83159:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PromptAIMenu=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=1e4;t.PromptAIMenu=e=>{const{onClose:t}=e,[n,o]=c.default.useState(""),[i,s]=c.default.useState(0);return(0,c.useEffect)((()=>{s(0);const t=setInterval((()=>{s((t=>{const n=(Date.now()-e.submitTime)/d;return Math.min(n+.05*Math.random()/2,.95)}))}),500);return()=>clearInterval(t)}),[e.submitTime]),(0,a.jsxs)(u.Dialog,{isOpen:!0,onClose:t,className:"prompt-ai-menu",title:"\u2728 Generate Code Node using AI",children:[(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsx)(u.TextArea,{value:n,disabled:e.submitting,onChange:e=>o(e.target.value),placeholder:"Describe your node in details",fill:!0})}),e.submitTime?(0,a.jsx)("div",{className:"progress-bar-container",children:(0,a.jsx)(u.ProgressBar,{value:i})}):null,(0,a.jsx)("div",{className:u.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:u.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(u.Button,{onClick:t,children:"Close"}),(0,a.jsx)(u.Button,{intent:u.Intent.PRIMARY,className:"run-btn",disabled:e.submitting||!n,loading:e.submitting,onClick:()=>{s(0),e.onSubmit(n)},children:"Create \u2728"})]})})]})}},46334:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(83159),t)},3152:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RunFlowModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(90680),f=n(31745);t.RunFlowModal=u.memo((function(e){const{onRun:t,onClose:n,node:o}=e,[i,s]=u.useState(0),[r,m]=(0,p.useLocalStorage)(`run-inputs-${o.id}`,Object.keys(o.inputs).reduce(((e,t)=>(e[t]=`Enter a value for input ${t}`,e)),{})),[v,h]=u.useState(JSON.stringify(r,null,2)),g=e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})},I=u.useCallback((()=>{const e=JSON.parse(v);m(e),t(e,i)}),[t,m,v,i]),y=Object.keys(o.inputs),b=y.filter((e=>"required"!==o.inputs[e].mode)),C=u.useMemo((()=>y.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:"This node receives external inputs. Enter values for each input below:"}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"json",value:v,onChange:e=>h(null!=e?e:""),onMount:g}),b.length>0?(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Note: input(s) ",(0,a.jsx)("code",{children:b.join(", ")})," are optional"]}):null]}):(0,a.jsx)("strong",{children:"This node does not receive any external inputs."})),[y.length,b,v]);return(0,a.jsxs)(c.Dialog,{isOpen:!0,onClose:e.onClose,className:"run-flow-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&I()},tabIndex:0,children:[C,(0,a.jsxs)("div",{className:"execution-delay-wrapper",children:[(0,a.jsxs)("label",{children:["Execution delay:"," ",(0,a.jsx)(f.InfoTooltip,{content:"Delay between each node execution. Useful for debugging."})]}),(0,a.jsx)(c.Slider,{value:i,onChange:s,min:0,labelStepSize:500,stepSize:100,labelRenderer:e=>`${e}ms`,max:1e3})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:n,children:"Close"}),(0,a.jsx)(c.Button,{onClick:I,intent:c.Intent.PRIMARY,className:"run-btn",children:"Run"})]})})]})}))},47230:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3152),t)},47749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starIcon=t.stopIcon=t.playIcon=t.pencilIcon=t.ungroupIcon=t.groupIcon=t.inspectIcon=t.removeNodeIcon=t.addNodeIcon=void 0,t.addNodeIcon='\n\n',t.removeNodeIcon='\n\n',t.inspectIcon='\n\n\n',t.groupIcon='\n\n\n',t.ungroupIcon='\n\n\n',t.pencilIcon='\n\n',t.playIcon='\n\n\n',t.stopIcon='\n\n\n',t.starIcon='\n\n\n\n\n'},1237:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HelpBubble=void 0;const i=n(70079),s=n(35250),r=n(50382),a=n(99489),u=n(50382),l=o(n(70079)),c=n(68120),d=n(71644),p=n(43490),f={offset:{enabled:!0,options:{offset:[0,20]}},preventOverflow:{enabled:!0,options:{padding:10}}};const m=["Viewport Controls","Editing","Selection"];t.HelpBubble=()=>{const[e,t]=l.default.useState(!1),n=Array.from(c.currentHotkeys.entries()).map((e=>{let[t,n]=e;return{combo:(o={key:t,menuData:n}).key,label:o.menuData.text,group:o.menuData.group};var o})).reduce(((e,t)=>(e[t.group]||(e[t.group]=[]),e[t.group].push(t),e)),{}),o=Object.entries(n).sort(((e,t)=>m.indexOf(t[0])-m.indexOf(e[0]))),{reportEvent:v}=(0,p.usePorts)(),h=(0,s.jsx)(r.Dialog,{isOpen:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:r.Classes.DIALOG_BODY,children:o.map((e=>{let[t,n]=e;return(0,s.jsxs)(l.default.Fragment,{children:[(0,s.jsx)(r.H4,{children:t}),n.map((e=>(0,i.createElement)(a.Hotkey,{...e,key:e.combo})))]},t)}))})}),g=(0,s.jsxs)(r.Menu,{children:[(0,s.jsx)(r.MenuItem,{text:"Hotkeys",onClick:()=>{t(!0),v("helpMenuItem",{item:"hotkeys"})}}),(0,s.jsx)(r.MenuItem,{text:"Documentation",onClick:()=>v("helpMenuItem",{item:"documentation"}),href:"https://www.flyde.dev/docs",target:"_blank"}),(0,s.jsx)(r.MenuDivider,{}),(0,s.jsx)(r.MenuItem,{text:"Discord",onClick:()=>v("helpMenuItem",{item:"discord"}),href:"https://discord.gg/x7t4tjZQP8",target:"_blank"})]});return(0,s.jsxs)("div",{className:"help-bubble","data-tip":"Help",children:[(0,s.jsx)(u.Popover,{content:g,modifiers:f,onOpened:()=>v("helpMenuOpen",{}),children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:d.helpIcon}})}),h]})}},71644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpIcon=void 0,t.helpIcon='\n\n\n'},3354:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1237),t)},7011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainInstanceEventsIndicator=void 0;const o=n(35250),i=n(30994),s=n(66189),r=n(50382);t.MainInstanceEventsIndicator=e=>{const{currentInsId:t,ancestorsInsIds:n}=e,{history:a,refreshHistory:u,resetHistory:l}=(0,s.useHistoryHelpers)(t),c=`main-indicator-${t}}`;return(0,o.jsx)("div",{className:"main-instance-events-indicator",children:(0,o.jsx)(r.Tooltip,{content:(0,s.calcHistoryContent)(a),children:(0,o.jsx)("span",{onMouseEnter:u,onMouseOut:l,id:(0,i.getMainInstanceIndicatorDomId)(t,n),className:"status-text","data-tip":"","data-html":!0,"data-for":c})})})}},22714:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7011),t)},63521:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VisualNodeEditor=t.defaultBoardData=t.defaultViewPort=t.NODE_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=n(74762),c=n(86553),d=n(65082),p=n(18420),f=n(26701),m=n(7047),v=n(53865),h=n(70079),g=n(68120),I=r(n(27942)),y=n(50382),b=n(66005),C=n(60190),_=n(71033),x=n(74762),N=n(99942),w=n(44338),j=n(561),O=n(84472),P=n(82232),E=n(18594),D=n(68371),S=r(n(61888)),M=n(65758),T=n(43490),k=r(n(26372)),R=n(25044),V=n(80510),A=n(1788),$=n(2130),z=n(88593),H=n(97106),G=n(67181),L=n(22714),F=n(3354),B=n(41032),q=n(30653),U=u.memo(y.Slider),W=()=>null;t.NODE_HEIGHT=28;t.defaultViewPort={pos:{x:0,y:0},zoom:1},t.defaultBoardData={selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}},t.VisualNodeEditor=u.memo(u.forwardRef(((e,n)=>{const{onChangeNode:o,nodeIoEditable:i,onCopy:s,onGoToNodeDef:r,onInspectPin:J,boardData:Y,onChangeBoardData:K,currentInsId:Q,ancestorsInsIds:X,node:ee,onShowOmnibar:te,resolvedDependencies:ne,queuedInputsData:oe,initialPadding:ie,disableScrolling:se}=e,{onImportNode:re}=(0,H.useDependenciesContext)(),ae=(0,q.useDarkMode)(),{reportEvent:ue}=(0,T.usePorts)(),le=e.parentViewport||t.defaultViewPort,[ce,de]=(0,h.useState)({...ne,[ee.id]:ee});(0,h.useEffect)((()=>{de({...ne,[ee.id]:ee})}),[ne,ee]);const{selected:pe,from:fe,to:me}=Y,{instances:ve,connections:he,inputsPosition:ge,outputsPosition:Ie,inputs:ye,outputs:be}=ee,[Ce,_e]=(0,h.useState)(),[xe,Ne]=(0,h.useState)(),we=void 0===X,[je,Oe]=(0,h.useState)(0),[Pe,Ee]=(0,h.useState)(),[De,Se]=(0,h.useState)(!1),[Me,Te]=(0,h.useState)(),[ke,Re]=(0,h.useState)(),[Ve,Ae]=(0,h.useState)(),[$e,ze]=(0,h.useState)(),He=(0,h.useRef)();(0,f.useDidMount)((()=>{He.current=Xe.current.querySelector(".inline-editor-portal-root")}));const Ge=(0,T.useConfirm)(),Le=(0,T.usePrompt)(),Fe=Y.viewPort,Be=(0,h.useRef)(!0),[qe,Ue]=(0,h.useState)(null),We=u.useCallback((e=>{K({viewPort:e})}),[K]),Ze=u.useCallback(((e,t)=>J(e,t)),[J]),Je=u.useCallback(((e,t,n)=>{const i=(0,V.handleConnectionCloseEditorCommand)(ee,{from:e,to:t}),s=(0,l.isInternalConnectionNode)(t)?ve.find((e=>e.id===t.insId)):null,r=(s?s.inputConfig:{})[t.pinId],a=(0,l.isStaticInputPinConfig)(r)?(0,A.handleDetachConstEditorCommand)(i,t.insId,t.pinId):i;o(a,(0,P.functionalChange)("close-connection")),K({from:void 0,to:void 0}),ue("createConnection",{source:n})}),[ve,o,K,ee,ue]),Ye=u.useCallback((async()=>{const e=await Le("New visual node name?");if(!e)return;const{currentNode:t}=await(0,M.groupSelected)(Y.selected,ee,e,"inline",Le);o(t,(0,P.functionalChange)("group node")),(0,O.toastMsg)("Node grouped"),ue("groupSelected",{count:Y.selected.length})}),[Le,Y.selected,o,ee,ue]);(0,h.useEffect)((()=>{if(Pe){const e=setTimeout((()=>{Ee(void 0)}),350);return()=>clearTimeout(e)}}),[Pe]);const[Ke,Qe]=(0,h.useState)();(0,h.useEffect)((()=>{(0,j.preloadMonaco)()}),[]);const Xe=(0,h.useRef)(),et=(0,I.default)(Xe),tt=u.useRef({x:400,y:400}),nt=(0,f.useBoundingclientrect)(Xe)||C.vZero,ot=()=>{const e=(0,m.fitViewPortToNode)(ee,ce,et);(0,m.animateViewPort)(Fe,e,500,(e=>{We(e)}))},it=u.useCallback(((e,t)=>{const{to:n,from:o}=Y,i="input"===t?o:n,s="input"===t?n:o,r={pinId:e,insId:l.THIS_INS_ID},a="input"===t?{from:r}:{to:r};i&&i.pinId===e?K({from:void 0,to:void 0}):s?"input"===t&&n?Je(r,n,"nodeIoClick"):o&&Je(o,r,"nodeIoClick"):K(a)}),[Y,K,Je]),st=u.useCallback(((e,t,n)=>{const i=(0,v.produce)(ee,(o=>{"input"===e?o.inputs[t].description=n:o.outputs[t].description=n}));o(i,(0,P.functionalChange)("Node io description"))}),[o,ee]),rt=u.useCallback(((e,t,n)=>{const{from:o,to:i}=Y;if(fe&&fe.insId===e.id||me&&me.insId===e.id)K({from:void 0,to:void 0});else if("input"===n){const n={insId:e.id,pinId:t};!i||i.pinId!==t||(0,l.isInternalConnectionNode)(i)&&i.insId!==e.id?fe?Je(fe,n,"pinClick"):K({to:n,selected:[]}):K({to:void 0})}else{const n={insId:e.id,pinId:t};!o||o.pinId!==t||(0,l.isInternalConnectionNode)(o)&&o.insId!==e.id?me?Je(n,me,"pinClick"):K({from:n,selected:[]}):K({from:void 0})}}),[Y,fe,K,Je,me]);(0,h.useEffect)((()=>{if(!De&&et.width){const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);We(t);const n=setTimeout((()=>{const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);e.thumbnailMode||We(t),Se(!0)}),100);return()=>clearTimeout(n)}}),[ee,ie,et,e.thumbnailMode,De,ce,We]);const at=u.useCallback((()=>{const{selected:e}=Y,t=ee.instances.filter((t=>e.includes(t.id))).map((e=>({...e,id:e.id+"-copy"}))),n=ee.connections.filter((t=>{let{from:n,to:o}=t;return e.includes(n.insId)&&e.includes(o.insId)}));s({instances:t,connections:n})}),[Y,s,ee]),ut=u.useCallback((()=>{const{newNode:t,newInstances:n}=(0,R.pasteInstancesCommand)(ee,tt.current,e.clipboardData);o(t,(0,P.functionalChange)("paste instances")),K({selected:n.map((e=>e.id))})}),[o,K,ee,e.clipboardData]),lt=u.useCallback((()=>{const e=ee.id;Ke?"input"===Ke.type?Ke.ins.id===e?it(Ke.pin,"input"):rt(Ke.ins,Ke.pin,"input"):Ke.ins.id===e?it(Ke.pin,"output"):rt(Ke.ins,Ke.pin,"output"):console.warn("tried selecting closest with no pin nearby")}),[ee.id,Ke,it,rt]),ct=u.useCallback(((e,t)=>{const n=Math.min(Math.max(e,.1),3),o="mouse"===t?tt.current:{x:Fe.pos.x+et.width/2,y:Fe.pos.y+et.height/2},i=(0,m.centerBoardPosOnTarget)(o,et,n,Fe);We({...Fe,zoom:n,pos:i})}),[We,Fe,et]);(0,g.useHotkeys)("cmd+=",(e=>{ct(Fe.zoom+.1,"hotkey"),e.preventDefault()}),{text:"Zoom in board",group:"Viewport Controls"},[Fe,ct],Be),(0,g.useHotkeys)("cmd+-",(e=>{ct(Fe.zoom-.1,"hotkey"),e.preventDefault()}),{text:"Zoom out board",group:"Viewport Controls"},[ct,Fe.zoom],Be),(0,g.useHotkeys)("cmd+o",(e=>{e.preventDefault(),(0,O.toastMsg)("Ordering");const t=[];(0,N.orderVisualNode)(ee,ce,200,((e,n)=>{n%3==0&&t.push(e)})),(async()=>{for(;t.length;){const e=t.shift();(0,O.toastMsg)(`Step ${t.length}!`),await(0,l.delay)(200),o(e,(0,P.metaChange)("order-step")),(0,O.toastMsg)(`Step ${t.length}! done`)}})()}),{text:"Auto-layout (experimental)",group:"Misc."},[o,ee,ne],Be),(0,g.useHotkeys)("cmd+0",(e=>{ct(1),e.preventDefault()}),{text:"Reset zoom",group:"Viewport Controls"},[Fe,ct],Be);const dt=()=>{K({from:void 0,to:void 0,selected:[]})},pt=u.useCallback(((e,t)=>{_e(e.id),o({...ee},(0,P.metaChange)("drag-start"))}),[o,ee]),ft=u.useCallback(((e,t,n)=>{const{newValue:i,newSelected:s}=(0,m.handleInstanceDrag)(ee,e,n,t,pe,Ce);o(i,(0,P.metaChange)("drag-move")),s&&K({selected:s})}),[Ce,o,K,pe,ee]),mt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(void 0)}),[]),vt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(l.THIS_INS_ID)}),[]),ht=u.useCallback((async(t,n,o,i)=>{o.preventDefault(),o.stopPropagation();const{x:s,y:r}=i,a=(0,v.produce)(ee,(e=>{"input"===t?e.inputsPosition[n]={x:s,y:r}:e.outputsPosition[n]={x:s,y:r}}));e.onChangeNode(a,(0,P.metaChange)("node-io-drag-move"))}),[e,ee]),gt=u.useCallback((async(e,t,n,o)=>{n.preventDefault(),n.stopPropagation(),_e(void 0)}),[]),It=u.useCallback(((e,t)=>{let{id:n}=e;const o=t.shiftKey?pe.filter((e=>e!==n)):[],i=t.shiftKey?[...pe,n]:[n],s=pe.includes(n)?o:i;K({selected:s,from:void 0,to:void 0})}),[K,pe]),yt=u.useCallback((()=>{const e=ee.instances.map((e=>e.id));K({selected:e,from:void 0,to:void 0})}),[K,ee.instances]),bt=u.useCallback((e=>{const t=he.filter((t=>{let{from:n,to:o}=t;return-1===e.indexOf(n.insId)&&-1===e.indexOf(o.insId)})),n=(0,v.produce)(ee,(n=>{n.connections=t,n.instances=n.instances.filter((t=>!e.includes(t.id)))}));K({selected:[]}),o(n,(0,P.functionalChange)("delete-ins"))}),[he,o,K,ee]),Ct=u.useCallback((e=>{bt([e.id])}),[bt]),_t=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{"input"===e?(delete n.inputs[t],n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===t)))):(n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===t))),n.completionOutputs=(n.completionOutputs||[]).map((e=>e.split("+").filter((e=>e!==t)).join("+"))).filter((e=>!!e)),delete n.outputs[t])}));fe&&fe.insId===l.THIS_INS_ID&&fe.pinId===t?K({from:void 0}):me&&me.insId===l.THIS_INS_ID&&me.pinId===t&&K({to:void 0}),o(n,(0,P.functionalChange)("remove io pin"))}),[ee,fe,me,o,K]),xt=u.useCallback((async()=>{const{selected:e,from:t,to:n}=Y;0===e.length?t&&(0,l.isExternalConnectionNode)(t)?await Ge(`Are you sure you want to remove main input ${t.pinId}?`)&&_t("input",t.pinId):n&&(0,l.isExternalConnectionNode)(n)&&await Ge(`Are you sure you want to remove main output ${n.pinId}?`)&&_t("output",n.pinId):bt(e)}),[Ge,Y,bt,_t]),Nt=u.useCallback(((e,t,n)=>{const i=(0,m.getInstancePinConfig)(ee,e.id,t),s=(0,l.isStickyInputPinConfig)(i)?(0,x.queueInputPinConfig)():(0,l.stickyInputPinConfig)();o((0,m.changePinConfig)(ee,e.id,t,s),(0,P.functionalChange)("toggle-sticky")),ue("togglePinSticky",{isSticky:(0,l.isStickyInputPinConfig)(s)})}),[o,ee,ue]),wt=u.useCallback((()=>{const{newNode:e,newInstances:t}=(0,$.handleDuplicateSelectedEditorCommand)(ee,pe);o(e,(0,P.functionalChange)("duplicated instances")),K({selected:t.map((e=>e.id))})}),[o,K,ee,pe]),jt=u.useCallback((e=>{const t=e.nativeEvent.target;if(0===e.button&&Z(e.nativeEvent,ee.id)&&t&&"board-editor-inner"===t.className){if(Date.now()-je<300)return void te(e);Oe(Date.now());const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,nt),o=(0,m.domToViewPort)(n,Fe,le);Ne({from:o,to:o})}}),[ee.id,Fe,je,nt,le,te]),Ot=u.useCallback((e=>{if(Ue(null),Z(e.nativeEvent,ee.id)&&xe){if((0,m.calcSelectionBoxArea)(xe)>50){const t=(0,m.getInstancesInRect)(xe,ce,Fe,Kt.current,ee.instances,nt,le),n=e.shiftKey?[...pe,...t]:t;K({selected:n})}Ne(void 0)}}),[ee.id,ee.instances,xe,ce,Fe,nt,le,pe,K]),Pt=u.useCallback((e=>{if(!Z(e.nativeEvent,ee.id))return void(Be.current=!1);Be.current=!0;const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,(0,C.vAdd)(nt,C.vZero)),o=(0,m.domToViewPort)(n,Fe,le);xe&&Ne({...xe,to:o});const i=(0,m.findClosestPin)(ee,ce,n,nt,Q,X,Fe),s=Ke;if(i){(!s||s.ins!==i.ins||s.ins===i.ins&&s.pin!==i.pin)&&Qe({ins:i.ins,type:i.type,pin:i.id})}tt.current=o,K({lastMousePos:tt.current})}),[ee,nt,Fe,le,xe,ce,Q,X,Ke,K]),Et=u.useCallback((e=>{var t;"bp5-menu"!==(null===(t=e.relatedTarget)||void 0===t?void 0:t.className)&&(Qe(void 0),Be.current=!1)}),[]),Dt=u.useCallback(((e,t)=>{if(t){const t=(0,l.isInlineNodeInstance)(e)?e.node:(0,B.safelyGetNodeDef)(e.nodeId,ce);if(!t)throw new Error("Impossible state inspecting inexisting node");if(!(0,l.isVisualNode)(t))return void(0,O.toastMsg)("Cannot inspect a non visual node","warning");ze({insId:`${Q}.${e.id}`,node:t})}else if((0,l.isRefNodeInstance)(e)){const t=(0,B.safelyGetNodeDef)(e,ce);r(t)}else{const t=e.node;if(!(0,l.isInlineValueNode)(t))return void((0,l.isVisualNode)(t)?ze({insId:e.id,node:t}):(0,O.toastMsg)("Editing this type of node is not supported"));const n=atob(t.dataBuilderSource);Ae({insId:e.id,templateType:t.templateType,value:n,type:"existing"}),(0,O.toastMsg)("Editing inline visual node not supported yet")}}),[r,ce,Q]),St=u.useCallback((e=>{if((0,l.isInlineNodeInstance)(e)){const t=e.node;if(!(0,l.isVisualNode)(t))return void(0,O.toastMsg)("Not supported","warning");const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.filter((t=>t.id!==e.id)),n.connections=n.connections.filter((t=>{let{from:n,to:o}=t;return n.insId!==e.id&&o.insId!==e.id})),n.instances.push(...t.instances),n.connections.push(...t.connections.filter((e=>(0,l.isInternalConnectionNode)(e.from)&&(0,l.isInternalConnectionNode)(e.to))))}));o(n,{type:"functional",message:"ungroup"}),K({selected:[]})}else{const t=(0,B.safelyGetNodeDef)(e.nodeId,ce);if(!(0,l.isVisualNode)(t))return void(0,O.toastMsg)("Not supported","warning")}}),[ee,o,K,ce]),Mt=u.useCallback((async e=>{}),[]),Tt=u.useCallback(((e,t)=>{const n=(0,A.handleDetachConstEditorCommand)(ee,e.id,t);o(n,(0,P.functionalChange)("detach-const"))}),[o,ee]),kt=u.useCallback(((e,t)=>{const n=e.inputConfig[t]||(0,x.queueInputPinConfig)();(0,l.isStaticInputPinConfig)(n)&&(Re(n.value),O.AppToaster.show({message:"Value copied"}))}),[]),Rt=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{const o=n.instances.find((t=>t.id===e.id));if(!o)throw new Error("Impossible state");o.inputConfig[t]=(0,l.staticInputPinConfig)(ke),n.connections=n.connections.filter((n=>!(0,l.isInternalConnectionNode)(n.to)||!(n.to.insId===e.id&&n.to.pinId===t)))}));o(n,(0,P.functionalChange)("paste const value"))}),[ee,o,ke]),Vt=u.useCallback((async e=>{const t=await Le("New name?");if(!t)return;const n=(0,v.produce)(ee,(n=>{var o;"input"===e?(ee.inputs||(n.inputs={}),n.inputs[t]=(0,l.nodeInput)(),n.inputsPosition[t]=tt.current):(ee.outputs||(n.outputs={}),n.outputs[t]=(0,l.nodeOutput)(),n.outputsPosition[t]=tt.current,(null===(o=n.completionOutputs)||void 0===o?void 0:o.length)&&(0,O.toastMsg)("Note that this node has explicit completion outputs set. You may need to update them."))}));o(n,(0,P.functionalChange)("add new io pin")),ue("addIoPin",{type:e})}),[Le,ee,o,ue]),At=u.useCallback((async()=>{var e;const t=null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","),n=await Le("Edit completion outputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,v.produce)(ee,(e=>{e.completionOutputs=""===n?void 0:n.split(",")}));o(e,(0,P.functionalChange)("change node completions")),ue("editCompletionOutputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),$t=u.useCallback((async()=>{var e;const t=null===(e=ee.reactiveInputs)||void 0===e?void 0:e.join(","),n=await Le("Edit reactive inputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,v.produce)(ee,(e=>{e.reactiveInputs=""===n?void 0:n.split(",")}));o(e,(0,P.functionalChange)("change reactive inputs")),ue("editReactiveInputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),zt=u.useCallback((async()=>{const e=await Le("Description?",ee.description),t=(0,v.produce)(ee,(t=>{t.description=e}));o(t,(0,P.functionalChange)("Edit node description"))}),[Le,o,ee]),Ht=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{t.defaultStyle=e}));o(t,(0,P.functionalChange)("change default style")),ue("changeStyle",{isDefault:!0})}),[o,ee,ue]),Gt=u.useCallback((async(e,t)=>{const n=await Le("New name?",t)||t,i=(0,m.handleIoPinRename)(ee,e,t,n);o(i,(0,P.functionalChange)("rename io pin"))}),[ee,o,Le]),Lt=u.useCallback(((e,t)=>{const n=(0,m.handleChangeNodeInputType)(ee,e,t);o(n,(0,P.functionalChange)("toggle io pin optional"))}),[ee,o]),Ft=u.useCallback((e=>{switch(e.type){case G.ActionType.RemoveNode:{const e=(0,v.produce)(ee,(e=>{if(!(0,l.isVisualNode)(ee))throw new Error("Impossible state, deleting instances opf non visual node");e.instances=e.instances.filter((e=>!pe.includes(e.id))),e.connections=e.connections.filter((e=>!pe.includes(e.from.insId)&&!pe.includes(e.to.insId)))}));K({selected:[]}),o(e,(0,P.functionalChange)("remove-instances")),(0,O.toastMsg)(`Removed ${pe.length} instances(s)`),ue("deleteInstances",{count:pe.length});break}case G.ActionType.Inspect:if(1===pe.length)J(pe[0]);else if(fe||me){const e=null!=fe?fe:me,t=(0,l.isExternalConnectionNode)(e)?l.ROOT_INS_ID:e.insId;J(t,{type:fe?"output":"input",id:e.pinId})}ue("openInspectMenu",{source:"actionMenu"});break;case G.ActionType.Group:(async()=>{await Ye()})();break;case G.ActionType.UnGroup:{const e=ee.instances.find((e=>e.id===pe[0]));St(e);const t=(0,B.safelyGetNodeDef)(e,ce);(0,O.toastMsg)(`Ungrouped inline node ${t.id}`),ue("unGroupNode",{instancesCount:t.instances.length});break}case G.ActionType.AddInlineValue:Ae({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"actionMenu"});break;case G.ActionType.AddNode:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,v.produce)(ee,(e=>{e.instances.push(r)})),u=(0,v.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,P.functionalChange)("add new instance")),K(u),(0,O.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;case G.ActionType.AI:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,v.produce)(ee,(e=>{e.instances.push(r)})),u=(0,v.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,P.functionalChange)("add new instance")),K(u),(0,O.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;default:(0,O.toastMsg)(`${e.type} not supported yet`)}}),[Y,fe,o,K,Ye,re,J,St,ee,ce,ue,pe,me,Fe,et]),Bt=()=>{const t=Y.from;return(0,p.entries)(ye).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"input",pos:ge[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,onDblClick:Zt,closest:!(!Ke||"input"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,inputMode:s.mode,onChangeInputMode:Lt,viewPort:Fe,onDragStart:vt,onDragEnd:gt,onDragMove:ht,onSelect:it,onSetDescription:st,selected:(null==t?void 0:t.pinId)===o,description:s.description,onMouseUp:Nn,onMouseDown:xn},o)}))},qt=()=>{const{to:t}=Y;return(0,p.entries)(be).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"output",pos:Ie[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,closest:!(!Ke||"output"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,viewPort:Fe,onDragStart:vt,onDragEnd:gt,onDragMove:ht,onSelect:it,onSetDescription:st,description:s.description,selected:(null==t?void 0:t.pinId)===o,onMouseUp:Nn,onMouseDown:xn},o)}))},Ut=()=>{if(xe){const{from:e,to:t}=xe,n=(0,m.logicalPosToRenderedPos)(e,Fe),o=(0,m.logicalPosToRenderedPos)(t,Fe),{x:i,y:s,w:r,h:u}=(0,m.getSelectionBoxRect)(n,o);return(0,a.jsx)("div",{className:"selection-box",style:{top:s,left:i,width:r,height:u}})}return null},Wt=u.useCallback((async(e,t,n,o)=>{if("input"===n){const n=e.inputConfig[t],o=(0,l.isStaticInputPinConfig)(n)?JSON.stringify(n.value):void 0;Ae({type:"static-input",insId:e.id,pinId:t,value:null!=o?o:JSON.stringify("Some static value")}),ue("addValueModalOpen",{source:"dblClickPin"})}else{const i=(0,B.safelyGetNodeDef)(e,ce);if(!(0,l.getNodeOutputs)(i)[t])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:o.clientX,y:o.clientY},ins:e,targetNode:i,pinId:t,pinType:n})}}),[ce,ue]),Zt=u.useCallback((async(e,t)=>{if(!ee.inputs[e])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:t.clientX,y:t.clientY},pinId:e,pinType:"input",targetNode:ee})}),[ee]),Jt=u.useCallback((e=>{if(e.metaKey||e.ctrlKey){const t=-.005*e.deltaY;ct(Fe.zoom+t,"mouse"),e.preventDefault(),e.stopPropagation()}else{if(se)return;const t=e.deltaX,n=e.deltaY,o=(0,v.produce)(Fe,(e=>{e.pos.x=e.pos.x+t/e.zoom,e.pos.y=e.pos.y+n/e.zoom}));We(o),e.stopPropagation(),e.preventDefault()}}),[se,ct,We,Fe]);(0,h.useEffect)((()=>{const{current:e}=Xe;if(e)return e.addEventListener("wheel",Jt),()=>{e.removeEventListener("wheel",Jt)}}),[Jt]);const Yt={backgroundPositionX:(0,m.roundNumber)(-Fe.pos.x*Fe.zoom),backgroundPositionY:(0,m.roundNumber)(-Fe.pos.y*Fe.zoom),backgroundSize:(0,m.roundNumber)(10*Fe.zoom)+"px"},Kt=u.useRef(new Map);u.useEffect((()=>{const e=ve.reduce(((e,t)=>{const n=(0,B.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeInputs)(n))),e}),new Map),t=ve.reduce(((e,t)=>{const n=(0,B.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeOutputs)(n))),e}),new Map);e.set(l.THIS_INS_ID,(0,l.keys)(ee.outputs)),t.set(l.THIS_INS_ID,(0,l.keys)(ee.inputs));const n=he.filter((n=>{const o=e.get(n.to.insId)&&e.get(n.to.insId).includes(n.to.pinId),i=t.get(n.from.insId)&&t.get(n.from.insId).includes(n.from.pinId);return!(o&&i)}));if(n.length>0){(0,O.toastMsg)(`${n.length} orphan connections removed`,"warning"),console.warn(`${n.length} orphan connections removed`,n);const e=(0,v.produce)(ee,(e=>{e.connections=ee.connections.filter((e=>!n.includes(e)))}));o(e,(0,P.functionalChange)("prune orphan connections"))}}),[ve,o,he,ee,ce]),u.useEffect((()=>{let e=[];const t=(0,v.produce)(ee,(t=>{t.instances=t.instances.map((t=>{const n=(0,B.safelyGetNodeDef)(t,ce);if(n){const o=(0,l.getNodeInputs)(n),i=(0,l.getNodeOutputs)(n);if(t.visibleInputs){const n=t.visibleInputs.filter((e=>!o[e]));n.length>0&&(t.visibleInputs=(0,l.keys)(o),e.push(...n))}if(t.visibleOutputs){const n=t.visibleOutputs.filter((e=>!i[e]));n.length>0&&(t.visibleOutputs=(0,l.keys)(i),e.push(...n))}}return t}))}));e.length>0&&((0,O.toastMsg)(`Found ${e.length} invalid visible inputs/outputs: ${e.join(", ")}. Reset them`,"warning"),o(t,(0,P.functionalChange)("reset corrupt visible inputs/outputs")))}),[ve,o,ee,ce]),(0,h.useEffect)((()=>{const e=new Map(ve.map((e=>[e.id,e])));Kt.current=he.reduce(((t,n)=>{const o=t.get(n.to.insId)||{},i=o[n.to.pinId]||[],s={...o,[n.to.pinId]:[...i,e.get(n.from.insId)]};return t.set(n.to.insId,s),t}),new Map)}),[he,ve]);const Qt=u.useCallback((()=>{Te(void 0)}),[]),Xt=u.useCallback((async e=>{if(!Me)throw new Error("impossible state - quick add menu invoked but not available");const{ins:t,pinId:n}=Me;switch(e.type){case"import":case"node":{const i="import"===e.type?await re(e.importableNode):ce,s="import"===e.type?e.importableNode.node:e.node,r=(0,m.createNewNodeInstance)(s.id,100,tt.current,i);if(r){const e=(0,v.produce)(ee,(e=>{e.instances.push(r),e.connections.push({from:{insId:t?t.id:l.THIS_INS_ID,pinId:n},to:{insId:r.id,pinId:l.TRIGGER_PIN_ID}})}));o(e,(0,P.functionalChange)("add-item-quick-menu")),Qt()}ue("addNode",{nodeId:s.id,source:"quickAdd"});break}case"value":if(!t)return void(0,O.toastMsg)("Cannot add value to main input");Ae({type:"new-output",insId:t.id,pinId:n}),ue("addValueModalOpen",{source:"quickAdd"})}}),[Me,ce,ue,ee,o,Qt,re]),en=u.useCallback((async()=>{const e=JSON.stringify(ee);await navigator.clipboard.writeText(e),O.AppToaster.show({message:"Copied!"})}),[ee]),tn=u.useCallback((()=>{var e,t;const n=i?"":" (cannot edit main node, only visual)";return(0,a.jsxs)(y.Menu,{children:[(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"New Value",onClick:(0,p.preventDefaultAnd)((()=>{Ae({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"contextMenu"})}))}),(0,a.jsx)(y.MenuItem,{text:`New input ${n}`,onMouseDown:e=>e.stopPropagation(),onClick:(0,p.preventDefaultAnd)((()=>Vt("input"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`New output ${n}`,onClick:(0,p.preventDefaultAnd)((()=>Vt("output"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Copy node to clipboard",onClick:(0,p.preventDefaultAnd)(en)}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Completion Outputs (${(null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>At()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Reactive inputs (${(null===(t=ee.reactiveInputs)||void 0===t?void 0:t.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>$t()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Edit description",onClick:(0,p.preventDefaultAnd)((()=>zt()))}),(0,a.jsx)(y.MenuDivider,{}),(0,a.jsx)(y.MenuItem,{text:"Default Style",children:(0,a.jsx)(z.NodeStyleMenu,{style:ee.defaultStyle,onChange:Ht,promptFn:Le})})]})}),[i,en,ee.completionOutputs,ee.reactiveInputs,ee.defaultStyle,Ht,Le,ue,Vt,At,$t,zt]);(0,g.useHotkeys)("shift+c",ot,{text:"Center viewport",group:"Viewport Controls"},[],Be),(0,g.useHotkeys)("cmd+c",at,{text:"Copy instances",group:"Editing"},[],Be),(0,g.useHotkeys)("cmd+v",ut,{text:"Paste instances",group:"Editing"},[],Be),(0,g.useHotkeys)("esc",dt,{text:"Clear selections",group:"Selection"},[],Be),(0,g.useHotkeys)("backspace",xt,{text:"Delete instances",group:"Editing"},[],Be),(0,g.useHotkeys)("shift+d",wt,{text:"Duplicate selected instances",group:"Editing"},[],Be),(0,g.useHotkeys)("cmd+a",yt,{text:"Select all",group:"Selection"},[],Be),(0,g.useHotkeys)("s",lt,{text:"Select pin closest to mouse",group:"Selection"},[],Be);const nn=u.useCallback(((e,t)=>{if(!$e)throw new Error("impossible state");const n=(0,v.produce)(ee,(t=>{const n=t.instances.find((e=>e.id===$e.insId));if(!n||!(0,l.isInlineNodeInstance)(n))throw new Error("impossible state");n.node=e}));o(n,(0,P.functionalChange)("Inner change: "+t.message)),ze((t=>({...t,node:e})))}),[o,$e,ee]),[on,sn]=(0,h.useState)({selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}}),rn=u.useCallback((e=>sn((t=>({...t,...e})))),[]),an=n=>$e&&$e.insId===n.id?{currentInsId:$e.insId,ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),boardData:on,onChangeBoardData:rn,resolvedDependencies:ne,onCopy:s,clipboardData:e.clipboardData,onInspectPin:e.onInspectPin,onGoToNodeDef:e.onGoToNodeDef,nodeIoEditable:e.nodeIoEditable,node:$e.node,onChangeNode:nn,onShowOmnibar:te,parentViewport:t.defaultViewPort,parentBoardPos:nt,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:e.queuedInputsData}:void 0,un=()=>{if(fe&&("input"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"output"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(e)&&!(0,l.isInternalConnectionNode)(fe))return;return{from:fe,to:e}}if(me&&("output"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"input"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(me)&&!(0,l.isInternalConnectionNode)(e))return;return{from:e,to:me}}},ln=()=>{const e=un();if(e){const{from:t,to:n}=e;return{connection:{from:t,to:n},type:he.some((t=>(0,l.connectionDataEquals)(t,e)))?"future-remove":"future-add"}}},cn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleInputs:t}:n))}));o(n,(0,P.functionalChange)("change instance visible inputs"))}),[ee,o]),dn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,style:t}:n))}));o(n,(0,P.functionalChange)("change instance style")),ue("changeStyle",{isDefault:!1})}),[o,ee,ue]),pn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleOutputs:t}:n))}));o(n,(0,P.functionalChange)("change instance visible outputs"))}),[ee,o]),fn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,displayName:t}:n))}));o(n,(0,P.functionalChange)("change instance display name"))}),[ee,o]);u.useImperativeHandle(n,(()=>({centerInstance(e){const t=ee.instances.find((t=>t.id===e));if(t){const e=(0,C.vSub)(t.pos,(0,C.vec)(et.width/2,et.height/2));We({...Fe,pos:e})}},centerViewPort(){ot()},getViewPort:()=>Fe,clearSelection:()=>{dt()},requestNewInlineValue:()=>{Ae({type:"new-floating",pos:tt.current})}})));const[mn,vn]=u.useState([]),hn=u.useCallback(((e,t)=>{const n=t.trim().substr(0,100),i=`Inline-value-${n.substr(0,15).replace(/["'`]/g,"")}`,s=(0,D.createInlineValueNode)({code:t,customView:n,nodeId:i,type:e});switch(Ve.type){case"existing":{const[e]=ee.instances.filter((e=>e.id===Ve.insId)).filter((e=>(0,l.isInlineNodeInstance)(e))).map((e=>e.node));if(!e)throw new Error("Unable to find inline node to save to");const t=(0,l.keys)(e.inputs),n=(0,l.keys)(s.inputs),i=new Set(S.default.difference(t,n)),r=(0,v.produce)(ee,(e=>{e.instances=e.instances.map((e=>e.id===Ve.insId?(0,l.inlineNodeInstance)(e.id,s,e.inputConfig,e.pos):e)),e.connections=e.connections.filter((e=>!(e.to.insId===Ve.insId&&i.has(e.to.pinId))))}));o(r,(0,P.functionalChange)("change inline value")),Ae(void 0);break}case"static-input":{let e;try{const n=t.replace(/^['`]/,'"').replace(/['`]$/,'"');e=JSON.parse(n)}catch(r){return void(0,O.toastMsg)("Input values must not be formulas or code")}const n=(0,v.produce)(ee,(t=>{t.instances.find((e=>e.id===Ve.insId)).inputConfig[Ve.pinId]=(0,l.staticInputPinConfig)(e)}));o(n,(0,P.functionalChange)("set static input value")),Ae(void 0);break}case"new-floating":{const e=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},Ve.pos),t=(0,v.produce)(ee,(t=>{t.instances.push(e)}));o(t,(0,P.functionalChange)("new floating value")),Ae(void 0);break}case"new-output":{const{insId:e,pinId:t}=Ve,n=ee.instances.find((t=>t.id===e));if(!n)throw new Error("Impossible state");const i=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},(0,C.vAdd)(n.pos,{x:-50,y:150})),r=(0,v.produce)(ee,(n=>{n.instances.push(i),n.connections.push({from:(0,l.connectionNode)(e,t),to:(0,l.connectionNode)(i.id,l.TRIGGER_PIN_ID)})}));o(r,(0,P.functionalChange)("new value connected to output")),Ae(void 0)}}ue("addValue",{type:e,placeholdersCount:(0,l.keys)(s.inputs).length})}),[Ve,o,ee,ue]),gn=he.filter((e=>{const t=un();return!t||!(0,l.connectionDataEquals)(t,e)})),In=u.useCallback((()=>{ze(void 0),sn(t.defaultBoardData)}),[]),yn=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{const n=t.connections.find((t=>(0,l.connectionDataEquals)(t,e)));n.hidden=!n.hidden}));o(t,(0,P.functionalChange)("toggle connection hidden"))}),[o,ee]),bn=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{t.connections=t.connections.filter((t=>!(0,l.connectionDataEquals)(t,e)))}));o(t,(0,P.functionalChange)("remove connection"))}),[o,ee]),Cn=u.useCallback(((e,t,n)=>{Ue("input"===n?{to:(0,l.connectionNode)(e.id,t),from:void 0}:{from:(0,l.connectionNode)(e.id,t),to:void 0})}),[]),_n=u.useCallback(((e,t,n)=>{qe&&(qe.from&&"input"===n?Je(qe.from,(0,l.connectionNode)(e.id,t),"pinDrag"):qe.to&&"output"===n&&Je((0,l.connectionNode)(e.id,t),qe.to,"pinDrag")),Ue(null)}),[qe,Je]),xn=u.useCallback(((e,t)=>{}),[]),Nn=u.useCallback(((e,t)=>{qe&&(qe.from&&"output"===t?Je(qe.from,(0,l.externalConnectionNode)(e),"nodeIoPinDrag"):qe.to&&"input"===t&&Je((0,l.externalConnectionNode)(e),qe.to,"nodeIoPinDrag"))}),[qe,Je]);try{return(0,a.jsxs)(y.ContextMenu,{className:(0,k.default)("visual-node-editor",e.className,{dark:ae}),"data-id":ee.id,content:tn(),disabled:!Be.current,children:[(0,a.jsxs)("main",{className:"board-editor-inner",onMouseDown:jt,onMouseUp:Ot,onMouseMove:Pt,onMouseLeave:Et,ref:Xe,style:Yt,children:[(0,a.jsx)(u.Fragment,{children:(0,a.jsx)(w.LayoutDebugger,{vp:Fe,node:ee,extraDebug:m.emptyList,mousePos:tt.current})}),(0,a.jsx)(d.ConnectionView,{resolvedNodes:ce,currentInsId:Q,ancestorsInsIds:X,size:et,node:ee,boardPos:nt,instances:ve,connections:gn,futureConnection:ln(),onDblClick:l.noop,viewPort:Fe,parentVp:le,selectedInstances:pe,toggleHidden:yn,removeConnection:bn,lastMousePos:tt.current,draggedSource:qe}),Bt(),ve.map((t=>{var n,o,i,s,r;return(0,a.jsx)(c.InstanceView,{onUngroup:St,onExtractInlineNode:Mt,onDetachConstValue:Tt,onCopyConstValue:kt,onPasteConstValue:Rt,copiedConstValue:ke,connectionsPerInput:Kt.current.get(t.id)||m.emptyObj,node:(0,B.safelyGetNodeDef)(t,ce),ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),onPinClick:rt,onPinDblClick:Wt,onDragStart:pt,onDragEnd:mt,resolvedDeps:ce,onDragMove:ft,onDblClick:Dt,onSelect:It,onToggleSticky:Nt,selected:-1!==pe.indexOf(t.id),dragged:Ce===t.id,onInspectPin:Ze,selectedInput:me&&(0,l.isInternalConnectionNode)(me)&&me.insId===t.id?me.pinId:void 0,selectedOutput:fe&&(0,l.isInternalConnectionNode)(fe)&&fe.insId===t.id?fe.pinId:void 0,closestPin:Ke&&Ke.ins.id===t.id?Ke:void 0,queuedInputsData:null!==(n=oe[t.id])&&void 0!==n?n:m.emptyObj,instance:t,connections:he,onTogglePinBreakpoint:l.noop,onTogglePinLog:l.noop,viewPort:Fe,onChangeVisibleInputs:cn,onChangeVisibleOutputs:pn,onSetDisplayName:fn,onDeleteInstance:Ct,forceShowMinimized:fe||(null===(o=null==qe?void 0:qe.to)||void 0===o?void 0:o.insId)===t.id?"input":me||(null===(i=null==qe?void 0:qe.from)||void 0===i?void 0:i.insId)===t.id?"output":void 0,isConnectedInstanceSelected:pe.some((e=>he.some((n=>{let{from:o,to:i}=n;return o.insId===t.id&&i.insId===e||o.insId===e&&i.insId===t.id})))),inlineGroupProps:an(t),onCloseInlineEditor:In,inlineEditorPortalDomNode:He.current,onChangeStyle:dn,onGroupSelected:Ye,onPinMouseDown:Cn,onPinMouseUp:_n,hadError:null!==(r=null===(s=e.instancesWithErrors)||void 0===s?void 0:s.has((0,l.fullInsIdPath)(t.id)))&&void 0!==r&&r},t.id)})),Ut(),qt(),(0,a.jsx)(L.MainInstanceEventsIndicator,{currentInsId:Q,ancestorsInsIds:X,viewPort:Fe}),Me?(0,a.jsx)(_.QuickAddMenu,{targetNode:Me.targetNode,pinId:Me.pinId,pinType:Me.pinType,pos:Me.pos,resolvedDependencies:ne,node:ee,onAdd:Xt,onClose:Qt}):null,(0,a.jsxs)("div",{className:"viewport-controls-and-help",children:[(0,a.jsx)(y.Button,{small:!0,onClick:ot,minimal:!0,intent:"primary",children:"Center"}),(0,a.jsx)(U,{min:.15,max:3,stepSize:.05,labelStepSize:10,labelRenderer:W,onChange:ct,value:Fe.zoom}),we?(0,a.jsx)(F.HelpBubble,{}):null]}),Ve?(0,a.jsx)(E.InlineCodeModal,{env:m.emptyObj,initialValue:Ve.value,initialType:"existing"===Ve.type?Ve.templateType:void 0,onCancel:()=>Ae(void 0),onSubmit:hn}):null,(0,a.jsx)("div",{className:"inline-editor-portal-root"})]}),(0,a.jsx)(G.ActionsMenu,{showRunFlowOptions:we,onAction:Ft,selectedInstances:pe,node:ee,resolvedNodes:ce,to:me,from:fe,hotkeysEnabled:Be})]})}catch(wn){return console.error(wn),(0,a.jsxs)("div",{children:["Error rendering board - ",wn.toString()]})}})));const Z=(e,t)=>{const n=e.target.closest(".visual-node-editor");return n&&n.getAttribute("data-id")===t}},83234:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeView=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=r(n(59349)),d=n(30653);t.BaseNodeView=function(e){const{dragged:t,viewPort:n,pos:o,onDragEnd:i,onDragMove:s,onDragStart:r,displayMode:p}=e,f=(0,d.useDarkMode)(),m=u.useCallback(((e,t)=>{r(e,t)}),[r]),v=u.useCallback(((e,t)=>{const s=o,r=(t.x-s.x)/n.zoom,a=(t.y-s.y)/n.zoom,u=s.x+r,l=s.y+a;i(e,{...t,x:u,y:l})}),[o,i,n]),h=u.useCallback(((e,t)=>{s(e,{x:t.x,y:t.y})}),[s]),g={transform:`scale(${n.zoom})`},I=(0,l.default)("base-node-view",e.className,{dragged:t,dark:f,"display-mode":p}),y=o.x*n.zoom-n.pos.x*n.zoom,b=o.y*n.zoom-n.pos.y*n.zoom,C={transform:`translate(${y-o.x}px, ${b-o.y}px)`},_=(0,l.default)("base-node-view-vp-fixer",{"display-mode":p}),x=(0,a.jsx)("span",{className:"base-node-view-wrapper",children:(0,a.jsx)("div",{className:I,style:g,id:e.domId,children:e.children})});return(0,a.jsx)("div",{className:_,style:C,children:(0,a.jsx)(c.default,{onStop:v,onStart:m,onDrag:h,position:o,cancel:".no-drag",children:x})})}},80510:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleConnectionCloseEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleConnectionCloseEditorCommand=(e,t)=>{let{from:n,to:o}=t;return(0,s.default)(e,(e=>{const t=e.connections.find((e=>{const t=(0,i.connectionNodeEquals)(n,e.from),s=(0,i.connectionNodeEquals)(o,e.to);return t&&s}));t?e.connections=e.connections.filter((e=>e!==t)):e.connections.push({from:n,to:o})}))}},1788:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDetachConstEditorCommand=void 0;const i=n(74762),s=o(n(53865)),r=n(68371);t.handleDetachConstEditorCommand=(e,t,n)=>(0,s.default)(e,(e=>{const{instances:o}=e,s=o.find((e=>e.id===t));if(!s)throw new Error("Impossible state ins id with no matching instance");const a=s.inputConfig[n];if(!a)throw new Error("impossible state detaching const from unexistent config");if(!(0,i.isStaticInputPinConfig)(a))throw new Error("impossible state detaching const with no value");const u=JSON.stringify(a.value),l=(0,r.createInlineValueNode)({code:`${u}`,type:i.InlineValueNodeType.VALUE}),c=(0,i.inlineNodeInstance)(`value-${(0,i.randomInt)(999)}`,l,{},{x:s.pos.x,y:s.pos.y-100});if(!e.instances.find((e=>e.id===s.id)))throw new Error("impossible state instance not found");s.inputConfig[n]=(0,i.queueInputPinConfig)(),e.instances.push(c),e.connections.push((0,i.connectionData)(`${c.id}.value`,`${s.id}.${n}`))}))},2130:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDuplicateSelectedEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleDuplicateSelectedEditorCommand=(e,t)=>{const n=[];return{newNode:(0,s.default)(e,(o=>{const s=o.instances;t.forEach((t=>{const o=s.find((e=>e.id===t));if(!o)throw new Error("impossible state duplicate selected no matching instance");if(o){const{pos:t}=o,r={...o,pos:{x:t.x+20,y:t.y+20},id:(0,i.createInsId)(e)};s.push(r),n.push(r.id)}}))})),newInstances:n}}},25044:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.pasteInstancesCommand=void 0;const i=n(74762),s=o(n(53865));t.pasteInstancesCommand=(e,t,n)=>{const o=n.instances.map((n=>({...n,pos:t,id:(0,i.createInsId)(e)}))),r=new Map(o.map(((e,t)=>[n.instances[t].id,e.id])));return{newNode:(0,s.default)(e,(e=>{e.instances.push(...o);const t=n.connections.map((e=>{let{from:t,to:n}=e;return{from:{...t,insId:r.get(t.insId)||t.insId},to:{...n,insId:r.get(n.insId)||n.insId}}}));e.connections.push(...t)})),newInstances:o}}},65082:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionView=t.SingleConnectionView=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=r(n(26372)),d=n(74762),p=n(18243),f=n(77852),m=n(74089),v=n(60190),h=n(50382),g=n(76064),I=n(41032);t.SingleConnectionView=e=>{const{isBrowser:t}=(0,f.useSsr)(),{connection:n,node:o,resolvedNodes:i,instances:s,type:r,viewPort:a,toggleHidden:l,parentSelected:m,removeConnection:y}=e,{from:b}=n,C=(0,d.isInternalConnectionNode)(b)&&s.find((e=>e.id===b.insId));if(!C&&(0,d.isInternalConnectionNode)(b))throw new Error(`impossible state - "from instance id - [${b.insId}] does not exist"`);const _=((0,d.isInternalConnectionNode)(b)&&C?(0,I.safelyGetNodeDef)(C,i):o).outputs[b.pinId],x=_&&_.delayed,N=t?(0,p.calcStartPos)({...e,connectionNode:b}):{x:0,y:0},w=t?(0,p.calcTargetPos)({...e,connectionNode:n.to}):{x:0,y:0},{x:j,y:O}=(0,v.vDiv)(N,e.parentVp.zoom),{x:P,y:E}=(0,v.vDiv)(w,e.parentVp.zoom),D=(0,c.default)({delayed:x,hidden:n.hidden,"parent-selected":m},r),S=(0,u.jsxs)(h.Menu,{children:[(0,u.jsx)(h.MenuItem,{text:n.hidden?"Show connection":"Hide connection",onClick:()=>l(n)}),(0,u.jsx)(h.MenuItem,{text:"Remove connection",onClick:()=>y(n)})]});return(0,u.jsx)(h.ContextMenu,{content:S,children:e=>(0,u.jsx)(g.ConnectionViewPath,{className:D,from:{x:j,y:O},to:{x:P,y:E},dashed:"regular"!==r,zoom:a.zoom,onContextMenu:e.onContextMenu})})};t.ConnectionView=e=>{var n;const{viewPort:o,futureConnection:i,toggleHidden:s,selectedInstances:r,draggedSource:c}=e,[d,f]=l.useState(0),v=l.useCallback((e=>requestAnimationFrame((()=>{f((e=>(e+1)%9)),e>0&&v(e-1)}))),[]);l.useEffect((()=>{const e=v(10);return()=>{cancelAnimationFrame(e)}}),[v]),l.useEffect((()=>{const e=()=>{v(3)};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[v,d]);const h=e.connections.map((n=>{const o=r.includes(n.from.insId)||r.includes(n.to.insId);return(0,a.createElement)(t.SingleConnectionView,{...e,connection:n,type:"regular",parentSelected:o,key:n.from.insId+n.from.pinId+n.to.insId+n.to.pinId})}));if(i&&h.push((0,a.createElement)(t.SingleConnectionView,{...e,connection:i.connection,type:i.type,toggleHidden:s,parentSelected:!1,key:"future"})),c){const t=(c.from?p.calcStartPos:p.calcTargetPos)({connectionNode:null!==(n=c.from)&&void 0!==n?n:c.to,viewPort:o,boardPos:e.boardPos,ancestorsInsIds:e.ancestorsInsIds,currentInsId:e.currentInsId});h.push((0,u.jsx)(g.ConnectionViewPath,{className:"dragged",from:t,to:(0,m.logicalPosToRenderedPos)(e.lastMousePos,o),zoom:o.zoom},"dragged"))}return(0,u.jsx)("span",{className:"connections-view",style:{opacity:o.zoom},children:(0,u.jsx)("svg",{style:{width:"100%"},children:h})})}},76064:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionViewPath=void 0;const i=n(35250),s=o(n(26372)),r=n(70079),a=n(23381);t.ConnectionViewPath=(0,r.forwardRef)(((e,t)=>{const{from:n,to:o,className:r,onContextMenu:u,zoom:l,dashed:c}=e,{x:d,y:p}=n,{x:f,y:m}=o,v=(0,a.calcBezierPath)({sourceX:d,sourceY:p,targetX:f,targetY:m,curvature:.15}),h=2.5*l,g=c?6*l:void 0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:v,ref:t,className:(0,s.default)("connection",r),style:{strokeWidth:h,strokeDasharray:g},onContextMenu:u}),e.label?(0,i.jsx)("text",{className:"label",x:(d+f)/2,y:(p+m)/2,fontSize:"12px"}):null,(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%"}),(0,i.jsx)("stop",{offset:"100%"})]})]})}))},23381:(e,t)=>{"use strict";var n;function o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i(e){let t,i,{pos:s,x1:r,y1:a,x2:u,y2:l,c:c}=e;switch(s){case n.Left:t=r-o(r-u,c),i=a;break;case n.Right:t=r+o(u-r,c),i=a;break;case n.Top:t=r,i=a-o(a-l,c);break;case n.Bottom:t=r,i=a+o(l-a,c)}return[t,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.getBezierCenter=t.calcBezierPath=t.Position=void 0,function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(n=t.Position||(t.Position={}));t.calcBezierPath=e=>{let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l});return`M${t},${o} C${c},${d} ${p},${f} ${r},${a}`},t.getBezierCenter=function(e){let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l}),m=.125*t+.375*c+.375*p+.125*r,v=.125*o+.375*d+.375*f+.125*a;return[m,v,Math.abs(m-t),Math.abs(v-o)]}},18243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcTargetPos=t.calcStartPos=t.calcPinPosition=void 0;const o=n(74762),i=n(30994),s={x:99999,y:99999};function r(e){const t=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds),pinId:e.pinId,pinType:e.pinType,isMain:e.isMain});return((e,t,n,o)=>{if(!e)return console.warn(`Cannot find element ${n} to calculate position.`),s;const{x:i,y:r,width:a,height:u}=e.getBoundingClientRect(),l=r+u/2;return{x:i+a/2-t.x,y:l-t.y}})(document.getElementById(t),e.boardPos,t,e.viewPort)}t.calcPinPosition=r;t.calcStartPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"input",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"output",boardPos:n,viewPort:s})};t.calcTargetPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"output",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"input",boardPos:n,viewPort:s})}},30994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPinDomId=t.getMainInstanceIndicatorDomId=t.getInstanceDomId=void 0;const o=n(74762);t.getInstanceDomId=(e,t)=>`ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getMainInstanceIndicatorDomId=(e,t)=>`main-ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getPinDomId=e=>{let{pinType:t,fullInsIdPath:n,pinId:o,isMain:i}=e;return`${i?"main-":""}pin:${t}:${n}:${o}`.replace(/\s+/g,"-")}},86553:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceView=t.getVisibleOutputs=t.getVisibleInputs=t.INSTANCE_INFO_TOOLTIP_DELAY=t.MAX_INSTANCE_WIDTH=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=n(66074),d=n(74762),p=r(n(26372)),f=n(2036),m=n(74762),v=n(74762),h=n(53159),g=n(83234),I=n(74762),y=n(30994),b=n(63521),C=n(74089),_=n(50382),x=r(n(99581)),N=n(88593),w=n(30653);t.PIECE_HORIZONTAL_PADDING=25,t.PIECE_CHAR_WIDTH=11,t.MIN_WIDTH_PER_PIN=40,t.MAX_INSTANCE_WIDTH=400,t.INSTANCE_INFO_TOOLTIP_DELAY=400;t.getVisibleInputs=(e,t,n)=>{const{visibleInputs:o}=e;if(o)return o;const i=(0,d.keys)((0,v.getNodeInputs)(t)).filter(((o,i)=>{var s;const r=n.some((t=>t.to.insId===e.id&&t.to.pinId===o)),a=t.inputs[o]&&"optional"===(null===(s=t.inputs[o])||void 0===s?void 0:s.mode);return r||!a&&o!==m.TRIGGER_PIN_ID}));return 0===i.length?[m.TRIGGER_PIN_ID]:i};t.getVisibleOutputs=(e,t,n)=>{const{visibleOutputs:o}=e;if(o)return o;const i=Object.keys(t.outputs);return n.some((t=>t.from.insId===e.id&&t.from.pinId===m.ERROR_PIN_ID))?[...i,m.ERROR_PIN_ID]:i};t.InstanceView=function(e){const{selected:n,selectedInput:o,selectedOutput:i,closestPin:s,dragged:r,onTogglePinLog:j,onTogglePinBreakpoint:O,onDetachConstValue:P,onCopyConstValue:E,onPasteConstValue:D,displayMode:S,connections:M,instance:T,viewPort:k,node:R,onPinClick:V,onPinDblClick:A,onDragStart:$,onDragEnd:z,onDragMove:H,onToggleSticky:G,onSelect:L,onDblClick:F,onChangeVisibleInputs:B,onChangeVisibleOutputs:q,onConvertConstToEnv:U,inlineGroupProps:W,onUngroup:Z,onExtractInlineNode:J,onGroupSelected:Y,isConnectedInstanceSelected:K,inlineEditorPortalDomNode:Q,onChangeStyle:X,onDeleteInstance:ee,onSetDisplayName:te,onPinMouseUp:ne,onPinMouseDown:oe}=e,ie=(0,w.useDarkMode)(),{id:se}=T,re=l.useMemo((()=>{const e=(0,d.randomInt)(6,1);return{icon:(0,d.pickRandom)([["fab","discord"],["fab","slack"],"bug","cube"]),color:e,size:(0,d.randomInt)(3,1),variation:(0,d.randomInt)(5,1)}}),[]),ae=l.useRef(),ue=l.useMemo((()=>T.style||R.defaultStyle||{}),[R,T]),le=ue.size||"regular",ce=l.useMemo((()=>new Map(M.filter((e=>{let{to:t}=e;return t.insId===se})).map((e=>{let{to:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),de=l.useMemo((()=>new Map(M.filter((e=>{let{from:t}=e;return t.insId===se})).map((e=>{let{from:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),pe=(0,C.usePrompt)(),fe=l.useCallback((e=>V(T,e,"input")),[T,V]),me=l.useCallback(((e,t)=>A(T,e,"input",t)),[T,A]),ve=l.useCallback(((e,t)=>A(T,e,"output",t)),[T,A]),he=l.useCallback((e=>V(T,e,"output")),[T,V]),ge=l.useCallback(((e,t)=>{$(T,e,t)}),[T,$]),Ie=l.useCallback(((e,t)=>{const n=T.pos,o=(t.x-n.x)/k.zoom,i=(t.y-n.y)/k.zoom,s=n.x+o,r=n.y+i;z(T,e,{...t,x:s,y:r})}),[T,z,k.zoom]),ye=l.useCallback(((e,t)=>{H(T,e,{x:t.x,y:t.y})}),[T,H]),be=l.useCallback((e=>G(T,e)),[T,G]),Ce=l.useCallback((e=>P(T,e)),[T,P]),_e=l.useCallback((e=>E(T,e)),[T,E]),xe=l.useCallback((e=>D(T,e)),[T,D]),Ne=l.useCallback((e=>L(T,e)),[T,L]),we=l.useCallback((e=>F(T,e.shiftKey)),[T,F]),je=(0,d.entries)(R.inputs),{visibleInputs:Oe,visibleOutputs:Pe}=T;Oe&&je.sort(((e,t)=>Oe.indexOf(e[0])-Oe.indexOf(t[0])));const Ee=(0,d.entries)(R.outputs);Pe&&Ee.sort(((e,t)=>Pe.indexOf(e[0])-Pe.indexOf(t[0])));const De=(0,t.getVisibleInputs)(T,R,M),Se=(0,t.getVisibleOutputs)(T,R,M);je.push([m.TRIGGER_PIN_ID,{...(0,d.nodeInput)(),description:"Use this pin to manually trigger the node. If not connected, the node will be triggered automatically when all required inputs have data."}]),Ee.push([m.ERROR_PIN_ID,{...(0,m.nodeOutput)(),description:"Use this pin to catch errors that happen inside this node. If not connected, errors will bubble up to the parent node."}]);const Me=je.filter((e=>{let[t]=e;return De.includes(t)||(n||K)&&ce.has(t)})),Te=Ee.filter((t=>{let[o]=t;return Se.includes(o)||(n||K)&&de.has(o)||o===m.ERROR_PIN_ID&&e.hadError})),ke=M.some((e=>e.from.insId===se&&e.from.pinId===m.ERROR_PIN_ID)),Re=(0,p.default)("ins-view",{"no-inputs":0===je.length,"no-outputs":0===Ee.length,"display-mode":S,"force-minimized-input":"input"===e.forceShowMinimized||"both"===e.forceShowMinimized,"force-minimized-output":"output"===e.forceShowMinimized||"both"===e.forceShowMinimized,"inline-node-edited":!!W,"error-caught":ke}),Ve=(0,p.default)({selected:n,dragged:r,closest:s&&s.ins.id===T.id},`size-${le}`),Ae=new Set((0,d.entries)(R.inputs).filter((e=>{let[t,n]=e;return(0,m.isInputPinOptional)(n)})).map(d.pickFirst)),$e=(0,d.entries)(T.inputConfig).reduce(((e,t)=>{let[n,o]=t;return(0,m.isStickyInputPinConfig)(o)||o.sticky?{...e,[n]:!0}:e}),{}),ze=(0,h.calcNodeContent)(T,R),He=e=>{const t=T.inputConfig[e];if((0,I.isStaticInputPinConfig)(t))return t.value},Ge=l.useCallback((async()=>{const e=(0,d.okeys)(R.inputs),t=await pe("New order?",(T.visibleInputs||e).join(","));t&&B(T,t.split(","))}),[R.inputs,pe,T,B]),Le=l.useCallback((async()=>{const e=(0,d.okeys)(R.outputs),t=await pe("New order?",(T.visibleOutputs||e).join(","));t&&q(T,t.split(","))}),[R.outputs,pe,T,q]),Fe=l.useCallback((()=>{ee(T)}),[ee,T]),Be=l.useCallback((async()=>{const e=await pe("Set custom display name",T.displayName||R.id);te(T,e)}),[pe,T,te,R.id]),qe=Object.keys((0,v.getNodeInputs)(R)),Ue=Object.keys((0,d.getNodeOutputs)(R)),We=l.useCallback((e=>{U&&U(T,e)}),[T,U]),Ze=l.useCallback(((e,t)=>{ne&&ne(T,e,t)}),[T,ne]),Je=l.useCallback(((e,t)=>{oe&&oe(T,e,t)}),[T,oe]),Ye=()=>(0,u.jsx)("div",{className:"inputs no-drag",children:Me.map((t=>{let[i,r]=t;var a;return(0,u.jsx)(f.PinView,{type:"input",currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,id:i,optional:Ae.has(i),connected:ce.has(i),isSticky:$e[i],minimized:!n&&1===Me.length,onToggleSticky:be,onDetachConstValue:Ce,onCopyConstValue:_e,onPasteConstValue:xe,copiedConstValue:e.copiedConstValue,selected:i===o,onClick:fe,onDoubleClick:me,isClosestToMouse:!!s&&"input"===s.type&&s.pin===i,onToggleLogged:j,onToggleBreakpoint:O,onInspect:e.onInspectPin,constValue:He(i),onConvertConstToEnv:e.onConvertConstToEnv?We:void 0,description:r.description,queuedValues:null!==(a=e.queuedInputsData[i])&&void 0!==a?a:0,onMouseUp:Ze,onMouseDown:Je},i)}))}),Ke=()=>(0,u.jsx)("div",{className:"outputs no-drag",children:Te.map((t=>{let[o,r]=t;return(0,u.jsx)(f.PinView,{currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,connected:de.has(o),type:"output",id:o,minimized:!n&&1===Te.length,isClosestToMouse:!!s&&"output"===s.type&&s.pin===o,selected:o===i,onClick:he,onDoubleClick:ve,onToggleLogged:j,onToggleBreakpoint:O,onInspect:e.onInspectPin,description:r.description,onMouseUp:Ze,onMouseDown:Je},o)}))}),Qe=l.useCallback((e=>{X(T,e)}),[T,X]),Xe=l.useCallback((()=>{const e=[...qe.map((e=>{const t=De.includes(e),n=ce.has(e)&&!0!==ce.get(e),o=(0,d.getInputName)(e);return{text:t?n?`Hide input "${o}" (disconnect first)`:`Hide input "${o}"`:`Show input "${o}"`,onClick:()=>B(T,t?De.filter((t=>t!==e)):[...De,e]),disabled:n&&t}})),...Ue.map((e=>{const t=Se.includes(e),n=de.has(e),o=(0,d.getOutputName)(e);return{text:t?n?`Hide output "${o}" (disconnect first)`:`Hide output "${o}"`:`Show output "${o}"`,onClick:()=>q(T,t?Se.filter((t=>t!==e)):[...Se,e]),disabled:n&&t}})),...(0,d.isInlineNodeInstance)(T)&&(0,v.isVisualNode)(T.node)?[{text:"Ungroup inline node",onClick:()=>Z(T)}]:[],...(0,d.isInlineNodeInstance)(T)?[{text:"Extract inline node to file",onClick:()=>J(T)}]:[],{text:"Reorder inputs",onClick:Ge},{text:"Reorder outputs",onClick:Le},{text:"Set display name",onClick:Be},{text:"Group selected instances",onClick:Y},{text:"Delete instance",intent:"danger",onClick:Fe}];return(0,u.jsxs)(_.Menu,{children:[(0,u.jsx)(_.MenuItem,{text:"Style",children:(0,u.jsx)(N.NodeStyleMenu,{style:ue,onChange:Qe,promptFn:pe})}),e.map(((e,t)=>(0,a.createElement)(_.MenuItem,{...e,key:t})))]})}),[qe,Ue,T,Ge,Le,Be,Fe,ue,Qe,pe,De,ce,B,Se,de,q,Z,J,Y]),et={"--node-color":ue.color,...ue.cssOverride||{}},tt=(0,y.getInstanceDomId)(T.id,e.ancestorsInsIds);return(0,u.jsx)("div",{className:Re,children:(0,u.jsx)(g.BaseNodeView,{pos:T.pos,viewPort:k,onDragStart:ge,onDragMove:ye,onDragEnd:Ie,upperRenderer:Ye,bottomRenderer:Ke,displayMode:S,domId:tt,children:(0,u.jsxs)(l.Fragment,{children:[Ye(),W?x.default.createPortal((0,u.jsxs)("div",{className:"inline-group-editor-container no-drag",children:[(0,u.jsxs)("header",{children:[ze," ",(0,u.jsx)("button",{onClick:e.onCloseInlineEditor,children:"close"})]}),(0,u.jsx)(b.VisualNodeEditor,{...e.inlineGroupProps,className:"no-drag",ref:ae})]}),Q):(0,u.jsx)(_.ContextMenu,{className:(0,p.default)("ins-view-inner",Ve,`size-${re.size}`,{dark:ie}),onClick:Ne,onDoubleClick:we,content:Xe(),style:et,children:(0,u.jsx)(_.Tooltip,{content:R.description,children:(0,u.jsxs)(l.Fragment,{children:[ue.icon?(0,u.jsx)(c.FontAwesomeIcon,{icon:ue.icon}):null," ",ze]})})}),Ke()]})})})}},53568:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStyleMenu=t.nodeStylePresetColors=void 0;const r=n(35250),a=n(50382),u=s(n(70079)),l=n(84472);t.nodeStylePresetColors=[{name:"Amethyst",color:"#9b5de5"},{name:"Magenta",color:"#f15bb5"},{name:"Yellow",color:"#fee440"},{name:"Capri",color:"#00bbf9"},{name:"Sea Green",color:"#00f5d4"},{name:"Orange",color:"#ff7f00"}];const c={size:"regular"};t.NodeStyleMenu=e=>{var n;const{onChange:o,style:i}=e,s=i||c,d=e.promptFn,p=u.default.useCallback(((e,t)=>{o({...s,[e]:t})}),[s,o]),f=u.default.useCallback((async()=>{const e=await d("Icon name? (Font Awesome conventions)","rocket"),t=e.includes(",")?e.split(","):e;p("icon",t)}),[d,p]),m=(0,u.useCallback)((async()=>{const e=await d("Enter a custom style (valid JSON representing a React CSS object)",s.cssOverride?JSON.stringify(s.cssOverride):"");try{const t=JSON.parse(e);p("cssOverride",t)}catch(t){console.error(t),(0,l.toastMsg)("Invalid object","danger")}}),[d,p,s.cssOverride]);return(0,r.jsxs)(u.default.Fragment,{children:[(0,r.jsxs)(a.MenuItem,{text:"Color",children:[t.nodeStylePresetColors.map((e=>(0,r.jsx)(a.MenuItem,{text:e.name,onClick:()=>p("color",e.color)},e.name))),(0,r.jsx)(a.MenuDivider,{}),(0,r.jsx)(a.MenuItem,{text:"Remove Color",onClick:()=>p("color",void 0)})]}),(0,r.jsxs)(a.MenuItem,{text:`Size (${null!==(n=s.size)&&void 0!==n?n:"regular"})`,children:[(0,r.jsx)(a.MenuItem,{text:"Small",onClick:()=>p("size","small")}),(0,r.jsx)(a.MenuItem,{text:"Regular",onClick:()=>p("size","regular")}),(0,r.jsx)(a.MenuItem,{text:"Large",onClick:()=>p("size","large")})]}),(0,r.jsxs)(a.MenuItem,{text:"Icon",children:[(0,r.jsx)(a.MenuItem,{text:"Choose Icon",onClick:f}),(0,r.jsx)(a.MenuItem,{text:"Remove Icon",onClick:()=>p("icon",void 0)})]}),(0,r.jsx)(a.MenuItem,{text:"Custom Styling",onClick:m})]})}},88593:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(53568),t)},83651:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86553),t)},53159:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calcInstancePosition=t.calcNodeWidth=t.calcNodeContent=void 0;const i=n(74762),s=o(n(6576)),r=n(86553),a=n(61888),u=n(30994);t.calcNodeContent=(e,t)=>{if(e.displayName)return e.displayName;if(t.customViewCode)try{const n=Object.entries(e.inputConfig).filter((e=>{let[,t]=e;return(0,i.isStaticInputPinConfig)(t)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o.value}}),{});return s.default.compile(t.customViewCode)({inputs:n}).trim()}catch(n){return console.error("Error with custom view",n),`Error in custom view [${t.id}]`}return t.id};t.calcNodeWidth=(e,n)=>{const o=(0,i.okeys)(n.inputs).length*r.MIN_WIDTH_PER_PIN,s=(0,t.calcNodeContent)(e,n),u=r.PIECE_CHAR_WIDTH;return(0,a.clamp)(s.length*u+2*r.PIECE_HORIZONTAL_PADDING,o,r.MAX_INSTANCE_WIDTH)};t.calcInstancePosition=(e,t,n)=>{const o=(0,u.getInstanceDomId)(e,t),i=document.getElementById(o);if(i){const{x:e,y:t,width:o,height:s}=i.getBoundingClientRect(),r=t+s/2;return{x:e+o/2-n.x,y:r-n.y}}return console.warn("Cannot find element to draw connection to",o),{x:99999,y:99999}}},17841:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutDebugger=t.LayoutDebuggerItem=t.PosDebugger=void 0;const i=n(70079),s=n(35250),r=n(74762),a=o(n(70079)),u=n(7047),l=e=>{let{pos:t}=e;return(0,s.jsxs)("span",{children:[t.x.toFixed(1),", ",t.y.toFixed(1)]})};t.PosDebugger=e=>(0,s.jsx)("span",{className:"pos-debugger",children:(0,s.jsx)(l,{pos:e.pos})});t.LayoutDebuggerItem=e=>{const{pos:n,viewPort:o,size:i,color:r}=e,a=o.zoom,u=n.x*a-o.pos.x*a,l=n.y*a-o.pos.y*a,c={transform:`translate(${u-n.x}px, ${l-n.y}px)`},d={transform:`scale(${o.zoom})`},p={transform:`translate(${n.x}px, ${n.y}px)`},f={width:`${i.width}px`,height:`${i.height}px`,backgroundColor:r};return(0,s.jsx)("div",{className:"layout-debugger",style:c,children:(0,s.jsxs)("span",{className:"drag-sim",style:p,children:[(0,s.jsx)(t.PosDebugger,{pos:n}),(0,s.jsx)("div",{className:"layout-debugger-zoom-wrapper",style:d,children:(0,s.jsx)("div",{className:"layout-debugger-inner",style:f})})]})})};const c=(()=>{try{return"true"===localStorage.getItem("pos-debugger")}catch(e){return!1}})();t.LayoutDebugger=e=>{const{extraDebug:n,vp:o,node:d,mousePos:p}=e;if(!c)return null;const f=n.map(((e,n)=>(0,i.createElement)(t.LayoutDebuggerItem,{...e,key:n}))),m=[...d.instances.map((e=>e.pos)),...(0,r.values)(d.inputsPosition),...(0,r.values)(d.outputsPosition)].map((e=>(0,s.jsx)(t.LayoutDebuggerItem,{pos:e,viewPort:o,size:{width:0,height:0},color:"red"}))),v=(0,u.logicalPosToRenderedPos)(p,o),h=(0,s.jsxs)("div",{className:"viewport-data",children:[(0,s.jsxs)("div",{children:["Pos: ",(0,s.jsx)(l,{pos:o.pos})]}),(0,s.jsxs)("div",{children:["Zoom: ",o.zoom.toFixed(2)," "]}),(0,s.jsxs)("div",{children:["Mouse (logical): ",(0,s.jsx)(l,{pos:p})]}),(0,s.jsxs)("div",{children:["Rendered (rendered): ",(0,s.jsx)(l,{pos:v})]})]});return(0,s.jsxs)(a.default.Fragment,{children:[h,f,m]})}},44338:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(17841),t)},38259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateInstancesWithSingleConstPinsMap=t.getLeafInstancesOfSelection=void 0;t.getLeafInstancesOfSelection=(e,t,n)=>e.reduce(((e,o)=>[...e,...n.filter((e=>e.to.insId===o.id)).map((e=>t.find((t=>t.id===e.from.insId)))).filter((e=>!!e))]),[]).filter((t=>1===n.filter((e=>e.from.insId===t.id||e.to.insId===t.id)).length&&!e.includes(t)));t.calculateInstancesWithSingleConstPinsMap=(e,t)=>{const{connections:n}=e;return n.filter((e=>t.has(e.from.insId))).reduce(((e,n)=>{const o=t.get(n.from.insId),i=n.to.insId,s=e.get(i)||new Map;return s.set(n.to.pinId,{val:o,insId:n.from.insId}),e.set(i,s),e}),new Map)}},37488:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeIoView=void 0;const a=n(35250),u=n(70079),l=s(n(70079)),c=n(74762),d=n(83234),p=r(n(26372)),f=n(50382),m=n(43490),v=n(66189),h=n(74762),g=n(30994),I=n(30653);t.NodeIoView=l.memo((function(e){const{viewPort:t,selected:n,pos:o,type:i,id:s,onDblClick:r,onRename:y,onDelete:b,onChangeInputMode:C,inputMode:_,onSelect:x,closest:N,onSetDescription:w,description:j,onMouseUp:O,onMouseDown:P,currentInsId:E}=e,{history:D,resetHistory:S,refreshHistory:M}=(0,v.useHistoryHelpers)(E,s,i),T=(0,m.usePrompt)(),k=l.useCallback((async()=>{const e=await T("Description?",j);w(i,s,e)}),[T,j,w,i,s]),R=l.useCallback((()=>{b&&b(i,s)}),[i,s,b]),V=l.useCallback((()=>{y&&y(i,s)}),[i,s,y]),A=l.useCallback((e=>{C&&C(s,e)}),[s,C]),$=l.useCallback((()=>[{text:`Current mode - ${_}`,onClick:c.noop},{text:"Make required",onClick:()=>A("required")},{text:"Make optional",onClick:()=>A("optional")},{text:"Make required-if-connected",onClick:()=>A("required-if-connected")},{text:"Set description",onClick:k},...e.onRename?[{text:"Rename",onClick:V}]:[],...e.onDelete?[{text:"Delete",onClick:R}]:[]]),[k,_,A,R,V,e.onDelete,e.onRename]),z=l.useCallback((t=>{r&&r(e.id,t)}),[r,e.id]),H=l.useCallback((()=>{x(s,i)}),[s,i,x]),G=l.useCallback((()=>(0,a.jsx)(f.Menu,{children:$().map(((e,t)=>(0,u.createElement)(f.MenuItem,{...e,key:t})))})),[$]),L="input"===i?(0,h.getInputName)(s):(0,c.getOutputName)(s),F=l.useCallback((e=>{O(s,i,e)}),[s,O,i]),B=l.useCallback((e=>{P(s,i,e)}),[s,P,i]),q=(0,I.useDarkMode)();return(0,a.jsx)(d.BaseNodeView,{className:(0,p.default)("node-io-view",i,{dark:q}),pos:o,onDragEnd:(n,o)=>{const r=e.pos,a=(o.x-r.x)/t.zoom,u=(o.y-r.y)/t.zoom,l=r.x+a,c=r.y+u;e.onDragEnd(i,s,n,{...o,x:l,y:c})},onDragStart:(t,n)=>{e.onDragStart(s,t,n)},onDragMove:(t,n)=>{e.onDragMove(i,s,t,{x:n.x,y:n.y})},viewPort:t,children:(0,a.jsx)(l.Fragment,{children:(0,a.jsx)(f.Tooltip,{content:(()=>{const t=(0,v.calcHistoryContent)(D),n=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:L})," (",i,")"," "]}),n,(0,a.jsx)("hr",{}),t]})})(),children:(0,a.jsx)(f.ContextMenu,{onMouseEnter:M,onMouseOut:S,onMouseUp:F,onMouseDown:B,"data-tip":"","data-html":!0,"data-for":s+e.currentInsId,className:(0,p.default)("node-io-view-inner",{closest:N,selected:n,dark:q}),id:(0,g.getPinDomId)({fullInsIdPath:(0,c.fullInsIdPath)(e.currentInsId,e.ancestorInsIds),pinId:s,pinType:i,isMain:!0}),onClick:H,onDoubleClick:z,content:G(),children:s})})})})}))},66005:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37488),t)},83782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcNodeIoWidth=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0,t.PIECE_HORIZONTAL_PADDING=15,t.PIECE_CHAR_WIDTH=9,t.MIN_WIDTH_PER_PIN=40;t.calcNodeIoWidth=e=>Math.max(t.MIN_WIDTH_PER_PIN,e.length*t.PIECE_CHAR_WIDTH+2*t.PIECE_HORIZONTAL_PADDING)},99942:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderVisualNode=t.layoutToInstances=void 0;const i=n(63521),s=n(74762),r=n(90794),a=o(n(53865)),u=n(83782),l=n(60190),c=n(53159),d=n(41032);t.layoutToInstances=(e,t)=>(0,a.default)(t,(t=>{(0,s.entries)(e.nodes).forEach((e=>{let[n,o]=e;if(n.startsWith("ins-")){const e=n.replace("ins-",""),i=t.instances.find((t=>t.id===e));i?i.pos=o.p:console.warn("WAT")}if(n.startsWith("node-input-")){const e=n.replace("node-input-","");t.inputsPosition[e]=o.p}if(n.startsWith("node-output-")){const e=n.replace("node-output-","");t.outputsPosition[e]=o.p}}))}));t.orderVisualNode=(e,n,o,a)=>{const{instances:p,connections:f}=e,m={...p.reduce(((e,t)=>{const o=(0,l.size)((0,c.calcNodeWidth)(t,(0,d.safelyGetNodeDef)(t,n)),i.NODE_HEIGHT);return{...e,[`ins-${t.id}`]:{p:t.pos,s:o}}}),{}),...(0,s.okeys)(e.inputsPosition).reduce(((t,n)=>({...t,[`node-input-${n}`]:{p:e.inputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{}),...(0,s.okeys)(e.outputsPosition).reduce(((t,n)=>({...t,[`node-output-${n}`]:{p:e.outputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{})},v=f.map((e=>[(0,s.isExternalConnectionNode)(e.from)?`node-input-${e.from.pinId}`:`ins-${e.from.insId}`,(0,s.isExternalConnectionNode)(e.to)?`node-output-${e.to.pinId}`:`ins-${e.to.insId}`])),h=(0,r.orderLayout)({nodes:m,edges:v},o,((n,o)=>{a&&a((0,t.layoutToInstances)(n,e),o)}));return(0,t.layoutToInstances)(h,e)}},90794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderLayout=void 0;const o=n(60190),i=400,s=e=>e.reduce(((e,t)=>{const n=(0,o.vSub)(t.p,(0,o.vec)(t.s.width/2,t.s.height/2));return{...e,[t.id]:{p:n,s:t.s}}}),{});t.orderLayout=(e,t,n)=>{let{nodes:r,edges:a}=e,u=Object.entries(r).map((e=>{let[t,n]=e;return{id:t,p:(0,o.vAdd)(n.p,(0,o.vec)(n.s.width/2,n.s.height/2)),f:(0,o.vec)(0,0),v:(0,o.vec)(0,0),m:1,s:n.s}})),l=0;for(;l.01);){let e=u;for(let t=0;t{let n=e.find((e=>e.id===t[0])),i=e.find((e=>e.id===t[1]));if(!n||!i)return void console.warn("weoops",t[0],t[1]);const s=(0,o.vec)(0,-200),r=(0,o.vSub)(n.p,i.p),a=(0,o.vSub)(s,r),u=1e3*(0,o.vLen)(a),l=(0,o.vMul)((0,o.vNorm)(a),.5*u),c=(0,o.vMul)((0,o.vNorm)(a),-.5*u);n.f=(0,o.vAdd)(n.f,l),i.f=(0,o.vAdd)(i.f,c)})),e=e.map((e=>(0,o.itrPhysics)(15,e))),e=e.map((e=>{const t=(0,o.vMul)(e.v,.5),n=(0,o.vLen)(t)>100?(0,o.vMul)((0,o.vNorm)(t),100):t;return{...e,v:n}})),u=e,n&&n({nodes:s(e),edges:a},l),l++}return{nodes:s(u),edges:a,itrs:l,timeout:l>=t,total:(0,o.totalEnergy)(u)}}},2036:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PinView=t.PIN_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=n(50382),d=n(18420),p=n(74762),f=n(30994),m=n(96233),v=n(66189),h=n(30653);t.PIN_HEIGHT=23;t.PinView=u.memo((function(e){const{selected:t,type:n,connected:o,optional:i,currentInsId:s,isClosestToMouse:r,id:g,onMouseDown:I,onMouseUp:y}=e,{history:b,resetHistory:C,refreshHistory:_}=(0,v.useHistoryHelpers)(s,g,n),x=(0,h.useDarkMode)(),N="input"===n?(0,p.getInputName)(g):(0,p.getOutputName)(g),w="input"===e.type&&(0,d.isDefined)(e.constValue)?e.constValue:void 0,j=u.useCallback((e=>{0===e.button&&I(g,n,e)}),[g,n,I]),O=u.useCallback((e=>{0===e.button&&y(g,n,e)}),[g,n,y]);return(0,a.jsxs)("div",{className:(()=>{if("input"===e.type){const{isSticky:s,constValue:a}=e;return(0,l.default)("pin",{sticky:s,selected:t,closest:r,optional:i,connected:o,"const-value":(0,d.isDefined)(a),"env-value":(0,d.isDefined)(a)&&(0,p.isEnvValue)(a),minimized:e.minimized,dark:x},n)}return(0,l.default)("pin",{selected:t,connected:o,closest:r,optional:i,minimized:e.minimized,"error-pin":g===p.ERROR_PIN_ID,dark:x},n)})(),"data-pin-id":g,children:[(0,a.jsx)(c.Tooltip,{className:"pin-info-tooltip",content:(()=>{const t=(0,v.calcHistoryContent)(b,"input"===n?e.queuedValues:void 0),o=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:N})," (",n,")"," "]}),o,(0,a.jsx)("hr",{}),(0,d.isDefined)(w)?(0,a.jsxs)("div",{children:["Static value:"," ",(0,a.jsx)("strong",{children:(0,m.valuePreview)(w).substring(0,200)})]}):t]})})(),children:(0,a.jsxs)(c.ContextMenu,{onMouseEnter:_,onMouseOut:C,onMouseDown:j,onMouseUp:O,"data-tip":"","data-html":!0,"data-for":g+e.currentInsId,id:(0,f.getPinDomId)({fullInsIdPath:(0,p.fullInsIdPath)(e.currentInsId,e.ancestorsInsIds),pinId:g,pinType:n,isMain:!1}),onDoubleClick:t=>e.onDoubleClick&&e.onDoubleClick(g,t),className:(0,l.default)("pin-inner",{dark:x}),onClick:t=>{const{onShiftClick:o,onClick:i,id:s}=e;t.shiftKey&&o?o(s,t):i(s,n,t)},content:(()=>{const t=(0,a.jsx)(c.MenuItem,{onClick:()=>e.onInspect(e.currentInsId,{id:e.id,type:e.type}),text:"Inspect"});if("input"===e.type){const{onConvertConstToEnv:n}=e;return(0,d.isDefined)(w)?(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onDetachConstValue(e.id),text:"Detach value"}),(0,a.jsx)(c.MenuItem,{onClick:()=>e.onCopyConstValue(e.id),text:"Copy value"}),(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null,n?(0,a.jsx)(c.MenuItem,{onClick:()=>n(e.id),text:"Convert to Env Var"}):null]}):(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onToggleSticky(e.id),text:"Toggle sticky (square means sticky)"}),t,(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null]})}return(0,a.jsx)(c.Menu,{children:t})})(),children:[N," ",(0,d.isDefined)(w)?(0,a.jsxs)(u.Fragment,{children:[":",(0,a.jsx)("span",{className:"value",children:(0,d.toString)(w)})]}):null,"input"===e.type&&e.isSticky?(0,a.jsx)("span",{className:"suffix",children:"s"}):null,"input"===e.type&&e.queueSize?(0,a.jsxs)("span",{className:"suffix",children:[e.queueSize," in Q"]}):null]})}),(0,a.jsx)("div",{className:"wire"})]})}))},66189:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHistoryHelpers=t.calcHistoryContent=void 0;const i=n(35250),s=n(96233),r=o(n(70079)),a=n(70079),u=n(98158);t.calcHistoryContent=(e,t)=>{if(e){const{total:n,lastSamples:o}=e,a=(0,i.jsxs)("strong",{children:["Activated ",n," times this session"]}),u=o.length>0?(0,i.jsxs)("div",{children:["Last value:"," ",(0,i.jsx)("strong",{children:(0,s.valuePreview)(o[0].val).substring(0,200)}),(0,i.jsx)("br",{}),(0,i.jsx)("em",{children:"Inspect instance for the full value"})]}):"",l=t?(0,i.jsx)(r.default.Fragment,{children:(0,i.jsxs)("div",{children:["Queued values: ",(0,i.jsx)("strong",{children:t})]})}):"";return(0,i.jsxs)(r.default.Fragment,{children:[a,u,l]})}return"Loading session data.."};t.useHistoryHelpers=(e,t,n)=>{const o=(0,a.useRef)(),{onRequestHistory:i}=(0,u.useDebuggerContext)(),[s,l]=(0,a.useState)();return{history:s,refreshHistory:(0,a.useCallback)((()=>{clearInterval(o.current),i(e,t,n).then((e=>{l(e)})),o.current=setInterval((()=>{i(e,t,n).then((e=>{l(e)}))}),500)}),[e,i,t,n]),resetHistory:r.default.useCallback((()=>{clearInterval(o.current),l(void 0)}),[])}}},89440:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAddMenu=void 0;const r=n(35250),a=s(n(70079)),u=n(74762),l=n(50382),c=n(70457),d=n(9958),p=n(86125),f=c.Select.ofType(),m=e=>{switch(e.type){case"node":return`${e.node.id}`;case"value":return"Add inline value or function";case"import":return`Import ${e.importableNode.node.id} from ${e.importableNode.module}`}},v=(e,t)=>{let{handleClick:n,modifiers:o,query:i}=t;if(!o.matchesPredicate)return null;const s=m(e);return"value"===e.type?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(l.MenuDivider,{}),(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))]}):(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))},h=(e,t,n,o)=>{const i=m(t).toLocaleLowerCase(),s=e.toLowerCase();return o?i===s:i.includes(s)};t.QuickAddMenu=e=>{const{resolvedDependencies:t,targetNode:n}=e,o={left:e.pos.x,top:e.pos.y},{onRequestImportables:i}=(0,p.useDependenciesContext)(),[s,c]=a.useState();a.useEffect((()=>{i().then((e=>c(e.importables)))}),[i]);const d=(0,u.values)({...t,[n.id]:n}),m=d.map((e=>({type:"node",node:e}))),g=new Set(d.map((e=>e.id))),I=s?s.filter((e=>!g.has(e.node.id))).map((e=>({type:"import",importableNode:e}))):[],y=m.concat(I).concat({type:"value"});return(0,r.jsx)("div",{className:"quick-add-menu",style:o,children:(0,r.jsx)(f,{className:"quick-add-nodes-select",items:y,itemPredicate:h,itemRenderer:v,inputProps:{className:"quick-add-input"},noResults:(0,r.jsx)(l.MenuItem,{disabled:!0,text:"No results."}),onItemSelect:t=>e.onAdd(t),popoverProps:{isOpen:!0,onClose:()=>e.onClose()}})})}},71033:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89440),t)},73470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimePlayer=void 0;const o=n(74762),i=n(64955),s=(0,o.debugLogger)("runtime-player");t.createRuntimePlayer=()=>{let e=0,t=[];let n=!1,r=Date.now(),a=e;const u=()=>requestAnimationFrame((()=>{const l=Date.now();a=e,e+=l-r,r=l,((e,n)=>{const r=t;t=[],r.length&&s(`Playing ${r.length} events from`,e,n),r.forEach((e=>{s("Playing event",e),(0,i.playEvent)(e),e.insId===o.ROOT_INS_ID&&e.type===o.DebuggerEventType.PROCESSING_CHANGE&&!1===e.val&&(s("Main instance is done processing, clearing runtime UI",e),c())}))})(a,e),n&&u()})),l=()=>{n=!1},c=()=>{document.querySelectorAll("[data-runtime]").forEach((e=>{e.removeAttribute("data-runtime")})),document.querySelectorAll("[data-runtime-queue]").forEach((e=>{e.removeAttribute("data-runtime-queue")})),t=[]};return{stop:l,start:function(t){void 0===t&&(t=0),n=!0,e=t,r=Date.now(),u()},addEvents:e=>{t.push(...e)},destroy:()=>{l(),c()},clear:c,status:()=>({running:n,currDt:e,lastDt:a,queue:t,last:r})}}},64955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playEvent=t.cancelTimers=void 0;const o=n(74762),i=n(30994),s=5e3,r=(0,o.debugLogger)("runtime-player:play-event"),a=(e,t)=>e.type===o.DebuggerEventType.INPUT_CHANGE||e.type===o.DebuggerEventType.OUTPUT_CHANGE?`${(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds)}.${e.pinId}`:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds);t.cancelTimers=new Map;t.playEvent=e=>{switch(e.type){case o.DebuggerEventType.INPUT_CHANGE:case o.DebuggerEventType.OUTPUT_CHANGE:{const{pinId:n,insId:u,ancestorsInsIds:l}=e,c=e.type===o.DebuggerEventType.INPUT_CHANGE?"input":"output",d=[(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!0})];u!==o.ROOT_INS_ID&&d.push((0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!1})),d.forEach(((i,l)=>{const c=a(e);clearTimeout(t.cancelTimers.get(c));const d=document.getElementById(i),p=`${u}.${n}`,f=e.type===o.DebuggerEventType.OUTPUT_CHANGE?document.querySelectorAll(`[data-from-id="${p}"]`):[];if(d){clearTimeout(t.cancelTimers.get(c)),d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),setTimeout((()=>{d.setAttribute("data-runtime","active"),f.forEach((e=>{e.setAttribute("data-runtime","active")}))}),0);const n=setTimeout((()=>{d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),t.cancelTimers.delete(c)}),s);t.cancelTimers.set(a(e),n)}else console.warn(`No DOM element with Id [${i}] found to play event`),r(`No DOM element with Id [${i}] found to play event`,e)}));break}case o.DebuggerEventType.PROCESSING_CHANGE:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(l)if(!0===e.val)l.setAttribute("data-runtime","processing"),clearTimeout(t.cancelTimers.get(u));else{l.removeAttribute("data-runtime"),setTimeout((()=>{"error"!==l.getAttribute("data-runtime")&&l.setAttribute("data-runtime","done")}),0);const e=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,e)}else r(`No DOM element with Id [${n}] found to play event`,e)}));break}case o.DebuggerEventType.ERROR:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(!l)return void r(`No DOM element with Id [${n}] found to play event`,e);clearTimeout(t.cancelTimers.get(u)),l.removeAttribute("data-runtime"),setTimeout((()=>{l.setAttribute("data-runtime","error")}));const c=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,c)}));const c={...e,type:o.DebuggerEventType.OUTPUT_CHANGE,pinId:o.ERROR_PIN_ID};(0,t.playEvent)(c);break}case o.DebuggerEventType.INPUTS_STATE_CHANGE:(0,o.entries)(e.val).forEach((t=>{let[n,s]=t;const{insId:a,ancestorsInsIds:u}=e,l=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(a,u),pinId:n,pinType:"input",isMain:!1}),c=document.getElementById(l);c?s>0?c.setAttribute("data-runtime-queue",`${s}`):c.removeAttribute("data-runtime-queue"):r(`No DOM element with Id [${l}] found to play event`,e)}))}}},25804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounce=void 0;const o=n(70079);t.useDebounce=function(e,t){const[n,i]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}},7047:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.handleChangeNodeInputType=t.handleIoPinRename=t.handleInstanceDrag=t.getInstancesInRect=t.isJsxValue=t.getMiddleOfViewPort=t.fitViewPortToNode=t.centerBoardPosOnTarget=t.renderedPosToLogicalPos=t.logicalPosToRenderedPos=t.getEffectiveNodeDimensions=t.calcNodesPositions=t.calcSelectionBoxArea=t.animateViewPort=t.easeInOutNum=t.easeInOutPos=t.easeInOutQuad=t.center=t.distance=t.clamp=t.domToViewPort=t.roundNumber=t.createNewNodeInstance=t.createNewInlineNodeInstance=t.parseInputOutputTypes=t.parsePromptValue=t.getSelectionBoxRect=t.findClosestPin=t.changePinConfig=t.getInstancePinConfig=t.emptyList=t.emptyObj=void 0;const r=s(n(53865)),a=n(30721),u=n(63521),l=n(74762),c=n(18243),d=n(74762),p=n(53159),f=n(83782),m=n(60190),v=n(38259),h=n(83651),g=n(41032);t.emptyObj={},t.emptyList=[],t.getInstancePinConfig=function(e,n,o){var i;const s=e.instances.find((e=>e.id===n));if(!s)throw new Error(`Instance ${n} not found`);return null!==(i=(s.inputConfig||t.emptyObj)[o])&&void 0!==i?i:(0,l.queueInputPinConfig)()};t.changePinConfig=(e,t,n,o)=>r.produce(e,(e=>{var i;const{instances:s}=e,r=s.find((e=>e.id===t));if(!r)throw new Error("blah");const a=null!==(i=r.inputConfig)&&void 0!==i?i:{};a[n]=o,e.instances=s.map((e=>e===r?{...r,inputConfig:a}:e))}));t.findClosestPin=(e,t,n,o,i,s,r)=>{const a=(0,l.nodeInstance)(e.id,e.id),u=(0,d.okeys)(e.inputs).map((e=>({id:e,type:"input",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),p=(0,d.okeys)(e.outputs).map((e=>({id:e,type:"output",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),f=[...u,...e.instances.reduce(((n,a)=>{const u=(0,g.safelyGetNodeDef)(a,t),d=(0,h.getVisibleInputs)(a,u,e.connections),p=(0,h.getVisibleOutputs)(a,u,e.connections);return[...n,...d.map((e=>({ins:a,type:"input",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!1}),id:e}))),...p.map((e=>({ins:a,type:"output",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!1}),id:e})))]}),[]),...p];let m={dis:1e5,item:f[0]};return f.forEach((e=>{const t=e.pos.x-n.x,o=e.pos.y-n.y,i=Math.sqrt(t*t+o*o);i{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x,t.x)-n,h:Math.max(e.y,t.y)-o}};t.parsePromptValue=e=>{if(null===e)return;const t=parseInt(e,10);let n=e;return t.toString()!=e||isNaN(t)||(n=t),n};t.parseInputOutputTypes=e=>{const[,t,n]=e.match(/node\((.+)\|(.+)\)/)||[],o=(0,d.entries)(JSON.parse(t)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]})),i=(0,d.entries)(JSON.parse(n)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]}));return{inputs:(0,d.fromEntries)(o),outputs:(0,d.fromEntries)(i)}};t.createNewInlineNodeInstance=function(e,t,n){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const o=(0,l.inlineNodeInstance)(`${e.id}-${(0,d.randomInt)(999)}`,e,{},{x:0,y:0}),i=(0,p.calcNodeWidth)(o,e),{x:s,y:r}=n,a={x:s-i/2,y:r+t};return{...o,pos:a}};t.createNewNodeInstance=function(e,t,n,o){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const i="string"==typeof e?(0,g.safelyGetNodeDef)(e,o):e;if(!i)throw new Error(`${e} node not found in resolvedNodes`);const s=(0,d.entries)(i.inputs).reduce(((e,t)=>{let[n,o]=t;return o.defaultValue&&(e[n]=(0,l.staticInputPinConfig)(o.defaultValue)),e}),{}),r=(0,l.nodeInstance)((0,a.createId)(),i.id,s,{x:0,y:0}),c=(0,p.calcNodeWidth)(r,i),{x:f,y:m}=n,v={x:f-c/2,y:m+t};return{...r,pos:v}};t.roundNumber=e=>Math.round(100*e)/100;t.domToViewPort=(e,n,o)=>({x:(0,t.roundNumber)(n.pos.x+e.x/n.zoom/o.zoom),y:(0,t.roundNumber)(n.pos.y+e.y/n.zoom/o.zoom)});t.clamp=(e,t,n)=>Math.max(e,Math.min(t,n));t.distance=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)};t.center=(e,t,n)=>{let{zoom:o}=n;const i=e.x+e.w/2,s=e.y+e.h/2,{w:r,h:a}=t;return{x:i-r/o/2,y:s-a/o/2}};t.easeInOutQuad=e=>e<.5?2*e*e:(4-2*e)*e-1;t.easeInOutPos=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i),a=(0,t.easeInOutQuad)(r),u=n.x-e.x,l=n.y-e.y;return{x:e.x+u*a,y:e.y+l*a}};t.easeInOutNum=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i);return e+(n-e)*(0,t.easeInOutQuad)(r)};t.animateViewPort=(e,n,o,i)=>{const s=(0,t.distance)(e.pos,n.pos),r=Date.now(),a=o;if(0===s)return void i(e);const u=()=>{const o=Date.now(),s=(0,t.easeInOutPos)(e.pos,n.pos,r,a,o),l=(0,t.easeInOutNum)(e.zoom,n.zoom,r,a,o);o-r{const n=(0,t.getSelectionBoxRect)(e.from,e.to);return n.h*n.w};const I=(e,t,n,o)=>({left:n.x,right:n.x+e,top:n.y,bottom:n.y+t,tag:o,center:(0,l.calcCenter)({w:e,h:t,...n})});t.calcNodesPositions=(e,t)=>[...e.instances.map((e=>{const n=(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,t)),o=u.NODE_HEIGHT;return I(n,o,e.pos,e.id)})),...(0,d.okeys)(e.inputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.inputsPosition[t]||{x:0,y:0};return I(n,o,i,"input_"+t)})),...(0,d.okeys)(e.outputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.outputsPosition[t]||{x:0,y:0};return I(n,o,i,"output"+t)}))];t.getEffectiveNodeDimensions=(e,n)=>{const o=(0,t.calcNodesPositions)(e,n),i=o[0]||{left:0,right:0,top:0,bottom:0},s=o.reduce(((e,t)=>t.leftt.right>e?t.right:e),i.right),a=o.reduce(((e,t)=>t.topt.bottom>e?t.bottom:e),i.bottom)-a,d={x:s,y:a};return{size:{width:u,height:c},pos:d,center:(0,l.calcCenter)({w:u,h:c,...d})}};t.logicalPosToRenderedPos=(e,t)=>{const n=(0,m.vSub)(e,t.pos);return(0,m.vMul)(n,t.zoom)};t.renderedPosToLogicalPos=(e,t)=>{const n=(0,m.vDiv)(e,t.zoom);return(0,m.vAdd)(t.pos,n)};t.centerBoardPosOnTarget=(e,n,o,i)=>{const s=(0,t.logicalPosToRenderedPos)(e,i),r=(0,t.renderedPosToLogicalPos)(s,{...i,zoom:o}),a=Math.max(e.x,r.x)-Math.min(e.x,r.x),u=Math.max(e.y,r.y)-Math.min(e.y,r.y);return{x:o>i.zoom?i.pos.x+a:i.pos.x-a,y:o>i.zoom?i.pos.y+u:i.pos.y-u}};t.fitViewPortToNode=function(e,n,o,i){void 0===i&&(i=[20,150]);const{size:s,center:r}=(0,t.getEffectiveNodeDimensions)(e,n),a=i[0],u=i[1],l=s.width+a,c=s.height+u,d=o.width/l,p=o.height/c,f=Math.min(d,p)/1.15,m=(0,t.clamp)(.3,1.2,f);return{zoom:m,pos:{x:r.x-o.width/2/m,y:r.y-o.height/2/m+20}}};t.getMiddleOfViewPort=(e,n)=>{const o={x:n.width/2,y:n.height/2};return(0,t.renderedPosToLogicalPos)(o,e)};t.isJsxValue=e=>{const t=e=>(0,d.isDefined)(e.ref)&&(0,d.isDefined)(e.type)&&(0,d.isDefined)(e.props);try{const n=JSON.parse(e);return t(n)||Array.isArray(n)&&t(n[0])}catch(n){return!1}};t.getInstancesInRect=(e,n,o,i,s,r,a)=>{const{from:c,to:d}=e,f=(0,t.getSelectionBoxRect)(c,d);return s.filter((e=>{const{pos:t}=e,i={...t,w:(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,n))*o.zoom*a.zoom,h:u.NODE_HEIGHT*o.zoom*a.zoom};return(0,l.intersectRect)(f,i)||(0,l.intersectRect)(i,f)})).map((e=>e.id))};t.handleInstanceDrag=(e,t,n,o,i,s)=>{o.preventDefault(),o.stopPropagation();const a=(0,m.vSub)(n,t.pos);let u;const l=r.produce(e,(e=>{const r=e.instances.find((e=>e.id===t.id));if(!r)throw new Error("impossible state dragging instance that does not exist");!o.shiftKey&&s&&(u=[s]);const l=e.instances.filter((e=>i.includes(e.id)&&e!==r)),c=[r,...l],d=(0,v.getLeafInstancesOfSelection)(c,e.instances,e.connections);[...l,...d].forEach((e=>{e.pos=(0,m.vAdd)(e.pos,a)})),r.pos=n,!o.shiftKey&&s&&(u=[s])}));return{newValue:l,newSelected:u}};t.handleIoPinRename=(e,t,n,o)=>r.produce(e,(e=>{"input"===t?(e.inputs[o]=e.inputs[n],e.inputsPosition[o]=e.inputsPosition[n],delete e.inputs[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===n?{...e,from:{...e.from,pinId:o}}:e))):(e.outputs[o]=e.outputs[n],e.outputsPosition[o]=e.outputsPosition[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===n?{...e,to:{...e.to,pinId:o}}:e)),e.completionOutputs=(e.completionOutputs||[]).map((e=>e.split("+").map((e=>e===n?o:n)).join("+"))),delete e.outputs[n])}));t.handleChangeNodeInputType=(e,t,n)=>r.produce(e,(e=>{const o=e.inputs[t];if(!o)throw new Error("Wat");o.mode=n}))},42403:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorClient=void 0;const i=n(74762),s=o(n(18706)),r=n(32048),a=n(31758),u=(0,i.debugLogger)("remote-debugger:editor-client");t.createEditorClient=(e,t)=>{const n=new URL(e),o=(0,r.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/editor`,timeout:3e4});return o.emit("join-room-editor",t),{emitChange:e=>{o.emit(a.DebuggerServerEventType.CHANGE_EVENT_NAME,e)},emitBreakpointsChange:e=>{o.emit(a.DebuggerServerEventType.UPDATE_BREAKPOINTS,e)},interceptInput:e=>{o.emit(a.DebuggerServerEventType.INPUT_VALUE_OVERRIDE,e)},interceptOutput:e=>{o.emit(a.DebuggerServerEventType.OUTPUT_VALUE_OVERRIDE,e)},onRuntimeReady:e=>(o.on(a.DebuggerServerEventType.RUNTIME_READY,e),()=>o.off(a.DebuggerServerEventType.RUNTIME_READY,e)),onChangeAwk:e=>(o.on(a.DebuggerServerEventType.CHANGE_AWK,e),()=>o.off(a.DebuggerServerEventType.CHANGE_AWK,e)),onChangeError:e=>(o.on(a.DebuggerServerEventType.CHANGE_ERROR,e),()=>o.off(a.DebuggerServerEventType.CHANGE_ERROR,e)),onIsAlive:e=>(o.on(a.DebuggerServerEventType.IS_ALIVE,e),()=>o.off(a.DebuggerServerEventType.IS_ALIVE,e)),emitInputValue:(e,t)=>{u(`Emitting push input value to ${e} %o`,t),o.emit(a.DebuggerServerEventType.PUSH_INPUT_VALUE,{pinId:e,value:t})},destroy:()=>{o.disconnect(),(0,a.enumToArray)(a.DebuggerServerEventType).forEach((e=>o.off(e)))},onDisconnect:e=>(o.on("disconnect",e),()=>o.off("disconnect",e)),debugInfo:()=>`Remote debugger for ${e}`,onBatchedEvents:e=>(o.on(a.DebuggerServerEventType.EVENTS_BATCH,e),()=>o.off(a.DebuggerServerEventType.EVENTS_BATCH,e)),requestState:()=>s.default.get(`${e}/state`).then((e=>e.data.state)),getHistory:n=>s.default.get(`${e}/history`,{params:{insId:n.insId,pinId:n.pinId,limit:n.limit,executionId:t}}).then((e=>e.data)),clearHistory:()=>s.default.delete(`${e}/history`).then((()=>{})),triggerNode:(t,n)=>s.default.post(`${e}/trigger`,{nodeId:t,inputs:n}).then((e=>e.data))}}},58066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeData=void 0;const o=n(74762),i=n(36783),s=(0,o.debugLogger)("remote-debugger:normalize-data");t.normalizeData=e=>{if(e instanceof Error)return(0,i.serializeError)(e);if("object"==typeof e&&null!==e){e={...e};const t=new WeakSet,n=e=>{if("bigint"==typeof e)return e.toString();if("object"!=typeof e||Array.isArray(e))return e;if(null===e)return e;if(t.has(e))return"[Circular]";try{t.add(e)}catch(o){s("Error adding to WeakSet","data:",e,"type:",typeof e,"error:",o)}if(Array.isArray(e))return e.map(n);if("object"==typeof e){const t={};for(const o in e)t[o]=n(e[o]);return t}return e};return n(e)}return e}},39641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimeClient=t.DEFAULT_DT_SCALE=void 0;const o=n(74762),i=n(32048),s=n(31758),r=n(58066),a=(0,o.debugLogger)("remote-debugger:runtime-client");t.DEFAULT_DT_SCALE=1;t.createRuntimeClient=(e,t)=>{const n=new URL(e),u=(0,i.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/runtime`,timeout:1e3,reconnectionAttempts:3});u.emit("join-room-runtime",t),u.on("connection",(e=>{e.join(t)}));let l=new Set;u.on(s.DebuggerServerEventType.UPDATE_BREAKPOINTS,(e=>{l=new Set(e)}));const c=(0,o.cappedArrayDebounce)((e=>{a(`Emitting debounced batched events - ${e.length}`),u.emit(s.DebuggerServerEventType.EVENTS_BATCH,e)}),100,200);return{onChange:e=>(u.on(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e),()=>u.off(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e)),onInput:e=>(u.on(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e),()=>u.off(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e)),emitEvent:e=>{a(`Emitting event ${e.type} change event of ${e.insId}`),e.val=(0,r.normalizeData)(e.val),c.addItem({...e,time:Date.now()})},emitRuntimeReady:()=>{u.emit(s.DebuggerServerEventType.RUNTIME_READY,{})},emitChangeAwk:()=>{u.emit(s.DebuggerServerEventType.CHANGE_AWK,{})},emitChangeError:e=>{u.emit(s.DebuggerServerEventType.CHANGE_ERROR,{error:e})},emitIsAlive:e=>{u.emit(s.DebuggerServerEventType.IS_ALIVE,{time:e})},destroy:async()=>{c.pendingItems()&&(c.flush(),await(0,o.delay)(100)),(0,s.enumToArray)(s.DebuggerServerEventType).forEach((e=>u.off(e))),u.disconnect()},onDisconnect:e=>(u.on("disconnect",e),()=>u.off("disconnect",e)),waitForConnection:()=>new Promise(((e,t)=>{u.connected?e():(u.on("connect_error",(e=>{t(`Socket connect error: ${e}`)})),u.on("connect",(()=>{e()})))}))}}},31758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerServerEventType=t.enumToArray=t.isNumber=t.isSimpleType=t.valuePreview=t.toString=void 0;const o=n(36783);t.toString=e=>{if("object"===typeof e){if(e instanceof Error)return JSON.stringify((0,o.serializeError)(e));try{return JSON.stringify(e).substr(0,250)}catch(t){return"Object (cannot stringify)"}}return`${e}`.substr(0,250)};t.valuePreview=e=>(0,t.toString)(e).substr(0,100);t.isSimpleType=e=>["number","string","boolean"].includes(typeof e);t.isNumber=e=>!1===isNaN(Number(e)),t.enumToArray=function(e){return Object.keys(e).filter(t.isNumber).map((t=>e[t]))},function(e){e.RUNTIME_READY="runtime-ready",e.CHANGE_EVENT_NAME="change",e.PUSH_INPUT_VALUE="push-input-value",e.CHANGE_AWK="live-change-awk",e.CHANGE_ERROR="live-change-error",e.IS_ALIVE="is-alive",e.UPDATE_BREAKPOINTS="update-breakpoints",e.INPUT_VALUE_OVERRIDE="input-value-override",e.OUTPUT_VALUE_OVERRIDE="output-value-override",e.INPUT_VALUE_CHANGE="input-value-changed",e.OUTPUT_VALUE_CHANGE="output-value-changed",e.PROCESSING_CHANGE="processing-changed",e.INPUTS_STATE_CHANGE="inputs-state-changed",e.NODE_ERROR="node-error",e.EVENTS_BATCH="events-batch"}(t.DebuggerServerEventType||(t.DebuggerServerEventType={}))},96233:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31758),t),i(n(42403),t),i(n(39641),t)},43920:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Equals=t.EqualsBoolean=t.Throttle=t.ThrottleError=t.Debounce=t.Interval=t.Delay=t.Switch4=t.Switch2=t.Switch3=t.EmitOnTrigger=t.BooleanSplit=t.Subscribe=t.Publish=t.RoundRobin4=t.RoundRobin2=t.RoundRobin3=t.LimitTimes=void 0;const o=n(11253),i="Control Flow";t.LimitTimes={id:"Limit Times",namespace:i,description:"Item will be emitted until the limit is reached",inputs:{item:{mode:"required",description:"The item to emit"},times:{mode:"required",description:"The number of times to emit the item"},reset:{mode:"optional",description:"Reset the counter"}},outputs:{ok:{}},reactiveInputs:["item","reset"],completionOutputs:[],run:function(e,t,n){const{state:o}=n,{item:i,times:s,reset:r}=e,{ok:a}=t;if(void 0!==r)return void o.set("val",0);let u=o.get("val")||0;u++,o.set("val",u),u>=s?n.onError(new Error(`Limit of ${s} reached`)):a.next(i)}},t.RoundRobin3={id:"Round Robin 3",namespace:i,description:"Item will be emitted to one of the three outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r}=t,a=o.get("curr")||0,u=(a+1)%3;[i,s,r][a].next(e.item),o.set("curr",u)}},t.RoundRobin2={namespace:i,id:"Round Robin 2",description:"Item will be emitted to one of the 2 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s}=t,r=o.get("curr")||0,a=(r+1)%2;[i,s][r].next(e.item),o.set("curr",a)}},t.RoundRobin4={id:"Round Robin 4",namespace:i,description:"Item will be emitted to one of the 4 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves to "r4"\'s turn.'},r4:{description:'The fourth output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r,r4:a}=t,u=o.get("curr")||0,l=(u+1)%4;[i,s,r,a][u].next(e.item),o.set("curr",l)}},t.Publish={id:"Publish",namespace:i,description:"Publishes a value by a key to all listeners in the current flow. Use 'Subscribe' to listen to events.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},value:{mode:"required"}},outputs:{},run:function(e,t,n){const i=`${n.ancestorsInsIds}__${e.key}`;o.publish(i,e.value)}},t.Subscribe={id:"Subscribe",namespace:i,description:"Subscribes to a value published by a key. Use 'Publish' to publish values.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},initial:{mode:"required-if-connected",description:"If passed will be published has the first value"}},completionOutputs:[],outputs:{value:{description:"The value published by the key"}},run:function(e,t,n){const{value:i}=t,s=`${n.ancestorsInsIds}__${e.key}`,r=o.subscribe(s,((e,t)=>{i.next(t)}));void 0!==e.initial&&i.next(e.initial),n.onCleanup((()=>{o.unsubscribe(r)}))}},t.BooleanSplit={namespace:i,id:"Boolean Split",description:"Splits a boolean value into two outputs",inputs:{value:{mode:"required",description:"Boolean value"},trueValue:{mode:"required-if-connected",description:"Value to emit if the input is true. Defaults to true"},falseValue:{mode:"required-if-connected",description:"Value to emit if the input is false. Defaults to false"}},outputs:{true:{description:"The value is true"},false:{description:"The value is false"}},run:function(e,t){const{true:n,false:o}=t,{value:i,trueValue:s,falseValue:r}=e;i?n.next(null==s||s):o.next(null!=r&&r)}},t.EmitOnTrigger={namespace:i,id:"Emit on Trigger",description:"Emits the value when the trigger input receives any value",inputs:{value:{mode:"required",description:"The value to emit"},trigger:{mode:"required",description:"The trigger to emit the value"}},outputs:{result:{description:"The value emitted"}},run:function(e,t){const{result:n}=t,{value:o,trigger:i}=e;void 0!==i&&n.next(o)}},t.Switch3={namespace:i,id:"Switch 3",description:"Switches between 3 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,default:s,outputValue:r}=t,{value:a,firstCase:u,secondCase:l,thirdCase:c}=e;a===u?n.next(null!=r?r:a):a===l?o.next(null!=r?r:a):a===c?i.next(null!=r?r:a):s.next(null!=r?r:a)}},t.Switch2={id:"Switch 2",description:"Switches between 2 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,default:i,outputValue:s}=t,{value:r,firstCase:a,secondCase:u}=e;r===a?n.next(null!=s?s:r):r===u?o.next(null!=s?s:r):i.next(null!=s?s:r)}},t.Switch4={id:"Switch 4",description:"Switches between 4 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},fourthCase:{mode:"required",description:"The value to switch on for the fourth output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},fourth:{description:"The value emitted if the input value is equal to the fourth case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,fourth:s,default:r,outputValue:a}=t,{value:u,firstCase:l,secondCase:c,thirdCase:d,fourthCase:p}=e;u===l?n.next(null!=a?a:u):u===c?o.next(null!=a?a:u):u===d?i.next(null!=a?a:u):u===p?s.next(null!=a?a:u):r.next(null!=a?a:u)}},t.Delay={id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:i,description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:async(e,t)=>{let{value:n,delay:o}=e,{delayedValue:i}=t;await new Promise((e=>setTimeout(e,o))),i.next(n)}},t.Interval={id:"Interval",namespace:i,defaultStyle:{icon:"fa-clock"},description:"Emits a value every interval",inputs:{value:{description:"Value to emit"},interval:{description:"Interval in milliseconds"}},reactiveInputs:["value","interval"],outputs:{value:{description:"Emitted value"}},completionOutputs:[],run:(e,t,n)=>{n.state.get("timer")&&clearInterval(n.state.get("timer"));const o=setInterval((()=>{t.value.next(e.value)}),e.interval);n.state.set("timer",o),n.onCleanup((()=>{clearInterval(o)}))}},t.Debounce={id:"Debounce",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be debounced"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The debounced value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the last value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:s}=t,r=n.state.get("timer");r&&clearTimeout(r);const a=setTimeout((()=>{s.next(o)}),i);n.state.set("timer",a),n.onCleanup((()=>{clearTimeout(r)}))}};class s extends Error{constructor(e){super("Throttle: Value dropped"),this.value=e}}t.ThrottleError=s,t.Throttle={id:"Throttle",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be throttled"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The throttled value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the first value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:r}=t;if(n.state.get("timer"))n.onError(new s(o));else{r.next(o);const e=setTimeout((()=>{n.state.set("timer",null)}),i);n.state.set("timer",e)}}},t.EqualsBoolean={id:"Equals (Bool)",defaultStyle:{icon:"fa-equals"},namespace:i,description:"Emits true if two values are equal (=== equality). Otherwise emits false.",inputs:{a:{description:"First value"},b:{description:"Second value"}},outputs:{result:{description:"true if a is equal to b"}},run:(e,t)=>{let{a:n,b:o}=e,{result:i}=t;return i.next(n===o)}},t.Equals={id:"Equals",namespace:i,description:'Emits the value of "a" to output "true" if "a" is equal to "b". Otherwise emits the value of "a" to output "false".',inputs:{a:{mode:"required",description:"First value"},b:{mode:"required",description:"Second value"}},outputs:{true:{description:"Emits the value of a if a is equal to b"},false:{description:"Emits the value of a if a is not equal to b"}},run:(e,t)=>{const{a:n,b:o}=e,{true:i,false:s}=t;n===o?i.next(n):s.next(n)}}},65645:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var o=n(70079),i=n(11253),s=n(74089),r=n(74762),a=n(21766);var u=n(10831),l=n(61997),c=n(77852);const d=(0,a.S)(),p=[0,20],f=e=>{let{flow:t,output:n,inputs:o,onError:s,debugDelay:a,onCompleted:u,dependencies:l,player:c}=e;const p=((e,t)=>{const n=new Set;return{onEvent:o=>{const i={...o,time:Date.now(),executionId:"n/a"};console.info("Got debugger event",o),t.addEvents([i]),e.addEvents([i]),n.forEach((e=>e([i])))},onBatchedEvents:e=>(n.add(e),()=>n.delete(e))}})(c,d);p.debugDelay=a;const f=(0,r.keys)(t.node.outputs)[0];return{executeResult:(0,r.execute)({node:t.node,inputs:o,outputs:{[f]:n},resolvedDeps:{...l,[t.node.id]:t.node},_debugger:p,onCompleted:u,onBubbleError:e=>{s(e)},extraContext:{PubSub:i}}),localDebugger:p}},m=e=>{const{debugDelay:t,onOutput:i,flowProps:a}=e,{flow:m,inputs:v,output:h}=a,g=(0,o.useRef)((0,s.createRuntimePlayer)()),[I,y]=(0,o.useState)(e.flowProps.dependencies),[b,C]=(0,o.useState)(),[_]=(0,s.useDebounce)(I,500),x=(0,c.useDarkMode)(),N=async(e,t)=>{const{node:o}=e,i=Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).find((e=>(0,r.isBaseNode)(e)&&e.id===o.id));let a;y((e=>({...e,[i.id]:{...i,source:{path:"@flyde/stdlib/dist/all-browser",export:i.id}}})));const l=(0,u.ZP)(m,(n=>{if(t){const o=(0,s.vAdd)({x:0,y:0},t.pos);if(a=(0,s.createNewNodeInstance)(e.node,0,o,I),n.node.instances.push(a),t.connectTo){const{insId:e,outputId:o}=t.connectTo;n.node.connections.push({from:{insId:e,pinId:o},to:{insId:a.id,pinId:r.TRIGGER_PIN_ID}})}}}));await new Promise((e=>setTimeout(e,10)));const c=(0,u.ZP)(j,(e=>{e.flow=l,t?.selectAfterAdding&&a&&(e.boardData.selected=[a?.id])}));return O(c),(0,s.toastMsg)(`Node ${o.id} successfully imported from ${e.module}`),I},w=async()=>({importables:Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).filter(r.isBaseNode).map((e=>({node:{...e,source:{path:"n/a",export:"n/a"}},module:"@flyde/stdlib"}))),errors:[]}),[j,O]=(0,o.useState)({flow:m,boardData:{viewPort:{pos:{x:0,y:0},zoom:1},lastMousePos:{x:0,y:0},selected:[]}});(0,o.useEffect)((()=>{O((e=>({...e,flow:m})))}),[m]),(0,o.useEffect)((()=>{y((e=>({...e,main:j.flow.node})))}),[j.flow.node]);const P={state:j,onChangeEditorState:O,hideTemplatingTips:!0,initialPadding:p,onExtractInlineNode:r.noop,disableScrolling:!0,darkMode:x.isDarkMode};(0,o.useEffect)((()=>{g.current.start()}),[]),(0,o.useEffect)((()=>{const{executeResult:n,localDebugger:o}=f({flow:j.flow,dependencies:I,output:h,inputs:v,onError:r.noop,debugDelay:t,player:g.current,onCompleted:e.onCompleted}),s=e.flowProps.output.subscribe((e=>i(e)));return C(o),()=>{n(),s.unsubscribe()}}),[t,_]);const E=(0,o.useMemo)((()=>({resolvedDependencies:I,onImportNode:N,onRequestImportables:w})),[]),D=(0,o.useMemo)((()=>({debuggerClient:b,onRequestHistory:d.requestHistory})),[b]);return o.createElement(l.Z,null,(()=>o.createElement(s.DependenciesContextProvider,{value:E},o.createElement(s.DebuggerContextProvider,{value:D},o.createElement(s.FlowEditor,P)))))}},21766:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var o=n(74762);const i=200,s=()=>{const e=new Map,t=new Map;return{requestHistory:async(n,s,r)=>{const a="input"===r?o.DebuggerEventType.INPUT_CHANGE:o.DebuggerEventType.OUTPUT_CHANGE;if(console.log({insId:n,pinId:s,type:a}),s){const t=`${n}.${s}.${a}`,o=e.get(t)||{total:0,lastSamples:[]},r=o.lastSamples.slice(0,i);return{...o,lastSamples:r}}{const e=t.get(n)||{total:0,lastSamples:[]},o=e.lastSamples.slice(0,i);return{...e,lastSamples:o}}},addEvents:n=>{n.forEach((n=>{if(n.type===o.DebuggerEventType.ERROR){const e=n;e.type=o.DebuggerEventType.OUTPUT_CHANGE,e.pinId=o.ERROR_PIN_ID}if(n.type===o.DebuggerEventType.INPUT_CHANGE||n.type===o.DebuggerEventType.OUTPUT_CHANGE){const{insId:o,type:s,pinId:r}=n;{const t=`${o}.${r}.${s}`,a=e.get(t)||{total:0,lastSamples:[]};a.lastSamples.unshift(n),a.lastSamples.length>i&&a.lastSamples.splice(i,a.lastSamples.length-i),a.total++,e.set(t,a)}{const s=t.get(o)||{total:0,lastSamples:[]};s.lastSamples.unshift(n),s.lastSamples.length>i&&s.lastSamples.splice(i,s.lastSamples.length-i),s.total++,e.set(o,s)}}}))}}}},4144:(e,t,n)=>{"use strict";n.d(t,{V:()=>r});var o=n(10328),i=n(70079);const s=e=>i.createElement("li",{className:"log-item"},i.createElement("main",{className:"content"},e.value),i.createElement("aside",null,new Date(e.time).toLocaleTimeString())),r=e=>{const[t,n]=i.useState([]);return i.useEffect((()=>{e.output.subscribe((e=>{const t="object"==typeof e&&i.isValidElement(e)?e:`${e}`;n((e=>[...e,{value:t,time:Date.now()}]))}))}),[]),i.createElement("div",{className:"output-log"},i.createElement("header",null,"Output Log"," ",i.createElement("button",{className:"clear-btn button button--outline button--secondary button--sm",onClick:()=>n([])},"Clear")),i.createElement("main",null,i.createElement("ul",null,t.map(((e,t)=>i.createElement(s,(0,o.Z)({},e,{key:t}))))),0===t.length?i.createElement("div",{className:"empty-state"},"Nothing to show. Interact with the example to emit some outputs!"):null))}},79256:(e,t,n)=>{"use strict";n.d(t,{I:()=>p});var o=n(70079),i=n(65092),s=n(19841),r=n(49794),a=n(21766),u=n(73949),l=n(81098),c=n(65645);(0,a.S)();const d=[{title:"Hello World",key:"hello-world"},{title:"React Counter",key:"react-counter"},{title:"BMI Calculator",key:"bmi"},{title:"REST API Usage",key:"apis"},{title:"Debounce vs. Throttling",key:"debounce-throttling"},{title:"Fibonacci Seq.",key:"fibonacci"}],p=e=>{const[t,n]=(0,o.useState)(e.initWidth||500),[a,p]=(0,o.useState)(e.defaultDelay||0),[f,m]=(0,o.useState)(!1),v=(0,o.useCallback)(((e,t)=>{let{size:o}=t;n(o.width)}),[]),h=o.createElement("div",{className:"delay-container"},o.createElement("input",{type:"range",id:"volume",name:"delay",value:a,step:"100",min:"0",max:"300",onChange:e=>p(Number(e.target.value))}),o.createElement("label",{htmlFor:"volume"},"Debug Delay: ",a,"ms")),g=d.findIndex((t=>t.key===e.meta.key)),I=d[g+1],y=d[g-1];return o.createElement(i.Z,{title:`${e.meta.title} | Playground`,description:`Flyde Playground - ${e.meta.title} example`},o.createElement("header",{className:(0,s.default)("hero hero--primary",u.Z.heroBanner,"playground-hero")},o.createElement("div",{className:"container"},o.createElement("h1",{className:"hero__title"},"Welcome to Flyde's Online Playground"),o.createElement("p",{className:"hero__subtitle"},"Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!"))),o.createElement("div",{className:"mobile-warning"},"Flyde is currently not optimized for mobile devices. Please"," ",o.createElement("strong",null,"use a desktop computer for the best experience"),"."),o.createElement("ul",{className:"examples__menu"},d.map((e=>o.createElement("li",{key:e.key},o.createElement(r.Z,{to:`/playground/${e.key}`,className:"button button--primary"},e.title))))),o.createElement("div",{className:"playground-container"},o.createElement("header",null,o.createElement("h2",{className:"playground-title"},e.meta.title),o.createElement("div",{className:"playground-description"},e.meta.description),f?o.createElement(o.Fragment,null,o.createElement("hr",null),o.createElement("div",{className:"playground-extra"},e.extraInfo||e.meta.extraInfo,o.createElement("div",{className:"star-hint"},o.createElement("span",null,"\xa0 PS: Did you like this example?"),"Please consider giving a \u2b50\ufe0f to the project"," ",o.createElement("span",{className:"star-wrapper"},o.createElement("iframe",{className:"gh-stars-frame",src:"https://ghbtns.com/github-btn.html?user=flydelabs&repo=flyde&type=star&count=true&size=small",width:100,height:20,title:"GitHub Stars"}))))):null,e.prefixComponent),o.createElement("div",{className:"playground"},o.createElement("div",{className:"flow-container"},!0!==e.hideDelay?h:null,o.createElement(c.Y,{flowProps:e.flowProps,debugDelay:a,onOutput:()=>m(!0)})),o.createElement(l.Resizable,{height:0,width:t,onResize:v,handle:o.createElement("div",{className:"handle"}),axis:"x",resizeHandles:["w"]},o.createElement("div",{className:"output-container",style:{flexBasis:t}},e.children))),o.createElement("nav",{className:"pagination-nav"},o.createElement("div",{className:"pagination-nav__item"},y?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${y.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Previous Example"),o.createElement("div",{className:"pagination-nav__label"},y.title)):null),o.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},I?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${I.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Next Example"),o.createElement("div",{className:"pagination-nav__label"},I.title)):null))))}},74465:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var o=n(70079),i=n(10831),s=n(74762),r=n(79256);const a={dependencies:{Debounce:{id:"Debounce",namespace:"Control Flow",inputs:{value:{mode:"required",description:"The data that needs to be debounced"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The debounced value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the last value received after being idle for "wait" amount of milliseconds',run:n(43920).Debounce.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Debounce"}},Throttle:{id:"Throttle",namespace:"Control Flow",inputs:{value:{mode:"required",description:"The data that needs to be throttled"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The throttled value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the first value received after being idle for "wait" amount of milliseconds',run:n(43920).Throttle.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Throttle"}}},flow:{imports:{"@flyde/stdlib":["Debounce","Throttle"]},node:{instances:[{pos:{x:564.2311294555664,y:353.080333404541},id:"Debounce-194-d108",inputConfig:{ms:{mode:"static",value:1500},wait:{mode:"static",value:2e3}},visibleInputs:["value","wait","__trigger"],nodeId:"Debounce",style:{size:"large",color:"#f15bb5"}},{pos:{x:278.2552195739746,y:344.8639384841919},id:"Throttle-652",inputConfig:{threshold:{mode:"static",value:4e3},wait:{mode:"static",value:1500}},visibleOutputs:["result","__error"],nodeId:"Throttle",style:{size:"large",color:"#fee440"}},{pos:{x:375.39898803710935,y:498.85297454833983},id:"Inline-value-Value was thro-555",inputConfig:{},node:{id:"Inline-value-Value was thro",inputs:{},outputs:{r:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"outputs.r.next((`Value was throttled!`))",customViewCode:"`Value was throttled!`",dataBuilderSource:"YFZhbHVlIHdhcyB0aHJvdHRsZWQhYA==",templateType:"value",completionOutputs:["r"],defaultStyle:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"300"}}},style:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"300"}}},{pos:{x:50.283386535644524,y:575.9333444213867},id:"Inline-value-Throttle out-817",inputConfig:{},node:{id:"Inline-value-Throttle out",inputs:{value:{type:"any",mode:"required"}},outputs:{r:{type:"any",delayed:!1,optional:!1}},runFnRawCode:'outputs.r.next((`"Throttle" output - ${inputs.value}`))',customViewCode:'`"Throttle" output - ${inputs.value}`',dataBuilderSource:"YCJUaHJvdHRsZSIgb3V0cHV0IC0gJHtpbnB1dHMudmFsdWV9YA==",templateType:"value",completionOutputs:["r"],defaultStyle:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"300"}}},style:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"300"}}},{pos:{x:638.5763772583008,y:559.9217034912109},id:"Inline-value-Debounce out-720",inputConfig:{},node:{id:"Inline-value-Debounce out",inputs:{val:{type:"any",mode:"required"}},outputs:{r:{type:"any",delayed:!1,optional:!1}},runFnRawCode:'outputs.r.next((`"Debounce" output - ${inputs.val}`))',customViewCode:'`"Debounce" output - ${inputs.val}`',dataBuilderSource:"YCJEZWJvdW5jZSIgb3V0cHV0IC0gJHtpbnB1dHMudmFsfWA=",templateType:"value",completionOutputs:["r"],defaultStyle:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"300"}}},style:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"300"}}}],connections:[{from:{insId:"Inline-value-Value was thro-555",pinId:"r"},to:{insId:"__this",pinId:"result"}},{from:{insId:"Throttle-652",pinId:"result"},to:{insId:"Inline-value-Throttle out-817",pinId:"value"}},{from:{insId:"Inline-value-Throttle out-817",pinId:"r"},to:{insId:"__this",pinId:"result"}},{from:{insId:"Inline-value-Debounce out-720",pinId:"r"},to:{insId:"__this",pinId:"result"}},{from:{insId:"Throttle-652",pinId:"__error"},to:{insId:"Inline-value-Value was thro-555",pinId:"__trigger"}},{from:{insId:"__this",pinId:"input"},to:{insId:"Throttle-652",pinId:"value"}},{from:{insId:"__this",pinId:"input"},to:{insId:"Debounce-194-d108",pinId:"value"}},{from:{insId:"Debounce-194-d108",pinId:"result"},to:{insId:"Inline-value-Debounce out-720",pinId:"val"}}],id:"Main",inputs:{input:{mode:"required",type:"any"}},outputs:{result:{type:"any"}},inputsPosition:{value:{x:478.848314936081,y:129.00413662180574},ggg:{x:8.112505244875974,y:489.6946435546802},rr:{x:319.4,y:268.6},threshold:{x:485.56077831498897,y:225.21610416222086},input:{x:466.16074863066945,y:179.24732213758483}},outputsPosition:{result:{x:533.2714674326223,y:848.1304470496965},bb:{x:-119.26,y:783.62}},completionOutputs:[],reactiveInputs:["input"]}}};var u=n(4144);console.log({example:a});const l={title:"Debounce vs. Throttling",description:"This example takes Flyde's visual feedback to the next level by showing the difference between debouncing and throttling. Click on the buttons below to emit some Emojis.",key:"debounce-throttling"},c="Cool right? you can try duplicating nodes by pressing shift+D. Connect nodes together by clicking on the source node's output pin and then on a the targets node's input pin";function d(){const e=(0,o.useRef)((0,s.dynamicOutput)()),t=(0,o.useRef)({input:(0,s.dynamicNodeInput)()}),[n,d]=(0,o.useState)(1500),[p,f]=(0,o.useState)(4e3),[m,v]=(0,o.useState)({flow:a.flow,dependencies:a.dependencies,inputs:t.current,output:e.current});(0,o.useEffect)((()=>{v((0,i.Uy)(m,(e=>{const t=e.flow.node;if((0,s.isVisualNode)(t)){t.instances.find((e=>(0,s.isRefNodeInstance)(e)&&"Debounce"===e.nodeId)).inputConfig.wait=(0,s.staticInputPinConfig)(n);t.instances.find((e=>(0,s.isRefNodeInstance)(e)&&"Throttle"===e.nodeId)).inputConfig.wait=(0,s.staticInputPinConfig)(p)}})))}),[n,p]),(0,o.useEffect)((()=>{e.current.subscribe((e=>{}))}),[]);const h=o.createElement(o.Fragment,null,o.createElement("div",{style:{display:"flex",justifyContent:"center",gap:5}},o.createElement("input",{type:"range",id:"deb",name:"deb",value:n,step:"100",min:"0",max:"7500",onChange:e=>d(Number(e.target.value))}),o.createElement("label",{htmlFor:"deb"},"Debounce - ",n,"ms")),o.createElement("div",{style:{display:"flex",justifyContent:"center",gap:5}},o.createElement("input",{type:"range",id:"thr",name:"thr",value:p,step:"100",min:"0",max:"7500",onChange:e=>f(Number(e.target.value))}),o.createElement("label",{htmlFor:"thr"},"Throttle - ",p,"ms")),o.createElement("button",{className:"emit-btn button button--outline button--primary",onClick:()=>t.current.input.subject.next("\ud83d\udc36")},"Emit \ud83d\udc36"),o.createElement("button",{className:"emit-btn button button--outline button--primary",onClick:()=>t.current.input.subject.next("\ud83d\ude38")},"Emit \ud83d\ude38"),o.createElement("button",{className:"emit-btn button button--outline button--primary",onClick:()=>t.current.input.subject.next("\ud83e\udd84")},"Emit \ud83e\udd84"));return o.createElement(r.I,{meta:l,flowProps:m,prefixComponent:h,hideDelay:!0,extraInfo:c},o.createElement(u.V,{output:e.current}))}},73949:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={"flyde-flow-editor":"flyde-flow-editor_AAD4",_hj_feedback_container:"_hj_feedback_container_Af03"}},85721:(e,t,n)=>{var o={"./af":47654,"./af.js":47654,"./ar":61325,"./ar-dz":98344,"./ar-dz.js":98344,"./ar-kw":26230,"./ar-kw.js":26230,"./ar-ly":42524,"./ar-ly.js":42524,"./ar-ma":44119,"./ar-ma.js":44119,"./ar-sa":82625,"./ar-sa.js":82625,"./ar-tn":42182,"./ar-tn.js":42182,"./ar.js":61325,"./az":37093,"./az.js":37093,"./be":32721,"./be.js":32721,"./bg":59919,"./bg.js":59919,"./bm":95594,"./bm.js":95594,"./bn":563,"./bn-bd":41757,"./bn-bd.js":41757,"./bn.js":563,"./bo":73211,"./bo.js":73211,"./br":87438,"./br.js":87438,"./bs":83662,"./bs.js":83662,"./ca":61196,"./ca.js":61196,"./cs":5841,"./cs.js":5841,"./cv":85251,"./cv.js":85251,"./cy":24512,"./cy.js":24512,"./da":37539,"./da.js":37539,"./de":5059,"./de-at":53853,"./de-at.js":53853,"./de-ch":99378,"./de-ch.js":99378,"./de.js":5059,"./dv":91454,"./dv.js":91454,"./el":39651,"./el.js":39651,"./en-au":87953,"./en-au.js":87953,"./en-ca":98193,"./en-ca.js":98193,"./en-gb":61980,"./en-gb.js":61980,"./en-ie":14050,"./en-ie.js":14050,"./en-il":6502,"./en-il.js":6502,"./en-in":555,"./en-in.js":555,"./en-nz":11372,"./en-nz.js":11372,"./en-sg":26568,"./en-sg.js":26568,"./eo":69533,"./eo.js":69533,"./es":68327,"./es-do":17620,"./es-do.js":17620,"./es-mx":96467,"./es-mx.js":96467,"./es-us":83272,"./es-us.js":83272,"./es.js":68327,"./et":68523,"./et.js":68523,"./eu":19066,"./eu.js":19066,"./fa":59087,"./fa.js":59087,"./fi":96443,"./fi.js":96443,"./fil":93979,"./fil.js":93979,"./fo":90383,"./fo.js":90383,"./fr":56327,"./fr-ca":25610,"./fr-ca.js":25610,"./fr-ch":97274,"./fr-ch.js":97274,"./fr.js":56327,"./fy":67442,"./fy.js":67442,"./ga":44291,"./ga.js":44291,"./gd":77342,"./gd.js":77342,"./gl":96248,"./gl.js":96248,"./gom-deva":21404,"./gom-deva.js":21404,"./gom-latn":20833,"./gom-latn.js":20833,"./gu":9122,"./gu.js":9122,"./he":74623,"./he.js":74623,"./hi":60364,"./hi.js":60364,"./hr":30860,"./hr.js":30860,"./hu":70441,"./hu.js":70441,"./hy-am":90425,"./hy-am.js":90425,"./id":29672,"./id.js":29672,"./is":96150,"./is.js":96150,"./it":27852,"./it-ch":55603,"./it-ch.js":55603,"./it.js":27852,"./ja":16465,"./ja.js":16465,"./jv":20120,"./jv.js":20120,"./ka":87245,"./ka.js":87245,"./kk":21479,"./kk.js":21479,"./km":65038,"./km.js":65038,"./kn":63060,"./kn.js":63060,"./ko":85020,"./ko.js":85020,"./ku":90582,"./ku.js":90582,"./ky":34950,"./ky.js":34950,"./lb":94201,"./lb.js":94201,"./lo":87894,"./lo.js":87894,"./lt":70120,"./lt.js":70120,"./lv":4265,"./lv.js":4265,"./me":14030,"./me.js":14030,"./mi":9463,"./mi.js":9463,"./mk":25898,"./mk.js":25898,"./ml":64233,"./ml.js":64233,"./mn":47156,"./mn.js":47156,"./mr":34479,"./mr.js":34479,"./ms":24691,"./ms-my":6456,"./ms-my.js":6456,"./ms.js":24691,"./mt":81789,"./mt.js":81789,"./my":37452,"./my.js":37452,"./nb":91170,"./nb.js":91170,"./ne":87529,"./ne.js":87529,"./nl":81776,"./nl-be":24455,"./nl-be.js":24455,"./nl.js":81776,"./nn":34705,"./nn.js":34705,"./oc-lnc":36139,"./oc-lnc.js":36139,"./pa-in":17960,"./pa-in.js":17960,"./pl":1899,"./pl.js":1899,"./pt":31670,"./pt-br":29159,"./pt-br.js":29159,"./pt.js":31670,"./ro":55115,"./ro.js":55115,"./ru":45149,"./ru.js":45149,"./sd":81231,"./sd.js":81231,"./se":35397,"./se.js":35397,"./si":99786,"./si.js":99786,"./sk":39383,"./sk.js":39383,"./sl":68691,"./sl.js":68691,"./sq":34826,"./sq.js":34826,"./sr":40080,"./sr-cyrl":75673,"./sr-cyrl.js":75673,"./sr.js":40080,"./ss":54309,"./ss.js":54309,"./sv":52245,"./sv.js":52245,"./sw":8967,"./sw.js":8967,"./ta":10454,"./ta.js":10454,"./te":35204,"./te.js":35204,"./tet":81571,"./tet.js":81571,"./tg":15737,"./tg.js":15737,"./th":41786,"./th.js":41786,"./tk":50511,"./tk.js":50511,"./tl-ph":14828,"./tl-ph.js":14828,"./tlh":62422,"./tlh.js":62422,"./tr":97047,"./tr.js":97047,"./tzl":90792,"./tzl.js":90792,"./tzm":67730,"./tzm-latn":59963,"./tzm-latn.js":59963,"./tzm.js":67730,"./ug-cn":42535,"./ug-cn.js":42535,"./uk":33151,"./uk.js":33151,"./ur":22750,"./ur.js":22750,"./uz":61914,"./uz-latn":60231,"./uz-latn.js":60231,"./uz.js":61914,"./vi":55517,"./vi.js":55517,"./x-pseudo":64078,"./x-pseudo.js":64078,"./yo":70046,"./yo.js":70046,"./zh-cn":81832,"./zh-cn.js":81832,"./zh-hk":90953,"./zh-hk.js":90953,"./zh-mo":38236,"./zh-mo.js":38236,"./zh-tw":71001,"./zh-tw.js":71001};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=s,e.exports=i,i.id=85721}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5884],{19121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cappedArrayDebounce=void 0;t.cappedArrayDebounce=function(e,t,n,o){void 0===o&&(o=500);let i=[],s=null,r=null;return{addItem:a=>{clearTimeout(s),i.push(a),r||(r=setTimeout((()=>{e(i),clearTimeout(s),r=null}),o)),i.length>=n?(e(i),clearTimeout(r),r=null,i=[]):s=setTimeout((()=>{e(i),clearTimeout(r),r=null,i=[]}),t)},flush:()=>{i.length&&(e(i),i=[],clearTimeout(r))},pendingItems:()=>i.length}}},59792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.dataShaper=t.DataShapeType=void 0,function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.ARRAY=3]="ARRAY",e[e.OBJECT=4]="OBJECT",e[e.NULL=5]="NULL",e[e.UNSUPPORTED=6]="UNSUPPORTED"}(n=t.DataShapeType||(t.DataShapeType={}));const o={string:n.STRING,number:n.NUMBER,boolean:n.BOOLEAN,object:n.OBJECT,array:n.ARRAY,null:n.NULL,symbol:n.UNSUPPORTED,undefined:n.UNSUPPORTED,function:n.UNSUPPORTED,bigint:n.UNSUPPORTED};t.dataShaper=function(e,n,i){void 0===n&&(n=5),void 0===i&&(i=5);const s=null===(r=e)?"null":typeof r;var r,a;if("object"===s){if(Array.isArray(e))return n>1?e.filter(((e,t)=>t(0,t.dataShaper)(e,n-1,i))):o.array;if(n>1){const o={};for(const s in e)o[s]=(0,t.dataShaper)(e[s],n-1,i);return a=o,Object.keys(a).sort().reduce(((e,t)=>(e[t]=a[t],e)),{})}return o.object}return o[s]}},23046:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.debugLogger=void 0;const i=(0,o(n(55899)).default)("flyde");t.debugLogger=e=>i.extend(e)},24331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullInsIdPath=void 0,t.fullInsIdPath=function(e,t){if(!e)throw new Error("insId is not defined");return t?`${t}.${e}`:e}},34459:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hashFlow=t.hashNode=void 0;const i=o(n(68805)),s=n(30292),r=e=>(0,i.default)(e);t.hashNode=function(e,t){var n;void 0===t&&(t=!0);const{id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l}=e,c={id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l};if((0,s.isVisualNode)(e)){const{instances:n,connections:o,inputsPosition:i,outputsPosition:s}=e,a=n.map((e=>{const{pos:t,...n}=e;return n})),u=t?{}:{inputsPosition:i,outputsPosition:s},l=t?a:n;l.sort(((e,t)=>e.id.localeCompare(t.id)));const d=[...o];d.sort(((e,t)=>{const n=`${e.from.insId}.${e.from.pinId}`,o=`${t.from.insId}.${t.from.pinId}`;return n.localeCompare(o)}));const p=JSON.stringify({instancesToUse:l,conns:d,...c,maybeIoPos:u});return r(p)}if((0,s.isInlineValueNode)(e)){const{customViewCode:t}=e,o=null!==(n=e.fnCode)&&void 0!==n?n:e.runFnRawCode,i=JSON.stringify({fnCode:o,customViewCode:t,...c});return r(i)}throw new Error("Hashing code nodes unsupported")};t.hashFlow=e=>{const{node:n,imports:o}=e,i=(0,t.hashNode)(n,!1),s=Object.entries(null!=o?o:{}).sort(((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)})).map((e=>{let[t,n]=e;return[t,n.sort()]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{}),a=JSON.stringify(s);return r(i+a)}},86873:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DepGraph=void 0,i(n(3172),t),i(n(59962),t),i(n(23046),t),i(n(19121),t),i(n(59962),t),i(n(34459),t),i(n(39043),t),i(n(59792),t),i(n(24331),t),t.DepGraph=n(60359).DepGraph},3172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testDataCreator=void 0;t.testDataCreator=e=>function(t){void 0===t&&(t={});return{..."function"==typeof e?e():e,...t}}},59962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplePluralize=t.eventually=t.delay=t.noop=t.removeDupes=t.ensure=t.isOptionalType=t.callFnOrFnPromise=t.isPromise=t.isDefined=t.containsAll=t.shuffle=t.randomInts=t.repeat=t.pickRandom=t.randomPos=t.randomInt=t.pickSecond=t.pickFirst=t.fromEntries=t.entries=t.okeys=t.values=t.keys=t.filterOMap=t.mapOMap=t.middlePos=t.calcCenter=t.intersectRect=void 0;t.intersectRect=(e,t)=>{const n=e.x+e.w,o=t.x+t.w;return!(t.x>n||oe.y+e.h||t.y+t.h{let{w:t,h:n,x:o,y:i}=e;return{x:o+t/2,y:i+n/2}};t.middlePos=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});t.mapOMap=(e,n)=>(0,t.entries)(e).map((e=>{let[t,o]=e;return[t,n(t,o)]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.filterOMap=(e,n)=>(0,t.entries)(e).filter((e=>{let[t,o]=e;return n(t,o)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.keys=e=>Object.keys(e);t.values=e=>Object.values(e),t.okeys=t.keys;t.entries=e=>(0,t.okeys)(e).map((t=>[t,e[t]]));t.fromEntries=e=>e.reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.pickFirst=e=>e[0];t.pickSecond=e=>e[1];t.randomInt=function(e,t){void 0===t&&(t=0);const n=Math.random();return t+Math.floor((e-t)*n)};t.randomPos=function(e,n){void 0===e&&(e=1e3),void 0===n&&(n=0);return{x:(0,t.randomInt)(e,n),y:(0,t.randomInt)(e,n)}};t.pickRandom=e=>e[(0,t.randomInt)(e.length)];t.repeat=(e,t)=>"x".repeat(e).split("").map(((e,n)=>t(n)));t.randomInts=function(e,n,o){return void 0===n&&(n=100),void 0===o&&(o=0),(0,t.repeat)(e,(()=>(0,t.randomInt)(n,o)))};t.shuffle=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t};t.containsAll=(e,t)=>t.every((t=>e.includes(t)));t.isDefined=e=>void 0!==e;t.isPromise=e=>e&&"function"==typeof e.then;t.callFnOrFnPromise=(e,n)=>{if(!(0,t.isDefined)(e))return;const o=e=>{try{e()}catch(t){console.error(n,t)}};"function"==typeof e?o(e):Promise.resolve(e).then((e=>{"function"==typeof e&&o(e)}))};t.isOptionalType=e=>/\?$/.test(e);t.ensure=(e,t)=>{if(void 0===e)throw new Error(t||"Undefined value passed");return e};t.removeDupes=e=>Array.from(new Set(e));t.noop=()=>{};t.delay=e=>new Promise((t=>setTimeout(t,e)));t.eventually=async function(e,n,o,i){if(void 0===n&&(n=1e3),void 0===o&&(o=100),void 0===i&&(i=new Set),n<0){const e=Array.from(i).reduce(((e,t,n)=>`${e}\n\t\t${n+1}. ${t}`),"");throw new Error(`[Eventually timeout exceeded after: timeout with error]: ${e}`)}try{await e()}catch(s){const r=Date.now();await(0,t.delay)(o);const a=Date.now()-r;return i.add(null==s?void 0:s.message),(0,t.eventually)(e,n-a,o,i)}},t.simplePluralize=function(e,t){return`${e} ${t}${1!==e?"s":""}`}},39043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileObjectTemplate=t.compileStringTemplate=void 0;t.compileStringTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=new RegExp("\\$\\{"+e+"\\}","g");n=n.replace(i,o)})),n};t.compileObjectTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=JSON.stringify(o),s=new RegExp('"\\$\\$\\{'+e+'\\}"',"g"),r=new RegExp("\\$\\{"+e+"\\}","g"),a="string"==typeof o?o.replace(/"/g,((e,t,n)=>"\\"!==n[t-1]?'\\"':n[t])):o;n=n.replace(s,i).replace(r,a).replace(/\n/g,"\\n")})),JSON.parse(n)}},69150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connection=t.connectionData=t.connectionDataEquals=t.connectionNodeEquals=t.connectionNode=t.externalConnectionNode=t.isInternalConnection=t.isExternalConnection=t.isInternalConnectionNode=t.isExternalConnectionNode=t.getNodeOutputs=t.getOutputName=t.getInputName=t.getNodeInputs=t.TRIGGER_PIN_ID=t.ERROR_PIN_ID=t.THIS_INS_ID=void 0;const o=n(30292);t.THIS_INS_ID="__this",t.ERROR_PIN_ID="__error",t.TRIGGER_PIN_ID="__trigger";t.getNodeInputs=e=>({...e.inputs,[t.TRIGGER_PIN_ID]:(0,o.nodeInput)()});t.getInputName=e=>e===t.TRIGGER_PIN_ID?"Trigger Node":e;t.getOutputName=e=>e===t.ERROR_PIN_ID?"Error":e;t.getNodeOutputs=e=>({...e.outputs,[t.ERROR_PIN_ID]:(0,o.nodeOutput)()});t.isExternalConnectionNode=e=>e&&e.insId===t.THIS_INS_ID;t.isInternalConnectionNode=e=>e.insId!==t.THIS_INS_ID;t.isExternalConnection=e=>{let{from:n,to:o}=e;return(0,t.isExternalConnectionNode)(n)||(0,t.isExternalConnectionNode)(o)};t.isInternalConnection=e=>!(0,t.isExternalConnection)(e);t.externalConnectionNode=e=>({insId:t.THIS_INS_ID,pinId:e});t.connectionNode=(e,t)=>({insId:e,pinId:t});t.connectionNodeEquals=(e,t)=>e.insId===t.insId&&e.pinId===t.pinId;t.connectionDataEquals=(e,n)=>!(!e||!n)&&((0,t.connectionNodeEquals)(e.from,n.from)&&(0,t.connectionNodeEquals)(e.to,n.to)),t.connectionData=function(e,n,o){const i="string"==typeof e?e.split("."):e,s="string"==typeof n?n.split("."):n;if(i.length>2||s.length>2)throw new Error(`invalid source or target to connection data - ${e} / ${n}`);return{from:2===i.length?(0,t.connectionNode)(i[0],i[1]):(0,t.externalConnectionNode)(i[0]),to:2===s.length?(0,t.connectionNode)(s[0],s[1]):(0,t.externalConnectionNode)(s[0]),delayed:o}};t.connection=function(e,t,n){return void 0===n&&(n=!1),{from:e,to:t,delayed:n}}},6775:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;const s=n(30292),r=n(47025),a=n(86873),u=n(69150);i(n(69150),t);t.connect=function(e,t,n,o,i,l,c,d){void 0===n&&(n={}),void 0===i&&(i={}),void 0===l&&(l=a.noop),void 0===c&&(c={}),void 0===d&&(d={});const{id:p,connections:f,instances:m}=e,v=p||"connected-node"+(0,a.randomInt)(999);return{inputs:e.inputs,outputs:e.outputs,id:v,completionOutputs:e.completionOutputs,reactiveInputs:e.reactiveInputs,run:(p,h)=>{let g=[];const I=new a.DepGraph({}),y=new Map,b=new Map,C=new Map,_=new Map,x=new Map,N=new Map;let w;const j=new Set;m.forEach((e=>{const n=(0,s.getNode)(e,t),o=e.id;y.set(e,o),b.set(o,e),I.addNode(o);const i=Object.keys(n.inputs),r=Object.keys(n.outputs),a={},l={};i.forEach((t=>{const n=(e.inputConfig||{})[t]||(0,s.queueInputPinConfig)();(0,s.isStaticInputPinConfig)(n)?a[t]=(0,s.staticNodeInput)(n.value):a[t]=(0,s.dynamicNodeInput)({config:n})})),a[u.TRIGGER_PIN_ID]=(0,s.dynamicNodeInput)({config:(0,s.queueInputPinConfig)()});if(f.some((t=>(0,u.isInternalConnectionNode)(t.to)&&t.to.insId===e.id&&t.to.pinId===u.TRIGGER_PIN_ID))&&e.inputConfig&&e.inputConfig[u.TRIGGER_PIN_ID])throw"Trigger connection can not be configured";r.forEach((e=>{const t=(0,s.dynamicOutput)();l[e]=t}));f.some((t=>(0,u.isInternalConnectionNode)(t.from)&&t.from.insId===e.id&&t.from.pinId===u.ERROR_PIN_ID))&&(l[u.ERROR_PIN_ID]=(0,s.dynamicOutput)()),C.set(o,a),_.set(o,l)}));const O=new Set;return f.forEach((n=>{const{from:o,to:i}=n,{insId:r,pinId:a}=o,{insId:l,pinId:c}=i,d=_.get(r),p=C.get(l);if((0,u.isInternalConnectionNode)(i)&&O.add(`${i.insId}.${i.pinId}`),(0,u.isExternalConnection)(n)){if((0,u.isExternalConnectionNode)(o)){const e=null==p?void 0:p[i.pinId];if(!e)throw new Error(`Input ${i.pinId} of instance ${l} not found`);const t=x.get(o.pinId)||[];t.push(e),x.set(o.pinId,t)}else{let e=null==d?void 0:d[o.pinId];if(!e)throw new Error(`Output ${o.pinId} of instance ${r} not found`);const t=N.get(i.pinId)||[];t.push(e),N.set(i.pinId,t)}return}if(!d)throw new Error(`No outputs found for instance [${r}]`);if(!p)throw b.has(l)?new Error(`No inputs found for instance [${l}]`):new Error(`Instance with id [${l}] does not exist!`);const f=d[a];if(!f)throw new Error(`Output source - [${a}] not found in node [${v}]`);const m=p[c],h=b.get(r);if(!h&&r!==u.THIS_INS_ID)throw new Error(`Instance [${r}] does not exist! failed to connect [${o}] -> [${i}]`);const y=(h?(0,s.getNode)(h,t):e).outputs[a];if(y&&y.delayed||n.delayed||r!==u.THIS_INS_ID&&l!==u.THIS_INS_ID&&I.addDependency(r,l),!m)throw new Error(`Target arg - [${i}] not found in node [${v}]`);const w=f.subscribe((async e=>{if(!(0,s.isDynamicInput)(m))throw console.info(m),new Error(`Impossible state listening to non dynamic input - ${l}.${c}`);m.subject.next(e)}));g.push((()=>w.unsubscribe()))})),(0,a.okeys)(h).forEach((e=>{(N.get(e)||[]).forEach((t=>{const n=t.subscribe((async t=>{if(!h[e])throw new Error(`Impossible state - output ${e} does not exist`);h[e].next(t)}));g.push((()=>n.unsubscribe()))}))})),I.overallOrder().map((e=>b.get(e))).forEach((e=>{const a=C.get(e.id),u=_.get(e.id),p=(0,s.getNode)(e,t);if(!a)throw new Error(`Unexpected error - args not found when running ${e}`);if(!u)throw new Error(`Unexpected error - outputs not found when running ${e}`);for(const t in a){const n=e.inputConfig[t];O.has(`${e.id}.${t}`)||(0,s.isStaticInputPinConfig)(n)||delete a[t]}const f=(0,r.execute)({node:p,inputs:a,outputs:u,resolvedDeps:t,_debugger:n,insId:e.id,extraContext:d,mainState:i,ancestorsInsIds:o,onBubbleError:l,onCompleted:()=>{return t=e.id,j.delete(t),void(0===j.size&&w&&w());var t},onStarted:()=>{return t=e.id,void j.add(t);var t},env:c});g.push(f)})),Object.keys(p).forEach((async e=>{(x.get(e)||[]).forEach((t=>{const n=p[e];if(!(0,s.isDynamicInput)(t))throw new Error(`Unsure what to do with key ${e}, input: ${t} of ins ${o}`);(0,a.isDefined)(n)&&t.subject.next(n)}))})),void 0===e.completionOutputs&&j.size>0?new Promise((e=>{w=e})):()=>g.forEach((e=>{try{e()}catch(t){console.error("error unsubscribing",t)}}))}}}},26488:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MINOR_DEBUGGER_EVENT_TYPES=t.MAJOR_DEBUGGER_EVENT_TYPES=t.DebuggerEventType=void 0,function(e){e.INPUT_CHANGE="i",e.OUTPUT_CHANGE="o",e.PROCESSING_CHANGE="pc",e.ERROR="err",e.INPUTS_STATE_CHANGE="isc"}(n=t.DebuggerEventType||(t.DebuggerEventType={})),t.MAJOR_DEBUGGER_EVENT_TYPES=[n.INPUT_CHANGE,n.OUTPUT_CHANGE,n.ERROR],t.MINOR_DEBUGGER_EVENT_TYPES=[n.PROCESSING_CHANGE,n.INPUTS_STATE_CHANGE]},43686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatEvent=void 0;const o=n(26488);t.formatEvent=function(e){var t,n,i;const s=[e.insId,...null!==(n=null===(t=e.ancestorsInsIds)||void 0===t?void 0:t.split("."))&&void 0!==n?n:[]];(null===(i=e.ancestorsInsIds)||void 0===i?void 0:i.length)>0&&e.ancestorsInsIds;const r=`Node <${e.nodeId}> `,a=`(${s.join(" -> ")})`;return`${r} - ${function(e){switch(e.type){case o.DebuggerEventType.PROCESSING_CHANGE:return e.val?"started processing":"stopped processing";case o.DebuggerEventType.INPUT_CHANGE:return`Input pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.OUTPUT_CHANGE:return`Output pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.INPUTS_STATE_CHANGE:return`Inputs queue size changed to ${Object.entries(e.val).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join(", ")}`;case o.DebuggerEventType.ERROR:return`Error: ${e.val}`}}(e)} ${a}`}},99896:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26488),t),i(n(43686),t)},47025:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.GLOBAL_STATE_NS=t.ROOT_INS_ID=t.INPUTS_STATE_SUFFIX=t.INNER_STATE_SUFFIX=void 0;const s=n(62600),r=n(87794);i(n(99896),t);const a=n(30292),u=n(6775),l=n(84479),c=n(86873),d=n(23046),p=n(30292),f=n(99896),m=n(79804);t.INNER_STATE_SUFFIX="_inner",t.INPUTS_STATE_SUFFIX="_inputs";t.ROOT_INS_ID="__root",t.GLOBAL_STATE_NS="____global";t.execute=e=>{let{node:n,inputs:o,outputs:i,resolvedDeps:v,_debugger:h={},insId:g=t.ROOT_INS_ID,extraContext:I={},mainState:y={},ancestorsInsIds:b,onBubbleError:C=s.noop,env:_={},onCompleted:x=s.noop,onStarted:N=s.noop}=e;const w=[];y[t.GLOBAL_STATE_NS]||(y[t.GLOBAL_STATE_NS]=new Map);const j={...I,ENV:_},O=(0,m.customNodesToNodesCollection)(v,j),P=e=>{const t=e instanceof a.NodeInstanceError?e:new a.NodeInstanceError(e,(0,c.fullInsIdPath)(g,b),n.id);h.onEvent&&h.onEvent({type:f.DebuggerEventType.ERROR,val:t,insId:g,ancestorsInsIds:b,nodeId:n.id}),i[u.ERROR_PIN_ID]?i[u.ERROR_PIN_ID].next(t):C(t)},E=(e=>(0,a.isVisualNode)(e)?(0,u.connect)(e,O,h,(0,c.fullInsIdPath)(g,b),y,P,_,I):(0,a.isInlineValueNode)(e)?(0,m.inlineValueNodeToNode)(e,j):e)(n),D=h.onEvent||s.noop,S={},M={};(0,c.entries)(o).forEach((e=>{let[t,o]=e;if((0,a.isDynamicInput)(o)){const e=(0,a.dynamicNodeInput)({config:o.config}),i=o.subject.subscribe((async o=>{const i=D({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o,ancestorsInsIds:b,nodeId:n.id});if(i){const t=await i.valuePromise;e.subject.next(t)}else h.debugDelay&&await(0,c.delay)(h.debugDelay),e.subject.next(o)}));w.push((()=>i.unsubscribe())),M[t]=e}else{D({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o.config.value,ancestorsInsIds:b,nodeId:n.id});const e=(0,a.staticNodeInput)((0,a.getStaticValue)(o.config.value,O,g));M[t]=e}})),(0,c.entries)(i).forEach((e=>{let[t,o]=e;const i=(0,a.dynamicOutput)(),s=i.subscribe((async e=>{const i=D({type:f.DebuggerEventType.OUTPUT_CHANGE,insId:g,pinId:t,val:e,ancestorsInsIds:b,nodeId:n.id});if(i){const e=await i.valuePromise;o.next(e)}else o.next(e)}));w.push((()=>s.unsubscribe())),S[t]=i}));const T=(e=>{var n,o;const{node:i,inputs:u,outputs:m,resolvedDeps:v,_debugger:h,insId:g,ancestorsInsIds:I,mainState:y,onError:b,onStarted:C,onCompleted:_,env:x,extraContext:N}=e,{run:w,fn:j}=i,O=(0,d.debugLogger)("core"),P=[];let E;const D=(null==h?void 0:h.onEvent)||s.noop,S=(0,c.fullInsIdPath)(g,I),M=`${S}${t.INNER_STATE_SUFFIX}`,T=`${S}${t.INPUTS_STATE_SUFFIX}`,k=O.extend(S),R=y[t.GLOBAL_STATE_NS];y[M]||(y[M]=new Map),y[T]||(y[T]=new Map);let V=null!==(n=y[T])&&void 0!==n?n:new Map;const A=()=>{const e=Array.from(V.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:(0,a.isQueueInputPinConfig)(u[n].config)?null==o?void 0:o.length:1}}),{});D({type:f.DebuggerEventType.INPUTS_STATE_CHANGE,val:e,insId:g,ancestorsInsIds:I,nodeId:i.id})},$={execute:(e,n,o,i)=>(0,t.execute)({node:e,inputs:n,outputs:o,resolvedDeps:v,_debugger:h,insId:i,onCompleted:_,onStarted:C}),insId:g,state:null!==(o=y[M])&&void 0!==o?o:new Map,onCleanup:e=>{P.push(e)},onError:e=>{b(e)},context:null!=N?N:{},ancestorsInsIds:I,globalState:R};let z,H=!1;const G=(i.reactiveInputs||[]).filter((e=>{var t;return!(0,p.isStaticInputPinConfig)(null===(t=u[e])||void 0===t?void 0:t.config)})),L=()=>{var e;null===(e=y[M])||void 0===e||e.clear(),(0,c.keys)(y).filter((e=>e.startsWith(`${S}.`))).forEach((e=>{y[e]=new Map}))},F=e=>{const t=(null==e?void 0:e.key)&&G.includes(null==e?void 0:e.key);if(H&&!t);else{const o=H&&t;if((0,l.isNodeStateValid)(u,V,i)||o){let t;if(H){if(!e)throw new Error("Unexpected state, got reactive node while not processing and not valid");const n=(0,l.pullValueForExecution)(e.key,u[e.key],V,x);t={...z,[e.key]:n},A()}else t=(0,l.pullValuesForExecution)(u,V,x),z=t,A();let o=new Set,s={};if(H=!0,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),i.completionOutputs){const e=i.completionOutputs.map((e=>e.split("+"))).reduce(((e,t)=>(t.forEach((n=>{e.set(n,t)})),e)),new Map);(0,c.entries)(m).forEach((t=>{let[n,a]=t;a.pipe((0,r.first)()).subscribe((t=>{o.add(n),s[n]=t;let r=e.get(n);r&&(r.splice(r.indexOf(n),1),0===r.length&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_&&_(s),L(),(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),E=void 0,o.clear(),s={},(0,l.hasNewSignificantValues)(u,V,x,i.id)&&F()))}))}))}else(0,c.entries)(m).forEach((e=>{let[t,n]=e;n.subscribe((e=>{s[t]=e}))}));try{k("Running node %s with values %o",i.id,t),C&&C(),E=(null!=j?j:w)(t,m,$),(0,c.isPromise)(E)?E.then((()=>{void 0===i.completionOutputs&&_&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_(s),L(),(0,l.hasNewSignificantValues)(u,V,x,i.id)&&F())})).catch((e=>{b(e),H=!1,k("Error in node %s - value %e",i.id,e),D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id})})):void 0===i.completionOutputs&&_&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_(s),L())}catch(n){b(n),H=!1,k("Error in node %s - value %e",i.id,n),D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id})}const d=G.find((e=>u[e]&&(0,l.peekValueForExecution)(e,u[e],V,x,i.id)));if(d){const e=(0,l.peekValueForExecution)(d,u[d],V,x,i.id);F({key:d,value:e})}else{const e=(0,c.entries)(u).find((e=>{let[t,n]=e;const o=(0,a.isQueueInputPinConfig)(n.config),s=(0,l.peekValueForExecution)(t,n,V,x,i.id);return!!o&&(0,c.isDefined)(s)}));if(e){const[t,n]=e,o=(0,l.peekValueForExecution)(t,n,V,x,i.id);F({key:t,value:o})}}}}};F();const B=(0,l.subscribeInputsToState)(u,V,((e,t)=>{O("Got input %s - value is [%o]",e,t),A();try{F({key:e,value:t})}catch(n){b(n)}}));return P.push(B),()=>{(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),P.forEach((e=>e()))}})({node:E,inputs:M,outputs:S,resolvedDeps:O,_debugger:h,insId:g,mainState:y,ancestorsInsIds:b,onError:P,onBubbleError:C,env:_,extraContext:I,onCompleted:x,onStarted:N});return()=>{w.forEach((e=>e())),T()}}},84479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeInputsToState=t.isNodeStateValid=t.hasNewSignificantValues=t.peekValuesForExecution=t.pullValuesForExecution=t.pullValueForExecution=t.peekValueForExecution=void 0;const o=n(30292),i=n(86873),s=n(6775),r=(e,t)=>{const n=(0,o.extractStaticValue)(e);if((0,o.isEnvValue)(n)){return((e,t)=>{const n=e.split(".");let o={...t};for(let s of n){if(!o||!(0,i.isDefined)(o[s])||null===o[s])throw new Error(`Cannot find key ${e} inside obj ${t}`);o=o[s]}return o})((0,o.getEnvKeyFromValue)(n),t)}return n};t.peekValueForExecution=(e,t,n,i,s)=>{const a=n.get(e);let u;if(!t)throw new Error(`Trying to peek value of inexsting input in key "${e}" in node "${s}"`);return u=(0,o.isStaticInput)(t)?r(t,i):(0,o.isQueueInputPinConfig)(t.config)?a?[...a].shift():void 0:a,u};t.pullValueForExecution=(e,t,n,i)=>{const s=n.get(e);let a;return(0,o.isStaticInput)(t)?a=r(t,i):(0,o.isQueueInputPinConfig)(t.config)?(a=(s||[]).shift(),n.set(e,s)):(a=s,(0,o.isStickyInputPinConfig)(t.config)||n.delete(e)),a};t.pullValuesForExecution=(e,n,o)=>(0,i.entries)(e).reduce(((e,i)=>{let[s,r]=i;return e[s]=(0,t.pullValueForExecution)(s,r,n,o),e}),{});t.peekValuesForExecution=(e,n,o,s)=>(0,i.entries)(e).reduce(((e,i)=>{let[r,a]=i;return e[r]=(0,t.peekValueForExecution)(r,a,n,o,s),e}),{});t.hasNewSignificantValues=(e,n,s,r)=>(0,i.entries)(e).some((e=>{let[a,u]=e;const l=(0,o.isQueueInputPinConfig)(u.config),c=(0,t.peekValueForExecution)(a,u,n,s,r);return(0,i.isDefined)(c)&&l}));t.isNodeStateValid=(e,t,n)=>{const r=(0,i.keys)(e),a=(0,i.keys)(n.inputs).filter((e=>{var t;const o=null===(t=n.inputs[e])||void 0===t?void 0:t.mode;return!o||"required"===o}));r.includes(s.TRIGGER_PIN_ID)&&a.push(s.TRIGGER_PIN_ID);return!!(0,i.containsAll)(r,a)&&(0,i.entries)(e).filter((e=>{let[t]=e;return!!n.inputs[t]||t===s.TRIGGER_PIN_ID})).every((e=>{let[s,r]=e;var a;const u=t.get(s);return"optional"===((null===(a=n.inputs[s])||void 0===a?void 0:a.mode)||"required")||(!!(0,o.isStaticInput)(r)||((0,o.isQueueInputPinConfig)(r.config)?(0,i.isDefined)(u)&&u.length>0:(0,i.isDefined)(u)))}))};t.subscribeInputsToState=(e,t,n)=>{const s=[];return(0,i.entries)(e).forEach((e=>{let[i,r]=e;if(!r)return;if((0,o.isStaticInput)(r))return;const a=r.subject.subscribe((e=>{if((0,o.isQueueInputPinConfig)(r.config)){const o=t.get(i)||[];if(!Array.isArray(o))throw new Error(`impossible state - state of key ${i} is set but not an array`);o.push(e),t.set(i,o),n(i,e)}else t.set(i,e),n(i,e)}));s.push((()=>a.unsubscribe()))})),()=>s.forEach((e=>e()))}},5474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flydeFlowSchema=void 0;const o=n(29022),i=o.z.record(o.z.string(),o.z.string().or(o.z.array(o.z.string()))),s=o.z.strictObject({x:o.z.number(),y:o.z.number()}),r=o.z.discriminatedUnion("mode",[o.z.strictObject({mode:o.z.literal("static"),value:o.z.any()}),o.z.strictObject({mode:o.z.literal("queue")}),o.z.strictObject({mode:o.z.literal("sticky")})]),a=o.z.object({size:o.z.optional(o.z.enum(["small","regular","large"])),icon:o.z.optional(o.z.any()),color:o.z.optional(o.z.string()),cssOverride:o.z.optional(o.z.record(o.z.string()))}),u=o.z.object({pos:s.default({x:0,y:0}),id:o.z.string(),inputConfig:o.z.optional(o.z.record(o.z.string(),r)).default({}),visibleInputs:o.z.optional(o.z.array(o.z.string())),visibleOutputs:o.z.optional(o.z.array(o.z.string())),nodeId:o.z.optional(o.z.string()),node:o.z.optional(o.z.any()),style:o.z.optional(a)}).refine((e=>e.node||e.nodeId),{message:"Instance must have either an inline node or refer to a nodeId"}),l=o.z.union([o.z.string(),o.z.object({mode:o.z.enum(["required","optional","required-if-connected"]),type:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),defaultValue:o.z.optional(o.z.any())})]),c=o.z.object({type:o.z.optional(o.z.string()),optional:o.z.optional(o.z.boolean()),delayed:o.z.optional(o.z.boolean()),description:o.z.optional(o.z.string())}),d=o.z.object({id:o.z.optional(o.z.string()),inputs:o.z.record(o.z.string(),l),outputs:o.z.record(o.z.string(),c),inputsPosition:o.z.optional(o.z.record(o.z.string(),s)),outputsPosition:o.z.optional(o.z.record(o.z.string(),s)),customViewCode:o.z.optional(o.z.string()),dataBuilderSource:o.z.optional(o.z.string()),templateType:o.z.optional(o.z.string()),completionOutputs:o.z.optional(o.z.array(o.z.string())),reactiveInputs:o.z.optional(o.z.array(o.z.string())),defaultStyle:o.z.optional(a),description:o.z.optional(o.z.string()),searchKeywords:o.z.optional(o.z.array(o.z.string()))}),p=o.z.object({instances:o.z.array(u),connections:o.z.array(o.z.strictObject({from:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),to:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),delayed:o.z.optional(o.z.boolean()),hidden:o.z.optional(o.z.boolean())}))}).and(d);t.flydeFlowSchema=o.z.strictObject({imports:o.z.optional(i).default({}),node:p})},74762:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticValueVisualNode=void 0,i(n(86873),t);const s=n(30292);i(n(6775),t),i(n(47025),t),i(n(10418),t),i(n(30292),t),i(n(3320),t),i(n(79804),t),i(n(5474),t);t.isStaticValueVisualNode=e=>!!e&&!!(0,s.maybeGetStaticValueNodeId)(`${e}`)},87093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fakeVm=t.VM=t.VMScript=void 0;const o=n(86873);class i{constructor(e){this.script=e}}t.VMScript=i;class s{constructor(e){this.context=e}run(e){const t=(0,o.okeys)(this.context.sandbox),n=Object.values(this.context.sandbox);Function(...t,e.script)(...n)}}t.VM=s,t.fakeVm={VMScript:i,VM:s}},28145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVM2Instance=void 0;const o=n(87093);t.getVM2Instance=()=>o.fakeVm},79804:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.customNodesToNodesCollection=t.inlineValueNodeToNode=void 0;const i=o(n(18706)),s=n(86873),r=n(30292),a=(0,n(28145).getVM2Instance)();t.inlineValueNodeToNode=function(e,t){void 0===t&&(t={});const{runFnRawCode:n,...o}=e,u=(0,s.debugLogger)(`code-node:${e.id}`),l=`\n try {\n ${n}\n } catch (e) {\n adv.onError(e);\n }\n `,c=new a.VMScript(l),d={...o,run:(n,o,l)=>{const d=new a.VM({sandbox:{inputs:n,outputs:o,setInterval:setInterval,clearInterval:clearInterval,setTimeout:setTimeout,clearTimeout:clearTimeout,encodeURIComponent:encodeURIComponent,adv:l,log:function(){for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeWithDependencies=void 0;const o=n(30292),i=n(74762),s=n(88270);t.getNodeWithDependencies=function(e,n,r){if(void 0===r&&(r=[]),(0,o.isInlineValueNode)(e))return[e];if(r.includes(e.id))return[];const a=(0,i.removeDupes)(e.instances.filter((e=>(0,s.isRefNodeInstance)(e))).map((e=>e.nodeId)).filter((e=>n[e])));return[e,...a.flatMap((e=>{var t;return null!==(t=n[e])&&void 0!==t?t:[]})).reduce(((e,o)=>[...e,...(0,t.getNodeWithDependencies)(o,n,[...r,...a])]),[])]}},30292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88270),t),i(n(43069),t),i(n(79426),t),i(n(44535),t),i(n(18063),t),i(n(20359),t)},18063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeInstanceError=void 0;class n extends Error{constructor(e,t,n){let o="Unknown error";o="string"==typeof e?e:e instanceof Error?e.message:null!==e&&"object"==typeof e?JSON.stringify(e):String(e),super(`${o} (insId: ${t}, nodeId: ${n})`),this.name=this.constructor.name,this.message=`${o} (insId: ${t}, nodeId: ${n})`,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.fullInsIdsPath=t,this.nodeId=n}}t.NodeInstanceError=n},88270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInsId=t.NodeInstance=t.isRefNodeInstance=t.isInlineNodeInstance=t.inlineNodeInstance=t.nodeInstance=void 0;const o=n(36618);t.nodeInstance=(e,t,n,o)=>({id:e,nodeId:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.inlineNodeInstance=(e,t,n,o)=>({id:e,node:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.isInlineNodeInstance=e=>!!e.node;t.isRefNodeInstance=e=>!(0,t.isInlineNodeInstance)(e);t.NodeInstance=(e,t,n,o)=>({id:e,nodeId:t.id,inputConfig:n||{},pos:o||{x:0,y:0}});t.createInsId=e=>`${e.id}-${(0,o.slug)()}`},43069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvKeyFromValue=t.toEnvValue=t.isEnvValue=t.extractStaticValue=t.isStaticInput=t.isDynamicInput=t.staticNodeInput=t.dynamicNodeInputs=t.dynamicNodeInput=t.dynamicOutput=t.nodeOutputs=t.nodeOutput=t.nodeInputs=t.isInputPinOptional=t.nodeInput=void 0;const o=n(62600),i=n(30292),s=n(86873),r=n(79426);t.nodeInput=function(e){return void 0===e&&(e="required"),{mode:e}};t.isInputPinOptional=e=>"optional"===e.mode;t.nodeInputs=(e,n)=>(0,s.repeat)(e,(e=>(0,t.nodeInput)((null==n?void 0:n[e])||"required")));t.nodeOutput=function(e){return void 0===e&&(e=!1),{delayed:e}};t.nodeOutputs=e=>(0,s.repeat)(e,(()=>(0,t.nodeOutput)()));t.dynamicOutput=()=>new o.Subject,t.dynamicNodeInput=(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})));t.dynamicNodeInputs=function(e){return void 0===e&&(e=10),(0,s.repeat)(e,(()=>(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})))()))};t.staticNodeInput=e=>({config:(0,r.staticInputPinConfig)(e)});t.isDynamicInput=e=>{const t=e;return t&&t.subject&&!!t.subject.next};t.isStaticInput=e=>(0,i.isStaticInputPinConfig)(null==e?void 0:e.config);t.extractStaticValue=e=>{if((0,t.isStaticInput)(e))return e.config.value;throw new Error("Cannot extract static value from non static arg")};t.isEnvValue=e=>"string"==typeof e&&e.startsWith("$ENV.");t.toEnvValue=e=>`$ENV.${e}`;t.getEnvKeyFromValue=e=>"string"==typeof e?e.replace(/^\$ENV\./,""):e},20359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeFromFunction=t.getNodeDef=t.getNode=t.getStaticValue=t.maybeGetStaticValueNodeId=t.fromSimplified=t.inlineValueNode=t.codeNode=t.visualNode=t.isInlineValueNode=t.isVisualNode=t.isCodeNode=t.isBaseNode=t.InlineValueNodeType=void 0;const o=n(86873),i=n(88270),s=n(43069);!function(e){e.VALUE="value",e.FUNCTION="function"}(t.InlineValueNodeType||(t.InlineValueNodeType={}));t.isBaseNode=e=>e&&e.id&&e.inputs&&e.outputs;t.isCodeNode=e=>(0,t.isBaseNode)(e)&&"function"==typeof e.run;t.isVisualNode=e=>!!e.instances;t.isInlineValueNode=e=>(0,o.isDefined)(e)&&(0,o.isDefined)(e.runFnRawCode),t.visualNode=(0,o.testDataCreator)({id:"visual-node",inputs:{},outputs:{},instances:[],connections:[],outputsPosition:{},inputsPosition:{}}),t.codeNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},run:o.noop}),t.inlineValueNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},runFnRawCode:""});t.fromSimplified=e=>{let{run:t,inputTypes:n,outputTypes:i,id:s}=e;return{id:s,inputs:(0,o.entries)(n).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),outputs:(0,o.entries)(i).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),run:t}};t.maybeGetStaticValueNodeId=e=>{const t="string"==typeof e&&e.match(/^__node\:(.*)/);if(t){return t[1]}return null};t.getStaticValue=(e,n,o)=>{const i=(0,t.maybeGetStaticValueNodeId)(e);if(i){const e=n[i];if(!e)throw new Error(`Instance ${o} referrer to a node reference ${i} that does not exist`);return e}return e};t.getNode=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw new Error(`Node with id ${n} not found`);return o};t.getNodeDef=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw console.error(`Node with id ${n} not found`),new Error(`Node with id ${n} not found`);return o};t.codeFromFunction=e=>{let{id:t,fn:n,inputNames:o,outputName:i,defaultStyle:r}=e;return{id:t,inputs:o.reduce(((e,t)=>({...e,[t]:(0,s.nodeInput)()})),{}),outputs:{[i]:(0,s.nodeOutput)()},run:(e,t)=>{const s=o.map((t=>e[t])),r=t[i],a=n(...s);return Promise.resolve(a).then((e=>null==r?void 0:r.next(e)))},completionOutputs:[i],defaultStyle:r}}},44535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nodeFromSimpleFunction=void 0,t.nodeFromSimpleFunction=function(e){var t;return{...e,id:e.id,description:e.description,namespace:e.namespace,inputs:e.inputs?e.inputs.reduce(((e,t)=>{let{name:n,description:o,mode:i,defaultValue:s}=t;return{...e,[n]:{description:o,mode:null!=i?i:"required",defaultValue:s}}}),{}):{},outputs:e.output?{[e.output.name]:{description:e.output.description}}:{},defaultStyle:{icon:e.icon,size:e.size},run:null!==(t=e.fullRunFn)&&void 0!==t?t:async function(t,n,o){var i,s;const r=(null!==(i=e.inputs)&&void 0!==i?i:[]).map((e=>{let{name:n}=e;return t[n]}));try{const t=await Promise.resolve(e.run(...r));e.output&&(null===(s=n[e.output.name])||void 0===s||s.next(t))}catch(a){console.error("Error in node",a),o.onError(a)}},customViewCode:e.customViewCode}}},79426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticInputPinConfig=t.isStickyInputPinConfig=t.isQueueInputPinConfig=t.staticInputPinConfig=t.stickyInputPinConfig=t.queueInputPinConfig=t.INPUT_MODES=void 0,t.INPUT_MODES=["queue","sticky","static"];t.queueInputPinConfig=()=>({mode:"queue"});t.stickyInputPinConfig=()=>({mode:"sticky"});t.staticInputPinConfig=e=>({mode:"static",value:e});t.isQueueInputPinConfig=e=>"queue"===e.mode;t.isStickyInputPinConfig=e=>!!e&&"sticky"===e.mode,t.isStaticInputPinConfig=function(e){return!!e&&"static"===e.mode}},10418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedExecute=void 0;const o=n(74762),i=n(47025);t.simplifiedExecute=function(e,t,n,s,r){void 0===r&&(r={});const a=(0,o.keys)(e.outputs),u=Object.keys(n).reduce(((e,t)=>{const i=n[t];return{...e,[t]:(0,o.isDynamicInput)(i)?i:(0,o.staticNodeInput)(i)}}),{}),l=a.reduce(((e,t)=>{const n=(0,o.dynamicOutput)();return s&&n.subscribe((e=>{s(t,e)})),{...e,[t]:n}}),{});return(0,i.execute)({node:e,inputs:u,outputs:l,resolvedDeps:t,onBubbleError:e=>{throw e},...r})}},25779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodePreview=void 0;const o=n(35250),i=n(74762),s=n(86553);t.NodePreview=e=>{let{node:t}=e;const n={node:t,instance:(0,i.nodeInstance)("bob",t.id,{}),connections:[],viewPort:{pos:{x:0,y:0},zoom:1},resolvedDeps:{},connectionsPerInput:{},onUngroup:i.noop,onDblClick:i.noop,onDragEnd:i.noop,onDragMove:i.noop,onDragStart:i.noop,onPinClick:i.noop,onPinDblClick:i.noop,onSelect:i.noop,onTogglePinBreakpoint:i.noop,onTogglePinLog:i.noop,onToggleSticky:i.noop,displayMode:!0,onInspectPin:i.noop,onDetachConstValue:i.noop,onCopyConstValue:i.noop,onPasteConstValue:i.noop,ancestorsInsIds:"",onChangeVisibleInputs:i.noop,onChangeVisibleOutputs:i.noop,onConvertConstToEnv:i.noop,forceShowMinimized:"both",onExtractInlineNode:i.noop,onCloseInlineEditor:i.noop,isConnectedInstanceSelected:!1,inlineEditorPortalDomNode:null,onChangeStyle:i.noop,onDeleteInstance:i.noop,onGroupSelected:i.noop,onSetDisplayName:i.noop,hadError:!1,queuedInputsData:{},onPinMouseDown:i.noop,onPinMouseUp:i.noop};return(0,o.jsx)("div",{className:"node-preview",children:(0,o.jsx)(s.InstanceView,{...n})})}},30653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDarkMode=t.DarkModeProvider=void 0;const o=n(70079),i=(0,o.createContext)(!0);t.DarkModeProvider=i.Provider;t.useDarkMode=()=>(0,o.useContext)(i)},29183:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataInspectionModal=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=n(74089),p=n(83938),f=n(17102),m=n(98158);t.DataInspectionModal=e=>{var t;const{onRequestHistory:n}=(0,m.useDebuggerContext)(),{item:o}=e,[i,s]=c.default.useState(),[r,v]=c.default.useState(0),[h,g]=c.default.useState(""),[I,y]=c.default.useState(),[b]=(0,d.useDebounce)(h,300);(0,c.useEffect)((()=>{y(null==i?void 0:i.lastSamples.filter((e=>"object"==typeof e.val?JSON.stringify(e.val).includes(b):e.val.toString().includes(b)))),v(0)}),[null==i?void 0:i.lastSamples,b]),c.default.useEffect((()=>{!async function(){var e,t;const i=await n(o.insId,null===(e=o.pin)||void 0===e?void 0:e.id,null===(t=o.pin)||void 0===t?void 0:t.type);s(i)}()}),[o,n]);const C=e=>{const t=e.val;return"object"==typeof t?(0,a.jsx)(p.BrowserOnlyReactJson,{src:t}):(0,a.jsx)(u.Code,{children:t.toString()})},_=`"${o.insId}" ${(null===(t=o.pin)||void 0===t?void 0:t.id)?`(${o.pin.id})`:""}`;return(0,a.jsx)(u.Dialog,{isOpen:!0,title:`Inspecting data for instance ${_}`,onClose:e.onClose,canEscapeKeyClose:!1,className:"data-inspection-modal",children:(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{children:[i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("em",{children:[_," called ",i.total," time(s)"]}),i.total>10&&(0,a.jsx)("span",{children:"Showing last 10 samples"})]}):null,(0,a.jsx)("input",{className:"bp5-input bp5-small bp5-fill",type:"search",placeholder:"Search for values",dir:"auto",onChange:e=>g(e.target.value),value:h}),b.length>0&&(0,a.jsxs)("span",{children:["Showing ",null==I?void 0:I.length," of ",i.lastSamples.length," ",'samples matching query "',b,'"']})]}),(0,a.jsx)("main",{className:"main-wrapper",children:(()=>{if(!i)return(0,a.jsx)(f.Loader,{});if(0===i.total)return(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",(0,a.jsx)("em",{children:o.insId})," ",o.pin?(0,a.jsxs)(c.default.Fragment,{children:["and pin ",(0,a.jsx)("em",{children:o.pin.id})]}):null,". Make sure debugger is running and your program was triggered."]});const e=null==I?void 0:I[r];return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Card,{className:"content-wrapper",children:[e?(0,a.jsxs)("div",{className:"info",children:[(0,a.jsxs)("div",{children:["Showing sample ",r," of event from"," ",(0,a.jsx)("strong",{children:(0,d.timeAgo)(e.time)})," (",new Date(e.time).toLocaleString(),")"]}),(0,a.jsxs)("div",{children:["Instance: ",(0,a.jsx)("strong",{children:e.insId}),", Pin id:"," ",(0,a.jsx)("strong",{children:e.pinId})," "]}),(0,a.jsx)("div",{children:"Value:"})]}):null,C(e)]}),(0,a.jsx)(u.Menu,{className:"samples-menu",children:I.map(((e,t)=>{const n=e.pinId,o=`${i.total-t}. from pin "${n}"`;return(0,a.jsx)(u.MenuItem,{text:o,onClick:()=>v(t)},t)}))})]}):i.lastSamples.length>0&&h.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",children:['No data found for search query "',h,'"']}):(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",o.insId," ",o.pin?`and ${o.pin.id}`:"",". Make sure a debugger is connected and your program was triggered."]})})()})]})})})}},40471:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29183),t)},98158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebuggerContext=t.DebuggerContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({onRequestHistory:()=>Promise.reject(new Error("Not implemented"))});t.DebuggerContextProvider=i.Provider;t.useDebuggerContext=()=>(0,o.useContext)(i)},86125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDependenciesContext=t.DependenciesContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({resolvedDependencies:{},onImportNode:()=>Promise.reject(new Error("Not implemented")),onRequestImportables:()=>Promise.reject(new Error("Not implemented"))});t.DependenciesContextProvider=i.Provider;t.useDependenciesContext=()=>(0,o.useContext)(i)},97106:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FlowEditor=void 0;const u=n(35250),l=s(n(70079)),c=n(74762),d=n(63521),p=a(n(53865)),f=n(68120),m=n(7047),v=n(84472),h=n(82232),g=n(49283),I=n(43490),y=n(68840),b=n(78087),C=n(20079),_=n(60190),x=n(40471),N=n(98158),w=n(86125),j=n(30653),O=n(77852);r(n(43490),t),r(n(98158),t),r(n(86125),t),y.library.add(b.fab,C.fas);const P=["select","drag-move","order-step"];t.FlowEditor=l.memo(l.forwardRef(((e,t)=>{const{state:n,onChangeEditorState:o}=e,{resolvedDependencies:i,onImportNode:s}=(0,w.useDependenciesContext)(),[r,a]=l.useState([]),[y,b]=l.useState([]),{flow:C,boardData:E}=n,D=n.flow.node,[S,M]=l.useState({}),[T,k]=l.useState(new Set),{debuggerClient:R}=(0,N.useDebuggerContext)();l.useEffect((()=>{if(R)return R.onBatchedEvents((e=>{e.forEach((e=>{e.type===c.DebuggerEventType.INPUTS_STATE_CHANGE&&(console.log("INPUTS_STATE_CHANGE",e.insId,e.val),M((t=>({...t,[e.insId]:e.val})))),e.type===c.DebuggerEventType.ERROR&&k((t=>{const n=new Set(t);return n.add(e.insId),n}))}))}))}),[R]);const{openFile:V,reportEvent:A}=(0,I.usePorts)(),$=l.useCallback(((e,t)=>{console.info("onChangeFlow",t.type),"functional"===t.type&&(a([{flow:{...n.flow,...e}},...r.slice(0,50)]),b([])),o((t=>({...t,flow:{...t.flow,...e}})))}),[o,n.flow,r]),[z,H]=l.useState({instances:[],connections:[]}),[G,L]=l.useState(!1),F=l.useCallback((()=>L(!1)),[]),B=l.useCallback((()=>L(!0)),[]),q=l.useCallback((e=>{o((t=>({...t,boardData:{...t.boardData,...e}})))}),[o]);l.useEffect((()=>{q({selected:[],viewPort:d.defaultViewPort,from:void 0,to:void 0,lastMousePos:{x:0,y:0}})}),[D.id]),(0,f.useHotkeys)("cmd+z",(e=>{b([...y,n]);const[t,...i]=r;t&&(o((e=>({...e,...t}))),a(i)),e.preventDefault()}),{text:"Undo last change",group:"Editing"},[n,r,y]);const U=l.useCallback(((e,t)=>{P.some((e=>t.message.includes(e)))||b([]),$({node:e},t)}),[$]),W=l.useCallback((e=>{V({absPath:e.source.path})}),[V]),Z=l.useCallback((function(e,t){void 0===t&&(t=-1*d.NODE_HEIGHT*1.5);const n=(0,m.createNewNodeInstance)(e,t,E.lastMousePos,i);if(n){const e=(0,p.default)(C,(e=>{const t=e.node;if(!(0,c.isVisualNode)(t))throw new Error("Impossible state, adding node to non visual node");t.instances.push(n)}));return $(e,(0,h.functionalChange)("add-node")),F(),n}}),[E.lastMousePos,C,$,F,i]),J=l.useCallback((async e=>{switch(e.type){case g.OmniBarCmdType.ADD:return A("addNode",{nodeId:e.data,source:"omnibar"}),Z(e.data);case g.OmniBarCmdType.ADD_VALUE:{const e=t.current;null==e||e.requestNewInlineValue();break}case g.OmniBarCmdType.IMPORT:{await s(e.data,{pos:E.lastMousePos});const t=(0,_.vAdd)({x:0,y:0},E.lastMousePos),n=(0,m.createNewNodeInstance)(e.data.node,0,t,i),o=(0,p.default)(C,(e=>{e.node.instances.push(n)}));$(o,(0,h.functionalChange)("add-imported-node")),A("addNode",{nodeId:e.data.node.id,source:"omnibar"});break}default:v.AppToaster.show({intent:"warning",message:"Not supported yet"})}F()}),[F,A,Z,t,s,E.lastMousePos,i,C,$]),[Y,K]=l.useState(),Q=l.useCallback((()=>K(void 0)),[]),X=l.useCallback(((e,t)=>{K({insId:e,pin:t})}),[]),{isDarkMode:ee}=(0,O.useDarkMode)();return(0,u.jsx)("div",{className:"flyde-flow-editor",children:(()=>{var n;if((0,c.isInlineValueNode)(D))throw new Error("Impossible state");return(0,u.jsx)(j.DarkModeProvider,{value:null!==(n=e.darkMode)&&void 0!==n?n:ee,children:(0,u.jsxs)(l.Fragment,{children:[Y?(0,u.jsx)(x.DataInspectionModal,{item:Y,onClose:Q}):null,(0,u.jsx)(d.VisualNodeEditor,{currentInsId:c.ROOT_INS_ID,ref:t,boardData:E,onChangeBoardData:q,node:D,onGoToNodeDef:W,onChangeNode:U,resolvedDependencies:i,clipboardData:z,onCopy:H,nodeIoEditable:!D.id.startsWith("Trigger"),onInspectPin:X,onShowOmnibar:B,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:S,initialPadding:e.initialPadding,instancesWithErrors:T,disableScrolling:e.disableScrolling},D.id),G?(0,u.jsx)(g.Omnibar,{flow:C,resolvedNodes:i,onCommand:J,visible:G,onClose:F}):null]})})})()})})))},9001:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeEditor=t.renderCreateIOOption=void 0;const i=n(35250),s=o(n(70079)),r=n(74762),a=n(50382),u=o(n(53865)),l=n(70457),c=n(25779);t.renderCreateIOOption=(e,t,n)=>(0,i.jsx)(a.MenuItem,{icon:"add",text:`Create "${e}"`,active:t,onClick:n,shouldDismissPopover:!1});const d=l.MultiSelect.ofType();t.BaseNodeEditor=e=>{var n,o;const{node:l,onChange:p}=e,f=(0,r.entries)(l.inputs),m=f.filter((e=>{let[,t]=e;return"required"===t.mode})).map((e=>{let[t]=e;return t})),v=f.filter((e=>{let[,t]=e;return"optional"===t.mode})).map((e=>{let[t]=e;return t})),h=f.filter((e=>{let[,t]=e;return"required-if-connected"===t.mode})).map((e=>{let[t]=e;return t})),[g,I]=s.default.useState(!1),y=(0,r.okeys)(l.outputs),b=s.default.useCallback((e=>{p({...l,id:e})}),[l,p]),C=s.default.useCallback((e=>{let t=e?e.split(","):void 0;"[]"===e&&(t=[]),p({...l,completionOutputs:t})}),[l,p]),_=s.default.useCallback((e=>{let t=e?e.split(","):void 0;p({...l,reactiveInputs:t})}),[l,p]),x=s.default.useCallback(((e,t)=>{const n=(0,u.default)(l,(n=>{n.inputs[e]=(0,r.nodeInput)(t)}));p(n)}),[l,p]),N=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.inputs[e]}));p(t)}),[l,p]),w=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{t.outputs[e]=(0,r.nodeOutput)()}));p(t)}),[l,p]),j=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.outputs[e]}));p(t)}),[l,p]);return(0,i.jsxs)("div",{className:"base-node-editor",children:[(0,i.jsx)("div",{className:"form-row",children:(0,i.jsx)(a.FormGroup,{label:"Node Name",labelFor:"text-input",labelInfo:"(required)",children:(0,i.jsx)(a.InputGroup,{id:"node-name",disabled:e.idDisabled,placeholder:"Node ID",value:l.id,onChange:e=>b(e.target.value)})})}),(0,i.jsx)(a.FormGroup,{label:"Required Inputs",children:(0,i.jsx)(d,{selectedItems:m,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),!0!==e.hiddenOutputs?(0,i.jsx)(a.FormGroup,{label:"Outputs",children:(0,i.jsx)(d,{selectedItems:y,placeholder:"Enter output names here",items:[],tagRenderer:e=>e,onItemSelect:w,onRemove:j,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}):null,(0,i.jsx)(a.Checkbox,{checked:g,onChange:e=>I(e.target.checked),children:"Show advanced options"}),(0,i.jsxs)(a.Collapse,{isOpen:g,children:[(0,i.jsx)(a.FormGroup,{label:"Optional Inputs",children:(0,i.jsx)(d,{selectedItems:v,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"optional"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Required-if-connected Inputs",children:(0,i.jsx)(d,{selectedItems:h,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required-if-connected"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Completion Outputs",children:(0,i.jsx)(a.InputGroup,{id:"completion-outputs",placeholder:"completion outputs",value:(null===(n=l.completionOutputs)||void 0===n?void 0:n.join(","))||"",onChange:e=>C(e.target.value)})}),(0,i.jsx)(a.FormGroup,{label:"Reactive Inputs",children:(0,i.jsx)(a.InputGroup,{id:"reactive-inputs",placeholder:"Reactive inputs",value:(null===(o=l.reactiveInputs)||void 0===o?void 0:o.join(","))||"",onChange:e=>_(e.target.value)})})]}),(0,i.jsx)(a.FormGroup,{label:"Preview",children:(0,i.jsx)("div",{className:"preview-wrapper",children:(0,i.jsx)(c.NodePreview,{node:l})})})]})}},82232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metaChange=t.functionalChange=void 0;t.functionalChange=e=>({type:"functional",message:e});t.metaChange=function(e){return void 0===e&&(e="n/a"),{type:"meta",message:e}}},41032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safelyGetNodeDef=t.loadingDef=void 0;const o=n(74762);t.loadingDef={id:"Loading",inputs:{},outputs:{}};t.safelyGetNodeDef=(e,n)=>{try{return(0,o.getNodeDef)(e,n)}catch(i){const n="string"==typeof e?e:e.nodeId;return{...t.loadingDef,id:n}}}},72125:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCodeModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(68371),f=n(74762),m=n(31745),v="`Result is ${inputs.a + inputs.b}`";t.InlineCodeModal=u.memo((function(e){const{initialValue:t,initialType:n}=e,[o,i]=u.useState((0,f.isDefined)(t)?t:v),[s,r]=u.useState(n||f.InlineValueNodeType.VALUE),h=(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:['You can add variables to by referrencing the "inputs" object.',(0,a.jsx)("br",{})," For example:",(0,a.jsx)(c.Code,{children:"`Hello {inputs.name}`"}),' will expose an input pin named "name"']}),(0,a.jsxs)("p",{children:["You can also use ternery expressions, arithmetic operators and more!",(0,a.jsx)("br",{}),"For example:",(0,a.jsx)(c.Code,{children:"inputs.a > inputs.b ? inputs.a + 42 : Math.random() * inputs.b"})]})]}),g=(0,a.jsxs)("span",{children:["Type in any valid JS value, such as ",(0,a.jsx)(c.Code,{children:"true"}),", ",(0,a.jsx)(c.Code,{children:"42"}),","," ",(0,a.jsx)(c.Code,{children:'["bob", "alice", "dave"]'}),".",(0,a.jsx)("br",{})," Dynamic inputs may also be used"]}),I=(0,a.jsxs)("span",{children:["Write any JS code and return a value.",(0,a.jsx)("br",{})," The returned value will be the output.",(0,a.jsx)("br",{})," Example:",(0,a.jsx)(c.Code,{children:"const a = inputs.a; const b = inputs.b; return Math.floor(a/b);"})]}),y=(0,p.getVariables)(o);return u.useEffect((()=>{o===v&&s===f.InlineValueNodeType.FUNCTION&&i(`return ${v}`),o===`return ${v}`&&s===f.InlineValueNodeType.VALUE&&i(v)}),[o,s]),(0,a.jsxs)(c.Dialog,{isOpen:!0,title:"Inline Value / Code",onClose:e.onCancel,className:"inline-code-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:t=>{"Enter"===t.key&&t.metaKey&&e.onSubmit(s,o)},tabIndex:0,children:[(0,a.jsxs)(c.RadioGroup,{inline:!0,onChange:e=>r(e.target.value),selectedValue:s,children:[(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Value ",(0,a.jsx)(m.InfoTooltip,{content:g})]}),value:f.InlineValueNodeType.VALUE}),(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Function ",(0,a.jsx)(m.InfoTooltip,{content:I})]}),value:f.InlineValueNodeType.FUNCTION})]}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"javascript",value:o,onChange:e=>i(e||""),onMount:e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})}}),(()=>{const e=o.includes("return");return e&&s===f.InlineValueNodeType.VALUE?(0,a.jsx)(c.Callout,{intent:c.Intent.WARNING,children:'When using the "value" type you are not expected to return anything'}):e||s!==f.InlineValueNodeType.FUNCTION?null:(0,a.jsxs)(c.Callout,{intent:c.Intent.DANGER,children:['When using the "function" type you are expected to'," ",(0,a.jsx)(c.Code,{children:"return"})," a value.",(0,a.jsx)("br",{}),"Example: ",(0,a.jsx)(c.Code,{children:"return 42 + Date.now();"})]})})(),(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Input pins detected:"," ",y.length?y.map((e=>(0,a.jsx)(c.Code,{children:e},e))):"None",(0,a.jsx)(m.InfoTooltip,{content:h})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:e.onCancel,children:"Cancel"}),(0,a.jsx)(c.Button,{onClick:()=>e.onSubmit(s,o),intent:c.Intent.PRIMARY,className:"save-btn",children:"Save"})]})})]})}))},18594:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(72125),t)},68371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInlineValueNode=t.getVariables=void 0;const o=n(74762),i=n(74762);t.getVariables=e=>(e.match(/inputs\.([a-zA-Z]\w*)/g)||[]).map((e=>e.replace(/inputs\./,"")));t.createInlineValueNode=e=>{let{code:n,customView:s,nodeId:r,type:a}=e;const u=(0,t.getVariables)(n).reduce(((e,t)=>({...e,[t]:(0,o.nodeInput)()})),{}),l={value:(0,o.nodeOutput)()},c=a===o.InlineValueNodeType.FUNCTION?`const result = (function() { ${n}}());\n Promise.resolve(result).then(val => outputs.value.next(val))`:`const result = (${n}); Promise.resolve(result).then(val => outputs.value.next(val))`,d=btoa(n);return(0,i.inlineValueNode)({id:r||`Inline Code ${(0,o.randomInt)(99999)}`,inputs:u,outputs:l,runFnRawCode:c,customViewCode:s||n,dataBuilderSource:d,templateType:a,completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline "+(a===o.InlineValueNodeType.VALUE?"value":"function")})}},49283:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Omnibar=t.OmniBarCmdType=void 0;const a=n(35250),u=s(n(70079)),l=n(70457),c=n(74762),d=n(50382),p=r(n(26372));var f;!function(e){e.ADD="add",e.ADD_VALUE="add-value",e.IMPORT="import"}(f=t.OmniBarCmdType||(t.OmniBarCmdType={}));const m=[];t.Omnibar=e=>{const{resolvedNodes:t}=e,[n,o]=u.useState(""),[i,s]=u.useState(null),[r,v]=u.useState([]);u.useEffect((()=>{const e=(0,c.keys)(t).map((e=>({title:`${t[e].id}`,cmd:{type:f.ADD,data:e},extra:"current flow"}))),n=r.map((e=>({title:`${e.node.id}`,description:e.node.description,cmd:{type:f.IMPORT,data:e},extra:`${e.module}`}))),o={title:"Add inline value or code",suggestOnEmpty:!0,cmd:{type:f.ADD_VALUE}},i=[...m,...n,o,...e];s(i)}),[t,r]),u.useEffect((()=>{e.onRequestImportables&&e.onRequestImportables(n).then((e=>{v(e)}))}),[e,n]);const h=u.useCallback(((e,t)=>{let{handleClick:n,modifiers:o,query:i,index:s}=t;if(!o.matchesPredicate)return null;const r=`${e.title}`;return(0,a.jsx)(d.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,a.jsxs)("div",{className:(0,p.default)("omnibar-item",{active:o.active}),children:[(0,a.jsxs)("div",{className:"title",children:[r," ",e.extra?(0,a.jsx)("span",{className:"extra",children:e.extra}):null]}),e.description?(0,a.jsx)("div",{className:"description",children:e.description}):null]})},s)}),[]),g=u.useCallback(((e,t)=>{const n=e.toLowerCase().split("").map((e=>{return`${t=e,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*`;var t})).join(""),o=new RegExp(n);return!!t.title.toLowerCase().match(o)}),[]),I=u.useCallback((t=>{e.onCommand(t.cmd),e.onClose()}),[e]);return i?(0,a.jsx)(l.Omnibar,{query:n,onQueryChange:o,onClose:e.onClose,noResults:(0,a.jsx)(d.MenuItem,{disabled:!0,text:"No results."}),itemPredicate:g,isOpen:e.visible,items:i,initialContent:void 0,onItemSelect:I,itemRenderer:h,inputProps:{placeholder:"Search for nodes or commands.."}}):null}},60698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43490:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31874),t)},31874:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.usePorts=t.useConfirm=t.usePrompt=t.PortsContext=t.defaultPorts=void 0;const s=n(70079),r=n(74762),a=n(84472);i(n(60698),t);const u=e=>async()=>{console.warn(`${e} Not implemented`),(0,a.toastMsg)("Feature not implemented in this context yet","warning")};t.defaultPorts={prompt:async e=>{let{text:t,defaultValue:n}=e;return prompt(`${t}`,n)},openFile:async e=>{},confirm:async e=>{let{text:t}=e;return confirm(t)},readFlow:u("readFlow"),setFlow:u("setFlow"),resolveDeps:u("resolveDeps"),getImportables:u("getImportables"),onExternalFlowChange:u("onExternalFlowChange"),onInstallRuntimeRequest:u("onInstallRuntimeRequest"),onRunFlow:u("onRunFlow"),onStopFlow:u("onStopFlow"),reportEvent:r.noop,generateNodeFromPrompt:u("generateNodeFromPrompt"),hasOpenAiToken:()=>Promise.resolve(!1)},t.PortsContext=(0,s.createContext)(t.defaultPorts);t.usePrompt=()=>{const e=(0,s.useContext)(t.PortsContext).prompt;return(t,n)=>e({text:t,defaultValue:n})};t.useConfirm=()=>{const e=(0,s.useContext)(t.PortsContext).confirm;return t=>e({text:t})};t.usePorts=()=>(0,s.useContext)(t.PortsContext)},65758:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelected=void 0;const i=n(74762),s=o(n(53865)),r=n(22513);t.groupSelected=async(e,t,n,o,a)=>{const{instances:u,connections:l}=t,c=u.filter((t=>e.includes(t.id))),d=l.filter((t=>{let{from:n,to:o}=t;return-1!==e.indexOf(n.insId)||-1!==e.indexOf(o.insId)}));if(!c.length)throw new Error("visual without selections");const{visualNode:p,renamedInputs:f,renamedOutputs:m}=await(0,r.createGroup)(c,d,n,a),v=c.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),u[0].pos),h="ref"===o?(0,i.nodeInstance)((0,i.createInsId)(p),p.id,{},v):(0,i.inlineNodeInstance)((0,i.createInsId)(p),p,{},v),g=u.filter((t=>-1===e.indexOf(t.id))),I=l.map((e=>{const t=`${e.from.insId}.${e.from.pinId}`,n=`${e.to.insId}.${e.to.pinId}`;return f[n]?{...e,to:{insId:h.id,pinId:f[n]}}:m[t]?{...e,from:{insId:h.id,pinId:m[t]}}:e})).filter((t=>-1===e.indexOf(t.from.insId)&&-1===e.indexOf(t.to.insId)));return{newNode:p,currentNode:(0,s.default)(t,(e=>{e.instances=[...g,h],e.connections=I}))}}},74089:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(97106),t),i(n(18420),t),i(n(90680),t),i(n(84472),t),i(n(17102),t),i(n(82232),t),i(n(25779),t),i(n(25804),t),i(n(9958),t),i(n(68120),t),i(n(94651),t),i(n(73470),t),i(n(94007),t),i(n(60190),t),i(n(9001),t),i(n(7047),t),i(n(23386),t)},31745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoTooltip=void 0;const o=n(35250),i=n(50382),s=n(50382),r=n(44470),a=n(50382);t.InfoTooltip=e=>{const{content:t}=e;return(0,o.jsx)(s.Tooltip,{content:t,placement:"top",className:"info-tooltip",children:(0,o.jsx)(i.Icon,{icon:(0,o.jsx)(r.InfoSign,{className:a.Classes.INTENT_PRIMARY}),intent:i.Intent.SUCCESS,className:"info-tooltip-icon"})})}},83938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserOnlyReactJson=void 0;const o=n(35250);t.BrowserOnlyReactJson=e=>{if("undefined"==typeof window)return null;const t=n(73541).Z;return(0,o.jsx)(t,{...e})}},94651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsValueRenderer=void 0;const o=n(35250),i=n(74762),s=n(83938);t.AnalyticsValueRenderer=e=>{let{val:t}=e;try{const e=JSON.parse(t),n="object"==typeof e?e:{value:e},r=e&&[e.type,e.key,e.props,e.ref].every(i.isDefined),a=r?{jsxValue:e}:n;return(0,o.jsx)(s.BrowserOnlyReactJson,{src:a,collapseStringsAfterLength:50,collapsed:r})}catch(n){return(0,o.jsx)(s.BrowserOnlyReactJson,{src:{value:t},collapseStringsAfterLength:50})}}},22513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=void 0;const o=n(74762),i=n(74762),s=n(60190),r=n(88593);t.createGroup=async(e,t,n,a)=>{if(0===e.length)throw new Error("cannot create group without instances");const u=e.map((e=>e.id)),l=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return!t&&n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.to,e.to)))===t)),c=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return t&&!n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.from,e.from)))===t));let d={},p={},f={},m={};const v=[],h={};for(const o of l){const e=`${o.to.insId}.${o.to.pinId}`,t=`${o.from.insId}.${o.from.pinId}`,n=o.to.pinId;if(f[t]){v.push({from:(0,i.externalConnectionNode)(f[t]),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)});continue}const r=h[n]?await a(`Name this input (${n} of ${o.to.insId}) is already taken:`)||`i${(0,s.rnd)()}`:n;d[e]=r,f[t]=r,v.push({from:(0,i.externalConnectionNode)(r),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)}),h[r]=(0,i.nodeInput)()}const g={};for(const r of c){const e=`${r.to.insId}.${r.to.pinId}`,t=`${r.from.insId}.${r.from.pinId}`,n=r.from.pinId;if(m[e]){v.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(m[e])});continue}const u=g[n]?await a(`Name this output (${n} of ${r.from.insId} is already taken:`)||`i${(0,s.rnd)()}`:n;p[t]=u,m[e]=u,v.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(u)}),g[u]=(0,o.nodeOutput)()}e.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),e[0].pos);const I=t.filter((e=>u.includes(e.from.insId)&&u.includes(e.to.insId)));return{visualNode:{id:n,inputs:h,outputs:g,instances:e,defaultStyle:{size:"large",color:(0,o.pickRandom)(r.nodeStylePresetColors.map((e=>e.color)))},inputsPosition:(0,o.okeys)(h).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:0}})),{}),outputsPosition:(0,o.okeys)(g).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:400}})),{}),connections:[...I,...v],completionOutputs:(0,o.okeys)(g)},renamedInputs:d,renamedOutputs:p}}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightText=void 0;const o=n(35250);function i(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}t.highlightText=(e,t)=>{let n=0;const s=t.split(/\s+/).filter((e=>e.length>0)).map(i);if(0===s.length)return[e];const r=new RegExp(s.join("|"),"gi"),a=[];for(;;){const t=r.exec(e);if(!t)break;const i=t[0].length,s=e.slice(n,r.lastIndex-i);s.length>0&&a.push(s),n=r.lastIndex,a.push((0,o.jsx)("strong",{children:t[0]},n))}const u=e.slice(n);return u.length>0&&a.push(u),a}},17102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Loader=void 0;const o=n(35250);t.Loader=()=>(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)("svg",{width:"38",height:"38",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:"#007ec6",children:(0,o.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,o.jsxs)("g",{transform:"translate(1 1)",strokeWidth:"2",children:[(0,o.jsx)("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),(0,o.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:(0,o.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})})})},23386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;const o=n(74762);t.logger=(0,o.debugLogger)("editor")},561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadMonaco=void 0;const o=n(51848),i=n(23386);let s=!1;t.preloadMonaco=()=>{s||o.loader.init().then((()=>{(0,i.logger)("monaco preloaded"),s=!0}))}},68120:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHotkeys=t.currentHotkeys=void 0;const i=o(n(45240)),s=n(70079);t.currentHotkeys=new Map,t.useHotkeys=function(e,n,o,r,a){void 0===r&&(r=[]);const u=(0,s.useCallback)((function(){a&&!a.current||n(...arguments)}),[...r,n]);(0,s.useEffect)((()=>((0,i.default)(e,{},u),t.currentHotkeys.set(e,o),()=>{t.currentHotkeys.delete(e),i.default.unbind(e,u)})),[e,u,o])}},94007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeSessionStorage=t.safeLocalStorage=void 0,t.safeLocalStorage={getItem:function(){try{return localStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return localStorage.setItem(...arguments)}catch(e){return null}}},t.safeSessionStorage={getItem:function(){try{return sessionStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return sessionStorage.setItem(...arguments)}catch(e){return null}}}},90680:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocalStorage=t.useResizePref=t.userPreferences=t.useUserPref=void 0;const r=s(n(70079)),a=n(18420),u=n(94007);t.useUserPref=(e,n)=>{const[o,i]=r.useState((()=>{const o=t.userPreferences.getItem(e);return(0,a.isDefined)(o)?o:n}));r.useEffect((()=>{const o=t.userPreferences.getItem(e),s=(0,a.isDefined)(o)?o:n;i(s)}),[e]);return[o,n=>{t.userPreferences.setItem(e,n),i(n)}]},t.userPreferences=(()=>{const e=e=>`up.${e}`;return{getItem:t=>{const n=u.safeLocalStorage.getItem(e(t))||"",o=u.safeSessionStorage.getItem(e(t))||"";try{return JSON.parse(o||n).value}catch(i){return}},setItem:function(t,n,o){void 0===o&&(o=!1);const i=o?sessionStorage:u.safeLocalStorage;try{const o=JSON.stringify({value:n});return i.setItem(e(t),o),!0}catch(s){return console.error("Error saving user preference",s),!1}}}})();t.useResizePref=(e,n)=>{const o=`resize.${e}`;return(0,t.useUserPref)(o,n)};const l=e=>{const t=u.safeLocalStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch(n){return null}};t.useLocalStorage=(e,t)=>{const[n,o]=r.useState(l(e)||t),i=r.useCallback((t=>{u.safeLocalStorage.setItem(e,JSON.stringify({value:t})),o(t)}),[e]);return r.useEffect((()=>{l(e)||u.safeLocalStorage.setItem(e,JSON.stringify({value:t}))}),[e,t,i]),[n,i]}},60190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.totalEnergy=t.itrPhysics=t.hookes=t.coulombs=t.vToStr=t.vNorm=t.vLen=t.vSub=t.vAdd=t.vDiv=t.vMul=t.vZero=t.rnd=t.vec=t.size=void 0;t.size=(e,t)=>({width:e,height:t});t.vec=(e,t)=>({x:e,y:t});t.rnd=function(e,t){return void 0===e&&(e=100),void 0===t&&(t=0),Math.floor(Math.random()*(e-t))+t},t.vZero={x:0,y:0};t.vMul=(e,t)=>{let{x:n,y:o}=e;return{x:n*t,y:o*t}};t.vDiv=(e,n)=>{let{x:o,y:i}=e;return(0,t.vMul)({x:o,y:i},1/n)};t.vAdd=(e,t)=>({x:e.x+t.x,y:e.y+t.y});t.vSub=(e,n)=>(0,t.vAdd)(e,(0,t.vMul)(n,-1));t.vLen=e=>{let{x:t,y:n}=e;return Math.sqrt(t*t+n*n)};t.vNorm=e=>(0,t.vDiv)(e,(0,t.vLen)(e)||1);t.vToStr=e=>{let{x:t,y:n}=e;return`${t.toFixed(1)},${n.toFixed(1)}`};t.coulombs=(e,n,o)=>{const i=(0,t.vLen)((0,t.vSub)(e.p,n.p));if(0===i){const i=(0,t.vec)(2*Math.random()-1,2*Math.random()-1),s=e.m*n.m/Math.pow(10,2);return(0,t.vMul)(i,s*o)}{const s=(0,t.vNorm)((0,t.vSub)(n.p,e.p)),r=e.m*n.m/Math.pow(i+.1,2);return(0,t.vMul)(s,r*o)}};t.hookes=(e,n,o,i,s)=>{const r=(0,t.vLen)((0,t.vSub)(e.p,n.p)),a=(0,t.vNorm)((0,t.vSub)(e.p,n.p));let u=0;return ri&&(u=i-r),(0,t.vMul)(a,s*u)};t.itrPhysics=(e,n)=>{const{p:o,v:i,f:s,m:r}=n,a=(0,t.vDiv)(s,r),u=e/1e3,l=(0,t.vAdd)((0,t.vMul)(a,u),i),c=(0,t.vAdd)((0,t.vMul)(l,u),o);return{...n,p:c,v:l,f:(0,t.vec)(0,0)}};t.totalEnergy=e=>e.reduce(((e,n)=>{const o=(0,t.vLen)(n.v);return e+.5*n.m*o*o}),0)},84472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateToast=t.toastMsg=t.AppToaster=void 0;const o=n(50382);t.AppToaster=(()=>{try{return o.OverlayToaster.create({className:"app-toaster",position:o.Position.BOTTOM_RIGHT})}catch(e){return{}}})();t.toastMsg=(e,n,o)=>t.AppToaster.show({message:e,intent:n,timeout:o});t.updateToast=(e,n,o)=>t.AppToaster.show({message:n,intent:o},e)},18420:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultAnd=t.isLocal=t.fullTime=t.timeAgoFromDt=t.timeAgo=t.toString=t.isDefined=t.set=t.createOmap=t.toOmap=t.values=t.keys=t.entries=void 0;const i=n(7047),s=n(74762),r=o(n(73136));t.entries=e=>Object.keys(e).map((t=>[t,e[t]]));t.keys=e=>Object.keys(e);t.values=e=>Object.keys(e).map((t=>e[t]));t.toOmap=e=>Array.from(e.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.createOmap=function(e){return void 0===e&&(e=[]),e.reduce(((e,t)=>({...e,[t[0]]:t[1]})),{})};t.set=(e,t,n)=>{e[t]=n};t.isDefined=e=>void 0!==e;t.toString=e=>{const t=typeof e;if(""===e)return"(empty string)";if((0,i.isJsxValue)(e))return"JSX Value";if((0,s.isStaticValueVisualNode)(e))return"Embedded Node";if((0,s.isEnvValue)(e))return(0,s.getEnvKeyFromValue)(e);if("object"===t)try{const t=JSON.stringify(e);return"{}"===t?"Empty object":t}catch(n){return"Object (cannot stringify)"}return`${e}`};t.timeAgo=e=>(0,r.default)(new Date(e)).fromNow();t.timeAgoFromDt=e=>(0,r.default)(Date.now()-e).fromNow();t.fullTime=e=>(0,r.default)(new Date(e)).toString();t.isLocal=()=>location.href.includes(":300");t.preventDefaultAnd=e=>t=>{t.preventDefault(),e(t)}},67181:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ActionButton=t.ActionsMenu=t.ActionType=void 0;const r=n(35250),a=n(50382),u=n(50382),l=n(74762),c=s(n(70079)),d=n(86125),p=n(43490),f=n(68120),m=n(90680),v=n(84472),h=n(9971),g=n(47749),I=n(46334),y=n(47230),b=n(41032);var C;!function(e){e.AddNode="add-node",e.RemoveNode="remove-node",e.Group="group",e.UnGroup="un-group",e.AddInlineValue="add-inline-value",e.Inspect="inspect",e.Run="run",e.AI="ai"}(C=t.ActionType||(t.ActionType={}));t.ActionsMenu=e=>{const{onAction:n,selectedInstances:o,resolvedNodes:i,node:s,from:u,to:g,hotkeysEnabled:x,showRunFlowOptions:N}=e,{onRequestImportables:w}=(0,d.useDependenciesContext)(),[j,O]=c.default.useState(!1),[P,E]=c.default.useState(!1),[D,S]=c.default.useState(!1),[M,T]=c.default.useState(null),[k,R]=(0,m.useLocalStorage)("hideHotkeyHintMap",{}),V=(0,c.useCallback)((()=>{O(!1)}),[]),{onRunFlow:A,generateNodeFromPrompt:$,reportEvent:z}=(0,p.usePorts)(),H=(0,c.useCallback)(((e,t)=>(E(!1),A(e,t))),[A]),G=[];if(G.push(C.AddNode),G.push(C.AddInlineValue),1===o.length){const e=s.instances.find((e=>e.id===o[0]));if(e)try{const t=(0,b.safelyGetNodeDef)(e,i);(0,l.isVisualNode)(t)&&G.push(C.UnGroup)}catch(U){console.error(`Could not find node with id ${o[0]} - ${U}`)}else console.error(`Could not find instance with id ${o[0]}`)}N&&G.push(C.Run),o.length>0&&G.push(C.Group),(1===o.length||u||g)&&G.push(C.Inspect),o.length>0&&G.push(C.RemoveNode),G.push(C.AI);const L=(0,c.useCallback)(((e,t)=>{R({...k,[e]:!0}),v.AppToaster.dismiss(t)}),[k,R]),F=(0,c.useCallback)(((e,t)=>{const{hotkey:o}=_[e];if("click"===t.type&&o&&!k[o]){const t=(0,v.toastMsg)((0,r.jsxs)(r.Fragment,{children:["Did you know? you can also use the hotkey"," ",(0,r.jsx)("kbd",{className:"hotkey",children:o})," to"," ",_[e].text.replace(/^[A-Z]/,(e=>e.toLowerCase())),(0,r.jsxs)(a.Button,{minimal:!0,small:!0,onClick:()=>L(o,t),children:[" ","Don't show again"," "]})]}),"none",3e3)}switch(e){case C.AddNode:O(!0);break;case C.Run:!async function(){E(!0)}();break;case C.AI:S(!0);break;default:n({type:e,data:void 0})}}),[k,n,L,s.inputs]);Object.entries(_).forEach((e=>{let[t,n]=e;n.hotkey&&(0,f.useHotkeys)(n.hotkey,(e=>{e.preventDefault(),G.includes(t)&&(F(t,e),R({...k,[n.hotkey]:!0}))}),{text:n.text,group:"Action menu hotkeys"},[G],x)}));const B=(0,c.useCallback)((e=>{n({type:C.AddNode,data:{importableNode:e}})}),[n]),q=(0,c.useCallback)((async e=>{const t=Date.now();T(t);try{z("generateNodeFromPrompt:start",{promptLength:e.length});const o=await $({prompt:e}),{inputs:i,outputs:s}=o.importableNode.node,r=Date.now()-t;z("generateNodeFromPrompt:success",{totalTime:r,inputs:Object.keys(i),outputs:Object.keys(s)}),T(null),n({type:C.AI,data:o}),S(!1)}catch(U){T(null),v.AppToaster.show({message:"Failed to generate node",intent:"danger"}),z("generateNodeFromPrompt:failure",{error:U.message})}}),[$,n,z]);return(0,r.jsxs)("div",{className:"actions-menu",children:[G.map((e=>(0,r.jsx)(t.ActionButton,{type:e,onClick:F},e))),j?(0,r.jsx)(h.AddNodeMenu,{onRequestImportables:w,onAddNode:B,onClose:V}):null,P?(0,r.jsx)(y.RunFlowModal,{onClose:()=>E(!1),onRun:H,node:s}):null,D?(0,r.jsx)(I.PromptAIMenu,{onClose:()=>{S(!1),T(null)},onSubmit:q,submitting:null!==M,submitTime:M}):null]})};const _={[C.AddNode]:{icon:g.addNodeIcon,text:'Open the "add node" menu',hotkey:"a"},[C.RemoveNode]:{icon:g.removeNodeIcon,text:"Remove selected instances",hotkey:"backspace"},[C.Group]:{icon:g.groupIcon,text:"Group selection into a new node",hotkey:"g"},[C.UnGroup]:{icon:g.ungroupIcon,text:"Ungroup selected visual node"},[C.Inspect]:{icon:g.inspectIcon,text:"Inspect data",hotkey:"i"},[C.AddInlineValue]:{icon:g.pencilIcon,text:"Add value / inline function",hotkey:"v"},[C.Run]:{icon:g.playIcon,text:"Run flow",hotkey:"r"},[C.AI]:{icon:g.starIcon,text:"Generate new code node using AI \u2728"}},x={icon:"",text:"N/A",hotkey:void 0};t.ActionButton=e=>{var t;const{onClick:n,type:o}=e,i=(0,c.useCallback)((e=>n(o,e)),[n,o]),s=null!==(t=_[o])&&void 0!==t?t:x,a=s.hotkey?(0,r.jsxs)("span",{children:[s.text," ",(0,r.jsx)("kbd",{className:"hotkey",children:s.hotkey})]}):s.text;return(0,r.jsx)("div",{className:"action-button",onClick:i,"data-type":o,children:(0,r.jsx)(u.Tooltip,{hoverOpenDelay:100,content:a,className:"icon-wrapper",popoverClassName:"action-button-tooltip",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s.icon}})})})}},40149:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenu=t.AddNodeMenuFilterTree=void 0;const a=n(35250),u=n(50382),l=n(74762),c=r(n(26372)),d=s(n(70079)),p=n(43490),f=n(31745),m=n(17102),v=n(87935),h=n(74657),g=n(44470);t.AddNodeMenuFilterTree=u.Tree.ofType();function I(e,t,n){return[...e.external.map((e=>({id:e.module,label:e.module,hasCaret:!0,nodeData:{type:"external",module:e.module},isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module,isExpanded:n.has(e.module),childNodes:e.namespaces.map((o=>({id:`${e.module}/${o}`,label:o,hasCaret:!1,isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module&&t.namespace===o,isExpanded:n.has(`${e.module}/${o}`),nodeData:{type:"external",module:e.module,namespace:o}})))}))),{id:"internal",label:"Current Project",nodeData:{type:"internal"},isExpanded:n.has("internal"),hasCaret:!0,isSelected:"internal"===t.type,childNodes:e.internal.files.map((e=>({id:e,label:e,isSelected:"internal"===t.type&&t.file===e,hasCaret:!1,isExpanded:n.has(e),nodeData:{type:"internal",file:e}})))}]}function y(e){return/\.flyde(\.[jt]s)?$/.test(e.module)}t.AddNodeMenu=e=>{const{onRequestImportables:n,onAddNode:o,onClose:i}=e,[s,r]=d.default.useState(),[b,C]=d.default.useState([]),[_,x]=d.default.useState(new Set),[N,w]=d.default.useState(""),[j,O]=d.default.useState({type:"all"}),[P,E]=d.default.useState(null),[D,S]=d.default.useState(null),[M,T]=d.default.useState(null),k=(0,d.useCallback)((e=>{_.add(e.id),x(new Set(_))}),[_]),R=(0,d.useCallback)((e=>{_.delete(e.id),x(new Set(_))}),[_]),V=(0,d.useCallback)((e=>{o(e),i()}),[o,i]),{onInstallRuntimeRequest:A,reportEvent:$}=(0,p.usePorts)();(0,d.useEffect)((()=>{$("addNodeMenuOpen",{})}),[$]),(0,d.useEffect)((()=>{S(null==s?void 0:s.flatMap((e=>{var t,n,o;if(j)if("external"===j.type){if((e.module!==j.module||j.namespace)&&e.node.namespace!==j.namespace)return[]}else if("internal"===j.type&&(!y(e)||j.file&&e.module!==j.file))return[];if(N){const i=`${null!==(n=null===(t=e.node.searchKeywords)||void 0===t?void 0:t.join(" "))&&void 0!==n?n:[]} ${e.node.id} ${null!==(o=e.node.namespace)&&void 0!==o?o:""} ${e.node.description}`.toLowerCase().indexOf(N.toLowerCase());return-1===i?[]:[{importable:e,score:i}]}return[{importable:e,score:1}]})).sort(((e,t)=>e.score-t.score)).map((e=>{let{importable:t}=e;return t})))}),[s,j,N]),(0,d.useEffect)((()=>{n().then((e=>{let{importables:t,errors:n}=e;C(n);const o=t.filter((e=>!y(e))).reduce(((e,t)=>{var n,o,i;null!==(n=e[i=t.module])&&void 0!==n||(e[i]=[]);const s=null!==(o=t.node.namespace)&&void 0!==o?o:"";return e[t.module].includes(s)||e[t.module].push(s),e}),{}),i=t.filter(y).map((e=>e.module));E({external:Object.entries(o).map((e=>{let[t,n]=e;return{module:t,namespaces:n}})),internal:{files:i}}),r(t),x(new Set(["internal",...Object.keys(o)]))}))}),[n]);const z=(0,d.useCallback)((e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),D&&!M)return void T(D["ArrowDown"===e.key?0:D.length-1]);if(D&&M){const t=D.findIndex((e=>e===M));let n="ArrowDown"===e.key?t+1:t-1;n=n<0?D.length-1:n,n=n>=D.length?0:n,T(D[n])}break;case"Enter":M&&V(M)}}),[D,M,V]),H=(0,d.useCallback)((e=>{let{nodeData:t}=e;JSON.stringify(t)===JSON.stringify(j)?"external"===t.type?t.namespace?O({type:"external",module:t.module}):O({type:"all"}):"internal"===t.type&&(t.file?O({type:"internal"}):O({type:"all"})):O(t)}),[j]),G=!s||s.some((e=>e.module.includes("@flyde/stdlib"))),L=(0,d.useCallback)((()=>{A(),i()}),[i,A]);return(0,a.jsx)(u.Dialog,{isOpen:!0,title:"Add Node Menu",onClose:e.onClose,className:"add-node-menu",isCloseButtonShown:!0,children:(0,a.jsxs)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),children:[(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"bp5-input-group",children:[(0,a.jsx)(g.Search,{}),(0,a.jsx)("input",{className:"bp5-input",type:"search",placeholder:"Search input",dir:"auto",autoFocus:!0,onChange:e=>w(e.target.value),value:N,onKeyDown:z})]}),G?null:(0,a.jsxs)(u.Callout,{intent:u.Intent.NONE,style:{marginTop:10},children:["Using built-in @flyde/stdlib. It's recommended to explicitly install it instead."," ",(0,a.jsx)(u.Button,{minimal:!0,small:!0,intent:u.Intent.PRIMARY,onClick:L,children:"Click here to install it using npm/yarn"})]})]}),(0,a.jsx)("div",{className:"content-wrapper",children:s?(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsxs)("aside",{children:[(0,a.jsxs)("div",{className:"filter-header",children:["Filter by package"," ",(0,a.jsx)(u.Tooltip,{content:(0,a.jsxs)("span",{children:["Click to learn more about how packages work in Flyde"," "]}),hoverCloseDelay:1500,children:(0,a.jsx)("a",{target:"_blank",href:"https://www.flyde.dev/docs/packages",rel:"noreferrer",children:(0,a.jsx)(u.Icon,{icon:(0,a.jsx)(g.Help,{}),intent:"primary",iconSize:12})})})]}),(0,a.jsx)("div",{className:"tree-container",children:(0,a.jsx)(t.AddNodeMenuFilterTree,{contents:I(P,j,_),onNodeCollapse:R,onNodeExpand:k,onNodeClick:H,className:u.Classes.ELEVATION_0})})]}),(0,a.jsx)("main",{children:D?0===D.length?(0,a.jsxs)("div",{className:"no-results",children:[(0,a.jsx)(h.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:O,query:N,onChangeQuery:w,resultsCount:D.length}),(0,a.jsxs)(u.Callout,{className:"callout",intent:"primary",children:["Can't find a suitable node? Create one yourself!"," ",(0,a.jsx)("a",{href:"https://www.flyde.dev/docs/code-nodes",target:"_blank",rel:"noreferrer",children:"Learn more"})]})]}):(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsx)(h.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:O,query:N,onChangeQuery:w,resultsCount:D.length}),(0,a.jsx)("div",{className:"results",children:D.map((e=>(0,a.jsx)(v.AddNodeMenuListItem,{importableNode:e,onAdd:V,selected:(null==M?void 0:M.node)===e.node,onSelect:T,onSetFilter:O},e.node.id+e.node.namespace+e.module)))})]}):(0,a.jsx)(m.Loader,{})})]}):(0,a.jsx)(m.Loader,{})}),b.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",style:{marginTop:"10px"},children:["Found ",(0,l.simplePluralize)(b.length,"corrupt flow"),(0,a.jsx)(f.InfoTooltip,{content:b.map((e=>{let{path:t,message:n}=e;return`${t}: ${n}`})).join(", ")})," "]}):null]})})}},8470:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuListItem=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079));t.AddNodeMenuListItem=e=>{const{importableNode:t,onSetFilter:n,onAdd:o,onSelect:i}=e,{node:s,module:r}=t,{id:d,description:p}=s,f=c.default.useRef(null);c.default.useEffect((()=>{e.selected&&f.current&&f.current.scrollIntoView({block:"center"})}),[e.selected]);const m=(0,c.useCallback)((()=>{o(t)}),[o,t]),v=(0,c.useCallback)((()=>{i(t)}),[i,t]);return(0,a.jsxs)("div",{className:(0,l.default)("add-node-menu-list-item",{selected:e.selected}),ref:f,onClick:v,children:[(0,a.jsxs)("div",{className:"content",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("span",{className:"id",children:d}),(0,a.jsxs)(u.Tag,{interactive:!0,onClick:()=>n({type:"external",module:r,namespace:s.namespace}),className:"source",minimal:!0,children:[r,s.namespace?` / ${s.namespace}`:null]})]}),(0,a.jsx)("div",{className:"description",children:p||(0,a.jsx)("em",{children:"No description"})})]}),(0,a.jsx)("aside",{children:(0,a.jsx)(u.Button,{onClick:m,children:"Add"})})]})}},87935:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8470),t)},88671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuResultsSummary=void 0;const o=n(35250),i=n(50382);t.AddNodeMenuResultsSummary=e=>{const{resultsCount:t,query:n,filter:s,onChangeFilter:r,onChangeQuery:a}=e;return(0,o.jsxs)("div",{className:"add-node-menu-results-summary",children:[t?`Showing ${t} result${t>1?"s":""}`:"No results found","\xa0",n?(0,o.jsxs)(o.Fragment,{children:["matching query\xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>a(""),children:['"',n,'"']})]}):null,"all"===s.type?null:"external"===s.type?(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["package ",s.module,s.namespace?` / ${s.namespace}`:null]})]}):(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["\xa0this project ",s.file?` / ${s.file}`:null]})]})]})}},74657:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88671),t)},9971:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40149),t)},83159:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PromptAIMenu=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=1e4;t.PromptAIMenu=e=>{const{onClose:t}=e,[n,o]=c.default.useState(""),[i,s]=c.default.useState(0);return(0,c.useEffect)((()=>{s(0);const t=setInterval((()=>{s((t=>{const n=(Date.now()-e.submitTime)/d;return Math.min(n+.05*Math.random()/2,.95)}))}),500);return()=>clearInterval(t)}),[e.submitTime]),(0,a.jsxs)(u.Dialog,{isOpen:!0,onClose:t,className:"prompt-ai-menu",title:"\u2728 Generate Code Node using AI",children:[(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsx)(u.TextArea,{value:n,disabled:e.submitting,onChange:e=>o(e.target.value),placeholder:"Describe your node in details",fill:!0})}),e.submitTime?(0,a.jsx)("div",{className:"progress-bar-container",children:(0,a.jsx)(u.ProgressBar,{value:i})}):null,(0,a.jsx)("div",{className:u.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:u.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(u.Button,{onClick:t,children:"Close"}),(0,a.jsx)(u.Button,{intent:u.Intent.PRIMARY,className:"run-btn",disabled:e.submitting||!n,loading:e.submitting,onClick:()=>{s(0),e.onSubmit(n)},children:"Create \u2728"})]})})]})}},46334:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(83159),t)},3152:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RunFlowModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(90680),f=n(31745);t.RunFlowModal=u.memo((function(e){const{onRun:t,onClose:n,node:o}=e,[i,s]=u.useState(0),[r,m]=(0,p.useLocalStorage)(`run-inputs-${o.id}`,Object.keys(o.inputs).reduce(((e,t)=>(e[t]=`Enter a value for input ${t}`,e)),{})),[v,h]=u.useState(JSON.stringify(r,null,2)),g=e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})},I=u.useCallback((()=>{const e=JSON.parse(v);m(e),t(e,i)}),[t,m,v,i]),y=Object.keys(o.inputs),b=y.filter((e=>"required"!==o.inputs[e].mode)),C=u.useMemo((()=>y.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:"This node receives external inputs. Enter values for each input below:"}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"json",value:v,onChange:e=>h(null!=e?e:""),onMount:g}),b.length>0?(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Note: input(s) ",(0,a.jsx)("code",{children:b.join(", ")})," are optional"]}):null]}):(0,a.jsx)("strong",{children:"This node does not receive any external inputs."})),[y.length,b,v]);return(0,a.jsxs)(c.Dialog,{isOpen:!0,onClose:e.onClose,className:"run-flow-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&I()},tabIndex:0,children:[C,(0,a.jsxs)("div",{className:"execution-delay-wrapper",children:[(0,a.jsxs)("label",{children:["Execution delay:"," ",(0,a.jsx)(f.InfoTooltip,{content:"Delay between each node execution. Useful for debugging."})]}),(0,a.jsx)(c.Slider,{value:i,onChange:s,min:0,labelStepSize:500,stepSize:100,labelRenderer:e=>`${e}ms`,max:1e3})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:n,children:"Close"}),(0,a.jsx)(c.Button,{onClick:I,intent:c.Intent.PRIMARY,className:"run-btn",children:"Run"})]})})]})}))},47230:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3152),t)},47749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starIcon=t.stopIcon=t.playIcon=t.pencilIcon=t.ungroupIcon=t.groupIcon=t.inspectIcon=t.removeNodeIcon=t.addNodeIcon=void 0,t.addNodeIcon='\n\n',t.removeNodeIcon='\n\n',t.inspectIcon='\n\n\n',t.groupIcon='\n\n\n',t.ungroupIcon='\n\n\n',t.pencilIcon='\n\n',t.playIcon='\n\n\n',t.stopIcon='\n\n\n',t.starIcon='\n\n\n\n\n'},1237:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HelpBubble=void 0;const i=n(70079),s=n(35250),r=n(50382),a=n(99489),u=n(50382),l=o(n(70079)),c=n(68120),d=n(71644),p=n(43490),f={offset:{enabled:!0,options:{offset:[0,20]}},preventOverflow:{enabled:!0,options:{padding:10}}};const m=["Viewport Controls","Editing","Selection"];t.HelpBubble=()=>{const[e,t]=l.default.useState(!1),n=Array.from(c.currentHotkeys.entries()).map((e=>{let[t,n]=e;return{combo:(o={key:t,menuData:n}).key,label:o.menuData.text,group:o.menuData.group};var o})).reduce(((e,t)=>(e[t.group]||(e[t.group]=[]),e[t.group].push(t),e)),{}),o=Object.entries(n).sort(((e,t)=>m.indexOf(t[0])-m.indexOf(e[0]))),{reportEvent:v}=(0,p.usePorts)(),h=(0,s.jsx)(r.Dialog,{isOpen:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:r.Classes.DIALOG_BODY,children:o.map((e=>{let[t,n]=e;return(0,s.jsxs)(l.default.Fragment,{children:[(0,s.jsx)(r.H4,{children:t}),n.map((e=>(0,i.createElement)(a.Hotkey,{...e,key:e.combo})))]},t)}))})}),g=(0,s.jsxs)(r.Menu,{children:[(0,s.jsx)(r.MenuItem,{text:"Hotkeys",onClick:()=>{t(!0),v("helpMenuItem",{item:"hotkeys"})}}),(0,s.jsx)(r.MenuItem,{text:"Documentation",onClick:()=>v("helpMenuItem",{item:"documentation"}),href:"https://www.flyde.dev/docs",target:"_blank"}),(0,s.jsx)(r.MenuDivider,{}),(0,s.jsx)(r.MenuItem,{text:"Discord",onClick:()=>v("helpMenuItem",{item:"discord"}),href:"https://discord.gg/x7t4tjZQP8",target:"_blank"})]});return(0,s.jsxs)("div",{className:"help-bubble","data-tip":"Help",children:[(0,s.jsx)(u.Popover,{content:g,modifiers:f,onOpened:()=>v("helpMenuOpen",{}),children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:d.helpIcon}})}),h]})}},71644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpIcon=void 0,t.helpIcon='\n\n\n'},3354:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1237),t)},7011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainInstanceEventsIndicator=void 0;const o=n(35250),i=n(30994),s=n(66189),r=n(50382);t.MainInstanceEventsIndicator=e=>{const{currentInsId:t,ancestorsInsIds:n}=e,{history:a,refreshHistory:u,resetHistory:l}=(0,s.useHistoryHelpers)(t),c=`main-indicator-${t}}`;return(0,o.jsx)("div",{className:"main-instance-events-indicator",children:(0,o.jsx)(r.Tooltip,{content:(0,s.calcHistoryContent)(a),children:(0,o.jsx)("span",{onMouseEnter:u,onMouseOut:l,id:(0,i.getMainInstanceIndicatorDomId)(t,n),className:"status-text","data-tip":"","data-html":!0,"data-for":c})})})}},22714:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7011),t)},63521:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VisualNodeEditor=t.defaultBoardData=t.defaultViewPort=t.NODE_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=n(74762),c=n(86553),d=n(65082),p=n(18420),f=n(26701),m=n(7047),v=n(53865),h=n(70079),g=n(68120),I=r(n(27942)),y=n(50382),b=n(66005),C=n(60190),_=n(71033),x=n(74762),N=n(99942),w=n(44338),j=n(561),O=n(84472),P=n(82232),E=n(18594),D=n(68371),S=r(n(61888)),M=n(65758),T=n(43490),k=r(n(26372)),R=n(25044),V=n(80510),A=n(1788),$=n(2130),z=n(88593),H=n(97106),G=n(67181),L=n(22714),F=n(3354),B=n(41032),q=n(30653),U=u.memo(y.Slider),W=()=>null;t.NODE_HEIGHT=28;t.defaultViewPort={pos:{x:0,y:0},zoom:1},t.defaultBoardData={selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}},t.VisualNodeEditor=u.memo(u.forwardRef(((e,n)=>{const{onChangeNode:o,nodeIoEditable:i,onCopy:s,onGoToNodeDef:r,onInspectPin:J,boardData:Y,onChangeBoardData:K,currentInsId:Q,ancestorsInsIds:X,node:ee,onShowOmnibar:te,resolvedDependencies:ne,queuedInputsData:oe,initialPadding:ie,disableScrolling:se}=e,{onImportNode:re}=(0,H.useDependenciesContext)(),ae=(0,q.useDarkMode)(),{reportEvent:ue}=(0,T.usePorts)(),le=e.parentViewport||t.defaultViewPort,[ce,de]=(0,h.useState)({...ne,[ee.id]:ee});(0,h.useEffect)((()=>{de({...ne,[ee.id]:ee})}),[ne,ee]);const{selected:pe,from:fe,to:me}=Y,{instances:ve,connections:he,inputsPosition:ge,outputsPosition:Ie,inputs:ye,outputs:be}=ee,[Ce,_e]=(0,h.useState)(),[xe,Ne]=(0,h.useState)(),we=void 0===X,[je,Oe]=(0,h.useState)(0),[Pe,Ee]=(0,h.useState)(),[De,Se]=(0,h.useState)(!1),[Me,Te]=(0,h.useState)(),[ke,Re]=(0,h.useState)(),[Ve,Ae]=(0,h.useState)(),[$e,ze]=(0,h.useState)(),He=(0,h.useRef)();(0,f.useDidMount)((()=>{He.current=Xe.current.querySelector(".inline-editor-portal-root")}));const Ge=(0,T.useConfirm)(),Le=(0,T.usePrompt)(),Fe=Y.viewPort,Be=(0,h.useRef)(!0),[qe,Ue]=(0,h.useState)(null),We=u.useCallback((e=>{K({viewPort:e})}),[K]),Ze=u.useCallback(((e,t)=>J(e,t)),[J]),Je=u.useCallback(((e,t,n)=>{const i=(0,V.handleConnectionCloseEditorCommand)(ee,{from:e,to:t}),s=(0,l.isInternalConnectionNode)(t)?ve.find((e=>e.id===t.insId)):null,r=(s?s.inputConfig:{})[t.pinId],a=(0,l.isStaticInputPinConfig)(r)?(0,A.handleDetachConstEditorCommand)(i,t.insId,t.pinId):i;o(a,(0,P.functionalChange)("close-connection")),K({from:void 0,to:void 0}),ue("createConnection",{source:n})}),[ve,o,K,ee,ue]),Ye=u.useCallback((async()=>{const e=await Le("New visual node name?");if(!e)return;const{currentNode:t}=await(0,M.groupSelected)(Y.selected,ee,e,"inline",Le);o(t,(0,P.functionalChange)("group node")),(0,O.toastMsg)("Node grouped"),ue("groupSelected",{count:Y.selected.length})}),[Le,Y.selected,o,ee,ue]);(0,h.useEffect)((()=>{if(Pe){const e=setTimeout((()=>{Ee(void 0)}),350);return()=>clearTimeout(e)}}),[Pe]);const[Ke,Qe]=(0,h.useState)();(0,h.useEffect)((()=>{(0,j.preloadMonaco)()}),[]);const Xe=(0,h.useRef)(),et=(0,I.default)(Xe),tt=u.useRef({x:400,y:400}),nt=(0,f.useBoundingclientrect)(Xe)||C.vZero,ot=()=>{const e=(0,m.fitViewPortToNode)(ee,ce,et);(0,m.animateViewPort)(Fe,e,500,(e=>{We(e)}))},it=u.useCallback(((e,t)=>{const{to:n,from:o}=Y,i="input"===t?o:n,s="input"===t?n:o,r={pinId:e,insId:l.THIS_INS_ID},a="input"===t?{from:r}:{to:r};i&&i.pinId===e?K({from:void 0,to:void 0}):s?"input"===t&&n?Je(r,n,"nodeIoClick"):o&&Je(o,r,"nodeIoClick"):K(a)}),[Y,K,Je]),st=u.useCallback(((e,t,n)=>{const i=(0,v.produce)(ee,(o=>{"input"===e?o.inputs[t].description=n:o.outputs[t].description=n}));o(i,(0,P.functionalChange)("Node io description"))}),[o,ee]),rt=u.useCallback(((e,t,n)=>{const{from:o,to:i}=Y;if(fe&&fe.insId===e.id||me&&me.insId===e.id)K({from:void 0,to:void 0});else if("input"===n){const n={insId:e.id,pinId:t};!i||i.pinId!==t||(0,l.isInternalConnectionNode)(i)&&i.insId!==e.id?fe?Je(fe,n,"pinClick"):K({to:n,selected:[]}):K({to:void 0})}else{const n={insId:e.id,pinId:t};!o||o.pinId!==t||(0,l.isInternalConnectionNode)(o)&&o.insId!==e.id?me?Je(n,me,"pinClick"):K({from:n,selected:[]}):K({from:void 0})}}),[Y,fe,K,Je,me]);(0,h.useEffect)((()=>{if(!De&&et.width){const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);We(t);const n=setTimeout((()=>{const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);e.thumbnailMode||We(t),Se(!0)}),100);return()=>clearTimeout(n)}}),[ee,ie,et,e.thumbnailMode,De,ce,We]);const at=u.useCallback((()=>{const{selected:e}=Y,t=ee.instances.filter((t=>e.includes(t.id))).map((e=>({...e,id:e.id+"-copy"}))),n=ee.connections.filter((t=>{let{from:n,to:o}=t;return e.includes(n.insId)&&e.includes(o.insId)}));s({instances:t,connections:n})}),[Y,s,ee]),ut=u.useCallback((()=>{const{newNode:t,newInstances:n}=(0,R.pasteInstancesCommand)(ee,tt.current,e.clipboardData);o(t,(0,P.functionalChange)("paste instances")),K({selected:n.map((e=>e.id))})}),[o,K,ee,e.clipboardData]),lt=u.useCallback((()=>{const e=ee.id;Ke?"input"===Ke.type?Ke.ins.id===e?it(Ke.pin,"input"):rt(Ke.ins,Ke.pin,"input"):Ke.ins.id===e?it(Ke.pin,"output"):rt(Ke.ins,Ke.pin,"output"):console.warn("tried selecting closest with no pin nearby")}),[ee.id,Ke,it,rt]),ct=u.useCallback(((e,t)=>{const n=Math.min(Math.max(e,.1),3),o="mouse"===t?tt.current:{x:Fe.pos.x+et.width/2,y:Fe.pos.y+et.height/2},i=(0,m.centerBoardPosOnTarget)(o,et,n,Fe);We({...Fe,zoom:n,pos:i})}),[We,Fe,et]);(0,g.useHotkeys)("cmd+=",(e=>{ct(Fe.zoom+.1,"hotkey"),e.preventDefault()}),{text:"Zoom in board",group:"Viewport Controls"},[Fe,ct],Be),(0,g.useHotkeys)("cmd+-",(e=>{ct(Fe.zoom-.1,"hotkey"),e.preventDefault()}),{text:"Zoom out board",group:"Viewport Controls"},[ct,Fe.zoom],Be),(0,g.useHotkeys)("cmd+o",(e=>{e.preventDefault(),(0,O.toastMsg)("Ordering");const t=[];(0,N.orderVisualNode)(ee,ce,200,((e,n)=>{n%3==0&&t.push(e)})),(async()=>{for(;t.length;){const e=t.shift();(0,O.toastMsg)(`Step ${t.length}!`),await(0,l.delay)(200),o(e,(0,P.metaChange)("order-step")),(0,O.toastMsg)(`Step ${t.length}! done`)}})()}),{text:"Auto-layout (experimental)",group:"Misc."},[o,ee,ne],Be),(0,g.useHotkeys)("cmd+0",(e=>{ct(1),e.preventDefault()}),{text:"Reset zoom",group:"Viewport Controls"},[Fe,ct],Be);const dt=()=>{K({from:void 0,to:void 0,selected:[]})},pt=u.useCallback(((e,t)=>{_e(e.id),o({...ee},(0,P.metaChange)("drag-start"))}),[o,ee]),ft=u.useCallback(((e,t,n)=>{const{newValue:i,newSelected:s}=(0,m.handleInstanceDrag)(ee,e,n,t,pe,Ce);o(i,(0,P.metaChange)("drag-move")),s&&K({selected:s})}),[Ce,o,K,pe,ee]),mt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(void 0)}),[]),vt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(l.THIS_INS_ID)}),[]),ht=u.useCallback((async(t,n,o,i)=>{o.preventDefault(),o.stopPropagation();const{x:s,y:r}=i,a=(0,v.produce)(ee,(e=>{"input"===t?e.inputsPosition[n]={x:s,y:r}:e.outputsPosition[n]={x:s,y:r}}));e.onChangeNode(a,(0,P.metaChange)("node-io-drag-move"))}),[e,ee]),gt=u.useCallback((async(e,t,n,o)=>{n.preventDefault(),n.stopPropagation(),_e(void 0)}),[]),It=u.useCallback(((e,t)=>{let{id:n}=e;const o=t.shiftKey?pe.filter((e=>e!==n)):[],i=t.shiftKey?[...pe,n]:[n],s=pe.includes(n)?o:i;K({selected:s,from:void 0,to:void 0})}),[K,pe]),yt=u.useCallback((()=>{const e=ee.instances.map((e=>e.id));K({selected:e,from:void 0,to:void 0})}),[K,ee.instances]),bt=u.useCallback((e=>{const t=he.filter((t=>{let{from:n,to:o}=t;return-1===e.indexOf(n.insId)&&-1===e.indexOf(o.insId)})),n=(0,v.produce)(ee,(n=>{n.connections=t,n.instances=n.instances.filter((t=>!e.includes(t.id)))}));K({selected:[]}),o(n,(0,P.functionalChange)("delete-ins"))}),[he,o,K,ee]),Ct=u.useCallback((e=>{bt([e.id])}),[bt]),_t=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{"input"===e?(delete n.inputs[t],n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===t)))):(n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===t))),n.completionOutputs=(n.completionOutputs||[]).map((e=>e.split("+").filter((e=>e!==t)).join("+"))).filter((e=>!!e)),delete n.outputs[t])}));fe&&fe.insId===l.THIS_INS_ID&&fe.pinId===t?K({from:void 0}):me&&me.insId===l.THIS_INS_ID&&me.pinId===t&&K({to:void 0}),o(n,(0,P.functionalChange)("remove io pin"))}),[ee,fe,me,o,K]),xt=u.useCallback((async()=>{const{selected:e,from:t,to:n}=Y;0===e.length?t&&(0,l.isExternalConnectionNode)(t)?await Ge(`Are you sure you want to remove main input ${t.pinId}?`)&&_t("input",t.pinId):n&&(0,l.isExternalConnectionNode)(n)&&await Ge(`Are you sure you want to remove main output ${n.pinId}?`)&&_t("output",n.pinId):bt(e)}),[Ge,Y,bt,_t]),Nt=u.useCallback(((e,t,n)=>{const i=(0,m.getInstancePinConfig)(ee,e.id,t),s=(0,l.isStickyInputPinConfig)(i)?(0,x.queueInputPinConfig)():(0,l.stickyInputPinConfig)();o((0,m.changePinConfig)(ee,e.id,t,s),(0,P.functionalChange)("toggle-sticky")),ue("togglePinSticky",{isSticky:(0,l.isStickyInputPinConfig)(s)})}),[o,ee,ue]),wt=u.useCallback((()=>{const{newNode:e,newInstances:t}=(0,$.handleDuplicateSelectedEditorCommand)(ee,pe);o(e,(0,P.functionalChange)("duplicated instances")),K({selected:t.map((e=>e.id))})}),[o,K,ee,pe]),jt=u.useCallback((e=>{const t=e.nativeEvent.target;if(0===e.button&&Z(e.nativeEvent,ee.id)&&t&&"board-editor-inner"===t.className){if(Date.now()-je<300)return void te(e);Oe(Date.now());const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,nt),o=(0,m.domToViewPort)(n,Fe,le);Ne({from:o,to:o})}}),[ee.id,Fe,je,nt,le,te]),Ot=u.useCallback((e=>{if(Ue(null),Z(e.nativeEvent,ee.id)&&xe){if((0,m.calcSelectionBoxArea)(xe)>50){const t=(0,m.getInstancesInRect)(xe,ce,Fe,Kt.current,ee.instances,nt,le),n=e.shiftKey?[...pe,...t]:t;K({selected:n})}Ne(void 0)}}),[ee.id,ee.instances,xe,ce,Fe,nt,le,pe,K]),Pt=u.useCallback((e=>{if(!Z(e.nativeEvent,ee.id))return void(Be.current=!1);Be.current=!0;const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,(0,C.vAdd)(nt,C.vZero)),o=(0,m.domToViewPort)(n,Fe,le);xe&&Ne({...xe,to:o});const i=(0,m.findClosestPin)(ee,ce,n,nt,Q,X,Fe),s=Ke;if(i){(!s||s.ins!==i.ins||s.ins===i.ins&&s.pin!==i.pin)&&Qe({ins:i.ins,type:i.type,pin:i.id})}tt.current=o,K({lastMousePos:tt.current})}),[ee,nt,Fe,le,xe,ce,Q,X,Ke,K]),Et=u.useCallback((e=>{var t;"bp5-menu"!==(null===(t=e.relatedTarget)||void 0===t?void 0:t.className)&&(Qe(void 0),Be.current=!1)}),[]),Dt=u.useCallback(((e,t)=>{if(t){const t=(0,l.isInlineNodeInstance)(e)?e.node:(0,B.safelyGetNodeDef)(e.nodeId,ce);if(!t)throw new Error("Impossible state inspecting inexisting node");if(!(0,l.isVisualNode)(t))return void(0,O.toastMsg)("Cannot inspect a non visual node","warning");ze({insId:`${Q}.${e.id}`,node:t})}else if((0,l.isRefNodeInstance)(e)){const t=(0,B.safelyGetNodeDef)(e,ce);r(t)}else{const t=e.node;if(!(0,l.isInlineValueNode)(t))return void((0,l.isVisualNode)(t)?ze({insId:e.id,node:t}):(0,O.toastMsg)("Editing this type of node is not supported"));const n=atob(t.dataBuilderSource);Ae({insId:e.id,templateType:t.templateType,value:n,type:"existing"}),(0,O.toastMsg)("Editing inline visual node not supported yet")}}),[r,ce,Q]),St=u.useCallback((e=>{if((0,l.isInlineNodeInstance)(e)){const t=e.node;if(!(0,l.isVisualNode)(t))return void(0,O.toastMsg)("Not supported","warning");const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.filter((t=>t.id!==e.id)),n.connections=n.connections.filter((t=>{let{from:n,to:o}=t;return n.insId!==e.id&&o.insId!==e.id})),n.instances.push(...t.instances),n.connections.push(...t.connections.filter((e=>(0,l.isInternalConnectionNode)(e.from)&&(0,l.isInternalConnectionNode)(e.to))))}));o(n,{type:"functional",message:"ungroup"}),K({selected:[]})}else{const t=(0,B.safelyGetNodeDef)(e.nodeId,ce);if(!(0,l.isVisualNode)(t))return void(0,O.toastMsg)("Not supported","warning")}}),[ee,o,K,ce]),Mt=u.useCallback((async e=>{}),[]),Tt=u.useCallback(((e,t)=>{const n=(0,A.handleDetachConstEditorCommand)(ee,e.id,t);o(n,(0,P.functionalChange)("detach-const"))}),[o,ee]),kt=u.useCallback(((e,t)=>{const n=e.inputConfig[t]||(0,x.queueInputPinConfig)();(0,l.isStaticInputPinConfig)(n)&&(Re(n.value),O.AppToaster.show({message:"Value copied"}))}),[]),Rt=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{const o=n.instances.find((t=>t.id===e.id));if(!o)throw new Error("Impossible state");o.inputConfig[t]=(0,l.staticInputPinConfig)(ke),n.connections=n.connections.filter((n=>!(0,l.isInternalConnectionNode)(n.to)||!(n.to.insId===e.id&&n.to.pinId===t)))}));o(n,(0,P.functionalChange)("paste const value"))}),[ee,o,ke]),Vt=u.useCallback((async e=>{const t=await Le("New name?");if(!t)return;const n=(0,v.produce)(ee,(n=>{var o;"input"===e?(ee.inputs||(n.inputs={}),n.inputs[t]=(0,l.nodeInput)(),n.inputsPosition[t]=tt.current):(ee.outputs||(n.outputs={}),n.outputs[t]=(0,l.nodeOutput)(),n.outputsPosition[t]=tt.current,(null===(o=n.completionOutputs)||void 0===o?void 0:o.length)&&(0,O.toastMsg)("Note that this node has explicit completion outputs set. You may need to update them."))}));o(n,(0,P.functionalChange)("add new io pin")),ue("addIoPin",{type:e})}),[Le,ee,o,ue]),At=u.useCallback((async()=>{var e;const t=null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","),n=await Le("Edit completion outputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,v.produce)(ee,(e=>{e.completionOutputs=""===n?void 0:n.split(",")}));o(e,(0,P.functionalChange)("change node completions")),ue("editCompletionOutputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),$t=u.useCallback((async()=>{var e;const t=null===(e=ee.reactiveInputs)||void 0===e?void 0:e.join(","),n=await Le("Edit reactive inputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,v.produce)(ee,(e=>{e.reactiveInputs=""===n?void 0:n.split(",")}));o(e,(0,P.functionalChange)("change reactive inputs")),ue("editReactiveInputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),zt=u.useCallback((async()=>{const e=await Le("Description?",ee.description),t=(0,v.produce)(ee,(t=>{t.description=e}));o(t,(0,P.functionalChange)("Edit node description"))}),[Le,o,ee]),Ht=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{t.defaultStyle=e}));o(t,(0,P.functionalChange)("change default style")),ue("changeStyle",{isDefault:!0})}),[o,ee,ue]),Gt=u.useCallback((async(e,t)=>{const n=await Le("New name?",t)||t,i=(0,m.handleIoPinRename)(ee,e,t,n);o(i,(0,P.functionalChange)("rename io pin"))}),[ee,o,Le]),Lt=u.useCallback(((e,t)=>{const n=(0,m.handleChangeNodeInputType)(ee,e,t);o(n,(0,P.functionalChange)("toggle io pin optional"))}),[ee,o]),Ft=u.useCallback((e=>{switch(e.type){case G.ActionType.RemoveNode:{const e=(0,v.produce)(ee,(e=>{if(!(0,l.isVisualNode)(ee))throw new Error("Impossible state, deleting instances opf non visual node");e.instances=e.instances.filter((e=>!pe.includes(e.id))),e.connections=e.connections.filter((e=>!pe.includes(e.from.insId)&&!pe.includes(e.to.insId)))}));K({selected:[]}),o(e,(0,P.functionalChange)("remove-instances")),(0,O.toastMsg)(`Removed ${pe.length} instances(s)`),ue("deleteInstances",{count:pe.length});break}case G.ActionType.Inspect:if(1===pe.length)J(pe[0]);else if(fe||me){const e=null!=fe?fe:me,t=(0,l.isExternalConnectionNode)(e)?l.ROOT_INS_ID:e.insId;J(t,{type:fe?"output":"input",id:e.pinId})}ue("openInspectMenu",{source:"actionMenu"});break;case G.ActionType.Group:(async()=>{await Ye()})();break;case G.ActionType.UnGroup:{const e=ee.instances.find((e=>e.id===pe[0]));St(e);const t=(0,B.safelyGetNodeDef)(e,ce);(0,O.toastMsg)(`Ungrouped inline node ${t.id}`),ue("unGroupNode",{instancesCount:t.instances.length});break}case G.ActionType.AddInlineValue:Ae({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"actionMenu"});break;case G.ActionType.AddNode:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,v.produce)(ee,(e=>{e.instances.push(r)})),u=(0,v.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,P.functionalChange)("add new instance")),K(u),(0,O.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;case G.ActionType.AI:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,v.produce)(ee,(e=>{e.instances.push(r)})),u=(0,v.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,P.functionalChange)("add new instance")),K(u),(0,O.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;default:(0,O.toastMsg)(`${e.type} not supported yet`)}}),[Y,fe,o,K,Ye,re,J,St,ee,ce,ue,pe,me,Fe,et]),Bt=()=>{const t=Y.from;return(0,p.entries)(ye).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"input",pos:ge[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,onDblClick:Zt,closest:!(!Ke||"input"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,inputMode:s.mode,onChangeInputMode:Lt,viewPort:Fe,onDragStart:vt,onDragEnd:gt,onDragMove:ht,onSelect:it,onSetDescription:st,selected:(null==t?void 0:t.pinId)===o,description:s.description,onMouseUp:Nn,onMouseDown:xn},o)}))},qt=()=>{const{to:t}=Y;return(0,p.entries)(be).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"output",pos:Ie[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,closest:!(!Ke||"output"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,viewPort:Fe,onDragStart:vt,onDragEnd:gt,onDragMove:ht,onSelect:it,onSetDescription:st,description:s.description,selected:(null==t?void 0:t.pinId)===o,onMouseUp:Nn,onMouseDown:xn},o)}))},Ut=()=>{if(xe){const{from:e,to:t}=xe,n=(0,m.logicalPosToRenderedPos)(e,Fe),o=(0,m.logicalPosToRenderedPos)(t,Fe),{x:i,y:s,w:r,h:u}=(0,m.getSelectionBoxRect)(n,o);return(0,a.jsx)("div",{className:"selection-box",style:{top:s,left:i,width:r,height:u}})}return null},Wt=u.useCallback((async(e,t,n,o)=>{if("input"===n){const n=e.inputConfig[t],o=(0,l.isStaticInputPinConfig)(n)?JSON.stringify(n.value):void 0;Ae({type:"static-input",insId:e.id,pinId:t,value:null!=o?o:JSON.stringify("Some static value")}),ue("addValueModalOpen",{source:"dblClickPin"})}else{const i=(0,B.safelyGetNodeDef)(e,ce);if(!(0,l.getNodeOutputs)(i)[t])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:o.clientX,y:o.clientY},ins:e,targetNode:i,pinId:t,pinType:n})}}),[ce,ue]),Zt=u.useCallback((async(e,t)=>{if(!ee.inputs[e])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:t.clientX,y:t.clientY},pinId:e,pinType:"input",targetNode:ee})}),[ee]),Jt=u.useCallback((e=>{if(e.metaKey||e.ctrlKey){const t=-.005*e.deltaY;ct(Fe.zoom+t,"mouse"),e.preventDefault(),e.stopPropagation()}else{if(se)return;const t=e.deltaX,n=e.deltaY,o=(0,v.produce)(Fe,(e=>{e.pos.x=e.pos.x+t/e.zoom,e.pos.y=e.pos.y+n/e.zoom}));We(o),e.stopPropagation(),e.preventDefault()}}),[se,ct,We,Fe]);(0,h.useEffect)((()=>{const{current:e}=Xe;if(e)return e.addEventListener("wheel",Jt),()=>{e.removeEventListener("wheel",Jt)}}),[Jt]);const Yt={backgroundPositionX:(0,m.roundNumber)(-Fe.pos.x*Fe.zoom),backgroundPositionY:(0,m.roundNumber)(-Fe.pos.y*Fe.zoom),backgroundSize:(0,m.roundNumber)(10*Fe.zoom)+"px"},Kt=u.useRef(new Map);u.useEffect((()=>{const e=ve.reduce(((e,t)=>{const n=(0,B.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeInputs)(n))),e}),new Map),t=ve.reduce(((e,t)=>{const n=(0,B.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeOutputs)(n))),e}),new Map);e.set(l.THIS_INS_ID,(0,l.keys)(ee.outputs)),t.set(l.THIS_INS_ID,(0,l.keys)(ee.inputs));const n=he.filter((n=>{const o=e.get(n.to.insId)&&e.get(n.to.insId).includes(n.to.pinId),i=t.get(n.from.insId)&&t.get(n.from.insId).includes(n.from.pinId);return!(o&&i)}));if(n.length>0){(0,O.toastMsg)(`${n.length} orphan connections removed`,"warning"),console.warn(`${n.length} orphan connections removed`,n);const e=(0,v.produce)(ee,(e=>{e.connections=ee.connections.filter((e=>!n.includes(e)))}));o(e,(0,P.functionalChange)("prune orphan connections"))}}),[ve,o,he,ee,ce]),u.useEffect((()=>{let e=[];const t=(0,v.produce)(ee,(t=>{t.instances=t.instances.map((t=>{const n=(0,B.safelyGetNodeDef)(t,ce);if(n){const o=(0,l.getNodeInputs)(n),i=(0,l.getNodeOutputs)(n);if(t.visibleInputs){const n=t.visibleInputs.filter((e=>!o[e]));n.length>0&&(t.visibleInputs=(0,l.keys)(o),e.push(...n))}if(t.visibleOutputs){const n=t.visibleOutputs.filter((e=>!i[e]));n.length>0&&(t.visibleOutputs=(0,l.keys)(i),e.push(...n))}}return t}))}));e.length>0&&((0,O.toastMsg)(`Found ${e.length} invalid visible inputs/outputs: ${e.join(", ")}. Reset them`,"warning"),o(t,(0,P.functionalChange)("reset corrupt visible inputs/outputs")))}),[ve,o,ee,ce]),(0,h.useEffect)((()=>{const e=new Map(ve.map((e=>[e.id,e])));Kt.current=he.reduce(((t,n)=>{const o=t.get(n.to.insId)||{},i=o[n.to.pinId]||[],s={...o,[n.to.pinId]:[...i,e.get(n.from.insId)]};return t.set(n.to.insId,s),t}),new Map)}),[he,ve]);const Qt=u.useCallback((()=>{Te(void 0)}),[]),Xt=u.useCallback((async e=>{if(!Me)throw new Error("impossible state - quick add menu invoked but not available");const{ins:t,pinId:n}=Me;switch(e.type){case"import":case"node":{const i="import"===e.type?await re(e.importableNode):ce,s="import"===e.type?e.importableNode.node:e.node,r=(0,m.createNewNodeInstance)(s.id,100,tt.current,i);if(r){const e=(0,v.produce)(ee,(e=>{e.instances.push(r),e.connections.push({from:{insId:t?t.id:l.THIS_INS_ID,pinId:n},to:{insId:r.id,pinId:l.TRIGGER_PIN_ID}})}));o(e,(0,P.functionalChange)("add-item-quick-menu")),Qt()}ue("addNode",{nodeId:s.id,source:"quickAdd"});break}case"value":if(!t)return void(0,O.toastMsg)("Cannot add value to main input");Ae({type:"new-output",insId:t.id,pinId:n}),ue("addValueModalOpen",{source:"quickAdd"})}}),[Me,ce,ue,ee,o,Qt,re]),en=u.useCallback((async()=>{const e=JSON.stringify(ee);await navigator.clipboard.writeText(e),O.AppToaster.show({message:"Copied!"})}),[ee]),tn=u.useCallback((()=>{var e,t;const n=i?"":" (cannot edit main node, only visual)";return(0,a.jsxs)(y.Menu,{children:[(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"New Value",onClick:(0,p.preventDefaultAnd)((()=>{Ae({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"contextMenu"})}))}),(0,a.jsx)(y.MenuItem,{text:`New input ${n}`,onMouseDown:e=>e.stopPropagation(),onClick:(0,p.preventDefaultAnd)((()=>Vt("input"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`New output ${n}`,onClick:(0,p.preventDefaultAnd)((()=>Vt("output"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Copy node to clipboard",onClick:(0,p.preventDefaultAnd)(en)}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Completion Outputs (${(null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>At()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Reactive inputs (${(null===(t=ee.reactiveInputs)||void 0===t?void 0:t.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>$t()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Edit description",onClick:(0,p.preventDefaultAnd)((()=>zt()))}),(0,a.jsx)(y.MenuDivider,{}),(0,a.jsx)(y.MenuItem,{text:"Default Style",children:(0,a.jsx)(z.NodeStyleMenu,{style:ee.defaultStyle,onChange:Ht,promptFn:Le})})]})}),[i,en,ee.completionOutputs,ee.reactiveInputs,ee.defaultStyle,Ht,Le,ue,Vt,At,$t,zt]);(0,g.useHotkeys)("shift+c",ot,{text:"Center viewport",group:"Viewport Controls"},[],Be),(0,g.useHotkeys)("cmd+c",at,{text:"Copy instances",group:"Editing"},[],Be),(0,g.useHotkeys)("cmd+v",ut,{text:"Paste instances",group:"Editing"},[],Be),(0,g.useHotkeys)("esc",dt,{text:"Clear selections",group:"Selection"},[],Be),(0,g.useHotkeys)("backspace",xt,{text:"Delete instances",group:"Editing"},[],Be),(0,g.useHotkeys)("shift+d",wt,{text:"Duplicate selected instances",group:"Editing"},[],Be),(0,g.useHotkeys)("cmd+a",yt,{text:"Select all",group:"Selection"},[],Be),(0,g.useHotkeys)("s",lt,{text:"Select pin closest to mouse",group:"Selection"},[],Be);const nn=u.useCallback(((e,t)=>{if(!$e)throw new Error("impossible state");const n=(0,v.produce)(ee,(t=>{const n=t.instances.find((e=>e.id===$e.insId));if(!n||!(0,l.isInlineNodeInstance)(n))throw new Error("impossible state");n.node=e}));o(n,(0,P.functionalChange)("Inner change: "+t.message)),ze((t=>({...t,node:e})))}),[o,$e,ee]),[on,sn]=(0,h.useState)({selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}}),rn=u.useCallback((e=>sn((t=>({...t,...e})))),[]),an=n=>$e&&$e.insId===n.id?{currentInsId:$e.insId,ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),boardData:on,onChangeBoardData:rn,resolvedDependencies:ne,onCopy:s,clipboardData:e.clipboardData,onInspectPin:e.onInspectPin,onGoToNodeDef:e.onGoToNodeDef,nodeIoEditable:e.nodeIoEditable,node:$e.node,onChangeNode:nn,onShowOmnibar:te,parentViewport:t.defaultViewPort,parentBoardPos:nt,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:e.queuedInputsData}:void 0,un=()=>{if(fe&&("input"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"output"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(e)&&!(0,l.isInternalConnectionNode)(fe))return;return{from:fe,to:e}}if(me&&("output"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"input"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(me)&&!(0,l.isInternalConnectionNode)(e))return;return{from:e,to:me}}},ln=()=>{const e=un();if(e){const{from:t,to:n}=e;return{connection:{from:t,to:n},type:he.some((t=>(0,l.connectionDataEquals)(t,e)))?"future-remove":"future-add"}}},cn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleInputs:t}:n))}));o(n,(0,P.functionalChange)("change instance visible inputs"))}),[ee,o]),dn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,style:t}:n))}));o(n,(0,P.functionalChange)("change instance style")),ue("changeStyle",{isDefault:!1})}),[o,ee,ue]),pn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleOutputs:t}:n))}));o(n,(0,P.functionalChange)("change instance visible outputs"))}),[ee,o]),fn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,displayName:t}:n))}));o(n,(0,P.functionalChange)("change instance display name"))}),[ee,o]);u.useImperativeHandle(n,(()=>({centerInstance(e){const t=ee.instances.find((t=>t.id===e));if(t){const e=(0,C.vSub)(t.pos,(0,C.vec)(et.width/2,et.height/2));We({...Fe,pos:e})}},centerViewPort(){ot()},getViewPort:()=>Fe,clearSelection:()=>{dt()},requestNewInlineValue:()=>{Ae({type:"new-floating",pos:tt.current})}})));const[mn,vn]=u.useState([]),hn=u.useCallback(((e,t)=>{const n=t.trim().substr(0,100),i=`Inline-value-${n.substr(0,15).replace(/["'`]/g,"")}`,s=(0,D.createInlineValueNode)({code:t,customView:n,nodeId:i,type:e});switch(Ve.type){case"existing":{const[e]=ee.instances.filter((e=>e.id===Ve.insId)).filter((e=>(0,l.isInlineNodeInstance)(e))).map((e=>e.node));if(!e)throw new Error("Unable to find inline node to save to");const t=(0,l.keys)(e.inputs),n=(0,l.keys)(s.inputs),i=new Set(S.default.difference(t,n)),r=(0,v.produce)(ee,(e=>{e.instances=e.instances.map((e=>e.id===Ve.insId?(0,l.inlineNodeInstance)(e.id,s,e.inputConfig,e.pos):e)),e.connections=e.connections.filter((e=>!(e.to.insId===Ve.insId&&i.has(e.to.pinId))))}));o(r,(0,P.functionalChange)("change inline value")),Ae(void 0);break}case"static-input":{let e;try{const n=t.replace(/^['`]/,'"').replace(/['`]$/,'"');e=JSON.parse(n)}catch(r){return void(0,O.toastMsg)("Input values must not be formulas or code")}const n=(0,v.produce)(ee,(t=>{t.instances.find((e=>e.id===Ve.insId)).inputConfig[Ve.pinId]=(0,l.staticInputPinConfig)(e)}));o(n,(0,P.functionalChange)("set static input value")),Ae(void 0);break}case"new-floating":{const e=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},Ve.pos),t=(0,v.produce)(ee,(t=>{t.instances.push(e)}));o(t,(0,P.functionalChange)("new floating value")),Ae(void 0);break}case"new-output":{const{insId:e,pinId:t}=Ve,n=ee.instances.find((t=>t.id===e));if(!n)throw new Error("Impossible state");const i=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},(0,C.vAdd)(n.pos,{x:-50,y:150})),r=(0,v.produce)(ee,(n=>{n.instances.push(i),n.connections.push({from:(0,l.connectionNode)(e,t),to:(0,l.connectionNode)(i.id,l.TRIGGER_PIN_ID)})}));o(r,(0,P.functionalChange)("new value connected to output")),Ae(void 0)}}ue("addValue",{type:e,placeholdersCount:(0,l.keys)(s.inputs).length})}),[Ve,o,ee,ue]),gn=he.filter((e=>{const t=un();return!t||!(0,l.connectionDataEquals)(t,e)})),In=u.useCallback((()=>{ze(void 0),sn(t.defaultBoardData)}),[]),yn=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{const n=t.connections.find((t=>(0,l.connectionDataEquals)(t,e)));n.hidden=!n.hidden}));o(t,(0,P.functionalChange)("toggle connection hidden"))}),[o,ee]),bn=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{t.connections=t.connections.filter((t=>!(0,l.connectionDataEquals)(t,e)))}));o(t,(0,P.functionalChange)("remove connection"))}),[o,ee]),Cn=u.useCallback(((e,t,n)=>{Ue("input"===n?{to:(0,l.connectionNode)(e.id,t),from:void 0}:{from:(0,l.connectionNode)(e.id,t),to:void 0})}),[]),_n=u.useCallback(((e,t,n)=>{qe&&(qe.from&&"input"===n?Je(qe.from,(0,l.connectionNode)(e.id,t),"pinDrag"):qe.to&&"output"===n&&Je((0,l.connectionNode)(e.id,t),qe.to,"pinDrag")),Ue(null)}),[qe,Je]),xn=u.useCallback(((e,t)=>{}),[]),Nn=u.useCallback(((e,t)=>{qe&&(qe.from&&"output"===t?Je(qe.from,(0,l.externalConnectionNode)(e),"nodeIoPinDrag"):qe.to&&"input"===t&&Je((0,l.externalConnectionNode)(e),qe.to,"nodeIoPinDrag"))}),[qe,Je]);try{return(0,a.jsxs)(y.ContextMenu,{className:(0,k.default)("visual-node-editor",e.className,{dark:ae}),"data-id":ee.id,content:tn(),disabled:!Be.current,children:[(0,a.jsxs)("main",{className:"board-editor-inner",onMouseDown:jt,onMouseUp:Ot,onMouseMove:Pt,onMouseLeave:Et,ref:Xe,style:Yt,children:[(0,a.jsx)(u.Fragment,{children:(0,a.jsx)(w.LayoutDebugger,{vp:Fe,node:ee,extraDebug:m.emptyList,mousePos:tt.current})}),(0,a.jsx)(d.ConnectionView,{resolvedNodes:ce,currentInsId:Q,ancestorsInsIds:X,size:et,node:ee,boardPos:nt,instances:ve,connections:gn,futureConnection:ln(),onDblClick:l.noop,viewPort:Fe,parentVp:le,selectedInstances:pe,toggleHidden:yn,removeConnection:bn,lastMousePos:tt.current,draggedSource:qe}),Bt(),ve.map((t=>{var n,o,i,s,r;return(0,a.jsx)(c.InstanceView,{onUngroup:St,onExtractInlineNode:Mt,onDetachConstValue:Tt,onCopyConstValue:kt,onPasteConstValue:Rt,copiedConstValue:ke,connectionsPerInput:Kt.current.get(t.id)||m.emptyObj,node:(0,B.safelyGetNodeDef)(t,ce),ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),onPinClick:rt,onPinDblClick:Wt,onDragStart:pt,onDragEnd:mt,resolvedDeps:ce,onDragMove:ft,onDblClick:Dt,onSelect:It,onToggleSticky:Nt,selected:-1!==pe.indexOf(t.id),dragged:Ce===t.id,onInspectPin:Ze,selectedInput:me&&(0,l.isInternalConnectionNode)(me)&&me.insId===t.id?me.pinId:void 0,selectedOutput:fe&&(0,l.isInternalConnectionNode)(fe)&&fe.insId===t.id?fe.pinId:void 0,closestPin:Ke&&Ke.ins.id===t.id?Ke:void 0,queuedInputsData:null!==(n=oe[t.id])&&void 0!==n?n:m.emptyObj,instance:t,connections:he,onTogglePinBreakpoint:l.noop,onTogglePinLog:l.noop,viewPort:Fe,onChangeVisibleInputs:cn,onChangeVisibleOutputs:pn,onSetDisplayName:fn,onDeleteInstance:Ct,forceShowMinimized:fe||(null===(o=null==qe?void 0:qe.to)||void 0===o?void 0:o.insId)===t.id?"input":me||(null===(i=null==qe?void 0:qe.from)||void 0===i?void 0:i.insId)===t.id?"output":void 0,isConnectedInstanceSelected:pe.some((e=>he.some((n=>{let{from:o,to:i}=n;return o.insId===t.id&&i.insId===e||o.insId===e&&i.insId===t.id})))),inlineGroupProps:an(t),onCloseInlineEditor:In,inlineEditorPortalDomNode:He.current,onChangeStyle:dn,onGroupSelected:Ye,onPinMouseDown:Cn,onPinMouseUp:_n,hadError:null!==(r=null===(s=e.instancesWithErrors)||void 0===s?void 0:s.has((0,l.fullInsIdPath)(t.id)))&&void 0!==r&&r},t.id)})),Ut(),qt(),(0,a.jsx)(L.MainInstanceEventsIndicator,{currentInsId:Q,ancestorsInsIds:X,viewPort:Fe}),Me?(0,a.jsx)(_.QuickAddMenu,{targetNode:Me.targetNode,pinId:Me.pinId,pinType:Me.pinType,pos:Me.pos,resolvedDependencies:ne,node:ee,onAdd:Xt,onClose:Qt}):null,(0,a.jsxs)("div",{className:"viewport-controls-and-help",children:[(0,a.jsx)(y.Button,{small:!0,onClick:ot,minimal:!0,intent:"primary",children:"Center"}),(0,a.jsx)(U,{min:.15,max:3,stepSize:.05,labelStepSize:10,labelRenderer:W,onChange:ct,value:Fe.zoom}),we?(0,a.jsx)(F.HelpBubble,{}):null]}),Ve?(0,a.jsx)(E.InlineCodeModal,{env:m.emptyObj,initialValue:Ve.value,initialType:"existing"===Ve.type?Ve.templateType:void 0,onCancel:()=>Ae(void 0),onSubmit:hn}):null,(0,a.jsx)("div",{className:"inline-editor-portal-root"})]}),(0,a.jsx)(G.ActionsMenu,{showRunFlowOptions:we,onAction:Ft,selectedInstances:pe,node:ee,resolvedNodes:ce,to:me,from:fe,hotkeysEnabled:Be})]})}catch(wn){return console.error(wn),(0,a.jsxs)("div",{children:["Error rendering board - ",wn.toString()]})}})));const Z=(e,t)=>{const n=e.target.closest(".visual-node-editor");return n&&n.getAttribute("data-id")===t}},83234:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeView=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=r(n(59349)),d=n(30653);t.BaseNodeView=function(e){const{dragged:t,viewPort:n,pos:o,onDragEnd:i,onDragMove:s,onDragStart:r,displayMode:p}=e,f=(0,d.useDarkMode)(),m=u.useCallback(((e,t)=>{r(e,t)}),[r]),v=u.useCallback(((e,t)=>{const s=o,r=(t.x-s.x)/n.zoom,a=(t.y-s.y)/n.zoom,u=s.x+r,l=s.y+a;i(e,{...t,x:u,y:l})}),[o,i,n]),h=u.useCallback(((e,t)=>{s(e,{x:t.x,y:t.y})}),[s]),g={transform:`scale(${n.zoom})`},I=(0,l.default)("base-node-view",e.className,{dragged:t,dark:f,"display-mode":p}),y=o.x*n.zoom-n.pos.x*n.zoom,b=o.y*n.zoom-n.pos.y*n.zoom,C={transform:`translate(${y-o.x}px, ${b-o.y}px)`},_=(0,l.default)("base-node-view-vp-fixer",{"display-mode":p}),x=(0,a.jsx)("span",{className:"base-node-view-wrapper",children:(0,a.jsx)("div",{className:I,style:g,id:e.domId,children:e.children})});return(0,a.jsx)("div",{className:_,style:C,children:(0,a.jsx)(c.default,{onStop:v,onStart:m,onDrag:h,position:o,cancel:".no-drag",children:x})})}},80510:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleConnectionCloseEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleConnectionCloseEditorCommand=(e,t)=>{let{from:n,to:o}=t;return(0,s.default)(e,(e=>{const t=e.connections.find((e=>{const t=(0,i.connectionNodeEquals)(n,e.from),s=(0,i.connectionNodeEquals)(o,e.to);return t&&s}));t?e.connections=e.connections.filter((e=>e!==t)):e.connections.push({from:n,to:o})}))}},1788:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDetachConstEditorCommand=void 0;const i=n(74762),s=o(n(53865)),r=n(68371);t.handleDetachConstEditorCommand=(e,t,n)=>(0,s.default)(e,(e=>{const{instances:o}=e,s=o.find((e=>e.id===t));if(!s)throw new Error("Impossible state ins id with no matching instance");const a=s.inputConfig[n];if(!a)throw new Error("impossible state detaching const from unexistent config");if(!(0,i.isStaticInputPinConfig)(a))throw new Error("impossible state detaching const with no value");const u=JSON.stringify(a.value),l=(0,r.createInlineValueNode)({code:`${u}`,type:i.InlineValueNodeType.VALUE}),c=(0,i.inlineNodeInstance)(`value-${(0,i.randomInt)(999)}`,l,{},{x:s.pos.x,y:s.pos.y-100});if(!e.instances.find((e=>e.id===s.id)))throw new Error("impossible state instance not found");s.inputConfig[n]=(0,i.queueInputPinConfig)(),e.instances.push(c),e.connections.push((0,i.connectionData)(`${c.id}.value`,`${s.id}.${n}`))}))},2130:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDuplicateSelectedEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleDuplicateSelectedEditorCommand=(e,t)=>{const n=[];return{newNode:(0,s.default)(e,(o=>{const s=o.instances;t.forEach((t=>{const o=s.find((e=>e.id===t));if(!o)throw new Error("impossible state duplicate selected no matching instance");if(o){const{pos:t}=o,r={...o,pos:{x:t.x+20,y:t.y+20},id:(0,i.createInsId)(e)};s.push(r),n.push(r.id)}}))})),newInstances:n}}},25044:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.pasteInstancesCommand=void 0;const i=n(74762),s=o(n(53865));t.pasteInstancesCommand=(e,t,n)=>{const o=n.instances.map((n=>({...n,pos:t,id:(0,i.createInsId)(e)}))),r=new Map(o.map(((e,t)=>[n.instances[t].id,e.id])));return{newNode:(0,s.default)(e,(e=>{e.instances.push(...o);const t=n.connections.map((e=>{let{from:t,to:n}=e;return{from:{...t,insId:r.get(t.insId)||t.insId},to:{...n,insId:r.get(n.insId)||n.insId}}}));e.connections.push(...t)})),newInstances:o}}},65082:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionView=t.SingleConnectionView=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=r(n(26372)),d=n(74762),p=n(18243),f=n(77852),m=n(74089),v=n(60190),h=n(50382),g=n(76064),I=n(41032);t.SingleConnectionView=e=>{const{isBrowser:t}=(0,f.useSsr)(),{connection:n,node:o,resolvedNodes:i,instances:s,type:r,viewPort:a,toggleHidden:l,parentSelected:m,removeConnection:y}=e,{from:b}=n,C=(0,d.isInternalConnectionNode)(b)&&s.find((e=>e.id===b.insId));if(!C&&(0,d.isInternalConnectionNode)(b))throw new Error(`impossible state - "from instance id - [${b.insId}] does not exist"`);const _=((0,d.isInternalConnectionNode)(b)&&C?(0,I.safelyGetNodeDef)(C,i):o).outputs[b.pinId],x=_&&_.delayed,N=t?(0,p.calcStartPos)({...e,connectionNode:b}):{x:0,y:0},w=t?(0,p.calcTargetPos)({...e,connectionNode:n.to}):{x:0,y:0},{x:j,y:O}=(0,v.vDiv)(N,e.parentVp.zoom),{x:P,y:E}=(0,v.vDiv)(w,e.parentVp.zoom),D=(0,c.default)({delayed:x,hidden:n.hidden,"parent-selected":m},r),S=(0,u.jsxs)(h.Menu,{children:[(0,u.jsx)(h.MenuItem,{text:n.hidden?"Show connection":"Hide connection",onClick:()=>l(n)}),(0,u.jsx)(h.MenuItem,{text:"Remove connection",onClick:()=>y(n)})]});return(0,u.jsx)(h.ContextMenu,{content:S,children:e=>(0,u.jsx)(g.ConnectionViewPath,{className:D,from:{x:j,y:O},to:{x:P,y:E},dashed:"regular"!==r,zoom:a.zoom,onContextMenu:e.onContextMenu})})};t.ConnectionView=e=>{var n;const{viewPort:o,futureConnection:i,toggleHidden:s,selectedInstances:r,draggedSource:c}=e,[d,f]=l.useState(0),v=l.useCallback((e=>requestAnimationFrame((()=>{f((e=>(e+1)%9)),e>0&&v(e-1)}))),[]);l.useEffect((()=>{const e=v(10);return()=>{cancelAnimationFrame(e)}}),[v]),l.useEffect((()=>{const e=()=>{v(3)};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[v,d]);const h=e.connections.map((n=>{const o=r.includes(n.from.insId)||r.includes(n.to.insId);return(0,a.createElement)(t.SingleConnectionView,{...e,connection:n,type:"regular",parentSelected:o,key:n.from.insId+n.from.pinId+n.to.insId+n.to.pinId})}));if(i&&h.push((0,a.createElement)(t.SingleConnectionView,{...e,connection:i.connection,type:i.type,toggleHidden:s,parentSelected:!1,key:"future"})),c){const t=(c.from?p.calcStartPos:p.calcTargetPos)({connectionNode:null!==(n=c.from)&&void 0!==n?n:c.to,viewPort:o,boardPos:e.boardPos,ancestorsInsIds:e.ancestorsInsIds,currentInsId:e.currentInsId});h.push((0,u.jsx)(g.ConnectionViewPath,{className:"dragged",from:t,to:(0,m.logicalPosToRenderedPos)(e.lastMousePos,o),zoom:o.zoom},"dragged"))}return(0,u.jsx)("svg",{className:"connections-view",children:h})}},76064:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionViewPath=void 0;const i=n(35250),s=o(n(26372)),r=n(70079),a=n(23381);t.ConnectionViewPath=(0,r.forwardRef)(((e,t)=>{const{from:n,to:o,className:r,onContextMenu:u,zoom:l,dashed:c}=e,{x:d,y:p}=n,{x:f,y:m}=o,v=(0,a.calcBezierPath)({sourceX:d,sourceY:p,targetX:f,targetY:m,curvature:.15}),h=2.5*l,g=c?6*l:void 0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:v,ref:t,className:(0,s.default)("connection",r),style:{strokeWidth:h,strokeDasharray:g},onContextMenu:u}),e.label?(0,i.jsx)("text",{className:"label",x:(d+f)/2,y:(p+m)/2,fontSize:"12px"}):null,(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%"}),(0,i.jsx)("stop",{offset:"100%"})]})]})}))},23381:(e,t)=>{"use strict";var n;function o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i(e){let t,i,{pos:s,x1:r,y1:a,x2:u,y2:l,c:c}=e;switch(s){case n.Left:t=r-o(r-u,c),i=a;break;case n.Right:t=r+o(u-r,c),i=a;break;case n.Top:t=r,i=a-o(a-l,c);break;case n.Bottom:t=r,i=a+o(l-a,c)}return[t,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.getBezierCenter=t.calcBezierPath=t.Position=void 0,function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(n=t.Position||(t.Position={}));t.calcBezierPath=e=>{let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l});return`M${t},${o} C${c},${d} ${p},${f} ${r},${a}`},t.getBezierCenter=function(e){let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l}),m=.125*t+.375*c+.375*p+.125*r,v=.125*o+.375*d+.375*f+.125*a;return[m,v,Math.abs(m-t),Math.abs(v-o)]}},18243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcTargetPos=t.calcStartPos=t.calcPinPosition=void 0;const o=n(74762),i=n(30994),s={x:99999,y:99999};function r(e){const t=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds),pinId:e.pinId,pinType:e.pinType,isMain:e.isMain});return((e,t,n,o)=>{if(!e)return console.warn(`Cannot find element ${n} to calculate position.`),s;const{x:i,y:r,width:a,height:u}=e.getBoundingClientRect(),l=r+u/2;return{x:i+a/2-t.x,y:l-t.y}})(document.getElementById(t),e.boardPos,t,e.viewPort)}t.calcPinPosition=r;t.calcStartPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"input",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"output",boardPos:n,viewPort:s})};t.calcTargetPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"output",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"input",boardPos:n,viewPort:s})}},30994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPinDomId=t.getMainInstanceIndicatorDomId=t.getInstanceDomId=void 0;const o=n(74762);t.getInstanceDomId=(e,t)=>`ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getMainInstanceIndicatorDomId=(e,t)=>`main-ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getPinDomId=e=>{let{pinType:t,fullInsIdPath:n,pinId:o,isMain:i}=e;return`${i?"main-":""}pin:${t}:${n}:${o}`.replace(/\s+/g,"-")}},86553:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceView=t.getVisibleOutputs=t.getVisibleInputs=t.INSTANCE_INFO_TOOLTIP_DELAY=t.MAX_INSTANCE_WIDTH=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=n(66074),d=n(74762),p=r(n(26372)),f=n(2036),m=n(74762),v=n(74762),h=n(53159),g=n(83234),I=n(74762),y=n(30994),b=n(63521),C=n(74089),_=n(50382),x=r(n(99581)),N=n(88593),w=n(30653);t.PIECE_HORIZONTAL_PADDING=25,t.PIECE_CHAR_WIDTH=11,t.MIN_WIDTH_PER_PIN=40,t.MAX_INSTANCE_WIDTH=400,t.INSTANCE_INFO_TOOLTIP_DELAY=400;t.getVisibleInputs=(e,t,n)=>{const{visibleInputs:o}=e;if(o)return o;const i=(0,d.keys)((0,v.getNodeInputs)(t)).filter(((o,i)=>{var s;const r=n.some((t=>t.to.insId===e.id&&t.to.pinId===o)),a=t.inputs[o]&&"optional"===(null===(s=t.inputs[o])||void 0===s?void 0:s.mode);return r||!a&&o!==m.TRIGGER_PIN_ID}));return 0===i.length?[m.TRIGGER_PIN_ID]:i};t.getVisibleOutputs=(e,t,n)=>{const{visibleOutputs:o}=e;if(o)return o;const i=Object.keys(t.outputs);return n.some((t=>t.from.insId===e.id&&t.from.pinId===m.ERROR_PIN_ID))?[...i,m.ERROR_PIN_ID]:i};t.InstanceView=function(e){const{selected:n,selectedInput:o,selectedOutput:i,closestPin:s,dragged:r,onTogglePinLog:j,onTogglePinBreakpoint:O,onDetachConstValue:P,onCopyConstValue:E,onPasteConstValue:D,displayMode:S,connections:M,instance:T,viewPort:k,node:R,onPinClick:V,onPinDblClick:A,onDragStart:$,onDragEnd:z,onDragMove:H,onToggleSticky:G,onSelect:L,onDblClick:F,onChangeVisibleInputs:B,onChangeVisibleOutputs:q,onConvertConstToEnv:U,inlineGroupProps:W,onUngroup:Z,onExtractInlineNode:J,onGroupSelected:Y,isConnectedInstanceSelected:K,inlineEditorPortalDomNode:Q,onChangeStyle:X,onDeleteInstance:ee,onSetDisplayName:te,onPinMouseUp:ne,onPinMouseDown:oe}=e,ie=(0,w.useDarkMode)(),{id:se}=T,re=l.useMemo((()=>{const e=(0,d.randomInt)(6,1);return{icon:(0,d.pickRandom)([["fab","discord"],["fab","slack"],"bug","cube"]),color:e,size:(0,d.randomInt)(3,1),variation:(0,d.randomInt)(5,1)}}),[]),ae=l.useRef(),ue=l.useMemo((()=>T.style||R.defaultStyle||{}),[R,T]),le=ue.size||"regular",ce=l.useMemo((()=>new Map(M.filter((e=>{let{to:t}=e;return t.insId===se})).map((e=>{let{to:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),de=l.useMemo((()=>new Map(M.filter((e=>{let{from:t}=e;return t.insId===se})).map((e=>{let{from:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),pe=(0,C.usePrompt)(),fe=l.useCallback((e=>V(T,e,"input")),[T,V]),me=l.useCallback(((e,t)=>A(T,e,"input",t)),[T,A]),ve=l.useCallback(((e,t)=>A(T,e,"output",t)),[T,A]),he=l.useCallback((e=>V(T,e,"output")),[T,V]),ge=l.useCallback(((e,t)=>{$(T,e,t)}),[T,$]),Ie=l.useCallback(((e,t)=>{const n=T.pos,o=(t.x-n.x)/k.zoom,i=(t.y-n.y)/k.zoom,s=n.x+o,r=n.y+i;z(T,e,{...t,x:s,y:r})}),[T,z,k.zoom]),ye=l.useCallback(((e,t)=>{H(T,e,{x:t.x,y:t.y})}),[T,H]),be=l.useCallback((e=>G(T,e)),[T,G]),Ce=l.useCallback((e=>P(T,e)),[T,P]),_e=l.useCallback((e=>E(T,e)),[T,E]),xe=l.useCallback((e=>D(T,e)),[T,D]),Ne=l.useCallback((e=>L(T,e)),[T,L]),we=l.useCallback((e=>F(T,e.shiftKey)),[T,F]),je=(0,d.entries)(R.inputs),{visibleInputs:Oe,visibleOutputs:Pe}=T;Oe&&je.sort(((e,t)=>Oe.indexOf(e[0])-Oe.indexOf(t[0])));const Ee=(0,d.entries)(R.outputs);Pe&&Ee.sort(((e,t)=>Pe.indexOf(e[0])-Pe.indexOf(t[0])));const De=(0,t.getVisibleInputs)(T,R,M),Se=(0,t.getVisibleOutputs)(T,R,M);je.push([m.TRIGGER_PIN_ID,{...(0,d.nodeInput)(),description:"Use this pin to manually trigger the node. If not connected, the node will be triggered automatically when all required inputs have data."}]),Ee.push([m.ERROR_PIN_ID,{...(0,m.nodeOutput)(),description:"Use this pin to catch errors that happen inside this node. If not connected, errors will bubble up to the parent node."}]);const Me=je.filter((e=>{let[t]=e;return De.includes(t)||(n||K)&&ce.has(t)})),Te=Ee.filter((t=>{let[o]=t;return Se.includes(o)||(n||K)&&de.has(o)||o===m.ERROR_PIN_ID&&e.hadError})),ke=M.some((e=>e.from.insId===se&&e.from.pinId===m.ERROR_PIN_ID)),Re=(0,p.default)("ins-view",{"no-inputs":0===je.length,"no-outputs":0===Ee.length,"display-mode":S,"force-minimized-input":"input"===e.forceShowMinimized||"both"===e.forceShowMinimized,"force-minimized-output":"output"===e.forceShowMinimized||"both"===e.forceShowMinimized,"inline-node-edited":!!W,"error-caught":ke}),Ve=(0,p.default)({selected:n,dragged:r,closest:s&&s.ins.id===T.id},`size-${le}`),Ae=new Set((0,d.entries)(R.inputs).filter((e=>{let[t,n]=e;return(0,m.isInputPinOptional)(n)})).map(d.pickFirst)),$e=(0,d.entries)(T.inputConfig).reduce(((e,t)=>{let[n,o]=t;return(0,m.isStickyInputPinConfig)(o)||o.sticky?{...e,[n]:!0}:e}),{}),ze=(0,h.calcNodeContent)(T,R),He=e=>{const t=T.inputConfig[e];if((0,I.isStaticInputPinConfig)(t))return t.value},Ge=l.useCallback((async()=>{const e=(0,d.okeys)(R.inputs),t=await pe("New order?",(T.visibleInputs||e).join(","));t&&B(T,t.split(","))}),[R.inputs,pe,T,B]),Le=l.useCallback((async()=>{const e=(0,d.okeys)(R.outputs),t=await pe("New order?",(T.visibleOutputs||e).join(","));t&&q(T,t.split(","))}),[R.outputs,pe,T,q]),Fe=l.useCallback((()=>{ee(T)}),[ee,T]),Be=l.useCallback((async()=>{const e=await pe("Set custom display name",T.displayName||R.id);te(T,e)}),[pe,T,te,R.id]),qe=Object.keys((0,v.getNodeInputs)(R)),Ue=Object.keys((0,d.getNodeOutputs)(R)),We=l.useCallback((e=>{U&&U(T,e)}),[T,U]),Ze=l.useCallback(((e,t)=>{ne&&ne(T,e,t)}),[T,ne]),Je=l.useCallback(((e,t)=>{oe&&oe(T,e,t)}),[T,oe]),Ye=()=>(0,u.jsx)("div",{className:"inputs no-drag",children:Me.map((t=>{let[i,r]=t;var a;return(0,u.jsx)(f.PinView,{type:"input",currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,id:i,optional:Ae.has(i),connected:ce.has(i),isSticky:$e[i],minimized:!n&&1===Me.length,onToggleSticky:be,onDetachConstValue:Ce,onCopyConstValue:_e,onPasteConstValue:xe,copiedConstValue:e.copiedConstValue,selected:i===o,onClick:fe,onDoubleClick:me,isClosestToMouse:!!s&&"input"===s.type&&s.pin===i,onToggleLogged:j,onToggleBreakpoint:O,onInspect:e.onInspectPin,constValue:He(i),onConvertConstToEnv:e.onConvertConstToEnv?We:void 0,description:r.description,queuedValues:null!==(a=e.queuedInputsData[i])&&void 0!==a?a:0,onMouseUp:Ze,onMouseDown:Je},i)}))}),Ke=()=>(0,u.jsx)("div",{className:"outputs no-drag",children:Te.map((t=>{let[o,r]=t;return(0,u.jsx)(f.PinView,{currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,connected:de.has(o),type:"output",id:o,minimized:!n&&1===Te.length,isClosestToMouse:!!s&&"output"===s.type&&s.pin===o,selected:o===i,onClick:he,onDoubleClick:ve,onToggleLogged:j,onToggleBreakpoint:O,onInspect:e.onInspectPin,description:r.description,onMouseUp:Ze,onMouseDown:Je},o)}))}),Qe=l.useCallback((e=>{X(T,e)}),[T,X]),Xe=l.useCallback((()=>{const e=[...qe.map((e=>{const t=De.includes(e),n=ce.has(e)&&!0!==ce.get(e),o=(0,d.getInputName)(e);return{text:t?n?`Hide input "${o}" (disconnect first)`:`Hide input "${o}"`:`Show input "${o}"`,onClick:()=>B(T,t?De.filter((t=>t!==e)):[...De,e]),disabled:n&&t}})),...Ue.map((e=>{const t=Se.includes(e),n=de.has(e),o=(0,d.getOutputName)(e);return{text:t?n?`Hide output "${o}" (disconnect first)`:`Hide output "${o}"`:`Show output "${o}"`,onClick:()=>q(T,t?Se.filter((t=>t!==e)):[...Se,e]),disabled:n&&t}})),...(0,d.isInlineNodeInstance)(T)&&(0,v.isVisualNode)(T.node)?[{text:"Ungroup inline node",onClick:()=>Z(T)}]:[],...(0,d.isInlineNodeInstance)(T)?[{text:"Extract inline node to file",onClick:()=>J(T)}]:[],{text:"Reorder inputs",onClick:Ge},{text:"Reorder outputs",onClick:Le},{text:"Set display name",onClick:Be},{text:"Group selected instances",onClick:Y},{text:"Delete instance",intent:"danger",onClick:Fe}];return(0,u.jsxs)(_.Menu,{children:[(0,u.jsx)(_.MenuItem,{text:"Style",children:(0,u.jsx)(N.NodeStyleMenu,{style:ue,onChange:Qe,promptFn:pe})}),e.map(((e,t)=>(0,a.createElement)(_.MenuItem,{...e,key:t})))]})}),[qe,Ue,T,Ge,Le,Be,Fe,ue,Qe,pe,De,ce,B,Se,de,q,Z,J,Y]),et={"--node-color":ue.color,...ue.cssOverride||{}},tt=(0,y.getInstanceDomId)(T.id,e.ancestorsInsIds);return(0,u.jsx)("div",{className:Re,children:(0,u.jsx)(g.BaseNodeView,{pos:T.pos,viewPort:k,onDragStart:ge,onDragMove:ye,onDragEnd:Ie,upperRenderer:Ye,bottomRenderer:Ke,displayMode:S,domId:tt,children:(0,u.jsxs)(l.Fragment,{children:[Ye(),W?x.default.createPortal((0,u.jsxs)("div",{className:"inline-group-editor-container no-drag",children:[(0,u.jsxs)("header",{children:[ze," ",(0,u.jsx)("button",{onClick:e.onCloseInlineEditor,children:"close"})]}),(0,u.jsx)(b.VisualNodeEditor,{...e.inlineGroupProps,className:"no-drag",ref:ae})]}),Q):(0,u.jsx)(_.ContextMenu,{className:(0,p.default)("ins-view-inner",Ve,`size-${re.size}`,{dark:ie}),onClick:Ne,onDoubleClick:we,content:Xe(),style:et,children:(0,u.jsx)(_.Tooltip,{content:R.description,children:(0,u.jsxs)(l.Fragment,{children:[ue.icon?(0,u.jsx)(c.FontAwesomeIcon,{icon:ue.icon}):null," ",ze]})})}),Ke()]})})})}},53568:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStyleMenu=t.nodeStylePresetColors=void 0;const r=n(35250),a=n(50382),u=s(n(70079)),l=n(84472);t.nodeStylePresetColors=[{name:"Amethyst",color:"#9b5de5"},{name:"Magenta",color:"#f15bb5"},{name:"Yellow",color:"#fee440"},{name:"Capri",color:"#00bbf9"},{name:"Sea Green",color:"#00f5d4"},{name:"Orange",color:"#ff7f00"}];const c={size:"regular"};t.NodeStyleMenu=e=>{var n;const{onChange:o,style:i}=e,s=i||c,d=e.promptFn,p=u.default.useCallback(((e,t)=>{o({...s,[e]:t})}),[s,o]),f=u.default.useCallback((async()=>{const e=await d("Icon name? (Font Awesome conventions)","rocket"),t=e.includes(",")?e.split(","):e;p("icon",t)}),[d,p]),m=(0,u.useCallback)((async()=>{const e=await d("Enter a custom style (valid JSON representing a React CSS object)",s.cssOverride?JSON.stringify(s.cssOverride):"");try{const t=JSON.parse(e);p("cssOverride",t)}catch(t){console.error(t),(0,l.toastMsg)("Invalid object","danger")}}),[d,p,s.cssOverride]);return(0,r.jsxs)(u.default.Fragment,{children:[(0,r.jsxs)(a.MenuItem,{text:"Color",children:[t.nodeStylePresetColors.map((e=>(0,r.jsx)(a.MenuItem,{text:e.name,onClick:()=>p("color",e.color)},e.name))),(0,r.jsx)(a.MenuDivider,{}),(0,r.jsx)(a.MenuItem,{text:"Remove Color",onClick:()=>p("color",void 0)})]}),(0,r.jsxs)(a.MenuItem,{text:`Size (${null!==(n=s.size)&&void 0!==n?n:"regular"})`,children:[(0,r.jsx)(a.MenuItem,{text:"Small",onClick:()=>p("size","small")}),(0,r.jsx)(a.MenuItem,{text:"Regular",onClick:()=>p("size","regular")}),(0,r.jsx)(a.MenuItem,{text:"Large",onClick:()=>p("size","large")})]}),(0,r.jsxs)(a.MenuItem,{text:"Icon",children:[(0,r.jsx)(a.MenuItem,{text:"Choose Icon",onClick:f}),(0,r.jsx)(a.MenuItem,{text:"Remove Icon",onClick:()=>p("icon",void 0)})]}),(0,r.jsx)(a.MenuItem,{text:"Custom Styling",onClick:m})]})}},88593:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(53568),t)},83651:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86553),t)},53159:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calcInstancePosition=t.calcNodeWidth=t.calcNodeContent=void 0;const i=n(74762),s=o(n(6576)),r=n(86553),a=n(61888),u=n(30994);t.calcNodeContent=(e,t)=>{if(e.displayName)return e.displayName;if(t.customViewCode)try{const n=Object.entries(e.inputConfig).filter((e=>{let[,t]=e;return(0,i.isStaticInputPinConfig)(t)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o.value}}),{});return s.default.compile(t.customViewCode)({inputs:n}).trim()}catch(n){return console.error("Error with custom view",n),`Error in custom view [${t.id}]`}return t.id};t.calcNodeWidth=(e,n)=>{const o=(0,i.okeys)(n.inputs).length*r.MIN_WIDTH_PER_PIN,s=(0,t.calcNodeContent)(e,n),u=r.PIECE_CHAR_WIDTH;return(0,a.clamp)(s.length*u+2*r.PIECE_HORIZONTAL_PADDING,o,r.MAX_INSTANCE_WIDTH)};t.calcInstancePosition=(e,t,n)=>{const o=(0,u.getInstanceDomId)(e,t),i=document.getElementById(o);if(i){const{x:e,y:t,width:o,height:s}=i.getBoundingClientRect(),r=t+s/2;return{x:e+o/2-n.x,y:r-n.y}}return console.warn("Cannot find element to draw connection to",o),{x:99999,y:99999}}},17841:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutDebugger=t.LayoutDebuggerItem=t.PosDebugger=void 0;const i=n(70079),s=n(35250),r=n(74762),a=o(n(70079)),u=n(7047),l=e=>{let{pos:t}=e;return(0,s.jsxs)("span",{children:[t.x.toFixed(1),", ",t.y.toFixed(1)]})};t.PosDebugger=e=>(0,s.jsx)("span",{className:"pos-debugger",children:(0,s.jsx)(l,{pos:e.pos})});t.LayoutDebuggerItem=e=>{const{pos:n,viewPort:o,size:i,color:r}=e,a=o.zoom,u=n.x*a-o.pos.x*a,l=n.y*a-o.pos.y*a,c={transform:`translate(${u-n.x}px, ${l-n.y}px)`},d={transform:`scale(${o.zoom})`},p={transform:`translate(${n.x}px, ${n.y}px)`},f={width:`${i.width}px`,height:`${i.height}px`,backgroundColor:r};return(0,s.jsx)("div",{className:"layout-debugger",style:c,children:(0,s.jsxs)("span",{className:"drag-sim",style:p,children:[(0,s.jsx)(t.PosDebugger,{pos:n}),(0,s.jsx)("div",{className:"layout-debugger-zoom-wrapper",style:d,children:(0,s.jsx)("div",{className:"layout-debugger-inner",style:f})})]})})};const c=(()=>{try{return"true"===localStorage.getItem("pos-debugger")}catch(e){return!1}})();t.LayoutDebugger=e=>{const{extraDebug:n,vp:o,node:d,mousePos:p}=e;if(!c)return null;const f=n.map(((e,n)=>(0,i.createElement)(t.LayoutDebuggerItem,{...e,key:n}))),m=[...d.instances.map((e=>e.pos)),...(0,r.values)(d.inputsPosition),...(0,r.values)(d.outputsPosition)].map((e=>(0,s.jsx)(t.LayoutDebuggerItem,{pos:e,viewPort:o,size:{width:0,height:0},color:"red"}))),v=(0,u.logicalPosToRenderedPos)(p,o),h=(0,s.jsxs)("div",{className:"viewport-data",children:[(0,s.jsxs)("div",{children:["Pos: ",(0,s.jsx)(l,{pos:o.pos})]}),(0,s.jsxs)("div",{children:["Zoom: ",o.zoom.toFixed(2)," "]}),(0,s.jsxs)("div",{children:["Mouse (logical): ",(0,s.jsx)(l,{pos:p})]}),(0,s.jsxs)("div",{children:["Rendered (rendered): ",(0,s.jsx)(l,{pos:v})]})]});return(0,s.jsxs)(a.default.Fragment,{children:[h,f,m]})}},44338:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(17841),t)},38259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateInstancesWithSingleConstPinsMap=t.getLeafInstancesOfSelection=void 0;t.getLeafInstancesOfSelection=(e,t,n)=>e.reduce(((e,o)=>[...e,...n.filter((e=>e.to.insId===o.id)).map((e=>t.find((t=>t.id===e.from.insId)))).filter((e=>!!e))]),[]).filter((t=>1===n.filter((e=>e.from.insId===t.id||e.to.insId===t.id)).length&&!e.includes(t)));t.calculateInstancesWithSingleConstPinsMap=(e,t)=>{const{connections:n}=e;return n.filter((e=>t.has(e.from.insId))).reduce(((e,n)=>{const o=t.get(n.from.insId),i=n.to.insId,s=e.get(i)||new Map;return s.set(n.to.pinId,{val:o,insId:n.from.insId}),e.set(i,s),e}),new Map)}},37488:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeIoView=void 0;const a=n(35250),u=n(70079),l=s(n(70079)),c=n(74762),d=n(83234),p=r(n(26372)),f=n(50382),m=n(43490),v=n(66189),h=n(74762),g=n(30994),I=n(30653);t.NodeIoView=l.memo((function(e){const{viewPort:t,selected:n,pos:o,type:i,id:s,onDblClick:r,onRename:y,onDelete:b,onChangeInputMode:C,inputMode:_,onSelect:x,closest:N,onSetDescription:w,description:j,onMouseUp:O,onMouseDown:P,currentInsId:E}=e,{history:D,resetHistory:S,refreshHistory:M}=(0,v.useHistoryHelpers)(E,s,i),T=(0,m.usePrompt)(),k=l.useCallback((async()=>{const e=await T("Description?",j);w(i,s,e)}),[T,j,w,i,s]),R=l.useCallback((()=>{b&&b(i,s)}),[i,s,b]),V=l.useCallback((()=>{y&&y(i,s)}),[i,s,y]),A=l.useCallback((e=>{C&&C(s,e)}),[s,C]),$=l.useCallback((()=>[{text:`Current mode - ${_}`,onClick:c.noop},{text:"Make required",onClick:()=>A("required")},{text:"Make optional",onClick:()=>A("optional")},{text:"Make required-if-connected",onClick:()=>A("required-if-connected")},{text:"Set description",onClick:k},...e.onRename?[{text:"Rename",onClick:V}]:[],...e.onDelete?[{text:"Delete",onClick:R}]:[]]),[k,_,A,R,V,e.onDelete,e.onRename]),z=l.useCallback((t=>{r&&r(e.id,t)}),[r,e.id]),H=l.useCallback((()=>{x(s,i)}),[s,i,x]),G=l.useCallback((()=>(0,a.jsx)(f.Menu,{children:$().map(((e,t)=>(0,u.createElement)(f.MenuItem,{...e,key:t})))})),[$]),L="input"===i?(0,h.getInputName)(s):(0,c.getOutputName)(s),F=l.useCallback((e=>{O(s,i,e)}),[s,O,i]),B=l.useCallback((e=>{P(s,i,e)}),[s,P,i]),q=(0,I.useDarkMode)();return(0,a.jsx)(d.BaseNodeView,{className:(0,p.default)("node-io-view",i,{dark:q}),pos:o,onDragEnd:(n,o)=>{const r=e.pos,a=(o.x-r.x)/t.zoom,u=(o.y-r.y)/t.zoom,l=r.x+a,c=r.y+u;e.onDragEnd(i,s,n,{...o,x:l,y:c})},onDragStart:(t,n)=>{e.onDragStart(s,t,n)},onDragMove:(t,n)=>{e.onDragMove(i,s,t,{x:n.x,y:n.y})},viewPort:t,children:(0,a.jsx)(l.Fragment,{children:(0,a.jsx)(f.Tooltip,{content:(()=>{const t=(0,v.calcHistoryContent)(D),n=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:L})," (",i,")"," "]}),n,(0,a.jsx)("hr",{}),t]})})(),children:(0,a.jsx)(f.ContextMenu,{onMouseEnter:M,onMouseOut:S,onMouseUp:F,onMouseDown:B,"data-tip":"","data-html":!0,"data-for":s+e.currentInsId,className:(0,p.default)("node-io-view-inner",{closest:N,selected:n,dark:q}),id:(0,g.getPinDomId)({fullInsIdPath:(0,c.fullInsIdPath)(e.currentInsId,e.ancestorInsIds),pinId:s,pinType:i,isMain:!0}),onClick:H,onDoubleClick:z,content:G(),children:s})})})})}))},66005:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37488),t)},83782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcNodeIoWidth=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0,t.PIECE_HORIZONTAL_PADDING=15,t.PIECE_CHAR_WIDTH=9,t.MIN_WIDTH_PER_PIN=40;t.calcNodeIoWidth=e=>Math.max(t.MIN_WIDTH_PER_PIN,e.length*t.PIECE_CHAR_WIDTH+2*t.PIECE_HORIZONTAL_PADDING)},99942:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderVisualNode=t.layoutToInstances=void 0;const i=n(63521),s=n(74762),r=n(90794),a=o(n(53865)),u=n(83782),l=n(60190),c=n(53159),d=n(41032);t.layoutToInstances=(e,t)=>(0,a.default)(t,(t=>{(0,s.entries)(e.nodes).forEach((e=>{let[n,o]=e;if(n.startsWith("ins-")){const e=n.replace("ins-",""),i=t.instances.find((t=>t.id===e));i?i.pos=o.p:console.warn("WAT")}if(n.startsWith("node-input-")){const e=n.replace("node-input-","");t.inputsPosition[e]=o.p}if(n.startsWith("node-output-")){const e=n.replace("node-output-","");t.outputsPosition[e]=o.p}}))}));t.orderVisualNode=(e,n,o,a)=>{const{instances:p,connections:f}=e,m={...p.reduce(((e,t)=>{const o=(0,l.size)((0,c.calcNodeWidth)(t,(0,d.safelyGetNodeDef)(t,n)),i.NODE_HEIGHT);return{...e,[`ins-${t.id}`]:{p:t.pos,s:o}}}),{}),...(0,s.okeys)(e.inputsPosition).reduce(((t,n)=>({...t,[`node-input-${n}`]:{p:e.inputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{}),...(0,s.okeys)(e.outputsPosition).reduce(((t,n)=>({...t,[`node-output-${n}`]:{p:e.outputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{})},v=f.map((e=>[(0,s.isExternalConnectionNode)(e.from)?`node-input-${e.from.pinId}`:`ins-${e.from.insId}`,(0,s.isExternalConnectionNode)(e.to)?`node-output-${e.to.pinId}`:`ins-${e.to.insId}`])),h=(0,r.orderLayout)({nodes:m,edges:v},o,((n,o)=>{a&&a((0,t.layoutToInstances)(n,e),o)}));return(0,t.layoutToInstances)(h,e)}},90794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderLayout=void 0;const o=n(60190),i=400,s=e=>e.reduce(((e,t)=>{const n=(0,o.vSub)(t.p,(0,o.vec)(t.s.width/2,t.s.height/2));return{...e,[t.id]:{p:n,s:t.s}}}),{});t.orderLayout=(e,t,n)=>{let{nodes:r,edges:a}=e,u=Object.entries(r).map((e=>{let[t,n]=e;return{id:t,p:(0,o.vAdd)(n.p,(0,o.vec)(n.s.width/2,n.s.height/2)),f:(0,o.vec)(0,0),v:(0,o.vec)(0,0),m:1,s:n.s}})),l=0;for(;l.01);){let e=u;for(let t=0;t{let n=e.find((e=>e.id===t[0])),i=e.find((e=>e.id===t[1]));if(!n||!i)return void console.warn("weoops",t[0],t[1]);const s=(0,o.vec)(0,-200),r=(0,o.vSub)(n.p,i.p),a=(0,o.vSub)(s,r),u=1e3*(0,o.vLen)(a),l=(0,o.vMul)((0,o.vNorm)(a),.5*u),c=(0,o.vMul)((0,o.vNorm)(a),-.5*u);n.f=(0,o.vAdd)(n.f,l),i.f=(0,o.vAdd)(i.f,c)})),e=e.map((e=>(0,o.itrPhysics)(15,e))),e=e.map((e=>{const t=(0,o.vMul)(e.v,.5),n=(0,o.vLen)(t)>100?(0,o.vMul)((0,o.vNorm)(t),100):t;return{...e,v:n}})),u=e,n&&n({nodes:s(e),edges:a},l),l++}return{nodes:s(u),edges:a,itrs:l,timeout:l>=t,total:(0,o.totalEnergy)(u)}}},2036:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PinView=t.PIN_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=n(50382),d=n(18420),p=n(74762),f=n(30994),m=n(96233),v=n(66189),h=n(30653);t.PIN_HEIGHT=23;t.PinView=u.memo((function(e){const{selected:t,type:n,connected:o,optional:i,currentInsId:s,isClosestToMouse:r,id:g,onMouseDown:I,onMouseUp:y}=e,{history:b,resetHistory:C,refreshHistory:_}=(0,v.useHistoryHelpers)(s,g,n),x=(0,h.useDarkMode)(),N="input"===n?(0,p.getInputName)(g):(0,p.getOutputName)(g),w="input"===e.type&&(0,d.isDefined)(e.constValue)?e.constValue:void 0,j=u.useCallback((e=>{0===e.button&&I(g,n,e)}),[g,n,I]),O=u.useCallback((e=>{0===e.button&&y(g,n,e)}),[g,n,y]);return(0,a.jsxs)("div",{className:(()=>{if("input"===e.type){const{isSticky:s,constValue:a}=e;return(0,l.default)("pin",{sticky:s,selected:t,closest:r,optional:i,connected:o,"const-value":(0,d.isDefined)(a),"env-value":(0,d.isDefined)(a)&&(0,p.isEnvValue)(a),minimized:e.minimized,dark:x},n)}return(0,l.default)("pin",{selected:t,connected:o,closest:r,optional:i,minimized:e.minimized,"error-pin":g===p.ERROR_PIN_ID,dark:x},n)})(),"data-pin-id":g,children:[(0,a.jsx)(c.Tooltip,{className:"pin-info-tooltip",content:(()=>{const t=(0,v.calcHistoryContent)(b,"input"===n?e.queuedValues:void 0),o=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:N})," (",n,")"," "]}),o,(0,a.jsx)("hr",{}),(0,d.isDefined)(w)?(0,a.jsxs)("div",{children:["Static value:"," ",(0,a.jsx)("strong",{children:(0,m.valuePreview)(w).substring(0,200)})]}):t]})})(),children:(0,a.jsxs)(c.ContextMenu,{onMouseEnter:_,onMouseOut:C,onMouseDown:j,onMouseUp:O,"data-tip":"","data-html":!0,"data-for":g+e.currentInsId,id:(0,f.getPinDomId)({fullInsIdPath:(0,p.fullInsIdPath)(e.currentInsId,e.ancestorsInsIds),pinId:g,pinType:n,isMain:!1}),onDoubleClick:t=>e.onDoubleClick&&e.onDoubleClick(g,t),className:(0,l.default)("pin-inner",{dark:x}),onClick:t=>{const{onShiftClick:o,onClick:i,id:s}=e;t.shiftKey&&o?o(s,t):i(s,n,t)},content:(()=>{const t=(0,a.jsx)(c.MenuItem,{onClick:()=>e.onInspect(e.currentInsId,{id:e.id,type:e.type}),text:"Inspect"});if("input"===e.type){const{onConvertConstToEnv:n}=e;return(0,d.isDefined)(w)?(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onDetachConstValue(e.id),text:"Detach value"}),(0,a.jsx)(c.MenuItem,{onClick:()=>e.onCopyConstValue(e.id),text:"Copy value"}),(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null,n?(0,a.jsx)(c.MenuItem,{onClick:()=>n(e.id),text:"Convert to Env Var"}):null]}):(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onToggleSticky(e.id),text:"Toggle sticky (square means sticky)"}),t,(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null]})}return(0,a.jsx)(c.Menu,{children:t})})(),children:[N," ",(0,d.isDefined)(w)?(0,a.jsxs)(u.Fragment,{children:[":",(0,a.jsx)("span",{className:"value",children:(0,d.toString)(w)})]}):null,"input"===e.type&&e.isSticky?(0,a.jsx)("span",{className:"suffix",children:"s"}):null,"input"===e.type&&e.queueSize?(0,a.jsxs)("span",{className:"suffix",children:[e.queueSize," in Q"]}):null]})}),(0,a.jsx)("div",{className:"wire"})]})}))},66189:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHistoryHelpers=t.calcHistoryContent=void 0;const i=n(35250),s=n(96233),r=o(n(70079)),a=n(70079),u=n(98158);t.calcHistoryContent=(e,t)=>{if(e){const{total:n,lastSamples:o}=e,a=(0,i.jsxs)("strong",{children:["Activated ",n," times this session"]}),u=o.length>0?(0,i.jsxs)("div",{children:["Last value:"," ",(0,i.jsx)("strong",{children:(0,s.valuePreview)(o[0].val).substring(0,200)}),(0,i.jsx)("br",{}),(0,i.jsx)("em",{children:"Inspect instance for the full value"})]}):"",l=t?(0,i.jsx)(r.default.Fragment,{children:(0,i.jsxs)("div",{children:["Queued values: ",(0,i.jsx)("strong",{children:t})]})}):"";return(0,i.jsxs)(r.default.Fragment,{children:[a,u,l]})}return"Loading session data.."};t.useHistoryHelpers=(e,t,n)=>{const o=(0,a.useRef)(),{onRequestHistory:i}=(0,u.useDebuggerContext)(),[s,l]=(0,a.useState)();return{history:s,refreshHistory:(0,a.useCallback)((()=>{clearInterval(o.current),i(e,t,n).then((e=>{l(e)})),o.current=setInterval((()=>{i(e,t,n).then((e=>{l(e)}))}),500)}),[e,i,t,n]),resetHistory:r.default.useCallback((()=>{clearInterval(o.current),l(void 0)}),[])}}},89440:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAddMenu=void 0;const r=n(35250),a=s(n(70079)),u=n(74762),l=n(50382),c=n(70457),d=n(9958),p=n(86125),f=c.Select.ofType(),m=e=>{switch(e.type){case"node":return`${e.node.id}`;case"value":return"Add inline value or function";case"import":return`Import ${e.importableNode.node.id} from ${e.importableNode.module}`}},v=(e,t)=>{let{handleClick:n,modifiers:o,query:i}=t;if(!o.matchesPredicate)return null;const s=m(e);return"value"===e.type?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(l.MenuDivider,{}),(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))]}):(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))},h=(e,t,n,o)=>{const i=m(t).toLocaleLowerCase(),s=e.toLowerCase();return o?i===s:i.includes(s)};t.QuickAddMenu=e=>{const{resolvedDependencies:t,targetNode:n}=e,o={left:e.pos.x,top:e.pos.y},{onRequestImportables:i}=(0,p.useDependenciesContext)(),[s,c]=a.useState();a.useEffect((()=>{i().then((e=>c(e.importables)))}),[i]);const d=(0,u.values)({...t,[n.id]:n}),m=d.map((e=>({type:"node",node:e}))),g=new Set(d.map((e=>e.id))),I=s?s.filter((e=>!g.has(e.node.id))).map((e=>({type:"import",importableNode:e}))):[],y=m.concat(I).concat({type:"value"});return(0,r.jsx)("div",{className:"quick-add-menu",style:o,children:(0,r.jsx)(f,{className:"quick-add-nodes-select",items:y,itemPredicate:h,itemRenderer:v,inputProps:{className:"quick-add-input"},noResults:(0,r.jsx)(l.MenuItem,{disabled:!0,text:"No results."}),onItemSelect:t=>e.onAdd(t),popoverProps:{isOpen:!0,onClose:()=>e.onClose()}})})}},71033:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89440),t)},73470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimePlayer=void 0;const o=n(74762),i=n(64955),s=(0,o.debugLogger)("runtime-player");t.createRuntimePlayer=()=>{let e=0,t=[];let n=!1,r=Date.now(),a=e;const u=()=>requestAnimationFrame((()=>{const l=Date.now();a=e,e+=l-r,r=l,((e,n)=>{const r=t;t=[],r.length&&s(`Playing ${r.length} events from`,e,n),r.forEach((e=>{s("Playing event",e),(0,i.playEvent)(e),e.insId===o.ROOT_INS_ID&&e.type===o.DebuggerEventType.PROCESSING_CHANGE&&!1===e.val&&(s("Main instance is done processing, clearing runtime UI",e),c())}))})(a,e),n&&u()})),l=()=>{n=!1},c=()=>{document.querySelectorAll("[data-runtime]").forEach((e=>{e.removeAttribute("data-runtime")})),document.querySelectorAll("[data-runtime-queue]").forEach((e=>{e.removeAttribute("data-runtime-queue")})),t=[]};return{stop:l,start:function(t){void 0===t&&(t=0),n=!0,e=t,r=Date.now(),u()},addEvents:e=>{t.push(...e)},destroy:()=>{l(),c()},clear:c,status:()=>({running:n,currDt:e,lastDt:a,queue:t,last:r})}}},64955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playEvent=t.cancelTimers=void 0;const o=n(74762),i=n(30994),s=5e3,r=(0,o.debugLogger)("runtime-player:play-event"),a=(e,t)=>e.type===o.DebuggerEventType.INPUT_CHANGE||e.type===o.DebuggerEventType.OUTPUT_CHANGE?`${(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds)}.${e.pinId}`:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds);t.cancelTimers=new Map;t.playEvent=e=>{switch(e.type){case o.DebuggerEventType.INPUT_CHANGE:case o.DebuggerEventType.OUTPUT_CHANGE:{const{pinId:n,insId:u,ancestorsInsIds:l}=e,c=e.type===o.DebuggerEventType.INPUT_CHANGE?"input":"output",d=[(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!0})];u!==o.ROOT_INS_ID&&d.push((0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!1})),d.forEach(((i,l)=>{const c=a(e);clearTimeout(t.cancelTimers.get(c));const d=document.getElementById(i),p=`${u}.${n}`,f=e.type===o.DebuggerEventType.OUTPUT_CHANGE?document.querySelectorAll(`[data-from-id="${p}"]`):[];if(d){clearTimeout(t.cancelTimers.get(c)),d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),setTimeout((()=>{d.setAttribute("data-runtime","active"),f.forEach((e=>{e.setAttribute("data-runtime","active")}))}),0);const n=setTimeout((()=>{d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),t.cancelTimers.delete(c)}),s);t.cancelTimers.set(a(e),n)}else console.warn(`No DOM element with Id [${i}] found to play event`),r(`No DOM element with Id [${i}] found to play event`,e)}));break}case o.DebuggerEventType.PROCESSING_CHANGE:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(l)if(!0===e.val)l.setAttribute("data-runtime","processing"),clearTimeout(t.cancelTimers.get(u));else{l.removeAttribute("data-runtime"),setTimeout((()=>{"error"!==l.getAttribute("data-runtime")&&l.setAttribute("data-runtime","done")}),0);const e=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,e)}else r(`No DOM element with Id [${n}] found to play event`,e)}));break}case o.DebuggerEventType.ERROR:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(!l)return void r(`No DOM element with Id [${n}] found to play event`,e);clearTimeout(t.cancelTimers.get(u)),l.removeAttribute("data-runtime"),setTimeout((()=>{l.setAttribute("data-runtime","error")}));const c=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,c)}));const c={...e,type:o.DebuggerEventType.OUTPUT_CHANGE,pinId:o.ERROR_PIN_ID};(0,t.playEvent)(c);break}case o.DebuggerEventType.INPUTS_STATE_CHANGE:(0,o.entries)(e.val).forEach((t=>{let[n,s]=t;const{insId:a,ancestorsInsIds:u}=e,l=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(a,u),pinId:n,pinType:"input",isMain:!1}),c=document.getElementById(l);c?s>0?c.setAttribute("data-runtime-queue",`${s}`):c.removeAttribute("data-runtime-queue"):r(`No DOM element with Id [${l}] found to play event`,e)}))}}},25804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounce=void 0;const o=n(70079);t.useDebounce=function(e,t){const[n,i]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}},7047:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.handleChangeNodeInputType=t.handleIoPinRename=t.handleInstanceDrag=t.getInstancesInRect=t.isJsxValue=t.getMiddleOfViewPort=t.fitViewPortToNode=t.centerBoardPosOnTarget=t.renderedPosToLogicalPos=t.logicalPosToRenderedPos=t.getEffectiveNodeDimensions=t.calcNodesPositions=t.calcSelectionBoxArea=t.animateViewPort=t.easeInOutNum=t.easeInOutPos=t.easeInOutQuad=t.center=t.distance=t.clamp=t.domToViewPort=t.roundNumber=t.createNewNodeInstance=t.createNewInlineNodeInstance=t.parseInputOutputTypes=t.parsePromptValue=t.getSelectionBoxRect=t.findClosestPin=t.changePinConfig=t.getInstancePinConfig=t.emptyList=t.emptyObj=void 0;const r=s(n(53865)),a=n(30721),u=n(63521),l=n(74762),c=n(18243),d=n(74762),p=n(53159),f=n(83782),m=n(60190),v=n(38259),h=n(83651),g=n(41032);t.emptyObj={},t.emptyList=[],t.getInstancePinConfig=function(e,n,o){var i;const s=e.instances.find((e=>e.id===n));if(!s)throw new Error(`Instance ${n} not found`);return null!==(i=(s.inputConfig||t.emptyObj)[o])&&void 0!==i?i:(0,l.queueInputPinConfig)()};t.changePinConfig=(e,t,n,o)=>r.produce(e,(e=>{var i;const{instances:s}=e,r=s.find((e=>e.id===t));if(!r)throw new Error("blah");const a=null!==(i=r.inputConfig)&&void 0!==i?i:{};a[n]=o,e.instances=s.map((e=>e===r?{...r,inputConfig:a}:e))}));t.findClosestPin=(e,t,n,o,i,s,r)=>{const a=(0,l.nodeInstance)(e.id,e.id),u=(0,d.okeys)(e.inputs).map((e=>({id:e,type:"input",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),p=(0,d.okeys)(e.outputs).map((e=>({id:e,type:"output",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),f=[...u,...e.instances.reduce(((n,a)=>{const u=(0,g.safelyGetNodeDef)(a,t),d=(0,h.getVisibleInputs)(a,u,e.connections),p=(0,h.getVisibleOutputs)(a,u,e.connections);return[...n,...d.map((e=>({ins:a,type:"input",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!1}),id:e}))),...p.map((e=>({ins:a,type:"output",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!1}),id:e})))]}),[]),...p];let m={dis:1e5,item:f[0]};return f.forEach((e=>{const t=e.pos.x-n.x,o=e.pos.y-n.y,i=Math.sqrt(t*t+o*o);i{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x,t.x)-n,h:Math.max(e.y,t.y)-o}};t.parsePromptValue=e=>{if(null===e)return;const t=parseInt(e,10);let n=e;return t.toString()!=e||isNaN(t)||(n=t),n};t.parseInputOutputTypes=e=>{const[,t,n]=e.match(/node\((.+)\|(.+)\)/)||[],o=(0,d.entries)(JSON.parse(t)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]})),i=(0,d.entries)(JSON.parse(n)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]}));return{inputs:(0,d.fromEntries)(o),outputs:(0,d.fromEntries)(i)}};t.createNewInlineNodeInstance=function(e,t,n){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const o=(0,l.inlineNodeInstance)(`${e.id}-${(0,d.randomInt)(999)}`,e,{},{x:0,y:0}),i=(0,p.calcNodeWidth)(o,e),{x:s,y:r}=n,a={x:s-i/2,y:r+t};return{...o,pos:a}};t.createNewNodeInstance=function(e,t,n,o){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const i="string"==typeof e?(0,g.safelyGetNodeDef)(e,o):e;if(!i)throw new Error(`${e} node not found in resolvedNodes`);const s=(0,d.entries)(i.inputs).reduce(((e,t)=>{let[n,o]=t;return o.defaultValue&&(e[n]=(0,l.staticInputPinConfig)(o.defaultValue)),e}),{}),r=(0,l.nodeInstance)((0,a.createId)(),i.id,s,{x:0,y:0}),c=(0,p.calcNodeWidth)(r,i),{x:f,y:m}=n,v={x:f-c/2,y:m+t};return{...r,pos:v}};t.roundNumber=e=>Math.round(100*e)/100;t.domToViewPort=(e,n,o)=>({x:(0,t.roundNumber)(n.pos.x+e.x/n.zoom/o.zoom),y:(0,t.roundNumber)(n.pos.y+e.y/n.zoom/o.zoom)});t.clamp=(e,t,n)=>Math.max(e,Math.min(t,n));t.distance=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)};t.center=(e,t,n)=>{let{zoom:o}=n;const i=e.x+e.w/2,s=e.y+e.h/2,{w:r,h:a}=t;return{x:i-r/o/2,y:s-a/o/2}};t.easeInOutQuad=e=>e<.5?2*e*e:(4-2*e)*e-1;t.easeInOutPos=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i),a=(0,t.easeInOutQuad)(r),u=n.x-e.x,l=n.y-e.y;return{x:e.x+u*a,y:e.y+l*a}};t.easeInOutNum=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i);return e+(n-e)*(0,t.easeInOutQuad)(r)};t.animateViewPort=(e,n,o,i)=>{const s=(0,t.distance)(e.pos,n.pos),r=Date.now(),a=o;if(0===s)return void i(e);const u=()=>{const o=Date.now(),s=(0,t.easeInOutPos)(e.pos,n.pos,r,a,o),l=(0,t.easeInOutNum)(e.zoom,n.zoom,r,a,o);o-r{const n=(0,t.getSelectionBoxRect)(e.from,e.to);return n.h*n.w};const I=(e,t,n,o)=>({left:n.x,right:n.x+e,top:n.y,bottom:n.y+t,tag:o,center:(0,l.calcCenter)({w:e,h:t,...n})});t.calcNodesPositions=(e,t)=>[...e.instances.map((e=>{const n=(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,t)),o=u.NODE_HEIGHT;return I(n,o,e.pos,e.id)})),...(0,d.okeys)(e.inputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.inputsPosition[t]||{x:0,y:0};return I(n,o,i,"input_"+t)})),...(0,d.okeys)(e.outputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.outputsPosition[t]||{x:0,y:0};return I(n,o,i,"output"+t)}))];t.getEffectiveNodeDimensions=(e,n)=>{const o=(0,t.calcNodesPositions)(e,n),i=o[0]||{left:0,right:0,top:0,bottom:0},s=o.reduce(((e,t)=>t.leftt.right>e?t.right:e),i.right),a=o.reduce(((e,t)=>t.topt.bottom>e?t.bottom:e),i.bottom)-a,d={x:s,y:a};return{size:{width:u,height:c},pos:d,center:(0,l.calcCenter)({w:u,h:c,...d})}};t.logicalPosToRenderedPos=(e,t)=>{const n=(0,m.vSub)(e,t.pos);return(0,m.vMul)(n,t.zoom)};t.renderedPosToLogicalPos=(e,t)=>{const n=(0,m.vDiv)(e,t.zoom);return(0,m.vAdd)(t.pos,n)};t.centerBoardPosOnTarget=(e,n,o,i)=>{const s=(0,t.logicalPosToRenderedPos)(e,i),r=(0,t.renderedPosToLogicalPos)(s,{...i,zoom:o}),a=Math.max(e.x,r.x)-Math.min(e.x,r.x),u=Math.max(e.y,r.y)-Math.min(e.y,r.y);return{x:o>i.zoom?i.pos.x+a:i.pos.x-a,y:o>i.zoom?i.pos.y+u:i.pos.y-u}};t.fitViewPortToNode=function(e,n,o,i){void 0===i&&(i=[20,150]);const{size:s,center:r}=(0,t.getEffectiveNodeDimensions)(e,n),a=i[0],u=i[1],l=s.width+a,c=s.height+u,d=o.width/l,p=o.height/c,f=Math.min(d,p)/1.15,m=(0,t.clamp)(.3,1.2,f);return{zoom:m,pos:{x:r.x-o.width/2/m,y:r.y-o.height/2/m+20}}};t.getMiddleOfViewPort=(e,n)=>{const o={x:n.width/2,y:n.height/2};return(0,t.renderedPosToLogicalPos)(o,e)};t.isJsxValue=e=>{const t=e=>(0,d.isDefined)(e.ref)&&(0,d.isDefined)(e.type)&&(0,d.isDefined)(e.props);try{const n=JSON.parse(e);return t(n)||Array.isArray(n)&&t(n[0])}catch(n){return!1}};t.getInstancesInRect=(e,n,o,i,s,r,a)=>{const{from:c,to:d}=e,f=(0,t.getSelectionBoxRect)(c,d);return s.filter((e=>{const{pos:t}=e,i={...t,w:(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,n))*o.zoom*a.zoom,h:u.NODE_HEIGHT*o.zoom*a.zoom};return(0,l.intersectRect)(f,i)||(0,l.intersectRect)(i,f)})).map((e=>e.id))};t.handleInstanceDrag=(e,t,n,o,i,s)=>{o.preventDefault(),o.stopPropagation();const a=(0,m.vSub)(n,t.pos);let u;const l=r.produce(e,(e=>{const r=e.instances.find((e=>e.id===t.id));if(!r)throw new Error("impossible state dragging instance that does not exist");!o.shiftKey&&s&&(u=[s]);const l=e.instances.filter((e=>i.includes(e.id)&&e!==r)),c=[r,...l],d=(0,v.getLeafInstancesOfSelection)(c,e.instances,e.connections);[...l,...d].forEach((e=>{e.pos=(0,m.vAdd)(e.pos,a)})),r.pos=n,!o.shiftKey&&s&&(u=[s])}));return{newValue:l,newSelected:u}};t.handleIoPinRename=(e,t,n,o)=>r.produce(e,(e=>{"input"===t?(e.inputs[o]=e.inputs[n],e.inputsPosition[o]=e.inputsPosition[n],delete e.inputs[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===n?{...e,from:{...e.from,pinId:o}}:e))):(e.outputs[o]=e.outputs[n],e.outputsPosition[o]=e.outputsPosition[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===n?{...e,to:{...e.to,pinId:o}}:e)),e.completionOutputs=(e.completionOutputs||[]).map((e=>e.split("+").map((e=>e===n?o:n)).join("+"))),delete e.outputs[n])}));t.handleChangeNodeInputType=(e,t,n)=>r.produce(e,(e=>{const o=e.inputs[t];if(!o)throw new Error("Wat");o.mode=n}))},42403:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorClient=void 0;const i=n(74762),s=o(n(18706)),r=n(32048),a=n(31758),u=(0,i.debugLogger)("remote-debugger:editor-client");t.createEditorClient=(e,t)=>{const n=new URL(e),o=(0,r.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/editor`,timeout:3e4});return o.emit("join-room-editor",t),{emitChange:e=>{o.emit(a.DebuggerServerEventType.CHANGE_EVENT_NAME,e)},emitBreakpointsChange:e=>{o.emit(a.DebuggerServerEventType.UPDATE_BREAKPOINTS,e)},interceptInput:e=>{o.emit(a.DebuggerServerEventType.INPUT_VALUE_OVERRIDE,e)},interceptOutput:e=>{o.emit(a.DebuggerServerEventType.OUTPUT_VALUE_OVERRIDE,e)},onRuntimeReady:e=>(o.on(a.DebuggerServerEventType.RUNTIME_READY,e),()=>o.off(a.DebuggerServerEventType.RUNTIME_READY,e)),onChangeAwk:e=>(o.on(a.DebuggerServerEventType.CHANGE_AWK,e),()=>o.off(a.DebuggerServerEventType.CHANGE_AWK,e)),onChangeError:e=>(o.on(a.DebuggerServerEventType.CHANGE_ERROR,e),()=>o.off(a.DebuggerServerEventType.CHANGE_ERROR,e)),onIsAlive:e=>(o.on(a.DebuggerServerEventType.IS_ALIVE,e),()=>o.off(a.DebuggerServerEventType.IS_ALIVE,e)),emitInputValue:(e,t)=>{u(`Emitting push input value to ${e} %o`,t),o.emit(a.DebuggerServerEventType.PUSH_INPUT_VALUE,{pinId:e,value:t})},destroy:()=>{o.disconnect(),(0,a.enumToArray)(a.DebuggerServerEventType).forEach((e=>o.off(e)))},onDisconnect:e=>(o.on("disconnect",e),()=>o.off("disconnect",e)),debugInfo:()=>`Remote debugger for ${e}`,onBatchedEvents:e=>(o.on(a.DebuggerServerEventType.EVENTS_BATCH,e),()=>o.off(a.DebuggerServerEventType.EVENTS_BATCH,e)),requestState:()=>s.default.get(`${e}/state`).then((e=>e.data.state)),getHistory:n=>s.default.get(`${e}/history`,{params:{insId:n.insId,pinId:n.pinId,limit:n.limit,executionId:t}}).then((e=>e.data)),clearHistory:()=>s.default.delete(`${e}/history`).then((()=>{})),triggerNode:(t,n)=>s.default.post(`${e}/trigger`,{nodeId:t,inputs:n}).then((e=>e.data))}}},58066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeData=void 0;const o=n(74762),i=n(36783),s=(0,o.debugLogger)("remote-debugger:normalize-data");t.normalizeData=e=>{if(e instanceof Error)return(0,i.serializeError)(e);if("object"==typeof e&&null!==e){e={...e};const t=new WeakSet,n=e=>{if("bigint"==typeof e)return e.toString();if("object"!=typeof e||Array.isArray(e))return e;if(null===e)return e;if(t.has(e))return"[Circular]";try{t.add(e)}catch(o){s("Error adding to WeakSet","data:",e,"type:",typeof e,"error:",o)}if(Array.isArray(e))return e.map(n);if("object"==typeof e){const t={};for(const o in e)t[o]=n(e[o]);return t}return e};return n(e)}return e}},39641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimeClient=t.DEFAULT_DT_SCALE=void 0;const o=n(74762),i=n(32048),s=n(31758),r=n(58066),a=(0,o.debugLogger)("remote-debugger:runtime-client");t.DEFAULT_DT_SCALE=1;t.createRuntimeClient=(e,t)=>{const n=new URL(e),u=(0,i.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/runtime`,timeout:1e3,reconnectionAttempts:3});u.emit("join-room-runtime",t),u.on("connection",(e=>{e.join(t)}));let l=new Set;u.on(s.DebuggerServerEventType.UPDATE_BREAKPOINTS,(e=>{l=new Set(e)}));const c=(0,o.cappedArrayDebounce)((e=>{a(`Emitting debounced batched events - ${e.length}`),u.emit(s.DebuggerServerEventType.EVENTS_BATCH,e)}),100,200);return{onChange:e=>(u.on(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e),()=>u.off(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e)),onInput:e=>(u.on(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e),()=>u.off(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e)),emitEvent:e=>{a(`Emitting event ${e.type} change event of ${e.insId}`),e.val=(0,r.normalizeData)(e.val),c.addItem({...e,time:Date.now()})},emitRuntimeReady:()=>{u.emit(s.DebuggerServerEventType.RUNTIME_READY,{})},emitChangeAwk:()=>{u.emit(s.DebuggerServerEventType.CHANGE_AWK,{})},emitChangeError:e=>{u.emit(s.DebuggerServerEventType.CHANGE_ERROR,{error:e})},emitIsAlive:e=>{u.emit(s.DebuggerServerEventType.IS_ALIVE,{time:e})},destroy:async()=>{c.pendingItems()&&(c.flush(),await(0,o.delay)(100)),(0,s.enumToArray)(s.DebuggerServerEventType).forEach((e=>u.off(e))),u.disconnect()},onDisconnect:e=>(u.on("disconnect",e),()=>u.off("disconnect",e)),waitForConnection:()=>new Promise(((e,t)=>{u.connected?e():(u.on("connect_error",(e=>{t(`Socket connect error: ${e}`)})),u.on("connect",(()=>{e()})))}))}}},31758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerServerEventType=t.enumToArray=t.isNumber=t.isSimpleType=t.valuePreview=t.toString=void 0;const o=n(36783);t.toString=e=>{if("object"===typeof e){if(e instanceof Error)return JSON.stringify((0,o.serializeError)(e));try{return JSON.stringify(e).substr(0,250)}catch(t){return"Object (cannot stringify)"}}return`${e}`.substr(0,250)};t.valuePreview=e=>(0,t.toString)(e).substr(0,100);t.isSimpleType=e=>["number","string","boolean"].includes(typeof e);t.isNumber=e=>!1===isNaN(Number(e)),t.enumToArray=function(e){return Object.keys(e).filter(t.isNumber).map((t=>e[t]))},function(e){e.RUNTIME_READY="runtime-ready",e.CHANGE_EVENT_NAME="change",e.PUSH_INPUT_VALUE="push-input-value",e.CHANGE_AWK="live-change-awk",e.CHANGE_ERROR="live-change-error",e.IS_ALIVE="is-alive",e.UPDATE_BREAKPOINTS="update-breakpoints",e.INPUT_VALUE_OVERRIDE="input-value-override",e.OUTPUT_VALUE_OVERRIDE="output-value-override",e.INPUT_VALUE_CHANGE="input-value-changed",e.OUTPUT_VALUE_CHANGE="output-value-changed",e.PROCESSING_CHANGE="processing-changed",e.INPUTS_STATE_CHANGE="inputs-state-changed",e.NODE_ERROR="node-error",e.EVENTS_BATCH="events-batch"}(t.DebuggerServerEventType||(t.DebuggerServerEventType={}))},96233:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31758),t),i(n(42403),t),i(n(39641),t)},43920:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Equals=t.EqualsBoolean=t.Throttle=t.ThrottleError=t.Debounce=t.Interval=t.Delay=t.Switch4=t.Switch2=t.Switch3=t.EmitOnTrigger=t.BooleanSplit=t.Subscribe=t.Publish=t.RoundRobin4=t.RoundRobin2=t.RoundRobin3=t.LimitTimes=void 0;const o=n(11253),i="Control Flow";t.LimitTimes={id:"Limit Times",namespace:i,description:"Item will be emitted until the limit is reached",inputs:{item:{mode:"required",description:"The item to emit"},times:{mode:"required",description:"The number of times to emit the item"},reset:{mode:"optional",description:"Reset the counter"}},outputs:{ok:{}},reactiveInputs:["item","reset"],completionOutputs:[],run:function(e,t,n){const{state:o}=n,{item:i,times:s,reset:r}=e,{ok:a}=t;if(void 0!==r)return void o.set("val",0);let u=o.get("val")||0;u++,o.set("val",u),u>=s?n.onError(new Error(`Limit of ${s} reached`)):a.next(i)}},t.RoundRobin3={id:"Round Robin 3",namespace:i,description:"Item will be emitted to one of the three outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r}=t,a=o.get("curr")||0,u=(a+1)%3;[i,s,r][a].next(e.item),o.set("curr",u)}},t.RoundRobin2={namespace:i,id:"Round Robin 2",description:"Item will be emitted to one of the 2 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s}=t,r=o.get("curr")||0,a=(r+1)%2;[i,s][r].next(e.item),o.set("curr",a)}},t.RoundRobin4={id:"Round Robin 4",namespace:i,description:"Item will be emitted to one of the 4 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves to "r4"\'s turn.'},r4:{description:'The fourth output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r,r4:a}=t,u=o.get("curr")||0,l=(u+1)%4;[i,s,r,a][u].next(e.item),o.set("curr",l)}},t.Publish={id:"Publish",namespace:i,description:"Publishes a value by a key to all listeners in the current flow. Use 'Subscribe' to listen to events.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},value:{mode:"required"}},outputs:{},run:function(e,t,n){const i=`${n.ancestorsInsIds}__${e.key}`;o.publish(i,e.value)}},t.Subscribe={id:"Subscribe",namespace:i,description:"Subscribes to a value published by a key. Use 'Publish' to publish values.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},initial:{mode:"required-if-connected",description:"If passed will be published has the first value"}},completionOutputs:[],outputs:{value:{description:"The value published by the key"}},run:function(e,t,n){const{value:i}=t,s=`${n.ancestorsInsIds}__${e.key}`,r=o.subscribe(s,((e,t)=>{i.next(t)}));void 0!==e.initial&&i.next(e.initial),n.onCleanup((()=>{o.unsubscribe(r)}))}},t.BooleanSplit={namespace:i,id:"Boolean Split",description:"Splits a boolean value into two outputs",inputs:{value:{mode:"required",description:"Boolean value"},trueValue:{mode:"required-if-connected",description:"Value to emit if the input is true. Defaults to true"},falseValue:{mode:"required-if-connected",description:"Value to emit if the input is false. Defaults to false"}},outputs:{true:{description:"The value is true"},false:{description:"The value is false"}},run:function(e,t){const{true:n,false:o}=t,{value:i,trueValue:s,falseValue:r}=e;i?n.next(null==s||s):o.next(null!=r&&r)}},t.EmitOnTrigger={namespace:i,id:"Emit on Trigger",description:"Emits the value when the trigger input receives any value",inputs:{value:{mode:"required",description:"The value to emit"},trigger:{mode:"required",description:"The trigger to emit the value"}},outputs:{result:{description:"The value emitted"}},run:function(e,t){const{result:n}=t,{value:o,trigger:i}=e;void 0!==i&&n.next(o)}},t.Switch3={namespace:i,id:"Switch 3",description:"Switches between 3 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,default:s,outputValue:r}=t,{value:a,firstCase:u,secondCase:l,thirdCase:c}=e;a===u?n.next(null!=r?r:a):a===l?o.next(null!=r?r:a):a===c?i.next(null!=r?r:a):s.next(null!=r?r:a)}},t.Switch2={id:"Switch 2",description:"Switches between 2 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,default:i,outputValue:s}=t,{value:r,firstCase:a,secondCase:u}=e;r===a?n.next(null!=s?s:r):r===u?o.next(null!=s?s:r):i.next(null!=s?s:r)}},t.Switch4={id:"Switch 4",description:"Switches between 4 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},fourthCase:{mode:"required",description:"The value to switch on for the fourth output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},fourth:{description:"The value emitted if the input value is equal to the fourth case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,fourth:s,default:r,outputValue:a}=t,{value:u,firstCase:l,secondCase:c,thirdCase:d,fourthCase:p}=e;u===l?n.next(null!=a?a:u):u===c?o.next(null!=a?a:u):u===d?i.next(null!=a?a:u):u===p?s.next(null!=a?a:u):r.next(null!=a?a:u)}},t.Delay={id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:i,description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:async(e,t)=>{let{value:n,delay:o}=e,{delayedValue:i}=t;await new Promise((e=>setTimeout(e,o))),i.next(n)}},t.Interval={id:"Interval",namespace:i,defaultStyle:{icon:"fa-clock"},description:"Emits a value every interval",inputs:{value:{description:"Value to emit"},interval:{description:"Interval in milliseconds"}},reactiveInputs:["value","interval"],outputs:{value:{description:"Emitted value"}},completionOutputs:[],run:(e,t,n)=>{n.state.get("timer")&&clearInterval(n.state.get("timer"));const o=setInterval((()=>{t.value.next(e.value)}),e.interval);n.state.set("timer",o),n.onCleanup((()=>{clearInterval(o)}))}},t.Debounce={id:"Debounce",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be debounced"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The debounced value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the last value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:s}=t,r=n.state.get("timer");r&&clearTimeout(r);const a=setTimeout((()=>{s.next(o)}),i);n.state.set("timer",a),n.onCleanup((()=>{clearTimeout(r)}))}};class s extends Error{constructor(e){super("Throttle: Value dropped"),this.value=e}}t.ThrottleError=s,t.Throttle={id:"Throttle",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be throttled"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The throttled value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the first value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:r}=t;if(n.state.get("timer"))n.onError(new s(o));else{r.next(o);const e=setTimeout((()=>{n.state.set("timer",null)}),i);n.state.set("timer",e)}}},t.EqualsBoolean={id:"Equals (Bool)",defaultStyle:{icon:"fa-equals"},namespace:i,description:"Emits true if two values are equal (=== equality). Otherwise emits false.",inputs:{a:{description:"First value"},b:{description:"Second value"}},outputs:{result:{description:"true if a is equal to b"}},run:(e,t)=>{let{a:n,b:o}=e,{result:i}=t;return i.next(n===o)}},t.Equals={id:"Equals",namespace:i,description:'Emits the value of "a" to output "true" if "a" is equal to "b". Otherwise emits the value of "a" to output "false".',inputs:{a:{mode:"required",description:"First value"},b:{mode:"required",description:"Second value"}},outputs:{true:{description:"Emits the value of a if a is equal to b"},false:{description:"Emits the value of a if a is not equal to b"}},run:(e,t)=>{const{a:n,b:o}=e,{true:i,false:s}=t;n===o?i.next(n):s.next(n)}}},65645:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var o=n(70079),i=n(11253),s=n(74089),r=n(74762),a=n(21766);var u=n(10831),l=n(61997),c=n(77852);const d=(0,a.S)(),p=[0,20],f=e=>{let{flow:t,output:n,inputs:o,onError:s,debugDelay:a,onCompleted:u,dependencies:l,player:c}=e;const p=((e,t)=>{const n=new Set;return{onEvent:o=>{const i={...o,time:Date.now(),executionId:"n/a"};console.info("Got debugger event",o),t.addEvents([i]),e.addEvents([i]),n.forEach((e=>e([i])))},onBatchedEvents:e=>(n.add(e),()=>n.delete(e))}})(c,d);p.debugDelay=a;const f=(0,r.keys)(t.node.outputs)[0];return{executeResult:(0,r.execute)({node:t.node,inputs:o,outputs:{[f]:n},resolvedDeps:{...l,[t.node.id]:t.node},_debugger:p,onCompleted:u,onBubbleError:e=>{s(e)},extraContext:{PubSub:i}}),localDebugger:p}},m=e=>{const{debugDelay:t,onOutput:i,flowProps:a}=e,{flow:m,inputs:v,output:h}=a,g=(0,o.useRef)((0,s.createRuntimePlayer)()),[I,y]=(0,o.useState)(e.flowProps.dependencies),[b,C]=(0,o.useState)(),[_]=(0,s.useDebounce)(I,500),x=(0,c.useDarkMode)(),N=async(e,t)=>{const{node:o}=e,i=Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).find((e=>(0,r.isBaseNode)(e)&&e.id===o.id));let a;y((e=>({...e,[i.id]:{...i,source:{path:"@flyde/stdlib/dist/all-browser",export:i.id}}})));const l=(0,u.ZP)(m,(n=>{if(t){const o=(0,s.vAdd)({x:0,y:0},t.pos);if(a=(0,s.createNewNodeInstance)(e.node,0,o,I),n.node.instances.push(a),t.connectTo){const{insId:e,outputId:o}=t.connectTo;n.node.connections.push({from:{insId:e,pinId:o},to:{insId:a.id,pinId:r.TRIGGER_PIN_ID}})}}}));await new Promise((e=>setTimeout(e,10)));const c=(0,u.ZP)(j,(e=>{e.flow=l,t?.selectAfterAdding&&a&&(e.boardData.selected=[a?.id])}));return O(c),(0,s.toastMsg)(`Node ${o.id} successfully imported from ${e.module}`),I},w=async()=>({importables:Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).filter(r.isBaseNode).map((e=>({node:{...e,source:{path:"n/a",export:"n/a"}},module:"@flyde/stdlib"}))),errors:[]}),[j,O]=(0,o.useState)({flow:m,boardData:{viewPort:{pos:{x:0,y:0},zoom:1},lastMousePos:{x:0,y:0},selected:[]}});(0,o.useEffect)((()=>{O((e=>({...e,flow:m})))}),[m]),(0,o.useEffect)((()=>{y((e=>({...e,main:j.flow.node})))}),[j.flow.node]);const P={state:j,onChangeEditorState:O,hideTemplatingTips:!0,initialPadding:p,onExtractInlineNode:r.noop,disableScrolling:!0,darkMode:x.isDarkMode};(0,o.useEffect)((()=>{g.current.start()}),[]),(0,o.useEffect)((()=>{const{executeResult:n,localDebugger:o}=f({flow:j.flow,dependencies:I,output:h,inputs:v,onError:r.noop,debugDelay:t,player:g.current,onCompleted:e.onCompleted}),s=e.flowProps.output.subscribe((e=>i(e)));return C(o),()=>{n(),s.unsubscribe()}}),[t,_]);const E=(0,o.useMemo)((()=>({resolvedDependencies:I,onImportNode:N,onRequestImportables:w})),[]),D=(0,o.useMemo)((()=>({debuggerClient:b,onRequestHistory:d.requestHistory})),[b]);return o.createElement(l.Z,null,(()=>o.createElement(s.DependenciesContextProvider,{value:E},o.createElement(s.DebuggerContextProvider,{value:D},o.createElement(s.FlowEditor,P)))))}},21766:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var o=n(74762);const i=200,s=()=>{const e=new Map,t=new Map;return{requestHistory:async(n,s,r)=>{const a="input"===r?o.DebuggerEventType.INPUT_CHANGE:o.DebuggerEventType.OUTPUT_CHANGE;if(console.log({insId:n,pinId:s,type:a}),s){const t=`${n}.${s}.${a}`,o=e.get(t)||{total:0,lastSamples:[]},r=o.lastSamples.slice(0,i);return{...o,lastSamples:r}}{const e=t.get(n)||{total:0,lastSamples:[]},o=e.lastSamples.slice(0,i);return{...e,lastSamples:o}}},addEvents:n=>{n.forEach((n=>{if(n.type===o.DebuggerEventType.ERROR){const e=n;e.type=o.DebuggerEventType.OUTPUT_CHANGE,e.pinId=o.ERROR_PIN_ID}if(n.type===o.DebuggerEventType.INPUT_CHANGE||n.type===o.DebuggerEventType.OUTPUT_CHANGE){const{insId:o,type:s,pinId:r}=n;{const t=`${o}.${r}.${s}`,a=e.get(t)||{total:0,lastSamples:[]};a.lastSamples.unshift(n),a.lastSamples.length>i&&a.lastSamples.splice(i,a.lastSamples.length-i),a.total++,e.set(t,a)}{const s=t.get(o)||{total:0,lastSamples:[]};s.lastSamples.unshift(n),s.lastSamples.length>i&&s.lastSamples.splice(i,s.lastSamples.length-i),s.total++,e.set(o,s)}}}))}}}},4144:(e,t,n)=>{"use strict";n.d(t,{V:()=>r});var o=n(10328),i=n(70079);const s=e=>i.createElement("li",{className:"log-item"},i.createElement("main",{className:"content"},e.value),i.createElement("aside",null,new Date(e.time).toLocaleTimeString())),r=e=>{const[t,n]=i.useState([]);return i.useEffect((()=>{e.output.subscribe((e=>{const t="object"==typeof e&&i.isValidElement(e)?e:`${e}`;n((e=>[...e,{value:t,time:Date.now()}]))}))}),[]),i.createElement("div",{className:"output-log"},i.createElement("header",null,"Output Log"," ",i.createElement("button",{className:"clear-btn button button--outline button--secondary button--sm",onClick:()=>n([])},"Clear")),i.createElement("main",null,i.createElement("ul",null,t.map(((e,t)=>i.createElement(s,(0,o.Z)({},e,{key:t}))))),0===t.length?i.createElement("div",{className:"empty-state"},"Nothing to show. Interact with the example to emit some outputs!"):null))}},79256:(e,t,n)=>{"use strict";n.d(t,{I:()=>p});var o=n(70079),i=n(65092),s=n(19841),r=n(49794),a=n(21766),u=n(73949),l=n(81098),c=n(65645);(0,a.S)();const d=[{title:"Hello World",key:"hello-world"},{title:"React Counter",key:"react-counter"},{title:"BMI Calculator",key:"bmi"},{title:"REST API Usage",key:"apis"},{title:"Debounce vs. Throttling",key:"debounce-throttling"},{title:"Fibonacci Seq.",key:"fibonacci"}],p=e=>{const[t,n]=(0,o.useState)(e.initWidth||500),[a,p]=(0,o.useState)(e.defaultDelay||0),[f,m]=(0,o.useState)(!1),v=(0,o.useCallback)(((e,t)=>{let{size:o}=t;n(o.width)}),[]),h=o.createElement("div",{className:"delay-container"},o.createElement("input",{type:"range",id:"volume",name:"delay",value:a,step:"100",min:"0",max:"300",onChange:e=>p(Number(e.target.value))}),o.createElement("label",{htmlFor:"volume"},"Debug Delay: ",a,"ms")),g=d.findIndex((t=>t.key===e.meta.key)),I=d[g+1],y=d[g-1];return o.createElement(i.Z,{title:`${e.meta.title} | Playground`,description:`Flyde Playground - ${e.meta.title} example`},o.createElement("header",{className:(0,s.default)("hero hero--primary",u.Z.heroBanner,"playground-hero")},o.createElement("div",{className:"container"},o.createElement("h1",{className:"hero__title"},"Welcome to Flyde's Online Playground"),o.createElement("p",{className:"hero__subtitle"},"Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!"))),o.createElement("div",{className:"mobile-warning"},"Flyde is currently not optimized for mobile devices. Please"," ",o.createElement("strong",null,"use a desktop computer for the best experience"),"."),o.createElement("ul",{className:"examples__menu"},d.map((e=>o.createElement("li",{key:e.key},o.createElement(r.Z,{to:`/playground/${e.key}`,className:"button button--primary"},e.title))))),o.createElement("div",{className:"playground-container"},o.createElement("header",null,o.createElement("h2",{className:"playground-title"},e.meta.title),o.createElement("div",{className:"playground-description"},e.meta.description),f?o.createElement(o.Fragment,null,o.createElement("hr",null),o.createElement("div",{className:"playground-extra"},e.extraInfo||e.meta.extraInfo,o.createElement("div",{className:"star-hint"},o.createElement("span",null,"\xa0 PS: Did you like this example?"),"Please consider giving a \u2b50\ufe0f to the project"," ",o.createElement("span",{className:"star-wrapper"},o.createElement("iframe",{className:"gh-stars-frame",src:"https://ghbtns.com/github-btn.html?user=flydelabs&repo=flyde&type=star&count=true&size=small",width:100,height:20,title:"GitHub Stars"}))))):null,e.prefixComponent),o.createElement("div",{className:"playground"},o.createElement("div",{className:"flow-container"},!0!==e.hideDelay?h:null,o.createElement(c.Y,{flowProps:e.flowProps,debugDelay:a,onOutput:()=>m(!0)})),o.createElement(l.Resizable,{height:0,width:t,onResize:v,handle:o.createElement("div",{className:"handle"}),axis:"x",resizeHandles:["w"]},o.createElement("div",{className:"output-container",style:{flexBasis:t}},e.children))),o.createElement("nav",{className:"pagination-nav"},o.createElement("div",{className:"pagination-nav__item"},y?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${y.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Previous Example"),o.createElement("div",{className:"pagination-nav__label"},y.title)):null),o.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},I?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${I.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Next Example"),o.createElement("div",{className:"pagination-nav__label"},I.title)):null))))}},74465:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var o=n(70079),i=n(10831),s=n(74762),r=n(79256);const a={dependencies:{Debounce:{id:"Debounce",namespace:"Control Flow",inputs:{value:{mode:"required",description:"The data that needs to be debounced"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The debounced value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the last value received after being idle for "wait" amount of milliseconds',run:n(43920).Debounce.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Debounce"}},Throttle:{id:"Throttle",namespace:"Control Flow",inputs:{value:{mode:"required",description:"The data that needs to be throttled"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The throttled value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the first value received after being idle for "wait" amount of milliseconds',run:n(43920).Throttle.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Throttle"}}},flow:{imports:{"@flyde/stdlib":["Debounce","Throttle"]},node:{instances:[{pos:{x:564.2311294555664,y:353.080333404541},id:"Debounce-194-d108",inputConfig:{ms:{mode:"static",value:1500},wait:{mode:"static",value:2e3}},visibleInputs:["value","wait","__trigger"],nodeId:"Debounce",style:{size:"large",color:"#f15bb5"}},{pos:{x:278.2552195739746,y:344.8639384841919},id:"Throttle-652",inputConfig:{threshold:{mode:"static",value:4e3},wait:{mode:"static",value:1500}},visibleOutputs:["result","__error"],nodeId:"Throttle",style:{size:"large",color:"#fee440"}},{pos:{x:375.39898803710935,y:498.85297454833983},id:"Inline-value-Value was thro-555",inputConfig:{},node:{id:"Inline-value-Value was thro",inputs:{},outputs:{r:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"outputs.r.next((`Value was throttled!`))",customViewCode:"`Value was throttled!`",dataBuilderSource:"YFZhbHVlIHdhcyB0aHJvdHRsZWQhYA==",templateType:"value",completionOutputs:["r"],defaultStyle:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"300"}}},style:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"300"}}},{pos:{x:50.283386535644524,y:575.9333444213867},id:"Inline-value-Throttle out-817",inputConfig:{},node:{id:"Inline-value-Throttle out",inputs:{value:{type:"any",mode:"required"}},outputs:{r:{type:"any",delayed:!1,optional:!1}},runFnRawCode:'outputs.r.next((`"Throttle" output - ${inputs.value}`))',customViewCode:'`"Throttle" output - ${inputs.value}`',dataBuilderSource:"YCJUaHJvdHRsZSIgb3V0cHV0IC0gJHtpbnB1dHMudmFsdWV9YA==",templateType:"value",completionOutputs:["r"],defaultStyle:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"300"}}},style:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"300"}}},{pos:{x:638.5763772583008,y:559.9217034912109},id:"Inline-value-Debounce out-720",inputConfig:{},node:{id:"Inline-value-Debounce out",inputs:{val:{type:"any",mode:"required"}},outputs:{r:{type:"any",delayed:!1,optional:!1}},runFnRawCode:'outputs.r.next((`"Debounce" output - ${inputs.val}`))',customViewCode:'`"Debounce" output - ${inputs.val}`',dataBuilderSource:"YCJEZWJvdW5jZSIgb3V0cHV0IC0gJHtpbnB1dHMudmFsfWA=",templateType:"value",completionOutputs:["r"],defaultStyle:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"300"}}},style:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"300"}}}],connections:[{from:{insId:"Inline-value-Value was thro-555",pinId:"r"},to:{insId:"__this",pinId:"result"}},{from:{insId:"Throttle-652",pinId:"result"},to:{insId:"Inline-value-Throttle out-817",pinId:"value"}},{from:{insId:"Inline-value-Throttle out-817",pinId:"r"},to:{insId:"__this",pinId:"result"}},{from:{insId:"Inline-value-Debounce out-720",pinId:"r"},to:{insId:"__this",pinId:"result"}},{from:{insId:"Throttle-652",pinId:"__error"},to:{insId:"Inline-value-Value was thro-555",pinId:"__trigger"}},{from:{insId:"__this",pinId:"input"},to:{insId:"Throttle-652",pinId:"value"}},{from:{insId:"__this",pinId:"input"},to:{insId:"Debounce-194-d108",pinId:"value"}},{from:{insId:"Debounce-194-d108",pinId:"result"},to:{insId:"Inline-value-Debounce out-720",pinId:"val"}}],id:"Main",inputs:{input:{mode:"required",type:"any"}},outputs:{result:{type:"any"}},inputsPosition:{value:{x:478.848314936081,y:129.00413662180574},ggg:{x:8.112505244875974,y:489.6946435546802},rr:{x:319.4,y:268.6},threshold:{x:485.56077831498897,y:225.21610416222086},input:{x:466.16074863066945,y:179.24732213758483}},outputsPosition:{result:{x:533.2714674326223,y:848.1304470496965},bb:{x:-119.26,y:783.62}},completionOutputs:[],reactiveInputs:["input"]}}};var u=n(4144);console.log({example:a});const l={title:"Debounce vs. Throttling",description:"This example takes Flyde's visual feedback to the next level by showing the difference between debouncing and throttling. Click on the buttons below to emit some Emojis.",key:"debounce-throttling"},c="Cool right? you can try duplicating nodes by pressing shift+D. Connect nodes together by clicking on the source node's output pin and then on a the targets node's input pin";function d(){const e=(0,o.useRef)((0,s.dynamicOutput)()),t=(0,o.useRef)({input:(0,s.dynamicNodeInput)()}),[n,d]=(0,o.useState)(1500),[p,f]=(0,o.useState)(4e3),[m,v]=(0,o.useState)({flow:a.flow,dependencies:a.dependencies,inputs:t.current,output:e.current});(0,o.useEffect)((()=>{v((0,i.Uy)(m,(e=>{const t=e.flow.node;if((0,s.isVisualNode)(t)){t.instances.find((e=>(0,s.isRefNodeInstance)(e)&&"Debounce"===e.nodeId)).inputConfig.wait=(0,s.staticInputPinConfig)(n);t.instances.find((e=>(0,s.isRefNodeInstance)(e)&&"Throttle"===e.nodeId)).inputConfig.wait=(0,s.staticInputPinConfig)(p)}})))}),[n,p]),(0,o.useEffect)((()=>{e.current.subscribe((e=>{}))}),[]);const h=o.createElement(o.Fragment,null,o.createElement("div",{style:{display:"flex",justifyContent:"center",gap:5}},o.createElement("input",{type:"range",id:"deb",name:"deb",value:n,step:"100",min:"0",max:"7500",onChange:e=>d(Number(e.target.value))}),o.createElement("label",{htmlFor:"deb"},"Debounce - ",n,"ms")),o.createElement("div",{style:{display:"flex",justifyContent:"center",gap:5}},o.createElement("input",{type:"range",id:"thr",name:"thr",value:p,step:"100",min:"0",max:"7500",onChange:e=>f(Number(e.target.value))}),o.createElement("label",{htmlFor:"thr"},"Throttle - ",p,"ms")),o.createElement("button",{className:"emit-btn button button--outline button--primary",onClick:()=>t.current.input.subject.next("\ud83d\udc36")},"Emit \ud83d\udc36"),o.createElement("button",{className:"emit-btn button button--outline button--primary",onClick:()=>t.current.input.subject.next("\ud83d\ude38")},"Emit \ud83d\ude38"),o.createElement("button",{className:"emit-btn button button--outline button--primary",onClick:()=>t.current.input.subject.next("\ud83e\udd84")},"Emit \ud83e\udd84"));return o.createElement(r.I,{meta:l,flowProps:m,prefixComponent:h,hideDelay:!0,extraInfo:c},o.createElement(u.V,{output:e.current}))}},73949:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={"flyde-flow-editor":"flyde-flow-editor_AAD4",_hj_feedback_container:"_hj_feedback_container_Af03"}},85721:(e,t,n)=>{var o={"./af":47654,"./af.js":47654,"./ar":61325,"./ar-dz":98344,"./ar-dz.js":98344,"./ar-kw":26230,"./ar-kw.js":26230,"./ar-ly":42524,"./ar-ly.js":42524,"./ar-ma":44119,"./ar-ma.js":44119,"./ar-sa":82625,"./ar-sa.js":82625,"./ar-tn":42182,"./ar-tn.js":42182,"./ar.js":61325,"./az":37093,"./az.js":37093,"./be":32721,"./be.js":32721,"./bg":59919,"./bg.js":59919,"./bm":95594,"./bm.js":95594,"./bn":563,"./bn-bd":41757,"./bn-bd.js":41757,"./bn.js":563,"./bo":73211,"./bo.js":73211,"./br":87438,"./br.js":87438,"./bs":83662,"./bs.js":83662,"./ca":61196,"./ca.js":61196,"./cs":5841,"./cs.js":5841,"./cv":85251,"./cv.js":85251,"./cy":24512,"./cy.js":24512,"./da":37539,"./da.js":37539,"./de":5059,"./de-at":53853,"./de-at.js":53853,"./de-ch":99378,"./de-ch.js":99378,"./de.js":5059,"./dv":91454,"./dv.js":91454,"./el":39651,"./el.js":39651,"./en-au":87953,"./en-au.js":87953,"./en-ca":98193,"./en-ca.js":98193,"./en-gb":61980,"./en-gb.js":61980,"./en-ie":14050,"./en-ie.js":14050,"./en-il":6502,"./en-il.js":6502,"./en-in":555,"./en-in.js":555,"./en-nz":11372,"./en-nz.js":11372,"./en-sg":26568,"./en-sg.js":26568,"./eo":69533,"./eo.js":69533,"./es":68327,"./es-do":17620,"./es-do.js":17620,"./es-mx":96467,"./es-mx.js":96467,"./es-us":83272,"./es-us.js":83272,"./es.js":68327,"./et":68523,"./et.js":68523,"./eu":19066,"./eu.js":19066,"./fa":59087,"./fa.js":59087,"./fi":96443,"./fi.js":96443,"./fil":93979,"./fil.js":93979,"./fo":90383,"./fo.js":90383,"./fr":56327,"./fr-ca":25610,"./fr-ca.js":25610,"./fr-ch":97274,"./fr-ch.js":97274,"./fr.js":56327,"./fy":67442,"./fy.js":67442,"./ga":44291,"./ga.js":44291,"./gd":77342,"./gd.js":77342,"./gl":96248,"./gl.js":96248,"./gom-deva":21404,"./gom-deva.js":21404,"./gom-latn":20833,"./gom-latn.js":20833,"./gu":9122,"./gu.js":9122,"./he":74623,"./he.js":74623,"./hi":60364,"./hi.js":60364,"./hr":30860,"./hr.js":30860,"./hu":70441,"./hu.js":70441,"./hy-am":90425,"./hy-am.js":90425,"./id":29672,"./id.js":29672,"./is":96150,"./is.js":96150,"./it":27852,"./it-ch":55603,"./it-ch.js":55603,"./it.js":27852,"./ja":16465,"./ja.js":16465,"./jv":20120,"./jv.js":20120,"./ka":87245,"./ka.js":87245,"./kk":21479,"./kk.js":21479,"./km":65038,"./km.js":65038,"./kn":63060,"./kn.js":63060,"./ko":85020,"./ko.js":85020,"./ku":90582,"./ku.js":90582,"./ky":34950,"./ky.js":34950,"./lb":94201,"./lb.js":94201,"./lo":87894,"./lo.js":87894,"./lt":70120,"./lt.js":70120,"./lv":4265,"./lv.js":4265,"./me":14030,"./me.js":14030,"./mi":9463,"./mi.js":9463,"./mk":25898,"./mk.js":25898,"./ml":64233,"./ml.js":64233,"./mn":47156,"./mn.js":47156,"./mr":34479,"./mr.js":34479,"./ms":24691,"./ms-my":6456,"./ms-my.js":6456,"./ms.js":24691,"./mt":81789,"./mt.js":81789,"./my":37452,"./my.js":37452,"./nb":91170,"./nb.js":91170,"./ne":87529,"./ne.js":87529,"./nl":81776,"./nl-be":24455,"./nl-be.js":24455,"./nl.js":81776,"./nn":34705,"./nn.js":34705,"./oc-lnc":36139,"./oc-lnc.js":36139,"./pa-in":17960,"./pa-in.js":17960,"./pl":1899,"./pl.js":1899,"./pt":31670,"./pt-br":29159,"./pt-br.js":29159,"./pt.js":31670,"./ro":55115,"./ro.js":55115,"./ru":45149,"./ru.js":45149,"./sd":81231,"./sd.js":81231,"./se":35397,"./se.js":35397,"./si":99786,"./si.js":99786,"./sk":39383,"./sk.js":39383,"./sl":68691,"./sl.js":68691,"./sq":34826,"./sq.js":34826,"./sr":40080,"./sr-cyrl":75673,"./sr-cyrl.js":75673,"./sr.js":40080,"./ss":54309,"./ss.js":54309,"./sv":52245,"./sv.js":52245,"./sw":8967,"./sw.js":8967,"./ta":10454,"./ta.js":10454,"./te":35204,"./te.js":35204,"./tet":81571,"./tet.js":81571,"./tg":15737,"./tg.js":15737,"./th":41786,"./th.js":41786,"./tk":50511,"./tk.js":50511,"./tl-ph":14828,"./tl-ph.js":14828,"./tlh":62422,"./tlh.js":62422,"./tr":97047,"./tr.js":97047,"./tzl":90792,"./tzl.js":90792,"./tzm":67730,"./tzm-latn":59963,"./tzm-latn.js":59963,"./tzm.js":67730,"./ug-cn":42535,"./ug-cn.js":42535,"./uk":33151,"./uk.js":33151,"./ur":22750,"./ur.js":22750,"./uz":61914,"./uz-latn":60231,"./uz-latn.js":60231,"./uz.js":61914,"./vi":55517,"./vi.js":55517,"./x-pseudo":64078,"./x-pseudo.js":64078,"./yo":70046,"./yo.js":70046,"./zh-cn":81832,"./zh-cn.js":81832,"./zh-hk":90953,"./zh-hk.js":90953,"./zh-mo":38236,"./zh-mo.js":38236,"./zh-tw":71001,"./zh-tw.js":71001};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=s,e.exports=i,i.id=85721}}]); \ No newline at end of file diff --git a/assets/js/1df93b7f.1d72a79e.js b/assets/js/1df93b7f.b5fbcbac.js similarity index 54% rename from assets/js/1df93b7f.1d72a79e.js rename to assets/js/1df93b7f.b5fbcbac.js index 90ad4d681..257f586c2 100644 --- a/assets/js/1df93b7f.1d72a79e.js +++ b/assets/js/1df93b7f.b5fbcbac.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3237],{19121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cappedArrayDebounce=void 0;t.cappedArrayDebounce=function(e,t,n,o){void 0===o&&(o=500);let i=[],s=null,r=null;return{addItem:a=>{clearTimeout(s),i.push(a),r||(r=setTimeout((()=>{e(i),clearTimeout(s),r=null}),o)),i.length>=n?(e(i),clearTimeout(r),r=null,i=[]):s=setTimeout((()=>{e(i),clearTimeout(r),r=null,i=[]}),t)},flush:()=>{i.length&&(e(i),i=[],clearTimeout(r))},pendingItems:()=>i.length}}},59792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.dataShaper=t.DataShapeType=void 0,function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.ARRAY=3]="ARRAY",e[e.OBJECT=4]="OBJECT",e[e.NULL=5]="NULL",e[e.UNSUPPORTED=6]="UNSUPPORTED"}(n=t.DataShapeType||(t.DataShapeType={}));const o={string:n.STRING,number:n.NUMBER,boolean:n.BOOLEAN,object:n.OBJECT,array:n.ARRAY,null:n.NULL,symbol:n.UNSUPPORTED,undefined:n.UNSUPPORTED,function:n.UNSUPPORTED,bigint:n.UNSUPPORTED};t.dataShaper=function(e,n,i){void 0===n&&(n=5),void 0===i&&(i=5);const s=null===(r=e)?"null":typeof r;var r,a;if("object"===s){if(Array.isArray(e))return n>1?e.filter(((e,t)=>t(0,t.dataShaper)(e,n-1,i))):o.array;if(n>1){const o={};for(const s in e)o[s]=(0,t.dataShaper)(e[s],n-1,i);return a=o,Object.keys(a).sort().reduce(((e,t)=>(e[t]=a[t],e)),{})}return o.object}return o[s]}},23046:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.debugLogger=void 0;const i=(0,o(n(55899)).default)("flyde");t.debugLogger=e=>i.extend(e)},24331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullInsIdPath=void 0,t.fullInsIdPath=function(e,t){if(!e)throw new Error("insId is not defined");return t?`${t}.${e}`:e}},34459:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hashFlow=t.hashNode=void 0;const i=o(n(68805)),s=n(30292),r=e=>(0,i.default)(e);t.hashNode=function(e,t){var n;void 0===t&&(t=!0);const{id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l}=e,c={id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l};if((0,s.isVisualNode)(e)){const{instances:n,connections:o,inputsPosition:i,outputsPosition:s}=e,a=n.map((e=>{const{pos:t,...n}=e;return n})),u=t?{}:{inputsPosition:i,outputsPosition:s},l=t?a:n;l.sort(((e,t)=>e.id.localeCompare(t.id)));const d=[...o];d.sort(((e,t)=>{const n=`${e.from.insId}.${e.from.pinId}`,o=`${t.from.insId}.${t.from.pinId}`;return n.localeCompare(o)}));const p=JSON.stringify({instancesToUse:l,conns:d,...c,maybeIoPos:u});return r(p)}if((0,s.isInlineValueNode)(e)){const{customViewCode:t}=e,o=null!==(n=e.fnCode)&&void 0!==n?n:e.runFnRawCode,i=JSON.stringify({fnCode:o,customViewCode:t,...c});return r(i)}throw new Error("Hashing code nodes unsupported")};t.hashFlow=e=>{const{node:n,imports:o}=e,i=(0,t.hashNode)(n,!1),s=Object.entries(null!=o?o:{}).sort(((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)})).map((e=>{let[t,n]=e;return[t,n.sort()]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{}),a=JSON.stringify(s);return r(i+a)}},86873:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DepGraph=void 0,i(n(3172),t),i(n(59962),t),i(n(23046),t),i(n(19121),t),i(n(59962),t),i(n(34459),t),i(n(39043),t),i(n(59792),t),i(n(24331),t),t.DepGraph=n(60359).DepGraph},3172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testDataCreator=void 0;t.testDataCreator=e=>function(t){void 0===t&&(t={});return{..."function"==typeof e?e():e,...t}}},59962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplePluralize=t.eventually=t.delay=t.noop=t.removeDupes=t.ensure=t.isOptionalType=t.callFnOrFnPromise=t.isPromise=t.isDefined=t.containsAll=t.shuffle=t.randomInts=t.repeat=t.pickRandom=t.randomPos=t.randomInt=t.pickSecond=t.pickFirst=t.fromEntries=t.entries=t.okeys=t.values=t.keys=t.filterOMap=t.mapOMap=t.middlePos=t.calcCenter=t.intersectRect=void 0;t.intersectRect=(e,t)=>{const n=e.x+e.w,o=t.x+t.w;return!(t.x>n||oe.y+e.h||t.y+t.h{let{w:t,h:n,x:o,y:i}=e;return{x:o+t/2,y:i+n/2}};t.middlePos=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});t.mapOMap=(e,n)=>(0,t.entries)(e).map((e=>{let[t,o]=e;return[t,n(t,o)]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.filterOMap=(e,n)=>(0,t.entries)(e).filter((e=>{let[t,o]=e;return n(t,o)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.keys=e=>Object.keys(e);t.values=e=>Object.values(e),t.okeys=t.keys;t.entries=e=>(0,t.okeys)(e).map((t=>[t,e[t]]));t.fromEntries=e=>e.reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.pickFirst=e=>e[0];t.pickSecond=e=>e[1];t.randomInt=function(e,t){void 0===t&&(t=0);const n=Math.random();return t+Math.floor((e-t)*n)};t.randomPos=function(e,n){void 0===e&&(e=1e3),void 0===n&&(n=0);return{x:(0,t.randomInt)(e,n),y:(0,t.randomInt)(e,n)}};t.pickRandom=e=>e[(0,t.randomInt)(e.length)];t.repeat=(e,t)=>"x".repeat(e).split("").map(((e,n)=>t(n)));t.randomInts=function(e,n,o){return void 0===n&&(n=100),void 0===o&&(o=0),(0,t.repeat)(e,(()=>(0,t.randomInt)(n,o)))};t.shuffle=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t};t.containsAll=(e,t)=>t.every((t=>e.includes(t)));t.isDefined=e=>void 0!==e;t.isPromise=e=>e&&"function"==typeof e.then;t.callFnOrFnPromise=(e,n)=>{if(!(0,t.isDefined)(e))return;const o=e=>{try{e()}catch(t){console.error(n,t)}};"function"==typeof e?o(e):Promise.resolve(e).then((e=>{"function"==typeof e&&o(e)}))};t.isOptionalType=e=>/\?$/.test(e);t.ensure=(e,t)=>{if(void 0===e)throw new Error(t||"Undefined value passed");return e};t.removeDupes=e=>Array.from(new Set(e));t.noop=()=>{};t.delay=e=>new Promise((t=>setTimeout(t,e)));t.eventually=async function(e,n,o,i){if(void 0===n&&(n=1e3),void 0===o&&(o=100),void 0===i&&(i=new Set),n<0){const e=Array.from(i).reduce(((e,t,n)=>`${e}\n\t\t${n+1}. ${t}`),"");throw new Error(`[Eventually timeout exceeded after: timeout with error]: ${e}`)}try{await e()}catch(s){const r=Date.now();await(0,t.delay)(o);const a=Date.now()-r;return i.add(null==s?void 0:s.message),(0,t.eventually)(e,n-a,o,i)}},t.simplePluralize=function(e,t){return`${e} ${t}${1!==e?"s":""}`}},39043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileObjectTemplate=t.compileStringTemplate=void 0;t.compileStringTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=new RegExp("\\$\\{"+e+"\\}","g");n=n.replace(i,o)})),n};t.compileObjectTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=JSON.stringify(o),s=new RegExp('"\\$\\$\\{'+e+'\\}"',"g"),r=new RegExp("\\$\\{"+e+"\\}","g"),a="string"==typeof o?o.replace(/"/g,((e,t,n)=>"\\"!==n[t-1]?'\\"':n[t])):o;n=n.replace(s,i).replace(r,a).replace(/\n/g,"\\n")})),JSON.parse(n)}},69150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connection=t.connectionData=t.connectionDataEquals=t.connectionNodeEquals=t.connectionNode=t.externalConnectionNode=t.isInternalConnection=t.isExternalConnection=t.isInternalConnectionNode=t.isExternalConnectionNode=t.getNodeOutputs=t.getOutputName=t.getInputName=t.getNodeInputs=t.TRIGGER_PIN_ID=t.ERROR_PIN_ID=t.THIS_INS_ID=void 0;const o=n(30292);t.THIS_INS_ID="__this",t.ERROR_PIN_ID="__error",t.TRIGGER_PIN_ID="__trigger";t.getNodeInputs=e=>({...e.inputs,[t.TRIGGER_PIN_ID]:(0,o.nodeInput)()});t.getInputName=e=>e===t.TRIGGER_PIN_ID?"Trigger Node":e;t.getOutputName=e=>e===t.ERROR_PIN_ID?"Error":e;t.getNodeOutputs=e=>({...e.outputs,[t.ERROR_PIN_ID]:(0,o.nodeOutput)()});t.isExternalConnectionNode=e=>e&&e.insId===t.THIS_INS_ID;t.isInternalConnectionNode=e=>e.insId!==t.THIS_INS_ID;t.isExternalConnection=e=>{let{from:n,to:o}=e;return(0,t.isExternalConnectionNode)(n)||(0,t.isExternalConnectionNode)(o)};t.isInternalConnection=e=>!(0,t.isExternalConnection)(e);t.externalConnectionNode=e=>({insId:t.THIS_INS_ID,pinId:e});t.connectionNode=(e,t)=>({insId:e,pinId:t});t.connectionNodeEquals=(e,t)=>e.insId===t.insId&&e.pinId===t.pinId;t.connectionDataEquals=(e,n)=>!(!e||!n)&&((0,t.connectionNodeEquals)(e.from,n.from)&&(0,t.connectionNodeEquals)(e.to,n.to)),t.connectionData=function(e,n,o){const i="string"==typeof e?e.split("."):e,s="string"==typeof n?n.split("."):n;if(i.length>2||s.length>2)throw new Error(`invalid source or target to connection data - ${e} / ${n}`);return{from:2===i.length?(0,t.connectionNode)(i[0],i[1]):(0,t.externalConnectionNode)(i[0]),to:2===s.length?(0,t.connectionNode)(s[0],s[1]):(0,t.externalConnectionNode)(s[0]),delayed:o}};t.connection=function(e,t,n){return void 0===n&&(n=!1),{from:e,to:t,delayed:n}}},6775:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;const s=n(30292),r=n(47025),a=n(86873),u=n(69150);i(n(69150),t);t.connect=function(e,t,n,o,i,l,c,d){void 0===n&&(n={}),void 0===i&&(i={}),void 0===l&&(l=a.noop),void 0===c&&(c={}),void 0===d&&(d={});const{id:p,connections:f,instances:m}=e,h=p||"connected-node"+(0,a.randomInt)(999);return{inputs:e.inputs,outputs:e.outputs,id:h,completionOutputs:e.completionOutputs,reactiveInputs:e.reactiveInputs,run:(p,v)=>{let g=[];const y=new a.DepGraph({}),b=new Map,I=new Map,C=new Map,x=new Map,w=new Map,_=new Map;let j;const N=new Set;m.forEach((e=>{const n=(0,s.getNode)(e,t),o=e.id;b.set(e,o),I.set(o,e),y.addNode(o);const i=Object.keys(n.inputs),r=Object.keys(n.outputs),a={},l={};i.forEach((t=>{const n=(e.inputConfig||{})[t]||(0,s.queueInputPinConfig)();(0,s.isStaticInputPinConfig)(n)?a[t]=(0,s.staticNodeInput)(n.value):a[t]=(0,s.dynamicNodeInput)({config:n})})),a[u.TRIGGER_PIN_ID]=(0,s.dynamicNodeInput)({config:(0,s.queueInputPinConfig)()});if(f.some((t=>(0,u.isInternalConnectionNode)(t.to)&&t.to.insId===e.id&&t.to.pinId===u.TRIGGER_PIN_ID))&&e.inputConfig&&e.inputConfig[u.TRIGGER_PIN_ID])throw"Trigger connection can not be configured";r.forEach((e=>{const t=(0,s.dynamicOutput)();l[e]=t}));f.some((t=>(0,u.isInternalConnectionNode)(t.from)&&t.from.insId===e.id&&t.from.pinId===u.ERROR_PIN_ID))&&(l[u.ERROR_PIN_ID]=(0,s.dynamicOutput)()),C.set(o,a),x.set(o,l)}));const O=new Set;return f.forEach((n=>{const{from:o,to:i}=n,{insId:r,pinId:a}=o,{insId:l,pinId:c}=i,d=x.get(r),p=C.get(l);if((0,u.isInternalConnectionNode)(i)&&O.add(`${i.insId}.${i.pinId}`),(0,u.isExternalConnection)(n)){if((0,u.isExternalConnectionNode)(o)){const e=null==p?void 0:p[i.pinId];if(!e)throw new Error(`Input ${i.pinId} of instance ${l} not found`);const t=w.get(o.pinId)||[];t.push(e),w.set(o.pinId,t)}else{let e=null==d?void 0:d[o.pinId];if(!e)throw new Error(`Output ${o.pinId} of instance ${r} not found`);const t=_.get(i.pinId)||[];t.push(e),_.set(i.pinId,t)}return}if(!d)throw new Error(`No outputs found for instance [${r}]`);if(!p)throw I.has(l)?new Error(`No inputs found for instance [${l}]`):new Error(`Instance with id [${l}] does not exist!`);const f=d[a];if(!f)throw new Error(`Output source - [${a}] not found in node [${h}]`);const m=p[c],v=I.get(r);if(!v&&r!==u.THIS_INS_ID)throw new Error(`Instance [${r}] does not exist! failed to connect [${o}] -> [${i}]`);const b=(v?(0,s.getNode)(v,t):e).outputs[a];if(b&&b.delayed||n.delayed||r!==u.THIS_INS_ID&&l!==u.THIS_INS_ID&&y.addDependency(r,l),!m)throw new Error(`Target arg - [${i}] not found in node [${h}]`);const j=f.subscribe((async e=>{if(!(0,s.isDynamicInput)(m))throw console.info(m),new Error(`Impossible state listening to non dynamic input - ${l}.${c}`);m.subject.next(e)}));g.push((()=>j.unsubscribe()))})),(0,a.okeys)(v).forEach((e=>{(_.get(e)||[]).forEach((t=>{const n=t.subscribe((async t=>{if(!v[e])throw new Error(`Impossible state - output ${e} does not exist`);v[e].next(t)}));g.push((()=>n.unsubscribe()))}))})),y.overallOrder().map((e=>I.get(e))).forEach((e=>{const a=C.get(e.id),u=x.get(e.id),p=(0,s.getNode)(e,t);if(!a)throw new Error(`Unexpected error - args not found when running ${e}`);if(!u)throw new Error(`Unexpected error - outputs not found when running ${e}`);for(const t in a){const n=e.inputConfig[t];O.has(`${e.id}.${t}`)||(0,s.isStaticInputPinConfig)(n)||delete a[t]}const f=(0,r.execute)({node:p,inputs:a,outputs:u,resolvedDeps:t,_debugger:n,insId:e.id,extraContext:d,mainState:i,ancestorsInsIds:o,onBubbleError:l,onCompleted:()=>{return t=e.id,N.delete(t),void(0===N.size&&j&&j());var t},onStarted:()=>{return t=e.id,void N.add(t);var t},env:c});g.push(f)})),Object.keys(p).forEach((async e=>{(w.get(e)||[]).forEach((t=>{const n=p[e];if(!(0,s.isDynamicInput)(t))throw new Error(`Unsure what to do with key ${e}, input: ${t} of ins ${o}`);(0,a.isDefined)(n)&&t.subject.next(n)}))})),void 0===e.completionOutputs&&N.size>0?new Promise((e=>{j=e})):()=>g.forEach((e=>{try{e()}catch(t){console.error("error unsubscribing",t)}}))}}}},26488:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MINOR_DEBUGGER_EVENT_TYPES=t.MAJOR_DEBUGGER_EVENT_TYPES=t.DebuggerEventType=void 0,function(e){e.INPUT_CHANGE="i",e.OUTPUT_CHANGE="o",e.PROCESSING_CHANGE="pc",e.ERROR="err",e.INPUTS_STATE_CHANGE="isc"}(n=t.DebuggerEventType||(t.DebuggerEventType={})),t.MAJOR_DEBUGGER_EVENT_TYPES=[n.INPUT_CHANGE,n.OUTPUT_CHANGE,n.ERROR],t.MINOR_DEBUGGER_EVENT_TYPES=[n.PROCESSING_CHANGE,n.INPUTS_STATE_CHANGE]},43686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatEvent=void 0;const o=n(26488);t.formatEvent=function(e){var t,n,i;const s=[e.insId,...null!==(n=null===(t=e.ancestorsInsIds)||void 0===t?void 0:t.split("."))&&void 0!==n?n:[]];(null===(i=e.ancestorsInsIds)||void 0===i?void 0:i.length)>0&&e.ancestorsInsIds;const r=`Node <${e.nodeId}> `,a=`(${s.join(" -> ")})`;return`${r} - ${function(e){switch(e.type){case o.DebuggerEventType.PROCESSING_CHANGE:return e.val?"started processing":"stopped processing";case o.DebuggerEventType.INPUT_CHANGE:return`Input pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.OUTPUT_CHANGE:return`Output pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.INPUTS_STATE_CHANGE:return`Inputs queue size changed to ${Object.entries(e.val).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join(", ")}`;case o.DebuggerEventType.ERROR:return`Error: ${e.val}`}}(e)} ${a}`}},99896:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26488),t),i(n(43686),t)},47025:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.GLOBAL_STATE_NS=t.ROOT_INS_ID=t.INPUTS_STATE_SUFFIX=t.INNER_STATE_SUFFIX=void 0;const s=n(62600),r=n(87794);i(n(99896),t);const a=n(30292),u=n(6775),l=n(84479),c=n(86873),d=n(23046),p=n(30292),f=n(99896),m=n(79804);t.INNER_STATE_SUFFIX="_inner",t.INPUTS_STATE_SUFFIX="_inputs";t.ROOT_INS_ID="__root",t.GLOBAL_STATE_NS="____global";t.execute=e=>{let{node:n,inputs:o,outputs:i,resolvedDeps:h,_debugger:v={},insId:g=t.ROOT_INS_ID,extraContext:y={},mainState:b={},ancestorsInsIds:I,onBubbleError:C=s.noop,env:x={},onCompleted:w=s.noop,onStarted:_=s.noop}=e;const j=[];b[t.GLOBAL_STATE_NS]||(b[t.GLOBAL_STATE_NS]=new Map);const N={...y,ENV:x},O=(0,m.customNodesToNodesCollection)(h,N),P=e=>{const t=e instanceof a.NodeInstanceError?e:new a.NodeInstanceError(e,(0,c.fullInsIdPath)(g,I),n.id);v.onEvent&&v.onEvent({type:f.DebuggerEventType.ERROR,val:t,insId:g,ancestorsInsIds:I,nodeId:n.id}),i[u.ERROR_PIN_ID]?i[u.ERROR_PIN_ID].next(t):C(t)},E=(e=>(0,a.isVisualNode)(e)?(0,u.connect)(e,O,v,(0,c.fullInsIdPath)(g,I),b,P,x,y):(0,a.isInlineValueNode)(e)?(0,m.inlineValueNodeToNode)(e,N):e)(n),S=v.onEvent||s.noop,T={},D={};(0,c.entries)(o).forEach((e=>{let[t,o]=e;if((0,a.isDynamicInput)(o)){const e=(0,a.dynamicNodeInput)({config:o.config}),i=o.subject.subscribe((async o=>{const i=S({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o,ancestorsInsIds:I,nodeId:n.id});if(i){const t=await i.valuePromise;e.subject.next(t)}else v.debugDelay&&await(0,c.delay)(v.debugDelay),e.subject.next(o)}));j.push((()=>i.unsubscribe())),D[t]=e}else{S({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o.config.value,ancestorsInsIds:I,nodeId:n.id});const e=(0,a.staticNodeInput)((0,a.getStaticValue)(o.config.value,O,g));D[t]=e}})),(0,c.entries)(i).forEach((e=>{let[t,o]=e;const i=(0,a.dynamicOutput)(),s=i.subscribe((async e=>{const i=S({type:f.DebuggerEventType.OUTPUT_CHANGE,insId:g,pinId:t,val:e,ancestorsInsIds:I,nodeId:n.id});if(i){const e=await i.valuePromise;o.next(e)}else o.next(e)}));j.push((()=>s.unsubscribe())),T[t]=i}));const M=(e=>{var n,o;const{node:i,inputs:u,outputs:m,resolvedDeps:h,_debugger:v,insId:g,ancestorsInsIds:y,mainState:b,onError:I,onStarted:C,onCompleted:x,env:w,extraContext:_}=e,{run:j,fn:N}=i,O=(0,d.debugLogger)("core"),P=[];let E;const S=(null==v?void 0:v.onEvent)||s.noop,T=(0,c.fullInsIdPath)(g,y),D=`${T}${t.INNER_STATE_SUFFIX}`,M=`${T}${t.INPUTS_STATE_SUFFIX}`,k=O.extend(T),R=b[t.GLOBAL_STATE_NS];b[D]||(b[D]=new Map),b[M]||(b[M]=new Map);let A=null!==(n=b[M])&&void 0!==n?n:new Map;const V=()=>{const e=Array.from(A.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:(0,a.isQueueInputPinConfig)(u[n].config)?null==o?void 0:o.length:1}}),{});S({type:f.DebuggerEventType.INPUTS_STATE_CHANGE,val:e,insId:g,ancestorsInsIds:y,nodeId:i.id})},L={execute:(e,n,o,i)=>(0,t.execute)({node:e,inputs:n,outputs:o,resolvedDeps:h,_debugger:v,insId:i,onCompleted:x,onStarted:C}),insId:g,state:null!==(o=b[D])&&void 0!==o?o:new Map,onCleanup:e=>{P.push(e)},onError:e=>{I(e)},context:null!=_?_:{},ancestorsInsIds:y,globalState:R};let z,$=!1;const H=(i.reactiveInputs||[]).filter((e=>{var t;return!(0,p.isStaticInputPinConfig)(null===(t=u[e])||void 0===t?void 0:t.config)})),q=()=>{var e;null===(e=b[D])||void 0===e||e.clear(),(0,c.keys)(b).filter((e=>e.startsWith(`${T}.`))).forEach((e=>{b[e]=new Map}))},F=e=>{const t=(null==e?void 0:e.key)&&H.includes(null==e?void 0:e.key);if($&&!t);else{const o=$&&t;if((0,l.isNodeStateValid)(u,A,i)||o){let t;if($){if(!e)throw new Error("Unexpected state, got reactive node while not processing and not valid");const n=(0,l.pullValueForExecution)(e.key,u[e.key],A,w);t={...z,[e.key]:n},V()}else t=(0,l.pullValuesForExecution)(u,A,w),z=t,V();let o=new Set,s={};if($=!0,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:$,insId:g,ancestorsInsIds:y,nodeId:i.id}),i.completionOutputs){const e=i.completionOutputs.map((e=>e.split("+"))).reduce(((e,t)=>(t.forEach((n=>{e.set(n,t)})),e)),new Map);(0,c.entries)(m).forEach((t=>{let[n,a]=t;a.pipe((0,r.first)()).subscribe((t=>{o.add(n),s[n]=t;let r=e.get(n);r&&(r.splice(r.indexOf(n),1),0===r.length&&($=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:$,insId:g,ancestorsInsIds:y,nodeId:i.id}),x&&x(s),q(),(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),E=void 0,o.clear(),s={},(0,l.hasNewSignificantValues)(u,A,w,i.id)&&F()))}))}))}else(0,c.entries)(m).forEach((e=>{let[t,n]=e;n.subscribe((e=>{s[t]=e}))}));try{k("Running node %s with values %o",i.id,t),C&&C(),E=(null!=N?N:j)(t,m,L),(0,c.isPromise)(E)?E.then((()=>{void 0===i.completionOutputs&&x&&($=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:$,insId:g,ancestorsInsIds:y,nodeId:i.id}),x(s),q(),(0,l.hasNewSignificantValues)(u,A,w,i.id)&&F())})).catch((e=>{I(e),$=!1,k("Error in node %s - value %e",i.id,e),S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:$,insId:g,ancestorsInsIds:y,nodeId:i.id})})):void 0===i.completionOutputs&&x&&($=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:$,insId:g,ancestorsInsIds:y,nodeId:i.id}),x(s),q())}catch(n){I(n),$=!1,k("Error in node %s - value %e",i.id,n),S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:$,insId:g,ancestorsInsIds:y,nodeId:i.id})}const d=H.find((e=>u[e]&&(0,l.peekValueForExecution)(e,u[e],A,w,i.id)));if(d){const e=(0,l.peekValueForExecution)(d,u[d],A,w,i.id);F({key:d,value:e})}else{const e=(0,c.entries)(u).find((e=>{let[t,n]=e;const o=(0,a.isQueueInputPinConfig)(n.config),s=(0,l.peekValueForExecution)(t,n,A,w,i.id);return!!o&&(0,c.isDefined)(s)}));if(e){const[t,n]=e,o=(0,l.peekValueForExecution)(t,n,A,w,i.id);F({key:t,value:o})}}}}};F();const G=(0,l.subscribeInputsToState)(u,A,((e,t)=>{O("Got input %s - value is [%o]",e,t),V();try{F({key:e,value:t})}catch(n){I(n)}}));return P.push(G),()=>{(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),P.forEach((e=>e()))}})({node:E,inputs:D,outputs:T,resolvedDeps:O,_debugger:v,insId:g,mainState:b,ancestorsInsIds:I,onError:P,onBubbleError:C,env:x,extraContext:y,onCompleted:w,onStarted:_});return()=>{j.forEach((e=>e())),M()}}},84479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeInputsToState=t.isNodeStateValid=t.hasNewSignificantValues=t.peekValuesForExecution=t.pullValuesForExecution=t.pullValueForExecution=t.peekValueForExecution=void 0;const o=n(30292),i=n(86873),s=n(6775),r=(e,t)=>{const n=(0,o.extractStaticValue)(e);if((0,o.isEnvValue)(n)){return((e,t)=>{const n=e.split(".");let o={...t};for(let s of n){if(!o||!(0,i.isDefined)(o[s])||null===o[s])throw new Error(`Cannot find key ${e} inside obj ${t}`);o=o[s]}return o})((0,o.getEnvKeyFromValue)(n),t)}return n};t.peekValueForExecution=(e,t,n,i,s)=>{const a=n.get(e);let u;if(!t)throw new Error(`Trying to peek value of inexsting input in key "${e}" in node "${s}"`);return u=(0,o.isStaticInput)(t)?r(t,i):(0,o.isQueueInputPinConfig)(t.config)?a?[...a].shift():void 0:a,u};t.pullValueForExecution=(e,t,n,i)=>{const s=n.get(e);let a;return(0,o.isStaticInput)(t)?a=r(t,i):(0,o.isQueueInputPinConfig)(t.config)?(a=(s||[]).shift(),n.set(e,s)):(a=s,(0,o.isStickyInputPinConfig)(t.config)||n.delete(e)),a};t.pullValuesForExecution=(e,n,o)=>(0,i.entries)(e).reduce(((e,i)=>{let[s,r]=i;return e[s]=(0,t.pullValueForExecution)(s,r,n,o),e}),{});t.peekValuesForExecution=(e,n,o,s)=>(0,i.entries)(e).reduce(((e,i)=>{let[r,a]=i;return e[r]=(0,t.peekValueForExecution)(r,a,n,o,s),e}),{});t.hasNewSignificantValues=(e,n,s,r)=>(0,i.entries)(e).some((e=>{let[a,u]=e;const l=(0,o.isQueueInputPinConfig)(u.config),c=(0,t.peekValueForExecution)(a,u,n,s,r);return(0,i.isDefined)(c)&&l}));t.isNodeStateValid=(e,t,n)=>{const r=(0,i.keys)(e),a=(0,i.keys)(n.inputs).filter((e=>{var t;const o=null===(t=n.inputs[e])||void 0===t?void 0:t.mode;return!o||"required"===o}));r.includes(s.TRIGGER_PIN_ID)&&a.push(s.TRIGGER_PIN_ID);return!!(0,i.containsAll)(r,a)&&(0,i.entries)(e).filter((e=>{let[t]=e;return!!n.inputs[t]||t===s.TRIGGER_PIN_ID})).every((e=>{let[s,r]=e;var a;const u=t.get(s);return"optional"===((null===(a=n.inputs[s])||void 0===a?void 0:a.mode)||"required")||(!!(0,o.isStaticInput)(r)||((0,o.isQueueInputPinConfig)(r.config)?(0,i.isDefined)(u)&&u.length>0:(0,i.isDefined)(u)))}))};t.subscribeInputsToState=(e,t,n)=>{const s=[];return(0,i.entries)(e).forEach((e=>{let[i,r]=e;if(!r)return;if((0,o.isStaticInput)(r))return;const a=r.subject.subscribe((e=>{if((0,o.isQueueInputPinConfig)(r.config)){const o=t.get(i)||[];if(!Array.isArray(o))throw new Error(`impossible state - state of key ${i} is set but not an array`);o.push(e),t.set(i,o),n(i,e)}else t.set(i,e),n(i,e)}));s.push((()=>a.unsubscribe()))})),()=>s.forEach((e=>e()))}},5474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flydeFlowSchema=void 0;const o=n(29022),i=o.z.record(o.z.string(),o.z.string().or(o.z.array(o.z.string()))),s=o.z.strictObject({x:o.z.number(),y:o.z.number()}),r=o.z.discriminatedUnion("mode",[o.z.strictObject({mode:o.z.literal("static"),value:o.z.any()}),o.z.strictObject({mode:o.z.literal("queue")}),o.z.strictObject({mode:o.z.literal("sticky")})]),a=o.z.object({size:o.z.optional(o.z.enum(["small","regular","large"])),icon:o.z.optional(o.z.any()),color:o.z.optional(o.z.string()),cssOverride:o.z.optional(o.z.record(o.z.string()))}),u=o.z.object({pos:s.default({x:0,y:0}),id:o.z.string(),inputConfig:o.z.optional(o.z.record(o.z.string(),r)).default({}),visibleInputs:o.z.optional(o.z.array(o.z.string())),visibleOutputs:o.z.optional(o.z.array(o.z.string())),nodeId:o.z.optional(o.z.string()),node:o.z.optional(o.z.any()),style:o.z.optional(a)}).refine((e=>e.node||e.nodeId),{message:"Instance must have either an inline node or refer to a nodeId"}),l=o.z.union([o.z.string(),o.z.object({mode:o.z.enum(["required","optional","required-if-connected"]),type:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),defaultValue:o.z.optional(o.z.any())})]),c=o.z.object({type:o.z.optional(o.z.string()),optional:o.z.optional(o.z.boolean()),delayed:o.z.optional(o.z.boolean()),description:o.z.optional(o.z.string())}),d=o.z.object({id:o.z.optional(o.z.string()),inputs:o.z.record(o.z.string(),l),outputs:o.z.record(o.z.string(),c),inputsPosition:o.z.optional(o.z.record(o.z.string(),s)),outputsPosition:o.z.optional(o.z.record(o.z.string(),s)),customViewCode:o.z.optional(o.z.string()),dataBuilderSource:o.z.optional(o.z.string()),templateType:o.z.optional(o.z.string()),completionOutputs:o.z.optional(o.z.array(o.z.string())),reactiveInputs:o.z.optional(o.z.array(o.z.string())),defaultStyle:o.z.optional(a),description:o.z.optional(o.z.string()),searchKeywords:o.z.optional(o.z.array(o.z.string()))}),p=o.z.object({instances:o.z.array(u),connections:o.z.array(o.z.strictObject({from:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),to:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),delayed:o.z.optional(o.z.boolean()),hidden:o.z.optional(o.z.boolean())}))}).and(d);t.flydeFlowSchema=o.z.strictObject({imports:o.z.optional(i).default({}),node:p})},74762:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticValueVisualNode=void 0,i(n(86873),t);const s=n(30292);i(n(6775),t),i(n(47025),t),i(n(10418),t),i(n(30292),t),i(n(3320),t),i(n(79804),t),i(n(5474),t);t.isStaticValueVisualNode=e=>!!e&&!!(0,s.maybeGetStaticValueNodeId)(`${e}`)},87093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fakeVm=t.VM=t.VMScript=void 0;const o=n(86873);class i{constructor(e){this.script=e}}t.VMScript=i;class s{constructor(e){this.context=e}run(e){const t=(0,o.okeys)(this.context.sandbox),n=Object.values(this.context.sandbox);Function(...t,e.script)(...n)}}t.VM=s,t.fakeVm={VMScript:i,VM:s}},28145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVM2Instance=void 0;const o=n(87093);t.getVM2Instance=()=>o.fakeVm},79804:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.customNodesToNodesCollection=t.inlineValueNodeToNode=void 0;const i=o(n(18706)),s=n(86873),r=n(30292),a=(0,n(28145).getVM2Instance)();t.inlineValueNodeToNode=function(e,t){void 0===t&&(t={});const{runFnRawCode:n,...o}=e,u=(0,s.debugLogger)(`code-node:${e.id}`),l=`\n try {\n ${n}\n } catch (e) {\n adv.onError(e);\n }\n `,c=new a.VMScript(l),d={...o,run:(n,o,l)=>{const d=new a.VM({sandbox:{inputs:n,outputs:o,setInterval:setInterval,clearInterval:clearInterval,setTimeout:setTimeout,clearTimeout:clearTimeout,encodeURIComponent:encodeURIComponent,adv:l,log:function(){for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeWithDependencies=void 0;const o=n(30292),i=n(74762),s=n(88270);t.getNodeWithDependencies=function(e,n,r){if(void 0===r&&(r=[]),(0,o.isInlineValueNode)(e))return[e];if(r.includes(e.id))return[];const a=(0,i.removeDupes)(e.instances.filter((e=>(0,s.isRefNodeInstance)(e))).map((e=>e.nodeId)).filter((e=>n[e])));return[e,...a.flatMap((e=>{var t;return null!==(t=n[e])&&void 0!==t?t:[]})).reduce(((e,o)=>[...e,...(0,t.getNodeWithDependencies)(o,n,[...r,...a])]),[])]}},30292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88270),t),i(n(43069),t),i(n(79426),t),i(n(44535),t),i(n(18063),t),i(n(20359),t)},18063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeInstanceError=void 0;class n extends Error{constructor(e,t,n){let o="Unknown error";o="string"==typeof e?e:e instanceof Error?e.message:null!==e&&"object"==typeof e?JSON.stringify(e):String(e),super(`${o} (insId: ${t}, nodeId: ${n})`),this.name=this.constructor.name,this.message=`${o} (insId: ${t}, nodeId: ${n})`,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.fullInsIdsPath=t,this.nodeId=n}}t.NodeInstanceError=n},88270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInsId=t.NodeInstance=t.isRefNodeInstance=t.isInlineNodeInstance=t.inlineNodeInstance=t.nodeInstance=void 0;const o=n(36618);t.nodeInstance=(e,t,n,o)=>({id:e,nodeId:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.inlineNodeInstance=(e,t,n,o)=>({id:e,node:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.isInlineNodeInstance=e=>!!e.node;t.isRefNodeInstance=e=>!(0,t.isInlineNodeInstance)(e);t.NodeInstance=(e,t,n,o)=>({id:e,nodeId:t.id,inputConfig:n||{},pos:o||{x:0,y:0}});t.createInsId=e=>`${e.id}-${(0,o.slug)()}`},43069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvKeyFromValue=t.toEnvValue=t.isEnvValue=t.extractStaticValue=t.isStaticInput=t.isDynamicInput=t.staticNodeInput=t.dynamicNodeInputs=t.dynamicNodeInput=t.dynamicOutput=t.nodeOutputs=t.nodeOutput=t.nodeInputs=t.isInputPinOptional=t.nodeInput=void 0;const o=n(62600),i=n(30292),s=n(86873),r=n(79426);t.nodeInput=function(e){return void 0===e&&(e="required"),{mode:e}};t.isInputPinOptional=e=>"optional"===e.mode;t.nodeInputs=(e,n)=>(0,s.repeat)(e,(e=>(0,t.nodeInput)((null==n?void 0:n[e])||"required")));t.nodeOutput=function(e){return void 0===e&&(e=!1),{delayed:e}};t.nodeOutputs=e=>(0,s.repeat)(e,(()=>(0,t.nodeOutput)()));t.dynamicOutput=()=>new o.Subject,t.dynamicNodeInput=(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})));t.dynamicNodeInputs=function(e){return void 0===e&&(e=10),(0,s.repeat)(e,(()=>(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})))()))};t.staticNodeInput=e=>({config:(0,r.staticInputPinConfig)(e)});t.isDynamicInput=e=>{const t=e;return t&&t.subject&&!!t.subject.next};t.isStaticInput=e=>(0,i.isStaticInputPinConfig)(null==e?void 0:e.config);t.extractStaticValue=e=>{if((0,t.isStaticInput)(e))return e.config.value;throw new Error("Cannot extract static value from non static arg")};t.isEnvValue=e=>"string"==typeof e&&e.startsWith("$ENV.");t.toEnvValue=e=>`$ENV.${e}`;t.getEnvKeyFromValue=e=>"string"==typeof e?e.replace(/^\$ENV\./,""):e},20359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeFromFunction=t.getNodeDef=t.getNode=t.getStaticValue=t.maybeGetStaticValueNodeId=t.fromSimplified=t.inlineValueNode=t.codeNode=t.visualNode=t.isInlineValueNode=t.isVisualNode=t.isCodeNode=t.isBaseNode=t.InlineValueNodeType=void 0;const o=n(86873),i=n(88270),s=n(43069);!function(e){e.VALUE="value",e.FUNCTION="function"}(t.InlineValueNodeType||(t.InlineValueNodeType={}));t.isBaseNode=e=>e&&e.id&&e.inputs&&e.outputs;t.isCodeNode=e=>(0,t.isBaseNode)(e)&&"function"==typeof e.run;t.isVisualNode=e=>!!e.instances;t.isInlineValueNode=e=>(0,o.isDefined)(e)&&(0,o.isDefined)(e.runFnRawCode),t.visualNode=(0,o.testDataCreator)({id:"visual-node",inputs:{},outputs:{},instances:[],connections:[],outputsPosition:{},inputsPosition:{}}),t.codeNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},run:o.noop}),t.inlineValueNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},runFnRawCode:""});t.fromSimplified=e=>{let{run:t,inputTypes:n,outputTypes:i,id:s}=e;return{id:s,inputs:(0,o.entries)(n).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),outputs:(0,o.entries)(i).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),run:t}};t.maybeGetStaticValueNodeId=e=>{const t="string"==typeof e&&e.match(/^__node\:(.*)/);if(t){return t[1]}return null};t.getStaticValue=(e,n,o)=>{const i=(0,t.maybeGetStaticValueNodeId)(e);if(i){const e=n[i];if(!e)throw new Error(`Instance ${o} referrer to a node reference ${i} that does not exist`);return e}return e};t.getNode=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw new Error(`Node with id ${n} not found`);return o};t.getNodeDef=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw console.error(`Node with id ${n} not found`),new Error(`Node with id ${n} not found`);return o};t.codeFromFunction=e=>{let{id:t,fn:n,inputNames:o,outputName:i,defaultStyle:r}=e;return{id:t,inputs:o.reduce(((e,t)=>({...e,[t]:(0,s.nodeInput)()})),{}),outputs:{[i]:(0,s.nodeOutput)()},run:(e,t)=>{const s=o.map((t=>e[t])),r=t[i],a=n(...s);return Promise.resolve(a).then((e=>null==r?void 0:r.next(e)))},completionOutputs:[i],defaultStyle:r}}},44535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nodeFromSimpleFunction=void 0,t.nodeFromSimpleFunction=function(e){var t;return{...e,id:e.id,description:e.description,namespace:e.namespace,inputs:e.inputs?e.inputs.reduce(((e,t)=>{let{name:n,description:o,mode:i,defaultValue:s}=t;return{...e,[n]:{description:o,mode:null!=i?i:"required",defaultValue:s}}}),{}):{},outputs:e.output?{[e.output.name]:{description:e.output.description}}:{},defaultStyle:{icon:e.icon,size:e.size},run:null!==(t=e.fullRunFn)&&void 0!==t?t:async function(t,n,o){var i,s;const r=(null!==(i=e.inputs)&&void 0!==i?i:[]).map((e=>{let{name:n}=e;return t[n]}));try{const t=await Promise.resolve(e.run(...r));e.output&&(null===(s=n[e.output.name])||void 0===s||s.next(t))}catch(a){console.error("Error in node",a),o.onError(a)}},customViewCode:e.customViewCode}}},79426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticInputPinConfig=t.isStickyInputPinConfig=t.isQueueInputPinConfig=t.staticInputPinConfig=t.stickyInputPinConfig=t.queueInputPinConfig=t.INPUT_MODES=void 0,t.INPUT_MODES=["queue","sticky","static"];t.queueInputPinConfig=()=>({mode:"queue"});t.stickyInputPinConfig=()=>({mode:"sticky"});t.staticInputPinConfig=e=>({mode:"static",value:e});t.isQueueInputPinConfig=e=>"queue"===e.mode;t.isStickyInputPinConfig=e=>!!e&&"sticky"===e.mode,t.isStaticInputPinConfig=function(e){return!!e&&"static"===e.mode}},10418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedExecute=void 0;const o=n(74762),i=n(47025);t.simplifiedExecute=function(e,t,n,s,r){void 0===r&&(r={});const a=(0,o.keys)(e.outputs),u=Object.keys(n).reduce(((e,t)=>{const i=n[t];return{...e,[t]:(0,o.isDynamicInput)(i)?i:(0,o.staticNodeInput)(i)}}),{}),l=a.reduce(((e,t)=>{const n=(0,o.dynamicOutput)();return s&&n.subscribe((e=>{s(t,e)})),{...e,[t]:n}}),{});return(0,i.execute)({node:e,inputs:u,outputs:l,resolvedDeps:t,onBubbleError:e=>{throw e},...r})}},25779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodePreview=void 0;const o=n(35250),i=n(74762),s=n(86553);t.NodePreview=e=>{let{node:t}=e;const n={node:t,instance:(0,i.nodeInstance)("bob",t.id,{}),connections:[],viewPort:{pos:{x:0,y:0},zoom:1},resolvedDeps:{},connectionsPerInput:{},onUngroup:i.noop,onDblClick:i.noop,onDragEnd:i.noop,onDragMove:i.noop,onDragStart:i.noop,onPinClick:i.noop,onPinDblClick:i.noop,onSelect:i.noop,onTogglePinBreakpoint:i.noop,onTogglePinLog:i.noop,onToggleSticky:i.noop,displayMode:!0,onInspectPin:i.noop,onDetachConstValue:i.noop,onCopyConstValue:i.noop,onPasteConstValue:i.noop,ancestorsInsIds:"",onChangeVisibleInputs:i.noop,onChangeVisibleOutputs:i.noop,onConvertConstToEnv:i.noop,forceShowMinimized:"both",onExtractInlineNode:i.noop,onCloseInlineEditor:i.noop,isConnectedInstanceSelected:!1,inlineEditorPortalDomNode:null,onChangeStyle:i.noop,onDeleteInstance:i.noop,onGroupSelected:i.noop,onSetDisplayName:i.noop,hadError:!1,queuedInputsData:{},onPinMouseDown:i.noop,onPinMouseUp:i.noop};return(0,o.jsx)("div",{className:"node-preview",children:(0,o.jsx)(s.InstanceView,{...n})})}},30653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDarkMode=t.DarkModeProvider=void 0;const o=n(70079),i=(0,o.createContext)(!0);t.DarkModeProvider=i.Provider;t.useDarkMode=()=>(0,o.useContext)(i)},29183:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataInspectionModal=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=n(74089),p=n(83938),f=n(17102),m=n(98158);t.DataInspectionModal=e=>{var t;const{onRequestHistory:n}=(0,m.useDebuggerContext)(),{item:o}=e,[i,s]=c.default.useState(),[r,h]=c.default.useState(0),[v,g]=c.default.useState(""),[y,b]=c.default.useState(),[I]=(0,d.useDebounce)(v,300);(0,c.useEffect)((()=>{b(null==i?void 0:i.lastSamples.filter((e=>"object"==typeof e.val?JSON.stringify(e.val).includes(I):e.val.toString().includes(I)))),h(0)}),[null==i?void 0:i.lastSamples,I]),c.default.useEffect((()=>{!async function(){var e,t;const i=await n(o.insId,null===(e=o.pin)||void 0===e?void 0:e.id,null===(t=o.pin)||void 0===t?void 0:t.type);s(i)}()}),[o,n]);const C=e=>{const t=e.val;return"object"==typeof t?(0,a.jsx)(p.BrowserOnlyReactJson,{src:t}):(0,a.jsx)(u.Code,{children:t.toString()})},x=`"${o.insId}" ${(null===(t=o.pin)||void 0===t?void 0:t.id)?`(${o.pin.id})`:""}`;return(0,a.jsx)(u.Dialog,{isOpen:!0,title:`Inspecting data for instance ${x}`,onClose:e.onClose,canEscapeKeyClose:!1,className:"data-inspection-modal",children:(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{children:[i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("em",{children:[x," called ",i.total," time(s)"]}),i.total>10&&(0,a.jsx)("span",{children:"Showing last 10 samples"})]}):null,(0,a.jsx)("input",{className:"bp5-input bp5-small bp5-fill",type:"search",placeholder:"Search for values",dir:"auto",onChange:e=>g(e.target.value),value:v}),I.length>0&&(0,a.jsxs)("span",{children:["Showing ",null==y?void 0:y.length," of ",i.lastSamples.length," ",'samples matching query "',I,'"']})]}),(0,a.jsx)("main",{className:"main-wrapper",children:(()=>{if(!i)return(0,a.jsx)(f.Loader,{});if(0===i.total)return(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",(0,a.jsx)("em",{children:o.insId})," ",o.pin?(0,a.jsxs)(c.default.Fragment,{children:["and pin ",(0,a.jsx)("em",{children:o.pin.id})]}):null,". Make sure debugger is running and your program was triggered."]});const e=null==y?void 0:y[r];return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Card,{className:"content-wrapper",children:[e?(0,a.jsxs)("div",{className:"info",children:[(0,a.jsxs)("div",{children:["Showing sample ",r," of event from"," ",(0,a.jsx)("strong",{children:(0,d.timeAgo)(e.time)})," (",new Date(e.time).toLocaleString(),")"]}),(0,a.jsxs)("div",{children:["Instance: ",(0,a.jsx)("strong",{children:e.insId}),", Pin id:"," ",(0,a.jsx)("strong",{children:e.pinId})," "]}),(0,a.jsx)("div",{children:"Value:"})]}):null,C(e)]}),(0,a.jsx)(u.Menu,{className:"samples-menu",children:y.map(((e,t)=>{const n=e.pinId,o=`${i.total-t}. from pin "${n}"`;return(0,a.jsx)(u.MenuItem,{text:o,onClick:()=>h(t)},t)}))})]}):i.lastSamples.length>0&&v.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",children:['No data found for search query "',v,'"']}):(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",o.insId," ",o.pin?`and ${o.pin.id}`:"",". Make sure a debugger is connected and your program was triggered."]})})()})]})})})}},40471:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29183),t)},98158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebuggerContext=t.DebuggerContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({onRequestHistory:()=>Promise.reject(new Error("Not implemented"))});t.DebuggerContextProvider=i.Provider;t.useDebuggerContext=()=>(0,o.useContext)(i)},86125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDependenciesContext=t.DependenciesContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({resolvedDependencies:{},onImportNode:()=>Promise.reject(new Error("Not implemented")),onRequestImportables:()=>Promise.reject(new Error("Not implemented"))});t.DependenciesContextProvider=i.Provider;t.useDependenciesContext=()=>(0,o.useContext)(i)},97106:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FlowEditor=void 0;const u=n(35250),l=s(n(70079)),c=n(74762),d=n(63521),p=a(n(53865)),f=n(68120),m=n(7047),h=n(84472),v=n(82232),g=n(49283),y=n(43490),b=n(68840),I=n(78087),C=n(20079),x=n(60190),w=n(40471),_=n(98158),j=n(86125),N=n(30653),O=n(77852);r(n(43490),t),r(n(98158),t),r(n(86125),t),b.library.add(I.fab,C.fas);const P=["select","drag-move","order-step"];t.FlowEditor=l.memo(l.forwardRef(((e,t)=>{const{state:n,onChangeEditorState:o}=e,{resolvedDependencies:i,onImportNode:s}=(0,j.useDependenciesContext)(),[r,a]=l.useState([]),[b,I]=l.useState([]),{flow:C,boardData:E}=n,S=n.flow.node,[T,D]=l.useState({}),[M,k]=l.useState(new Set),{debuggerClient:R}=(0,_.useDebuggerContext)();l.useEffect((()=>{if(R)return R.onBatchedEvents((e=>{e.forEach((e=>{e.type===c.DebuggerEventType.INPUTS_STATE_CHANGE&&(console.log("INPUTS_STATE_CHANGE",e.insId,e.val),D((t=>({...t,[e.insId]:e.val})))),e.type===c.DebuggerEventType.ERROR&&k((t=>{const n=new Set(t);return n.add(e.insId),n}))}))}))}),[R]);const{openFile:A,reportEvent:V}=(0,y.usePorts)(),L=l.useCallback(((e,t)=>{console.info("onChangeFlow",t.type),"functional"===t.type&&(a([{flow:{...n.flow,...e}},...r.slice(0,50)]),I([])),o((t=>({...t,flow:{...t.flow,...e}})))}),[o,n.flow,r]),[z,$]=l.useState({instances:[],connections:[]}),[H,q]=l.useState(!1),F=l.useCallback((()=>q(!1)),[]),G=l.useCallback((()=>q(!0)),[]),U=l.useCallback((e=>{o((t=>({...t,boardData:{...t.boardData,...e}})))}),[o]);l.useEffect((()=>{U({selected:[],viewPort:d.defaultViewPort,from:void 0,to:void 0,lastMousePos:{x:0,y:0}})}),[S.id]),(0,f.useHotkeys)("cmd+z",(e=>{I([...b,n]);const[t,...i]=r;t&&(o((e=>({...e,...t}))),a(i)),e.preventDefault()}),{text:"Undo last change",group:"Editing"},[n,r,b]);const B=l.useCallback(((e,t)=>{P.some((e=>t.message.includes(e)))||I([]),L({node:e},t)}),[L]),W=l.useCallback((e=>{A({absPath:e.source.path})}),[A]),Z=l.useCallback((function(e,t){void 0===t&&(t=-1*d.NODE_HEIGHT*1.5);const n=(0,m.createNewNodeInstance)(e,t,E.lastMousePos,i);if(n){const e=(0,p.default)(C,(e=>{const t=e.node;if(!(0,c.isVisualNode)(t))throw new Error("Impossible state, adding node to non visual node");t.instances.push(n)}));return L(e,(0,v.functionalChange)("add-node")),F(),n}}),[E.lastMousePos,C,L,F,i]),J=l.useCallback((async e=>{switch(e.type){case g.OmniBarCmdType.ADD:return V("addNode",{nodeId:e.data,source:"omnibar"}),Z(e.data);case g.OmniBarCmdType.ADD_VALUE:{const e=t.current;null==e||e.requestNewInlineValue();break}case g.OmniBarCmdType.IMPORT:{await s(e.data,{pos:E.lastMousePos});const t=(0,x.vAdd)({x:0,y:0},E.lastMousePos),n=(0,m.createNewNodeInstance)(e.data.node,0,t,i),o=(0,p.default)(C,(e=>{e.node.instances.push(n)}));L(o,(0,v.functionalChange)("add-imported-node")),V("addNode",{nodeId:e.data.node.id,source:"omnibar"});break}default:h.AppToaster.show({intent:"warning",message:"Not supported yet"})}F()}),[F,V,Z,t,s,E.lastMousePos,i,C,L]),[Y,K]=l.useState(),Q=l.useCallback((()=>K(void 0)),[]),X=l.useCallback(((e,t)=>{K({insId:e,pin:t})}),[]),{isDarkMode:ee}=(0,O.useDarkMode)();return(0,u.jsx)("div",{className:"flyde-flow-editor",children:(()=>{var n;if((0,c.isInlineValueNode)(S))throw new Error("Impossible state");return(0,u.jsx)(N.DarkModeProvider,{value:null!==(n=e.darkMode)&&void 0!==n?n:ee,children:(0,u.jsxs)(l.Fragment,{children:[Y?(0,u.jsx)(w.DataInspectionModal,{item:Y,onClose:Q}):null,(0,u.jsx)(d.VisualNodeEditor,{currentInsId:c.ROOT_INS_ID,ref:t,boardData:E,onChangeBoardData:U,node:S,onGoToNodeDef:W,onChangeNode:B,resolvedDependencies:i,clipboardData:z,onCopy:$,nodeIoEditable:!S.id.startsWith("Trigger"),onInspectPin:X,onShowOmnibar:G,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:T,initialPadding:e.initialPadding,instancesWithErrors:M,disableScrolling:e.disableScrolling},S.id),H?(0,u.jsx)(g.Omnibar,{flow:C,resolvedNodes:i,onCommand:J,visible:H,onClose:F}):null]})})})()})})))},9001:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeEditor=t.renderCreateIOOption=void 0;const i=n(35250),s=o(n(70079)),r=n(74762),a=n(50382),u=o(n(53865)),l=n(70457),c=n(25779);t.renderCreateIOOption=(e,t,n)=>(0,i.jsx)(a.MenuItem,{icon:"add",text:`Create "${e}"`,active:t,onClick:n,shouldDismissPopover:!1});const d=l.MultiSelect.ofType();t.BaseNodeEditor=e=>{var n,o;const{node:l,onChange:p}=e,f=(0,r.entries)(l.inputs),m=f.filter((e=>{let[,t]=e;return"required"===t.mode})).map((e=>{let[t]=e;return t})),h=f.filter((e=>{let[,t]=e;return"optional"===t.mode})).map((e=>{let[t]=e;return t})),v=f.filter((e=>{let[,t]=e;return"required-if-connected"===t.mode})).map((e=>{let[t]=e;return t})),[g,y]=s.default.useState(!1),b=(0,r.okeys)(l.outputs),I=s.default.useCallback((e=>{p({...l,id:e})}),[l,p]),C=s.default.useCallback((e=>{let t=e?e.split(","):void 0;"[]"===e&&(t=[]),p({...l,completionOutputs:t})}),[l,p]),x=s.default.useCallback((e=>{let t=e?e.split(","):void 0;p({...l,reactiveInputs:t})}),[l,p]),w=s.default.useCallback(((e,t)=>{const n=(0,u.default)(l,(n=>{n.inputs[e]=(0,r.nodeInput)(t)}));p(n)}),[l,p]),_=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.inputs[e]}));p(t)}),[l,p]),j=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{t.outputs[e]=(0,r.nodeOutput)()}));p(t)}),[l,p]),N=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.outputs[e]}));p(t)}),[l,p]);return(0,i.jsxs)("div",{className:"base-node-editor",children:[(0,i.jsx)("div",{className:"form-row",children:(0,i.jsx)(a.FormGroup,{label:"Node Name",labelFor:"text-input",labelInfo:"(required)",children:(0,i.jsx)(a.InputGroup,{id:"node-name",disabled:e.idDisabled,placeholder:"Node ID",value:l.id,onChange:e=>I(e.target.value)})})}),(0,i.jsx)(a.FormGroup,{label:"Required Inputs",children:(0,i.jsx)(d,{selectedItems:m,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>w(e,"required"),onRemove:_,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),!0!==e.hiddenOutputs?(0,i.jsx)(a.FormGroup,{label:"Outputs",children:(0,i.jsx)(d,{selectedItems:b,placeholder:"Enter output names here",items:[],tagRenderer:e=>e,onItemSelect:j,onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}):null,(0,i.jsx)(a.Checkbox,{checked:g,onChange:e=>y(e.target.checked),children:"Show advanced options"}),(0,i.jsxs)(a.Collapse,{isOpen:g,children:[(0,i.jsx)(a.FormGroup,{label:"Optional Inputs",children:(0,i.jsx)(d,{selectedItems:h,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>w(e,"optional"),onRemove:_,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Required-if-connected Inputs",children:(0,i.jsx)(d,{selectedItems:v,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>w(e,"required-if-connected"),onRemove:_,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Completion Outputs",children:(0,i.jsx)(a.InputGroup,{id:"completion-outputs",placeholder:"completion outputs",value:(null===(n=l.completionOutputs)||void 0===n?void 0:n.join(","))||"",onChange:e=>C(e.target.value)})}),(0,i.jsx)(a.FormGroup,{label:"Reactive Inputs",children:(0,i.jsx)(a.InputGroup,{id:"reactive-inputs",placeholder:"Reactive inputs",value:(null===(o=l.reactiveInputs)||void 0===o?void 0:o.join(","))||"",onChange:e=>x(e.target.value)})})]}),(0,i.jsx)(a.FormGroup,{label:"Preview",children:(0,i.jsx)("div",{className:"preview-wrapper",children:(0,i.jsx)(c.NodePreview,{node:l})})})]})}},82232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metaChange=t.functionalChange=void 0;t.functionalChange=e=>({type:"functional",message:e});t.metaChange=function(e){return void 0===e&&(e="n/a"),{type:"meta",message:e}}},41032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safelyGetNodeDef=t.loadingDef=void 0;const o=n(74762);t.loadingDef={id:"Loading",inputs:{},outputs:{}};t.safelyGetNodeDef=(e,n)=>{try{return(0,o.getNodeDef)(e,n)}catch(i){const n="string"==typeof e?e:e.nodeId;return{...t.loadingDef,id:n}}}},72125:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCodeModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(68371),f=n(74762),m=n(31745),h="`Result is ${inputs.a + inputs.b}`";t.InlineCodeModal=u.memo((function(e){const{initialValue:t,initialType:n}=e,[o,i]=u.useState((0,f.isDefined)(t)?t:h),[s,r]=u.useState(n||f.InlineValueNodeType.VALUE),v=(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:['You can add variables to by referrencing the "inputs" object.',(0,a.jsx)("br",{})," For example:",(0,a.jsx)(c.Code,{children:"`Hello {inputs.name}`"}),' will expose an input pin named "name"']}),(0,a.jsxs)("p",{children:["You can also use ternery expressions, arithmetic operators and more!",(0,a.jsx)("br",{}),"For example:",(0,a.jsx)(c.Code,{children:"inputs.a > inputs.b ? inputs.a + 42 : Math.random() * inputs.b"})]})]}),g=(0,a.jsxs)("span",{children:["Type in any valid JS value, such as ",(0,a.jsx)(c.Code,{children:"true"}),", ",(0,a.jsx)(c.Code,{children:"42"}),","," ",(0,a.jsx)(c.Code,{children:'["bob", "alice", "dave"]'}),".",(0,a.jsx)("br",{})," Dynamic inputs may also be used"]}),y=(0,a.jsxs)("span",{children:["Write any JS code and return a value.",(0,a.jsx)("br",{})," The returned value will be the output.",(0,a.jsx)("br",{})," Example:",(0,a.jsx)(c.Code,{children:"const a = inputs.a; const b = inputs.b; return Math.floor(a/b);"})]}),b=(0,p.getVariables)(o);return u.useEffect((()=>{o===h&&s===f.InlineValueNodeType.FUNCTION&&i(`return ${h}`),o===`return ${h}`&&s===f.InlineValueNodeType.VALUE&&i(h)}),[o,s]),(0,a.jsxs)(c.Dialog,{isOpen:!0,title:"Inline Value / Code",onClose:e.onCancel,className:"inline-code-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:t=>{"Enter"===t.key&&t.metaKey&&e.onSubmit(s,o)},tabIndex:0,children:[(0,a.jsxs)(c.RadioGroup,{inline:!0,onChange:e=>r(e.target.value),selectedValue:s,children:[(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Value ",(0,a.jsx)(m.InfoTooltip,{content:g})]}),value:f.InlineValueNodeType.VALUE}),(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Function ",(0,a.jsx)(m.InfoTooltip,{content:y})]}),value:f.InlineValueNodeType.FUNCTION})]}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"javascript",value:o,onChange:e=>i(e||""),onMount:e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})}}),(()=>{const e=o.includes("return");return e&&s===f.InlineValueNodeType.VALUE?(0,a.jsx)(c.Callout,{intent:c.Intent.WARNING,children:'When using the "value" type you are not expected to return anything'}):e||s!==f.InlineValueNodeType.FUNCTION?null:(0,a.jsxs)(c.Callout,{intent:c.Intent.DANGER,children:['When using the "function" type you are expected to'," ",(0,a.jsx)(c.Code,{children:"return"})," a value.",(0,a.jsx)("br",{}),"Example: ",(0,a.jsx)(c.Code,{children:"return 42 + Date.now();"})]})})(),(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Input pins detected:"," ",b.length?b.map((e=>(0,a.jsx)(c.Code,{children:e},e))):"None",(0,a.jsx)(m.InfoTooltip,{content:v})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:e.onCancel,children:"Cancel"}),(0,a.jsx)(c.Button,{onClick:()=>e.onSubmit(s,o),intent:c.Intent.PRIMARY,className:"save-btn",children:"Save"})]})})]})}))},18594:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(72125),t)},68371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInlineValueNode=t.getVariables=void 0;const o=n(74762),i=n(74762);t.getVariables=e=>(e.match(/inputs\.([a-zA-Z]\w*)/g)||[]).map((e=>e.replace(/inputs\./,"")));t.createInlineValueNode=e=>{let{code:n,customView:s,nodeId:r,type:a}=e;const u=(0,t.getVariables)(n).reduce(((e,t)=>({...e,[t]:(0,o.nodeInput)()})),{}),l={value:(0,o.nodeOutput)()},c=a===o.InlineValueNodeType.FUNCTION?`const result = (function() { ${n}}());\n Promise.resolve(result).then(val => outputs.value.next(val))`:`const result = (${n}); Promise.resolve(result).then(val => outputs.value.next(val))`,d=btoa(n);return(0,i.inlineValueNode)({id:r||`Inline Code ${(0,o.randomInt)(99999)}`,inputs:u,outputs:l,runFnRawCode:c,customViewCode:s||n,dataBuilderSource:d,templateType:a,completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline "+(a===o.InlineValueNodeType.VALUE?"value":"function")})}},49283:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Omnibar=t.OmniBarCmdType=void 0;const a=n(35250),u=s(n(70079)),l=n(70457),c=n(74762),d=n(50382),p=r(n(26372));var f;!function(e){e.ADD="add",e.ADD_VALUE="add-value",e.IMPORT="import"}(f=t.OmniBarCmdType||(t.OmniBarCmdType={}));const m=[];t.Omnibar=e=>{const{resolvedNodes:t}=e,[n,o]=u.useState(""),[i,s]=u.useState(null),[r,h]=u.useState([]);u.useEffect((()=>{const e=(0,c.keys)(t).map((e=>({title:`${t[e].id}`,cmd:{type:f.ADD,data:e},extra:"current flow"}))),n=r.map((e=>({title:`${e.node.id}`,description:e.node.description,cmd:{type:f.IMPORT,data:e},extra:`${e.module}`}))),o={title:"Add inline value or code",suggestOnEmpty:!0,cmd:{type:f.ADD_VALUE}},i=[...m,...n,o,...e];s(i)}),[t,r]),u.useEffect((()=>{e.onRequestImportables&&e.onRequestImportables(n).then((e=>{h(e)}))}),[e,n]);const v=u.useCallback(((e,t)=>{let{handleClick:n,modifiers:o,query:i,index:s}=t;if(!o.matchesPredicate)return null;const r=`${e.title}`;return(0,a.jsx)(d.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,a.jsxs)("div",{className:(0,p.default)("omnibar-item",{active:o.active}),children:[(0,a.jsxs)("div",{className:"title",children:[r," ",e.extra?(0,a.jsx)("span",{className:"extra",children:e.extra}):null]}),e.description?(0,a.jsx)("div",{className:"description",children:e.description}):null]})},s)}),[]),g=u.useCallback(((e,t)=>{const n=e.toLowerCase().split("").map((e=>{return`${t=e,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*`;var t})).join(""),o=new RegExp(n);return!!t.title.toLowerCase().match(o)}),[]),y=u.useCallback((t=>{e.onCommand(t.cmd),e.onClose()}),[e]);return i?(0,a.jsx)(l.Omnibar,{query:n,onQueryChange:o,onClose:e.onClose,noResults:(0,a.jsx)(d.MenuItem,{disabled:!0,text:"No results."}),itemPredicate:g,isOpen:e.visible,items:i,initialContent:void 0,onItemSelect:y,itemRenderer:v,inputProps:{placeholder:"Search for nodes or commands.."}}):null}},60698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43490:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31874),t)},31874:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.usePorts=t.useConfirm=t.usePrompt=t.PortsContext=t.defaultPorts=void 0;const s=n(70079),r=n(74762),a=n(84472);i(n(60698),t);const u=e=>async()=>{console.warn(`${e} Not implemented`),(0,a.toastMsg)("Feature not implemented in this context yet","warning")};t.defaultPorts={prompt:async e=>{let{text:t,defaultValue:n}=e;return prompt(`${t}`,n)},openFile:async e=>{},confirm:async e=>{let{text:t}=e;return confirm(t)},readFlow:u("readFlow"),setFlow:u("setFlow"),resolveDeps:u("resolveDeps"),getImportables:u("getImportables"),onExternalFlowChange:u("onExternalFlowChange"),onInstallRuntimeRequest:u("onInstallRuntimeRequest"),onRunFlow:u("onRunFlow"),onStopFlow:u("onStopFlow"),reportEvent:r.noop,generateNodeFromPrompt:u("generateNodeFromPrompt"),hasOpenAiToken:()=>Promise.resolve(!1)},t.PortsContext=(0,s.createContext)(t.defaultPorts);t.usePrompt=()=>{const e=(0,s.useContext)(t.PortsContext).prompt;return(t,n)=>e({text:t,defaultValue:n})};t.useConfirm=()=>{const e=(0,s.useContext)(t.PortsContext).confirm;return t=>e({text:t})};t.usePorts=()=>(0,s.useContext)(t.PortsContext)},65758:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelected=void 0;const i=n(74762),s=o(n(53865)),r=n(22513);t.groupSelected=async(e,t,n,o,a)=>{const{instances:u,connections:l}=t,c=u.filter((t=>e.includes(t.id))),d=l.filter((t=>{let{from:n,to:o}=t;return-1!==e.indexOf(n.insId)||-1!==e.indexOf(o.insId)}));if(!c.length)throw new Error("visual without selections");const{visualNode:p,renamedInputs:f,renamedOutputs:m}=await(0,r.createGroup)(c,d,n,a),h=c.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),u[0].pos),v="ref"===o?(0,i.nodeInstance)((0,i.createInsId)(p),p.id,{},h):(0,i.inlineNodeInstance)((0,i.createInsId)(p),p,{},h),g=u.filter((t=>-1===e.indexOf(t.id))),y=l.map((e=>{const t=`${e.from.insId}.${e.from.pinId}`,n=`${e.to.insId}.${e.to.pinId}`;return f[n]?{...e,to:{insId:v.id,pinId:f[n]}}:m[t]?{...e,from:{insId:v.id,pinId:m[t]}}:e})).filter((t=>-1===e.indexOf(t.from.insId)&&-1===e.indexOf(t.to.insId)));return{newNode:p,currentNode:(0,s.default)(t,(e=>{e.instances=[...g,v],e.connections=y}))}}},74089:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(97106),t),i(n(18420),t),i(n(90680),t),i(n(84472),t),i(n(17102),t),i(n(82232),t),i(n(25779),t),i(n(25804),t),i(n(9958),t),i(n(68120),t),i(n(94651),t),i(n(73470),t),i(n(94007),t),i(n(60190),t),i(n(9001),t),i(n(7047),t),i(n(23386),t)},31745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoTooltip=void 0;const o=n(35250),i=n(50382),s=n(50382),r=n(44470),a=n(50382);t.InfoTooltip=e=>{const{content:t}=e;return(0,o.jsx)(s.Tooltip,{content:t,placement:"top",className:"info-tooltip",children:(0,o.jsx)(i.Icon,{icon:(0,o.jsx)(r.InfoSign,{className:a.Classes.INTENT_PRIMARY}),intent:i.Intent.SUCCESS,className:"info-tooltip-icon"})})}},83938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserOnlyReactJson=void 0;const o=n(35250);t.BrowserOnlyReactJson=e=>{if("undefined"==typeof window)return null;const t=n(73541).Z;return(0,o.jsx)(t,{...e})}},94651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsValueRenderer=void 0;const o=n(35250),i=n(74762),s=n(83938);t.AnalyticsValueRenderer=e=>{let{val:t}=e;try{const e=JSON.parse(t),n="object"==typeof e?e:{value:e},r=e&&[e.type,e.key,e.props,e.ref].every(i.isDefined),a=r?{jsxValue:e}:n;return(0,o.jsx)(s.BrowserOnlyReactJson,{src:a,collapseStringsAfterLength:50,collapsed:r})}catch(n){return(0,o.jsx)(s.BrowserOnlyReactJson,{src:{value:t},collapseStringsAfterLength:50})}}},22513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=void 0;const o=n(74762),i=n(74762),s=n(60190),r=n(88593);t.createGroup=async(e,t,n,a)=>{if(0===e.length)throw new Error("cannot create group without instances");const u=e.map((e=>e.id)),l=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return!t&&n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.to,e.to)))===t)),c=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return t&&!n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.from,e.from)))===t));let d={},p={},f={},m={};const h=[],v={};for(const o of l){const e=`${o.to.insId}.${o.to.pinId}`,t=`${o.from.insId}.${o.from.pinId}`,n=o.to.pinId;if(f[t]){h.push({from:(0,i.externalConnectionNode)(f[t]),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)});continue}const r=v[n]?await a(`Name this input (${n} of ${o.to.insId}) is already taken:`)||`i${(0,s.rnd)()}`:n;d[e]=r,f[t]=r,h.push({from:(0,i.externalConnectionNode)(r),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)}),v[r]=(0,i.nodeInput)()}const g={};for(const r of c){const e=`${r.to.insId}.${r.to.pinId}`,t=`${r.from.insId}.${r.from.pinId}`,n=r.from.pinId;if(m[e]){h.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(m[e])});continue}const u=g[n]?await a(`Name this output (${n} of ${r.from.insId} is already taken:`)||`i${(0,s.rnd)()}`:n;p[t]=u,m[e]=u,h.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(u)}),g[u]=(0,o.nodeOutput)()}e.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),e[0].pos);const y=t.filter((e=>u.includes(e.from.insId)&&u.includes(e.to.insId)));return{visualNode:{id:n,inputs:v,outputs:g,instances:e,defaultStyle:{size:"large",color:(0,o.pickRandom)(r.nodeStylePresetColors.map((e=>e.color)))},inputsPosition:(0,o.okeys)(v).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:0}})),{}),outputsPosition:(0,o.okeys)(g).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:400}})),{}),connections:[...y,...h],completionOutputs:(0,o.okeys)(g)},renamedInputs:d,renamedOutputs:p}}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightText=void 0;const o=n(35250);function i(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}t.highlightText=(e,t)=>{let n=0;const s=t.split(/\s+/).filter((e=>e.length>0)).map(i);if(0===s.length)return[e];const r=new RegExp(s.join("|"),"gi"),a=[];for(;;){const t=r.exec(e);if(!t)break;const i=t[0].length,s=e.slice(n,r.lastIndex-i);s.length>0&&a.push(s),n=r.lastIndex,a.push((0,o.jsx)("strong",{children:t[0]},n))}const u=e.slice(n);return u.length>0&&a.push(u),a}},17102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Loader=void 0;const o=n(35250);t.Loader=()=>(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)("svg",{width:"38",height:"38",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:"#007ec6",children:(0,o.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,o.jsxs)("g",{transform:"translate(1 1)",strokeWidth:"2",children:[(0,o.jsx)("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),(0,o.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:(0,o.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})})})},23386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;const o=n(74762);t.logger=(0,o.debugLogger)("editor")},561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadMonaco=void 0;const o=n(51848),i=n(23386);let s=!1;t.preloadMonaco=()=>{s||o.loader.init().then((()=>{(0,i.logger)("monaco preloaded"),s=!0}))}},68120:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHotkeys=t.currentHotkeys=void 0;const i=o(n(45240)),s=n(70079);t.currentHotkeys=new Map,t.useHotkeys=function(e,n,o,r,a){void 0===r&&(r=[]);const u=(0,s.useCallback)((function(){a&&!a.current||n(...arguments)}),[...r,n]);(0,s.useEffect)((()=>((0,i.default)(e,{},u),t.currentHotkeys.set(e,o),()=>{t.currentHotkeys.delete(e),i.default.unbind(e,u)})),[e,u,o])}},94007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeSessionStorage=t.safeLocalStorage=void 0,t.safeLocalStorage={getItem:function(){try{return localStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return localStorage.setItem(...arguments)}catch(e){return null}}},t.safeSessionStorage={getItem:function(){try{return sessionStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return sessionStorage.setItem(...arguments)}catch(e){return null}}}},90680:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocalStorage=t.useResizePref=t.userPreferences=t.useUserPref=void 0;const r=s(n(70079)),a=n(18420),u=n(94007);t.useUserPref=(e,n)=>{const[o,i]=r.useState((()=>{const o=t.userPreferences.getItem(e);return(0,a.isDefined)(o)?o:n}));r.useEffect((()=>{const o=t.userPreferences.getItem(e),s=(0,a.isDefined)(o)?o:n;i(s)}),[e]);return[o,n=>{t.userPreferences.setItem(e,n),i(n)}]},t.userPreferences=(()=>{const e=e=>`up.${e}`;return{getItem:t=>{const n=u.safeLocalStorage.getItem(e(t))||"",o=u.safeSessionStorage.getItem(e(t))||"";try{return JSON.parse(o||n).value}catch(i){return}},setItem:function(t,n,o){void 0===o&&(o=!1);const i=o?sessionStorage:u.safeLocalStorage;try{const o=JSON.stringify({value:n});return i.setItem(e(t),o),!0}catch(s){return console.error("Error saving user preference",s),!1}}}})();t.useResizePref=(e,n)=>{const o=`resize.${e}`;return(0,t.useUserPref)(o,n)};const l=e=>{const t=u.safeLocalStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch(n){return null}};t.useLocalStorage=(e,t)=>{const[n,o]=r.useState(l(e)||t),i=r.useCallback((t=>{u.safeLocalStorage.setItem(e,JSON.stringify({value:t})),o(t)}),[e]);return r.useEffect((()=>{l(e)||u.safeLocalStorage.setItem(e,JSON.stringify({value:t}))}),[e,t,i]),[n,i]}},60190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.totalEnergy=t.itrPhysics=t.hookes=t.coulombs=t.vToStr=t.vNorm=t.vLen=t.vSub=t.vAdd=t.vDiv=t.vMul=t.vZero=t.rnd=t.vec=t.size=void 0;t.size=(e,t)=>({width:e,height:t});t.vec=(e,t)=>({x:e,y:t});t.rnd=function(e,t){return void 0===e&&(e=100),void 0===t&&(t=0),Math.floor(Math.random()*(e-t))+t},t.vZero={x:0,y:0};t.vMul=(e,t)=>{let{x:n,y:o}=e;return{x:n*t,y:o*t}};t.vDiv=(e,n)=>{let{x:o,y:i}=e;return(0,t.vMul)({x:o,y:i},1/n)};t.vAdd=(e,t)=>({x:e.x+t.x,y:e.y+t.y});t.vSub=(e,n)=>(0,t.vAdd)(e,(0,t.vMul)(n,-1));t.vLen=e=>{let{x:t,y:n}=e;return Math.sqrt(t*t+n*n)};t.vNorm=e=>(0,t.vDiv)(e,(0,t.vLen)(e)||1);t.vToStr=e=>{let{x:t,y:n}=e;return`${t.toFixed(1)},${n.toFixed(1)}`};t.coulombs=(e,n,o)=>{const i=(0,t.vLen)((0,t.vSub)(e.p,n.p));if(0===i){const i=(0,t.vec)(2*Math.random()-1,2*Math.random()-1),s=e.m*n.m/Math.pow(10,2);return(0,t.vMul)(i,s*o)}{const s=(0,t.vNorm)((0,t.vSub)(n.p,e.p)),r=e.m*n.m/Math.pow(i+.1,2);return(0,t.vMul)(s,r*o)}};t.hookes=(e,n,o,i,s)=>{const r=(0,t.vLen)((0,t.vSub)(e.p,n.p)),a=(0,t.vNorm)((0,t.vSub)(e.p,n.p));let u=0;return ri&&(u=i-r),(0,t.vMul)(a,s*u)};t.itrPhysics=(e,n)=>{const{p:o,v:i,f:s,m:r}=n,a=(0,t.vDiv)(s,r),u=e/1e3,l=(0,t.vAdd)((0,t.vMul)(a,u),i),c=(0,t.vAdd)((0,t.vMul)(l,u),o);return{...n,p:c,v:l,f:(0,t.vec)(0,0)}};t.totalEnergy=e=>e.reduce(((e,n)=>{const o=(0,t.vLen)(n.v);return e+.5*n.m*o*o}),0)},84472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateToast=t.toastMsg=t.AppToaster=void 0;const o=n(50382);t.AppToaster=(()=>{try{return o.OverlayToaster.create({className:"app-toaster",position:o.Position.BOTTOM_RIGHT})}catch(e){return{}}})();t.toastMsg=(e,n,o)=>t.AppToaster.show({message:e,intent:n,timeout:o});t.updateToast=(e,n,o)=>t.AppToaster.show({message:n,intent:o},e)},18420:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultAnd=t.isLocal=t.fullTime=t.timeAgoFromDt=t.timeAgo=t.toString=t.isDefined=t.set=t.createOmap=t.toOmap=t.values=t.keys=t.entries=void 0;const i=n(7047),s=n(74762),r=o(n(73136));t.entries=e=>Object.keys(e).map((t=>[t,e[t]]));t.keys=e=>Object.keys(e);t.values=e=>Object.keys(e).map((t=>e[t]));t.toOmap=e=>Array.from(e.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.createOmap=function(e){return void 0===e&&(e=[]),e.reduce(((e,t)=>({...e,[t[0]]:t[1]})),{})};t.set=(e,t,n)=>{e[t]=n};t.isDefined=e=>void 0!==e;t.toString=e=>{const t=typeof e;if(""===e)return"(empty string)";if((0,i.isJsxValue)(e))return"JSX Value";if((0,s.isStaticValueVisualNode)(e))return"Embedded Node";if((0,s.isEnvValue)(e))return(0,s.getEnvKeyFromValue)(e);if("object"===t)try{const t=JSON.stringify(e);return"{}"===t?"Empty object":t}catch(n){return"Object (cannot stringify)"}return`${e}`};t.timeAgo=e=>(0,r.default)(new Date(e)).fromNow();t.timeAgoFromDt=e=>(0,r.default)(Date.now()-e).fromNow();t.fullTime=e=>(0,r.default)(new Date(e)).toString();t.isLocal=()=>location.href.includes(":300");t.preventDefaultAnd=e=>t=>{t.preventDefault(),e(t)}},67181:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ActionButton=t.ActionsMenu=t.ActionType=void 0;const r=n(35250),a=n(50382),u=n(50382),l=n(74762),c=s(n(70079)),d=n(86125),p=n(43490),f=n(68120),m=n(90680),h=n(84472),v=n(9971),g=n(47749),y=n(46334),b=n(47230),I=n(41032);var C;!function(e){e.AddNode="add-node",e.RemoveNode="remove-node",e.Group="group",e.UnGroup="un-group",e.AddInlineValue="add-inline-value",e.Inspect="inspect",e.Run="run",e.AI="ai"}(C=t.ActionType||(t.ActionType={}));t.ActionsMenu=e=>{const{onAction:n,selectedInstances:o,resolvedNodes:i,node:s,from:u,to:g,hotkeysEnabled:w,showRunFlowOptions:_}=e,{onRequestImportables:j}=(0,d.useDependenciesContext)(),[N,O]=c.default.useState(!1),[P,E]=c.default.useState(!1),[S,T]=c.default.useState(!1),[D,M]=c.default.useState(null),[k,R]=(0,m.useLocalStorage)("hideHotkeyHintMap",{}),A=(0,c.useCallback)((()=>{O(!1)}),[]),{onRunFlow:V,generateNodeFromPrompt:L,reportEvent:z}=(0,p.usePorts)(),$=(0,c.useCallback)(((e,t)=>(E(!1),V(e,t))),[V]),H=[];if(H.push(C.AddNode),H.push(C.AddInlineValue),1===o.length){const e=s.instances.find((e=>e.id===o[0]));if(e)try{const t=(0,I.safelyGetNodeDef)(e,i);(0,l.isVisualNode)(t)&&H.push(C.UnGroup)}catch(B){console.error(`Could not find node with id ${o[0]} - ${B}`)}else console.error(`Could not find instance with id ${o[0]}`)}_&&H.push(C.Run),o.length>0&&H.push(C.Group),(1===o.length||u||g)&&H.push(C.Inspect),o.length>0&&H.push(C.RemoveNode),H.push(C.AI);const q=(0,c.useCallback)(((e,t)=>{R({...k,[e]:!0}),h.AppToaster.dismiss(t)}),[k,R]),F=(0,c.useCallback)(((e,t)=>{const{hotkey:o}=x[e];if("click"===t.type&&o&&!k[o]){const t=(0,h.toastMsg)((0,r.jsxs)(r.Fragment,{children:["Did you know? you can also use the hotkey"," ",(0,r.jsx)("kbd",{className:"hotkey",children:o})," to"," ",x[e].text.replace(/^[A-Z]/,(e=>e.toLowerCase())),(0,r.jsxs)(a.Button,{minimal:!0,small:!0,onClick:()=>q(o,t),children:[" ","Don't show again"," "]})]}),"none",3e3)}switch(e){case C.AddNode:O(!0);break;case C.Run:!async function(){E(!0)}();break;case C.AI:T(!0);break;default:n({type:e,data:void 0})}}),[k,n,q,s.inputs]);Object.entries(x).forEach((e=>{let[t,n]=e;n.hotkey&&(0,f.useHotkeys)(n.hotkey,(e=>{e.preventDefault(),H.includes(t)&&(F(t,e),R({...k,[n.hotkey]:!0}))}),{text:n.text,group:"Action menu hotkeys"},[H],w)}));const G=(0,c.useCallback)((e=>{n({type:C.AddNode,data:{importableNode:e}})}),[n]),U=(0,c.useCallback)((async e=>{const t=Date.now();M(t);try{z("generateNodeFromPrompt:start",{promptLength:e.length});const o=await L({prompt:e}),{inputs:i,outputs:s}=o.importableNode.node,r=Date.now()-t;z("generateNodeFromPrompt:success",{totalTime:r,inputs:Object.keys(i),outputs:Object.keys(s)}),M(null),n({type:C.AI,data:o}),T(!1)}catch(B){M(null),h.AppToaster.show({message:"Failed to generate node",intent:"danger"}),z("generateNodeFromPrompt:failure",{error:B.message})}}),[L,n,z]);return(0,r.jsxs)("div",{className:"actions-menu",children:[H.map((e=>(0,r.jsx)(t.ActionButton,{type:e,onClick:F},e))),N?(0,r.jsx)(v.AddNodeMenu,{onRequestImportables:j,onAddNode:G,onClose:A}):null,P?(0,r.jsx)(b.RunFlowModal,{onClose:()=>E(!1),onRun:$,node:s}):null,S?(0,r.jsx)(y.PromptAIMenu,{onClose:()=>{T(!1),M(null)},onSubmit:U,submitting:null!==D,submitTime:D}):null]})};const x={[C.AddNode]:{icon:g.addNodeIcon,text:'Open the "add node" menu',hotkey:"a"},[C.RemoveNode]:{icon:g.removeNodeIcon,text:"Remove selected instances",hotkey:"backspace"},[C.Group]:{icon:g.groupIcon,text:"Group selection into a new node",hotkey:"g"},[C.UnGroup]:{icon:g.ungroupIcon,text:"Ungroup selected visual node"},[C.Inspect]:{icon:g.inspectIcon,text:"Inspect data",hotkey:"i"},[C.AddInlineValue]:{icon:g.pencilIcon,text:"Add value / inline function",hotkey:"v"},[C.Run]:{icon:g.playIcon,text:"Run flow",hotkey:"r"},[C.AI]:{icon:g.starIcon,text:"Generate new code node using AI \u2728"}},w={icon:"",text:"N/A",hotkey:void 0};t.ActionButton=e=>{var t;const{onClick:n,type:o}=e,i=(0,c.useCallback)((e=>n(o,e)),[n,o]),s=null!==(t=x[o])&&void 0!==t?t:w,a=s.hotkey?(0,r.jsxs)("span",{children:[s.text," ",(0,r.jsx)("kbd",{className:"hotkey",children:s.hotkey})]}):s.text;return(0,r.jsx)("div",{className:"action-button",onClick:i,"data-type":o,children:(0,r.jsx)(u.Tooltip,{hoverOpenDelay:100,content:a,className:"icon-wrapper",popoverClassName:"action-button-tooltip",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s.icon}})})})}},40149:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenu=t.AddNodeMenuFilterTree=void 0;const a=n(35250),u=n(50382),l=n(74762),c=r(n(26372)),d=s(n(70079)),p=n(43490),f=n(31745),m=n(17102),h=n(87935),v=n(74657),g=n(44470);t.AddNodeMenuFilterTree=u.Tree.ofType();function y(e,t,n){return[...e.external.map((e=>({id:e.module,label:e.module,hasCaret:!0,nodeData:{type:"external",module:e.module},isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module,isExpanded:n.has(e.module),childNodes:e.namespaces.map((o=>({id:`${e.module}/${o}`,label:o,hasCaret:!1,isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module&&t.namespace===o,isExpanded:n.has(`${e.module}/${o}`),nodeData:{type:"external",module:e.module,namespace:o}})))}))),{id:"internal",label:"Current Project",nodeData:{type:"internal"},isExpanded:n.has("internal"),hasCaret:!0,isSelected:"internal"===t.type,childNodes:e.internal.files.map((e=>({id:e,label:e,isSelected:"internal"===t.type&&t.file===e,hasCaret:!1,isExpanded:n.has(e),nodeData:{type:"internal",file:e}})))}]}function b(e){return/\.flyde(\.[jt]s)?$/.test(e.module)}t.AddNodeMenu=e=>{const{onRequestImportables:n,onAddNode:o,onClose:i}=e,[s,r]=d.default.useState(),[I,C]=d.default.useState([]),[x,w]=d.default.useState(new Set),[_,j]=d.default.useState(""),[N,O]=d.default.useState({type:"all"}),[P,E]=d.default.useState(null),[S,T]=d.default.useState(null),[D,M]=d.default.useState(null),k=(0,d.useCallback)((e=>{x.add(e.id),w(new Set(x))}),[x]),R=(0,d.useCallback)((e=>{x.delete(e.id),w(new Set(x))}),[x]),A=(0,d.useCallback)((e=>{o(e),i()}),[o,i]),{onInstallRuntimeRequest:V,reportEvent:L}=(0,p.usePorts)();(0,d.useEffect)((()=>{L("addNodeMenuOpen",{})}),[L]),(0,d.useEffect)((()=>{T(null==s?void 0:s.flatMap((e=>{var t,n,o;if(N)if("external"===N.type){if((e.module!==N.module||N.namespace)&&e.node.namespace!==N.namespace)return[]}else if("internal"===N.type&&(!b(e)||N.file&&e.module!==N.file))return[];if(_){const i=`${null!==(n=null===(t=e.node.searchKeywords)||void 0===t?void 0:t.join(" "))&&void 0!==n?n:[]} ${e.node.id} ${null!==(o=e.node.namespace)&&void 0!==o?o:""} ${e.node.description}`.toLowerCase().indexOf(_.toLowerCase());return-1===i?[]:[{importable:e,score:i}]}return[{importable:e,score:1}]})).sort(((e,t)=>e.score-t.score)).map((e=>{let{importable:t}=e;return t})))}),[s,N,_]),(0,d.useEffect)((()=>{n().then((e=>{let{importables:t,errors:n}=e;C(n);const o=t.filter((e=>!b(e))).reduce(((e,t)=>{var n,o,i;null!==(n=e[i=t.module])&&void 0!==n||(e[i]=[]);const s=null!==(o=t.node.namespace)&&void 0!==o?o:"";return e[t.module].includes(s)||e[t.module].push(s),e}),{}),i=t.filter(b).map((e=>e.module));E({external:Object.entries(o).map((e=>{let[t,n]=e;return{module:t,namespaces:n}})),internal:{files:i}}),r(t),w(new Set(["internal",...Object.keys(o)]))}))}),[n]);const z=(0,d.useCallback)((e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),S&&!D)return void M(S["ArrowDown"===e.key?0:S.length-1]);if(S&&D){const t=S.findIndex((e=>e===D));let n="ArrowDown"===e.key?t+1:t-1;n=n<0?S.length-1:n,n=n>=S.length?0:n,M(S[n])}break;case"Enter":D&&A(D)}}),[S,D,A]),$=(0,d.useCallback)((e=>{let{nodeData:t}=e;JSON.stringify(t)===JSON.stringify(N)?"external"===t.type?t.namespace?O({type:"external",module:t.module}):O({type:"all"}):"internal"===t.type&&(t.file?O({type:"internal"}):O({type:"all"})):O(t)}),[N]),H=!s||s.some((e=>e.module.includes("@flyde/stdlib"))),q=(0,d.useCallback)((()=>{V(),i()}),[i,V]);return(0,a.jsx)(u.Dialog,{isOpen:!0,title:"Add Node Menu",onClose:e.onClose,className:"add-node-menu",isCloseButtonShown:!0,children:(0,a.jsxs)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),children:[(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"bp5-input-group",children:[(0,a.jsx)(g.Search,{}),(0,a.jsx)("input",{className:"bp5-input",type:"search",placeholder:"Search input",dir:"auto",autoFocus:!0,onChange:e=>j(e.target.value),value:_,onKeyDown:z})]}),H?null:(0,a.jsxs)(u.Callout,{intent:u.Intent.NONE,style:{marginTop:10},children:["Using built-in @flyde/stdlib. It's recommended to explicitly install it instead."," ",(0,a.jsx)(u.Button,{minimal:!0,small:!0,intent:u.Intent.PRIMARY,onClick:q,children:"Click here to install it using npm/yarn"})]})]}),(0,a.jsx)("div",{className:"content-wrapper",children:s?(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsxs)("aside",{children:[(0,a.jsxs)("div",{className:"filter-header",children:["Filter by package"," ",(0,a.jsx)(u.Tooltip,{content:(0,a.jsxs)("span",{children:["Click to learn more about how packages work in Flyde"," "]}),hoverCloseDelay:1500,children:(0,a.jsx)("a",{target:"_blank",href:"https://www.flyde.dev/docs/packages",rel:"noreferrer",children:(0,a.jsx)(u.Icon,{icon:(0,a.jsx)(g.Help,{}),intent:"primary",iconSize:12})})})]}),(0,a.jsx)("div",{className:"tree-container",children:(0,a.jsx)(t.AddNodeMenuFilterTree,{contents:y(P,N,x),onNodeCollapse:R,onNodeExpand:k,onNodeClick:$,className:u.Classes.ELEVATION_0})})]}),(0,a.jsx)("main",{children:S?0===S.length?(0,a.jsxs)("div",{className:"no-results",children:[(0,a.jsx)(v.AddNodeMenuResultsSummary,{filter:N,onChangeFilter:O,query:_,onChangeQuery:j,resultsCount:S.length}),(0,a.jsxs)(u.Callout,{className:"callout",intent:"primary",children:["Can't find a suitable node? Create one yourself!"," ",(0,a.jsx)("a",{href:"https://www.flyde.dev/docs/code-nodes",target:"_blank",rel:"noreferrer",children:"Learn more"})]})]}):(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsx)(v.AddNodeMenuResultsSummary,{filter:N,onChangeFilter:O,query:_,onChangeQuery:j,resultsCount:S.length}),(0,a.jsx)("div",{className:"results",children:S.map((e=>(0,a.jsx)(h.AddNodeMenuListItem,{importableNode:e,onAdd:A,selected:(null==D?void 0:D.node)===e.node,onSelect:M,onSetFilter:O},e.node.id+e.node.namespace+e.module)))})]}):(0,a.jsx)(m.Loader,{})})]}):(0,a.jsx)(m.Loader,{})}),I.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",style:{marginTop:"10px"},children:["Found ",(0,l.simplePluralize)(I.length,"corrupt flow"),(0,a.jsx)(f.InfoTooltip,{content:I.map((e=>{let{path:t,message:n}=e;return`${t}: ${n}`})).join(", ")})," "]}):null]})})}},8470:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuListItem=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079));t.AddNodeMenuListItem=e=>{const{importableNode:t,onSetFilter:n,onAdd:o,onSelect:i}=e,{node:s,module:r}=t,{id:d,description:p}=s,f=c.default.useRef(null);c.default.useEffect((()=>{e.selected&&f.current&&f.current.scrollIntoView({block:"center"})}),[e.selected]);const m=(0,c.useCallback)((()=>{o(t)}),[o,t]),h=(0,c.useCallback)((()=>{i(t)}),[i,t]);return(0,a.jsxs)("div",{className:(0,l.default)("add-node-menu-list-item",{selected:e.selected}),ref:f,onClick:h,children:[(0,a.jsxs)("div",{className:"content",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("span",{className:"id",children:d}),(0,a.jsxs)(u.Tag,{interactive:!0,onClick:()=>n({type:"external",module:r,namespace:s.namespace}),className:"source",minimal:!0,children:[r,s.namespace?` / ${s.namespace}`:null]})]}),(0,a.jsx)("div",{className:"description",children:p||(0,a.jsx)("em",{children:"No description"})})]}),(0,a.jsx)("aside",{children:(0,a.jsx)(u.Button,{onClick:m,children:"Add"})})]})}},87935:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8470),t)},88671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuResultsSummary=void 0;const o=n(35250),i=n(50382);t.AddNodeMenuResultsSummary=e=>{const{resultsCount:t,query:n,filter:s,onChangeFilter:r,onChangeQuery:a}=e;return(0,o.jsxs)("div",{className:"add-node-menu-results-summary",children:[t?`Showing ${t} result${t>1?"s":""}`:"No results found","\xa0",n?(0,o.jsxs)(o.Fragment,{children:["matching query\xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>a(""),children:['"',n,'"']})]}):null,"all"===s.type?null:"external"===s.type?(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["package ",s.module,s.namespace?` / ${s.namespace}`:null]})]}):(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["\xa0this project ",s.file?` / ${s.file}`:null]})]})]})}},74657:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88671),t)},9971:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40149),t)},83159:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PromptAIMenu=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=1e4;t.PromptAIMenu=e=>{const{onClose:t}=e,[n,o]=c.default.useState(""),[i,s]=c.default.useState(0);return(0,c.useEffect)((()=>{s(0);const t=setInterval((()=>{s((t=>{const n=(Date.now()-e.submitTime)/d;return Math.min(n+.05*Math.random()/2,.95)}))}),500);return()=>clearInterval(t)}),[e.submitTime]),(0,a.jsxs)(u.Dialog,{isOpen:!0,onClose:t,className:"prompt-ai-menu",title:"\u2728 Generate Code Node using AI",children:[(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsx)(u.TextArea,{value:n,disabled:e.submitting,onChange:e=>o(e.target.value),placeholder:"Describe your node in details",fill:!0})}),e.submitTime?(0,a.jsx)("div",{className:"progress-bar-container",children:(0,a.jsx)(u.ProgressBar,{value:i})}):null,(0,a.jsx)("div",{className:u.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:u.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(u.Button,{onClick:t,children:"Close"}),(0,a.jsx)(u.Button,{intent:u.Intent.PRIMARY,className:"run-btn",disabled:e.submitting||!n,loading:e.submitting,onClick:()=>{s(0),e.onSubmit(n)},children:"Create \u2728"})]})})]})}},46334:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(83159),t)},3152:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RunFlowModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(90680),f=n(31745);t.RunFlowModal=u.memo((function(e){const{onRun:t,onClose:n,node:o}=e,[i,s]=u.useState(0),[r,m]=(0,p.useLocalStorage)(`run-inputs-${o.id}`,Object.keys(o.inputs).reduce(((e,t)=>(e[t]=`Enter a value for input ${t}`,e)),{})),[h,v]=u.useState(JSON.stringify(r,null,2)),g=e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})},y=u.useCallback((()=>{const e=JSON.parse(h);m(e),t(e,i)}),[t,m,h,i]),b=Object.keys(o.inputs),I=b.filter((e=>"required"!==o.inputs[e].mode)),C=u.useMemo((()=>b.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:"This node receives external inputs. Enter values for each input below:"}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"json",value:h,onChange:e=>v(null!=e?e:""),onMount:g}),I.length>0?(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Note: input(s) ",(0,a.jsx)("code",{children:I.join(", ")})," are optional"]}):null]}):(0,a.jsx)("strong",{children:"This node does not receive any external inputs."})),[b.length,I,h]);return(0,a.jsxs)(c.Dialog,{isOpen:!0,onClose:e.onClose,className:"run-flow-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&y()},tabIndex:0,children:[C,(0,a.jsxs)("div",{className:"execution-delay-wrapper",children:[(0,a.jsxs)("label",{children:["Execution delay:"," ",(0,a.jsx)(f.InfoTooltip,{content:"Delay between each node execution. Useful for debugging."})]}),(0,a.jsx)(c.Slider,{value:i,onChange:s,min:0,labelStepSize:500,stepSize:100,labelRenderer:e=>`${e}ms`,max:1e3})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:n,children:"Close"}),(0,a.jsx)(c.Button,{onClick:y,intent:c.Intent.PRIMARY,className:"run-btn",children:"Run"})]})})]})}))},47230:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3152),t)},47749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starIcon=t.stopIcon=t.playIcon=t.pencilIcon=t.ungroupIcon=t.groupIcon=t.inspectIcon=t.removeNodeIcon=t.addNodeIcon=void 0,t.addNodeIcon='\n\n',t.removeNodeIcon='\n\n',t.inspectIcon='\n\n\n',t.groupIcon='\n\n\n',t.ungroupIcon='\n\n\n',t.pencilIcon='\n\n',t.playIcon='\n\n\n',t.stopIcon='\n\n\n',t.starIcon='\n\n\n\n\n'},1237:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HelpBubble=void 0;const i=n(70079),s=n(35250),r=n(50382),a=n(99489),u=n(50382),l=o(n(70079)),c=n(68120),d=n(71644),p=n(43490),f={offset:{enabled:!0,options:{offset:[0,20]}},preventOverflow:{enabled:!0,options:{padding:10}}};const m=["Viewport Controls","Editing","Selection"];t.HelpBubble=()=>{const[e,t]=l.default.useState(!1),n=Array.from(c.currentHotkeys.entries()).map((e=>{let[t,n]=e;return{combo:(o={key:t,menuData:n}).key,label:o.menuData.text,group:o.menuData.group};var o})).reduce(((e,t)=>(e[t.group]||(e[t.group]=[]),e[t.group].push(t),e)),{}),o=Object.entries(n).sort(((e,t)=>m.indexOf(t[0])-m.indexOf(e[0]))),{reportEvent:h}=(0,p.usePorts)(),v=(0,s.jsx)(r.Dialog,{isOpen:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:r.Classes.DIALOG_BODY,children:o.map((e=>{let[t,n]=e;return(0,s.jsxs)(l.default.Fragment,{children:[(0,s.jsx)(r.H4,{children:t}),n.map((e=>(0,i.createElement)(a.Hotkey,{...e,key:e.combo})))]},t)}))})}),g=(0,s.jsxs)(r.Menu,{children:[(0,s.jsx)(r.MenuItem,{text:"Hotkeys",onClick:()=>{t(!0),h("helpMenuItem",{item:"hotkeys"})}}),(0,s.jsx)(r.MenuItem,{text:"Documentation",onClick:()=>h("helpMenuItem",{item:"documentation"}),href:"https://www.flyde.dev/docs",target:"_blank"}),(0,s.jsx)(r.MenuDivider,{}),(0,s.jsx)(r.MenuItem,{text:"Discord",onClick:()=>h("helpMenuItem",{item:"discord"}),href:"https://discord.gg/x7t4tjZQP8",target:"_blank"})]});return(0,s.jsxs)("div",{className:"help-bubble","data-tip":"Help",children:[(0,s.jsx)(u.Popover,{content:g,modifiers:f,onOpened:()=>h("helpMenuOpen",{}),children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:d.helpIcon}})}),v]})}},71644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpIcon=void 0,t.helpIcon='\n\n\n'},3354:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1237),t)},7011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainInstanceEventsIndicator=void 0;const o=n(35250),i=n(30994),s=n(66189),r=n(50382);t.MainInstanceEventsIndicator=e=>{const{currentInsId:t,ancestorsInsIds:n}=e,{history:a,refreshHistory:u,resetHistory:l}=(0,s.useHistoryHelpers)(t),c=`main-indicator-${t}}`;return(0,o.jsx)("div",{className:"main-instance-events-indicator",children:(0,o.jsx)(r.Tooltip,{content:(0,s.calcHistoryContent)(a),children:(0,o.jsx)("span",{onMouseEnter:u,onMouseOut:l,id:(0,i.getMainInstanceIndicatorDomId)(t,n),className:"status-text","data-tip":"","data-html":!0,"data-for":c})})})}},22714:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7011),t)},63521:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VisualNodeEditor=t.defaultBoardData=t.defaultViewPort=t.NODE_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=n(74762),c=n(86553),d=n(65082),p=n(18420),f=n(26701),m=n(7047),h=n(53865),v=n(70079),g=n(68120),y=r(n(27942)),b=n(50382),I=n(66005),C=n(60190),x=n(71033),w=n(74762),_=n(99942),j=n(44338),N=n(561),O=n(84472),P=n(82232),E=n(18594),S=n(68371),T=r(n(61888)),D=n(65758),M=n(43490),k=r(n(26372)),R=n(25044),A=n(80510),V=n(1788),L=n(2130),z=n(88593),$=n(97106),H=n(67181),q=n(22714),F=n(3354),G=n(41032),U=n(30653),B=u.memo(b.Slider),W=()=>null;t.NODE_HEIGHT=28;t.defaultViewPort={pos:{x:0,y:0},zoom:1},t.defaultBoardData={selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}},t.VisualNodeEditor=u.memo(u.forwardRef(((e,n)=>{const{onChangeNode:o,nodeIoEditable:i,onCopy:s,onGoToNodeDef:r,onInspectPin:J,boardData:Y,onChangeBoardData:K,currentInsId:Q,ancestorsInsIds:X,node:ee,onShowOmnibar:te,resolvedDependencies:ne,queuedInputsData:oe,initialPadding:ie,disableScrolling:se}=e,{onImportNode:re}=(0,$.useDependenciesContext)(),ae=(0,U.useDarkMode)(),{reportEvent:ue}=(0,M.usePorts)(),le=e.parentViewport||t.defaultViewPort,[ce,de]=(0,v.useState)({...ne,[ee.id]:ee});(0,v.useEffect)((()=>{de({...ne,[ee.id]:ee})}),[ne,ee]);const{selected:pe,from:fe,to:me}=Y,{instances:he,connections:ve,inputsPosition:ge,outputsPosition:ye,inputs:be,outputs:Ie}=ee,[Ce,xe]=(0,v.useState)(),[we,_e]=(0,v.useState)(),je=void 0===X,[Ne,Oe]=(0,v.useState)(0),[Pe,Ee]=(0,v.useState)(),[Se,Te]=(0,v.useState)(!1),[De,Me]=(0,v.useState)(),[ke,Re]=(0,v.useState)(),[Ae,Ve]=(0,v.useState)(),[Le,ze]=(0,v.useState)(),$e=(0,v.useRef)();(0,f.useDidMount)((()=>{$e.current=Xe.current.querySelector(".inline-editor-portal-root")}));const He=(0,M.useConfirm)(),qe=(0,M.usePrompt)(),Fe=Y.viewPort,Ge=(0,v.useRef)(!0),[Ue,Be]=(0,v.useState)(null),We=u.useCallback((e=>{K({viewPort:e})}),[K]),Ze=u.useCallback(((e,t)=>J(e,t)),[J]),Je=u.useCallback(((e,t,n)=>{const i=(0,A.handleConnectionCloseEditorCommand)(ee,{from:e,to:t}),s=(0,l.isInternalConnectionNode)(t)?he.find((e=>e.id===t.insId)):null,r=(s?s.inputConfig:{})[t.pinId],a=(0,l.isStaticInputPinConfig)(r)?(0,V.handleDetachConstEditorCommand)(i,t.insId,t.pinId):i;o(a,(0,P.functionalChange)("close-connection")),K({from:void 0,to:void 0}),ue("createConnection",{source:n})}),[he,o,K,ee,ue]),Ye=u.useCallback((async()=>{const e=await qe("New visual node name?");if(!e)return;const{currentNode:t}=await(0,D.groupSelected)(Y.selected,ee,e,"inline",qe);o(t,(0,P.functionalChange)("group node")),(0,O.toastMsg)("Node grouped"),ue("groupSelected",{count:Y.selected.length})}),[qe,Y.selected,o,ee,ue]);(0,v.useEffect)((()=>{if(Pe){const e=setTimeout((()=>{Ee(void 0)}),350);return()=>clearTimeout(e)}}),[Pe]);const[Ke,Qe]=(0,v.useState)();(0,v.useEffect)((()=>{(0,N.preloadMonaco)()}),[]);const Xe=(0,v.useRef)(),et=(0,y.default)(Xe),tt=u.useRef({x:400,y:400}),nt=(0,f.useBoundingclientrect)(Xe)||C.vZero,ot=()=>{const e=(0,m.fitViewPortToNode)(ee,ce,et);(0,m.animateViewPort)(Fe,e,500,(e=>{We(e)}))},it=u.useCallback(((e,t)=>{const{to:n,from:o}=Y,i="input"===t?o:n,s="input"===t?n:o,r={pinId:e,insId:l.THIS_INS_ID},a="input"===t?{from:r}:{to:r};i&&i.pinId===e?K({from:void 0,to:void 0}):s?"input"===t&&n?Je(r,n,"nodeIoClick"):o&&Je(o,r,"nodeIoClick"):K(a)}),[Y,K,Je]),st=u.useCallback(((e,t,n)=>{const i=(0,h.produce)(ee,(o=>{"input"===e?o.inputs[t].description=n:o.outputs[t].description=n}));o(i,(0,P.functionalChange)("Node io description"))}),[o,ee]),rt=u.useCallback(((e,t,n)=>{const{from:o,to:i}=Y;if(fe&&fe.insId===e.id||me&&me.insId===e.id)K({from:void 0,to:void 0});else if("input"===n){const n={insId:e.id,pinId:t};!i||i.pinId!==t||(0,l.isInternalConnectionNode)(i)&&i.insId!==e.id?fe?Je(fe,n,"pinClick"):K({to:n,selected:[]}):K({to:void 0})}else{const n={insId:e.id,pinId:t};!o||o.pinId!==t||(0,l.isInternalConnectionNode)(o)&&o.insId!==e.id?me?Je(n,me,"pinClick"):K({from:n,selected:[]}):K({from:void 0})}}),[Y,fe,K,Je,me]);(0,v.useEffect)((()=>{if(!Se&&et.width){const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);We(t);const n=setTimeout((()=>{const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);e.thumbnailMode||We(t),Te(!0)}),100);return()=>clearTimeout(n)}}),[ee,ie,et,e.thumbnailMode,Se,ce,We]);const at=u.useCallback((()=>{const{selected:e}=Y,t=ee.instances.filter((t=>e.includes(t.id))).map((e=>({...e,id:e.id+"-copy"}))),n=ee.connections.filter((t=>{let{from:n,to:o}=t;return e.includes(n.insId)&&e.includes(o.insId)}));s({instances:t,connections:n})}),[Y,s,ee]),ut=u.useCallback((()=>{const{newNode:t,newInstances:n}=(0,R.pasteInstancesCommand)(ee,tt.current,e.clipboardData);o(t,(0,P.functionalChange)("paste instances")),K({selected:n.map((e=>e.id))})}),[o,K,ee,e.clipboardData]),lt=u.useCallback((()=>{const e=ee.id;Ke?"input"===Ke.type?Ke.ins.id===e?it(Ke.pin,"input"):rt(Ke.ins,Ke.pin,"input"):Ke.ins.id===e?it(Ke.pin,"output"):rt(Ke.ins,Ke.pin,"output"):console.warn("tried selecting closest with no pin nearby")}),[ee.id,Ke,it,rt]),ct=u.useCallback(((e,t)=>{const n=Math.min(Math.max(e,.1),3),o="mouse"===t?tt.current:{x:Fe.pos.x+et.width/2,y:Fe.pos.y+et.height/2},i=(0,m.centerBoardPosOnTarget)(o,et,n,Fe);We({...Fe,zoom:n,pos:i})}),[We,Fe,et]);(0,g.useHotkeys)("cmd+=",(e=>{ct(Fe.zoom+.1,"hotkey"),e.preventDefault()}),{text:"Zoom in board",group:"Viewport Controls"},[Fe,ct],Ge),(0,g.useHotkeys)("cmd+-",(e=>{ct(Fe.zoom-.1,"hotkey"),e.preventDefault()}),{text:"Zoom out board",group:"Viewport Controls"},[ct,Fe.zoom],Ge),(0,g.useHotkeys)("cmd+o",(e=>{e.preventDefault(),(0,O.toastMsg)("Ordering");const t=[];(0,_.orderVisualNode)(ee,ce,200,((e,n)=>{n%3==0&&t.push(e)})),(async()=>{for(;t.length;){const e=t.shift();(0,O.toastMsg)(`Step ${t.length}!`),await(0,l.delay)(200),o(e,(0,P.metaChange)("order-step")),(0,O.toastMsg)(`Step ${t.length}! done`)}})()}),{text:"Auto-layout (experimental)",group:"Misc."},[o,ee,ne],Ge),(0,g.useHotkeys)("cmd+0",(e=>{ct(1),e.preventDefault()}),{text:"Reset zoom",group:"Viewport Controls"},[Fe,ct],Ge);const dt=()=>{K({from:void 0,to:void 0,selected:[]})},pt=u.useCallback(((e,t)=>{xe(e.id),o({...ee},(0,P.metaChange)("drag-start"))}),[o,ee]),ft=u.useCallback(((e,t,n)=>{const{newValue:i,newSelected:s}=(0,m.handleInstanceDrag)(ee,e,n,t,pe,Ce);o(i,(0,P.metaChange)("drag-move")),s&&K({selected:s})}),[Ce,o,K,pe,ee]),mt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),xe(void 0)}),[]),ht=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),xe(l.THIS_INS_ID)}),[]),vt=u.useCallback((async(t,n,o,i)=>{o.preventDefault(),o.stopPropagation();const{x:s,y:r}=i,a=(0,h.produce)(ee,(e=>{"input"===t?e.inputsPosition[n]={x:s,y:r}:e.outputsPosition[n]={x:s,y:r}}));e.onChangeNode(a,(0,P.metaChange)("node-io-drag-move"))}),[e,ee]),gt=u.useCallback((async(e,t,n,o)=>{n.preventDefault(),n.stopPropagation(),xe(void 0)}),[]),yt=u.useCallback(((e,t)=>{let{id:n}=e;const o=t.shiftKey?pe.filter((e=>e!==n)):[],i=t.shiftKey?[...pe,n]:[n],s=pe.includes(n)?o:i;K({selected:s,from:void 0,to:void 0})}),[K,pe]),bt=u.useCallback((()=>{const e=ee.instances.map((e=>e.id));K({selected:e,from:void 0,to:void 0})}),[K,ee.instances]),It=u.useCallback((e=>{const t=ve.filter((t=>{let{from:n,to:o}=t;return-1===e.indexOf(n.insId)&&-1===e.indexOf(o.insId)})),n=(0,h.produce)(ee,(n=>{n.connections=t,n.instances=n.instances.filter((t=>!e.includes(t.id)))}));K({selected:[]}),o(n,(0,P.functionalChange)("delete-ins"))}),[ve,o,K,ee]),Ct=u.useCallback((e=>{It([e.id])}),[It]),xt=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{"input"===e?(delete n.inputs[t],n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===t)))):(n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===t))),n.completionOutputs=(n.completionOutputs||[]).map((e=>e.split("+").filter((e=>e!==t)).join("+"))).filter((e=>!!e)),delete n.outputs[t])}));fe&&fe.insId===l.THIS_INS_ID&&fe.pinId===t?K({from:void 0}):me&&me.insId===l.THIS_INS_ID&&me.pinId===t&&K({to:void 0}),o(n,(0,P.functionalChange)("remove io pin"))}),[ee,fe,me,o,K]),wt=u.useCallback((async()=>{const{selected:e,from:t,to:n}=Y;0===e.length?t&&(0,l.isExternalConnectionNode)(t)?await He(`Are you sure you want to remove main input ${t.pinId}?`)&&xt("input",t.pinId):n&&(0,l.isExternalConnectionNode)(n)&&await He(`Are you sure you want to remove main output ${n.pinId}?`)&&xt("output",n.pinId):It(e)}),[He,Y,It,xt]),_t=u.useCallback(((e,t,n)=>{const i=(0,m.getInstancePinConfig)(ee,e.id,t),s=(0,l.isStickyInputPinConfig)(i)?(0,w.queueInputPinConfig)():(0,l.stickyInputPinConfig)();o((0,m.changePinConfig)(ee,e.id,t,s),(0,P.functionalChange)("toggle-sticky")),ue("togglePinSticky",{isSticky:(0,l.isStickyInputPinConfig)(s)})}),[o,ee,ue]),jt=u.useCallback((()=>{const{newNode:e,newInstances:t}=(0,L.handleDuplicateSelectedEditorCommand)(ee,pe);o(e,(0,P.functionalChange)("duplicated instances")),K({selected:t.map((e=>e.id))})}),[o,K,ee,pe]),Nt=u.useCallback((e=>{const t=e.nativeEvent.target;if(0===e.button&&Z(e.nativeEvent,ee.id)&&t&&"board-editor-inner"===t.className){if(Date.now()-Ne<300)return void te(e);Oe(Date.now());const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,nt),o=(0,m.domToViewPort)(n,Fe,le);_e({from:o,to:o})}}),[ee.id,Fe,Ne,nt,le,te]),Ot=u.useCallback((e=>{if(Be(null),Z(e.nativeEvent,ee.id)&&we){if((0,m.calcSelectionBoxArea)(we)>50){const t=(0,m.getInstancesInRect)(we,ce,Fe,Kt.current,ee.instances,nt,le),n=e.shiftKey?[...pe,...t]:t;K({selected:n})}_e(void 0)}}),[ee.id,ee.instances,we,ce,Fe,nt,le,pe,K]),Pt=u.useCallback((e=>{if(!Z(e.nativeEvent,ee.id))return void(Ge.current=!1);Ge.current=!0;const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,(0,C.vAdd)(nt,C.vZero)),o=(0,m.domToViewPort)(n,Fe,le);we&&_e({...we,to:o});const i=(0,m.findClosestPin)(ee,ce,n,nt,Q,X,Fe),s=Ke;if(i){(!s||s.ins!==i.ins||s.ins===i.ins&&s.pin!==i.pin)&&Qe({ins:i.ins,type:i.type,pin:i.id})}tt.current=o,K({lastMousePos:tt.current})}),[ee,nt,Fe,le,we,ce,Q,X,Ke,K]),Et=u.useCallback((e=>{var t;"bp5-menu"!==(null===(t=e.relatedTarget)||void 0===t?void 0:t.className)&&(Qe(void 0),Ge.current=!1)}),[]),St=u.useCallback(((e,t)=>{if(t){const t=(0,l.isInlineNodeInstance)(e)?e.node:(0,G.safelyGetNodeDef)(e.nodeId,ce);if(!t)throw new Error("Impossible state inspecting inexisting node");if(!(0,l.isVisualNode)(t))return void(0,O.toastMsg)("Cannot inspect a non visual node","warning");ze({insId:`${Q}.${e.id}`,node:t})}else if((0,l.isRefNodeInstance)(e)){const t=(0,G.safelyGetNodeDef)(e,ce);r(t)}else{const t=e.node;if(!(0,l.isInlineValueNode)(t))return void((0,l.isVisualNode)(t)?ze({insId:e.id,node:t}):(0,O.toastMsg)("Editing this type of node is not supported"));const n=atob(t.dataBuilderSource);Ve({insId:e.id,templateType:t.templateType,value:n,type:"existing"}),(0,O.toastMsg)("Editing inline visual node not supported yet")}}),[r,ce,Q]),Tt=u.useCallback((e=>{if((0,l.isInlineNodeInstance)(e)){const t=e.node;if(!(0,l.isVisualNode)(t))return void(0,O.toastMsg)("Not supported","warning");const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.filter((t=>t.id!==e.id)),n.connections=n.connections.filter((t=>{let{from:n,to:o}=t;return n.insId!==e.id&&o.insId!==e.id})),n.instances.push(...t.instances),n.connections.push(...t.connections.filter((e=>(0,l.isInternalConnectionNode)(e.from)&&(0,l.isInternalConnectionNode)(e.to))))}));o(n,{type:"functional",message:"ungroup"}),K({selected:[]})}else{const t=(0,G.safelyGetNodeDef)(e.nodeId,ce);if(!(0,l.isVisualNode)(t))return void(0,O.toastMsg)("Not supported","warning")}}),[ee,o,K,ce]),Dt=u.useCallback((async e=>{}),[]),Mt=u.useCallback(((e,t)=>{const n=(0,V.handleDetachConstEditorCommand)(ee,e.id,t);o(n,(0,P.functionalChange)("detach-const"))}),[o,ee]),kt=u.useCallback(((e,t)=>{const n=e.inputConfig[t]||(0,w.queueInputPinConfig)();(0,l.isStaticInputPinConfig)(n)&&(Re(n.value),O.AppToaster.show({message:"Value copied"}))}),[]),Rt=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{const o=n.instances.find((t=>t.id===e.id));if(!o)throw new Error("Impossible state");o.inputConfig[t]=(0,l.staticInputPinConfig)(ke),n.connections=n.connections.filter((n=>!(0,l.isInternalConnectionNode)(n.to)||!(n.to.insId===e.id&&n.to.pinId===t)))}));o(n,(0,P.functionalChange)("paste const value"))}),[ee,o,ke]),At=u.useCallback((async e=>{const t=await qe("New name?");if(!t)return;const n=(0,h.produce)(ee,(n=>{var o;"input"===e?(ee.inputs||(n.inputs={}),n.inputs[t]=(0,l.nodeInput)(),n.inputsPosition[t]=tt.current):(ee.outputs||(n.outputs={}),n.outputs[t]=(0,l.nodeOutput)(),n.outputsPosition[t]=tt.current,(null===(o=n.completionOutputs)||void 0===o?void 0:o.length)&&(0,O.toastMsg)("Note that this node has explicit completion outputs set. You may need to update them."))}));o(n,(0,P.functionalChange)("add new io pin")),ue("addIoPin",{type:e})}),[qe,ee,o,ue]),Vt=u.useCallback((async()=>{var e;const t=null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","),n=await qe("Edit completion outputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,h.produce)(ee,(e=>{e.completionOutputs=""===n?void 0:n.split(",")}));o(e,(0,P.functionalChange)("change node completions")),ue("editCompletionOutputs",{count:n?n.split(",").length:0})}}),[qe,o,ee,ue]),Lt=u.useCallback((async()=>{var e;const t=null===(e=ee.reactiveInputs)||void 0===e?void 0:e.join(","),n=await qe("Edit reactive inputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,h.produce)(ee,(e=>{e.reactiveInputs=""===n?void 0:n.split(",")}));o(e,(0,P.functionalChange)("change reactive inputs")),ue("editReactiveInputs",{count:n?n.split(",").length:0})}}),[qe,o,ee,ue]),zt=u.useCallback((async()=>{const e=await qe("Description?",ee.description),t=(0,h.produce)(ee,(t=>{t.description=e}));o(t,(0,P.functionalChange)("Edit node description"))}),[qe,o,ee]),$t=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{t.defaultStyle=e}));o(t,(0,P.functionalChange)("change default style")),ue("changeStyle",{isDefault:!0})}),[o,ee,ue]),Ht=u.useCallback((async(e,t)=>{const n=await qe("New name?",t)||t,i=(0,m.handleIoPinRename)(ee,e,t,n);o(i,(0,P.functionalChange)("rename io pin"))}),[ee,o,qe]),qt=u.useCallback(((e,t)=>{const n=(0,m.handleChangeNodeInputType)(ee,e,t);o(n,(0,P.functionalChange)("toggle io pin optional"))}),[ee,o]),Ft=u.useCallback((e=>{switch(e.type){case H.ActionType.RemoveNode:{const e=(0,h.produce)(ee,(e=>{if(!(0,l.isVisualNode)(ee))throw new Error("Impossible state, deleting instances opf non visual node");e.instances=e.instances.filter((e=>!pe.includes(e.id))),e.connections=e.connections.filter((e=>!pe.includes(e.from.insId)&&!pe.includes(e.to.insId)))}));K({selected:[]}),o(e,(0,P.functionalChange)("remove-instances")),(0,O.toastMsg)(`Removed ${pe.length} instances(s)`),ue("deleteInstances",{count:pe.length});break}case H.ActionType.Inspect:if(1===pe.length)J(pe[0]);else if(fe||me){const e=null!=fe?fe:me,t=(0,l.isExternalConnectionNode)(e)?l.ROOT_INS_ID:e.insId;J(t,{type:fe?"output":"input",id:e.pinId})}ue("openInspectMenu",{source:"actionMenu"});break;case H.ActionType.Group:(async()=>{await Ye()})();break;case H.ActionType.UnGroup:{const e=ee.instances.find((e=>e.id===pe[0]));Tt(e);const t=(0,G.safelyGetNodeDef)(e,ce);(0,O.toastMsg)(`Ungrouped inline node ${t.id}`),ue("unGroupNode",{instancesCount:t.instances.length});break}case H.ActionType.AddInlineValue:Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"actionMenu"});break;case H.ActionType.AddNode:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,h.produce)(ee,(e=>{e.instances.push(r)})),u=(0,h.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,P.functionalChange)("add new instance")),K(u),(0,O.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;case H.ActionType.AI:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,h.produce)(ee,(e=>{e.instances.push(r)})),u=(0,h.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,P.functionalChange)("add new instance")),K(u),(0,O.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;default:(0,O.toastMsg)(`${e.type} not supported yet`)}}),[Y,fe,o,K,Ye,re,J,Tt,ee,ce,ue,pe,me,Fe,et]),Gt=()=>{const t=Y.from;return(0,p.entries)(be).map((n=>{let[o,s]=n;return(0,a.jsx)(I.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"input",pos:ge[o]||{x:0,y:0},id:o,onDelete:i?xt:void 0,onRename:i?Ht:void 0,onDblClick:Zt,closest:!(!Ke||"input"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,inputMode:s.mode,onChangeInputMode:qt,viewPort:Fe,onDragStart:ht,onDragEnd:gt,onDragMove:vt,onSelect:it,onSetDescription:st,selected:(null==t?void 0:t.pinId)===o,description:s.description,onMouseUp:_n,onMouseDown:wn},o)}))},Ut=()=>{const{to:t}=Y;return(0,p.entries)(Ie).map((n=>{let[o,s]=n;return(0,a.jsx)(I.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"output",pos:ye[o]||{x:0,y:0},id:o,onDelete:i?xt:void 0,onRename:i?Ht:void 0,closest:!(!Ke||"output"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,viewPort:Fe,onDragStart:ht,onDragEnd:gt,onDragMove:vt,onSelect:it,onSetDescription:st,description:s.description,selected:(null==t?void 0:t.pinId)===o,onMouseUp:_n,onMouseDown:wn},o)}))},Bt=()=>{if(we){const{from:e,to:t}=we,n=(0,m.logicalPosToRenderedPos)(e,Fe),o=(0,m.logicalPosToRenderedPos)(t,Fe),{x:i,y:s,w:r,h:u}=(0,m.getSelectionBoxRect)(n,o);return(0,a.jsx)("div",{className:"selection-box",style:{top:s,left:i,width:r,height:u}})}return null},Wt=u.useCallback((async(e,t,n,o)=>{if("input"===n){const n=e.inputConfig[t],o=(0,l.isStaticInputPinConfig)(n)?JSON.stringify(n.value):void 0;Ve({type:"static-input",insId:e.id,pinId:t,value:null!=o?o:JSON.stringify("Some static value")}),ue("addValueModalOpen",{source:"dblClickPin"})}else{const i=(0,G.safelyGetNodeDef)(e,ce);if(!(0,l.getNodeOutputs)(i)[t])throw new Error("Dbl clicked on un-existing pin");Me({pos:{x:o.clientX,y:o.clientY},ins:e,targetNode:i,pinId:t,pinType:n})}}),[ce,ue]),Zt=u.useCallback((async(e,t)=>{if(!ee.inputs[e])throw new Error("Dbl clicked on un-existing pin");Me({pos:{x:t.clientX,y:t.clientY},pinId:e,pinType:"input",targetNode:ee})}),[ee]),Jt=u.useCallback((e=>{if(e.metaKey||e.ctrlKey){const t=-.005*e.deltaY;ct(Fe.zoom+t,"mouse"),e.preventDefault(),e.stopPropagation()}else{if(se)return;const t=e.deltaX,n=e.deltaY,o=(0,h.produce)(Fe,(e=>{e.pos.x=e.pos.x+t/e.zoom,e.pos.y=e.pos.y+n/e.zoom}));We(o),e.stopPropagation(),e.preventDefault()}}),[se,ct,We,Fe]);(0,v.useEffect)((()=>{const{current:e}=Xe;if(e)return e.addEventListener("wheel",Jt),()=>{e.removeEventListener("wheel",Jt)}}),[Jt]);const Yt={backgroundPositionX:(0,m.roundNumber)(-Fe.pos.x*Fe.zoom),backgroundPositionY:(0,m.roundNumber)(-Fe.pos.y*Fe.zoom),backgroundSize:(0,m.roundNumber)(10*Fe.zoom)+"px"},Kt=u.useRef(new Map);u.useEffect((()=>{const e=he.reduce(((e,t)=>{const n=(0,G.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeInputs)(n))),e}),new Map),t=he.reduce(((e,t)=>{const n=(0,G.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeOutputs)(n))),e}),new Map);e.set(l.THIS_INS_ID,(0,l.keys)(ee.outputs)),t.set(l.THIS_INS_ID,(0,l.keys)(ee.inputs));const n=ve.filter((n=>{const o=e.get(n.to.insId)&&e.get(n.to.insId).includes(n.to.pinId),i=t.get(n.from.insId)&&t.get(n.from.insId).includes(n.from.pinId);return!(o&&i)}));if(n.length>0){(0,O.toastMsg)(`${n.length} orphan connections removed`,"warning"),console.warn(`${n.length} orphan connections removed`,n);const e=(0,h.produce)(ee,(e=>{e.connections=ee.connections.filter((e=>!n.includes(e)))}));o(e,(0,P.functionalChange)("prune orphan connections"))}}),[he,o,ve,ee,ce]),u.useEffect((()=>{let e=[];const t=(0,h.produce)(ee,(t=>{t.instances=t.instances.map((t=>{const n=(0,G.safelyGetNodeDef)(t,ce);if(n){const o=(0,l.getNodeInputs)(n),i=(0,l.getNodeOutputs)(n);if(t.visibleInputs){const n=t.visibleInputs.filter((e=>!o[e]));n.length>0&&(t.visibleInputs=(0,l.keys)(o),e.push(...n))}if(t.visibleOutputs){const n=t.visibleOutputs.filter((e=>!i[e]));n.length>0&&(t.visibleOutputs=(0,l.keys)(i),e.push(...n))}}return t}))}));e.length>0&&((0,O.toastMsg)(`Found ${e.length} invalid visible inputs/outputs: ${e.join(", ")}. Reset them`,"warning"),o(t,(0,P.functionalChange)("reset corrupt visible inputs/outputs")))}),[he,o,ee,ce]),(0,v.useEffect)((()=>{const e=new Map(he.map((e=>[e.id,e])));Kt.current=ve.reduce(((t,n)=>{const o=t.get(n.to.insId)||{},i=o[n.to.pinId]||[],s={...o,[n.to.pinId]:[...i,e.get(n.from.insId)]};return t.set(n.to.insId,s),t}),new Map)}),[ve,he]);const Qt=u.useCallback((()=>{Me(void 0)}),[]),Xt=u.useCallback((async e=>{if(!De)throw new Error("impossible state - quick add menu invoked but not available");const{ins:t,pinId:n}=De;switch(e.type){case"import":case"node":{const i="import"===e.type?await re(e.importableNode):ce,s="import"===e.type?e.importableNode.node:e.node,r=(0,m.createNewNodeInstance)(s.id,100,tt.current,i);if(r){const e=(0,h.produce)(ee,(e=>{e.instances.push(r),e.connections.push({from:{insId:t?t.id:l.THIS_INS_ID,pinId:n},to:{insId:r.id,pinId:l.TRIGGER_PIN_ID}})}));o(e,(0,P.functionalChange)("add-item-quick-menu")),Qt()}ue("addNode",{nodeId:s.id,source:"quickAdd"});break}case"value":if(!t)return void(0,O.toastMsg)("Cannot add value to main input");Ve({type:"new-output",insId:t.id,pinId:n}),ue("addValueModalOpen",{source:"quickAdd"})}}),[De,ce,ue,ee,o,Qt,re]),en=u.useCallback((async()=>{const e=JSON.stringify(ee);await navigator.clipboard.writeText(e),O.AppToaster.show({message:"Copied!"})}),[ee]),tn=u.useCallback((()=>{var e,t;const n=i?"":" (cannot edit main node, only visual)";return(0,a.jsxs)(b.Menu,{children:[(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"New Value",onClick:(0,p.preventDefaultAnd)((()=>{Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"contextMenu"})}))}),(0,a.jsx)(b.MenuItem,{text:`New input ${n}`,onMouseDown:e=>e.stopPropagation(),onClick:(0,p.preventDefaultAnd)((()=>At("input"))),disabled:!i}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`New output ${n}`,onClick:(0,p.preventDefaultAnd)((()=>At("output"))),disabled:!i}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Copy node to clipboard",onClick:(0,p.preventDefaultAnd)(en)}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Completion Outputs (${(null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Vt()))}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Reactive inputs (${(null===(t=ee.reactiveInputs)||void 0===t?void 0:t.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Lt()))}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Edit description",onClick:(0,p.preventDefaultAnd)((()=>zt()))}),(0,a.jsx)(b.MenuDivider,{}),(0,a.jsx)(b.MenuItem,{text:"Default Style",children:(0,a.jsx)(z.NodeStyleMenu,{style:ee.defaultStyle,onChange:$t,promptFn:qe})})]})}),[i,en,ee.completionOutputs,ee.reactiveInputs,ee.defaultStyle,$t,qe,ue,At,Vt,Lt,zt]);(0,g.useHotkeys)("shift+c",ot,{text:"Center viewport",group:"Viewport Controls"},[],Ge),(0,g.useHotkeys)("cmd+c",at,{text:"Copy instances",group:"Editing"},[],Ge),(0,g.useHotkeys)("cmd+v",ut,{text:"Paste instances",group:"Editing"},[],Ge),(0,g.useHotkeys)("esc",dt,{text:"Clear selections",group:"Selection"},[],Ge),(0,g.useHotkeys)("backspace",wt,{text:"Delete instances",group:"Editing"},[],Ge),(0,g.useHotkeys)("shift+d",jt,{text:"Duplicate selected instances",group:"Editing"},[],Ge),(0,g.useHotkeys)("cmd+a",bt,{text:"Select all",group:"Selection"},[],Ge),(0,g.useHotkeys)("s",lt,{text:"Select pin closest to mouse",group:"Selection"},[],Ge);const nn=u.useCallback(((e,t)=>{if(!Le)throw new Error("impossible state");const n=(0,h.produce)(ee,(t=>{const n=t.instances.find((e=>e.id===Le.insId));if(!n||!(0,l.isInlineNodeInstance)(n))throw new Error("impossible state");n.node=e}));o(n,(0,P.functionalChange)("Inner change: "+t.message)),ze((t=>({...t,node:e})))}),[o,Le,ee]),[on,sn]=(0,v.useState)({selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}}),rn=u.useCallback((e=>sn((t=>({...t,...e})))),[]),an=n=>Le&&Le.insId===n.id?{currentInsId:Le.insId,ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),boardData:on,onChangeBoardData:rn,resolvedDependencies:ne,onCopy:s,clipboardData:e.clipboardData,onInspectPin:e.onInspectPin,onGoToNodeDef:e.onGoToNodeDef,nodeIoEditable:e.nodeIoEditable,node:Le.node,onChangeNode:nn,onShowOmnibar:te,parentViewport:t.defaultViewPort,parentBoardPos:nt,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:e.queuedInputsData}:void 0,un=()=>{if(fe&&("input"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"output"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(e)&&!(0,l.isInternalConnectionNode)(fe))return;return{from:fe,to:e}}if(me&&("output"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"input"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(me)&&!(0,l.isInternalConnectionNode)(e))return;return{from:e,to:me}}},ln=()=>{const e=un();if(e){const{from:t,to:n}=e;return{connection:{from:t,to:n},type:ve.some((t=>(0,l.connectionDataEquals)(t,e)))?"future-remove":"future-add"}}},cn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleInputs:t}:n))}));o(n,(0,P.functionalChange)("change instance visible inputs"))}),[ee,o]),dn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,style:t}:n))}));o(n,(0,P.functionalChange)("change instance style")),ue("changeStyle",{isDefault:!1})}),[o,ee,ue]),pn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleOutputs:t}:n))}));o(n,(0,P.functionalChange)("change instance visible outputs"))}),[ee,o]),fn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,displayName:t}:n))}));o(n,(0,P.functionalChange)("change instance display name"))}),[ee,o]);u.useImperativeHandle(n,(()=>({centerInstance(e){const t=ee.instances.find((t=>t.id===e));if(t){const e=(0,C.vSub)(t.pos,(0,C.vec)(et.width/2,et.height/2));We({...Fe,pos:e})}},centerViewPort(){ot()},getViewPort:()=>Fe,clearSelection:()=>{dt()},requestNewInlineValue:()=>{Ve({type:"new-floating",pos:tt.current})}})));const[mn,hn]=u.useState([]),vn=u.useCallback(((e,t)=>{const n=t.trim().substr(0,100),i=`Inline-value-${n.substr(0,15).replace(/["'`]/g,"")}`,s=(0,S.createInlineValueNode)({code:t,customView:n,nodeId:i,type:e});switch(Ae.type){case"existing":{const[e]=ee.instances.filter((e=>e.id===Ae.insId)).filter((e=>(0,l.isInlineNodeInstance)(e))).map((e=>e.node));if(!e)throw new Error("Unable to find inline node to save to");const t=(0,l.keys)(e.inputs),n=(0,l.keys)(s.inputs),i=new Set(T.default.difference(t,n)),r=(0,h.produce)(ee,(e=>{e.instances=e.instances.map((e=>e.id===Ae.insId?(0,l.inlineNodeInstance)(e.id,s,e.inputConfig,e.pos):e)),e.connections=e.connections.filter((e=>!(e.to.insId===Ae.insId&&i.has(e.to.pinId))))}));o(r,(0,P.functionalChange)("change inline value")),Ve(void 0);break}case"static-input":{let e;try{const n=t.replace(/^['`]/,'"').replace(/['`]$/,'"');e=JSON.parse(n)}catch(r){return void(0,O.toastMsg)("Input values must not be formulas or code")}const n=(0,h.produce)(ee,(t=>{t.instances.find((e=>e.id===Ae.insId)).inputConfig[Ae.pinId]=(0,l.staticInputPinConfig)(e)}));o(n,(0,P.functionalChange)("set static input value")),Ve(void 0);break}case"new-floating":{const e=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},Ae.pos),t=(0,h.produce)(ee,(t=>{t.instances.push(e)}));o(t,(0,P.functionalChange)("new floating value")),Ve(void 0);break}case"new-output":{const{insId:e,pinId:t}=Ae,n=ee.instances.find((t=>t.id===e));if(!n)throw new Error("Impossible state");const i=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},(0,C.vAdd)(n.pos,{x:-50,y:150})),r=(0,h.produce)(ee,(n=>{n.instances.push(i),n.connections.push({from:(0,l.connectionNode)(e,t),to:(0,l.connectionNode)(i.id,l.TRIGGER_PIN_ID)})}));o(r,(0,P.functionalChange)("new value connected to output")),Ve(void 0)}}ue("addValue",{type:e,placeholdersCount:(0,l.keys)(s.inputs).length})}),[Ae,o,ee,ue]),gn=ve.filter((e=>{const t=un();return!t||!(0,l.connectionDataEquals)(t,e)})),yn=u.useCallback((()=>{ze(void 0),sn(t.defaultBoardData)}),[]),bn=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{const n=t.connections.find((t=>(0,l.connectionDataEquals)(t,e)));n.hidden=!n.hidden}));o(t,(0,P.functionalChange)("toggle connection hidden"))}),[o,ee]),In=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{t.connections=t.connections.filter((t=>!(0,l.connectionDataEquals)(t,e)))}));o(t,(0,P.functionalChange)("remove connection"))}),[o,ee]),Cn=u.useCallback(((e,t,n)=>{Be("input"===n?{to:(0,l.connectionNode)(e.id,t),from:void 0}:{from:(0,l.connectionNode)(e.id,t),to:void 0})}),[]),xn=u.useCallback(((e,t,n)=>{Ue&&(Ue.from&&"input"===n?Je(Ue.from,(0,l.connectionNode)(e.id,t),"pinDrag"):Ue.to&&"output"===n&&Je((0,l.connectionNode)(e.id,t),Ue.to,"pinDrag")),Be(null)}),[Ue,Je]),wn=u.useCallback(((e,t)=>{}),[]),_n=u.useCallback(((e,t)=>{Ue&&(Ue.from&&"output"===t?Je(Ue.from,(0,l.externalConnectionNode)(e),"nodeIoPinDrag"):Ue.to&&"input"===t&&Je((0,l.externalConnectionNode)(e),Ue.to,"nodeIoPinDrag"))}),[Ue,Je]);try{return(0,a.jsxs)(b.ContextMenu,{className:(0,k.default)("visual-node-editor",e.className,{dark:ae}),"data-id":ee.id,content:tn(),disabled:!Ge.current,children:[(0,a.jsxs)("main",{className:"board-editor-inner",onMouseDown:Nt,onMouseUp:Ot,onMouseMove:Pt,onMouseLeave:Et,ref:Xe,style:Yt,children:[(0,a.jsx)(u.Fragment,{children:(0,a.jsx)(j.LayoutDebugger,{vp:Fe,node:ee,extraDebug:m.emptyList,mousePos:tt.current})}),(0,a.jsx)(d.ConnectionView,{resolvedNodes:ce,currentInsId:Q,ancestorsInsIds:X,size:et,node:ee,boardPos:nt,instances:he,connections:gn,futureConnection:ln(),onDblClick:l.noop,viewPort:Fe,parentVp:le,selectedInstances:pe,toggleHidden:bn,removeConnection:In,lastMousePos:tt.current,draggedSource:Ue}),Gt(),he.map((t=>{var n,o,i,s,r;return(0,a.jsx)(c.InstanceView,{onUngroup:Tt,onExtractInlineNode:Dt,onDetachConstValue:Mt,onCopyConstValue:kt,onPasteConstValue:Rt,copiedConstValue:ke,connectionsPerInput:Kt.current.get(t.id)||m.emptyObj,node:(0,G.safelyGetNodeDef)(t,ce),ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),onPinClick:rt,onPinDblClick:Wt,onDragStart:pt,onDragEnd:mt,resolvedDeps:ce,onDragMove:ft,onDblClick:St,onSelect:yt,onToggleSticky:_t,selected:-1!==pe.indexOf(t.id),dragged:Ce===t.id,onInspectPin:Ze,selectedInput:me&&(0,l.isInternalConnectionNode)(me)&&me.insId===t.id?me.pinId:void 0,selectedOutput:fe&&(0,l.isInternalConnectionNode)(fe)&&fe.insId===t.id?fe.pinId:void 0,closestPin:Ke&&Ke.ins.id===t.id?Ke:void 0,queuedInputsData:null!==(n=oe[t.id])&&void 0!==n?n:m.emptyObj,instance:t,connections:ve,onTogglePinBreakpoint:l.noop,onTogglePinLog:l.noop,viewPort:Fe,onChangeVisibleInputs:cn,onChangeVisibleOutputs:pn,onSetDisplayName:fn,onDeleteInstance:Ct,forceShowMinimized:fe||(null===(o=null==Ue?void 0:Ue.to)||void 0===o?void 0:o.insId)===t.id?"input":me||(null===(i=null==Ue?void 0:Ue.from)||void 0===i?void 0:i.insId)===t.id?"output":void 0,isConnectedInstanceSelected:pe.some((e=>ve.some((n=>{let{from:o,to:i}=n;return o.insId===t.id&&i.insId===e||o.insId===e&&i.insId===t.id})))),inlineGroupProps:an(t),onCloseInlineEditor:yn,inlineEditorPortalDomNode:$e.current,onChangeStyle:dn,onGroupSelected:Ye,onPinMouseDown:Cn,onPinMouseUp:xn,hadError:null!==(r=null===(s=e.instancesWithErrors)||void 0===s?void 0:s.has((0,l.fullInsIdPath)(t.id)))&&void 0!==r&&r},t.id)})),Bt(),Ut(),(0,a.jsx)(q.MainInstanceEventsIndicator,{currentInsId:Q,ancestorsInsIds:X,viewPort:Fe}),De?(0,a.jsx)(x.QuickAddMenu,{targetNode:De.targetNode,pinId:De.pinId,pinType:De.pinType,pos:De.pos,resolvedDependencies:ne,node:ee,onAdd:Xt,onClose:Qt}):null,(0,a.jsxs)("div",{className:"viewport-controls-and-help",children:[(0,a.jsx)(b.Button,{small:!0,onClick:ot,minimal:!0,intent:"primary",children:"Center"}),(0,a.jsx)(B,{min:.15,max:3,stepSize:.05,labelStepSize:10,labelRenderer:W,onChange:ct,value:Fe.zoom}),je?(0,a.jsx)(F.HelpBubble,{}):null]}),Ae?(0,a.jsx)(E.InlineCodeModal,{env:m.emptyObj,initialValue:Ae.value,initialType:"existing"===Ae.type?Ae.templateType:void 0,onCancel:()=>Ve(void 0),onSubmit:vn}):null,(0,a.jsx)("div",{className:"inline-editor-portal-root"})]}),(0,a.jsx)(H.ActionsMenu,{showRunFlowOptions:je,onAction:Ft,selectedInstances:pe,node:ee,resolvedNodes:ce,to:me,from:fe,hotkeysEnabled:Ge})]})}catch(jn){return console.error(jn),(0,a.jsxs)("div",{children:["Error rendering board - ",jn.toString()]})}})));const Z=(e,t)=>{const n=e.target.closest(".visual-node-editor");return n&&n.getAttribute("data-id")===t}},83234:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeView=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=r(n(59349)),d=n(30653);t.BaseNodeView=function(e){const{dragged:t,viewPort:n,pos:o,onDragEnd:i,onDragMove:s,onDragStart:r,displayMode:p}=e,f=(0,d.useDarkMode)(),m=u.useCallback(((e,t)=>{r(e,t)}),[r]),h=u.useCallback(((e,t)=>{const s=o,r=(t.x-s.x)/n.zoom,a=(t.y-s.y)/n.zoom,u=s.x+r,l=s.y+a;i(e,{...t,x:u,y:l})}),[o,i,n]),v=u.useCallback(((e,t)=>{s(e,{x:t.x,y:t.y})}),[s]),g={transform:`scale(${n.zoom})`},y=(0,l.default)("base-node-view",e.className,{dragged:t,dark:f,"display-mode":p}),b=o.x*n.zoom-n.pos.x*n.zoom,I=o.y*n.zoom-n.pos.y*n.zoom,C={transform:`translate(${b-o.x}px, ${I-o.y}px)`},x=(0,l.default)("base-node-view-vp-fixer",{"display-mode":p}),w=(0,a.jsx)("span",{className:"base-node-view-wrapper",children:(0,a.jsx)("div",{className:y,style:g,id:e.domId,children:e.children})});return(0,a.jsx)("div",{className:x,style:C,children:(0,a.jsx)(c.default,{onStop:h,onStart:m,onDrag:v,position:o,cancel:".no-drag",children:w})})}},80510:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleConnectionCloseEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleConnectionCloseEditorCommand=(e,t)=>{let{from:n,to:o}=t;return(0,s.default)(e,(e=>{const t=e.connections.find((e=>{const t=(0,i.connectionNodeEquals)(n,e.from),s=(0,i.connectionNodeEquals)(o,e.to);return t&&s}));t?e.connections=e.connections.filter((e=>e!==t)):e.connections.push({from:n,to:o})}))}},1788:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDetachConstEditorCommand=void 0;const i=n(74762),s=o(n(53865)),r=n(68371);t.handleDetachConstEditorCommand=(e,t,n)=>(0,s.default)(e,(e=>{const{instances:o}=e,s=o.find((e=>e.id===t));if(!s)throw new Error("Impossible state ins id with no matching instance");const a=s.inputConfig[n];if(!a)throw new Error("impossible state detaching const from unexistent config");if(!(0,i.isStaticInputPinConfig)(a))throw new Error("impossible state detaching const with no value");const u=JSON.stringify(a.value),l=(0,r.createInlineValueNode)({code:`${u}`,type:i.InlineValueNodeType.VALUE}),c=(0,i.inlineNodeInstance)(`value-${(0,i.randomInt)(999)}`,l,{},{x:s.pos.x,y:s.pos.y-100});if(!e.instances.find((e=>e.id===s.id)))throw new Error("impossible state instance not found");s.inputConfig[n]=(0,i.queueInputPinConfig)(),e.instances.push(c),e.connections.push((0,i.connectionData)(`${c.id}.value`,`${s.id}.${n}`))}))},2130:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDuplicateSelectedEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleDuplicateSelectedEditorCommand=(e,t)=>{const n=[];return{newNode:(0,s.default)(e,(o=>{const s=o.instances;t.forEach((t=>{const o=s.find((e=>e.id===t));if(!o)throw new Error("impossible state duplicate selected no matching instance");if(o){const{pos:t}=o,r={...o,pos:{x:t.x+20,y:t.y+20},id:(0,i.createInsId)(e)};s.push(r),n.push(r.id)}}))})),newInstances:n}}},25044:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.pasteInstancesCommand=void 0;const i=n(74762),s=o(n(53865));t.pasteInstancesCommand=(e,t,n)=>{const o=n.instances.map((n=>({...n,pos:t,id:(0,i.createInsId)(e)}))),r=new Map(o.map(((e,t)=>[n.instances[t].id,e.id])));return{newNode:(0,s.default)(e,(e=>{e.instances.push(...o);const t=n.connections.map((e=>{let{from:t,to:n}=e;return{from:{...t,insId:r.get(t.insId)||t.insId},to:{...n,insId:r.get(n.insId)||n.insId}}}));e.connections.push(...t)})),newInstances:o}}},65082:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionView=t.SingleConnectionView=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=r(n(26372)),d=n(74762),p=n(18243),f=n(77852),m=n(74089),h=n(60190),v=n(50382),g=n(76064),y=n(41032);t.SingleConnectionView=e=>{const{isBrowser:t}=(0,f.useSsr)(),{connection:n,node:o,resolvedNodes:i,instances:s,type:r,viewPort:a,toggleHidden:l,parentSelected:m,removeConnection:b}=e,{from:I}=n,C=(0,d.isInternalConnectionNode)(I)&&s.find((e=>e.id===I.insId));if(!C&&(0,d.isInternalConnectionNode)(I))throw new Error(`impossible state - "from instance id - [${I.insId}] does not exist"`);const x=((0,d.isInternalConnectionNode)(I)&&C?(0,y.safelyGetNodeDef)(C,i):o).outputs[I.pinId],w=x&&x.delayed,_=t?(0,p.calcStartPos)({...e,connectionNode:I}):{x:0,y:0},j=t?(0,p.calcTargetPos)({...e,connectionNode:n.to}):{x:0,y:0},{x:N,y:O}=(0,h.vDiv)(_,e.parentVp.zoom),{x:P,y:E}=(0,h.vDiv)(j,e.parentVp.zoom),S=(0,c.default)({delayed:w,hidden:n.hidden,"parent-selected":m},r),T=(0,u.jsxs)(v.Menu,{children:[(0,u.jsx)(v.MenuItem,{text:n.hidden?"Show connection":"Hide connection",onClick:()=>l(n)}),(0,u.jsx)(v.MenuItem,{text:"Remove connection",onClick:()=>b(n)})]});return(0,u.jsx)(v.ContextMenu,{content:T,children:e=>(0,u.jsx)(g.ConnectionViewPath,{className:S,from:{x:N,y:O},to:{x:P,y:E},dashed:"regular"!==r,zoom:a.zoom,onContextMenu:e.onContextMenu})})};t.ConnectionView=e=>{var n;const{viewPort:o,futureConnection:i,toggleHidden:s,selectedInstances:r,draggedSource:c}=e,[d,f]=l.useState(0),h=l.useCallback((e=>requestAnimationFrame((()=>{f((e=>(e+1)%9)),e>0&&h(e-1)}))),[]);l.useEffect((()=>{const e=h(10);return()=>{cancelAnimationFrame(e)}}),[h]),l.useEffect((()=>{const e=()=>{h(3)};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[h,d]);const v=e.connections.map((n=>{const o=r.includes(n.from.insId)||r.includes(n.to.insId);return(0,a.createElement)(t.SingleConnectionView,{...e,connection:n,type:"regular",parentSelected:o,key:n.from.insId+n.from.pinId+n.to.insId+n.to.pinId})}));if(i&&v.push((0,a.createElement)(t.SingleConnectionView,{...e,connection:i.connection,type:i.type,toggleHidden:s,parentSelected:!1,key:"future"})),c){const t=(c.from?p.calcStartPos:p.calcTargetPos)({connectionNode:null!==(n=c.from)&&void 0!==n?n:c.to,viewPort:o,boardPos:e.boardPos,ancestorsInsIds:e.ancestorsInsIds,currentInsId:e.currentInsId});v.push((0,u.jsx)(g.ConnectionViewPath,{className:"dragged",from:t,to:(0,m.logicalPosToRenderedPos)(e.lastMousePos,o),zoom:o.zoom},"dragged"))}return(0,u.jsx)("span",{className:"connections-view",style:{opacity:o.zoom},children:(0,u.jsx)("svg",{style:{width:"100%"},children:v})})}},76064:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionViewPath=void 0;const i=n(35250),s=o(n(26372)),r=n(70079),a=n(23381);t.ConnectionViewPath=(0,r.forwardRef)(((e,t)=>{const{from:n,to:o,className:r,onContextMenu:u,zoom:l,dashed:c}=e,{x:d,y:p}=n,{x:f,y:m}=o,h=(0,a.calcBezierPath)({sourceX:d,sourceY:p,targetX:f,targetY:m,curvature:.15}),v=2.5*l,g=c?6*l:void 0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:h,ref:t,className:(0,s.default)("connection",r),style:{strokeWidth:v,strokeDasharray:g},onContextMenu:u}),e.label?(0,i.jsx)("text",{className:"label",x:(d+f)/2,y:(p+m)/2,fontSize:"12px"}):null,(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%"}),(0,i.jsx)("stop",{offset:"100%"})]})]})}))},23381:(e,t)=>{"use strict";var n;function o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i(e){let t,i,{pos:s,x1:r,y1:a,x2:u,y2:l,c:c}=e;switch(s){case n.Left:t=r-o(r-u,c),i=a;break;case n.Right:t=r+o(u-r,c),i=a;break;case n.Top:t=r,i=a-o(a-l,c);break;case n.Bottom:t=r,i=a+o(l-a,c)}return[t,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.getBezierCenter=t.calcBezierPath=t.Position=void 0,function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(n=t.Position||(t.Position={}));t.calcBezierPath=e=>{let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l});return`M${t},${o} C${c},${d} ${p},${f} ${r},${a}`},t.getBezierCenter=function(e){let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l}),m=.125*t+.375*c+.375*p+.125*r,h=.125*o+.375*d+.375*f+.125*a;return[m,h,Math.abs(m-t),Math.abs(h-o)]}},18243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcTargetPos=t.calcStartPos=t.calcPinPosition=void 0;const o=n(74762),i=n(30994),s={x:99999,y:99999};function r(e){const t=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds),pinId:e.pinId,pinType:e.pinType,isMain:e.isMain});return((e,t,n,o)=>{if(!e)return console.warn(`Cannot find element ${n} to calculate position.`),s;const{x:i,y:r,width:a,height:u}=e.getBoundingClientRect(),l=r+u/2;return{x:i+a/2-t.x,y:l-t.y}})(document.getElementById(t),e.boardPos,t,e.viewPort)}t.calcPinPosition=r;t.calcStartPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"input",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"output",boardPos:n,viewPort:s})};t.calcTargetPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"output",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"input",boardPos:n,viewPort:s})}},30994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPinDomId=t.getMainInstanceIndicatorDomId=t.getInstanceDomId=void 0;const o=n(74762);t.getInstanceDomId=(e,t)=>`ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getMainInstanceIndicatorDomId=(e,t)=>`main-ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getPinDomId=e=>{let{pinType:t,fullInsIdPath:n,pinId:o,isMain:i}=e;return`${i?"main-":""}pin:${t}:${n}:${o}`.replace(/\s+/g,"-")}},86553:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceView=t.getVisibleOutputs=t.getVisibleInputs=t.INSTANCE_INFO_TOOLTIP_DELAY=t.MAX_INSTANCE_WIDTH=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=n(66074),d=n(74762),p=r(n(26372)),f=n(2036),m=n(74762),h=n(74762),v=n(53159),g=n(83234),y=n(74762),b=n(30994),I=n(63521),C=n(74089),x=n(50382),w=r(n(99581)),_=n(88593),j=n(30653);t.PIECE_HORIZONTAL_PADDING=25,t.PIECE_CHAR_WIDTH=11,t.MIN_WIDTH_PER_PIN=40,t.MAX_INSTANCE_WIDTH=400,t.INSTANCE_INFO_TOOLTIP_DELAY=400;t.getVisibleInputs=(e,t,n)=>{const{visibleInputs:o}=e;if(o)return o;const i=(0,d.keys)((0,h.getNodeInputs)(t)).filter(((o,i)=>{var s;const r=n.some((t=>t.to.insId===e.id&&t.to.pinId===o)),a=t.inputs[o]&&"optional"===(null===(s=t.inputs[o])||void 0===s?void 0:s.mode);return r||!a&&o!==m.TRIGGER_PIN_ID}));return 0===i.length?[m.TRIGGER_PIN_ID]:i};t.getVisibleOutputs=(e,t,n)=>{const{visibleOutputs:o}=e;if(o)return o;const i=Object.keys(t.outputs);return n.some((t=>t.from.insId===e.id&&t.from.pinId===m.ERROR_PIN_ID))?[...i,m.ERROR_PIN_ID]:i};t.InstanceView=function(e){const{selected:n,selectedInput:o,selectedOutput:i,closestPin:s,dragged:r,onTogglePinLog:N,onTogglePinBreakpoint:O,onDetachConstValue:P,onCopyConstValue:E,onPasteConstValue:S,displayMode:T,connections:D,instance:M,viewPort:k,node:R,onPinClick:A,onPinDblClick:V,onDragStart:L,onDragEnd:z,onDragMove:$,onToggleSticky:H,onSelect:q,onDblClick:F,onChangeVisibleInputs:G,onChangeVisibleOutputs:U,onConvertConstToEnv:B,inlineGroupProps:W,onUngroup:Z,onExtractInlineNode:J,onGroupSelected:Y,isConnectedInstanceSelected:K,inlineEditorPortalDomNode:Q,onChangeStyle:X,onDeleteInstance:ee,onSetDisplayName:te,onPinMouseUp:ne,onPinMouseDown:oe}=e,ie=(0,j.useDarkMode)(),{id:se}=M,re=l.useMemo((()=>{const e=(0,d.randomInt)(6,1);return{icon:(0,d.pickRandom)([["fab","discord"],["fab","slack"],"bug","cube"]),color:e,size:(0,d.randomInt)(3,1),variation:(0,d.randomInt)(5,1)}}),[]),ae=l.useRef(),ue=l.useMemo((()=>M.style||R.defaultStyle||{}),[R,M]),le=ue.size||"regular",ce=l.useMemo((()=>new Map(D.filter((e=>{let{to:t}=e;return t.insId===se})).map((e=>{let{to:t,hidden:n}=e;return[t.pinId,n]})))),[D,se]),de=l.useMemo((()=>new Map(D.filter((e=>{let{from:t}=e;return t.insId===se})).map((e=>{let{from:t,hidden:n}=e;return[t.pinId,n]})))),[D,se]),pe=(0,C.usePrompt)(),fe=l.useCallback((e=>A(M,e,"input")),[M,A]),me=l.useCallback(((e,t)=>V(M,e,"input",t)),[M,V]),he=l.useCallback(((e,t)=>V(M,e,"output",t)),[M,V]),ve=l.useCallback((e=>A(M,e,"output")),[M,A]),ge=l.useCallback(((e,t)=>{L(M,e,t)}),[M,L]),ye=l.useCallback(((e,t)=>{const n=M.pos,o=(t.x-n.x)/k.zoom,i=(t.y-n.y)/k.zoom,s=n.x+o,r=n.y+i;z(M,e,{...t,x:s,y:r})}),[M,z,k.zoom]),be=l.useCallback(((e,t)=>{$(M,e,{x:t.x,y:t.y})}),[M,$]),Ie=l.useCallback((e=>H(M,e)),[M,H]),Ce=l.useCallback((e=>P(M,e)),[M,P]),xe=l.useCallback((e=>E(M,e)),[M,E]),we=l.useCallback((e=>S(M,e)),[M,S]),_e=l.useCallback((e=>q(M,e)),[M,q]),je=l.useCallback((e=>F(M,e.shiftKey)),[M,F]),Ne=(0,d.entries)(R.inputs),{visibleInputs:Oe,visibleOutputs:Pe}=M;Oe&&Ne.sort(((e,t)=>Oe.indexOf(e[0])-Oe.indexOf(t[0])));const Ee=(0,d.entries)(R.outputs);Pe&&Ee.sort(((e,t)=>Pe.indexOf(e[0])-Pe.indexOf(t[0])));const Se=(0,t.getVisibleInputs)(M,R,D),Te=(0,t.getVisibleOutputs)(M,R,D);Ne.push([m.TRIGGER_PIN_ID,{...(0,d.nodeInput)(),description:"Use this pin to manually trigger the node. If not connected, the node will be triggered automatically when all required inputs have data."}]),Ee.push([m.ERROR_PIN_ID,{...(0,m.nodeOutput)(),description:"Use this pin to catch errors that happen inside this node. If not connected, errors will bubble up to the parent node."}]);const De=Ne.filter((e=>{let[t]=e;return Se.includes(t)||(n||K)&&ce.has(t)})),Me=Ee.filter((t=>{let[o]=t;return Te.includes(o)||(n||K)&&de.has(o)||o===m.ERROR_PIN_ID&&e.hadError})),ke=D.some((e=>e.from.insId===se&&e.from.pinId===m.ERROR_PIN_ID)),Re=(0,p.default)("ins-view",{"no-inputs":0===Ne.length,"no-outputs":0===Ee.length,"display-mode":T,"force-minimized-input":"input"===e.forceShowMinimized||"both"===e.forceShowMinimized,"force-minimized-output":"output"===e.forceShowMinimized||"both"===e.forceShowMinimized,"inline-node-edited":!!W,"error-caught":ke}),Ae=(0,p.default)({selected:n,dragged:r,closest:s&&s.ins.id===M.id},`size-${le}`),Ve=new Set((0,d.entries)(R.inputs).filter((e=>{let[t,n]=e;return(0,m.isInputPinOptional)(n)})).map(d.pickFirst)),Le=(0,d.entries)(M.inputConfig).reduce(((e,t)=>{let[n,o]=t;return(0,m.isStickyInputPinConfig)(o)||o.sticky?{...e,[n]:!0}:e}),{}),ze=(0,v.calcNodeContent)(M,R),$e=e=>{const t=M.inputConfig[e];if((0,y.isStaticInputPinConfig)(t))return t.value},He=l.useCallback((async()=>{const e=(0,d.okeys)(R.inputs),t=await pe("New order?",(M.visibleInputs||e).join(","));t&&G(M,t.split(","))}),[R.inputs,pe,M,G]),qe=l.useCallback((async()=>{const e=(0,d.okeys)(R.outputs),t=await pe("New order?",(M.visibleOutputs||e).join(","));t&&U(M,t.split(","))}),[R.outputs,pe,M,U]),Fe=l.useCallback((()=>{ee(M)}),[ee,M]),Ge=l.useCallback((async()=>{const e=await pe("Set custom display name",M.displayName||R.id);te(M,e)}),[pe,M,te,R.id]),Ue=Object.keys((0,h.getNodeInputs)(R)),Be=Object.keys((0,d.getNodeOutputs)(R)),We=l.useCallback((e=>{B&&B(M,e)}),[M,B]),Ze=l.useCallback(((e,t)=>{ne&&ne(M,e,t)}),[M,ne]),Je=l.useCallback(((e,t)=>{oe&&oe(M,e,t)}),[M,oe]),Ye=()=>(0,u.jsx)("div",{className:"inputs no-drag",children:De.map((t=>{let[i,r]=t;var a;return(0,u.jsx)(f.PinView,{type:"input",currentInsId:M.id,ancestorsInsIds:e.ancestorsInsIds,id:i,optional:Ve.has(i),connected:ce.has(i),isSticky:Le[i],minimized:!n&&1===De.length,onToggleSticky:Ie,onDetachConstValue:Ce,onCopyConstValue:xe,onPasteConstValue:we,copiedConstValue:e.copiedConstValue,selected:i===o,onClick:fe,onDoubleClick:me,isClosestToMouse:!!s&&"input"===s.type&&s.pin===i,onToggleLogged:N,onToggleBreakpoint:O,onInspect:e.onInspectPin,constValue:$e(i),onConvertConstToEnv:e.onConvertConstToEnv?We:void 0,description:r.description,queuedValues:null!==(a=e.queuedInputsData[i])&&void 0!==a?a:0,onMouseUp:Ze,onMouseDown:Je},i)}))}),Ke=()=>(0,u.jsx)("div",{className:"outputs no-drag",children:Me.map((t=>{let[o,r]=t;return(0,u.jsx)(f.PinView,{currentInsId:M.id,ancestorsInsIds:e.ancestorsInsIds,connected:de.has(o),type:"output",id:o,minimized:!n&&1===Me.length,isClosestToMouse:!!s&&"output"===s.type&&s.pin===o,selected:o===i,onClick:ve,onDoubleClick:he,onToggleLogged:N,onToggleBreakpoint:O,onInspect:e.onInspectPin,description:r.description,onMouseUp:Ze,onMouseDown:Je},o)}))}),Qe=l.useCallback((e=>{X(M,e)}),[M,X]),Xe=l.useCallback((()=>{const e=[...Ue.map((e=>{const t=Se.includes(e),n=ce.has(e)&&!0!==ce.get(e),o=(0,d.getInputName)(e);return{text:t?n?`Hide input "${o}" (disconnect first)`:`Hide input "${o}"`:`Show input "${o}"`,onClick:()=>G(M,t?Se.filter((t=>t!==e)):[...Se,e]),disabled:n&&t}})),...Be.map((e=>{const t=Te.includes(e),n=de.has(e),o=(0,d.getOutputName)(e);return{text:t?n?`Hide output "${o}" (disconnect first)`:`Hide output "${o}"`:`Show output "${o}"`,onClick:()=>U(M,t?Te.filter((t=>t!==e)):[...Te,e]),disabled:n&&t}})),...(0,d.isInlineNodeInstance)(M)&&(0,h.isVisualNode)(M.node)?[{text:"Ungroup inline node",onClick:()=>Z(M)}]:[],...(0,d.isInlineNodeInstance)(M)?[{text:"Extract inline node to file",onClick:()=>J(M)}]:[],{text:"Reorder inputs",onClick:He},{text:"Reorder outputs",onClick:qe},{text:"Set display name",onClick:Ge},{text:"Group selected instances",onClick:Y},{text:"Delete instance",intent:"danger",onClick:Fe}];return(0,u.jsxs)(x.Menu,{children:[(0,u.jsx)(x.MenuItem,{text:"Style",children:(0,u.jsx)(_.NodeStyleMenu,{style:ue,onChange:Qe,promptFn:pe})}),e.map(((e,t)=>(0,a.createElement)(x.MenuItem,{...e,key:t})))]})}),[Ue,Be,M,He,qe,Ge,Fe,ue,Qe,pe,Se,ce,G,Te,de,U,Z,J,Y]),et={"--node-color":ue.color,...ue.cssOverride||{}},tt=(0,b.getInstanceDomId)(M.id,e.ancestorsInsIds);return(0,u.jsx)("div",{className:Re,children:(0,u.jsx)(g.BaseNodeView,{pos:M.pos,viewPort:k,onDragStart:ge,onDragMove:be,onDragEnd:ye,upperRenderer:Ye,bottomRenderer:Ke,displayMode:T,domId:tt,children:(0,u.jsxs)(l.Fragment,{children:[Ye(),W?w.default.createPortal((0,u.jsxs)("div",{className:"inline-group-editor-container no-drag",children:[(0,u.jsxs)("header",{children:[ze," ",(0,u.jsx)("button",{onClick:e.onCloseInlineEditor,children:"close"})]}),(0,u.jsx)(I.VisualNodeEditor,{...e.inlineGroupProps,className:"no-drag",ref:ae})]}),Q):(0,u.jsx)(x.ContextMenu,{className:(0,p.default)("ins-view-inner",Ae,`size-${re.size}`,{dark:ie}),onClick:_e,onDoubleClick:je,content:Xe(),style:et,children:(0,u.jsx)(x.Tooltip,{content:R.description,children:(0,u.jsxs)(l.Fragment,{children:[ue.icon?(0,u.jsx)(c.FontAwesomeIcon,{icon:ue.icon}):null," ",ze]})})}),Ke()]})})})}},53568:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStyleMenu=t.nodeStylePresetColors=void 0;const r=n(35250),a=n(50382),u=s(n(70079)),l=n(84472);t.nodeStylePresetColors=[{name:"Amethyst",color:"#9b5de5"},{name:"Magenta",color:"#f15bb5"},{name:"Yellow",color:"#fee440"},{name:"Capri",color:"#00bbf9"},{name:"Sea Green",color:"#00f5d4"},{name:"Orange",color:"#ff7f00"}];const c={size:"regular"};t.NodeStyleMenu=e=>{var n;const{onChange:o,style:i}=e,s=i||c,d=e.promptFn,p=u.default.useCallback(((e,t)=>{o({...s,[e]:t})}),[s,o]),f=u.default.useCallback((async()=>{const e=await d("Icon name? (Font Awesome conventions)","rocket"),t=e.includes(",")?e.split(","):e;p("icon",t)}),[d,p]),m=(0,u.useCallback)((async()=>{const e=await d("Enter a custom style (valid JSON representing a React CSS object)",s.cssOverride?JSON.stringify(s.cssOverride):"");try{const t=JSON.parse(e);p("cssOverride",t)}catch(t){console.error(t),(0,l.toastMsg)("Invalid object","danger")}}),[d,p,s.cssOverride]);return(0,r.jsxs)(u.default.Fragment,{children:[(0,r.jsxs)(a.MenuItem,{text:"Color",children:[t.nodeStylePresetColors.map((e=>(0,r.jsx)(a.MenuItem,{text:e.name,onClick:()=>p("color",e.color)},e.name))),(0,r.jsx)(a.MenuDivider,{}),(0,r.jsx)(a.MenuItem,{text:"Remove Color",onClick:()=>p("color",void 0)})]}),(0,r.jsxs)(a.MenuItem,{text:`Size (${null!==(n=s.size)&&void 0!==n?n:"regular"})`,children:[(0,r.jsx)(a.MenuItem,{text:"Small",onClick:()=>p("size","small")}),(0,r.jsx)(a.MenuItem,{text:"Regular",onClick:()=>p("size","regular")}),(0,r.jsx)(a.MenuItem,{text:"Large",onClick:()=>p("size","large")})]}),(0,r.jsxs)(a.MenuItem,{text:"Icon",children:[(0,r.jsx)(a.MenuItem,{text:"Choose Icon",onClick:f}),(0,r.jsx)(a.MenuItem,{text:"Remove Icon",onClick:()=>p("icon",void 0)})]}),(0,r.jsx)(a.MenuItem,{text:"Custom Styling",onClick:m})]})}},88593:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(53568),t)},83651:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86553),t)},53159:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calcInstancePosition=t.calcNodeWidth=t.calcNodeContent=void 0;const i=n(74762),s=o(n(6576)),r=n(86553),a=n(61888),u=n(30994);t.calcNodeContent=(e,t)=>{if(e.displayName)return e.displayName;if(t.customViewCode)try{const n=Object.entries(e.inputConfig).filter((e=>{let[,t]=e;return(0,i.isStaticInputPinConfig)(t)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o.value}}),{});return s.default.compile(t.customViewCode)({inputs:n}).trim()}catch(n){return console.error("Error with custom view",n),`Error in custom view [${t.id}]`}return t.id};t.calcNodeWidth=(e,n)=>{const o=(0,i.okeys)(n.inputs).length*r.MIN_WIDTH_PER_PIN,s=(0,t.calcNodeContent)(e,n),u=r.PIECE_CHAR_WIDTH;return(0,a.clamp)(s.length*u+2*r.PIECE_HORIZONTAL_PADDING,o,r.MAX_INSTANCE_WIDTH)};t.calcInstancePosition=(e,t,n)=>{const o=(0,u.getInstanceDomId)(e,t),i=document.getElementById(o);if(i){const{x:e,y:t,width:o,height:s}=i.getBoundingClientRect(),r=t+s/2;return{x:e+o/2-n.x,y:r-n.y}}return console.warn("Cannot find element to draw connection to",o),{x:99999,y:99999}}},17841:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutDebugger=t.LayoutDebuggerItem=t.PosDebugger=void 0;const i=n(70079),s=n(35250),r=n(74762),a=o(n(70079)),u=n(7047),l=e=>{let{pos:t}=e;return(0,s.jsxs)("span",{children:[t.x.toFixed(1),", ",t.y.toFixed(1)]})};t.PosDebugger=e=>(0,s.jsx)("span",{className:"pos-debugger",children:(0,s.jsx)(l,{pos:e.pos})});t.LayoutDebuggerItem=e=>{const{pos:n,viewPort:o,size:i,color:r}=e,a=o.zoom,u=n.x*a-o.pos.x*a,l=n.y*a-o.pos.y*a,c={transform:`translate(${u-n.x}px, ${l-n.y}px)`},d={transform:`scale(${o.zoom})`},p={transform:`translate(${n.x}px, ${n.y}px)`},f={width:`${i.width}px`,height:`${i.height}px`,backgroundColor:r};return(0,s.jsx)("div",{className:"layout-debugger",style:c,children:(0,s.jsxs)("span",{className:"drag-sim",style:p,children:[(0,s.jsx)(t.PosDebugger,{pos:n}),(0,s.jsx)("div",{className:"layout-debugger-zoom-wrapper",style:d,children:(0,s.jsx)("div",{className:"layout-debugger-inner",style:f})})]})})};const c=(()=>{try{return"true"===localStorage.getItem("pos-debugger")}catch(e){return!1}})();t.LayoutDebugger=e=>{const{extraDebug:n,vp:o,node:d,mousePos:p}=e;if(!c)return null;const f=n.map(((e,n)=>(0,i.createElement)(t.LayoutDebuggerItem,{...e,key:n}))),m=[...d.instances.map((e=>e.pos)),...(0,r.values)(d.inputsPosition),...(0,r.values)(d.outputsPosition)].map((e=>(0,s.jsx)(t.LayoutDebuggerItem,{pos:e,viewPort:o,size:{width:0,height:0},color:"red"}))),h=(0,u.logicalPosToRenderedPos)(p,o),v=(0,s.jsxs)("div",{className:"viewport-data",children:[(0,s.jsxs)("div",{children:["Pos: ",(0,s.jsx)(l,{pos:o.pos})]}),(0,s.jsxs)("div",{children:["Zoom: ",o.zoom.toFixed(2)," "]}),(0,s.jsxs)("div",{children:["Mouse (logical): ",(0,s.jsx)(l,{pos:p})]}),(0,s.jsxs)("div",{children:["Rendered (rendered): ",(0,s.jsx)(l,{pos:h})]})]});return(0,s.jsxs)(a.default.Fragment,{children:[v,f,m]})}},44338:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(17841),t)},38259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateInstancesWithSingleConstPinsMap=t.getLeafInstancesOfSelection=void 0;t.getLeafInstancesOfSelection=(e,t,n)=>e.reduce(((e,o)=>[...e,...n.filter((e=>e.to.insId===o.id)).map((e=>t.find((t=>t.id===e.from.insId)))).filter((e=>!!e))]),[]).filter((t=>1===n.filter((e=>e.from.insId===t.id||e.to.insId===t.id)).length&&!e.includes(t)));t.calculateInstancesWithSingleConstPinsMap=(e,t)=>{const{connections:n}=e;return n.filter((e=>t.has(e.from.insId))).reduce(((e,n)=>{const o=t.get(n.from.insId),i=n.to.insId,s=e.get(i)||new Map;return s.set(n.to.pinId,{val:o,insId:n.from.insId}),e.set(i,s),e}),new Map)}},37488:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeIoView=void 0;const a=n(35250),u=n(70079),l=s(n(70079)),c=n(74762),d=n(83234),p=r(n(26372)),f=n(50382),m=n(43490),h=n(66189),v=n(74762),g=n(30994),y=n(30653);t.NodeIoView=l.memo((function(e){const{viewPort:t,selected:n,pos:o,type:i,id:s,onDblClick:r,onRename:b,onDelete:I,onChangeInputMode:C,inputMode:x,onSelect:w,closest:_,onSetDescription:j,description:N,onMouseUp:O,onMouseDown:P,currentInsId:E}=e,{history:S,resetHistory:T,refreshHistory:D}=(0,h.useHistoryHelpers)(E,s,i),M=(0,m.usePrompt)(),k=l.useCallback((async()=>{const e=await M("Description?",N);j(i,s,e)}),[M,N,j,i,s]),R=l.useCallback((()=>{I&&I(i,s)}),[i,s,I]),A=l.useCallback((()=>{b&&b(i,s)}),[i,s,b]),V=l.useCallback((e=>{C&&C(s,e)}),[s,C]),L=l.useCallback((()=>[{text:`Current mode - ${x}`,onClick:c.noop},{text:"Make required",onClick:()=>V("required")},{text:"Make optional",onClick:()=>V("optional")},{text:"Make required-if-connected",onClick:()=>V("required-if-connected")},{text:"Set description",onClick:k},...e.onRename?[{text:"Rename",onClick:A}]:[],...e.onDelete?[{text:"Delete",onClick:R}]:[]]),[k,x,V,R,A,e.onDelete,e.onRename]),z=l.useCallback((t=>{r&&r(e.id,t)}),[r,e.id]),$=l.useCallback((()=>{w(s,i)}),[s,i,w]),H=l.useCallback((()=>(0,a.jsx)(f.Menu,{children:L().map(((e,t)=>(0,u.createElement)(f.MenuItem,{...e,key:t})))})),[L]),q="input"===i?(0,v.getInputName)(s):(0,c.getOutputName)(s),F=l.useCallback((e=>{O(s,i,e)}),[s,O,i]),G=l.useCallback((e=>{P(s,i,e)}),[s,P,i]),U=(0,y.useDarkMode)();return(0,a.jsx)(d.BaseNodeView,{className:(0,p.default)("node-io-view",i,{dark:U}),pos:o,onDragEnd:(n,o)=>{const r=e.pos,a=(o.x-r.x)/t.zoom,u=(o.y-r.y)/t.zoom,l=r.x+a,c=r.y+u;e.onDragEnd(i,s,n,{...o,x:l,y:c})},onDragStart:(t,n)=>{e.onDragStart(s,t,n)},onDragMove:(t,n)=>{e.onDragMove(i,s,t,{x:n.x,y:n.y})},viewPort:t,children:(0,a.jsx)(l.Fragment,{children:(0,a.jsx)(f.Tooltip,{content:(()=>{const t=(0,h.calcHistoryContent)(S),n=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:q})," (",i,")"," "]}),n,(0,a.jsx)("hr",{}),t]})})(),children:(0,a.jsx)(f.ContextMenu,{onMouseEnter:D,onMouseOut:T,onMouseUp:F,onMouseDown:G,"data-tip":"","data-html":!0,"data-for":s+e.currentInsId,className:(0,p.default)("node-io-view-inner",{closest:_,selected:n,dark:U}),id:(0,g.getPinDomId)({fullInsIdPath:(0,c.fullInsIdPath)(e.currentInsId,e.ancestorInsIds),pinId:s,pinType:i,isMain:!0}),onClick:$,onDoubleClick:z,content:H(),children:s})})})})}))},66005:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37488),t)},83782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcNodeIoWidth=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0,t.PIECE_HORIZONTAL_PADDING=15,t.PIECE_CHAR_WIDTH=9,t.MIN_WIDTH_PER_PIN=40;t.calcNodeIoWidth=e=>Math.max(t.MIN_WIDTH_PER_PIN,e.length*t.PIECE_CHAR_WIDTH+2*t.PIECE_HORIZONTAL_PADDING)},99942:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderVisualNode=t.layoutToInstances=void 0;const i=n(63521),s=n(74762),r=n(90794),a=o(n(53865)),u=n(83782),l=n(60190),c=n(53159),d=n(41032);t.layoutToInstances=(e,t)=>(0,a.default)(t,(t=>{(0,s.entries)(e.nodes).forEach((e=>{let[n,o]=e;if(n.startsWith("ins-")){const e=n.replace("ins-",""),i=t.instances.find((t=>t.id===e));i?i.pos=o.p:console.warn("WAT")}if(n.startsWith("node-input-")){const e=n.replace("node-input-","");t.inputsPosition[e]=o.p}if(n.startsWith("node-output-")){const e=n.replace("node-output-","");t.outputsPosition[e]=o.p}}))}));t.orderVisualNode=(e,n,o,a)=>{const{instances:p,connections:f}=e,m={...p.reduce(((e,t)=>{const o=(0,l.size)((0,c.calcNodeWidth)(t,(0,d.safelyGetNodeDef)(t,n)),i.NODE_HEIGHT);return{...e,[`ins-${t.id}`]:{p:t.pos,s:o}}}),{}),...(0,s.okeys)(e.inputsPosition).reduce(((t,n)=>({...t,[`node-input-${n}`]:{p:e.inputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{}),...(0,s.okeys)(e.outputsPosition).reduce(((t,n)=>({...t,[`node-output-${n}`]:{p:e.outputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{})},h=f.map((e=>[(0,s.isExternalConnectionNode)(e.from)?`node-input-${e.from.pinId}`:`ins-${e.from.insId}`,(0,s.isExternalConnectionNode)(e.to)?`node-output-${e.to.pinId}`:`ins-${e.to.insId}`])),v=(0,r.orderLayout)({nodes:m,edges:h},o,((n,o)=>{a&&a((0,t.layoutToInstances)(n,e),o)}));return(0,t.layoutToInstances)(v,e)}},90794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderLayout=void 0;const o=n(60190),i=400,s=e=>e.reduce(((e,t)=>{const n=(0,o.vSub)(t.p,(0,o.vec)(t.s.width/2,t.s.height/2));return{...e,[t.id]:{p:n,s:t.s}}}),{});t.orderLayout=(e,t,n)=>{let{nodes:r,edges:a}=e,u=Object.entries(r).map((e=>{let[t,n]=e;return{id:t,p:(0,o.vAdd)(n.p,(0,o.vec)(n.s.width/2,n.s.height/2)),f:(0,o.vec)(0,0),v:(0,o.vec)(0,0),m:1,s:n.s}})),l=0;for(;l.01);){let e=u;for(let t=0;t{let n=e.find((e=>e.id===t[0])),i=e.find((e=>e.id===t[1]));if(!n||!i)return void console.warn("weoops",t[0],t[1]);const s=(0,o.vec)(0,-200),r=(0,o.vSub)(n.p,i.p),a=(0,o.vSub)(s,r),u=1e3*(0,o.vLen)(a),l=(0,o.vMul)((0,o.vNorm)(a),.5*u),c=(0,o.vMul)((0,o.vNorm)(a),-.5*u);n.f=(0,o.vAdd)(n.f,l),i.f=(0,o.vAdd)(i.f,c)})),e=e.map((e=>(0,o.itrPhysics)(15,e))),e=e.map((e=>{const t=(0,o.vMul)(e.v,.5),n=(0,o.vLen)(t)>100?(0,o.vMul)((0,o.vNorm)(t),100):t;return{...e,v:n}})),u=e,n&&n({nodes:s(e),edges:a},l),l++}return{nodes:s(u),edges:a,itrs:l,timeout:l>=t,total:(0,o.totalEnergy)(u)}}},2036:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PinView=t.PIN_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=n(50382),d=n(18420),p=n(74762),f=n(30994),m=n(96233),h=n(66189),v=n(30653);t.PIN_HEIGHT=23;t.PinView=u.memo((function(e){const{selected:t,type:n,connected:o,optional:i,currentInsId:s,isClosestToMouse:r,id:g,onMouseDown:y,onMouseUp:b}=e,{history:I,resetHistory:C,refreshHistory:x}=(0,h.useHistoryHelpers)(s,g,n),w=(0,v.useDarkMode)(),_="input"===n?(0,p.getInputName)(g):(0,p.getOutputName)(g),j="input"===e.type&&(0,d.isDefined)(e.constValue)?e.constValue:void 0,N=u.useCallback((e=>{0===e.button&&y(g,n,e)}),[g,n,y]),O=u.useCallback((e=>{0===e.button&&b(g,n,e)}),[g,n,b]);return(0,a.jsxs)("div",{className:(()=>{if("input"===e.type){const{isSticky:s,constValue:a}=e;return(0,l.default)("pin",{sticky:s,selected:t,closest:r,optional:i,connected:o,"const-value":(0,d.isDefined)(a),"env-value":(0,d.isDefined)(a)&&(0,p.isEnvValue)(a),minimized:e.minimized,dark:w},n)}return(0,l.default)("pin",{selected:t,connected:o,closest:r,optional:i,minimized:e.minimized,"error-pin":g===p.ERROR_PIN_ID,dark:w},n)})(),"data-pin-id":g,children:[(0,a.jsx)(c.Tooltip,{className:"pin-info-tooltip",content:(()=>{const t=(0,h.calcHistoryContent)(I,"input"===n?e.queuedValues:void 0),o=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:_})," (",n,")"," "]}),o,(0,a.jsx)("hr",{}),(0,d.isDefined)(j)?(0,a.jsxs)("div",{children:["Static value:"," ",(0,a.jsx)("strong",{children:(0,m.valuePreview)(j).substring(0,200)})]}):t]})})(),children:(0,a.jsxs)(c.ContextMenu,{onMouseEnter:x,onMouseOut:C,onMouseDown:N,onMouseUp:O,"data-tip":"","data-html":!0,"data-for":g+e.currentInsId,id:(0,f.getPinDomId)({fullInsIdPath:(0,p.fullInsIdPath)(e.currentInsId,e.ancestorsInsIds),pinId:g,pinType:n,isMain:!1}),onDoubleClick:t=>e.onDoubleClick&&e.onDoubleClick(g,t),className:(0,l.default)("pin-inner",{dark:w}),onClick:t=>{const{onShiftClick:o,onClick:i,id:s}=e;t.shiftKey&&o?o(s,t):i(s,n,t)},content:(()=>{const t=(0,a.jsx)(c.MenuItem,{onClick:()=>e.onInspect(e.currentInsId,{id:e.id,type:e.type}),text:"Inspect"});if("input"===e.type){const{onConvertConstToEnv:n}=e;return(0,d.isDefined)(j)?(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onDetachConstValue(e.id),text:"Detach value"}),(0,a.jsx)(c.MenuItem,{onClick:()=>e.onCopyConstValue(e.id),text:"Copy value"}),(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null,n?(0,a.jsx)(c.MenuItem,{onClick:()=>n(e.id),text:"Convert to Env Var"}):null]}):(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onToggleSticky(e.id),text:"Toggle sticky (square means sticky)"}),t,(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null]})}return(0,a.jsx)(c.Menu,{children:t})})(),children:[_," ",(0,d.isDefined)(j)?(0,a.jsxs)(u.Fragment,{children:[":",(0,a.jsx)("span",{className:"value",children:(0,d.toString)(j)})]}):null,"input"===e.type&&e.isSticky?(0,a.jsx)("span",{className:"suffix",children:"s"}):null,"input"===e.type&&e.queueSize?(0,a.jsxs)("span",{className:"suffix",children:[e.queueSize," in Q"]}):null]})}),(0,a.jsx)("div",{className:"wire"})]})}))},66189:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHistoryHelpers=t.calcHistoryContent=void 0;const i=n(35250),s=n(96233),r=o(n(70079)),a=n(70079),u=n(98158);t.calcHistoryContent=(e,t)=>{if(e){const{total:n,lastSamples:o}=e,a=(0,i.jsxs)("strong",{children:["Activated ",n," times this session"]}),u=o.length>0?(0,i.jsxs)("div",{children:["Last value:"," ",(0,i.jsx)("strong",{children:(0,s.valuePreview)(o[0].val).substring(0,200)}),(0,i.jsx)("br",{}),(0,i.jsx)("em",{children:"Inspect instance for the full value"})]}):"",l=t?(0,i.jsx)(r.default.Fragment,{children:(0,i.jsxs)("div",{children:["Queued values: ",(0,i.jsx)("strong",{children:t})]})}):"";return(0,i.jsxs)(r.default.Fragment,{children:[a,u,l]})}return"Loading session data.."};t.useHistoryHelpers=(e,t,n)=>{const o=(0,a.useRef)(),{onRequestHistory:i}=(0,u.useDebuggerContext)(),[s,l]=(0,a.useState)();return{history:s,refreshHistory:(0,a.useCallback)((()=>{clearInterval(o.current),i(e,t,n).then((e=>{l(e)})),o.current=setInterval((()=>{i(e,t,n).then((e=>{l(e)}))}),500)}),[e,i,t,n]),resetHistory:r.default.useCallback((()=>{clearInterval(o.current),l(void 0)}),[])}}},89440:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAddMenu=void 0;const r=n(35250),a=s(n(70079)),u=n(74762),l=n(50382),c=n(70457),d=n(9958),p=n(86125),f=c.Select.ofType(),m=e=>{switch(e.type){case"node":return`${e.node.id}`;case"value":return"Add inline value or function";case"import":return`Import ${e.importableNode.node.id} from ${e.importableNode.module}`}},h=(e,t)=>{let{handleClick:n,modifiers:o,query:i}=t;if(!o.matchesPredicate)return null;const s=m(e);return"value"===e.type?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(l.MenuDivider,{}),(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))]}):(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))},v=(e,t,n,o)=>{const i=m(t).toLocaleLowerCase(),s=e.toLowerCase();return o?i===s:i.includes(s)};t.QuickAddMenu=e=>{const{resolvedDependencies:t,targetNode:n}=e,o={left:e.pos.x,top:e.pos.y},{onRequestImportables:i}=(0,p.useDependenciesContext)(),[s,c]=a.useState();a.useEffect((()=>{i().then((e=>c(e.importables)))}),[i]);const d=(0,u.values)({...t,[n.id]:n}),m=d.map((e=>({type:"node",node:e}))),g=new Set(d.map((e=>e.id))),y=s?s.filter((e=>!g.has(e.node.id))).map((e=>({type:"import",importableNode:e}))):[],b=m.concat(y).concat({type:"value"});return(0,r.jsx)("div",{className:"quick-add-menu",style:o,children:(0,r.jsx)(f,{className:"quick-add-nodes-select",items:b,itemPredicate:v,itemRenderer:h,inputProps:{className:"quick-add-input"},noResults:(0,r.jsx)(l.MenuItem,{disabled:!0,text:"No results."}),onItemSelect:t=>e.onAdd(t),popoverProps:{isOpen:!0,onClose:()=>e.onClose()}})})}},71033:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89440),t)},73470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimePlayer=void 0;const o=n(74762),i=n(64955),s=(0,o.debugLogger)("runtime-player");t.createRuntimePlayer=()=>{let e=0,t=[];let n=!1,r=Date.now(),a=e;const u=()=>requestAnimationFrame((()=>{const l=Date.now();a=e,e+=l-r,r=l,((e,n)=>{const r=t;t=[],r.length&&s(`Playing ${r.length} events from`,e,n),r.forEach((e=>{s("Playing event",e),(0,i.playEvent)(e),e.insId===o.ROOT_INS_ID&&e.type===o.DebuggerEventType.PROCESSING_CHANGE&&!1===e.val&&(s("Main instance is done processing, clearing runtime UI",e),c())}))})(a,e),n&&u()})),l=()=>{n=!1},c=()=>{document.querySelectorAll("[data-runtime]").forEach((e=>{e.removeAttribute("data-runtime")})),document.querySelectorAll("[data-runtime-queue]").forEach((e=>{e.removeAttribute("data-runtime-queue")})),t=[]};return{stop:l,start:function(t){void 0===t&&(t=0),n=!0,e=t,r=Date.now(),u()},addEvents:e=>{t.push(...e)},destroy:()=>{l(),c()},clear:c,status:()=>({running:n,currDt:e,lastDt:a,queue:t,last:r})}}},64955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playEvent=t.cancelTimers=void 0;const o=n(74762),i=n(30994),s=5e3,r=(0,o.debugLogger)("runtime-player:play-event"),a=(e,t)=>e.type===o.DebuggerEventType.INPUT_CHANGE||e.type===o.DebuggerEventType.OUTPUT_CHANGE?`${(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds)}.${e.pinId}`:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds);t.cancelTimers=new Map;t.playEvent=e=>{switch(e.type){case o.DebuggerEventType.INPUT_CHANGE:case o.DebuggerEventType.OUTPUT_CHANGE:{const{pinId:n,insId:u,ancestorsInsIds:l}=e,c=e.type===o.DebuggerEventType.INPUT_CHANGE?"input":"output",d=[(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!0})];u!==o.ROOT_INS_ID&&d.push((0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!1})),d.forEach(((i,l)=>{const c=a(e);clearTimeout(t.cancelTimers.get(c));const d=document.getElementById(i),p=`${u}.${n}`,f=e.type===o.DebuggerEventType.OUTPUT_CHANGE?document.querySelectorAll(`[data-from-id="${p}"]`):[];if(d){clearTimeout(t.cancelTimers.get(c)),d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),setTimeout((()=>{d.setAttribute("data-runtime","active"),f.forEach((e=>{e.setAttribute("data-runtime","active")}))}),0);const n=setTimeout((()=>{d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),t.cancelTimers.delete(c)}),s);t.cancelTimers.set(a(e),n)}else console.warn(`No DOM element with Id [${i}] found to play event`),r(`No DOM element with Id [${i}] found to play event`,e)}));break}case o.DebuggerEventType.PROCESSING_CHANGE:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(l)if(!0===e.val)l.setAttribute("data-runtime","processing"),clearTimeout(t.cancelTimers.get(u));else{l.removeAttribute("data-runtime"),setTimeout((()=>{"error"!==l.getAttribute("data-runtime")&&l.setAttribute("data-runtime","done")}),0);const e=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,e)}else r(`No DOM element with Id [${n}] found to play event`,e)}));break}case o.DebuggerEventType.ERROR:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(!l)return void r(`No DOM element with Id [${n}] found to play event`,e);clearTimeout(t.cancelTimers.get(u)),l.removeAttribute("data-runtime"),setTimeout((()=>{l.setAttribute("data-runtime","error")}));const c=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,c)}));const c={...e,type:o.DebuggerEventType.OUTPUT_CHANGE,pinId:o.ERROR_PIN_ID};(0,t.playEvent)(c);break}case o.DebuggerEventType.INPUTS_STATE_CHANGE:(0,o.entries)(e.val).forEach((t=>{let[n,s]=t;const{insId:a,ancestorsInsIds:u}=e,l=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(a,u),pinId:n,pinType:"input",isMain:!1}),c=document.getElementById(l);c?s>0?c.setAttribute("data-runtime-queue",`${s}`):c.removeAttribute("data-runtime-queue"):r(`No DOM element with Id [${l}] found to play event`,e)}))}}},25804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounce=void 0;const o=n(70079);t.useDebounce=function(e,t){const[n,i]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}},7047:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.handleChangeNodeInputType=t.handleIoPinRename=t.handleInstanceDrag=t.getInstancesInRect=t.isJsxValue=t.getMiddleOfViewPort=t.fitViewPortToNode=t.centerBoardPosOnTarget=t.renderedPosToLogicalPos=t.logicalPosToRenderedPos=t.getEffectiveNodeDimensions=t.calcNodesPositions=t.calcSelectionBoxArea=t.animateViewPort=t.easeInOutNum=t.easeInOutPos=t.easeInOutQuad=t.center=t.distance=t.clamp=t.domToViewPort=t.roundNumber=t.createNewNodeInstance=t.createNewInlineNodeInstance=t.parseInputOutputTypes=t.parsePromptValue=t.getSelectionBoxRect=t.findClosestPin=t.changePinConfig=t.getInstancePinConfig=t.emptyList=t.emptyObj=void 0;const r=s(n(53865)),a=n(30721),u=n(63521),l=n(74762),c=n(18243),d=n(74762),p=n(53159),f=n(83782),m=n(60190),h=n(38259),v=n(83651),g=n(41032);t.emptyObj={},t.emptyList=[],t.getInstancePinConfig=function(e,n,o){var i;const s=e.instances.find((e=>e.id===n));if(!s)throw new Error(`Instance ${n} not found`);return null!==(i=(s.inputConfig||t.emptyObj)[o])&&void 0!==i?i:(0,l.queueInputPinConfig)()};t.changePinConfig=(e,t,n,o)=>r.produce(e,(e=>{var i;const{instances:s}=e,r=s.find((e=>e.id===t));if(!r)throw new Error("blah");const a=null!==(i=r.inputConfig)&&void 0!==i?i:{};a[n]=o,e.instances=s.map((e=>e===r?{...r,inputConfig:a}:e))}));t.findClosestPin=(e,t,n,o,i,s,r)=>{const a=(0,l.nodeInstance)(e.id,e.id),u=(0,d.okeys)(e.inputs).map((e=>({id:e,type:"input",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),p=(0,d.okeys)(e.outputs).map((e=>({id:e,type:"output",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),f=[...u,...e.instances.reduce(((n,a)=>{const u=(0,g.safelyGetNodeDef)(a,t),d=(0,v.getVisibleInputs)(a,u,e.connections),p=(0,v.getVisibleOutputs)(a,u,e.connections);return[...n,...d.map((e=>({ins:a,type:"input",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!1}),id:e}))),...p.map((e=>({ins:a,type:"output",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!1}),id:e})))]}),[]),...p];let m={dis:1e5,item:f[0]};return f.forEach((e=>{const t=e.pos.x-n.x,o=e.pos.y-n.y,i=Math.sqrt(t*t+o*o);i{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x,t.x)-n,h:Math.max(e.y,t.y)-o}};t.parsePromptValue=e=>{if(null===e)return;const t=parseInt(e,10);let n=e;return t.toString()!=e||isNaN(t)||(n=t),n};t.parseInputOutputTypes=e=>{const[,t,n]=e.match(/node\((.+)\|(.+)\)/)||[],o=(0,d.entries)(JSON.parse(t)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]})),i=(0,d.entries)(JSON.parse(n)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]}));return{inputs:(0,d.fromEntries)(o),outputs:(0,d.fromEntries)(i)}};t.createNewInlineNodeInstance=function(e,t,n){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const o=(0,l.inlineNodeInstance)(`${e.id}-${(0,d.randomInt)(999)}`,e,{},{x:0,y:0}),i=(0,p.calcNodeWidth)(o,e),{x:s,y:r}=n,a={x:s-i/2,y:r+t};return{...o,pos:a}};t.createNewNodeInstance=function(e,t,n,o){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const i="string"==typeof e?(0,g.safelyGetNodeDef)(e,o):e;if(!i)throw new Error(`${e} node not found in resolvedNodes`);const s=(0,d.entries)(i.inputs).reduce(((e,t)=>{let[n,o]=t;return o.defaultValue&&(e[n]=(0,l.staticInputPinConfig)(o.defaultValue)),e}),{}),r=(0,l.nodeInstance)((0,a.createId)(),i.id,s,{x:0,y:0}),c=(0,p.calcNodeWidth)(r,i),{x:f,y:m}=n,h={x:f-c/2,y:m+t};return{...r,pos:h}};t.roundNumber=e=>Math.round(100*e)/100;t.domToViewPort=(e,n,o)=>({x:(0,t.roundNumber)(n.pos.x+e.x/n.zoom/o.zoom),y:(0,t.roundNumber)(n.pos.y+e.y/n.zoom/o.zoom)});t.clamp=(e,t,n)=>Math.max(e,Math.min(t,n));t.distance=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)};t.center=(e,t,n)=>{let{zoom:o}=n;const i=e.x+e.w/2,s=e.y+e.h/2,{w:r,h:a}=t;return{x:i-r/o/2,y:s-a/o/2}};t.easeInOutQuad=e=>e<.5?2*e*e:(4-2*e)*e-1;t.easeInOutPos=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i),a=(0,t.easeInOutQuad)(r),u=n.x-e.x,l=n.y-e.y;return{x:e.x+u*a,y:e.y+l*a}};t.easeInOutNum=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i);return e+(n-e)*(0,t.easeInOutQuad)(r)};t.animateViewPort=(e,n,o,i)=>{const s=(0,t.distance)(e.pos,n.pos),r=Date.now(),a=o;if(0===s)return void i(e);const u=()=>{const o=Date.now(),s=(0,t.easeInOutPos)(e.pos,n.pos,r,a,o),l=(0,t.easeInOutNum)(e.zoom,n.zoom,r,a,o);o-r{const n=(0,t.getSelectionBoxRect)(e.from,e.to);return n.h*n.w};const y=(e,t,n,o)=>({left:n.x,right:n.x+e,top:n.y,bottom:n.y+t,tag:o,center:(0,l.calcCenter)({w:e,h:t,...n})});t.calcNodesPositions=(e,t)=>[...e.instances.map((e=>{const n=(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,t)),o=u.NODE_HEIGHT;return y(n,o,e.pos,e.id)})),...(0,d.okeys)(e.inputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.inputsPosition[t]||{x:0,y:0};return y(n,o,i,"input_"+t)})),...(0,d.okeys)(e.outputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.outputsPosition[t]||{x:0,y:0};return y(n,o,i,"output"+t)}))];t.getEffectiveNodeDimensions=(e,n)=>{const o=(0,t.calcNodesPositions)(e,n),i=o[0]||{left:0,right:0,top:0,bottom:0},s=o.reduce(((e,t)=>t.leftt.right>e?t.right:e),i.right),a=o.reduce(((e,t)=>t.topt.bottom>e?t.bottom:e),i.bottom)-a,d={x:s,y:a};return{size:{width:u,height:c},pos:d,center:(0,l.calcCenter)({w:u,h:c,...d})}};t.logicalPosToRenderedPos=(e,t)=>{const n=(0,m.vSub)(e,t.pos);return(0,m.vMul)(n,t.zoom)};t.renderedPosToLogicalPos=(e,t)=>{const n=(0,m.vDiv)(e,t.zoom);return(0,m.vAdd)(t.pos,n)};t.centerBoardPosOnTarget=(e,n,o,i)=>{const s=(0,t.logicalPosToRenderedPos)(e,i),r=(0,t.renderedPosToLogicalPos)(s,{...i,zoom:o}),a=Math.max(e.x,r.x)-Math.min(e.x,r.x),u=Math.max(e.y,r.y)-Math.min(e.y,r.y);return{x:o>i.zoom?i.pos.x+a:i.pos.x-a,y:o>i.zoom?i.pos.y+u:i.pos.y-u}};t.fitViewPortToNode=function(e,n,o,i){void 0===i&&(i=[20,150]);const{size:s,center:r}=(0,t.getEffectiveNodeDimensions)(e,n),a=i[0],u=i[1],l=s.width+a,c=s.height+u,d=o.width/l,p=o.height/c,f=Math.min(d,p)/1.15,m=(0,t.clamp)(.3,1.2,f);return{zoom:m,pos:{x:r.x-o.width/2/m,y:r.y-o.height/2/m+20}}};t.getMiddleOfViewPort=(e,n)=>{const o={x:n.width/2,y:n.height/2};return(0,t.renderedPosToLogicalPos)(o,e)};t.isJsxValue=e=>{const t=e=>(0,d.isDefined)(e.ref)&&(0,d.isDefined)(e.type)&&(0,d.isDefined)(e.props);try{const n=JSON.parse(e);return t(n)||Array.isArray(n)&&t(n[0])}catch(n){return!1}};t.getInstancesInRect=(e,n,o,i,s,r,a)=>{const{from:c,to:d}=e,f=(0,t.getSelectionBoxRect)(c,d);return s.filter((e=>{const{pos:t}=e,i={...t,w:(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,n))*o.zoom*a.zoom,h:u.NODE_HEIGHT*o.zoom*a.zoom};return(0,l.intersectRect)(f,i)||(0,l.intersectRect)(i,f)})).map((e=>e.id))};t.handleInstanceDrag=(e,t,n,o,i,s)=>{o.preventDefault(),o.stopPropagation();const a=(0,m.vSub)(n,t.pos);let u;const l=r.produce(e,(e=>{const r=e.instances.find((e=>e.id===t.id));if(!r)throw new Error("impossible state dragging instance that does not exist");!o.shiftKey&&s&&(u=[s]);const l=e.instances.filter((e=>i.includes(e.id)&&e!==r)),c=[r,...l],d=(0,h.getLeafInstancesOfSelection)(c,e.instances,e.connections);[...l,...d].forEach((e=>{e.pos=(0,m.vAdd)(e.pos,a)})),r.pos=n,!o.shiftKey&&s&&(u=[s])}));return{newValue:l,newSelected:u}};t.handleIoPinRename=(e,t,n,o)=>r.produce(e,(e=>{"input"===t?(e.inputs[o]=e.inputs[n],e.inputsPosition[o]=e.inputsPosition[n],delete e.inputs[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===n?{...e,from:{...e.from,pinId:o}}:e))):(e.outputs[o]=e.outputs[n],e.outputsPosition[o]=e.outputsPosition[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===n?{...e,to:{...e.to,pinId:o}}:e)),e.completionOutputs=(e.completionOutputs||[]).map((e=>e.split("+").map((e=>e===n?o:n)).join("+"))),delete e.outputs[n])}));t.handleChangeNodeInputType=(e,t,n)=>r.produce(e,(e=>{const o=e.inputs[t];if(!o)throw new Error("Wat");o.mode=n}))},42403:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorClient=void 0;const i=n(74762),s=o(n(18706)),r=n(32048),a=n(31758),u=(0,i.debugLogger)("remote-debugger:editor-client");t.createEditorClient=(e,t)=>{const n=new URL(e),o=(0,r.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/editor`,timeout:3e4});return o.emit("join-room-editor",t),{emitChange:e=>{o.emit(a.DebuggerServerEventType.CHANGE_EVENT_NAME,e)},emitBreakpointsChange:e=>{o.emit(a.DebuggerServerEventType.UPDATE_BREAKPOINTS,e)},interceptInput:e=>{o.emit(a.DebuggerServerEventType.INPUT_VALUE_OVERRIDE,e)},interceptOutput:e=>{o.emit(a.DebuggerServerEventType.OUTPUT_VALUE_OVERRIDE,e)},onRuntimeReady:e=>(o.on(a.DebuggerServerEventType.RUNTIME_READY,e),()=>o.off(a.DebuggerServerEventType.RUNTIME_READY,e)),onChangeAwk:e=>(o.on(a.DebuggerServerEventType.CHANGE_AWK,e),()=>o.off(a.DebuggerServerEventType.CHANGE_AWK,e)),onChangeError:e=>(o.on(a.DebuggerServerEventType.CHANGE_ERROR,e),()=>o.off(a.DebuggerServerEventType.CHANGE_ERROR,e)),onIsAlive:e=>(o.on(a.DebuggerServerEventType.IS_ALIVE,e),()=>o.off(a.DebuggerServerEventType.IS_ALIVE,e)),emitInputValue:(e,t)=>{u(`Emitting push input value to ${e} %o`,t),o.emit(a.DebuggerServerEventType.PUSH_INPUT_VALUE,{pinId:e,value:t})},destroy:()=>{o.disconnect(),(0,a.enumToArray)(a.DebuggerServerEventType).forEach((e=>o.off(e)))},onDisconnect:e=>(o.on("disconnect",e),()=>o.off("disconnect",e)),debugInfo:()=>`Remote debugger for ${e}`,onBatchedEvents:e=>(o.on(a.DebuggerServerEventType.EVENTS_BATCH,e),()=>o.off(a.DebuggerServerEventType.EVENTS_BATCH,e)),requestState:()=>s.default.get(`${e}/state`).then((e=>e.data.state)),getHistory:n=>s.default.get(`${e}/history`,{params:{insId:n.insId,pinId:n.pinId,limit:n.limit,executionId:t}}).then((e=>e.data)),clearHistory:()=>s.default.delete(`${e}/history`).then((()=>{})),triggerNode:(t,n)=>s.default.post(`${e}/trigger`,{nodeId:t,inputs:n}).then((e=>e.data))}}},58066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeData=void 0;const o=n(74762),i=n(36783),s=(0,o.debugLogger)("remote-debugger:normalize-data");t.normalizeData=e=>{if(e instanceof Error)return(0,i.serializeError)(e);if("object"==typeof e&&null!==e){e={...e};const t=new WeakSet,n=e=>{if("bigint"==typeof e)return e.toString();if("object"!=typeof e||Array.isArray(e))return e;if(null===e)return e;if(t.has(e))return"[Circular]";try{t.add(e)}catch(o){s("Error adding to WeakSet","data:",e,"type:",typeof e,"error:",o)}if(Array.isArray(e))return e.map(n);if("object"==typeof e){const t={};for(const o in e)t[o]=n(e[o]);return t}return e};return n(e)}return e}},39641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimeClient=t.DEFAULT_DT_SCALE=void 0;const o=n(74762),i=n(32048),s=n(31758),r=n(58066),a=(0,o.debugLogger)("remote-debugger:runtime-client");t.DEFAULT_DT_SCALE=1;t.createRuntimeClient=(e,t)=>{const n=new URL(e),u=(0,i.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/runtime`,timeout:1e3,reconnectionAttempts:3});u.emit("join-room-runtime",t),u.on("connection",(e=>{e.join(t)}));let l=new Set;u.on(s.DebuggerServerEventType.UPDATE_BREAKPOINTS,(e=>{l=new Set(e)}));const c=(0,o.cappedArrayDebounce)((e=>{a(`Emitting debounced batched events - ${e.length}`),u.emit(s.DebuggerServerEventType.EVENTS_BATCH,e)}),100,200);return{onChange:e=>(u.on(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e),()=>u.off(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e)),onInput:e=>(u.on(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e),()=>u.off(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e)),emitEvent:e=>{a(`Emitting event ${e.type} change event of ${e.insId}`),e.val=(0,r.normalizeData)(e.val),c.addItem({...e,time:Date.now()})},emitRuntimeReady:()=>{u.emit(s.DebuggerServerEventType.RUNTIME_READY,{})},emitChangeAwk:()=>{u.emit(s.DebuggerServerEventType.CHANGE_AWK,{})},emitChangeError:e=>{u.emit(s.DebuggerServerEventType.CHANGE_ERROR,{error:e})},emitIsAlive:e=>{u.emit(s.DebuggerServerEventType.IS_ALIVE,{time:e})},destroy:async()=>{c.pendingItems()&&(c.flush(),await(0,o.delay)(100)),(0,s.enumToArray)(s.DebuggerServerEventType).forEach((e=>u.off(e))),u.disconnect()},onDisconnect:e=>(u.on("disconnect",e),()=>u.off("disconnect",e)),waitForConnection:()=>new Promise(((e,t)=>{u.connected?e():(u.on("connect_error",(e=>{t(`Socket connect error: ${e}`)})),u.on("connect",(()=>{e()})))}))}}},31758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerServerEventType=t.enumToArray=t.isNumber=t.isSimpleType=t.valuePreview=t.toString=void 0;const o=n(36783);t.toString=e=>{if("object"===typeof e){if(e instanceof Error)return JSON.stringify((0,o.serializeError)(e));try{return JSON.stringify(e).substr(0,250)}catch(t){return"Object (cannot stringify)"}}return`${e}`.substr(0,250)};t.valuePreview=e=>(0,t.toString)(e).substr(0,100);t.isSimpleType=e=>["number","string","boolean"].includes(typeof e);t.isNumber=e=>!1===isNaN(Number(e)),t.enumToArray=function(e){return Object.keys(e).filter(t.isNumber).map((t=>e[t]))},function(e){e.RUNTIME_READY="runtime-ready",e.CHANGE_EVENT_NAME="change",e.PUSH_INPUT_VALUE="push-input-value",e.CHANGE_AWK="live-change-awk",e.CHANGE_ERROR="live-change-error",e.IS_ALIVE="is-alive",e.UPDATE_BREAKPOINTS="update-breakpoints",e.INPUT_VALUE_OVERRIDE="input-value-override",e.OUTPUT_VALUE_OVERRIDE="output-value-override",e.INPUT_VALUE_CHANGE="input-value-changed",e.OUTPUT_VALUE_CHANGE="output-value-changed",e.PROCESSING_CHANGE="processing-changed",e.INPUTS_STATE_CHANGE="inputs-state-changed",e.NODE_ERROR="node-error",e.EVENTS_BATCH="events-batch"}(t.DebuggerServerEventType||(t.DebuggerServerEventType={}))},96233:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31758),t),i(n(42403),t),i(n(39641),t)},43920:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Equals=t.EqualsBoolean=t.Throttle=t.ThrottleError=t.Debounce=t.Interval=t.Delay=t.Switch4=t.Switch2=t.Switch3=t.EmitOnTrigger=t.BooleanSplit=t.Subscribe=t.Publish=t.RoundRobin4=t.RoundRobin2=t.RoundRobin3=t.LimitTimes=void 0;const o=n(11253),i="Control Flow";t.LimitTimes={id:"Limit Times",namespace:i,description:"Item will be emitted until the limit is reached",inputs:{item:{mode:"required",description:"The item to emit"},times:{mode:"required",description:"The number of times to emit the item"},reset:{mode:"optional",description:"Reset the counter"}},outputs:{ok:{}},reactiveInputs:["item","reset"],completionOutputs:[],run:function(e,t,n){const{state:o}=n,{item:i,times:s,reset:r}=e,{ok:a}=t;if(void 0!==r)return void o.set("val",0);let u=o.get("val")||0;u++,o.set("val",u),u>=s?n.onError(new Error(`Limit of ${s} reached`)):a.next(i)}},t.RoundRobin3={id:"Round Robin 3",namespace:i,description:"Item will be emitted to one of the three outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r}=t,a=o.get("curr")||0,u=(a+1)%3;[i,s,r][a].next(e.item),o.set("curr",u)}},t.RoundRobin2={namespace:i,id:"Round Robin 2",description:"Item will be emitted to one of the 2 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s}=t,r=o.get("curr")||0,a=(r+1)%2;[i,s][r].next(e.item),o.set("curr",a)}},t.RoundRobin4={id:"Round Robin 4",namespace:i,description:"Item will be emitted to one of the 4 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves to "r4"\'s turn.'},r4:{description:'The fourth output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r,r4:a}=t,u=o.get("curr")||0,l=(u+1)%4;[i,s,r,a][u].next(e.item),o.set("curr",l)}},t.Publish={id:"Publish",namespace:i,description:"Publishes a value by a key to all listeners in the current flow. Use 'Subscribe' to listen to events.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},value:{mode:"required"}},outputs:{},run:function(e,t,n){const i=`${n.ancestorsInsIds}__${e.key}`;o.publish(i,e.value)}},t.Subscribe={id:"Subscribe",namespace:i,description:"Subscribes to a value published by a key. Use 'Publish' to publish values.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},initial:{mode:"required-if-connected",description:"If passed will be published has the first value"}},completionOutputs:[],outputs:{value:{description:"The value published by the key"}},run:function(e,t,n){const{value:i}=t,s=`${n.ancestorsInsIds}__${e.key}`,r=o.subscribe(s,((e,t)=>{i.next(t)}));void 0!==e.initial&&i.next(e.initial),n.onCleanup((()=>{o.unsubscribe(r)}))}},t.BooleanSplit={namespace:i,id:"Boolean Split",description:"Splits a boolean value into two outputs",inputs:{value:{mode:"required",description:"Boolean value"},trueValue:{mode:"required-if-connected",description:"Value to emit if the input is true. Defaults to true"},falseValue:{mode:"required-if-connected",description:"Value to emit if the input is false. Defaults to false"}},outputs:{true:{description:"The value is true"},false:{description:"The value is false"}},run:function(e,t){const{true:n,false:o}=t,{value:i,trueValue:s,falseValue:r}=e;i?n.next(null==s||s):o.next(null!=r&&r)}},t.EmitOnTrigger={namespace:i,id:"Emit on Trigger",description:"Emits the value when the trigger input receives any value",inputs:{value:{mode:"required",description:"The value to emit"},trigger:{mode:"required",description:"The trigger to emit the value"}},outputs:{result:{description:"The value emitted"}},run:function(e,t){const{result:n}=t,{value:o,trigger:i}=e;void 0!==i&&n.next(o)}},t.Switch3={namespace:i,id:"Switch 3",description:"Switches between 3 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,default:s,outputValue:r}=t,{value:a,firstCase:u,secondCase:l,thirdCase:c}=e;a===u?n.next(null!=r?r:a):a===l?o.next(null!=r?r:a):a===c?i.next(null!=r?r:a):s.next(null!=r?r:a)}},t.Switch2={id:"Switch 2",description:"Switches between 2 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,default:i,outputValue:s}=t,{value:r,firstCase:a,secondCase:u}=e;r===a?n.next(null!=s?s:r):r===u?o.next(null!=s?s:r):i.next(null!=s?s:r)}},t.Switch4={id:"Switch 4",description:"Switches between 4 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},fourthCase:{mode:"required",description:"The value to switch on for the fourth output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},fourth:{description:"The value emitted if the input value is equal to the fourth case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,fourth:s,default:r,outputValue:a}=t,{value:u,firstCase:l,secondCase:c,thirdCase:d,fourthCase:p}=e;u===l?n.next(null!=a?a:u):u===c?o.next(null!=a?a:u):u===d?i.next(null!=a?a:u):u===p?s.next(null!=a?a:u):r.next(null!=a?a:u)}},t.Delay={id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:i,description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:async(e,t)=>{let{value:n,delay:o}=e,{delayedValue:i}=t;await new Promise((e=>setTimeout(e,o))),i.next(n)}},t.Interval={id:"Interval",namespace:i,defaultStyle:{icon:"fa-clock"},description:"Emits a value every interval",inputs:{value:{description:"Value to emit"},interval:{description:"Interval in milliseconds"}},reactiveInputs:["value","interval"],outputs:{value:{description:"Emitted value"}},completionOutputs:[],run:(e,t,n)=>{n.state.get("timer")&&clearInterval(n.state.get("timer"));const o=setInterval((()=>{t.value.next(e.value)}),e.interval);n.state.set("timer",o),n.onCleanup((()=>{clearInterval(o)}))}},t.Debounce={id:"Debounce",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be debounced"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The debounced value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the last value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:s}=t,r=n.state.get("timer");r&&clearTimeout(r);const a=setTimeout((()=>{s.next(o)}),i);n.state.set("timer",a),n.onCleanup((()=>{clearTimeout(r)}))}};class s extends Error{constructor(e){super("Throttle: Value dropped"),this.value=e}}t.ThrottleError=s,t.Throttle={id:"Throttle",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be throttled"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The throttled value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the first value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:r}=t;if(n.state.get("timer"))n.onError(new s(o));else{r.next(o);const e=setTimeout((()=>{n.state.set("timer",null)}),i);n.state.set("timer",e)}}},t.EqualsBoolean={id:"Equals (Bool)",defaultStyle:{icon:"fa-equals"},namespace:i,description:"Emits true if two values are equal (=== equality). Otherwise emits false.",inputs:{a:{description:"First value"},b:{description:"Second value"}},outputs:{result:{description:"true if a is equal to b"}},run:(e,t)=>{let{a:n,b:o}=e,{result:i}=t;return i.next(n===o)}},t.Equals={id:"Equals",namespace:i,description:'Emits the value of "a" to output "true" if "a" is equal to "b". Otherwise emits the value of "a" to output "false".',inputs:{a:{mode:"required",description:"First value"},b:{mode:"required",description:"Second value"}},outputs:{true:{description:"Emits the value of a if a is equal to b"},false:{description:"Emits the value of a if a is not equal to b"}},run:(e,t)=>{const{a:n,b:o}=e,{true:i,false:s}=t;n===o?i.next(n):s.next(n)}}},79118:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Request=t.Put=t.Post=t.Get=void 0;const i=o(n(18706)),s="HTTP";t.Get={id:"GET Request",defaultStyle:{icon:"fa-server"},namespace:s,description:"Performs a HTTP GET request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:(e,t)=>{let{url:n,headers:o,params:s}=e,{data:r}=t;return i.default.get(n,{headers:o,params:s}).then((e=>r.next(e.data)))}},t.Post={id:"POST Request",defaultStyle:{icon:"fa-server"},namespace:s,description:"Performs a HTTP POST request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"},data:{description:"Data to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:(e,t)=>{let{url:n,headers:o,params:s,data:r}=e,{data:a}=t;const u={headers:o,params:s};return i.default.post(n,r,u).then((e=>a.next(e.data)))}},t.Put={id:"PUT Request",defaultStyle:{icon:"fa-server"},namespace:s,description:"Performs a HTTP PUT request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"},data:{description:"Data to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:(e,t)=>{let{url:n,headers:o,params:s,data:r}=e,{data:a}=t;const u={headers:o,params:s};return i.default.put(n,r,u).then((e=>a.next(e.data)))}},t.Request={id:"Request",defaultStyle:{icon:"fa-server"},namespace:s,description:"Performs a HTTP request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},method:{description:"HTTP method to use"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"},data:{description:"Data to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:(e,t)=>{let{url:n,method:o,headers:s,params:r,data:a}=e,{data:u}=t;const l={method:o,headers:s,params:r};return i.default.request({url:n,data:a,...l}).then((e=>u.next(e.data)))}}},67040:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Flatten=t.Slice=t.RemoveAt=t.Remove=t.Prepend=t.Append=t.AccumulateSomeValuesByCount=t.AccumulateValuesByCount=t.AccumulateValuesByTime=t.AccumulateValuesUntilTrigger=t.SplitQuadruple=t.SplitTriple=t.SplitTuple=t.HeadAndRest=t.LoopList=t.Reverse=t.ConcatLists=t.ListFrom5=t.ListFrom4=t.ListFrom3=t.ListFrom2=t.Repeat=t.GetListElement=t.ListIsEmpty=t.ListLength=void 0;const n="Lists";t.ListLength={id:"List Length",defaultStyle:{icon:"fa-list"},namespace:n,description:"Returns the length of a list",inputs:{list:{description:"List"}},outputs:{length:{description:"Length"}},run:(e,t)=>{let{list:n}=e,{length:o}=t;return o.next(n.length)}},t.ListIsEmpty={id:"List Is Empty",defaultStyle:{icon:"fa-list"},namespace:n,description:"Returns true if the list is empty",inputs:{list:{description:"List"}},outputs:{isEmpty:{description:"Is empty"}},run:(e,t)=>{let{list:n}=e,{isEmpty:o}=t;return o.next(0===n.length)}},t.GetListElement={id:"Get List Element",defaultStyle:{icon:"fa-list"},namespace:n,description:"Returns the element at the specified index",inputs:{list:{description:"List"},index:{description:"Index"}},outputs:{element:{description:"Element"}},run:(e,t)=>{let{list:n,index:o}=e,{element:i}=t;return i.next(n[o])}},t.Repeat={id:"Repeat",defaultStyle:{icon:"fa-list"},namespace:n,description:"Repeats a value a number of times",inputs:{value:{description:"Value to repeat"},times:{description:"How many times will the value be repeated"}},outputs:{list:{description:"List"}},run:(e,t)=>{let{value:n,times:o}=e,{list:i}=t;const s=[];for(let r=0;r{let{value1:n,value2:o}=e,{list:i}=t;return i.next([n,o])}},t.ListFrom3={id:"List From 3",defaultStyle:{icon:"fa-list"},namespace:n,description:"Creates a list from three values",inputs:{value1:{description:"First value"},value2:{description:"Second value"},value3:{description:"Third value"}},outputs:{list:{description:"List containing all 3 values"}},run:(e,t)=>{let{value1:n,value2:o,value3:i}=e,{list:s}=t;return s.next([n,o,i])}},t.ListFrom4={id:"List From 4",defaultStyle:{icon:"fa-list"},namespace:n,description:"Creates a list from four values",inputs:{value1:{description:"First value"},value2:{description:"Second value"},value3:{description:"Third value"},value4:{description:"Fourth value"}},outputs:{list:{description:"List containing all 4 values"}},run:(e,t)=>{let{value1:n,value2:o,value3:i,value4:s}=e,{list:r}=t;return r.next([n,o,i,s])}},t.ListFrom5={id:"List From 5",defaultStyle:{icon:"fa-list"},namespace:n,description:"Creates a list from five values",inputs:{value1:{description:"First value"},value2:{description:"Second value"},value3:{description:"Third value"},value4:{description:"Fourth value"},value5:{description:"Fifth value"}},outputs:{list:{description:"List containing all 5 values"}},run:(e,t)=>{let{value1:n,value2:o,value3:i,value4:s,value5:r}=e,{list:a}=t;return a.next([n,o,i,s,r])}},t.ConcatLists={id:"Concat Lists",defaultStyle:{icon:"fa-list"},namespace:n,description:"Concatenates two lists",inputs:{list1:{description:"First list"},list2:{description:"Second list"}},outputs:{list:{description:"Concatenated list"}},run:(e,t)=>{let{list1:n,list2:o}=e,{list:i}=t;return i.next([...n,...o])}},t.Reverse={id:"Reverse",defaultStyle:{icon:"fa-list"},namespace:n,description:"Reverses a list",inputs:{list:{description:"List"}},outputs:{reversed:{description:"Reversed list"}},run:(e,t)=>{let{list:n}=e,{reversed:o}=t;return o.next(n.reverse())}},t.LoopList={id:"Loop List",defaultStyle:{icon:"fa-list"},namespace:n,searchKeywords:["each","spread"],description:"Emits all values in a list",inputs:{list:{description:"The list to loop"}},outputs:{item:{description:"Will emit a value for each item in the list"},index:{description:"Will emit the index of the item"},length:{description:"Will emit the length of the list"}},run:(e,t)=>{const{list:n}=e,{item:o,index:i}=t;for(const s of n)o.next(s),i.next(n.indexOf(s));t.length.next(n.length)}},t.HeadAndRest={id:"Head and rest",defaultStyle:{icon:"fa-list"},namespace:n,description:"Receives a list and emits two outputs: the first item and the rest of the list",inputs:{list:{description:"The list"}},outputs:{head:{description:"The first item in the list"},rest:{description:"The rest of the list"}},run:(e,t)=>{const{list:n}=e,{head:o,rest:i}=t;o.next(n[0]),i.next(n.slice(1))}},t.SplitTuple={id:"Split Pair",defaultStyle:{icon:"fa-list"},namespace:n,description:"Receives a list with 2 items and emits two outputs: the first item and the second item",inputs:{pair:{description:"The pair to split"}},outputs:{item1:{description:"The first item in the pair"},item2:{description:"The second item in the pair"}},run:(e,t)=>{const{pair:n}=e,{item1:o,item2:i}=t;o.next(n[0]),i.next(n[1])}},t.SplitTriple={id:"Split Triple",defaultStyle:{icon:"fa-list"},namespace:n,description:"Receives a list with 3 items and emits three outputs: the first item, the second item and the third item",inputs:{triple:{description:"The triple"}},outputs:{item1:{description:"The first item in the triple"},item2:{description:"The second item in the triple"},item3:{description:"The third item in the triple"}},run:(e,t)=>{const{list:n}=e,{item1:o,item2:i,item3:s}=t;o.next(n[0]),i.next(n[1]),s.next(n[2])}},t.SplitQuadruple={id:"Split Quadruple",defaultStyle:{icon:"fa-list"},namespace:n,description:"Receives a list with 4 items and emits four outputs: the first item, the second item, the third item and the fourth item",inputs:{quadruple:{description:"The quadruple"}},outputs:{item1:{description:"The first item in the quadruple"},item2:{description:"The second item in the quadruple"},item3:{description:"The third item in the quadruple"},item4:{description:"The fourth item in the quadruple"}},run:(e,t)=>{const{list:n}=e,{item1:o,item2:i,item3:s,item4:r}=t;o.next(n[0]),i.next(n[1]),s.next(n[2]),r.next(n[3])}},t.AccumulateValuesUntilTrigger={id:"Accumulate Values by Trigger",defaultStyle:{icon:"fa-basket-shopping"},namespace:n,description:'Accumulates values sent to the "value" input, until the "reset" input is triggered. Then it emits the accumulated values and resets the accumulator.',inputs:{value:{description:"The value to accumulate"},reset:{description:"Resets the accumulator"}},reactiveInputs:["value","reset"],outputs:{accumulated:{description:"The accumulated values"}},run:(e,t,n)=>{const{item:o,until:i}=e,{r:s}=t,{state:r}=n;let a=r.get("list")||[];void 0!==o&&(a.push(o),r.set("list",a)),void 0!==i&&s.next(a)}},t.AccumulateValuesByTime={id:"Accumulate Values by Time",defaultStyle:{icon:"fa-basket-shopping"},namespace:n,description:'Accumulates values sent to the "value" input. After the specified time it emits the accumulated values and resets the accumulator.',inputs:{value:{description:"The value to accumulate"},time:{description:"Time to wait before emitting the accumulated values. Default is 200ms",defaultValue:200,mode:"required-if-connected"}},reactiveInputs:["value"],outputs:{accumulated:{description:"The accumulated values"}},run:(e,t,n)=>{const{value:o,time:i}=e,{accumulated:s}=t,{state:r}=n;let a=r.get("list")||[];const u=Date.now()%1e3;console.log("called",e.value,e.time,u),r.set("bob",2),console.log(Array.from(r.entries())),void 0!==o&&(a.push(o),r.set("list",a)),r.get("timeout")&&clearTimeout(r.get("timeout"));const l=new Promise((e=>{r.set("resolve",e)}));return r.set("timeout",setTimeout((()=>{console.log("emitting",a,u,Date.now()%1e3),s.next(a),r.set("list",[]);const e=r.get("resolve");if(!e)throw new Error("resolve is undefined");e()}),i)),l}},t.AccumulateValuesByCount={id:"Accumulate Values by Count",defaultStyle:{icon:"fa-basket-shopping"},namespace:n,description:'Accumulates values sent to the "value" input. After the specified count it emits the accumulated values and resets the accumulator.',inputs:{value:{description:"The value to accumulate"},count:{description:"Number of values to accumulate before emitting them"}},reactiveInputs:["value"],outputs:{accumulated:{description:"The accumulated values"}},completionOutputs:["accumulated"],run:(e,t,n)=>{const{value:o,count:i}=e,{accumulated:s}=t,{state:r}=n;let a=r.get("list")||[];void 0!==o&&(a.push(o),r.set("list",a)),a.length>=i&&s.next(a)}},t.AccumulateSomeValuesByCount={id:"Accumulate Some Values by Count",defaultStyle:{icon:"fa-basket-shopping"},namespace:n,description:'Accumulates values sent to the "accept" input. Emits the list after the total items passed to both "accept" and "ignore" inputs reach the specified count.',inputs:{accept:{description:"Values to accumulate"},ignore:{description:"Values to ignore"},count:{description:"Number of values to accumulate before emitting them"}},reactiveInputs:["accept","ignore"],outputs:{accumulated:{description:"The accumulated accepted values"},ignored:{description:"The accumulated ignored values"}},run:(e,t,n)=>{const{accept:o,ignore:i,count:s}=e,{accumulated:r,ignored:a}=t,{state:u}=n;let l=u.get("list")||[],c=u.get("ignored")||[];void 0!==o&&(l.push(o),u.set("list",l)),void 0!==i&&(c.push(i),u.set("ignored",a)),l.length+c.length>=s&&(r.next(l),a.next(a))}},t.Append={id:"Append",namespace:n,description:"Appends an item to a list",inputs:{list:{description:"The list"},item:{description:"The item to append"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,item:o}=e,{list:i}=t;i.next([...n,o])},defaultStyle:{icon:"fa-plus"}},t.Prepend={id:"Prepend",namespace:n,description:"Prepends an item to a list",inputs:{list:{description:"The list"},item:{description:"The item to prepend"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,item:o}=e,{list:i}=t;i.next([o,...n])},defaultStyle:{icon:"fa-arrow-up"}},t.Remove={id:"Remove",namespace:n,description:"Removes an item from a list",inputs:{list:{description:"The list"},item:{description:"The item to remove"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,item:o}=e,{list:i}=t;i.next(n.filter((e=>e!==o)))},defaultStyle:{icon:"fa-minus"}},t.RemoveAt={id:"Remove At",namespace:n,description:"Removes an item from a list at the specified index",inputs:{list:{description:"The list"},index:{description:"The index of the item to remove"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,index:o}=e,{list:i}=t;i.next(n.filter(((e,t)=>t!==o)))},defaultStyle:{icon:"fa-times"}},t.Slice={id:"Slice",namespace:n,description:"Returns a slice of a list from the specified start index to the specified end index",inputs:{list:{description:"The list"},start:{description:"The index to start slicing from"},end:{description:"The index to end slicing at"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,start:o,end:i}=e,{list:s}=t;s.next(n.slice(o,i))},defaultStyle:{icon:"fa-cut"}},t.Flatten={id:"Flatten",namespace:n,description:"Flattens a list of lists into a single list",inputs:{list:{description:"The list of lists"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n}=e,{list:o}=t;o.next(n.reduce(((e,t)=>[...e,...t]),[]))},defaultStyle:{icon:"fa-compress"}}},21518:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyEquals=t.DeleteAttribute=t.SetAttribute=t.GetAttribute=t.ObjectAssign=t.ObjectFromEntries=t.ObjectEntries=t.ObjectValues=t.ObjectHasOwnProperty=t.ObjectKeys=t.JSONStringify=t.JSONParse=void 0;const n="Objects";t.JSONParse={id:"JSON Parse",defaultStyle:{icon:"fa-glasses"},namespace:n,description:"Parses a JSON string into an object",inputs:{json:{description:"JSON string to parse"}},outputs:{object:{description:"The parsed object"}},run:(e,t)=>{let{json:n}=e,{object:o}=t;return o.next(JSON.parse(n))}},t.JSONStringify={id:"JSON Stringify",defaultStyle:{icon:"fa-pen-fancy"},namespace:n,description:"Stringifies an object into a JSON string",inputs:{object:{description:"Object to stringify"}},outputs:{json:{description:"The stringified JSON"}},run:(e,t)=>{let{object:n}=e,{json:o}=t;return o.next(JSON.stringify(n))}},t.ObjectKeys={id:"Keys",defaultStyle:{icon:"fa-key"},namespace:n,description:"Emits the keys of an object",inputs:{object:{description:"Object to get keys of"}},outputs:{keys:{description:"The keys of object"}},run:(e,t)=>{let{object:n}=e,{keys:o}=t;return o.next(Object.keys(n))}},t.ObjectHasOwnProperty={id:"Has own property",defaultStyle:{icon:"fa-key"},namespace:n,description:"Checks if object has property",inputs:{object:{mode:"required",description:"Object to get keys of"},property:{mode:"required",description:"the property to search for"}},outputs:{true:{description:"The value is true"},false:{description:"The value is false"}},run:function(e,t){const{true:n,false:o}=t,{object:i,property:s}=e;i.hasOwnProperty(s)?n.next(!0):o.next(!1)}},t.ObjectValues={id:"Values",namespace:n,description:"Emits the values of an object",inputs:{object:{description:"Object to get values of"}},outputs:{values:{description:"The values of object"}},run:(e,t)=>{let{object:n}=e,{values:o}=t;return o.next(Object.values(n))}},t.ObjectEntries={id:"Entries",defaultStyle:{icon:"fa-box"},namespace:n,description:"Emits the entries of an object",inputs:{object:{description:"Object to get entries of"}},outputs:{entries:{description:"The entries of object"}},run:(e,t)=>{let{object:n}=e,{entries:o}=t;return o.next(Object.entries(n))}},t.ObjectFromEntries={id:"From Entries",namespace:n,defaultStyle:{icon:"fa-box"},description:"Creates an object from an array of entries",inputs:{entries:{description:"Array of entries to create object from"}},outputs:{object:{description:"The created object"}},run:(e,t)=>{let{entries:n}=e,{object:o}=t;return o.next(Object.fromEntries(n))}},t.ObjectAssign={id:"Assign",namespace:n,defaultStyle:{icon:"fa-box"},description:"Assigns properties from one or more objects to a target object",inputs:{target:{description:"Target object to assign properties to"},sources:{description:"One or more objects to assign properties from"}},outputs:{object:{description:"The target object"}},run:(e,t)=>{let{target:n,sources:o}=e,{object:i}=t;return i.next(Object.assign(n,...o))}},t.GetAttribute={id:"Get Attribute",searchKeywords:["pick","dot"],namespace:n,defaultStyle:{icon:"fa-magnifying-glass"},description:"Gets an attribute from an object",inputs:{object:{description:"Object to get attribute from"},attribute:{description:"Attribute to get"}},outputs:{value:{description:"The value of the attribute"}},customViewCode:'{{#if inputs.attribute}}\n Get "{{inputs.attribute}}"\n{{else}}\n Get Attribute\n{{/if}}',run:(e,t)=>{let{object:n,attribute:o}=e,{value:i}=t;return i.next(o.split(".").reduce(((e,t)=>e[t]),n))}},t.SetAttribute={id:"Set Attribute",searchKeywords:["dot"],namespace:n,defaultStyle:{icon:"fa-box"},description:"Sets an attribute on an object",inputs:{object:{description:"Object to set attribute on"},attribute:{description:"Attribute to set"},value:{description:"Value to set attribute to"}},outputs:{object:{description:"The object with the attribute set"}},customViewCode:'{{#if inputs.attribute}}\n Set "{{inputs.attribute}}"\n{{else}}\n Set Attribute\n{{/if}}',run:(e,t)=>{let{object:n,attribute:o,value:i}=e,{object:s}=t;const r=o.split("."),a=r.pop();return r.reduce(((e,t)=>e[t]),n)[a]=i,s.next(n)}},t.DeleteAttribute={id:"Delete Attribute",defaultStyle:{icon:"fa-box"},namespace:n,description:"Deletes an attribute from an object",inputs:{object:{description:"Object to delete attribute from"},attribute:{description:"Attribute to delete"}},customViewCode:'{{#if inputs.attribute.value}}\n Delete "{{inputs.attribute.value}}"\n{{else}}\n Delete Attribute\n{{/if}}',outputs:{object:{description:"The object with the attribute deleted"}},run:(e,t)=>{let{object:n,attribute:o}=e,{object:i}=t;const s=o.value.split("."),r=s.pop();delete s.reduce(((e,t)=>e[t]),n.value)[r],i.next(n.value)}},t.PropertyEquals={id:"Property Equals",namespace:n,defaultStyle:{icon:"fa-equals"},description:'Emits the object to the "true" output if an object\'s property equals a value, otherwise emits to the "false" output',inputs:{object:{description:"Object to check property of"},attribute:{description:"Attribute to check"},value:{description:"Value to check attribute against"}},outputs:{true:{description:"Emitted if the attribute equals the value"},false:{description:"Emitted if the attribute does not equal the value"}},customViewCode:'{{#if inputs.attribute}}\n "{{inputs.attribute}}" equals "{{inputs.value}}"\n{{else}}\n Property Equals\n{{/if}}',run:(e,t)=>{e.attribute.split(".").reduce(((e,t)=>e[t]),e.object)===e.value?t.true.next(e.object):t.false.next(e.object)}}},40863:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyString=t.MatchRegex=t.IsEmpty=t.EndsWith=t.StartsWith=t.Includes=t.ToTitleCase=t.ToSnakeCase=t.ToPascalCase=t.ToCamelCase=t.ToKebabCase=t.CharAt=t.LastIndexOf=t.IndexOf=t.Length=t.Substring=t.ToUpperCase=t.ToLowerCase=t.Trim=t.Replace=t.Join=t.Split=t.Concat=void 0;const n="Strings";t.Concat={id:"Concat",defaultStyle:{icon:"fa-font"},namespace:n,description:"Concatenates two strings",inputs:{a:{description:"String a"},b:{description:"String b"}},outputs:{value:{description:"Concatenated value"}},run:(e,t)=>{let{a:n,b:o}=e,{value:i}=t;return i.next(n+o)}},t.Split={id:"Split",defaultStyle:{icon:"fa-font"},namespace:n,description:"Splits a string",inputs:{string:{description:"String to split"},separator:{description:"Separator"}},outputs:{value:{description:"Splitted value"}},run:(e,t)=>{let{string:n,separator:o}=e,{value:i}=t;return i.next(n.split(o))}},t.Join={id:"Join",defaultStyle:{icon:"fa-font"},namespace:n,description:"Joins an array of strings",inputs:{array:{description:"Array to join"},separator:{description:"Separator"}},outputs:{value:{description:"Joined value"}},run:(e,t)=>{let{array:n,separator:o}=e,{value:i}=t;return i.next(n.join(o))}},t.Replace={id:"Replace",defaultStyle:{icon:"fa-font"},namespace:n,description:"Replaces a string",inputs:{string:{description:"String to replace"},searchValue:{description:"Value to search for"},replaceValue:{description:"Value to replace with"}},outputs:{value:{description:"Replaced value"}},run:(e,t)=>{let{string:n,searchValue:o,replaceValue:i}=e,{value:s}=t;return s.next(n.replace(o,i))}},t.Trim={id:"Trim",defaultStyle:{icon:"fa-font"},namespace:n,description:"Trims a string",inputs:{string:{description:"String to trim"}},outputs:{value:{description:"Trimmed value"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(n.trim())}},t.ToLowerCase={id:"To Lower Case",defaultStyle:{icon:"fa-font"},namespace:n,description:"Converts a string to lower case",inputs:{string:{description:"String to convert to lower case"}},outputs:{value:{description:"Converted value"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(n.toLowerCase())}},t.ToUpperCase={id:"To Upper Case",defaultStyle:{icon:"fa-font"},namespace:n,description:"Converts a string to upper case",inputs:{string:{description:"String to convert to upper case"}},outputs:{value:{description:"Converted value"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(n.toUpperCase())}},t.Substring={id:"Substring",defaultStyle:{icon:"fa-font"},namespace:n,description:"Returns the node of the string between the start and end indexes",inputs:{string:{description:"String to get substring from"},start:{description:"Start index"},end:{description:"End index"}},outputs:{value:{description:"Substring"}},run:(e,t)=>{let{string:n,start:o,end:i}=e,{value:s}=t;return s.next(n.substring(o,i))}},t.Length={id:"Length",defaultStyle:{icon:"fa-font"},namespace:n,description:"Returns the length of a string",inputs:{string:{description:"String to get length from"}},outputs:{value:{description:"Length"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(n.length)}},t.IndexOf={id:"Index Of",defaultStyle:{icon:"fa-font"},namespace:n,description:"Returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex",inputs:{string:{description:"String to search in"},searchValue:{description:"Value to search for"},fromIndex:{description:"Index to start searching from"}},outputs:{value:{description:"Index"}},run:(e,t)=>{let{string:n,searchValue:o,fromIndex:i}=e,{value:s}=t;return s.next(n.indexOf(o,i))}},t.LastIndexOf={id:"Last Index Of",defaultStyle:{icon:"fa-font"},namespace:n,description:"Returns the index within the calling String object of the last occurrence of the specified value, or -1 if not found. The calling string is searched backward, starting at fromIndex",inputs:{string:{description:"String to search in"},searchValue:{description:"Value to search for"},fromIndex:{description:"Index to start searching from"}},outputs:{value:{description:"Index"}},run:(e,t)=>{let{string:n,searchValue:o,fromIndex:i}=e,{value:s}=t;return s.next(n.lastIndexOf(o,i))}},t.CharAt={id:"Char At",defaultStyle:{icon:"fa-font"},namespace:n,description:"Returns the character at the specified index",inputs:{string:{description:"String to get character from"},index:{description:"Index to get character from"}},outputs:{value:{description:"Character"}},run:(e,t)=>{let{string:n,index:o}=e,{value:i}=t;return i.next(n.charAt(o))}},t.ToKebabCase={id:"To Kebab Case",defaultStyle:{icon:"fa-font"},namespace:n,description:"Converts a string to kebab case",inputs:{string:{description:"String to convert to kebab case"}},outputs:{value:{description:"Converted value"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(n.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase())}},t.ToCamelCase={id:"To Camel Case",defaultStyle:{icon:"fa-font"},namespace:n,description:"Converts a string to camel case",inputs:{string:{description:"String to convert to camel case"}},outputs:{value:{description:"Converted value"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(n.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g,((e,t)=>0==+e?"":0===t?e.toLowerCase():e.toUpperCase())))}},t.ToPascalCase={id:"To Pascal Case",defaultStyle:{icon:"fa-font"},namespace:n,description:"Converts a string to pascal case",inputs:{string:{description:"String to convert to pascal case"}},outputs:{value:{description:"Converted value"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(n.replace(/(?:^\w|[A-Z]|\b\w)/g,((e,t)=>0===t?e.toUpperCase():e.toLowerCase())).replace(/\s+/g,""))}},t.ToSnakeCase={id:"To Snake Case",defaultStyle:{icon:"fa-font"},namespace:n,description:"Converts a string to snake case",inputs:{string:{description:"String to convert to snake case"}},outputs:{value:{description:"Converted value"}},run:e=>e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/\s+/g,"_").toLowerCase()},t.ToTitleCase={id:"To Title Case",defaultStyle:{icon:"fa-font"},namespace:n,description:"Converts a string to title case",inputs:{string:{description:"String to convert to title case"}},outputs:{value:{description:"Converted value"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(n.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase())))}},t.Includes={id:"Includes",namespace:n,defaultStyle:{icon:"fa-font"},description:"Determines whether one string may be found within another string, returning true or false as appropriate",inputs:{string:{description:"String to search in"},searchValue:{description:"Value to search for"},fromIndex:{description:"Index to start searching from"}},outputs:{value:{description:"Result"}},run:(e,t)=>{let{string:n,searchValue:o,fromIndex:i}=e,{value:s}=t;return s.next(n.includes(o,i))}},t.StartsWith={id:"Starts With",namespace:n,defaultStyle:{icon:"fa-font"},description:"Determines whether a string begins with the characters of another string, returning true or false as appropriate",inputs:{string:{description:"String to search in"},searchValue:{description:"Value to search for"},fromIndex:{description:"Index to start searching from"}},outputs:{value:{description:"Result"}},run:(e,t)=>{let{string:n,searchValue:o,fromIndex:i}=e,{value:s}=t;return s.next(n.startsWith(o,i))}},t.EndsWith={id:"Ends With",namespace:n,defaultStyle:{icon:"fa-font"},description:"Determines whether a string ends with the characters of another string, returning true or false as appropriate",inputs:{string:{description:"String to search in"},searchValue:{description:"Value to search for"},fromIndex:{description:"Index to start searching from"}},outputs:{value:{description:"Result"}},run:(e,t,n)=>e.endsWith(t,n)},t.IsEmpty={id:"Is Empty",namespace:n,defaultStyle:{icon:"fa-font"},description:"Determines whether a string is empty",inputs:{string:{description:"String to check"}},outputs:{value:{description:"Result"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(0===n.length)}},t.MatchRegex={id:"Match Regex",namespace:n,defaultStyle:{icon:"fa-font"},description:"Determines whether a string matches a regular expression",inputs:{string:{description:"String to check"},regex:{description:"Regular expression to match"}},outputs:{value:{description:"Result"}},run:(e,t)=>{let{string:n,regex:o}=e,{value:i}=t;return i.next(n.match(o))}},t.EmptyString={id:"Empty String",namespace:n,defaultStyle:{icon:"fa-font",size:"small"},description:"Creates an empty string",inputs:{},outputs:{string:{description:"The empty string"}},run:(e,t)=>{let{}=e,{string:n}=t;return n.next("")}}},65645:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var o=n(70079),i=n(11253),s=n(74089),r=n(74762),a=n(21766);var u=n(10831),l=n(61997),c=n(77852);const d=(0,a.S)(),p=[0,20],f=e=>{let{flow:t,output:n,inputs:o,onError:s,debugDelay:a,onCompleted:u,dependencies:l,player:c}=e;const p=((e,t)=>{const n=new Set;return{onEvent:o=>{const i={...o,time:Date.now(),executionId:"n/a"};console.info("Got debugger event",o),t.addEvents([i]),e.addEvents([i]),n.forEach((e=>e([i])))},onBatchedEvents:e=>(n.add(e),()=>n.delete(e))}})(c,d);p.debugDelay=a;const f=(0,r.keys)(t.node.outputs)[0];return{executeResult:(0,r.execute)({node:t.node,inputs:o,outputs:{[f]:n},resolvedDeps:{...l,[t.node.id]:t.node},_debugger:p,onCompleted:u,onBubbleError:e=>{s(e)},extraContext:{PubSub:i}}),localDebugger:p}},m=e=>{const{debugDelay:t,onOutput:i,flowProps:a}=e,{flow:m,inputs:h,output:v}=a,g=(0,o.useRef)((0,s.createRuntimePlayer)()),[y,b]=(0,o.useState)(e.flowProps.dependencies),[I,C]=(0,o.useState)(),[x]=(0,s.useDebounce)(y,500),w=(0,c.useDarkMode)(),_=async(e,t)=>{const{node:o}=e,i=Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).find((e=>(0,r.isBaseNode)(e)&&e.id===o.id));let a;b((e=>({...e,[i.id]:{...i,source:{path:"@flyde/stdlib/dist/all-browser",export:i.id}}})));const l=(0,u.ZP)(m,(n=>{if(t){const o=(0,s.vAdd)({x:0,y:0},t.pos);if(a=(0,s.createNewNodeInstance)(e.node,0,o,y),n.node.instances.push(a),t.connectTo){const{insId:e,outputId:o}=t.connectTo;n.node.connections.push({from:{insId:e,pinId:o},to:{insId:a.id,pinId:r.TRIGGER_PIN_ID}})}}}));await new Promise((e=>setTimeout(e,10)));const c=(0,u.ZP)(N,(e=>{e.flow=l,t?.selectAfterAdding&&a&&(e.boardData.selected=[a?.id])}));return O(c),(0,s.toastMsg)(`Node ${o.id} successfully imported from ${e.module}`),y},j=async()=>({importables:Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).filter(r.isBaseNode).map((e=>({node:{...e,source:{path:"n/a",export:"n/a"}},module:"@flyde/stdlib"}))),errors:[]}),[N,O]=(0,o.useState)({flow:m,boardData:{viewPort:{pos:{x:0,y:0},zoom:1},lastMousePos:{x:0,y:0},selected:[]}});(0,o.useEffect)((()=>{O((e=>({...e,flow:m})))}),[m]),(0,o.useEffect)((()=>{b((e=>({...e,main:N.flow.node})))}),[N.flow.node]);const P={state:N,onChangeEditorState:O,hideTemplatingTips:!0,initialPadding:p,onExtractInlineNode:r.noop,disableScrolling:!0,darkMode:w.isDarkMode};(0,o.useEffect)((()=>{g.current.start()}),[]),(0,o.useEffect)((()=>{const{executeResult:n,localDebugger:o}=f({flow:N.flow,dependencies:y,output:v,inputs:h,onError:r.noop,debugDelay:t,player:g.current,onCompleted:e.onCompleted}),s=e.flowProps.output.subscribe((e=>i(e)));return C(o),()=>{n(),s.unsubscribe()}}),[t,x]);const E=(0,o.useMemo)((()=>({resolvedDependencies:y,onImportNode:_,onRequestImportables:j})),[]),S=(0,o.useMemo)((()=>({debuggerClient:I,onRequestHistory:d.requestHistory})),[I]);return o.createElement(l.Z,null,(()=>o.createElement(s.DependenciesContextProvider,{value:E},o.createElement(s.DebuggerContextProvider,{value:S},o.createElement(s.FlowEditor,P)))))}},21766:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var o=n(74762);const i=200,s=()=>{const e=new Map,t=new Map;return{requestHistory:async(n,s,r)=>{const a="input"===r?o.DebuggerEventType.INPUT_CHANGE:o.DebuggerEventType.OUTPUT_CHANGE;if(console.log({insId:n,pinId:s,type:a}),s){const t=`${n}.${s}.${a}`,o=e.get(t)||{total:0,lastSamples:[]},r=o.lastSamples.slice(0,i);return{...o,lastSamples:r}}{const e=t.get(n)||{total:0,lastSamples:[]},o=e.lastSamples.slice(0,i);return{...e,lastSamples:o}}},addEvents:n=>{n.forEach((n=>{if(n.type===o.DebuggerEventType.ERROR){const e=n;e.type=o.DebuggerEventType.OUTPUT_CHANGE,e.pinId=o.ERROR_PIN_ID}if(n.type===o.DebuggerEventType.INPUT_CHANGE||n.type===o.DebuggerEventType.OUTPUT_CHANGE){const{insId:o,type:s,pinId:r}=n;{const t=`${o}.${r}.${s}`,a=e.get(t)||{total:0,lastSamples:[]};a.lastSamples.unshift(n),a.lastSamples.length>i&&a.lastSamples.splice(i,a.lastSamples.length-i),a.total++,e.set(t,a)}{const s=t.get(o)||{total:0,lastSamples:[]};s.lastSamples.unshift(n),s.lastSamples.length>i&&s.lastSamples.splice(i,s.lastSamples.length-i),s.total++,e.set(o,s)}}}))}}}},70974:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>_,examples:()=>x});var o=n(70079),i=n(31918),s=n(65092),r=n(73949),a=n(19841),u=n(74762),l=n(65645),c=n(28648);const d=c.BV,p="Example.flyde",f=`import {loadFlow} from '@flyde/runtime';\n\nconst executeFlow = loadFlow('${p}');\nconst {result} = executeFlow();\nconst {output} = await result;\nconsole.log(\`Output: \${output}\`);`,m=e=>{const t=e.example,[n,i]=o.useState([]),[s,r]=o.useState("Example.flyde"),m=(0,o.useRef)({__trigger:(0,u.dynamicNodeInput)()}),h=(0,o.useRef)((0,u.dynamicOutput)()),v={flow:t.flow.flow,dependencies:t.flow.dependencies,inputs:m.current,output:h.current},g=o.useCallback((()=>{m.current.__trigger.subject.next("run")}),[]);return o.useEffect((()=>{const e=setTimeout((()=>{g()}),1500),t=setInterval((()=>{g()}),10500);return()=>{clearTimeout(e),clearInterval(t)}}),[g]),o.createElement("div",{className:"hero-example"},o.createElement("div",{className:"hero-example__tabs"},o.createElement("div",{onClick:()=>r(p),className:(0,a.default)("file-tag",s===p&&"selected")},p),o.createElement("div",{className:(0,a.default)("file-tag","index.ts"===s&&"selected"),onClick:()=>r("index.ts")},"index.ts")),s===p?o.createElement("div",{className:"flow-wrapper"},o.createElement(l.Y,{flowProps:v,debugDelay:100,onOutput:e=>{i((t=>[`[${(new Date).toLocaleTimeString()}] Output: ${e}`,...t]))}})):null,"index.ts"===s?o.createElement("div",{className:"code-wrapper"},o.createElement(c.dn,{className:"code-example",showLineNumbers:!1,text:f,language:"typescript",theme:d,codeBlock:!0,width:"100%"})):null,o.createElement("div",{className:"terminal-wrapper"},o.createElement("div",{className:"file-tag"},"Terminal"),o.createElement("div",{className:"terminal-emulator"},n.length?n.map(((e,t)=>o.createElement("div",null,e))):o.createElement("em",null,"Waiting for the example to run.."))))};var h=n(49794);function v(){return o.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("path",{d:"M21.9937 9.23411C21.9305 9.05119 21.8157 8.89053 21.663 8.77161C21.5104 8.65268 21.3265 8.5806 21.1337 8.56411L15.4437 7.73411L12.8937 2.56411C12.8118 2.39504 12.6839 2.25245 12.5248 2.15268C12.3656 2.05291 12.1815 2 11.9937 2C11.8058 2 11.6218 2.05291 11.4626 2.15268C11.3034 2.25245 11.1756 2.39504 11.0937 2.56411L8.54363 7.72411L2.85363 8.56411C2.66855 8.59041 2.49455 8.66807 2.35138 8.78826C2.2082 8.90846 2.10159 9.06638 2.04363 9.24411C1.99057 9.41778 1.98581 9.60265 2.02986 9.77875C2.0739 9.95495 2.16509 10.1159 2.29363 10.2442L6.42363 14.2442L5.42363 19.9241C5.38325 20.1125 5.39818 20.3086 5.46661 20.4887C5.53504 20.6688 5.65406 20.8254 5.80936 20.9395C5.96465 21.0535 6.1496 21.1203 6.34196 21.1318C6.53431 21.1433 6.72589 21.0989 6.89363 21.0041L11.9937 18.3341L17.0937 21.0041C17.234 21.0832 17.3925 21.1246 17.5537 21.1241C17.7655 21.1248 17.9721 21.0583 18.1437 20.9341C18.2988 20.8229 18.4189 20.6697 18.4898 20.4925C18.5607 20.3153 18.5794 20.1215 18.5437 19.9341L17.5437 14.2542L21.6737 10.2542C21.8181 10.1318 21.9248 9.97105 21.9814 9.79045C22.0381 9.60995 22.0423 9.41698 21.9937 9.23411ZM15.8437 13.2341C15.7279 13.3465 15.6411 13.4853 15.5906 13.6385C15.5401 13.7918 15.5274 13.955 15.5537 14.1142L16.2737 18.3141L12.5137 16.3142C12.3675 16.2419 12.2067 16.2042 12.0437 16.2042C11.8806 16.2042 11.7198 16.2419 11.5737 16.3142L7.81363 18.3141L8.53363 14.1142C8.55987 13.955 8.54719 13.7918 8.4967 13.6385C8.4462 13.4853 8.35937 13.3465 8.24363 13.2341L5.24363 10.2341L9.45363 9.62415C9.61563 9.60155 9.76963 9.53965 9.90213 9.44376C10.0347 9.34787 10.1416 9.22094 10.2137 9.07411L11.9937 5.26411L13.8737 9.08411C13.9457 9.23094 14.0527 9.35787 14.1852 9.45376C14.3177 9.54965 14.4717 9.61155 14.6337 9.63415L18.8437 10.2442L15.8437 13.2341Z",fill:"currentColor"}))}const g={dependencies:{Delay:{id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:"Control Flow",description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:n(43920).Delay.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Delay"}},Concat:{id:"Concat",defaultStyle:{icon:"fa-font"},namespace:"Strings",description:"Concatenates two strings",inputs:{a:{description:"String a"},b:{description:"String b"}},outputs:{value:{description:"Concatenated value"}},run:n(40863).Concat.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Strings.flyde.js",export:"Concat"}}},flow:{imports:{"@flyde/stdlib":["Delay","Concat"]},node:{instances:[{pos:{x:-745.6308628148531,y:-164.62084499951794},id:"hvnxp46iusf1g91k6dua576w",inputConfig:{delay:{mode:"static",value:4200}},nodeId:"Delay",style:{size:"small",icon:"fa-clock",color:"#00bbf9"}},{pos:{x:-890.0921093750001,y:-381.6685205078125},id:"Inline-value-Hello, -7i048oa",inputConfig:{},node:{id:"Inline-value-Hello, ",inputs:{},outputs:{value:{delayed:!1}},runFnRawCode:'const result = ("Hello, "); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"Hello, "',dataBuilderSource:"IkhlbGxvLCAi",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"},style:{size:"regular",icon:"code",color:"#00f5d4",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-769.3590283203125,y:-276.35265625},id:"ApisCombination-4z1481x",inputConfig:{},node:{id:"Inline-value-World!",inputs:{},outputs:{value:{delayed:!1}},runFnRawCode:'const result = ("World!"); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"World!"',dataBuilderSource:"IldvcmxkISI=",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"},style:{size:"regular",icon:"code",color:"#00f5d4",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-798.6117734787176,y:-85.88893284501296},id:"ldrz8aku7b0eiiettjq0q8rt",inputConfig:{},nodeId:"Concat",style:{size:"small",icon:"fa-font",color:"#fee440"}}],connections:[{from:{insId:"Inline-value-Hello, -7i048oa",pinId:"value"},to:{insId:"ApisCombination-4z1481x",pinId:"__trigger"}},{from:{insId:"ApisCombination-4z1481x",pinId:"value"},to:{insId:"hvnxp46iusf1g91k6dua576w",pinId:"value"}},{from:{insId:"hvnxp46iusf1g91k6dua576w",pinId:"delayedValue"},to:{insId:"ldrz8aku7b0eiiettjq0q8rt",pinId:"b"}},{from:{insId:"ldrz8aku7b0eiiettjq0q8rt",pinId:"value"},to:{insId:"__this",pinId:"output"}},{from:{insId:"Inline-value-Hello, -7i048oa",pinId:"value"},to:{insId:"ldrz8aku7b0eiiettjq0q8rt",pinId:"a"}}],id:"ApisCombination",inputs:{},outputs:{output:{type:"any",optional:!1,delayed:!1}},inputsPosition:{city:{x:-187.27285824815934,y:-14.13215209416181},Bob:{x:-464.39225613814307,y:-267.86263932413937},"\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x92\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x9b\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\xa2\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x9b\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x92\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\xa2":{x:-879.2823974609375,y:-510.9079638671875}},outputsPosition:{json:{x:-441.98276309426666,y:480.38719404276554},na:{x:-441.98276309426666,y:480.38719404276554},result:{x:-499.82438378976735,y:706.7650396699393},output:{x:-783.232804865152,y:11.154386263028243},response:{x:-506.3386688159596,y:488.67302443385125},"Bob 42":{x:-736.217912287027,y:209.40813992513762},"\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x92\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x9b\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x9b\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x92":{x:-589.98,y:-561}}}}},y={dependencies:{Throttle:{id:"Throttle",namespace:"Control Flow",inputs:{value:{mode:"required",description:"The data that needs to be throttled"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The throttled value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the first value received after being idle for "wait" amount of milliseconds',run:n(43920).Throttle.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Throttle"}},Debounce:{id:"Debounce",namespace:"Control Flow",inputs:{value:{mode:"required",description:"The data that needs to be debounced"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The debounced value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the last value received after being idle for "wait" amount of milliseconds',run:n(43920).Debounce.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Debounce"}},Repeat:{id:"Repeat",defaultStyle:{icon:"fa-list"},namespace:"Lists",description:"Repeats a value a number of times",inputs:{value:{description:"Value to repeat"},times:{description:"How many times will the value be repeated"}},outputs:{list:{description:"List"}},run:n(67040).Repeat.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Lists.flyde.js",export:"Repeat"}},"Loop List":{id:"Loop List",defaultStyle:{icon:"fa-list"},namespace:"Lists",searchKeywords:["each","spread"],description:"Emits all values in a list",inputs:{list:{description:"The list to loop"}},outputs:{item:{description:"Will emit a value for each item in the list"},index:{description:"Will emit the index of the item"},length:{description:"Will emit the length of the list"}},run:n(67040).LoopList.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Lists.flyde.js",export:"LoopList"}}},flow:{imports:{"@flyde/stdlib":["Repeat","Throttle","Debounce","Loop List"]},node:{instances:[{pos:{x:-777.6441479492187,y:-230.75769625127003},id:"wj31gd73i5l111q999pv4kor",inputConfig:{wait:{mode:"static",value:4200}},visibleOutputs:["result","__error"],nodeId:"Throttle"},{pos:{x:-960.8631420898437,y:-227.77420626103566},id:"eaa2b80mmdusjvxi3fve0du1",inputConfig:{wait:{mode:"static",value:4200}},nodeId:"Debounce"},{pos:{x:-1007.762890625,y:-141.30592895507812},id:"Inline-value-Debounce: ${in-qj1486n",inputConfig:{},node:{id:"Inline-value-Debounced",inputs:{},outputs:{value:{delayed:!1}},runFnRawCode:"const result = (`Debounced`); Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"`Debounced`",dataBuilderSource:"YERlYm91bmNlZGA=",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"},style:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-897.3139318847655,y:-411.8869211850429},id:"dimxqnz6n9uhawffzb6urp0y",inputConfig:{value:{mode:"static",value:"beep boop"},times:{mode:"static",value:2}},nodeId:"Repeat",style:{size:"small",icon:"fa-list"}},{pos:{x:-882.643474601553,y:-350.2880555829314},id:"dsqx2xve1xghrrhtx1o0ep60",inputConfig:{},nodeId:"Loop List",style:{size:"small",icon:"fa-list"}},{pos:{x:-764.763251953125,y:-141.78481811523437},id:"ApisCombination-7b048r2",inputConfig:{},node:{id:"Inline-value-Throttled",inputs:{},outputs:{value:{delayed:!1}},runFnRawCode:"const result = (`Throttled`); Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"`Throttled`",dataBuilderSource:"YFRocm90dGxlZGA=",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"},style:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}}],connections:[{from:{insId:"Inline-value-Debounce: ${in-qj1486n",pinId:"value"},to:{insId:"__this",pinId:"output"}},{from:{insId:"wj31gd73i5l111q999pv4kor",pinId:"result"},to:{insId:"__this",pinId:"output"}},{from:{insId:"dimxqnz6n9uhawffzb6urp0y",pinId:"list"},to:{insId:"dsqx2xve1xghrrhtx1o0ep60",pinId:"list"}},{from:{insId:"dsqx2xve1xghrrhtx1o0ep60",pinId:"item"},to:{insId:"eaa2b80mmdusjvxi3fve0du1",pinId:"value"}},{from:{insId:"dsqx2xve1xghrrhtx1o0ep60",pinId:"item"},to:{insId:"wj31gd73i5l111q999pv4kor",pinId:"value"}},{from:{insId:"eaa2b80mmdusjvxi3fve0du1",pinId:"result"},to:{insId:"Inline-value-Debounce: ${in-qj1486n",pinId:"__trigger"}},{from:{insId:"wj31gd73i5l111q999pv4kor",pinId:"__error"},to:{insId:"ApisCombination-7b048r2",pinId:"__trigger"}},{from:{insId:"ApisCombination-7b048r2",pinId:"value"},to:{insId:"__this",pinId:"output"}}],id:"ApisCombination",inputs:{},outputs:{output:{type:"any",optional:!1,delayed:!1}},inputsPosition:{city:{x:-187.27285824815934,y:-14.13215209416181},Bob:{x:-464.39225613814307,y:-267.86263932413937},"\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x92\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x9b\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\xa2\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x9b\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x92\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\xa2":{x:-879.2823974609375,y:-510.9079638671875}},outputsPosition:{json:{x:-441.98276309426666,y:480.38719404276554},na:{x:-441.98276309426666,y:480.38719404276554},result:{x:-499.82438378976735,y:706.7650396699393},output:{x:-836.6342941229645,y:-37.81857516275301},response:{x:-506.3386688159596,y:488.67302443385125},"Bob 42":{x:-736.217912287027,y:209.40813992513762},"\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x92\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x9b\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x9b\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x92":{x:-589.98,y:-561}}}}},b={dependencies:{"GET Request":{id:"GET Request",defaultStyle:{icon:"fa-server"},namespace:"HTTP",description:"Performs a HTTP GET request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:n(79118).Get.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Http.flyde.js",export:"Get"}},"Get Attribute":{id:"Get Attribute",searchKeywords:["pick","dot"],namespace:"Objects",defaultStyle:{icon:"fa-magnifying-glass"},description:"Gets an attribute from an object",inputs:{object:{description:"Object to get attribute from"},attribute:{description:"Attribute to get"}},outputs:{value:{description:"The value of the attribute"}},customViewCode:'{{#if inputs.attribute}}\n Get "{{inputs.attribute}}"\n{{else}}\n Get Attribute\n{{/if}}',run:n(21518).GetAttribute.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Objects.flyde.js",export:"GetAttribute"}}},flow:{imports:{"@flyde/stdlib":["GET Request","Get Attribute"]},node:{instances:[{pos:{x:-586.4493664550781,y:56.1908282470703},id:"Format Response-c3048ti",inputConfig:{},node:{id:"Format Response",inputs:{object:{mode:"required"}},outputs:{value:{delayed:!1}},instances:[{id:"Inline-value-Hello from ${i76",node:{id:"Inline-value-Looks like you",inputs:{country:{mode:"required"},capital:{mode:"required"}},outputs:{value:{delayed:!1}},runFnRawCode:"const result = (`Looks like you're from ${inputs.country} (capital - ${inputs.capital})`); Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"`Looks like you're from ${inputs.country} (capital - ${inputs.capital})`",dataBuilderSource:"YExvb2tzIGxpa2UgeW91J3JlIGZyb20gJHtpbnB1dHMuY291bnRyeX0gKGNhcGl0YWwgLSAke2lucHV0cy5jYXBpdGFsfSlg",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"},inputConfig:{},pos:{x:-650.8740991210938,y:270.8550616455078}},{id:"Get Attribute-217",nodeId:"Get Attribute",inputConfig:{attribute:{mode:"static",value:"data.capital"}},pos:{x:-444.1219165039063,y:143.72219421386717}},{id:"Get Country Name And Capital-srp46ei",nodeId:"Get Attribute",inputConfig:{attribute:{mode:"static",value:"data.name"}},pos:{x:-748.3599536132813,y:152.79966308593748}}],defaultStyle:{size:"large",color:"#00f5d4"},inputsPosition:{object:{x:-528.8314208984375,y:21.18914794921875}},outputsPosition:{value:{x:-492.3875732421875,y:445.4477171897888}},connections:[{from:{insId:"Get Country Name And Capital-srp46ei",pinId:"value"},to:{insId:"Inline-value-Hello from ${i76",pinId:"country"}},{from:{insId:"Get Attribute-217",pinId:"value"},to:{insId:"Inline-value-Hello from ${i76",pinId:"capital"}},{from:{insId:"__this",pinId:"object"},to:{insId:"Get Country Name And Capital-srp46ei",pinId:"object"}},{from:{insId:"__this",pinId:"object"},to:{insId:"Get Attribute-217",pinId:"object"}},{from:{insId:"Inline-value-Hello from ${i76",pinId:"value"},to:{pinId:"value",insId:"__this"}}],completionOutputs:["value"]},style:{size:"large",icon:"pencil",color:"#00f5d4"}},{pos:{x:-568.6907110608287,y:-46.22288864604303},id:"j5wyu9nbflija607zg7030gb",inputConfig:{},nodeId:"GET Request"}],connections:[{from:{insId:"Format Response-c3048ti",pinId:"value"},to:{insId:"__this",pinId:"output"}},{from:{insId:"j5wyu9nbflija607zg7030gb",pinId:"data"},to:{insId:"Format Response-c3048ti",pinId:"object"}}],id:"ApisCombination",inputs:{},outputs:{output:{type:"any",optional:!1,delayed:!1}},inputsPosition:{city:{x:-187.27285824815934,y:-14.13215209416181}},outputsPosition:{json:{x:-441.98276309426666,y:480.38719404276554},na:{x:-441.98276309426666,y:480.38719404276554},result:{x:-499.82438378976735,y:706.7650396699393},output:{x:-524.3136059489467,y:180.95270159220047},response:{x:-500.61566893722795,y:421.9045791861946}},completionOutputs:["output"]}}},I={dependencies:{Interval:{id:"Interval",namespace:"Control Flow",defaultStyle:{icon:"fa-clock"},description:"Emits a value every interval",inputs:{value:{description:"Value to emit"},interval:{description:"Interval in milliseconds"}},reactiveInputs:["value","interval"],outputs:{value:{description:"Emitted value"}},completionOutputs:[],run:n(43920).Interval.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Interval"}},"Accumulate Values by Count":{id:"Accumulate Values by Count",defaultStyle:{icon:"fa-basket-shopping"},namespace:"Lists",description:'Accumulates values sent to the "value" input. After the specified count it emits the accumulated values and resets the accumulator.',inputs:{value:{description:"The value to accumulate"},count:{description:"Number of values to accumulate before emitting them"}},reactiveInputs:["value"],outputs:{accumulated:{description:"The accumulated values"}},completionOutputs:["accumulated"],run:n(67040).AccumulateValuesByCount.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Lists.flyde.js",export:"AccumulateValuesByCount"}},"Round Robin 3":{id:"Round Robin 3",namespace:"Control Flow",description:"Item will be emitted to one of the three outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:n(43920).RoundRobin3.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"RoundRobin3"}},"Loop List":{id:"Loop List",defaultStyle:{icon:"fa-list"},namespace:"Lists",searchKeywords:["each","spread"],description:"Emits all values in a list",inputs:{list:{description:"The list to loop"}},outputs:{item:{description:"Will emit a value for each item in the list"},index:{description:"Will emit the index of the item"},length:{description:"Will emit the length of the list"}},run:n(67040).LoopList.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Lists.flyde.js",export:"LoopList"}}},flow:{imports:{"@flyde/stdlib":["Interval","Accumulate Values by Count","Loop List","Round Robin 3"]},node:{instances:[{pos:{x:-631.5591588310128,y:-398.1038369497917},id:"ghunnjxvc8lzz9ir1n7a5cv9",inputConfig:{interval:{mode:"static",value:3141},value:{mode:"static",value:""}},visibleInputs:["interval"],nodeId:"Interval"},{pos:{x:-621.8109288505441,y:-147.24308865877606},id:"zhz7csy5btxnhjsy3k51kj9g",inputConfig:{count:{mode:"static",value:3}},nodeId:"Accumulate Values by Count"},{pos:{x:-734.33669921875,y:-223.71463256835938},id:"Inline-value-beep-d5048it",inputConfig:{},node:{id:"Inline-value-beep",inputs:{},outputs:{value:{delayed:!1}},runFnRawCode:'const result = ("beep"); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"beep"',dataBuilderSource:"ImJlZXAi",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"},style:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-606.1128833007813,y:-224.51904541015625},id:"ApisCombination-u01482r",inputConfig:{},node:{id:"Inline-value-boop",inputs:{},outputs:{value:{delayed:!1}},runFnRawCode:'const result = ("boop"); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"boop"',dataBuilderSource:"ImJvb3Ai",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"},style:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-648.7103934472225,y:-316.292033067738},id:"akc8kvij9dns3euqp01iijtd",inputConfig:{},nodeId:"Round Robin 3"},{pos:{x:-480.1188427734375,y:-225.620185546875},id:"ApisCombination-wn048ny",inputConfig:{},node:{id:"Inline-value-bop",inputs:{},outputs:{value:{delayed:!1}},runFnRawCode:'const result = ("bop"); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"bop"',dataBuilderSource:"ImJvcCI=",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"},style:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-545.0292446458609,y:-57.809316679619855},id:"rjyjsbcahykm15dllqw8tlzj",inputConfig:{},nodeId:"Loop List"}],connections:[{from:{insId:"ghunnjxvc8lzz9ir1n7a5cv9",pinId:"value"},to:{insId:"akc8kvij9dns3euqp01iijtd",pinId:"value"}},{from:{insId:"akc8kvij9dns3euqp01iijtd",pinId:"r1"},to:{insId:"Inline-value-beep-d5048it",pinId:"__trigger"}},{from:{insId:"akc8kvij9dns3euqp01iijtd",pinId:"r2"},to:{insId:"ApisCombination-u01482r",pinId:"__trigger"}},{from:{insId:"akc8kvij9dns3euqp01iijtd",pinId:"r3"},to:{insId:"ApisCombination-wn048ny",pinId:"__trigger"}},{from:{insId:"Inline-value-beep-d5048it",pinId:"value"},to:{insId:"zhz7csy5btxnhjsy3k51kj9g",pinId:"value"}},{from:{insId:"ApisCombination-u01482r",pinId:"value"},to:{insId:"zhz7csy5btxnhjsy3k51kj9g",pinId:"value"}},{from:{insId:"ApisCombination-wn048ny",pinId:"value"},to:{insId:"zhz7csy5btxnhjsy3k51kj9g",pinId:"value"}},{from:{insId:"zhz7csy5btxnhjsy3k51kj9g",pinId:"accumulated"},to:{insId:"rjyjsbcahykm15dllqw8tlzj",pinId:"list"}},{from:{insId:"rjyjsbcahykm15dllqw8tlzj",pinId:"item"},to:{insId:"__this",pinId:"output"}}],id:"ApisCombination",inputs:{},outputs:{output:{type:"any",optional:!1,delayed:!1}},inputsPosition:{city:{x:-187.27285824815934,y:-14.13215209416181}},outputsPosition:{json:{x:-441.98276309426666,y:480.38719404276554},na:{x:-441.98276309426666,y:480.38719404276554},result:{x:-499.82438378976735,y:706.7650396699393},output:{x:-565.3591992106655,y:68.60921099161453},response:{x:-500.61566893722795,y:421.9045791861946}}}}},C=[{preview:"Open Source",title:"Open Source and Transparent",description:o.createElement(o.Fragment,null,o.createElement("p",null,"In Flyde, nothing is hidden. From node implementation, to runtime code. Easily access the code behind each node in Flyde\u2019s standard library."),o.createElement("p",null,"Everything needed to run Flyde flows is"," ",o.createElement("strong",null,"open-source and MIT licensed."))),image:n(43033).Z,imageCaption:"Double click on nodes to jump to their implementation",id:"open-source"},{preview:"CI/CD & Git Friendly",title:"Integrates With Existing Workflows. Doesn\u2019t Replace them.",description:o.createElement(o.Fragment,null,o.createElement("p",null,"Create Flyde flows right from your IDE. Wrap existing TypeScript code in a Flyde node and use it in your flows. Run flows from existing TypeScript code, from arbitrary CLI scripts, to HTTP request handlers, and even front-end code."),o.createElement("p",null,"Flows can be version-controlled, and be part ",o.createElement("strong",null,"CI/CD")," ","pipelines, just like regular text-based code.")),image:n(39415).Z,imageCaption:"Flyde flows and TypeScript code live side by side",id:"git-friendly"},{preview:"Visual Editor",title:"Reason About Programs in New Ways",image:n(61744).Z,imageCaption:"Visualize data flow and view data passing through nodes",description:o.createElement(o.Fragment,null,o.createElement("p",null,"Unlock new ways to think about, and debug your programs. Have an always-correct diagram of your program."),o.createElement("p",null,"Flyde\u2019s flow-based, visual approach makes asynchronous and concurrent tasks simpler and intuitive.")),id:"visual-editor"},{preview:"Flexible & Powerful",title:"Flexible and Powerful",description:o.createElement(o.Fragment,null,o.createElement("p",null,"Built on a functional-reactive foundation, Flyde enables more than simple input/output flows. It supports everything you'd expect from a textual-based language; recursions, loops and conditionals.")),image:n(42016).Z,imageCaption:"Fibonacci sequence in Flyde - a recursive flow example",id:"flexible-powerful"}],x=[{label:"Beep Boop",flow:I,playgroundUrl:"https://play.flyde.dev/?flow=hello-world"},{label:"Hello World",flow:g,tip:'Try double clicking on the "World" node to change the string.',playgroundUrl:"https://play.flyde.dev/?flow=hello-world"},{label:"Debounce/Throttle",flow:y,tip:"Try changing the delay time.",playgroundUrl:"https://play.flyde.dev/?flow=hello-world"},{label:"HTTP Requests",flow:b,tip:'Double click "Format Response" to see how it is implemented.',playgroundUrl:"https://play.flyde.dev/?flow=hello-world"}];function w(){const[e,t]=o.useState(x[0]);return o.createElement("div",{className:(0,a.default)("hero hero--primary",r.Z.heroBanner)},o.createElement("div",{className:"container"},o.createElement("div",{className:"content-wrapper"},o.createElement("a",{className:"github-star",href:"https://www.github.com/flydelabs/flyde",target:"_blank"},o.createElement(v,null)," ",o.createElement("span",null,"Star us on GitHub")),o.createElement("h1",{className:"hero__title"},o.createElement("div",{className:"font-thin"},"Visual Programming."),o.createElement("div",null,"For Developers")),o.createElement("p",{className:"hero__subtitle"},"Open source, runs in"," ",o.createElement("a",{href:"https://marketplace.visualstudio.com/items?itemName=flyde.flyde-vscode",target:"_blank"},"VS Code"),", integrates with existing ",o.createElement("strong",null,"TypeScript")," code, browser and Node.js."),o.createElement("div",{className:"buttons-container"},o.createElement(h.Z,{className:"button button--primary button--lg ",href:"https://marketplace.visualstudio.com/items?itemName=flyde.flyde-vscode"},"Quickstart"),o.createElement(h.Z,{className:"button button--secondary button--lg ",to:"https://play.flyde.dev"},"Playground"))),o.createElement("div",{className:"example-container"},o.createElement(m,{example:e,key:e.label}),e.tip?o.createElement("div",{className:"example-tip"},"Pssst.. ",e.tip," \xa0"):null,o.createElement("div",{className:"example-actions"},x.map((n=>o.createElement("button",{key:n.label,className:"button button--sm example-button "+(n.label===e.label?"button--primary":"button--secondary"),onClick:()=>t(n)},n.label)))))))}function _(){const{siteConfig:e}=(0,i.Z)();return(0,o.useEffect)((()=>{document.querySelectorAll('a[href^="#"]').forEach((e=>{e.addEventListener("click",(function(e){e.preventDefault();let t=this.getAttribute("href"),n=document.querySelector(t);n&&window.scrollTo({top:n.offsetTop-100,behavior:"smooth"})}))}))}),[]),o.createElement(s.Z,{title:"Flyde",description:"Flyde, open-source visual programming language. Runs in the IDE, integrates with existing TypeScript code, browser and Node.js."},o.createElement(w,null),o.createElement("section",{className:"features-strip"},C.map((e=>o.createElement("div",{className:"feature-highlight",key:e.title},o.createElement("a",{href:`#${e.id}`},e.preview))))),C.map((e=>o.createElement("section",{className:"feature-strip",id:e.id},o.createElement("div",{className:"feature-strip-inner"},o.createElement("div",{className:"image-container"},o.createElement("img",{src:e.image}),o.createElement("div",{className:"image-caption"},e.imageCaption)),o.createElement("div",{className:"content-container"},o.createElement("h3",null,e.title),o.createElement("div",{className:"feature-description"},e.description)))))))}},73949:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={"flyde-flow-editor":"flyde-flow-editor_AAD4",_hj_feedback_container:"_hj_feedback_container_Af03"}},85721:(e,t,n)=>{var o={"./af":47654,"./af.js":47654,"./ar":61325,"./ar-dz":98344,"./ar-dz.js":98344,"./ar-kw":26230,"./ar-kw.js":26230,"./ar-ly":42524,"./ar-ly.js":42524,"./ar-ma":44119,"./ar-ma.js":44119,"./ar-sa":82625,"./ar-sa.js":82625,"./ar-tn":42182,"./ar-tn.js":42182,"./ar.js":61325,"./az":37093,"./az.js":37093,"./be":32721,"./be.js":32721,"./bg":59919,"./bg.js":59919,"./bm":95594,"./bm.js":95594,"./bn":563,"./bn-bd":41757,"./bn-bd.js":41757,"./bn.js":563,"./bo":73211,"./bo.js":73211,"./br":87438,"./br.js":87438,"./bs":83662,"./bs.js":83662,"./ca":61196,"./ca.js":61196,"./cs":5841,"./cs.js":5841,"./cv":85251,"./cv.js":85251,"./cy":24512,"./cy.js":24512,"./da":37539,"./da.js":37539,"./de":5059,"./de-at":53853,"./de-at.js":53853,"./de-ch":99378,"./de-ch.js":99378,"./de.js":5059,"./dv":91454,"./dv.js":91454,"./el":39651,"./el.js":39651,"./en-au":87953,"./en-au.js":87953,"./en-ca":98193,"./en-ca.js":98193,"./en-gb":61980,"./en-gb.js":61980,"./en-ie":14050,"./en-ie.js":14050,"./en-il":6502,"./en-il.js":6502,"./en-in":555,"./en-in.js":555,"./en-nz":11372,"./en-nz.js":11372,"./en-sg":26568,"./en-sg.js":26568,"./eo":69533,"./eo.js":69533,"./es":68327,"./es-do":17620,"./es-do.js":17620,"./es-mx":96467,"./es-mx.js":96467,"./es-us":83272,"./es-us.js":83272,"./es.js":68327,"./et":68523,"./et.js":68523,"./eu":19066,"./eu.js":19066,"./fa":59087,"./fa.js":59087,"./fi":96443,"./fi.js":96443,"./fil":93979,"./fil.js":93979,"./fo":90383,"./fo.js":90383,"./fr":56327,"./fr-ca":25610,"./fr-ca.js":25610,"./fr-ch":97274,"./fr-ch.js":97274,"./fr.js":56327,"./fy":67442,"./fy.js":67442,"./ga":44291,"./ga.js":44291,"./gd":77342,"./gd.js":77342,"./gl":96248,"./gl.js":96248,"./gom-deva":21404,"./gom-deva.js":21404,"./gom-latn":20833,"./gom-latn.js":20833,"./gu":9122,"./gu.js":9122,"./he":74623,"./he.js":74623,"./hi":60364,"./hi.js":60364,"./hr":30860,"./hr.js":30860,"./hu":70441,"./hu.js":70441,"./hy-am":90425,"./hy-am.js":90425,"./id":29672,"./id.js":29672,"./is":96150,"./is.js":96150,"./it":27852,"./it-ch":55603,"./it-ch.js":55603,"./it.js":27852,"./ja":16465,"./ja.js":16465,"./jv":20120,"./jv.js":20120,"./ka":87245,"./ka.js":87245,"./kk":21479,"./kk.js":21479,"./km":65038,"./km.js":65038,"./kn":63060,"./kn.js":63060,"./ko":85020,"./ko.js":85020,"./ku":90582,"./ku.js":90582,"./ky":34950,"./ky.js":34950,"./lb":94201,"./lb.js":94201,"./lo":87894,"./lo.js":87894,"./lt":70120,"./lt.js":70120,"./lv":4265,"./lv.js":4265,"./me":14030,"./me.js":14030,"./mi":9463,"./mi.js":9463,"./mk":25898,"./mk.js":25898,"./ml":64233,"./ml.js":64233,"./mn":47156,"./mn.js":47156,"./mr":34479,"./mr.js":34479,"./ms":24691,"./ms-my":6456,"./ms-my.js":6456,"./ms.js":24691,"./mt":81789,"./mt.js":81789,"./my":37452,"./my.js":37452,"./nb":91170,"./nb.js":91170,"./ne":87529,"./ne.js":87529,"./nl":81776,"./nl-be":24455,"./nl-be.js":24455,"./nl.js":81776,"./nn":34705,"./nn.js":34705,"./oc-lnc":36139,"./oc-lnc.js":36139,"./pa-in":17960,"./pa-in.js":17960,"./pl":1899,"./pl.js":1899,"./pt":31670,"./pt-br":29159,"./pt-br.js":29159,"./pt.js":31670,"./ro":55115,"./ro.js":55115,"./ru":45149,"./ru.js":45149,"./sd":81231,"./sd.js":81231,"./se":35397,"./se.js":35397,"./si":99786,"./si.js":99786,"./sk":39383,"./sk.js":39383,"./sl":68691,"./sl.js":68691,"./sq":34826,"./sq.js":34826,"./sr":40080,"./sr-cyrl":75673,"./sr-cyrl.js":75673,"./sr.js":40080,"./ss":54309,"./ss.js":54309,"./sv":52245,"./sv.js":52245,"./sw":8967,"./sw.js":8967,"./ta":10454,"./ta.js":10454,"./te":35204,"./te.js":35204,"./tet":81571,"./tet.js":81571,"./tg":15737,"./tg.js":15737,"./th":41786,"./th.js":41786,"./tk":50511,"./tk.js":50511,"./tl-ph":14828,"./tl-ph.js":14828,"./tlh":62422,"./tlh.js":62422,"./tr":97047,"./tr.js":97047,"./tzl":90792,"./tzl.js":90792,"./tzm":67730,"./tzm-latn":59963,"./tzm-latn.js":59963,"./tzm.js":67730,"./ug-cn":42535,"./ug-cn.js":42535,"./uk":33151,"./uk.js":33151,"./ur":22750,"./ur.js":22750,"./uz":61914,"./uz-latn":60231,"./uz-latn.js":60231,"./uz.js":61914,"./vi":55517,"./vi.js":55517,"./x-pseudo":64078,"./x-pseudo.js":64078,"./yo":70046,"./yo.js":70046,"./zh-cn":81832,"./zh-cn.js":81832,"./zh-hk":90953,"./zh-hk.js":90953,"./zh-mo":38236,"./zh-mo.js":38236,"./zh-tw":71001,"./zh-tw.js":71001};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=s,e.exports=i,i.id=85721},42016:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o=n.p+"assets/images/fibo-cdbc5936ed3856df4928019564ef82dd.gif"},39415:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o=n.p+"assets/images/integrates-cd9b83d7c4fb96804f2ff6edb5e19fcd.gif"},43033:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o=n.p+"assets/images/transparent-25618eaa2d7966dceddf11fb5f2c1108.gif"},61744:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o=n.p+"assets/images/visual-b1b598cd76a44cfb7ae65dec6aeaaa41.gif"}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3237],{19121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cappedArrayDebounce=void 0;t.cappedArrayDebounce=function(e,t,n,o){void 0===o&&(o=500);let i=[],s=null,r=null;return{addItem:a=>{clearTimeout(s),i.push(a),r||(r=setTimeout((()=>{e(i),clearTimeout(s),r=null}),o)),i.length>=n?(e(i),clearTimeout(r),r=null,i=[]):s=setTimeout((()=>{e(i),clearTimeout(r),r=null,i=[]}),t)},flush:()=>{i.length&&(e(i),i=[],clearTimeout(r))},pendingItems:()=>i.length}}},59792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.dataShaper=t.DataShapeType=void 0,function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.ARRAY=3]="ARRAY",e[e.OBJECT=4]="OBJECT",e[e.NULL=5]="NULL",e[e.UNSUPPORTED=6]="UNSUPPORTED"}(n=t.DataShapeType||(t.DataShapeType={}));const o={string:n.STRING,number:n.NUMBER,boolean:n.BOOLEAN,object:n.OBJECT,array:n.ARRAY,null:n.NULL,symbol:n.UNSUPPORTED,undefined:n.UNSUPPORTED,function:n.UNSUPPORTED,bigint:n.UNSUPPORTED};t.dataShaper=function(e,n,i){void 0===n&&(n=5),void 0===i&&(i=5);const s=null===(r=e)?"null":typeof r;var r,a;if("object"===s){if(Array.isArray(e))return n>1?e.filter(((e,t)=>t(0,t.dataShaper)(e,n-1,i))):o.array;if(n>1){const o={};for(const s in e)o[s]=(0,t.dataShaper)(e[s],n-1,i);return a=o,Object.keys(a).sort().reduce(((e,t)=>(e[t]=a[t],e)),{})}return o.object}return o[s]}},23046:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.debugLogger=void 0;const i=(0,o(n(55899)).default)("flyde");t.debugLogger=e=>i.extend(e)},24331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullInsIdPath=void 0,t.fullInsIdPath=function(e,t){if(!e)throw new Error("insId is not defined");return t?`${t}.${e}`:e}},34459:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hashFlow=t.hashNode=void 0;const i=o(n(68805)),s=n(30292),r=e=>(0,i.default)(e);t.hashNode=function(e,t){var n;void 0===t&&(t=!0);const{id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l}=e,c={id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l};if((0,s.isVisualNode)(e)){const{instances:n,connections:o,inputsPosition:i,outputsPosition:s}=e,a=n.map((e=>{const{pos:t,...n}=e;return n})),u=t?{}:{inputsPosition:i,outputsPosition:s},l=t?a:n;l.sort(((e,t)=>e.id.localeCompare(t.id)));const d=[...o];d.sort(((e,t)=>{const n=`${e.from.insId}.${e.from.pinId}`,o=`${t.from.insId}.${t.from.pinId}`;return n.localeCompare(o)}));const p=JSON.stringify({instancesToUse:l,conns:d,...c,maybeIoPos:u});return r(p)}if((0,s.isInlineValueNode)(e)){const{customViewCode:t}=e,o=null!==(n=e.fnCode)&&void 0!==n?n:e.runFnRawCode,i=JSON.stringify({fnCode:o,customViewCode:t,...c});return r(i)}throw new Error("Hashing code nodes unsupported")};t.hashFlow=e=>{const{node:n,imports:o}=e,i=(0,t.hashNode)(n,!1),s=Object.entries(null!=o?o:{}).sort(((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)})).map((e=>{let[t,n]=e;return[t,n.sort()]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{}),a=JSON.stringify(s);return r(i+a)}},86873:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DepGraph=void 0,i(n(3172),t),i(n(59962),t),i(n(23046),t),i(n(19121),t),i(n(59962),t),i(n(34459),t),i(n(39043),t),i(n(59792),t),i(n(24331),t),t.DepGraph=n(60359).DepGraph},3172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testDataCreator=void 0;t.testDataCreator=e=>function(t){void 0===t&&(t={});return{..."function"==typeof e?e():e,...t}}},59962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplePluralize=t.eventually=t.delay=t.noop=t.removeDupes=t.ensure=t.isOptionalType=t.callFnOrFnPromise=t.isPromise=t.isDefined=t.containsAll=t.shuffle=t.randomInts=t.repeat=t.pickRandom=t.randomPos=t.randomInt=t.pickSecond=t.pickFirst=t.fromEntries=t.entries=t.okeys=t.values=t.keys=t.filterOMap=t.mapOMap=t.middlePos=t.calcCenter=t.intersectRect=void 0;t.intersectRect=(e,t)=>{const n=e.x+e.w,o=t.x+t.w;return!(t.x>n||oe.y+e.h||t.y+t.h{let{w:t,h:n,x:o,y:i}=e;return{x:o+t/2,y:i+n/2}};t.middlePos=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});t.mapOMap=(e,n)=>(0,t.entries)(e).map((e=>{let[t,o]=e;return[t,n(t,o)]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.filterOMap=(e,n)=>(0,t.entries)(e).filter((e=>{let[t,o]=e;return n(t,o)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.keys=e=>Object.keys(e);t.values=e=>Object.values(e),t.okeys=t.keys;t.entries=e=>(0,t.okeys)(e).map((t=>[t,e[t]]));t.fromEntries=e=>e.reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.pickFirst=e=>e[0];t.pickSecond=e=>e[1];t.randomInt=function(e,t){void 0===t&&(t=0);const n=Math.random();return t+Math.floor((e-t)*n)};t.randomPos=function(e,n){void 0===e&&(e=1e3),void 0===n&&(n=0);return{x:(0,t.randomInt)(e,n),y:(0,t.randomInt)(e,n)}};t.pickRandom=e=>e[(0,t.randomInt)(e.length)];t.repeat=(e,t)=>"x".repeat(e).split("").map(((e,n)=>t(n)));t.randomInts=function(e,n,o){return void 0===n&&(n=100),void 0===o&&(o=0),(0,t.repeat)(e,(()=>(0,t.randomInt)(n,o)))};t.shuffle=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t};t.containsAll=(e,t)=>t.every((t=>e.includes(t)));t.isDefined=e=>void 0!==e;t.isPromise=e=>e&&"function"==typeof e.then;t.callFnOrFnPromise=(e,n)=>{if(!(0,t.isDefined)(e))return;const o=e=>{try{e()}catch(t){console.error(n,t)}};"function"==typeof e?o(e):Promise.resolve(e).then((e=>{"function"==typeof e&&o(e)}))};t.isOptionalType=e=>/\?$/.test(e);t.ensure=(e,t)=>{if(void 0===e)throw new Error(t||"Undefined value passed");return e};t.removeDupes=e=>Array.from(new Set(e));t.noop=()=>{};t.delay=e=>new Promise((t=>setTimeout(t,e)));t.eventually=async function(e,n,o,i){if(void 0===n&&(n=1e3),void 0===o&&(o=100),void 0===i&&(i=new Set),n<0){const e=Array.from(i).reduce(((e,t,n)=>`${e}\n\t\t${n+1}. ${t}`),"");throw new Error(`[Eventually timeout exceeded after: timeout with error]: ${e}`)}try{await e()}catch(s){const r=Date.now();await(0,t.delay)(o);const a=Date.now()-r;return i.add(null==s?void 0:s.message),(0,t.eventually)(e,n-a,o,i)}},t.simplePluralize=function(e,t){return`${e} ${t}${1!==e?"s":""}`}},39043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileObjectTemplate=t.compileStringTemplate=void 0;t.compileStringTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=new RegExp("\\$\\{"+e+"\\}","g");n=n.replace(i,o)})),n};t.compileObjectTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=JSON.stringify(o),s=new RegExp('"\\$\\$\\{'+e+'\\}"',"g"),r=new RegExp("\\$\\{"+e+"\\}","g"),a="string"==typeof o?o.replace(/"/g,((e,t,n)=>"\\"!==n[t-1]?'\\"':n[t])):o;n=n.replace(s,i).replace(r,a).replace(/\n/g,"\\n")})),JSON.parse(n)}},69150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connection=t.connectionData=t.connectionDataEquals=t.connectionNodeEquals=t.connectionNode=t.externalConnectionNode=t.isInternalConnection=t.isExternalConnection=t.isInternalConnectionNode=t.isExternalConnectionNode=t.getNodeOutputs=t.getOutputName=t.getInputName=t.getNodeInputs=t.TRIGGER_PIN_ID=t.ERROR_PIN_ID=t.THIS_INS_ID=void 0;const o=n(30292);t.THIS_INS_ID="__this",t.ERROR_PIN_ID="__error",t.TRIGGER_PIN_ID="__trigger";t.getNodeInputs=e=>({...e.inputs,[t.TRIGGER_PIN_ID]:(0,o.nodeInput)()});t.getInputName=e=>e===t.TRIGGER_PIN_ID?"Trigger Node":e;t.getOutputName=e=>e===t.ERROR_PIN_ID?"Error":e;t.getNodeOutputs=e=>({...e.outputs,[t.ERROR_PIN_ID]:(0,o.nodeOutput)()});t.isExternalConnectionNode=e=>e&&e.insId===t.THIS_INS_ID;t.isInternalConnectionNode=e=>e.insId!==t.THIS_INS_ID;t.isExternalConnection=e=>{let{from:n,to:o}=e;return(0,t.isExternalConnectionNode)(n)||(0,t.isExternalConnectionNode)(o)};t.isInternalConnection=e=>!(0,t.isExternalConnection)(e);t.externalConnectionNode=e=>({insId:t.THIS_INS_ID,pinId:e});t.connectionNode=(e,t)=>({insId:e,pinId:t});t.connectionNodeEquals=(e,t)=>e.insId===t.insId&&e.pinId===t.pinId;t.connectionDataEquals=(e,n)=>!(!e||!n)&&((0,t.connectionNodeEquals)(e.from,n.from)&&(0,t.connectionNodeEquals)(e.to,n.to)),t.connectionData=function(e,n,o){const i="string"==typeof e?e.split("."):e,s="string"==typeof n?n.split("."):n;if(i.length>2||s.length>2)throw new Error(`invalid source or target to connection data - ${e} / ${n}`);return{from:2===i.length?(0,t.connectionNode)(i[0],i[1]):(0,t.externalConnectionNode)(i[0]),to:2===s.length?(0,t.connectionNode)(s[0],s[1]):(0,t.externalConnectionNode)(s[0]),delayed:o}};t.connection=function(e,t,n){return void 0===n&&(n=!1),{from:e,to:t,delayed:n}}},6775:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;const s=n(30292),r=n(47025),a=n(86873),u=n(69150);i(n(69150),t);t.connect=function(e,t,n,o,i,l,c,d){void 0===n&&(n={}),void 0===i&&(i={}),void 0===l&&(l=a.noop),void 0===c&&(c={}),void 0===d&&(d={});const{id:p,connections:f,instances:m}=e,h=p||"connected-node"+(0,a.randomInt)(999);return{inputs:e.inputs,outputs:e.outputs,id:h,completionOutputs:e.completionOutputs,reactiveInputs:e.reactiveInputs,run:(p,v)=>{let g=[];const y=new a.DepGraph({}),b=new Map,I=new Map,C=new Map,x=new Map,w=new Map,_=new Map;let j;const N=new Set;m.forEach((e=>{const n=(0,s.getNode)(e,t),o=e.id;b.set(e,o),I.set(o,e),y.addNode(o);const i=Object.keys(n.inputs),r=Object.keys(n.outputs),a={},l={};i.forEach((t=>{const n=(e.inputConfig||{})[t]||(0,s.queueInputPinConfig)();(0,s.isStaticInputPinConfig)(n)?a[t]=(0,s.staticNodeInput)(n.value):a[t]=(0,s.dynamicNodeInput)({config:n})})),a[u.TRIGGER_PIN_ID]=(0,s.dynamicNodeInput)({config:(0,s.queueInputPinConfig)()});if(f.some((t=>(0,u.isInternalConnectionNode)(t.to)&&t.to.insId===e.id&&t.to.pinId===u.TRIGGER_PIN_ID))&&e.inputConfig&&e.inputConfig[u.TRIGGER_PIN_ID])throw"Trigger connection can not be configured";r.forEach((e=>{const t=(0,s.dynamicOutput)();l[e]=t}));f.some((t=>(0,u.isInternalConnectionNode)(t.from)&&t.from.insId===e.id&&t.from.pinId===u.ERROR_PIN_ID))&&(l[u.ERROR_PIN_ID]=(0,s.dynamicOutput)()),C.set(o,a),x.set(o,l)}));const O=new Set;return f.forEach((n=>{const{from:o,to:i}=n,{insId:r,pinId:a}=o,{insId:l,pinId:c}=i,d=x.get(r),p=C.get(l);if((0,u.isInternalConnectionNode)(i)&&O.add(`${i.insId}.${i.pinId}`),(0,u.isExternalConnection)(n)){if((0,u.isExternalConnectionNode)(o)){const e=null==p?void 0:p[i.pinId];if(!e)throw new Error(`Input ${i.pinId} of instance ${l} not found`);const t=w.get(o.pinId)||[];t.push(e),w.set(o.pinId,t)}else{let e=null==d?void 0:d[o.pinId];if(!e)throw new Error(`Output ${o.pinId} of instance ${r} not found`);const t=_.get(i.pinId)||[];t.push(e),_.set(i.pinId,t)}return}if(!d)throw new Error(`No outputs found for instance [${r}]`);if(!p)throw I.has(l)?new Error(`No inputs found for instance [${l}]`):new Error(`Instance with id [${l}] does not exist!`);const f=d[a];if(!f)throw new Error(`Output source - [${a}] not found in node [${h}]`);const m=p[c],v=I.get(r);if(!v&&r!==u.THIS_INS_ID)throw new Error(`Instance [${r}] does not exist! failed to connect [${o}] -> [${i}]`);const b=(v?(0,s.getNode)(v,t):e).outputs[a];if(b&&b.delayed||n.delayed||r!==u.THIS_INS_ID&&l!==u.THIS_INS_ID&&y.addDependency(r,l),!m)throw new Error(`Target arg - [${i}] not found in node [${h}]`);const j=f.subscribe((async e=>{if(!(0,s.isDynamicInput)(m))throw console.info(m),new Error(`Impossible state listening to non dynamic input - ${l}.${c}`);m.subject.next(e)}));g.push((()=>j.unsubscribe()))})),(0,a.okeys)(v).forEach((e=>{(_.get(e)||[]).forEach((t=>{const n=t.subscribe((async t=>{if(!v[e])throw new Error(`Impossible state - output ${e} does not exist`);v[e].next(t)}));g.push((()=>n.unsubscribe()))}))})),y.overallOrder().map((e=>I.get(e))).forEach((e=>{const a=C.get(e.id),u=x.get(e.id),p=(0,s.getNode)(e,t);if(!a)throw new Error(`Unexpected error - args not found when running ${e}`);if(!u)throw new Error(`Unexpected error - outputs not found when running ${e}`);for(const t in a){const n=e.inputConfig[t];O.has(`${e.id}.${t}`)||(0,s.isStaticInputPinConfig)(n)||delete a[t]}const f=(0,r.execute)({node:p,inputs:a,outputs:u,resolvedDeps:t,_debugger:n,insId:e.id,extraContext:d,mainState:i,ancestorsInsIds:o,onBubbleError:l,onCompleted:()=>{return t=e.id,N.delete(t),void(0===N.size&&j&&j());var t},onStarted:()=>{return t=e.id,void N.add(t);var t},env:c});g.push(f)})),Object.keys(p).forEach((async e=>{(w.get(e)||[]).forEach((t=>{const n=p[e];if(!(0,s.isDynamicInput)(t))throw new Error(`Unsure what to do with key ${e}, input: ${t} of ins ${o}`);(0,a.isDefined)(n)&&t.subject.next(n)}))})),void 0===e.completionOutputs&&N.size>0?new Promise((e=>{j=e})):()=>g.forEach((e=>{try{e()}catch(t){console.error("error unsubscribing",t)}}))}}}},26488:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MINOR_DEBUGGER_EVENT_TYPES=t.MAJOR_DEBUGGER_EVENT_TYPES=t.DebuggerEventType=void 0,function(e){e.INPUT_CHANGE="i",e.OUTPUT_CHANGE="o",e.PROCESSING_CHANGE="pc",e.ERROR="err",e.INPUTS_STATE_CHANGE="isc"}(n=t.DebuggerEventType||(t.DebuggerEventType={})),t.MAJOR_DEBUGGER_EVENT_TYPES=[n.INPUT_CHANGE,n.OUTPUT_CHANGE,n.ERROR],t.MINOR_DEBUGGER_EVENT_TYPES=[n.PROCESSING_CHANGE,n.INPUTS_STATE_CHANGE]},43686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatEvent=void 0;const o=n(26488);t.formatEvent=function(e){var t,n,i;const s=[e.insId,...null!==(n=null===(t=e.ancestorsInsIds)||void 0===t?void 0:t.split("."))&&void 0!==n?n:[]];(null===(i=e.ancestorsInsIds)||void 0===i?void 0:i.length)>0&&e.ancestorsInsIds;const r=`Node <${e.nodeId}> `,a=`(${s.join(" -> ")})`;return`${r} - ${function(e){switch(e.type){case o.DebuggerEventType.PROCESSING_CHANGE:return e.val?"started processing":"stopped processing";case o.DebuggerEventType.INPUT_CHANGE:return`Input pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.OUTPUT_CHANGE:return`Output pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.INPUTS_STATE_CHANGE:return`Inputs queue size changed to ${Object.entries(e.val).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join(", ")}`;case o.DebuggerEventType.ERROR:return`Error: ${e.val}`}}(e)} ${a}`}},99896:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26488),t),i(n(43686),t)},47025:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.GLOBAL_STATE_NS=t.ROOT_INS_ID=t.INPUTS_STATE_SUFFIX=t.INNER_STATE_SUFFIX=void 0;const s=n(62600),r=n(87794);i(n(99896),t);const a=n(30292),u=n(6775),l=n(84479),c=n(86873),d=n(23046),p=n(30292),f=n(99896),m=n(79804);t.INNER_STATE_SUFFIX="_inner",t.INPUTS_STATE_SUFFIX="_inputs";t.ROOT_INS_ID="__root",t.GLOBAL_STATE_NS="____global";t.execute=e=>{let{node:n,inputs:o,outputs:i,resolvedDeps:h,_debugger:v={},insId:g=t.ROOT_INS_ID,extraContext:y={},mainState:b={},ancestorsInsIds:I,onBubbleError:C=s.noop,env:x={},onCompleted:w=s.noop,onStarted:_=s.noop}=e;const j=[];b[t.GLOBAL_STATE_NS]||(b[t.GLOBAL_STATE_NS]=new Map);const N={...y,ENV:x},O=(0,m.customNodesToNodesCollection)(h,N),P=e=>{const t=e instanceof a.NodeInstanceError?e:new a.NodeInstanceError(e,(0,c.fullInsIdPath)(g,I),n.id);v.onEvent&&v.onEvent({type:f.DebuggerEventType.ERROR,val:t,insId:g,ancestorsInsIds:I,nodeId:n.id}),i[u.ERROR_PIN_ID]?i[u.ERROR_PIN_ID].next(t):C(t)},E=(e=>(0,a.isVisualNode)(e)?(0,u.connect)(e,O,v,(0,c.fullInsIdPath)(g,I),b,P,x,y):(0,a.isInlineValueNode)(e)?(0,m.inlineValueNodeToNode)(e,N):e)(n),S=v.onEvent||s.noop,T={},D={};(0,c.entries)(o).forEach((e=>{let[t,o]=e;if((0,a.isDynamicInput)(o)){const e=(0,a.dynamicNodeInput)({config:o.config}),i=o.subject.subscribe((async o=>{const i=S({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o,ancestorsInsIds:I,nodeId:n.id});if(i){const t=await i.valuePromise;e.subject.next(t)}else v.debugDelay&&await(0,c.delay)(v.debugDelay),e.subject.next(o)}));j.push((()=>i.unsubscribe())),D[t]=e}else{S({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o.config.value,ancestorsInsIds:I,nodeId:n.id});const e=(0,a.staticNodeInput)((0,a.getStaticValue)(o.config.value,O,g));D[t]=e}})),(0,c.entries)(i).forEach((e=>{let[t,o]=e;const i=(0,a.dynamicOutput)(),s=i.subscribe((async e=>{const i=S({type:f.DebuggerEventType.OUTPUT_CHANGE,insId:g,pinId:t,val:e,ancestorsInsIds:I,nodeId:n.id});if(i){const e=await i.valuePromise;o.next(e)}else o.next(e)}));j.push((()=>s.unsubscribe())),T[t]=i}));const M=(e=>{var n,o;const{node:i,inputs:u,outputs:m,resolvedDeps:h,_debugger:v,insId:g,ancestorsInsIds:y,mainState:b,onError:I,onStarted:C,onCompleted:x,env:w,extraContext:_}=e,{run:j,fn:N}=i,O=(0,d.debugLogger)("core"),P=[];let E;const S=(null==v?void 0:v.onEvent)||s.noop,T=(0,c.fullInsIdPath)(g,y),D=`${T}${t.INNER_STATE_SUFFIX}`,M=`${T}${t.INPUTS_STATE_SUFFIX}`,k=O.extend(T),R=b[t.GLOBAL_STATE_NS];b[D]||(b[D]=new Map),b[M]||(b[M]=new Map);let A=null!==(n=b[M])&&void 0!==n?n:new Map;const V=()=>{const e=Array.from(A.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:(0,a.isQueueInputPinConfig)(u[n].config)?null==o?void 0:o.length:1}}),{});S({type:f.DebuggerEventType.INPUTS_STATE_CHANGE,val:e,insId:g,ancestorsInsIds:y,nodeId:i.id})},L={execute:(e,n,o,i)=>(0,t.execute)({node:e,inputs:n,outputs:o,resolvedDeps:h,_debugger:v,insId:i,onCompleted:x,onStarted:C}),insId:g,state:null!==(o=b[D])&&void 0!==o?o:new Map,onCleanup:e=>{P.push(e)},onError:e=>{I(e)},context:null!=_?_:{},ancestorsInsIds:y,globalState:R};let z,$=!1;const H=(i.reactiveInputs||[]).filter((e=>{var t;return!(0,p.isStaticInputPinConfig)(null===(t=u[e])||void 0===t?void 0:t.config)})),q=()=>{var e;null===(e=b[D])||void 0===e||e.clear(),(0,c.keys)(b).filter((e=>e.startsWith(`${T}.`))).forEach((e=>{b[e]=new Map}))},F=e=>{const t=(null==e?void 0:e.key)&&H.includes(null==e?void 0:e.key);if($&&!t);else{const o=$&&t;if((0,l.isNodeStateValid)(u,A,i)||o){let t;if($){if(!e)throw new Error("Unexpected state, got reactive node while not processing and not valid");const n=(0,l.pullValueForExecution)(e.key,u[e.key],A,w);t={...z,[e.key]:n},V()}else t=(0,l.pullValuesForExecution)(u,A,w),z=t,V();let o=new Set,s={};if($=!0,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:$,insId:g,ancestorsInsIds:y,nodeId:i.id}),i.completionOutputs){const e=i.completionOutputs.map((e=>e.split("+"))).reduce(((e,t)=>(t.forEach((n=>{e.set(n,t)})),e)),new Map);(0,c.entries)(m).forEach((t=>{let[n,a]=t;a.pipe((0,r.first)()).subscribe((t=>{o.add(n),s[n]=t;let r=e.get(n);r&&(r.splice(r.indexOf(n),1),0===r.length&&($=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:$,insId:g,ancestorsInsIds:y,nodeId:i.id}),x&&x(s),q(),(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),E=void 0,o.clear(),s={},(0,l.hasNewSignificantValues)(u,A,w,i.id)&&F()))}))}))}else(0,c.entries)(m).forEach((e=>{let[t,n]=e;n.subscribe((e=>{s[t]=e}))}));try{k("Running node %s with values %o",i.id,t),C&&C(),E=(null!=N?N:j)(t,m,L),(0,c.isPromise)(E)?E.then((()=>{void 0===i.completionOutputs&&x&&($=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:$,insId:g,ancestorsInsIds:y,nodeId:i.id}),x(s),q(),(0,l.hasNewSignificantValues)(u,A,w,i.id)&&F())})).catch((e=>{I(e),$=!1,k("Error in node %s - value %e",i.id,e),S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:$,insId:g,ancestorsInsIds:y,nodeId:i.id})})):void 0===i.completionOutputs&&x&&($=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:$,insId:g,ancestorsInsIds:y,nodeId:i.id}),x(s),q())}catch(n){I(n),$=!1,k("Error in node %s - value %e",i.id,n),S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:$,insId:g,ancestorsInsIds:y,nodeId:i.id})}const d=H.find((e=>u[e]&&(0,l.peekValueForExecution)(e,u[e],A,w,i.id)));if(d){const e=(0,l.peekValueForExecution)(d,u[d],A,w,i.id);F({key:d,value:e})}else{const e=(0,c.entries)(u).find((e=>{let[t,n]=e;const o=(0,a.isQueueInputPinConfig)(n.config),s=(0,l.peekValueForExecution)(t,n,A,w,i.id);return!!o&&(0,c.isDefined)(s)}));if(e){const[t,n]=e,o=(0,l.peekValueForExecution)(t,n,A,w,i.id);F({key:t,value:o})}}}}};F();const G=(0,l.subscribeInputsToState)(u,A,((e,t)=>{O("Got input %s - value is [%o]",e,t),V();try{F({key:e,value:t})}catch(n){I(n)}}));return P.push(G),()=>{(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),P.forEach((e=>e()))}})({node:E,inputs:D,outputs:T,resolvedDeps:O,_debugger:v,insId:g,mainState:b,ancestorsInsIds:I,onError:P,onBubbleError:C,env:x,extraContext:y,onCompleted:w,onStarted:_});return()=>{j.forEach((e=>e())),M()}}},84479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeInputsToState=t.isNodeStateValid=t.hasNewSignificantValues=t.peekValuesForExecution=t.pullValuesForExecution=t.pullValueForExecution=t.peekValueForExecution=void 0;const o=n(30292),i=n(86873),s=n(6775),r=(e,t)=>{const n=(0,o.extractStaticValue)(e);if((0,o.isEnvValue)(n)){return((e,t)=>{const n=e.split(".");let o={...t};for(let s of n){if(!o||!(0,i.isDefined)(o[s])||null===o[s])throw new Error(`Cannot find key ${e} inside obj ${t}`);o=o[s]}return o})((0,o.getEnvKeyFromValue)(n),t)}return n};t.peekValueForExecution=(e,t,n,i,s)=>{const a=n.get(e);let u;if(!t)throw new Error(`Trying to peek value of inexsting input in key "${e}" in node "${s}"`);return u=(0,o.isStaticInput)(t)?r(t,i):(0,o.isQueueInputPinConfig)(t.config)?a?[...a].shift():void 0:a,u};t.pullValueForExecution=(e,t,n,i)=>{const s=n.get(e);let a;return(0,o.isStaticInput)(t)?a=r(t,i):(0,o.isQueueInputPinConfig)(t.config)?(a=(s||[]).shift(),n.set(e,s)):(a=s,(0,o.isStickyInputPinConfig)(t.config)||n.delete(e)),a};t.pullValuesForExecution=(e,n,o)=>(0,i.entries)(e).reduce(((e,i)=>{let[s,r]=i;return e[s]=(0,t.pullValueForExecution)(s,r,n,o),e}),{});t.peekValuesForExecution=(e,n,o,s)=>(0,i.entries)(e).reduce(((e,i)=>{let[r,a]=i;return e[r]=(0,t.peekValueForExecution)(r,a,n,o,s),e}),{});t.hasNewSignificantValues=(e,n,s,r)=>(0,i.entries)(e).some((e=>{let[a,u]=e;const l=(0,o.isQueueInputPinConfig)(u.config),c=(0,t.peekValueForExecution)(a,u,n,s,r);return(0,i.isDefined)(c)&&l}));t.isNodeStateValid=(e,t,n)=>{const r=(0,i.keys)(e),a=(0,i.keys)(n.inputs).filter((e=>{var t;const o=null===(t=n.inputs[e])||void 0===t?void 0:t.mode;return!o||"required"===o}));r.includes(s.TRIGGER_PIN_ID)&&a.push(s.TRIGGER_PIN_ID);return!!(0,i.containsAll)(r,a)&&(0,i.entries)(e).filter((e=>{let[t]=e;return!!n.inputs[t]||t===s.TRIGGER_PIN_ID})).every((e=>{let[s,r]=e;var a;const u=t.get(s);return"optional"===((null===(a=n.inputs[s])||void 0===a?void 0:a.mode)||"required")||(!!(0,o.isStaticInput)(r)||((0,o.isQueueInputPinConfig)(r.config)?(0,i.isDefined)(u)&&u.length>0:(0,i.isDefined)(u)))}))};t.subscribeInputsToState=(e,t,n)=>{const s=[];return(0,i.entries)(e).forEach((e=>{let[i,r]=e;if(!r)return;if((0,o.isStaticInput)(r))return;const a=r.subject.subscribe((e=>{if((0,o.isQueueInputPinConfig)(r.config)){const o=t.get(i)||[];if(!Array.isArray(o))throw new Error(`impossible state - state of key ${i} is set but not an array`);o.push(e),t.set(i,o),n(i,e)}else t.set(i,e),n(i,e)}));s.push((()=>a.unsubscribe()))})),()=>s.forEach((e=>e()))}},5474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flydeFlowSchema=void 0;const o=n(29022),i=o.z.record(o.z.string(),o.z.string().or(o.z.array(o.z.string()))),s=o.z.strictObject({x:o.z.number(),y:o.z.number()}),r=o.z.discriminatedUnion("mode",[o.z.strictObject({mode:o.z.literal("static"),value:o.z.any()}),o.z.strictObject({mode:o.z.literal("queue")}),o.z.strictObject({mode:o.z.literal("sticky")})]),a=o.z.object({size:o.z.optional(o.z.enum(["small","regular","large"])),icon:o.z.optional(o.z.any()),color:o.z.optional(o.z.string()),cssOverride:o.z.optional(o.z.record(o.z.string()))}),u=o.z.object({pos:s.default({x:0,y:0}),id:o.z.string(),inputConfig:o.z.optional(o.z.record(o.z.string(),r)).default({}),visibleInputs:o.z.optional(o.z.array(o.z.string())),visibleOutputs:o.z.optional(o.z.array(o.z.string())),nodeId:o.z.optional(o.z.string()),node:o.z.optional(o.z.any()),style:o.z.optional(a)}).refine((e=>e.node||e.nodeId),{message:"Instance must have either an inline node or refer to a nodeId"}),l=o.z.union([o.z.string(),o.z.object({mode:o.z.enum(["required","optional","required-if-connected"]),type:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),defaultValue:o.z.optional(o.z.any())})]),c=o.z.object({type:o.z.optional(o.z.string()),optional:o.z.optional(o.z.boolean()),delayed:o.z.optional(o.z.boolean()),description:o.z.optional(o.z.string())}),d=o.z.object({id:o.z.optional(o.z.string()),inputs:o.z.record(o.z.string(),l),outputs:o.z.record(o.z.string(),c),inputsPosition:o.z.optional(o.z.record(o.z.string(),s)),outputsPosition:o.z.optional(o.z.record(o.z.string(),s)),customViewCode:o.z.optional(o.z.string()),dataBuilderSource:o.z.optional(o.z.string()),templateType:o.z.optional(o.z.string()),completionOutputs:o.z.optional(o.z.array(o.z.string())),reactiveInputs:o.z.optional(o.z.array(o.z.string())),defaultStyle:o.z.optional(a),description:o.z.optional(o.z.string()),searchKeywords:o.z.optional(o.z.array(o.z.string()))}),p=o.z.object({instances:o.z.array(u),connections:o.z.array(o.z.strictObject({from:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),to:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),delayed:o.z.optional(o.z.boolean()),hidden:o.z.optional(o.z.boolean())}))}).and(d);t.flydeFlowSchema=o.z.strictObject({imports:o.z.optional(i).default({}),node:p})},74762:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticValueVisualNode=void 0,i(n(86873),t);const s=n(30292);i(n(6775),t),i(n(47025),t),i(n(10418),t),i(n(30292),t),i(n(3320),t),i(n(79804),t),i(n(5474),t);t.isStaticValueVisualNode=e=>!!e&&!!(0,s.maybeGetStaticValueNodeId)(`${e}`)},87093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fakeVm=t.VM=t.VMScript=void 0;const o=n(86873);class i{constructor(e){this.script=e}}t.VMScript=i;class s{constructor(e){this.context=e}run(e){const t=(0,o.okeys)(this.context.sandbox),n=Object.values(this.context.sandbox);Function(...t,e.script)(...n)}}t.VM=s,t.fakeVm={VMScript:i,VM:s}},28145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVM2Instance=void 0;const o=n(87093);t.getVM2Instance=()=>o.fakeVm},79804:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.customNodesToNodesCollection=t.inlineValueNodeToNode=void 0;const i=o(n(18706)),s=n(86873),r=n(30292),a=(0,n(28145).getVM2Instance)();t.inlineValueNodeToNode=function(e,t){void 0===t&&(t={});const{runFnRawCode:n,...o}=e,u=(0,s.debugLogger)(`code-node:${e.id}`),l=`\n try {\n ${n}\n } catch (e) {\n adv.onError(e);\n }\n `,c=new a.VMScript(l),d={...o,run:(n,o,l)=>{const d=new a.VM({sandbox:{inputs:n,outputs:o,setInterval:setInterval,clearInterval:clearInterval,setTimeout:setTimeout,clearTimeout:clearTimeout,encodeURIComponent:encodeURIComponent,adv:l,log:function(){for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeWithDependencies=void 0;const o=n(30292),i=n(74762),s=n(88270);t.getNodeWithDependencies=function(e,n,r){if(void 0===r&&(r=[]),(0,o.isInlineValueNode)(e))return[e];if(r.includes(e.id))return[];const a=(0,i.removeDupes)(e.instances.filter((e=>(0,s.isRefNodeInstance)(e))).map((e=>e.nodeId)).filter((e=>n[e])));return[e,...a.flatMap((e=>{var t;return null!==(t=n[e])&&void 0!==t?t:[]})).reduce(((e,o)=>[...e,...(0,t.getNodeWithDependencies)(o,n,[...r,...a])]),[])]}},30292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88270),t),i(n(43069),t),i(n(79426),t),i(n(44535),t),i(n(18063),t),i(n(20359),t)},18063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeInstanceError=void 0;class n extends Error{constructor(e,t,n){let o="Unknown error";o="string"==typeof e?e:e instanceof Error?e.message:null!==e&&"object"==typeof e?JSON.stringify(e):String(e),super(`${o} (insId: ${t}, nodeId: ${n})`),this.name=this.constructor.name,this.message=`${o} (insId: ${t}, nodeId: ${n})`,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.fullInsIdsPath=t,this.nodeId=n}}t.NodeInstanceError=n},88270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInsId=t.NodeInstance=t.isRefNodeInstance=t.isInlineNodeInstance=t.inlineNodeInstance=t.nodeInstance=void 0;const o=n(36618);t.nodeInstance=(e,t,n,o)=>({id:e,nodeId:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.inlineNodeInstance=(e,t,n,o)=>({id:e,node:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.isInlineNodeInstance=e=>!!e.node;t.isRefNodeInstance=e=>!(0,t.isInlineNodeInstance)(e);t.NodeInstance=(e,t,n,o)=>({id:e,nodeId:t.id,inputConfig:n||{},pos:o||{x:0,y:0}});t.createInsId=e=>`${e.id}-${(0,o.slug)()}`},43069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvKeyFromValue=t.toEnvValue=t.isEnvValue=t.extractStaticValue=t.isStaticInput=t.isDynamicInput=t.staticNodeInput=t.dynamicNodeInputs=t.dynamicNodeInput=t.dynamicOutput=t.nodeOutputs=t.nodeOutput=t.nodeInputs=t.isInputPinOptional=t.nodeInput=void 0;const o=n(62600),i=n(30292),s=n(86873),r=n(79426);t.nodeInput=function(e){return void 0===e&&(e="required"),{mode:e}};t.isInputPinOptional=e=>"optional"===e.mode;t.nodeInputs=(e,n)=>(0,s.repeat)(e,(e=>(0,t.nodeInput)((null==n?void 0:n[e])||"required")));t.nodeOutput=function(e){return void 0===e&&(e=!1),{delayed:e}};t.nodeOutputs=e=>(0,s.repeat)(e,(()=>(0,t.nodeOutput)()));t.dynamicOutput=()=>new o.Subject,t.dynamicNodeInput=(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})));t.dynamicNodeInputs=function(e){return void 0===e&&(e=10),(0,s.repeat)(e,(()=>(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})))()))};t.staticNodeInput=e=>({config:(0,r.staticInputPinConfig)(e)});t.isDynamicInput=e=>{const t=e;return t&&t.subject&&!!t.subject.next};t.isStaticInput=e=>(0,i.isStaticInputPinConfig)(null==e?void 0:e.config);t.extractStaticValue=e=>{if((0,t.isStaticInput)(e))return e.config.value;throw new Error("Cannot extract static value from non static arg")};t.isEnvValue=e=>"string"==typeof e&&e.startsWith("$ENV.");t.toEnvValue=e=>`$ENV.${e}`;t.getEnvKeyFromValue=e=>"string"==typeof e?e.replace(/^\$ENV\./,""):e},20359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeFromFunction=t.getNodeDef=t.getNode=t.getStaticValue=t.maybeGetStaticValueNodeId=t.fromSimplified=t.inlineValueNode=t.codeNode=t.visualNode=t.isInlineValueNode=t.isVisualNode=t.isCodeNode=t.isBaseNode=t.InlineValueNodeType=void 0;const o=n(86873),i=n(88270),s=n(43069);!function(e){e.VALUE="value",e.FUNCTION="function"}(t.InlineValueNodeType||(t.InlineValueNodeType={}));t.isBaseNode=e=>e&&e.id&&e.inputs&&e.outputs;t.isCodeNode=e=>(0,t.isBaseNode)(e)&&"function"==typeof e.run;t.isVisualNode=e=>!!e.instances;t.isInlineValueNode=e=>(0,o.isDefined)(e)&&(0,o.isDefined)(e.runFnRawCode),t.visualNode=(0,o.testDataCreator)({id:"visual-node",inputs:{},outputs:{},instances:[],connections:[],outputsPosition:{},inputsPosition:{}}),t.codeNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},run:o.noop}),t.inlineValueNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},runFnRawCode:""});t.fromSimplified=e=>{let{run:t,inputTypes:n,outputTypes:i,id:s}=e;return{id:s,inputs:(0,o.entries)(n).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),outputs:(0,o.entries)(i).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),run:t}};t.maybeGetStaticValueNodeId=e=>{const t="string"==typeof e&&e.match(/^__node\:(.*)/);if(t){return t[1]}return null};t.getStaticValue=(e,n,o)=>{const i=(0,t.maybeGetStaticValueNodeId)(e);if(i){const e=n[i];if(!e)throw new Error(`Instance ${o} referrer to a node reference ${i} that does not exist`);return e}return e};t.getNode=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw new Error(`Node with id ${n} not found`);return o};t.getNodeDef=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw console.error(`Node with id ${n} not found`),new Error(`Node with id ${n} not found`);return o};t.codeFromFunction=e=>{let{id:t,fn:n,inputNames:o,outputName:i,defaultStyle:r}=e;return{id:t,inputs:o.reduce(((e,t)=>({...e,[t]:(0,s.nodeInput)()})),{}),outputs:{[i]:(0,s.nodeOutput)()},run:(e,t)=>{const s=o.map((t=>e[t])),r=t[i],a=n(...s);return Promise.resolve(a).then((e=>null==r?void 0:r.next(e)))},completionOutputs:[i],defaultStyle:r}}},44535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nodeFromSimpleFunction=void 0,t.nodeFromSimpleFunction=function(e){var t;return{...e,id:e.id,description:e.description,namespace:e.namespace,inputs:e.inputs?e.inputs.reduce(((e,t)=>{let{name:n,description:o,mode:i,defaultValue:s}=t;return{...e,[n]:{description:o,mode:null!=i?i:"required",defaultValue:s}}}),{}):{},outputs:e.output?{[e.output.name]:{description:e.output.description}}:{},defaultStyle:{icon:e.icon,size:e.size},run:null!==(t=e.fullRunFn)&&void 0!==t?t:async function(t,n,o){var i,s;const r=(null!==(i=e.inputs)&&void 0!==i?i:[]).map((e=>{let{name:n}=e;return t[n]}));try{const t=await Promise.resolve(e.run(...r));e.output&&(null===(s=n[e.output.name])||void 0===s||s.next(t))}catch(a){console.error("Error in node",a),o.onError(a)}},customViewCode:e.customViewCode}}},79426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticInputPinConfig=t.isStickyInputPinConfig=t.isQueueInputPinConfig=t.staticInputPinConfig=t.stickyInputPinConfig=t.queueInputPinConfig=t.INPUT_MODES=void 0,t.INPUT_MODES=["queue","sticky","static"];t.queueInputPinConfig=()=>({mode:"queue"});t.stickyInputPinConfig=()=>({mode:"sticky"});t.staticInputPinConfig=e=>({mode:"static",value:e});t.isQueueInputPinConfig=e=>"queue"===e.mode;t.isStickyInputPinConfig=e=>!!e&&"sticky"===e.mode,t.isStaticInputPinConfig=function(e){return!!e&&"static"===e.mode}},10418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedExecute=void 0;const o=n(74762),i=n(47025);t.simplifiedExecute=function(e,t,n,s,r){void 0===r&&(r={});const a=(0,o.keys)(e.outputs),u=Object.keys(n).reduce(((e,t)=>{const i=n[t];return{...e,[t]:(0,o.isDynamicInput)(i)?i:(0,o.staticNodeInput)(i)}}),{}),l=a.reduce(((e,t)=>{const n=(0,o.dynamicOutput)();return s&&n.subscribe((e=>{s(t,e)})),{...e,[t]:n}}),{});return(0,i.execute)({node:e,inputs:u,outputs:l,resolvedDeps:t,onBubbleError:e=>{throw e},...r})}},25779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodePreview=void 0;const o=n(35250),i=n(74762),s=n(86553);t.NodePreview=e=>{let{node:t}=e;const n={node:t,instance:(0,i.nodeInstance)("bob",t.id,{}),connections:[],viewPort:{pos:{x:0,y:0},zoom:1},resolvedDeps:{},connectionsPerInput:{},onUngroup:i.noop,onDblClick:i.noop,onDragEnd:i.noop,onDragMove:i.noop,onDragStart:i.noop,onPinClick:i.noop,onPinDblClick:i.noop,onSelect:i.noop,onTogglePinBreakpoint:i.noop,onTogglePinLog:i.noop,onToggleSticky:i.noop,displayMode:!0,onInspectPin:i.noop,onDetachConstValue:i.noop,onCopyConstValue:i.noop,onPasteConstValue:i.noop,ancestorsInsIds:"",onChangeVisibleInputs:i.noop,onChangeVisibleOutputs:i.noop,onConvertConstToEnv:i.noop,forceShowMinimized:"both",onExtractInlineNode:i.noop,onCloseInlineEditor:i.noop,isConnectedInstanceSelected:!1,inlineEditorPortalDomNode:null,onChangeStyle:i.noop,onDeleteInstance:i.noop,onGroupSelected:i.noop,onSetDisplayName:i.noop,hadError:!1,queuedInputsData:{},onPinMouseDown:i.noop,onPinMouseUp:i.noop};return(0,o.jsx)("div",{className:"node-preview",children:(0,o.jsx)(s.InstanceView,{...n})})}},30653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDarkMode=t.DarkModeProvider=void 0;const o=n(70079),i=(0,o.createContext)(!0);t.DarkModeProvider=i.Provider;t.useDarkMode=()=>(0,o.useContext)(i)},29183:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataInspectionModal=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=n(74089),p=n(83938),f=n(17102),m=n(98158);t.DataInspectionModal=e=>{var t;const{onRequestHistory:n}=(0,m.useDebuggerContext)(),{item:o}=e,[i,s]=c.default.useState(),[r,h]=c.default.useState(0),[v,g]=c.default.useState(""),[y,b]=c.default.useState(),[I]=(0,d.useDebounce)(v,300);(0,c.useEffect)((()=>{b(null==i?void 0:i.lastSamples.filter((e=>"object"==typeof e.val?JSON.stringify(e.val).includes(I):e.val.toString().includes(I)))),h(0)}),[null==i?void 0:i.lastSamples,I]),c.default.useEffect((()=>{!async function(){var e,t;const i=await n(o.insId,null===(e=o.pin)||void 0===e?void 0:e.id,null===(t=o.pin)||void 0===t?void 0:t.type);s(i)}()}),[o,n]);const C=e=>{const t=e.val;return"object"==typeof t?(0,a.jsx)(p.BrowserOnlyReactJson,{src:t}):(0,a.jsx)(u.Code,{children:t.toString()})},x=`"${o.insId}" ${(null===(t=o.pin)||void 0===t?void 0:t.id)?`(${o.pin.id})`:""}`;return(0,a.jsx)(u.Dialog,{isOpen:!0,title:`Inspecting data for instance ${x}`,onClose:e.onClose,canEscapeKeyClose:!1,className:"data-inspection-modal",children:(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{children:[i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("em",{children:[x," called ",i.total," time(s)"]}),i.total>10&&(0,a.jsx)("span",{children:"Showing last 10 samples"})]}):null,(0,a.jsx)("input",{className:"bp5-input bp5-small bp5-fill",type:"search",placeholder:"Search for values",dir:"auto",onChange:e=>g(e.target.value),value:v}),I.length>0&&(0,a.jsxs)("span",{children:["Showing ",null==y?void 0:y.length," of ",i.lastSamples.length," ",'samples matching query "',I,'"']})]}),(0,a.jsx)("main",{className:"main-wrapper",children:(()=>{if(!i)return(0,a.jsx)(f.Loader,{});if(0===i.total)return(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",(0,a.jsx)("em",{children:o.insId})," ",o.pin?(0,a.jsxs)(c.default.Fragment,{children:["and pin ",(0,a.jsx)("em",{children:o.pin.id})]}):null,". Make sure debugger is running and your program was triggered."]});const e=null==y?void 0:y[r];return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Card,{className:"content-wrapper",children:[e?(0,a.jsxs)("div",{className:"info",children:[(0,a.jsxs)("div",{children:["Showing sample ",r," of event from"," ",(0,a.jsx)("strong",{children:(0,d.timeAgo)(e.time)})," (",new Date(e.time).toLocaleString(),")"]}),(0,a.jsxs)("div",{children:["Instance: ",(0,a.jsx)("strong",{children:e.insId}),", Pin id:"," ",(0,a.jsx)("strong",{children:e.pinId})," "]}),(0,a.jsx)("div",{children:"Value:"})]}):null,C(e)]}),(0,a.jsx)(u.Menu,{className:"samples-menu",children:y.map(((e,t)=>{const n=e.pinId,o=`${i.total-t}. from pin "${n}"`;return(0,a.jsx)(u.MenuItem,{text:o,onClick:()=>h(t)},t)}))})]}):i.lastSamples.length>0&&v.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",children:['No data found for search query "',v,'"']}):(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",o.insId," ",o.pin?`and ${o.pin.id}`:"",". Make sure a debugger is connected and your program was triggered."]})})()})]})})})}},40471:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29183),t)},98158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebuggerContext=t.DebuggerContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({onRequestHistory:()=>Promise.reject(new Error("Not implemented"))});t.DebuggerContextProvider=i.Provider;t.useDebuggerContext=()=>(0,o.useContext)(i)},86125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDependenciesContext=t.DependenciesContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({resolvedDependencies:{},onImportNode:()=>Promise.reject(new Error("Not implemented")),onRequestImportables:()=>Promise.reject(new Error("Not implemented"))});t.DependenciesContextProvider=i.Provider;t.useDependenciesContext=()=>(0,o.useContext)(i)},97106:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FlowEditor=void 0;const u=n(35250),l=s(n(70079)),c=n(74762),d=n(63521),p=a(n(53865)),f=n(68120),m=n(7047),h=n(84472),v=n(82232),g=n(49283),y=n(43490),b=n(68840),I=n(78087),C=n(20079),x=n(60190),w=n(40471),_=n(98158),j=n(86125),N=n(30653),O=n(77852);r(n(43490),t),r(n(98158),t),r(n(86125),t),b.library.add(I.fab,C.fas);const P=["select","drag-move","order-step"];t.FlowEditor=l.memo(l.forwardRef(((e,t)=>{const{state:n,onChangeEditorState:o}=e,{resolvedDependencies:i,onImportNode:s}=(0,j.useDependenciesContext)(),[r,a]=l.useState([]),[b,I]=l.useState([]),{flow:C,boardData:E}=n,S=n.flow.node,[T,D]=l.useState({}),[M,k]=l.useState(new Set),{debuggerClient:R}=(0,_.useDebuggerContext)();l.useEffect((()=>{if(R)return R.onBatchedEvents((e=>{e.forEach((e=>{e.type===c.DebuggerEventType.INPUTS_STATE_CHANGE&&(console.log("INPUTS_STATE_CHANGE",e.insId,e.val),D((t=>({...t,[e.insId]:e.val})))),e.type===c.DebuggerEventType.ERROR&&k((t=>{const n=new Set(t);return n.add(e.insId),n}))}))}))}),[R]);const{openFile:A,reportEvent:V}=(0,y.usePorts)(),L=l.useCallback(((e,t)=>{console.info("onChangeFlow",t.type),"functional"===t.type&&(a([{flow:{...n.flow,...e}},...r.slice(0,50)]),I([])),o((t=>({...t,flow:{...t.flow,...e}})))}),[o,n.flow,r]),[z,$]=l.useState({instances:[],connections:[]}),[H,q]=l.useState(!1),F=l.useCallback((()=>q(!1)),[]),G=l.useCallback((()=>q(!0)),[]),U=l.useCallback((e=>{o((t=>({...t,boardData:{...t.boardData,...e}})))}),[o]);l.useEffect((()=>{U({selected:[],viewPort:d.defaultViewPort,from:void 0,to:void 0,lastMousePos:{x:0,y:0}})}),[S.id]),(0,f.useHotkeys)("cmd+z",(e=>{I([...b,n]);const[t,...i]=r;t&&(o((e=>({...e,...t}))),a(i)),e.preventDefault()}),{text:"Undo last change",group:"Editing"},[n,r,b]);const B=l.useCallback(((e,t)=>{P.some((e=>t.message.includes(e)))||I([]),L({node:e},t)}),[L]),W=l.useCallback((e=>{A({absPath:e.source.path})}),[A]),Z=l.useCallback((function(e,t){void 0===t&&(t=-1*d.NODE_HEIGHT*1.5);const n=(0,m.createNewNodeInstance)(e,t,E.lastMousePos,i);if(n){const e=(0,p.default)(C,(e=>{const t=e.node;if(!(0,c.isVisualNode)(t))throw new Error("Impossible state, adding node to non visual node");t.instances.push(n)}));return L(e,(0,v.functionalChange)("add-node")),F(),n}}),[E.lastMousePos,C,L,F,i]),J=l.useCallback((async e=>{switch(e.type){case g.OmniBarCmdType.ADD:return V("addNode",{nodeId:e.data,source:"omnibar"}),Z(e.data);case g.OmniBarCmdType.ADD_VALUE:{const e=t.current;null==e||e.requestNewInlineValue();break}case g.OmniBarCmdType.IMPORT:{await s(e.data,{pos:E.lastMousePos});const t=(0,x.vAdd)({x:0,y:0},E.lastMousePos),n=(0,m.createNewNodeInstance)(e.data.node,0,t,i),o=(0,p.default)(C,(e=>{e.node.instances.push(n)}));L(o,(0,v.functionalChange)("add-imported-node")),V("addNode",{nodeId:e.data.node.id,source:"omnibar"});break}default:h.AppToaster.show({intent:"warning",message:"Not supported yet"})}F()}),[F,V,Z,t,s,E.lastMousePos,i,C,L]),[Y,K]=l.useState(),Q=l.useCallback((()=>K(void 0)),[]),X=l.useCallback(((e,t)=>{K({insId:e,pin:t})}),[]),{isDarkMode:ee}=(0,O.useDarkMode)();return(0,u.jsx)("div",{className:"flyde-flow-editor",children:(()=>{var n;if((0,c.isInlineValueNode)(S))throw new Error("Impossible state");return(0,u.jsx)(N.DarkModeProvider,{value:null!==(n=e.darkMode)&&void 0!==n?n:ee,children:(0,u.jsxs)(l.Fragment,{children:[Y?(0,u.jsx)(w.DataInspectionModal,{item:Y,onClose:Q}):null,(0,u.jsx)(d.VisualNodeEditor,{currentInsId:c.ROOT_INS_ID,ref:t,boardData:E,onChangeBoardData:U,node:S,onGoToNodeDef:W,onChangeNode:B,resolvedDependencies:i,clipboardData:z,onCopy:$,nodeIoEditable:!S.id.startsWith("Trigger"),onInspectPin:X,onShowOmnibar:G,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:T,initialPadding:e.initialPadding,instancesWithErrors:M,disableScrolling:e.disableScrolling},S.id),H?(0,u.jsx)(g.Omnibar,{flow:C,resolvedNodes:i,onCommand:J,visible:H,onClose:F}):null]})})})()})})))},9001:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeEditor=t.renderCreateIOOption=void 0;const i=n(35250),s=o(n(70079)),r=n(74762),a=n(50382),u=o(n(53865)),l=n(70457),c=n(25779);t.renderCreateIOOption=(e,t,n)=>(0,i.jsx)(a.MenuItem,{icon:"add",text:`Create "${e}"`,active:t,onClick:n,shouldDismissPopover:!1});const d=l.MultiSelect.ofType();t.BaseNodeEditor=e=>{var n,o;const{node:l,onChange:p}=e,f=(0,r.entries)(l.inputs),m=f.filter((e=>{let[,t]=e;return"required"===t.mode})).map((e=>{let[t]=e;return t})),h=f.filter((e=>{let[,t]=e;return"optional"===t.mode})).map((e=>{let[t]=e;return t})),v=f.filter((e=>{let[,t]=e;return"required-if-connected"===t.mode})).map((e=>{let[t]=e;return t})),[g,y]=s.default.useState(!1),b=(0,r.okeys)(l.outputs),I=s.default.useCallback((e=>{p({...l,id:e})}),[l,p]),C=s.default.useCallback((e=>{let t=e?e.split(","):void 0;"[]"===e&&(t=[]),p({...l,completionOutputs:t})}),[l,p]),x=s.default.useCallback((e=>{let t=e?e.split(","):void 0;p({...l,reactiveInputs:t})}),[l,p]),w=s.default.useCallback(((e,t)=>{const n=(0,u.default)(l,(n=>{n.inputs[e]=(0,r.nodeInput)(t)}));p(n)}),[l,p]),_=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.inputs[e]}));p(t)}),[l,p]),j=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{t.outputs[e]=(0,r.nodeOutput)()}));p(t)}),[l,p]),N=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.outputs[e]}));p(t)}),[l,p]);return(0,i.jsxs)("div",{className:"base-node-editor",children:[(0,i.jsx)("div",{className:"form-row",children:(0,i.jsx)(a.FormGroup,{label:"Node Name",labelFor:"text-input",labelInfo:"(required)",children:(0,i.jsx)(a.InputGroup,{id:"node-name",disabled:e.idDisabled,placeholder:"Node ID",value:l.id,onChange:e=>I(e.target.value)})})}),(0,i.jsx)(a.FormGroup,{label:"Required Inputs",children:(0,i.jsx)(d,{selectedItems:m,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>w(e,"required"),onRemove:_,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),!0!==e.hiddenOutputs?(0,i.jsx)(a.FormGroup,{label:"Outputs",children:(0,i.jsx)(d,{selectedItems:b,placeholder:"Enter output names here",items:[],tagRenderer:e=>e,onItemSelect:j,onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}):null,(0,i.jsx)(a.Checkbox,{checked:g,onChange:e=>y(e.target.checked),children:"Show advanced options"}),(0,i.jsxs)(a.Collapse,{isOpen:g,children:[(0,i.jsx)(a.FormGroup,{label:"Optional Inputs",children:(0,i.jsx)(d,{selectedItems:h,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>w(e,"optional"),onRemove:_,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Required-if-connected Inputs",children:(0,i.jsx)(d,{selectedItems:v,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>w(e,"required-if-connected"),onRemove:_,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Completion Outputs",children:(0,i.jsx)(a.InputGroup,{id:"completion-outputs",placeholder:"completion outputs",value:(null===(n=l.completionOutputs)||void 0===n?void 0:n.join(","))||"",onChange:e=>C(e.target.value)})}),(0,i.jsx)(a.FormGroup,{label:"Reactive Inputs",children:(0,i.jsx)(a.InputGroup,{id:"reactive-inputs",placeholder:"Reactive inputs",value:(null===(o=l.reactiveInputs)||void 0===o?void 0:o.join(","))||"",onChange:e=>x(e.target.value)})})]}),(0,i.jsx)(a.FormGroup,{label:"Preview",children:(0,i.jsx)("div",{className:"preview-wrapper",children:(0,i.jsx)(c.NodePreview,{node:l})})})]})}},82232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metaChange=t.functionalChange=void 0;t.functionalChange=e=>({type:"functional",message:e});t.metaChange=function(e){return void 0===e&&(e="n/a"),{type:"meta",message:e}}},41032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safelyGetNodeDef=t.loadingDef=void 0;const o=n(74762);t.loadingDef={id:"Loading",inputs:{},outputs:{}};t.safelyGetNodeDef=(e,n)=>{try{return(0,o.getNodeDef)(e,n)}catch(i){const n="string"==typeof e?e:e.nodeId;return{...t.loadingDef,id:n}}}},72125:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCodeModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(68371),f=n(74762),m=n(31745),h="`Result is ${inputs.a + inputs.b}`";t.InlineCodeModal=u.memo((function(e){const{initialValue:t,initialType:n}=e,[o,i]=u.useState((0,f.isDefined)(t)?t:h),[s,r]=u.useState(n||f.InlineValueNodeType.VALUE),v=(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:['You can add variables to by referrencing the "inputs" object.',(0,a.jsx)("br",{})," For example:",(0,a.jsx)(c.Code,{children:"`Hello {inputs.name}`"}),' will expose an input pin named "name"']}),(0,a.jsxs)("p",{children:["You can also use ternery expressions, arithmetic operators and more!",(0,a.jsx)("br",{}),"For example:",(0,a.jsx)(c.Code,{children:"inputs.a > inputs.b ? inputs.a + 42 : Math.random() * inputs.b"})]})]}),g=(0,a.jsxs)("span",{children:["Type in any valid JS value, such as ",(0,a.jsx)(c.Code,{children:"true"}),", ",(0,a.jsx)(c.Code,{children:"42"}),","," ",(0,a.jsx)(c.Code,{children:'["bob", "alice", "dave"]'}),".",(0,a.jsx)("br",{})," Dynamic inputs may also be used"]}),y=(0,a.jsxs)("span",{children:["Write any JS code and return a value.",(0,a.jsx)("br",{})," The returned value will be the output.",(0,a.jsx)("br",{})," Example:",(0,a.jsx)(c.Code,{children:"const a = inputs.a; const b = inputs.b; return Math.floor(a/b);"})]}),b=(0,p.getVariables)(o);return u.useEffect((()=>{o===h&&s===f.InlineValueNodeType.FUNCTION&&i(`return ${h}`),o===`return ${h}`&&s===f.InlineValueNodeType.VALUE&&i(h)}),[o,s]),(0,a.jsxs)(c.Dialog,{isOpen:!0,title:"Inline Value / Code",onClose:e.onCancel,className:"inline-code-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:t=>{"Enter"===t.key&&t.metaKey&&e.onSubmit(s,o)},tabIndex:0,children:[(0,a.jsxs)(c.RadioGroup,{inline:!0,onChange:e=>r(e.target.value),selectedValue:s,children:[(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Value ",(0,a.jsx)(m.InfoTooltip,{content:g})]}),value:f.InlineValueNodeType.VALUE}),(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Function ",(0,a.jsx)(m.InfoTooltip,{content:y})]}),value:f.InlineValueNodeType.FUNCTION})]}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"javascript",value:o,onChange:e=>i(e||""),onMount:e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})}}),(()=>{const e=o.includes("return");return e&&s===f.InlineValueNodeType.VALUE?(0,a.jsx)(c.Callout,{intent:c.Intent.WARNING,children:'When using the "value" type you are not expected to return anything'}):e||s!==f.InlineValueNodeType.FUNCTION?null:(0,a.jsxs)(c.Callout,{intent:c.Intent.DANGER,children:['When using the "function" type you are expected to'," ",(0,a.jsx)(c.Code,{children:"return"})," a value.",(0,a.jsx)("br",{}),"Example: ",(0,a.jsx)(c.Code,{children:"return 42 + Date.now();"})]})})(),(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Input pins detected:"," ",b.length?b.map((e=>(0,a.jsx)(c.Code,{children:e},e))):"None",(0,a.jsx)(m.InfoTooltip,{content:v})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:e.onCancel,children:"Cancel"}),(0,a.jsx)(c.Button,{onClick:()=>e.onSubmit(s,o),intent:c.Intent.PRIMARY,className:"save-btn",children:"Save"})]})})]})}))},18594:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(72125),t)},68371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInlineValueNode=t.getVariables=void 0;const o=n(74762),i=n(74762);t.getVariables=e=>(e.match(/inputs\.([a-zA-Z]\w*)/g)||[]).map((e=>e.replace(/inputs\./,"")));t.createInlineValueNode=e=>{let{code:n,customView:s,nodeId:r,type:a}=e;const u=(0,t.getVariables)(n).reduce(((e,t)=>({...e,[t]:(0,o.nodeInput)()})),{}),l={value:(0,o.nodeOutput)()},c=a===o.InlineValueNodeType.FUNCTION?`const result = (function() { ${n}}());\n Promise.resolve(result).then(val => outputs.value.next(val))`:`const result = (${n}); Promise.resolve(result).then(val => outputs.value.next(val))`,d=btoa(n);return(0,i.inlineValueNode)({id:r||`Inline Code ${(0,o.randomInt)(99999)}`,inputs:u,outputs:l,runFnRawCode:c,customViewCode:s||n,dataBuilderSource:d,templateType:a,completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline "+(a===o.InlineValueNodeType.VALUE?"value":"function")})}},49283:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Omnibar=t.OmniBarCmdType=void 0;const a=n(35250),u=s(n(70079)),l=n(70457),c=n(74762),d=n(50382),p=r(n(26372));var f;!function(e){e.ADD="add",e.ADD_VALUE="add-value",e.IMPORT="import"}(f=t.OmniBarCmdType||(t.OmniBarCmdType={}));const m=[];t.Omnibar=e=>{const{resolvedNodes:t}=e,[n,o]=u.useState(""),[i,s]=u.useState(null),[r,h]=u.useState([]);u.useEffect((()=>{const e=(0,c.keys)(t).map((e=>({title:`${t[e].id}`,cmd:{type:f.ADD,data:e},extra:"current flow"}))),n=r.map((e=>({title:`${e.node.id}`,description:e.node.description,cmd:{type:f.IMPORT,data:e},extra:`${e.module}`}))),o={title:"Add inline value or code",suggestOnEmpty:!0,cmd:{type:f.ADD_VALUE}},i=[...m,...n,o,...e];s(i)}),[t,r]),u.useEffect((()=>{e.onRequestImportables&&e.onRequestImportables(n).then((e=>{h(e)}))}),[e,n]);const v=u.useCallback(((e,t)=>{let{handleClick:n,modifiers:o,query:i,index:s}=t;if(!o.matchesPredicate)return null;const r=`${e.title}`;return(0,a.jsx)(d.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,a.jsxs)("div",{className:(0,p.default)("omnibar-item",{active:o.active}),children:[(0,a.jsxs)("div",{className:"title",children:[r," ",e.extra?(0,a.jsx)("span",{className:"extra",children:e.extra}):null]}),e.description?(0,a.jsx)("div",{className:"description",children:e.description}):null]})},s)}),[]),g=u.useCallback(((e,t)=>{const n=e.toLowerCase().split("").map((e=>{return`${t=e,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*`;var t})).join(""),o=new RegExp(n);return!!t.title.toLowerCase().match(o)}),[]),y=u.useCallback((t=>{e.onCommand(t.cmd),e.onClose()}),[e]);return i?(0,a.jsx)(l.Omnibar,{query:n,onQueryChange:o,onClose:e.onClose,noResults:(0,a.jsx)(d.MenuItem,{disabled:!0,text:"No results."}),itemPredicate:g,isOpen:e.visible,items:i,initialContent:void 0,onItemSelect:y,itemRenderer:v,inputProps:{placeholder:"Search for nodes or commands.."}}):null}},60698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43490:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31874),t)},31874:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.usePorts=t.useConfirm=t.usePrompt=t.PortsContext=t.defaultPorts=void 0;const s=n(70079),r=n(74762),a=n(84472);i(n(60698),t);const u=e=>async()=>{console.warn(`${e} Not implemented`),(0,a.toastMsg)("Feature not implemented in this context yet","warning")};t.defaultPorts={prompt:async e=>{let{text:t,defaultValue:n}=e;return prompt(`${t}`,n)},openFile:async e=>{},confirm:async e=>{let{text:t}=e;return confirm(t)},readFlow:u("readFlow"),setFlow:u("setFlow"),resolveDeps:u("resolveDeps"),getImportables:u("getImportables"),onExternalFlowChange:u("onExternalFlowChange"),onInstallRuntimeRequest:u("onInstallRuntimeRequest"),onRunFlow:u("onRunFlow"),onStopFlow:u("onStopFlow"),reportEvent:r.noop,generateNodeFromPrompt:u("generateNodeFromPrompt"),hasOpenAiToken:()=>Promise.resolve(!1)},t.PortsContext=(0,s.createContext)(t.defaultPorts);t.usePrompt=()=>{const e=(0,s.useContext)(t.PortsContext).prompt;return(t,n)=>e({text:t,defaultValue:n})};t.useConfirm=()=>{const e=(0,s.useContext)(t.PortsContext).confirm;return t=>e({text:t})};t.usePorts=()=>(0,s.useContext)(t.PortsContext)},65758:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelected=void 0;const i=n(74762),s=o(n(53865)),r=n(22513);t.groupSelected=async(e,t,n,o,a)=>{const{instances:u,connections:l}=t,c=u.filter((t=>e.includes(t.id))),d=l.filter((t=>{let{from:n,to:o}=t;return-1!==e.indexOf(n.insId)||-1!==e.indexOf(o.insId)}));if(!c.length)throw new Error("visual without selections");const{visualNode:p,renamedInputs:f,renamedOutputs:m}=await(0,r.createGroup)(c,d,n,a),h=c.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),u[0].pos),v="ref"===o?(0,i.nodeInstance)((0,i.createInsId)(p),p.id,{},h):(0,i.inlineNodeInstance)((0,i.createInsId)(p),p,{},h),g=u.filter((t=>-1===e.indexOf(t.id))),y=l.map((e=>{const t=`${e.from.insId}.${e.from.pinId}`,n=`${e.to.insId}.${e.to.pinId}`;return f[n]?{...e,to:{insId:v.id,pinId:f[n]}}:m[t]?{...e,from:{insId:v.id,pinId:m[t]}}:e})).filter((t=>-1===e.indexOf(t.from.insId)&&-1===e.indexOf(t.to.insId)));return{newNode:p,currentNode:(0,s.default)(t,(e=>{e.instances=[...g,v],e.connections=y}))}}},74089:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(97106),t),i(n(18420),t),i(n(90680),t),i(n(84472),t),i(n(17102),t),i(n(82232),t),i(n(25779),t),i(n(25804),t),i(n(9958),t),i(n(68120),t),i(n(94651),t),i(n(73470),t),i(n(94007),t),i(n(60190),t),i(n(9001),t),i(n(7047),t),i(n(23386),t)},31745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoTooltip=void 0;const o=n(35250),i=n(50382),s=n(50382),r=n(44470),a=n(50382);t.InfoTooltip=e=>{const{content:t}=e;return(0,o.jsx)(s.Tooltip,{content:t,placement:"top",className:"info-tooltip",children:(0,o.jsx)(i.Icon,{icon:(0,o.jsx)(r.InfoSign,{className:a.Classes.INTENT_PRIMARY}),intent:i.Intent.SUCCESS,className:"info-tooltip-icon"})})}},83938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserOnlyReactJson=void 0;const o=n(35250);t.BrowserOnlyReactJson=e=>{if("undefined"==typeof window)return null;const t=n(73541).Z;return(0,o.jsx)(t,{...e})}},94651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsValueRenderer=void 0;const o=n(35250),i=n(74762),s=n(83938);t.AnalyticsValueRenderer=e=>{let{val:t}=e;try{const e=JSON.parse(t),n="object"==typeof e?e:{value:e},r=e&&[e.type,e.key,e.props,e.ref].every(i.isDefined),a=r?{jsxValue:e}:n;return(0,o.jsx)(s.BrowserOnlyReactJson,{src:a,collapseStringsAfterLength:50,collapsed:r})}catch(n){return(0,o.jsx)(s.BrowserOnlyReactJson,{src:{value:t},collapseStringsAfterLength:50})}}},22513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=void 0;const o=n(74762),i=n(74762),s=n(60190),r=n(88593);t.createGroup=async(e,t,n,a)=>{if(0===e.length)throw new Error("cannot create group without instances");const u=e.map((e=>e.id)),l=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return!t&&n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.to,e.to)))===t)),c=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return t&&!n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.from,e.from)))===t));let d={},p={},f={},m={};const h=[],v={};for(const o of l){const e=`${o.to.insId}.${o.to.pinId}`,t=`${o.from.insId}.${o.from.pinId}`,n=o.to.pinId;if(f[t]){h.push({from:(0,i.externalConnectionNode)(f[t]),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)});continue}const r=v[n]?await a(`Name this input (${n} of ${o.to.insId}) is already taken:`)||`i${(0,s.rnd)()}`:n;d[e]=r,f[t]=r,h.push({from:(0,i.externalConnectionNode)(r),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)}),v[r]=(0,i.nodeInput)()}const g={};for(const r of c){const e=`${r.to.insId}.${r.to.pinId}`,t=`${r.from.insId}.${r.from.pinId}`,n=r.from.pinId;if(m[e]){h.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(m[e])});continue}const u=g[n]?await a(`Name this output (${n} of ${r.from.insId} is already taken:`)||`i${(0,s.rnd)()}`:n;p[t]=u,m[e]=u,h.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(u)}),g[u]=(0,o.nodeOutput)()}e.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),e[0].pos);const y=t.filter((e=>u.includes(e.from.insId)&&u.includes(e.to.insId)));return{visualNode:{id:n,inputs:v,outputs:g,instances:e,defaultStyle:{size:"large",color:(0,o.pickRandom)(r.nodeStylePresetColors.map((e=>e.color)))},inputsPosition:(0,o.okeys)(v).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:0}})),{}),outputsPosition:(0,o.okeys)(g).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:400}})),{}),connections:[...y,...h],completionOutputs:(0,o.okeys)(g)},renamedInputs:d,renamedOutputs:p}}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightText=void 0;const o=n(35250);function i(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}t.highlightText=(e,t)=>{let n=0;const s=t.split(/\s+/).filter((e=>e.length>0)).map(i);if(0===s.length)return[e];const r=new RegExp(s.join("|"),"gi"),a=[];for(;;){const t=r.exec(e);if(!t)break;const i=t[0].length,s=e.slice(n,r.lastIndex-i);s.length>0&&a.push(s),n=r.lastIndex,a.push((0,o.jsx)("strong",{children:t[0]},n))}const u=e.slice(n);return u.length>0&&a.push(u),a}},17102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Loader=void 0;const o=n(35250);t.Loader=()=>(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)("svg",{width:"38",height:"38",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:"#007ec6",children:(0,o.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,o.jsxs)("g",{transform:"translate(1 1)",strokeWidth:"2",children:[(0,o.jsx)("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),(0,o.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:(0,o.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})})})},23386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;const o=n(74762);t.logger=(0,o.debugLogger)("editor")},561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadMonaco=void 0;const o=n(51848),i=n(23386);let s=!1;t.preloadMonaco=()=>{s||o.loader.init().then((()=>{(0,i.logger)("monaco preloaded"),s=!0}))}},68120:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHotkeys=t.currentHotkeys=void 0;const i=o(n(45240)),s=n(70079);t.currentHotkeys=new Map,t.useHotkeys=function(e,n,o,r,a){void 0===r&&(r=[]);const u=(0,s.useCallback)((function(){a&&!a.current||n(...arguments)}),[...r,n]);(0,s.useEffect)((()=>((0,i.default)(e,{},u),t.currentHotkeys.set(e,o),()=>{t.currentHotkeys.delete(e),i.default.unbind(e,u)})),[e,u,o])}},94007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeSessionStorage=t.safeLocalStorage=void 0,t.safeLocalStorage={getItem:function(){try{return localStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return localStorage.setItem(...arguments)}catch(e){return null}}},t.safeSessionStorage={getItem:function(){try{return sessionStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return sessionStorage.setItem(...arguments)}catch(e){return null}}}},90680:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocalStorage=t.useResizePref=t.userPreferences=t.useUserPref=void 0;const r=s(n(70079)),a=n(18420),u=n(94007);t.useUserPref=(e,n)=>{const[o,i]=r.useState((()=>{const o=t.userPreferences.getItem(e);return(0,a.isDefined)(o)?o:n}));r.useEffect((()=>{const o=t.userPreferences.getItem(e),s=(0,a.isDefined)(o)?o:n;i(s)}),[e]);return[o,n=>{t.userPreferences.setItem(e,n),i(n)}]},t.userPreferences=(()=>{const e=e=>`up.${e}`;return{getItem:t=>{const n=u.safeLocalStorage.getItem(e(t))||"",o=u.safeSessionStorage.getItem(e(t))||"";try{return JSON.parse(o||n).value}catch(i){return}},setItem:function(t,n,o){void 0===o&&(o=!1);const i=o?sessionStorage:u.safeLocalStorage;try{const o=JSON.stringify({value:n});return i.setItem(e(t),o),!0}catch(s){return console.error("Error saving user preference",s),!1}}}})();t.useResizePref=(e,n)=>{const o=`resize.${e}`;return(0,t.useUserPref)(o,n)};const l=e=>{const t=u.safeLocalStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch(n){return null}};t.useLocalStorage=(e,t)=>{const[n,o]=r.useState(l(e)||t),i=r.useCallback((t=>{u.safeLocalStorage.setItem(e,JSON.stringify({value:t})),o(t)}),[e]);return r.useEffect((()=>{l(e)||u.safeLocalStorage.setItem(e,JSON.stringify({value:t}))}),[e,t,i]),[n,i]}},60190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.totalEnergy=t.itrPhysics=t.hookes=t.coulombs=t.vToStr=t.vNorm=t.vLen=t.vSub=t.vAdd=t.vDiv=t.vMul=t.vZero=t.rnd=t.vec=t.size=void 0;t.size=(e,t)=>({width:e,height:t});t.vec=(e,t)=>({x:e,y:t});t.rnd=function(e,t){return void 0===e&&(e=100),void 0===t&&(t=0),Math.floor(Math.random()*(e-t))+t},t.vZero={x:0,y:0};t.vMul=(e,t)=>{let{x:n,y:o}=e;return{x:n*t,y:o*t}};t.vDiv=(e,n)=>{let{x:o,y:i}=e;return(0,t.vMul)({x:o,y:i},1/n)};t.vAdd=(e,t)=>({x:e.x+t.x,y:e.y+t.y});t.vSub=(e,n)=>(0,t.vAdd)(e,(0,t.vMul)(n,-1));t.vLen=e=>{let{x:t,y:n}=e;return Math.sqrt(t*t+n*n)};t.vNorm=e=>(0,t.vDiv)(e,(0,t.vLen)(e)||1);t.vToStr=e=>{let{x:t,y:n}=e;return`${t.toFixed(1)},${n.toFixed(1)}`};t.coulombs=(e,n,o)=>{const i=(0,t.vLen)((0,t.vSub)(e.p,n.p));if(0===i){const i=(0,t.vec)(2*Math.random()-1,2*Math.random()-1),s=e.m*n.m/Math.pow(10,2);return(0,t.vMul)(i,s*o)}{const s=(0,t.vNorm)((0,t.vSub)(n.p,e.p)),r=e.m*n.m/Math.pow(i+.1,2);return(0,t.vMul)(s,r*o)}};t.hookes=(e,n,o,i,s)=>{const r=(0,t.vLen)((0,t.vSub)(e.p,n.p)),a=(0,t.vNorm)((0,t.vSub)(e.p,n.p));let u=0;return ri&&(u=i-r),(0,t.vMul)(a,s*u)};t.itrPhysics=(e,n)=>{const{p:o,v:i,f:s,m:r}=n,a=(0,t.vDiv)(s,r),u=e/1e3,l=(0,t.vAdd)((0,t.vMul)(a,u),i),c=(0,t.vAdd)((0,t.vMul)(l,u),o);return{...n,p:c,v:l,f:(0,t.vec)(0,0)}};t.totalEnergy=e=>e.reduce(((e,n)=>{const o=(0,t.vLen)(n.v);return e+.5*n.m*o*o}),0)},84472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateToast=t.toastMsg=t.AppToaster=void 0;const o=n(50382);t.AppToaster=(()=>{try{return o.OverlayToaster.create({className:"app-toaster",position:o.Position.BOTTOM_RIGHT})}catch(e){return{}}})();t.toastMsg=(e,n,o)=>t.AppToaster.show({message:e,intent:n,timeout:o});t.updateToast=(e,n,o)=>t.AppToaster.show({message:n,intent:o},e)},18420:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultAnd=t.isLocal=t.fullTime=t.timeAgoFromDt=t.timeAgo=t.toString=t.isDefined=t.set=t.createOmap=t.toOmap=t.values=t.keys=t.entries=void 0;const i=n(7047),s=n(74762),r=o(n(73136));t.entries=e=>Object.keys(e).map((t=>[t,e[t]]));t.keys=e=>Object.keys(e);t.values=e=>Object.keys(e).map((t=>e[t]));t.toOmap=e=>Array.from(e.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.createOmap=function(e){return void 0===e&&(e=[]),e.reduce(((e,t)=>({...e,[t[0]]:t[1]})),{})};t.set=(e,t,n)=>{e[t]=n};t.isDefined=e=>void 0!==e;t.toString=e=>{const t=typeof e;if(""===e)return"(empty string)";if((0,i.isJsxValue)(e))return"JSX Value";if((0,s.isStaticValueVisualNode)(e))return"Embedded Node";if((0,s.isEnvValue)(e))return(0,s.getEnvKeyFromValue)(e);if("object"===t)try{const t=JSON.stringify(e);return"{}"===t?"Empty object":t}catch(n){return"Object (cannot stringify)"}return`${e}`};t.timeAgo=e=>(0,r.default)(new Date(e)).fromNow();t.timeAgoFromDt=e=>(0,r.default)(Date.now()-e).fromNow();t.fullTime=e=>(0,r.default)(new Date(e)).toString();t.isLocal=()=>location.href.includes(":300");t.preventDefaultAnd=e=>t=>{t.preventDefault(),e(t)}},67181:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ActionButton=t.ActionsMenu=t.ActionType=void 0;const r=n(35250),a=n(50382),u=n(50382),l=n(74762),c=s(n(70079)),d=n(86125),p=n(43490),f=n(68120),m=n(90680),h=n(84472),v=n(9971),g=n(47749),y=n(46334),b=n(47230),I=n(41032);var C;!function(e){e.AddNode="add-node",e.RemoveNode="remove-node",e.Group="group",e.UnGroup="un-group",e.AddInlineValue="add-inline-value",e.Inspect="inspect",e.Run="run",e.AI="ai"}(C=t.ActionType||(t.ActionType={}));t.ActionsMenu=e=>{const{onAction:n,selectedInstances:o,resolvedNodes:i,node:s,from:u,to:g,hotkeysEnabled:w,showRunFlowOptions:_}=e,{onRequestImportables:j}=(0,d.useDependenciesContext)(),[N,O]=c.default.useState(!1),[P,E]=c.default.useState(!1),[S,T]=c.default.useState(!1),[D,M]=c.default.useState(null),[k,R]=(0,m.useLocalStorage)("hideHotkeyHintMap",{}),A=(0,c.useCallback)((()=>{O(!1)}),[]),{onRunFlow:V,generateNodeFromPrompt:L,reportEvent:z}=(0,p.usePorts)(),$=(0,c.useCallback)(((e,t)=>(E(!1),V(e,t))),[V]),H=[];if(H.push(C.AddNode),H.push(C.AddInlineValue),1===o.length){const e=s.instances.find((e=>e.id===o[0]));if(e)try{const t=(0,I.safelyGetNodeDef)(e,i);(0,l.isVisualNode)(t)&&H.push(C.UnGroup)}catch(B){console.error(`Could not find node with id ${o[0]} - ${B}`)}else console.error(`Could not find instance with id ${o[0]}`)}_&&H.push(C.Run),o.length>0&&H.push(C.Group),(1===o.length||u||g)&&H.push(C.Inspect),o.length>0&&H.push(C.RemoveNode),H.push(C.AI);const q=(0,c.useCallback)(((e,t)=>{R({...k,[e]:!0}),h.AppToaster.dismiss(t)}),[k,R]),F=(0,c.useCallback)(((e,t)=>{const{hotkey:o}=x[e];if("click"===t.type&&o&&!k[o]){const t=(0,h.toastMsg)((0,r.jsxs)(r.Fragment,{children:["Did you know? you can also use the hotkey"," ",(0,r.jsx)("kbd",{className:"hotkey",children:o})," to"," ",x[e].text.replace(/^[A-Z]/,(e=>e.toLowerCase())),(0,r.jsxs)(a.Button,{minimal:!0,small:!0,onClick:()=>q(o,t),children:[" ","Don't show again"," "]})]}),"none",3e3)}switch(e){case C.AddNode:O(!0);break;case C.Run:!async function(){E(!0)}();break;case C.AI:T(!0);break;default:n({type:e,data:void 0})}}),[k,n,q,s.inputs]);Object.entries(x).forEach((e=>{let[t,n]=e;n.hotkey&&(0,f.useHotkeys)(n.hotkey,(e=>{e.preventDefault(),H.includes(t)&&(F(t,e),R({...k,[n.hotkey]:!0}))}),{text:n.text,group:"Action menu hotkeys"},[H],w)}));const G=(0,c.useCallback)((e=>{n({type:C.AddNode,data:{importableNode:e}})}),[n]),U=(0,c.useCallback)((async e=>{const t=Date.now();M(t);try{z("generateNodeFromPrompt:start",{promptLength:e.length});const o=await L({prompt:e}),{inputs:i,outputs:s}=o.importableNode.node,r=Date.now()-t;z("generateNodeFromPrompt:success",{totalTime:r,inputs:Object.keys(i),outputs:Object.keys(s)}),M(null),n({type:C.AI,data:o}),T(!1)}catch(B){M(null),h.AppToaster.show({message:"Failed to generate node",intent:"danger"}),z("generateNodeFromPrompt:failure",{error:B.message})}}),[L,n,z]);return(0,r.jsxs)("div",{className:"actions-menu",children:[H.map((e=>(0,r.jsx)(t.ActionButton,{type:e,onClick:F},e))),N?(0,r.jsx)(v.AddNodeMenu,{onRequestImportables:j,onAddNode:G,onClose:A}):null,P?(0,r.jsx)(b.RunFlowModal,{onClose:()=>E(!1),onRun:$,node:s}):null,S?(0,r.jsx)(y.PromptAIMenu,{onClose:()=>{T(!1),M(null)},onSubmit:U,submitting:null!==D,submitTime:D}):null]})};const x={[C.AddNode]:{icon:g.addNodeIcon,text:'Open the "add node" menu',hotkey:"a"},[C.RemoveNode]:{icon:g.removeNodeIcon,text:"Remove selected instances",hotkey:"backspace"},[C.Group]:{icon:g.groupIcon,text:"Group selection into a new node",hotkey:"g"},[C.UnGroup]:{icon:g.ungroupIcon,text:"Ungroup selected visual node"},[C.Inspect]:{icon:g.inspectIcon,text:"Inspect data",hotkey:"i"},[C.AddInlineValue]:{icon:g.pencilIcon,text:"Add value / inline function",hotkey:"v"},[C.Run]:{icon:g.playIcon,text:"Run flow",hotkey:"r"},[C.AI]:{icon:g.starIcon,text:"Generate new code node using AI \u2728"}},w={icon:"",text:"N/A",hotkey:void 0};t.ActionButton=e=>{var t;const{onClick:n,type:o}=e,i=(0,c.useCallback)((e=>n(o,e)),[n,o]),s=null!==(t=x[o])&&void 0!==t?t:w,a=s.hotkey?(0,r.jsxs)("span",{children:[s.text," ",(0,r.jsx)("kbd",{className:"hotkey",children:s.hotkey})]}):s.text;return(0,r.jsx)("div",{className:"action-button",onClick:i,"data-type":o,children:(0,r.jsx)(u.Tooltip,{hoverOpenDelay:100,content:a,className:"icon-wrapper",popoverClassName:"action-button-tooltip",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s.icon}})})})}},40149:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenu=t.AddNodeMenuFilterTree=void 0;const a=n(35250),u=n(50382),l=n(74762),c=r(n(26372)),d=s(n(70079)),p=n(43490),f=n(31745),m=n(17102),h=n(87935),v=n(74657),g=n(44470);t.AddNodeMenuFilterTree=u.Tree.ofType();function y(e,t,n){return[...e.external.map((e=>({id:e.module,label:e.module,hasCaret:!0,nodeData:{type:"external",module:e.module},isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module,isExpanded:n.has(e.module),childNodes:e.namespaces.map((o=>({id:`${e.module}/${o}`,label:o,hasCaret:!1,isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module&&t.namespace===o,isExpanded:n.has(`${e.module}/${o}`),nodeData:{type:"external",module:e.module,namespace:o}})))}))),{id:"internal",label:"Current Project",nodeData:{type:"internal"},isExpanded:n.has("internal"),hasCaret:!0,isSelected:"internal"===t.type,childNodes:e.internal.files.map((e=>({id:e,label:e,isSelected:"internal"===t.type&&t.file===e,hasCaret:!1,isExpanded:n.has(e),nodeData:{type:"internal",file:e}})))}]}function b(e){return/\.flyde(\.[jt]s)?$/.test(e.module)}t.AddNodeMenu=e=>{const{onRequestImportables:n,onAddNode:o,onClose:i}=e,[s,r]=d.default.useState(),[I,C]=d.default.useState([]),[x,w]=d.default.useState(new Set),[_,j]=d.default.useState(""),[N,O]=d.default.useState({type:"all"}),[P,E]=d.default.useState(null),[S,T]=d.default.useState(null),[D,M]=d.default.useState(null),k=(0,d.useCallback)((e=>{x.add(e.id),w(new Set(x))}),[x]),R=(0,d.useCallback)((e=>{x.delete(e.id),w(new Set(x))}),[x]),A=(0,d.useCallback)((e=>{o(e),i()}),[o,i]),{onInstallRuntimeRequest:V,reportEvent:L}=(0,p.usePorts)();(0,d.useEffect)((()=>{L("addNodeMenuOpen",{})}),[L]),(0,d.useEffect)((()=>{T(null==s?void 0:s.flatMap((e=>{var t,n,o;if(N)if("external"===N.type){if((e.module!==N.module||N.namespace)&&e.node.namespace!==N.namespace)return[]}else if("internal"===N.type&&(!b(e)||N.file&&e.module!==N.file))return[];if(_){const i=`${null!==(n=null===(t=e.node.searchKeywords)||void 0===t?void 0:t.join(" "))&&void 0!==n?n:[]} ${e.node.id} ${null!==(o=e.node.namespace)&&void 0!==o?o:""} ${e.node.description}`.toLowerCase().indexOf(_.toLowerCase());return-1===i?[]:[{importable:e,score:i}]}return[{importable:e,score:1}]})).sort(((e,t)=>e.score-t.score)).map((e=>{let{importable:t}=e;return t})))}),[s,N,_]),(0,d.useEffect)((()=>{n().then((e=>{let{importables:t,errors:n}=e;C(n);const o=t.filter((e=>!b(e))).reduce(((e,t)=>{var n,o,i;null!==(n=e[i=t.module])&&void 0!==n||(e[i]=[]);const s=null!==(o=t.node.namespace)&&void 0!==o?o:"";return e[t.module].includes(s)||e[t.module].push(s),e}),{}),i=t.filter(b).map((e=>e.module));E({external:Object.entries(o).map((e=>{let[t,n]=e;return{module:t,namespaces:n}})),internal:{files:i}}),r(t),w(new Set(["internal",...Object.keys(o)]))}))}),[n]);const z=(0,d.useCallback)((e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),S&&!D)return void M(S["ArrowDown"===e.key?0:S.length-1]);if(S&&D){const t=S.findIndex((e=>e===D));let n="ArrowDown"===e.key?t+1:t-1;n=n<0?S.length-1:n,n=n>=S.length?0:n,M(S[n])}break;case"Enter":D&&A(D)}}),[S,D,A]),$=(0,d.useCallback)((e=>{let{nodeData:t}=e;JSON.stringify(t)===JSON.stringify(N)?"external"===t.type?t.namespace?O({type:"external",module:t.module}):O({type:"all"}):"internal"===t.type&&(t.file?O({type:"internal"}):O({type:"all"})):O(t)}),[N]),H=!s||s.some((e=>e.module.includes("@flyde/stdlib"))),q=(0,d.useCallback)((()=>{V(),i()}),[i,V]);return(0,a.jsx)(u.Dialog,{isOpen:!0,title:"Add Node Menu",onClose:e.onClose,className:"add-node-menu",isCloseButtonShown:!0,children:(0,a.jsxs)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),children:[(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"bp5-input-group",children:[(0,a.jsx)(g.Search,{}),(0,a.jsx)("input",{className:"bp5-input",type:"search",placeholder:"Search input",dir:"auto",autoFocus:!0,onChange:e=>j(e.target.value),value:_,onKeyDown:z})]}),H?null:(0,a.jsxs)(u.Callout,{intent:u.Intent.NONE,style:{marginTop:10},children:["Using built-in @flyde/stdlib. It's recommended to explicitly install it instead."," ",(0,a.jsx)(u.Button,{minimal:!0,small:!0,intent:u.Intent.PRIMARY,onClick:q,children:"Click here to install it using npm/yarn"})]})]}),(0,a.jsx)("div",{className:"content-wrapper",children:s?(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsxs)("aside",{children:[(0,a.jsxs)("div",{className:"filter-header",children:["Filter by package"," ",(0,a.jsx)(u.Tooltip,{content:(0,a.jsxs)("span",{children:["Click to learn more about how packages work in Flyde"," "]}),hoverCloseDelay:1500,children:(0,a.jsx)("a",{target:"_blank",href:"https://www.flyde.dev/docs/packages",rel:"noreferrer",children:(0,a.jsx)(u.Icon,{icon:(0,a.jsx)(g.Help,{}),intent:"primary",iconSize:12})})})]}),(0,a.jsx)("div",{className:"tree-container",children:(0,a.jsx)(t.AddNodeMenuFilterTree,{contents:y(P,N,x),onNodeCollapse:R,onNodeExpand:k,onNodeClick:$,className:u.Classes.ELEVATION_0})})]}),(0,a.jsx)("main",{children:S?0===S.length?(0,a.jsxs)("div",{className:"no-results",children:[(0,a.jsx)(v.AddNodeMenuResultsSummary,{filter:N,onChangeFilter:O,query:_,onChangeQuery:j,resultsCount:S.length}),(0,a.jsxs)(u.Callout,{className:"callout",intent:"primary",children:["Can't find a suitable node? Create one yourself!"," ",(0,a.jsx)("a",{href:"https://www.flyde.dev/docs/code-nodes",target:"_blank",rel:"noreferrer",children:"Learn more"})]})]}):(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsx)(v.AddNodeMenuResultsSummary,{filter:N,onChangeFilter:O,query:_,onChangeQuery:j,resultsCount:S.length}),(0,a.jsx)("div",{className:"results",children:S.map((e=>(0,a.jsx)(h.AddNodeMenuListItem,{importableNode:e,onAdd:A,selected:(null==D?void 0:D.node)===e.node,onSelect:M,onSetFilter:O},e.node.id+e.node.namespace+e.module)))})]}):(0,a.jsx)(m.Loader,{})})]}):(0,a.jsx)(m.Loader,{})}),I.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",style:{marginTop:"10px"},children:["Found ",(0,l.simplePluralize)(I.length,"corrupt flow"),(0,a.jsx)(f.InfoTooltip,{content:I.map((e=>{let{path:t,message:n}=e;return`${t}: ${n}`})).join(", ")})," "]}):null]})})}},8470:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuListItem=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079));t.AddNodeMenuListItem=e=>{const{importableNode:t,onSetFilter:n,onAdd:o,onSelect:i}=e,{node:s,module:r}=t,{id:d,description:p}=s,f=c.default.useRef(null);c.default.useEffect((()=>{e.selected&&f.current&&f.current.scrollIntoView({block:"center"})}),[e.selected]);const m=(0,c.useCallback)((()=>{o(t)}),[o,t]),h=(0,c.useCallback)((()=>{i(t)}),[i,t]);return(0,a.jsxs)("div",{className:(0,l.default)("add-node-menu-list-item",{selected:e.selected}),ref:f,onClick:h,children:[(0,a.jsxs)("div",{className:"content",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("span",{className:"id",children:d}),(0,a.jsxs)(u.Tag,{interactive:!0,onClick:()=>n({type:"external",module:r,namespace:s.namespace}),className:"source",minimal:!0,children:[r,s.namespace?` / ${s.namespace}`:null]})]}),(0,a.jsx)("div",{className:"description",children:p||(0,a.jsx)("em",{children:"No description"})})]}),(0,a.jsx)("aside",{children:(0,a.jsx)(u.Button,{onClick:m,children:"Add"})})]})}},87935:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8470),t)},88671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuResultsSummary=void 0;const o=n(35250),i=n(50382);t.AddNodeMenuResultsSummary=e=>{const{resultsCount:t,query:n,filter:s,onChangeFilter:r,onChangeQuery:a}=e;return(0,o.jsxs)("div",{className:"add-node-menu-results-summary",children:[t?`Showing ${t} result${t>1?"s":""}`:"No results found","\xa0",n?(0,o.jsxs)(o.Fragment,{children:["matching query\xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>a(""),children:['"',n,'"']})]}):null,"all"===s.type?null:"external"===s.type?(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["package ",s.module,s.namespace?` / ${s.namespace}`:null]})]}):(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["\xa0this project ",s.file?` / ${s.file}`:null]})]})]})}},74657:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88671),t)},9971:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40149),t)},83159:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PromptAIMenu=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=1e4;t.PromptAIMenu=e=>{const{onClose:t}=e,[n,o]=c.default.useState(""),[i,s]=c.default.useState(0);return(0,c.useEffect)((()=>{s(0);const t=setInterval((()=>{s((t=>{const n=(Date.now()-e.submitTime)/d;return Math.min(n+.05*Math.random()/2,.95)}))}),500);return()=>clearInterval(t)}),[e.submitTime]),(0,a.jsxs)(u.Dialog,{isOpen:!0,onClose:t,className:"prompt-ai-menu",title:"\u2728 Generate Code Node using AI",children:[(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsx)(u.TextArea,{value:n,disabled:e.submitting,onChange:e=>o(e.target.value),placeholder:"Describe your node in details",fill:!0})}),e.submitTime?(0,a.jsx)("div",{className:"progress-bar-container",children:(0,a.jsx)(u.ProgressBar,{value:i})}):null,(0,a.jsx)("div",{className:u.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:u.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(u.Button,{onClick:t,children:"Close"}),(0,a.jsx)(u.Button,{intent:u.Intent.PRIMARY,className:"run-btn",disabled:e.submitting||!n,loading:e.submitting,onClick:()=>{s(0),e.onSubmit(n)},children:"Create \u2728"})]})})]})}},46334:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(83159),t)},3152:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RunFlowModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(90680),f=n(31745);t.RunFlowModal=u.memo((function(e){const{onRun:t,onClose:n,node:o}=e,[i,s]=u.useState(0),[r,m]=(0,p.useLocalStorage)(`run-inputs-${o.id}`,Object.keys(o.inputs).reduce(((e,t)=>(e[t]=`Enter a value for input ${t}`,e)),{})),[h,v]=u.useState(JSON.stringify(r,null,2)),g=e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})},y=u.useCallback((()=>{const e=JSON.parse(h);m(e),t(e,i)}),[t,m,h,i]),b=Object.keys(o.inputs),I=b.filter((e=>"required"!==o.inputs[e].mode)),C=u.useMemo((()=>b.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:"This node receives external inputs. Enter values for each input below:"}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"json",value:h,onChange:e=>v(null!=e?e:""),onMount:g}),I.length>0?(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Note: input(s) ",(0,a.jsx)("code",{children:I.join(", ")})," are optional"]}):null]}):(0,a.jsx)("strong",{children:"This node does not receive any external inputs."})),[b.length,I,h]);return(0,a.jsxs)(c.Dialog,{isOpen:!0,onClose:e.onClose,className:"run-flow-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&y()},tabIndex:0,children:[C,(0,a.jsxs)("div",{className:"execution-delay-wrapper",children:[(0,a.jsxs)("label",{children:["Execution delay:"," ",(0,a.jsx)(f.InfoTooltip,{content:"Delay between each node execution. Useful for debugging."})]}),(0,a.jsx)(c.Slider,{value:i,onChange:s,min:0,labelStepSize:500,stepSize:100,labelRenderer:e=>`${e}ms`,max:1e3})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:n,children:"Close"}),(0,a.jsx)(c.Button,{onClick:y,intent:c.Intent.PRIMARY,className:"run-btn",children:"Run"})]})})]})}))},47230:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3152),t)},47749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starIcon=t.stopIcon=t.playIcon=t.pencilIcon=t.ungroupIcon=t.groupIcon=t.inspectIcon=t.removeNodeIcon=t.addNodeIcon=void 0,t.addNodeIcon='\n\n',t.removeNodeIcon='\n\n',t.inspectIcon='\n\n\n',t.groupIcon='\n\n\n',t.ungroupIcon='\n\n\n',t.pencilIcon='\n\n',t.playIcon='\n\n\n',t.stopIcon='\n\n\n',t.starIcon='\n\n\n\n\n'},1237:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HelpBubble=void 0;const i=n(70079),s=n(35250),r=n(50382),a=n(99489),u=n(50382),l=o(n(70079)),c=n(68120),d=n(71644),p=n(43490),f={offset:{enabled:!0,options:{offset:[0,20]}},preventOverflow:{enabled:!0,options:{padding:10}}};const m=["Viewport Controls","Editing","Selection"];t.HelpBubble=()=>{const[e,t]=l.default.useState(!1),n=Array.from(c.currentHotkeys.entries()).map((e=>{let[t,n]=e;return{combo:(o={key:t,menuData:n}).key,label:o.menuData.text,group:o.menuData.group};var o})).reduce(((e,t)=>(e[t.group]||(e[t.group]=[]),e[t.group].push(t),e)),{}),o=Object.entries(n).sort(((e,t)=>m.indexOf(t[0])-m.indexOf(e[0]))),{reportEvent:h}=(0,p.usePorts)(),v=(0,s.jsx)(r.Dialog,{isOpen:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:r.Classes.DIALOG_BODY,children:o.map((e=>{let[t,n]=e;return(0,s.jsxs)(l.default.Fragment,{children:[(0,s.jsx)(r.H4,{children:t}),n.map((e=>(0,i.createElement)(a.Hotkey,{...e,key:e.combo})))]},t)}))})}),g=(0,s.jsxs)(r.Menu,{children:[(0,s.jsx)(r.MenuItem,{text:"Hotkeys",onClick:()=>{t(!0),h("helpMenuItem",{item:"hotkeys"})}}),(0,s.jsx)(r.MenuItem,{text:"Documentation",onClick:()=>h("helpMenuItem",{item:"documentation"}),href:"https://www.flyde.dev/docs",target:"_blank"}),(0,s.jsx)(r.MenuDivider,{}),(0,s.jsx)(r.MenuItem,{text:"Discord",onClick:()=>h("helpMenuItem",{item:"discord"}),href:"https://discord.gg/x7t4tjZQP8",target:"_blank"})]});return(0,s.jsxs)("div",{className:"help-bubble","data-tip":"Help",children:[(0,s.jsx)(u.Popover,{content:g,modifiers:f,onOpened:()=>h("helpMenuOpen",{}),children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:d.helpIcon}})}),v]})}},71644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpIcon=void 0,t.helpIcon='\n\n\n'},3354:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1237),t)},7011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainInstanceEventsIndicator=void 0;const o=n(35250),i=n(30994),s=n(66189),r=n(50382);t.MainInstanceEventsIndicator=e=>{const{currentInsId:t,ancestorsInsIds:n}=e,{history:a,refreshHistory:u,resetHistory:l}=(0,s.useHistoryHelpers)(t),c=`main-indicator-${t}}`;return(0,o.jsx)("div",{className:"main-instance-events-indicator",children:(0,o.jsx)(r.Tooltip,{content:(0,s.calcHistoryContent)(a),children:(0,o.jsx)("span",{onMouseEnter:u,onMouseOut:l,id:(0,i.getMainInstanceIndicatorDomId)(t,n),className:"status-text","data-tip":"","data-html":!0,"data-for":c})})})}},22714:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7011),t)},63521:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VisualNodeEditor=t.defaultBoardData=t.defaultViewPort=t.NODE_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=n(74762),c=n(86553),d=n(65082),p=n(18420),f=n(26701),m=n(7047),h=n(53865),v=n(70079),g=n(68120),y=r(n(27942)),b=n(50382),I=n(66005),C=n(60190),x=n(71033),w=n(74762),_=n(99942),j=n(44338),N=n(561),O=n(84472),P=n(82232),E=n(18594),S=n(68371),T=r(n(61888)),D=n(65758),M=n(43490),k=r(n(26372)),R=n(25044),A=n(80510),V=n(1788),L=n(2130),z=n(88593),$=n(97106),H=n(67181),q=n(22714),F=n(3354),G=n(41032),U=n(30653),B=u.memo(b.Slider),W=()=>null;t.NODE_HEIGHT=28;t.defaultViewPort={pos:{x:0,y:0},zoom:1},t.defaultBoardData={selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}},t.VisualNodeEditor=u.memo(u.forwardRef(((e,n)=>{const{onChangeNode:o,nodeIoEditable:i,onCopy:s,onGoToNodeDef:r,onInspectPin:J,boardData:Y,onChangeBoardData:K,currentInsId:Q,ancestorsInsIds:X,node:ee,onShowOmnibar:te,resolvedDependencies:ne,queuedInputsData:oe,initialPadding:ie,disableScrolling:se}=e,{onImportNode:re}=(0,$.useDependenciesContext)(),ae=(0,U.useDarkMode)(),{reportEvent:ue}=(0,M.usePorts)(),le=e.parentViewport||t.defaultViewPort,[ce,de]=(0,v.useState)({...ne,[ee.id]:ee});(0,v.useEffect)((()=>{de({...ne,[ee.id]:ee})}),[ne,ee]);const{selected:pe,from:fe,to:me}=Y,{instances:he,connections:ve,inputsPosition:ge,outputsPosition:ye,inputs:be,outputs:Ie}=ee,[Ce,xe]=(0,v.useState)(),[we,_e]=(0,v.useState)(),je=void 0===X,[Ne,Oe]=(0,v.useState)(0),[Pe,Ee]=(0,v.useState)(),[Se,Te]=(0,v.useState)(!1),[De,Me]=(0,v.useState)(),[ke,Re]=(0,v.useState)(),[Ae,Ve]=(0,v.useState)(),[Le,ze]=(0,v.useState)(),$e=(0,v.useRef)();(0,f.useDidMount)((()=>{$e.current=Xe.current.querySelector(".inline-editor-portal-root")}));const He=(0,M.useConfirm)(),qe=(0,M.usePrompt)(),Fe=Y.viewPort,Ge=(0,v.useRef)(!0),[Ue,Be]=(0,v.useState)(null),We=u.useCallback((e=>{K({viewPort:e})}),[K]),Ze=u.useCallback(((e,t)=>J(e,t)),[J]),Je=u.useCallback(((e,t,n)=>{const i=(0,A.handleConnectionCloseEditorCommand)(ee,{from:e,to:t}),s=(0,l.isInternalConnectionNode)(t)?he.find((e=>e.id===t.insId)):null,r=(s?s.inputConfig:{})[t.pinId],a=(0,l.isStaticInputPinConfig)(r)?(0,V.handleDetachConstEditorCommand)(i,t.insId,t.pinId):i;o(a,(0,P.functionalChange)("close-connection")),K({from:void 0,to:void 0}),ue("createConnection",{source:n})}),[he,o,K,ee,ue]),Ye=u.useCallback((async()=>{const e=await qe("New visual node name?");if(!e)return;const{currentNode:t}=await(0,D.groupSelected)(Y.selected,ee,e,"inline",qe);o(t,(0,P.functionalChange)("group node")),(0,O.toastMsg)("Node grouped"),ue("groupSelected",{count:Y.selected.length})}),[qe,Y.selected,o,ee,ue]);(0,v.useEffect)((()=>{if(Pe){const e=setTimeout((()=>{Ee(void 0)}),350);return()=>clearTimeout(e)}}),[Pe]);const[Ke,Qe]=(0,v.useState)();(0,v.useEffect)((()=>{(0,N.preloadMonaco)()}),[]);const Xe=(0,v.useRef)(),et=(0,y.default)(Xe),tt=u.useRef({x:400,y:400}),nt=(0,f.useBoundingclientrect)(Xe)||C.vZero,ot=()=>{const e=(0,m.fitViewPortToNode)(ee,ce,et);(0,m.animateViewPort)(Fe,e,500,(e=>{We(e)}))},it=u.useCallback(((e,t)=>{const{to:n,from:o}=Y,i="input"===t?o:n,s="input"===t?n:o,r={pinId:e,insId:l.THIS_INS_ID},a="input"===t?{from:r}:{to:r};i&&i.pinId===e?K({from:void 0,to:void 0}):s?"input"===t&&n?Je(r,n,"nodeIoClick"):o&&Je(o,r,"nodeIoClick"):K(a)}),[Y,K,Je]),st=u.useCallback(((e,t,n)=>{const i=(0,h.produce)(ee,(o=>{"input"===e?o.inputs[t].description=n:o.outputs[t].description=n}));o(i,(0,P.functionalChange)("Node io description"))}),[o,ee]),rt=u.useCallback(((e,t,n)=>{const{from:o,to:i}=Y;if(fe&&fe.insId===e.id||me&&me.insId===e.id)K({from:void 0,to:void 0});else if("input"===n){const n={insId:e.id,pinId:t};!i||i.pinId!==t||(0,l.isInternalConnectionNode)(i)&&i.insId!==e.id?fe?Je(fe,n,"pinClick"):K({to:n,selected:[]}):K({to:void 0})}else{const n={insId:e.id,pinId:t};!o||o.pinId!==t||(0,l.isInternalConnectionNode)(o)&&o.insId!==e.id?me?Je(n,me,"pinClick"):K({from:n,selected:[]}):K({from:void 0})}}),[Y,fe,K,Je,me]);(0,v.useEffect)((()=>{if(!Se&&et.width){const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);We(t);const n=setTimeout((()=>{const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);e.thumbnailMode||We(t),Te(!0)}),100);return()=>clearTimeout(n)}}),[ee,ie,et,e.thumbnailMode,Se,ce,We]);const at=u.useCallback((()=>{const{selected:e}=Y,t=ee.instances.filter((t=>e.includes(t.id))).map((e=>({...e,id:e.id+"-copy"}))),n=ee.connections.filter((t=>{let{from:n,to:o}=t;return e.includes(n.insId)&&e.includes(o.insId)}));s({instances:t,connections:n})}),[Y,s,ee]),ut=u.useCallback((()=>{const{newNode:t,newInstances:n}=(0,R.pasteInstancesCommand)(ee,tt.current,e.clipboardData);o(t,(0,P.functionalChange)("paste instances")),K({selected:n.map((e=>e.id))})}),[o,K,ee,e.clipboardData]),lt=u.useCallback((()=>{const e=ee.id;Ke?"input"===Ke.type?Ke.ins.id===e?it(Ke.pin,"input"):rt(Ke.ins,Ke.pin,"input"):Ke.ins.id===e?it(Ke.pin,"output"):rt(Ke.ins,Ke.pin,"output"):console.warn("tried selecting closest with no pin nearby")}),[ee.id,Ke,it,rt]),ct=u.useCallback(((e,t)=>{const n=Math.min(Math.max(e,.1),3),o="mouse"===t?tt.current:{x:Fe.pos.x+et.width/2,y:Fe.pos.y+et.height/2},i=(0,m.centerBoardPosOnTarget)(o,et,n,Fe);We({...Fe,zoom:n,pos:i})}),[We,Fe,et]);(0,g.useHotkeys)("cmd+=",(e=>{ct(Fe.zoom+.1,"hotkey"),e.preventDefault()}),{text:"Zoom in board",group:"Viewport Controls"},[Fe,ct],Ge),(0,g.useHotkeys)("cmd+-",(e=>{ct(Fe.zoom-.1,"hotkey"),e.preventDefault()}),{text:"Zoom out board",group:"Viewport Controls"},[ct,Fe.zoom],Ge),(0,g.useHotkeys)("cmd+o",(e=>{e.preventDefault(),(0,O.toastMsg)("Ordering");const t=[];(0,_.orderVisualNode)(ee,ce,200,((e,n)=>{n%3==0&&t.push(e)})),(async()=>{for(;t.length;){const e=t.shift();(0,O.toastMsg)(`Step ${t.length}!`),await(0,l.delay)(200),o(e,(0,P.metaChange)("order-step")),(0,O.toastMsg)(`Step ${t.length}! done`)}})()}),{text:"Auto-layout (experimental)",group:"Misc."},[o,ee,ne],Ge),(0,g.useHotkeys)("cmd+0",(e=>{ct(1),e.preventDefault()}),{text:"Reset zoom",group:"Viewport Controls"},[Fe,ct],Ge);const dt=()=>{K({from:void 0,to:void 0,selected:[]})},pt=u.useCallback(((e,t)=>{xe(e.id),o({...ee},(0,P.metaChange)("drag-start"))}),[o,ee]),ft=u.useCallback(((e,t,n)=>{const{newValue:i,newSelected:s}=(0,m.handleInstanceDrag)(ee,e,n,t,pe,Ce);o(i,(0,P.metaChange)("drag-move")),s&&K({selected:s})}),[Ce,o,K,pe,ee]),mt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),xe(void 0)}),[]),ht=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),xe(l.THIS_INS_ID)}),[]),vt=u.useCallback((async(t,n,o,i)=>{o.preventDefault(),o.stopPropagation();const{x:s,y:r}=i,a=(0,h.produce)(ee,(e=>{"input"===t?e.inputsPosition[n]={x:s,y:r}:e.outputsPosition[n]={x:s,y:r}}));e.onChangeNode(a,(0,P.metaChange)("node-io-drag-move"))}),[e,ee]),gt=u.useCallback((async(e,t,n,o)=>{n.preventDefault(),n.stopPropagation(),xe(void 0)}),[]),yt=u.useCallback(((e,t)=>{let{id:n}=e;const o=t.shiftKey?pe.filter((e=>e!==n)):[],i=t.shiftKey?[...pe,n]:[n],s=pe.includes(n)?o:i;K({selected:s,from:void 0,to:void 0})}),[K,pe]),bt=u.useCallback((()=>{const e=ee.instances.map((e=>e.id));K({selected:e,from:void 0,to:void 0})}),[K,ee.instances]),It=u.useCallback((e=>{const t=ve.filter((t=>{let{from:n,to:o}=t;return-1===e.indexOf(n.insId)&&-1===e.indexOf(o.insId)})),n=(0,h.produce)(ee,(n=>{n.connections=t,n.instances=n.instances.filter((t=>!e.includes(t.id)))}));K({selected:[]}),o(n,(0,P.functionalChange)("delete-ins"))}),[ve,o,K,ee]),Ct=u.useCallback((e=>{It([e.id])}),[It]),xt=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{"input"===e?(delete n.inputs[t],n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===t)))):(n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===t))),n.completionOutputs=(n.completionOutputs||[]).map((e=>e.split("+").filter((e=>e!==t)).join("+"))).filter((e=>!!e)),delete n.outputs[t])}));fe&&fe.insId===l.THIS_INS_ID&&fe.pinId===t?K({from:void 0}):me&&me.insId===l.THIS_INS_ID&&me.pinId===t&&K({to:void 0}),o(n,(0,P.functionalChange)("remove io pin"))}),[ee,fe,me,o,K]),wt=u.useCallback((async()=>{const{selected:e,from:t,to:n}=Y;0===e.length?t&&(0,l.isExternalConnectionNode)(t)?await He(`Are you sure you want to remove main input ${t.pinId}?`)&&xt("input",t.pinId):n&&(0,l.isExternalConnectionNode)(n)&&await He(`Are you sure you want to remove main output ${n.pinId}?`)&&xt("output",n.pinId):It(e)}),[He,Y,It,xt]),_t=u.useCallback(((e,t,n)=>{const i=(0,m.getInstancePinConfig)(ee,e.id,t),s=(0,l.isStickyInputPinConfig)(i)?(0,w.queueInputPinConfig)():(0,l.stickyInputPinConfig)();o((0,m.changePinConfig)(ee,e.id,t,s),(0,P.functionalChange)("toggle-sticky")),ue("togglePinSticky",{isSticky:(0,l.isStickyInputPinConfig)(s)})}),[o,ee,ue]),jt=u.useCallback((()=>{const{newNode:e,newInstances:t}=(0,L.handleDuplicateSelectedEditorCommand)(ee,pe);o(e,(0,P.functionalChange)("duplicated instances")),K({selected:t.map((e=>e.id))})}),[o,K,ee,pe]),Nt=u.useCallback((e=>{const t=e.nativeEvent.target;if(0===e.button&&Z(e.nativeEvent,ee.id)&&t&&"board-editor-inner"===t.className){if(Date.now()-Ne<300)return void te(e);Oe(Date.now());const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,nt),o=(0,m.domToViewPort)(n,Fe,le);_e({from:o,to:o})}}),[ee.id,Fe,Ne,nt,le,te]),Ot=u.useCallback((e=>{if(Be(null),Z(e.nativeEvent,ee.id)&&we){if((0,m.calcSelectionBoxArea)(we)>50){const t=(0,m.getInstancesInRect)(we,ce,Fe,Kt.current,ee.instances,nt,le),n=e.shiftKey?[...pe,...t]:t;K({selected:n})}_e(void 0)}}),[ee.id,ee.instances,we,ce,Fe,nt,le,pe,K]),Pt=u.useCallback((e=>{if(!Z(e.nativeEvent,ee.id))return void(Ge.current=!1);Ge.current=!0;const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,(0,C.vAdd)(nt,C.vZero)),o=(0,m.domToViewPort)(n,Fe,le);we&&_e({...we,to:o});const i=(0,m.findClosestPin)(ee,ce,n,nt,Q,X,Fe),s=Ke;if(i){(!s||s.ins!==i.ins||s.ins===i.ins&&s.pin!==i.pin)&&Qe({ins:i.ins,type:i.type,pin:i.id})}tt.current=o,K({lastMousePos:tt.current})}),[ee,nt,Fe,le,we,ce,Q,X,Ke,K]),Et=u.useCallback((e=>{var t;"bp5-menu"!==(null===(t=e.relatedTarget)||void 0===t?void 0:t.className)&&(Qe(void 0),Ge.current=!1)}),[]),St=u.useCallback(((e,t)=>{if(t){const t=(0,l.isInlineNodeInstance)(e)?e.node:(0,G.safelyGetNodeDef)(e.nodeId,ce);if(!t)throw new Error("Impossible state inspecting inexisting node");if(!(0,l.isVisualNode)(t))return void(0,O.toastMsg)("Cannot inspect a non visual node","warning");ze({insId:`${Q}.${e.id}`,node:t})}else if((0,l.isRefNodeInstance)(e)){const t=(0,G.safelyGetNodeDef)(e,ce);r(t)}else{const t=e.node;if(!(0,l.isInlineValueNode)(t))return void((0,l.isVisualNode)(t)?ze({insId:e.id,node:t}):(0,O.toastMsg)("Editing this type of node is not supported"));const n=atob(t.dataBuilderSource);Ve({insId:e.id,templateType:t.templateType,value:n,type:"existing"}),(0,O.toastMsg)("Editing inline visual node not supported yet")}}),[r,ce,Q]),Tt=u.useCallback((e=>{if((0,l.isInlineNodeInstance)(e)){const t=e.node;if(!(0,l.isVisualNode)(t))return void(0,O.toastMsg)("Not supported","warning");const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.filter((t=>t.id!==e.id)),n.connections=n.connections.filter((t=>{let{from:n,to:o}=t;return n.insId!==e.id&&o.insId!==e.id})),n.instances.push(...t.instances),n.connections.push(...t.connections.filter((e=>(0,l.isInternalConnectionNode)(e.from)&&(0,l.isInternalConnectionNode)(e.to))))}));o(n,{type:"functional",message:"ungroup"}),K({selected:[]})}else{const t=(0,G.safelyGetNodeDef)(e.nodeId,ce);if(!(0,l.isVisualNode)(t))return void(0,O.toastMsg)("Not supported","warning")}}),[ee,o,K,ce]),Dt=u.useCallback((async e=>{}),[]),Mt=u.useCallback(((e,t)=>{const n=(0,V.handleDetachConstEditorCommand)(ee,e.id,t);o(n,(0,P.functionalChange)("detach-const"))}),[o,ee]),kt=u.useCallback(((e,t)=>{const n=e.inputConfig[t]||(0,w.queueInputPinConfig)();(0,l.isStaticInputPinConfig)(n)&&(Re(n.value),O.AppToaster.show({message:"Value copied"}))}),[]),Rt=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{const o=n.instances.find((t=>t.id===e.id));if(!o)throw new Error("Impossible state");o.inputConfig[t]=(0,l.staticInputPinConfig)(ke),n.connections=n.connections.filter((n=>!(0,l.isInternalConnectionNode)(n.to)||!(n.to.insId===e.id&&n.to.pinId===t)))}));o(n,(0,P.functionalChange)("paste const value"))}),[ee,o,ke]),At=u.useCallback((async e=>{const t=await qe("New name?");if(!t)return;const n=(0,h.produce)(ee,(n=>{var o;"input"===e?(ee.inputs||(n.inputs={}),n.inputs[t]=(0,l.nodeInput)(),n.inputsPosition[t]=tt.current):(ee.outputs||(n.outputs={}),n.outputs[t]=(0,l.nodeOutput)(),n.outputsPosition[t]=tt.current,(null===(o=n.completionOutputs)||void 0===o?void 0:o.length)&&(0,O.toastMsg)("Note that this node has explicit completion outputs set. You may need to update them."))}));o(n,(0,P.functionalChange)("add new io pin")),ue("addIoPin",{type:e})}),[qe,ee,o,ue]),Vt=u.useCallback((async()=>{var e;const t=null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","),n=await qe("Edit completion outputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,h.produce)(ee,(e=>{e.completionOutputs=""===n?void 0:n.split(",")}));o(e,(0,P.functionalChange)("change node completions")),ue("editCompletionOutputs",{count:n?n.split(",").length:0})}}),[qe,o,ee,ue]),Lt=u.useCallback((async()=>{var e;const t=null===(e=ee.reactiveInputs)||void 0===e?void 0:e.join(","),n=await qe("Edit reactive inputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,h.produce)(ee,(e=>{e.reactiveInputs=""===n?void 0:n.split(",")}));o(e,(0,P.functionalChange)("change reactive inputs")),ue("editReactiveInputs",{count:n?n.split(",").length:0})}}),[qe,o,ee,ue]),zt=u.useCallback((async()=>{const e=await qe("Description?",ee.description),t=(0,h.produce)(ee,(t=>{t.description=e}));o(t,(0,P.functionalChange)("Edit node description"))}),[qe,o,ee]),$t=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{t.defaultStyle=e}));o(t,(0,P.functionalChange)("change default style")),ue("changeStyle",{isDefault:!0})}),[o,ee,ue]),Ht=u.useCallback((async(e,t)=>{const n=await qe("New name?",t)||t,i=(0,m.handleIoPinRename)(ee,e,t,n);o(i,(0,P.functionalChange)("rename io pin"))}),[ee,o,qe]),qt=u.useCallback(((e,t)=>{const n=(0,m.handleChangeNodeInputType)(ee,e,t);o(n,(0,P.functionalChange)("toggle io pin optional"))}),[ee,o]),Ft=u.useCallback((e=>{switch(e.type){case H.ActionType.RemoveNode:{const e=(0,h.produce)(ee,(e=>{if(!(0,l.isVisualNode)(ee))throw new Error("Impossible state, deleting instances opf non visual node");e.instances=e.instances.filter((e=>!pe.includes(e.id))),e.connections=e.connections.filter((e=>!pe.includes(e.from.insId)&&!pe.includes(e.to.insId)))}));K({selected:[]}),o(e,(0,P.functionalChange)("remove-instances")),(0,O.toastMsg)(`Removed ${pe.length} instances(s)`),ue("deleteInstances",{count:pe.length});break}case H.ActionType.Inspect:if(1===pe.length)J(pe[0]);else if(fe||me){const e=null!=fe?fe:me,t=(0,l.isExternalConnectionNode)(e)?l.ROOT_INS_ID:e.insId;J(t,{type:fe?"output":"input",id:e.pinId})}ue("openInspectMenu",{source:"actionMenu"});break;case H.ActionType.Group:(async()=>{await Ye()})();break;case H.ActionType.UnGroup:{const e=ee.instances.find((e=>e.id===pe[0]));Tt(e);const t=(0,G.safelyGetNodeDef)(e,ce);(0,O.toastMsg)(`Ungrouped inline node ${t.id}`),ue("unGroupNode",{instancesCount:t.instances.length});break}case H.ActionType.AddInlineValue:Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"actionMenu"});break;case H.ActionType.AddNode:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,h.produce)(ee,(e=>{e.instances.push(r)})),u=(0,h.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,P.functionalChange)("add new instance")),K(u),(0,O.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;case H.ActionType.AI:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,h.produce)(ee,(e=>{e.instances.push(r)})),u=(0,h.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,P.functionalChange)("add new instance")),K(u),(0,O.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;default:(0,O.toastMsg)(`${e.type} not supported yet`)}}),[Y,fe,o,K,Ye,re,J,Tt,ee,ce,ue,pe,me,Fe,et]),Gt=()=>{const t=Y.from;return(0,p.entries)(be).map((n=>{let[o,s]=n;return(0,a.jsx)(I.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"input",pos:ge[o]||{x:0,y:0},id:o,onDelete:i?xt:void 0,onRename:i?Ht:void 0,onDblClick:Zt,closest:!(!Ke||"input"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,inputMode:s.mode,onChangeInputMode:qt,viewPort:Fe,onDragStart:ht,onDragEnd:gt,onDragMove:vt,onSelect:it,onSetDescription:st,selected:(null==t?void 0:t.pinId)===o,description:s.description,onMouseUp:_n,onMouseDown:wn},o)}))},Ut=()=>{const{to:t}=Y;return(0,p.entries)(Ie).map((n=>{let[o,s]=n;return(0,a.jsx)(I.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"output",pos:ye[o]||{x:0,y:0},id:o,onDelete:i?xt:void 0,onRename:i?Ht:void 0,closest:!(!Ke||"output"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,viewPort:Fe,onDragStart:ht,onDragEnd:gt,onDragMove:vt,onSelect:it,onSetDescription:st,description:s.description,selected:(null==t?void 0:t.pinId)===o,onMouseUp:_n,onMouseDown:wn},o)}))},Bt=()=>{if(we){const{from:e,to:t}=we,n=(0,m.logicalPosToRenderedPos)(e,Fe),o=(0,m.logicalPosToRenderedPos)(t,Fe),{x:i,y:s,w:r,h:u}=(0,m.getSelectionBoxRect)(n,o);return(0,a.jsx)("div",{className:"selection-box",style:{top:s,left:i,width:r,height:u}})}return null},Wt=u.useCallback((async(e,t,n,o)=>{if("input"===n){const n=e.inputConfig[t],o=(0,l.isStaticInputPinConfig)(n)?JSON.stringify(n.value):void 0;Ve({type:"static-input",insId:e.id,pinId:t,value:null!=o?o:JSON.stringify("Some static value")}),ue("addValueModalOpen",{source:"dblClickPin"})}else{const i=(0,G.safelyGetNodeDef)(e,ce);if(!(0,l.getNodeOutputs)(i)[t])throw new Error("Dbl clicked on un-existing pin");Me({pos:{x:o.clientX,y:o.clientY},ins:e,targetNode:i,pinId:t,pinType:n})}}),[ce,ue]),Zt=u.useCallback((async(e,t)=>{if(!ee.inputs[e])throw new Error("Dbl clicked on un-existing pin");Me({pos:{x:t.clientX,y:t.clientY},pinId:e,pinType:"input",targetNode:ee})}),[ee]),Jt=u.useCallback((e=>{if(e.metaKey||e.ctrlKey){const t=-.005*e.deltaY;ct(Fe.zoom+t,"mouse"),e.preventDefault(),e.stopPropagation()}else{if(se)return;const t=e.deltaX,n=e.deltaY,o=(0,h.produce)(Fe,(e=>{e.pos.x=e.pos.x+t/e.zoom,e.pos.y=e.pos.y+n/e.zoom}));We(o),e.stopPropagation(),e.preventDefault()}}),[se,ct,We,Fe]);(0,v.useEffect)((()=>{const{current:e}=Xe;if(e)return e.addEventListener("wheel",Jt),()=>{e.removeEventListener("wheel",Jt)}}),[Jt]);const Yt={backgroundPositionX:(0,m.roundNumber)(-Fe.pos.x*Fe.zoom),backgroundPositionY:(0,m.roundNumber)(-Fe.pos.y*Fe.zoom),backgroundSize:(0,m.roundNumber)(10*Fe.zoom)+"px"},Kt=u.useRef(new Map);u.useEffect((()=>{const e=he.reduce(((e,t)=>{const n=(0,G.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeInputs)(n))),e}),new Map),t=he.reduce(((e,t)=>{const n=(0,G.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeOutputs)(n))),e}),new Map);e.set(l.THIS_INS_ID,(0,l.keys)(ee.outputs)),t.set(l.THIS_INS_ID,(0,l.keys)(ee.inputs));const n=ve.filter((n=>{const o=e.get(n.to.insId)&&e.get(n.to.insId).includes(n.to.pinId),i=t.get(n.from.insId)&&t.get(n.from.insId).includes(n.from.pinId);return!(o&&i)}));if(n.length>0){(0,O.toastMsg)(`${n.length} orphan connections removed`,"warning"),console.warn(`${n.length} orphan connections removed`,n);const e=(0,h.produce)(ee,(e=>{e.connections=ee.connections.filter((e=>!n.includes(e)))}));o(e,(0,P.functionalChange)("prune orphan connections"))}}),[he,o,ve,ee,ce]),u.useEffect((()=>{let e=[];const t=(0,h.produce)(ee,(t=>{t.instances=t.instances.map((t=>{const n=(0,G.safelyGetNodeDef)(t,ce);if(n){const o=(0,l.getNodeInputs)(n),i=(0,l.getNodeOutputs)(n);if(t.visibleInputs){const n=t.visibleInputs.filter((e=>!o[e]));n.length>0&&(t.visibleInputs=(0,l.keys)(o),e.push(...n))}if(t.visibleOutputs){const n=t.visibleOutputs.filter((e=>!i[e]));n.length>0&&(t.visibleOutputs=(0,l.keys)(i),e.push(...n))}}return t}))}));e.length>0&&((0,O.toastMsg)(`Found ${e.length} invalid visible inputs/outputs: ${e.join(", ")}. Reset them`,"warning"),o(t,(0,P.functionalChange)("reset corrupt visible inputs/outputs")))}),[he,o,ee,ce]),(0,v.useEffect)((()=>{const e=new Map(he.map((e=>[e.id,e])));Kt.current=ve.reduce(((t,n)=>{const o=t.get(n.to.insId)||{},i=o[n.to.pinId]||[],s={...o,[n.to.pinId]:[...i,e.get(n.from.insId)]};return t.set(n.to.insId,s),t}),new Map)}),[ve,he]);const Qt=u.useCallback((()=>{Me(void 0)}),[]),Xt=u.useCallback((async e=>{if(!De)throw new Error("impossible state - quick add menu invoked but not available");const{ins:t,pinId:n}=De;switch(e.type){case"import":case"node":{const i="import"===e.type?await re(e.importableNode):ce,s="import"===e.type?e.importableNode.node:e.node,r=(0,m.createNewNodeInstance)(s.id,100,tt.current,i);if(r){const e=(0,h.produce)(ee,(e=>{e.instances.push(r),e.connections.push({from:{insId:t?t.id:l.THIS_INS_ID,pinId:n},to:{insId:r.id,pinId:l.TRIGGER_PIN_ID}})}));o(e,(0,P.functionalChange)("add-item-quick-menu")),Qt()}ue("addNode",{nodeId:s.id,source:"quickAdd"});break}case"value":if(!t)return void(0,O.toastMsg)("Cannot add value to main input");Ve({type:"new-output",insId:t.id,pinId:n}),ue("addValueModalOpen",{source:"quickAdd"})}}),[De,ce,ue,ee,o,Qt,re]),en=u.useCallback((async()=>{const e=JSON.stringify(ee);await navigator.clipboard.writeText(e),O.AppToaster.show({message:"Copied!"})}),[ee]),tn=u.useCallback((()=>{var e,t;const n=i?"":" (cannot edit main node, only visual)";return(0,a.jsxs)(b.Menu,{children:[(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"New Value",onClick:(0,p.preventDefaultAnd)((()=>{Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"contextMenu"})}))}),(0,a.jsx)(b.MenuItem,{text:`New input ${n}`,onMouseDown:e=>e.stopPropagation(),onClick:(0,p.preventDefaultAnd)((()=>At("input"))),disabled:!i}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`New output ${n}`,onClick:(0,p.preventDefaultAnd)((()=>At("output"))),disabled:!i}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Copy node to clipboard",onClick:(0,p.preventDefaultAnd)(en)}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Completion Outputs (${(null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Vt()))}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Reactive inputs (${(null===(t=ee.reactiveInputs)||void 0===t?void 0:t.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Lt()))}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Edit description",onClick:(0,p.preventDefaultAnd)((()=>zt()))}),(0,a.jsx)(b.MenuDivider,{}),(0,a.jsx)(b.MenuItem,{text:"Default Style",children:(0,a.jsx)(z.NodeStyleMenu,{style:ee.defaultStyle,onChange:$t,promptFn:qe})})]})}),[i,en,ee.completionOutputs,ee.reactiveInputs,ee.defaultStyle,$t,qe,ue,At,Vt,Lt,zt]);(0,g.useHotkeys)("shift+c",ot,{text:"Center viewport",group:"Viewport Controls"},[],Ge),(0,g.useHotkeys)("cmd+c",at,{text:"Copy instances",group:"Editing"},[],Ge),(0,g.useHotkeys)("cmd+v",ut,{text:"Paste instances",group:"Editing"},[],Ge),(0,g.useHotkeys)("esc",dt,{text:"Clear selections",group:"Selection"},[],Ge),(0,g.useHotkeys)("backspace",wt,{text:"Delete instances",group:"Editing"},[],Ge),(0,g.useHotkeys)("shift+d",jt,{text:"Duplicate selected instances",group:"Editing"},[],Ge),(0,g.useHotkeys)("cmd+a",bt,{text:"Select all",group:"Selection"},[],Ge),(0,g.useHotkeys)("s",lt,{text:"Select pin closest to mouse",group:"Selection"},[],Ge);const nn=u.useCallback(((e,t)=>{if(!Le)throw new Error("impossible state");const n=(0,h.produce)(ee,(t=>{const n=t.instances.find((e=>e.id===Le.insId));if(!n||!(0,l.isInlineNodeInstance)(n))throw new Error("impossible state");n.node=e}));o(n,(0,P.functionalChange)("Inner change: "+t.message)),ze((t=>({...t,node:e})))}),[o,Le,ee]),[on,sn]=(0,v.useState)({selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}}),rn=u.useCallback((e=>sn((t=>({...t,...e})))),[]),an=n=>Le&&Le.insId===n.id?{currentInsId:Le.insId,ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),boardData:on,onChangeBoardData:rn,resolvedDependencies:ne,onCopy:s,clipboardData:e.clipboardData,onInspectPin:e.onInspectPin,onGoToNodeDef:e.onGoToNodeDef,nodeIoEditable:e.nodeIoEditable,node:Le.node,onChangeNode:nn,onShowOmnibar:te,parentViewport:t.defaultViewPort,parentBoardPos:nt,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:e.queuedInputsData}:void 0,un=()=>{if(fe&&("input"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"output"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(e)&&!(0,l.isInternalConnectionNode)(fe))return;return{from:fe,to:e}}if(me&&("output"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"input"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(me)&&!(0,l.isInternalConnectionNode)(e))return;return{from:e,to:me}}},ln=()=>{const e=un();if(e){const{from:t,to:n}=e;return{connection:{from:t,to:n},type:ve.some((t=>(0,l.connectionDataEquals)(t,e)))?"future-remove":"future-add"}}},cn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleInputs:t}:n))}));o(n,(0,P.functionalChange)("change instance visible inputs"))}),[ee,o]),dn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,style:t}:n))}));o(n,(0,P.functionalChange)("change instance style")),ue("changeStyle",{isDefault:!1})}),[o,ee,ue]),pn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleOutputs:t}:n))}));o(n,(0,P.functionalChange)("change instance visible outputs"))}),[ee,o]),fn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,displayName:t}:n))}));o(n,(0,P.functionalChange)("change instance display name"))}),[ee,o]);u.useImperativeHandle(n,(()=>({centerInstance(e){const t=ee.instances.find((t=>t.id===e));if(t){const e=(0,C.vSub)(t.pos,(0,C.vec)(et.width/2,et.height/2));We({...Fe,pos:e})}},centerViewPort(){ot()},getViewPort:()=>Fe,clearSelection:()=>{dt()},requestNewInlineValue:()=>{Ve({type:"new-floating",pos:tt.current})}})));const[mn,hn]=u.useState([]),vn=u.useCallback(((e,t)=>{const n=t.trim().substr(0,100),i=`Inline-value-${n.substr(0,15).replace(/["'`]/g,"")}`,s=(0,S.createInlineValueNode)({code:t,customView:n,nodeId:i,type:e});switch(Ae.type){case"existing":{const[e]=ee.instances.filter((e=>e.id===Ae.insId)).filter((e=>(0,l.isInlineNodeInstance)(e))).map((e=>e.node));if(!e)throw new Error("Unable to find inline node to save to");const t=(0,l.keys)(e.inputs),n=(0,l.keys)(s.inputs),i=new Set(T.default.difference(t,n)),r=(0,h.produce)(ee,(e=>{e.instances=e.instances.map((e=>e.id===Ae.insId?(0,l.inlineNodeInstance)(e.id,s,e.inputConfig,e.pos):e)),e.connections=e.connections.filter((e=>!(e.to.insId===Ae.insId&&i.has(e.to.pinId))))}));o(r,(0,P.functionalChange)("change inline value")),Ve(void 0);break}case"static-input":{let e;try{const n=t.replace(/^['`]/,'"').replace(/['`]$/,'"');e=JSON.parse(n)}catch(r){return void(0,O.toastMsg)("Input values must not be formulas or code")}const n=(0,h.produce)(ee,(t=>{t.instances.find((e=>e.id===Ae.insId)).inputConfig[Ae.pinId]=(0,l.staticInputPinConfig)(e)}));o(n,(0,P.functionalChange)("set static input value")),Ve(void 0);break}case"new-floating":{const e=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},Ae.pos),t=(0,h.produce)(ee,(t=>{t.instances.push(e)}));o(t,(0,P.functionalChange)("new floating value")),Ve(void 0);break}case"new-output":{const{insId:e,pinId:t}=Ae,n=ee.instances.find((t=>t.id===e));if(!n)throw new Error("Impossible state");const i=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},(0,C.vAdd)(n.pos,{x:-50,y:150})),r=(0,h.produce)(ee,(n=>{n.instances.push(i),n.connections.push({from:(0,l.connectionNode)(e,t),to:(0,l.connectionNode)(i.id,l.TRIGGER_PIN_ID)})}));o(r,(0,P.functionalChange)("new value connected to output")),Ve(void 0)}}ue("addValue",{type:e,placeholdersCount:(0,l.keys)(s.inputs).length})}),[Ae,o,ee,ue]),gn=ve.filter((e=>{const t=un();return!t||!(0,l.connectionDataEquals)(t,e)})),yn=u.useCallback((()=>{ze(void 0),sn(t.defaultBoardData)}),[]),bn=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{const n=t.connections.find((t=>(0,l.connectionDataEquals)(t,e)));n.hidden=!n.hidden}));o(t,(0,P.functionalChange)("toggle connection hidden"))}),[o,ee]),In=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{t.connections=t.connections.filter((t=>!(0,l.connectionDataEquals)(t,e)))}));o(t,(0,P.functionalChange)("remove connection"))}),[o,ee]),Cn=u.useCallback(((e,t,n)=>{Be("input"===n?{to:(0,l.connectionNode)(e.id,t),from:void 0}:{from:(0,l.connectionNode)(e.id,t),to:void 0})}),[]),xn=u.useCallback(((e,t,n)=>{Ue&&(Ue.from&&"input"===n?Je(Ue.from,(0,l.connectionNode)(e.id,t),"pinDrag"):Ue.to&&"output"===n&&Je((0,l.connectionNode)(e.id,t),Ue.to,"pinDrag")),Be(null)}),[Ue,Je]),wn=u.useCallback(((e,t)=>{}),[]),_n=u.useCallback(((e,t)=>{Ue&&(Ue.from&&"output"===t?Je(Ue.from,(0,l.externalConnectionNode)(e),"nodeIoPinDrag"):Ue.to&&"input"===t&&Je((0,l.externalConnectionNode)(e),Ue.to,"nodeIoPinDrag"))}),[Ue,Je]);try{return(0,a.jsxs)(b.ContextMenu,{className:(0,k.default)("visual-node-editor",e.className,{dark:ae}),"data-id":ee.id,content:tn(),disabled:!Ge.current,children:[(0,a.jsxs)("main",{className:"board-editor-inner",onMouseDown:Nt,onMouseUp:Ot,onMouseMove:Pt,onMouseLeave:Et,ref:Xe,style:Yt,children:[(0,a.jsx)(u.Fragment,{children:(0,a.jsx)(j.LayoutDebugger,{vp:Fe,node:ee,extraDebug:m.emptyList,mousePos:tt.current})}),(0,a.jsx)(d.ConnectionView,{resolvedNodes:ce,currentInsId:Q,ancestorsInsIds:X,size:et,node:ee,boardPos:nt,instances:he,connections:gn,futureConnection:ln(),onDblClick:l.noop,viewPort:Fe,parentVp:le,selectedInstances:pe,toggleHidden:bn,removeConnection:In,lastMousePos:tt.current,draggedSource:Ue}),Gt(),he.map((t=>{var n,o,i,s,r;return(0,a.jsx)(c.InstanceView,{onUngroup:Tt,onExtractInlineNode:Dt,onDetachConstValue:Mt,onCopyConstValue:kt,onPasteConstValue:Rt,copiedConstValue:ke,connectionsPerInput:Kt.current.get(t.id)||m.emptyObj,node:(0,G.safelyGetNodeDef)(t,ce),ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),onPinClick:rt,onPinDblClick:Wt,onDragStart:pt,onDragEnd:mt,resolvedDeps:ce,onDragMove:ft,onDblClick:St,onSelect:yt,onToggleSticky:_t,selected:-1!==pe.indexOf(t.id),dragged:Ce===t.id,onInspectPin:Ze,selectedInput:me&&(0,l.isInternalConnectionNode)(me)&&me.insId===t.id?me.pinId:void 0,selectedOutput:fe&&(0,l.isInternalConnectionNode)(fe)&&fe.insId===t.id?fe.pinId:void 0,closestPin:Ke&&Ke.ins.id===t.id?Ke:void 0,queuedInputsData:null!==(n=oe[t.id])&&void 0!==n?n:m.emptyObj,instance:t,connections:ve,onTogglePinBreakpoint:l.noop,onTogglePinLog:l.noop,viewPort:Fe,onChangeVisibleInputs:cn,onChangeVisibleOutputs:pn,onSetDisplayName:fn,onDeleteInstance:Ct,forceShowMinimized:fe||(null===(o=null==Ue?void 0:Ue.to)||void 0===o?void 0:o.insId)===t.id?"input":me||(null===(i=null==Ue?void 0:Ue.from)||void 0===i?void 0:i.insId)===t.id?"output":void 0,isConnectedInstanceSelected:pe.some((e=>ve.some((n=>{let{from:o,to:i}=n;return o.insId===t.id&&i.insId===e||o.insId===e&&i.insId===t.id})))),inlineGroupProps:an(t),onCloseInlineEditor:yn,inlineEditorPortalDomNode:$e.current,onChangeStyle:dn,onGroupSelected:Ye,onPinMouseDown:Cn,onPinMouseUp:xn,hadError:null!==(r=null===(s=e.instancesWithErrors)||void 0===s?void 0:s.has((0,l.fullInsIdPath)(t.id)))&&void 0!==r&&r},t.id)})),Bt(),Ut(),(0,a.jsx)(q.MainInstanceEventsIndicator,{currentInsId:Q,ancestorsInsIds:X,viewPort:Fe}),De?(0,a.jsx)(x.QuickAddMenu,{targetNode:De.targetNode,pinId:De.pinId,pinType:De.pinType,pos:De.pos,resolvedDependencies:ne,node:ee,onAdd:Xt,onClose:Qt}):null,(0,a.jsxs)("div",{className:"viewport-controls-and-help",children:[(0,a.jsx)(b.Button,{small:!0,onClick:ot,minimal:!0,intent:"primary",children:"Center"}),(0,a.jsx)(B,{min:.15,max:3,stepSize:.05,labelStepSize:10,labelRenderer:W,onChange:ct,value:Fe.zoom}),je?(0,a.jsx)(F.HelpBubble,{}):null]}),Ae?(0,a.jsx)(E.InlineCodeModal,{env:m.emptyObj,initialValue:Ae.value,initialType:"existing"===Ae.type?Ae.templateType:void 0,onCancel:()=>Ve(void 0),onSubmit:vn}):null,(0,a.jsx)("div",{className:"inline-editor-portal-root"})]}),(0,a.jsx)(H.ActionsMenu,{showRunFlowOptions:je,onAction:Ft,selectedInstances:pe,node:ee,resolvedNodes:ce,to:me,from:fe,hotkeysEnabled:Ge})]})}catch(jn){return console.error(jn),(0,a.jsxs)("div",{children:["Error rendering board - ",jn.toString()]})}})));const Z=(e,t)=>{const n=e.target.closest(".visual-node-editor");return n&&n.getAttribute("data-id")===t}},83234:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeView=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=r(n(59349)),d=n(30653);t.BaseNodeView=function(e){const{dragged:t,viewPort:n,pos:o,onDragEnd:i,onDragMove:s,onDragStart:r,displayMode:p}=e,f=(0,d.useDarkMode)(),m=u.useCallback(((e,t)=>{r(e,t)}),[r]),h=u.useCallback(((e,t)=>{const s=o,r=(t.x-s.x)/n.zoom,a=(t.y-s.y)/n.zoom,u=s.x+r,l=s.y+a;i(e,{...t,x:u,y:l})}),[o,i,n]),v=u.useCallback(((e,t)=>{s(e,{x:t.x,y:t.y})}),[s]),g={transform:`scale(${n.zoom})`},y=(0,l.default)("base-node-view",e.className,{dragged:t,dark:f,"display-mode":p}),b=o.x*n.zoom-n.pos.x*n.zoom,I=o.y*n.zoom-n.pos.y*n.zoom,C={transform:`translate(${b-o.x}px, ${I-o.y}px)`},x=(0,l.default)("base-node-view-vp-fixer",{"display-mode":p}),w=(0,a.jsx)("span",{className:"base-node-view-wrapper",children:(0,a.jsx)("div",{className:y,style:g,id:e.domId,children:e.children})});return(0,a.jsx)("div",{className:x,style:C,children:(0,a.jsx)(c.default,{onStop:h,onStart:m,onDrag:v,position:o,cancel:".no-drag",children:w})})}},80510:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleConnectionCloseEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleConnectionCloseEditorCommand=(e,t)=>{let{from:n,to:o}=t;return(0,s.default)(e,(e=>{const t=e.connections.find((e=>{const t=(0,i.connectionNodeEquals)(n,e.from),s=(0,i.connectionNodeEquals)(o,e.to);return t&&s}));t?e.connections=e.connections.filter((e=>e!==t)):e.connections.push({from:n,to:o})}))}},1788:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDetachConstEditorCommand=void 0;const i=n(74762),s=o(n(53865)),r=n(68371);t.handleDetachConstEditorCommand=(e,t,n)=>(0,s.default)(e,(e=>{const{instances:o}=e,s=o.find((e=>e.id===t));if(!s)throw new Error("Impossible state ins id with no matching instance");const a=s.inputConfig[n];if(!a)throw new Error("impossible state detaching const from unexistent config");if(!(0,i.isStaticInputPinConfig)(a))throw new Error("impossible state detaching const with no value");const u=JSON.stringify(a.value),l=(0,r.createInlineValueNode)({code:`${u}`,type:i.InlineValueNodeType.VALUE}),c=(0,i.inlineNodeInstance)(`value-${(0,i.randomInt)(999)}`,l,{},{x:s.pos.x,y:s.pos.y-100});if(!e.instances.find((e=>e.id===s.id)))throw new Error("impossible state instance not found");s.inputConfig[n]=(0,i.queueInputPinConfig)(),e.instances.push(c),e.connections.push((0,i.connectionData)(`${c.id}.value`,`${s.id}.${n}`))}))},2130:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDuplicateSelectedEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleDuplicateSelectedEditorCommand=(e,t)=>{const n=[];return{newNode:(0,s.default)(e,(o=>{const s=o.instances;t.forEach((t=>{const o=s.find((e=>e.id===t));if(!o)throw new Error("impossible state duplicate selected no matching instance");if(o){const{pos:t}=o,r={...o,pos:{x:t.x+20,y:t.y+20},id:(0,i.createInsId)(e)};s.push(r),n.push(r.id)}}))})),newInstances:n}}},25044:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.pasteInstancesCommand=void 0;const i=n(74762),s=o(n(53865));t.pasteInstancesCommand=(e,t,n)=>{const o=n.instances.map((n=>({...n,pos:t,id:(0,i.createInsId)(e)}))),r=new Map(o.map(((e,t)=>[n.instances[t].id,e.id])));return{newNode:(0,s.default)(e,(e=>{e.instances.push(...o);const t=n.connections.map((e=>{let{from:t,to:n}=e;return{from:{...t,insId:r.get(t.insId)||t.insId},to:{...n,insId:r.get(n.insId)||n.insId}}}));e.connections.push(...t)})),newInstances:o}}},65082:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionView=t.SingleConnectionView=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=r(n(26372)),d=n(74762),p=n(18243),f=n(77852),m=n(74089),h=n(60190),v=n(50382),g=n(76064),y=n(41032);t.SingleConnectionView=e=>{const{isBrowser:t}=(0,f.useSsr)(),{connection:n,node:o,resolvedNodes:i,instances:s,type:r,viewPort:a,toggleHidden:l,parentSelected:m,removeConnection:b}=e,{from:I}=n,C=(0,d.isInternalConnectionNode)(I)&&s.find((e=>e.id===I.insId));if(!C&&(0,d.isInternalConnectionNode)(I))throw new Error(`impossible state - "from instance id - [${I.insId}] does not exist"`);const x=((0,d.isInternalConnectionNode)(I)&&C?(0,y.safelyGetNodeDef)(C,i):o).outputs[I.pinId],w=x&&x.delayed,_=t?(0,p.calcStartPos)({...e,connectionNode:I}):{x:0,y:0},j=t?(0,p.calcTargetPos)({...e,connectionNode:n.to}):{x:0,y:0},{x:N,y:O}=(0,h.vDiv)(_,e.parentVp.zoom),{x:P,y:E}=(0,h.vDiv)(j,e.parentVp.zoom),S=(0,c.default)({delayed:w,hidden:n.hidden,"parent-selected":m},r),T=(0,u.jsxs)(v.Menu,{children:[(0,u.jsx)(v.MenuItem,{text:n.hidden?"Show connection":"Hide connection",onClick:()=>l(n)}),(0,u.jsx)(v.MenuItem,{text:"Remove connection",onClick:()=>b(n)})]});return(0,u.jsx)(v.ContextMenu,{content:T,children:e=>(0,u.jsx)(g.ConnectionViewPath,{className:S,from:{x:N,y:O},to:{x:P,y:E},dashed:"regular"!==r,zoom:a.zoom,onContextMenu:e.onContextMenu})})};t.ConnectionView=e=>{var n;const{viewPort:o,futureConnection:i,toggleHidden:s,selectedInstances:r,draggedSource:c}=e,[d,f]=l.useState(0),h=l.useCallback((e=>requestAnimationFrame((()=>{f((e=>(e+1)%9)),e>0&&h(e-1)}))),[]);l.useEffect((()=>{const e=h(10);return()=>{cancelAnimationFrame(e)}}),[h]),l.useEffect((()=>{const e=()=>{h(3)};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[h,d]);const v=e.connections.map((n=>{const o=r.includes(n.from.insId)||r.includes(n.to.insId);return(0,a.createElement)(t.SingleConnectionView,{...e,connection:n,type:"regular",parentSelected:o,key:n.from.insId+n.from.pinId+n.to.insId+n.to.pinId})}));if(i&&v.push((0,a.createElement)(t.SingleConnectionView,{...e,connection:i.connection,type:i.type,toggleHidden:s,parentSelected:!1,key:"future"})),c){const t=(c.from?p.calcStartPos:p.calcTargetPos)({connectionNode:null!==(n=c.from)&&void 0!==n?n:c.to,viewPort:o,boardPos:e.boardPos,ancestorsInsIds:e.ancestorsInsIds,currentInsId:e.currentInsId});v.push((0,u.jsx)(g.ConnectionViewPath,{className:"dragged",from:t,to:(0,m.logicalPosToRenderedPos)(e.lastMousePos,o),zoom:o.zoom},"dragged"))}return(0,u.jsx)("svg",{className:"connections-view",children:v})}},76064:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionViewPath=void 0;const i=n(35250),s=o(n(26372)),r=n(70079),a=n(23381);t.ConnectionViewPath=(0,r.forwardRef)(((e,t)=>{const{from:n,to:o,className:r,onContextMenu:u,zoom:l,dashed:c}=e,{x:d,y:p}=n,{x:f,y:m}=o,h=(0,a.calcBezierPath)({sourceX:d,sourceY:p,targetX:f,targetY:m,curvature:.15}),v=2.5*l,g=c?6*l:void 0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:h,ref:t,className:(0,s.default)("connection",r),style:{strokeWidth:v,strokeDasharray:g},onContextMenu:u}),e.label?(0,i.jsx)("text",{className:"label",x:(d+f)/2,y:(p+m)/2,fontSize:"12px"}):null,(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%"}),(0,i.jsx)("stop",{offset:"100%"})]})]})}))},23381:(e,t)=>{"use strict";var n;function o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i(e){let t,i,{pos:s,x1:r,y1:a,x2:u,y2:l,c:c}=e;switch(s){case n.Left:t=r-o(r-u,c),i=a;break;case n.Right:t=r+o(u-r,c),i=a;break;case n.Top:t=r,i=a-o(a-l,c);break;case n.Bottom:t=r,i=a+o(l-a,c)}return[t,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.getBezierCenter=t.calcBezierPath=t.Position=void 0,function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(n=t.Position||(t.Position={}));t.calcBezierPath=e=>{let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l});return`M${t},${o} C${c},${d} ${p},${f} ${r},${a}`},t.getBezierCenter=function(e){let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l}),m=.125*t+.375*c+.375*p+.125*r,h=.125*o+.375*d+.375*f+.125*a;return[m,h,Math.abs(m-t),Math.abs(h-o)]}},18243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcTargetPos=t.calcStartPos=t.calcPinPosition=void 0;const o=n(74762),i=n(30994),s={x:99999,y:99999};function r(e){const t=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds),pinId:e.pinId,pinType:e.pinType,isMain:e.isMain});return((e,t,n,o)=>{if(!e)return console.warn(`Cannot find element ${n} to calculate position.`),s;const{x:i,y:r,width:a,height:u}=e.getBoundingClientRect(),l=r+u/2;return{x:i+a/2-t.x,y:l-t.y}})(document.getElementById(t),e.boardPos,t,e.viewPort)}t.calcPinPosition=r;t.calcStartPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"input",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"output",boardPos:n,viewPort:s})};t.calcTargetPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"output",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"input",boardPos:n,viewPort:s})}},30994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPinDomId=t.getMainInstanceIndicatorDomId=t.getInstanceDomId=void 0;const o=n(74762);t.getInstanceDomId=(e,t)=>`ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getMainInstanceIndicatorDomId=(e,t)=>`main-ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getPinDomId=e=>{let{pinType:t,fullInsIdPath:n,pinId:o,isMain:i}=e;return`${i?"main-":""}pin:${t}:${n}:${o}`.replace(/\s+/g,"-")}},86553:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceView=t.getVisibleOutputs=t.getVisibleInputs=t.INSTANCE_INFO_TOOLTIP_DELAY=t.MAX_INSTANCE_WIDTH=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=n(66074),d=n(74762),p=r(n(26372)),f=n(2036),m=n(74762),h=n(74762),v=n(53159),g=n(83234),y=n(74762),b=n(30994),I=n(63521),C=n(74089),x=n(50382),w=r(n(99581)),_=n(88593),j=n(30653);t.PIECE_HORIZONTAL_PADDING=25,t.PIECE_CHAR_WIDTH=11,t.MIN_WIDTH_PER_PIN=40,t.MAX_INSTANCE_WIDTH=400,t.INSTANCE_INFO_TOOLTIP_DELAY=400;t.getVisibleInputs=(e,t,n)=>{const{visibleInputs:o}=e;if(o)return o;const i=(0,d.keys)((0,h.getNodeInputs)(t)).filter(((o,i)=>{var s;const r=n.some((t=>t.to.insId===e.id&&t.to.pinId===o)),a=t.inputs[o]&&"optional"===(null===(s=t.inputs[o])||void 0===s?void 0:s.mode);return r||!a&&o!==m.TRIGGER_PIN_ID}));return 0===i.length?[m.TRIGGER_PIN_ID]:i};t.getVisibleOutputs=(e,t,n)=>{const{visibleOutputs:o}=e;if(o)return o;const i=Object.keys(t.outputs);return n.some((t=>t.from.insId===e.id&&t.from.pinId===m.ERROR_PIN_ID))?[...i,m.ERROR_PIN_ID]:i};t.InstanceView=function(e){const{selected:n,selectedInput:o,selectedOutput:i,closestPin:s,dragged:r,onTogglePinLog:N,onTogglePinBreakpoint:O,onDetachConstValue:P,onCopyConstValue:E,onPasteConstValue:S,displayMode:T,connections:D,instance:M,viewPort:k,node:R,onPinClick:A,onPinDblClick:V,onDragStart:L,onDragEnd:z,onDragMove:$,onToggleSticky:H,onSelect:q,onDblClick:F,onChangeVisibleInputs:G,onChangeVisibleOutputs:U,onConvertConstToEnv:B,inlineGroupProps:W,onUngroup:Z,onExtractInlineNode:J,onGroupSelected:Y,isConnectedInstanceSelected:K,inlineEditorPortalDomNode:Q,onChangeStyle:X,onDeleteInstance:ee,onSetDisplayName:te,onPinMouseUp:ne,onPinMouseDown:oe}=e,ie=(0,j.useDarkMode)(),{id:se}=M,re=l.useMemo((()=>{const e=(0,d.randomInt)(6,1);return{icon:(0,d.pickRandom)([["fab","discord"],["fab","slack"],"bug","cube"]),color:e,size:(0,d.randomInt)(3,1),variation:(0,d.randomInt)(5,1)}}),[]),ae=l.useRef(),ue=l.useMemo((()=>M.style||R.defaultStyle||{}),[R,M]),le=ue.size||"regular",ce=l.useMemo((()=>new Map(D.filter((e=>{let{to:t}=e;return t.insId===se})).map((e=>{let{to:t,hidden:n}=e;return[t.pinId,n]})))),[D,se]),de=l.useMemo((()=>new Map(D.filter((e=>{let{from:t}=e;return t.insId===se})).map((e=>{let{from:t,hidden:n}=e;return[t.pinId,n]})))),[D,se]),pe=(0,C.usePrompt)(),fe=l.useCallback((e=>A(M,e,"input")),[M,A]),me=l.useCallback(((e,t)=>V(M,e,"input",t)),[M,V]),he=l.useCallback(((e,t)=>V(M,e,"output",t)),[M,V]),ve=l.useCallback((e=>A(M,e,"output")),[M,A]),ge=l.useCallback(((e,t)=>{L(M,e,t)}),[M,L]),ye=l.useCallback(((e,t)=>{const n=M.pos,o=(t.x-n.x)/k.zoom,i=(t.y-n.y)/k.zoom,s=n.x+o,r=n.y+i;z(M,e,{...t,x:s,y:r})}),[M,z,k.zoom]),be=l.useCallback(((e,t)=>{$(M,e,{x:t.x,y:t.y})}),[M,$]),Ie=l.useCallback((e=>H(M,e)),[M,H]),Ce=l.useCallback((e=>P(M,e)),[M,P]),xe=l.useCallback((e=>E(M,e)),[M,E]),we=l.useCallback((e=>S(M,e)),[M,S]),_e=l.useCallback((e=>q(M,e)),[M,q]),je=l.useCallback((e=>F(M,e.shiftKey)),[M,F]),Ne=(0,d.entries)(R.inputs),{visibleInputs:Oe,visibleOutputs:Pe}=M;Oe&&Ne.sort(((e,t)=>Oe.indexOf(e[0])-Oe.indexOf(t[0])));const Ee=(0,d.entries)(R.outputs);Pe&&Ee.sort(((e,t)=>Pe.indexOf(e[0])-Pe.indexOf(t[0])));const Se=(0,t.getVisibleInputs)(M,R,D),Te=(0,t.getVisibleOutputs)(M,R,D);Ne.push([m.TRIGGER_PIN_ID,{...(0,d.nodeInput)(),description:"Use this pin to manually trigger the node. If not connected, the node will be triggered automatically when all required inputs have data."}]),Ee.push([m.ERROR_PIN_ID,{...(0,m.nodeOutput)(),description:"Use this pin to catch errors that happen inside this node. If not connected, errors will bubble up to the parent node."}]);const De=Ne.filter((e=>{let[t]=e;return Se.includes(t)||(n||K)&&ce.has(t)})),Me=Ee.filter((t=>{let[o]=t;return Te.includes(o)||(n||K)&&de.has(o)||o===m.ERROR_PIN_ID&&e.hadError})),ke=D.some((e=>e.from.insId===se&&e.from.pinId===m.ERROR_PIN_ID)),Re=(0,p.default)("ins-view",{"no-inputs":0===Ne.length,"no-outputs":0===Ee.length,"display-mode":T,"force-minimized-input":"input"===e.forceShowMinimized||"both"===e.forceShowMinimized,"force-minimized-output":"output"===e.forceShowMinimized||"both"===e.forceShowMinimized,"inline-node-edited":!!W,"error-caught":ke}),Ae=(0,p.default)({selected:n,dragged:r,closest:s&&s.ins.id===M.id},`size-${le}`),Ve=new Set((0,d.entries)(R.inputs).filter((e=>{let[t,n]=e;return(0,m.isInputPinOptional)(n)})).map(d.pickFirst)),Le=(0,d.entries)(M.inputConfig).reduce(((e,t)=>{let[n,o]=t;return(0,m.isStickyInputPinConfig)(o)||o.sticky?{...e,[n]:!0}:e}),{}),ze=(0,v.calcNodeContent)(M,R),$e=e=>{const t=M.inputConfig[e];if((0,y.isStaticInputPinConfig)(t))return t.value},He=l.useCallback((async()=>{const e=(0,d.okeys)(R.inputs),t=await pe("New order?",(M.visibleInputs||e).join(","));t&&G(M,t.split(","))}),[R.inputs,pe,M,G]),qe=l.useCallback((async()=>{const e=(0,d.okeys)(R.outputs),t=await pe("New order?",(M.visibleOutputs||e).join(","));t&&U(M,t.split(","))}),[R.outputs,pe,M,U]),Fe=l.useCallback((()=>{ee(M)}),[ee,M]),Ge=l.useCallback((async()=>{const e=await pe("Set custom display name",M.displayName||R.id);te(M,e)}),[pe,M,te,R.id]),Ue=Object.keys((0,h.getNodeInputs)(R)),Be=Object.keys((0,d.getNodeOutputs)(R)),We=l.useCallback((e=>{B&&B(M,e)}),[M,B]),Ze=l.useCallback(((e,t)=>{ne&&ne(M,e,t)}),[M,ne]),Je=l.useCallback(((e,t)=>{oe&&oe(M,e,t)}),[M,oe]),Ye=()=>(0,u.jsx)("div",{className:"inputs no-drag",children:De.map((t=>{let[i,r]=t;var a;return(0,u.jsx)(f.PinView,{type:"input",currentInsId:M.id,ancestorsInsIds:e.ancestorsInsIds,id:i,optional:Ve.has(i),connected:ce.has(i),isSticky:Le[i],minimized:!n&&1===De.length,onToggleSticky:Ie,onDetachConstValue:Ce,onCopyConstValue:xe,onPasteConstValue:we,copiedConstValue:e.copiedConstValue,selected:i===o,onClick:fe,onDoubleClick:me,isClosestToMouse:!!s&&"input"===s.type&&s.pin===i,onToggleLogged:N,onToggleBreakpoint:O,onInspect:e.onInspectPin,constValue:$e(i),onConvertConstToEnv:e.onConvertConstToEnv?We:void 0,description:r.description,queuedValues:null!==(a=e.queuedInputsData[i])&&void 0!==a?a:0,onMouseUp:Ze,onMouseDown:Je},i)}))}),Ke=()=>(0,u.jsx)("div",{className:"outputs no-drag",children:Me.map((t=>{let[o,r]=t;return(0,u.jsx)(f.PinView,{currentInsId:M.id,ancestorsInsIds:e.ancestorsInsIds,connected:de.has(o),type:"output",id:o,minimized:!n&&1===Me.length,isClosestToMouse:!!s&&"output"===s.type&&s.pin===o,selected:o===i,onClick:ve,onDoubleClick:he,onToggleLogged:N,onToggleBreakpoint:O,onInspect:e.onInspectPin,description:r.description,onMouseUp:Ze,onMouseDown:Je},o)}))}),Qe=l.useCallback((e=>{X(M,e)}),[M,X]),Xe=l.useCallback((()=>{const e=[...Ue.map((e=>{const t=Se.includes(e),n=ce.has(e)&&!0!==ce.get(e),o=(0,d.getInputName)(e);return{text:t?n?`Hide input "${o}" (disconnect first)`:`Hide input "${o}"`:`Show input "${o}"`,onClick:()=>G(M,t?Se.filter((t=>t!==e)):[...Se,e]),disabled:n&&t}})),...Be.map((e=>{const t=Te.includes(e),n=de.has(e),o=(0,d.getOutputName)(e);return{text:t?n?`Hide output "${o}" (disconnect first)`:`Hide output "${o}"`:`Show output "${o}"`,onClick:()=>U(M,t?Te.filter((t=>t!==e)):[...Te,e]),disabled:n&&t}})),...(0,d.isInlineNodeInstance)(M)&&(0,h.isVisualNode)(M.node)?[{text:"Ungroup inline node",onClick:()=>Z(M)}]:[],...(0,d.isInlineNodeInstance)(M)?[{text:"Extract inline node to file",onClick:()=>J(M)}]:[],{text:"Reorder inputs",onClick:He},{text:"Reorder outputs",onClick:qe},{text:"Set display name",onClick:Ge},{text:"Group selected instances",onClick:Y},{text:"Delete instance",intent:"danger",onClick:Fe}];return(0,u.jsxs)(x.Menu,{children:[(0,u.jsx)(x.MenuItem,{text:"Style",children:(0,u.jsx)(_.NodeStyleMenu,{style:ue,onChange:Qe,promptFn:pe})}),e.map(((e,t)=>(0,a.createElement)(x.MenuItem,{...e,key:t})))]})}),[Ue,Be,M,He,qe,Ge,Fe,ue,Qe,pe,Se,ce,G,Te,de,U,Z,J,Y]),et={"--node-color":ue.color,...ue.cssOverride||{}},tt=(0,b.getInstanceDomId)(M.id,e.ancestorsInsIds);return(0,u.jsx)("div",{className:Re,children:(0,u.jsx)(g.BaseNodeView,{pos:M.pos,viewPort:k,onDragStart:ge,onDragMove:be,onDragEnd:ye,upperRenderer:Ye,bottomRenderer:Ke,displayMode:T,domId:tt,children:(0,u.jsxs)(l.Fragment,{children:[Ye(),W?w.default.createPortal((0,u.jsxs)("div",{className:"inline-group-editor-container no-drag",children:[(0,u.jsxs)("header",{children:[ze," ",(0,u.jsx)("button",{onClick:e.onCloseInlineEditor,children:"close"})]}),(0,u.jsx)(I.VisualNodeEditor,{...e.inlineGroupProps,className:"no-drag",ref:ae})]}),Q):(0,u.jsx)(x.ContextMenu,{className:(0,p.default)("ins-view-inner",Ae,`size-${re.size}`,{dark:ie}),onClick:_e,onDoubleClick:je,content:Xe(),style:et,children:(0,u.jsx)(x.Tooltip,{content:R.description,children:(0,u.jsxs)(l.Fragment,{children:[ue.icon?(0,u.jsx)(c.FontAwesomeIcon,{icon:ue.icon}):null," ",ze]})})}),Ke()]})})})}},53568:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStyleMenu=t.nodeStylePresetColors=void 0;const r=n(35250),a=n(50382),u=s(n(70079)),l=n(84472);t.nodeStylePresetColors=[{name:"Amethyst",color:"#9b5de5"},{name:"Magenta",color:"#f15bb5"},{name:"Yellow",color:"#fee440"},{name:"Capri",color:"#00bbf9"},{name:"Sea Green",color:"#00f5d4"},{name:"Orange",color:"#ff7f00"}];const c={size:"regular"};t.NodeStyleMenu=e=>{var n;const{onChange:o,style:i}=e,s=i||c,d=e.promptFn,p=u.default.useCallback(((e,t)=>{o({...s,[e]:t})}),[s,o]),f=u.default.useCallback((async()=>{const e=await d("Icon name? (Font Awesome conventions)","rocket"),t=e.includes(",")?e.split(","):e;p("icon",t)}),[d,p]),m=(0,u.useCallback)((async()=>{const e=await d("Enter a custom style (valid JSON representing a React CSS object)",s.cssOverride?JSON.stringify(s.cssOverride):"");try{const t=JSON.parse(e);p("cssOverride",t)}catch(t){console.error(t),(0,l.toastMsg)("Invalid object","danger")}}),[d,p,s.cssOverride]);return(0,r.jsxs)(u.default.Fragment,{children:[(0,r.jsxs)(a.MenuItem,{text:"Color",children:[t.nodeStylePresetColors.map((e=>(0,r.jsx)(a.MenuItem,{text:e.name,onClick:()=>p("color",e.color)},e.name))),(0,r.jsx)(a.MenuDivider,{}),(0,r.jsx)(a.MenuItem,{text:"Remove Color",onClick:()=>p("color",void 0)})]}),(0,r.jsxs)(a.MenuItem,{text:`Size (${null!==(n=s.size)&&void 0!==n?n:"regular"})`,children:[(0,r.jsx)(a.MenuItem,{text:"Small",onClick:()=>p("size","small")}),(0,r.jsx)(a.MenuItem,{text:"Regular",onClick:()=>p("size","regular")}),(0,r.jsx)(a.MenuItem,{text:"Large",onClick:()=>p("size","large")})]}),(0,r.jsxs)(a.MenuItem,{text:"Icon",children:[(0,r.jsx)(a.MenuItem,{text:"Choose Icon",onClick:f}),(0,r.jsx)(a.MenuItem,{text:"Remove Icon",onClick:()=>p("icon",void 0)})]}),(0,r.jsx)(a.MenuItem,{text:"Custom Styling",onClick:m})]})}},88593:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(53568),t)},83651:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86553),t)},53159:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calcInstancePosition=t.calcNodeWidth=t.calcNodeContent=void 0;const i=n(74762),s=o(n(6576)),r=n(86553),a=n(61888),u=n(30994);t.calcNodeContent=(e,t)=>{if(e.displayName)return e.displayName;if(t.customViewCode)try{const n=Object.entries(e.inputConfig).filter((e=>{let[,t]=e;return(0,i.isStaticInputPinConfig)(t)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o.value}}),{});return s.default.compile(t.customViewCode)({inputs:n}).trim()}catch(n){return console.error("Error with custom view",n),`Error in custom view [${t.id}]`}return t.id};t.calcNodeWidth=(e,n)=>{const o=(0,i.okeys)(n.inputs).length*r.MIN_WIDTH_PER_PIN,s=(0,t.calcNodeContent)(e,n),u=r.PIECE_CHAR_WIDTH;return(0,a.clamp)(s.length*u+2*r.PIECE_HORIZONTAL_PADDING,o,r.MAX_INSTANCE_WIDTH)};t.calcInstancePosition=(e,t,n)=>{const o=(0,u.getInstanceDomId)(e,t),i=document.getElementById(o);if(i){const{x:e,y:t,width:o,height:s}=i.getBoundingClientRect(),r=t+s/2;return{x:e+o/2-n.x,y:r-n.y}}return console.warn("Cannot find element to draw connection to",o),{x:99999,y:99999}}},17841:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutDebugger=t.LayoutDebuggerItem=t.PosDebugger=void 0;const i=n(70079),s=n(35250),r=n(74762),a=o(n(70079)),u=n(7047),l=e=>{let{pos:t}=e;return(0,s.jsxs)("span",{children:[t.x.toFixed(1),", ",t.y.toFixed(1)]})};t.PosDebugger=e=>(0,s.jsx)("span",{className:"pos-debugger",children:(0,s.jsx)(l,{pos:e.pos})});t.LayoutDebuggerItem=e=>{const{pos:n,viewPort:o,size:i,color:r}=e,a=o.zoom,u=n.x*a-o.pos.x*a,l=n.y*a-o.pos.y*a,c={transform:`translate(${u-n.x}px, ${l-n.y}px)`},d={transform:`scale(${o.zoom})`},p={transform:`translate(${n.x}px, ${n.y}px)`},f={width:`${i.width}px`,height:`${i.height}px`,backgroundColor:r};return(0,s.jsx)("div",{className:"layout-debugger",style:c,children:(0,s.jsxs)("span",{className:"drag-sim",style:p,children:[(0,s.jsx)(t.PosDebugger,{pos:n}),(0,s.jsx)("div",{className:"layout-debugger-zoom-wrapper",style:d,children:(0,s.jsx)("div",{className:"layout-debugger-inner",style:f})})]})})};const c=(()=>{try{return"true"===localStorage.getItem("pos-debugger")}catch(e){return!1}})();t.LayoutDebugger=e=>{const{extraDebug:n,vp:o,node:d,mousePos:p}=e;if(!c)return null;const f=n.map(((e,n)=>(0,i.createElement)(t.LayoutDebuggerItem,{...e,key:n}))),m=[...d.instances.map((e=>e.pos)),...(0,r.values)(d.inputsPosition),...(0,r.values)(d.outputsPosition)].map((e=>(0,s.jsx)(t.LayoutDebuggerItem,{pos:e,viewPort:o,size:{width:0,height:0},color:"red"}))),h=(0,u.logicalPosToRenderedPos)(p,o),v=(0,s.jsxs)("div",{className:"viewport-data",children:[(0,s.jsxs)("div",{children:["Pos: ",(0,s.jsx)(l,{pos:o.pos})]}),(0,s.jsxs)("div",{children:["Zoom: ",o.zoom.toFixed(2)," "]}),(0,s.jsxs)("div",{children:["Mouse (logical): ",(0,s.jsx)(l,{pos:p})]}),(0,s.jsxs)("div",{children:["Rendered (rendered): ",(0,s.jsx)(l,{pos:h})]})]});return(0,s.jsxs)(a.default.Fragment,{children:[v,f,m]})}},44338:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(17841),t)},38259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateInstancesWithSingleConstPinsMap=t.getLeafInstancesOfSelection=void 0;t.getLeafInstancesOfSelection=(e,t,n)=>e.reduce(((e,o)=>[...e,...n.filter((e=>e.to.insId===o.id)).map((e=>t.find((t=>t.id===e.from.insId)))).filter((e=>!!e))]),[]).filter((t=>1===n.filter((e=>e.from.insId===t.id||e.to.insId===t.id)).length&&!e.includes(t)));t.calculateInstancesWithSingleConstPinsMap=(e,t)=>{const{connections:n}=e;return n.filter((e=>t.has(e.from.insId))).reduce(((e,n)=>{const o=t.get(n.from.insId),i=n.to.insId,s=e.get(i)||new Map;return s.set(n.to.pinId,{val:o,insId:n.from.insId}),e.set(i,s),e}),new Map)}},37488:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeIoView=void 0;const a=n(35250),u=n(70079),l=s(n(70079)),c=n(74762),d=n(83234),p=r(n(26372)),f=n(50382),m=n(43490),h=n(66189),v=n(74762),g=n(30994),y=n(30653);t.NodeIoView=l.memo((function(e){const{viewPort:t,selected:n,pos:o,type:i,id:s,onDblClick:r,onRename:b,onDelete:I,onChangeInputMode:C,inputMode:x,onSelect:w,closest:_,onSetDescription:j,description:N,onMouseUp:O,onMouseDown:P,currentInsId:E}=e,{history:S,resetHistory:T,refreshHistory:D}=(0,h.useHistoryHelpers)(E,s,i),M=(0,m.usePrompt)(),k=l.useCallback((async()=>{const e=await M("Description?",N);j(i,s,e)}),[M,N,j,i,s]),R=l.useCallback((()=>{I&&I(i,s)}),[i,s,I]),A=l.useCallback((()=>{b&&b(i,s)}),[i,s,b]),V=l.useCallback((e=>{C&&C(s,e)}),[s,C]),L=l.useCallback((()=>[{text:`Current mode - ${x}`,onClick:c.noop},{text:"Make required",onClick:()=>V("required")},{text:"Make optional",onClick:()=>V("optional")},{text:"Make required-if-connected",onClick:()=>V("required-if-connected")},{text:"Set description",onClick:k},...e.onRename?[{text:"Rename",onClick:A}]:[],...e.onDelete?[{text:"Delete",onClick:R}]:[]]),[k,x,V,R,A,e.onDelete,e.onRename]),z=l.useCallback((t=>{r&&r(e.id,t)}),[r,e.id]),$=l.useCallback((()=>{w(s,i)}),[s,i,w]),H=l.useCallback((()=>(0,a.jsx)(f.Menu,{children:L().map(((e,t)=>(0,u.createElement)(f.MenuItem,{...e,key:t})))})),[L]),q="input"===i?(0,v.getInputName)(s):(0,c.getOutputName)(s),F=l.useCallback((e=>{O(s,i,e)}),[s,O,i]),G=l.useCallback((e=>{P(s,i,e)}),[s,P,i]),U=(0,y.useDarkMode)();return(0,a.jsx)(d.BaseNodeView,{className:(0,p.default)("node-io-view",i,{dark:U}),pos:o,onDragEnd:(n,o)=>{const r=e.pos,a=(o.x-r.x)/t.zoom,u=(o.y-r.y)/t.zoom,l=r.x+a,c=r.y+u;e.onDragEnd(i,s,n,{...o,x:l,y:c})},onDragStart:(t,n)=>{e.onDragStart(s,t,n)},onDragMove:(t,n)=>{e.onDragMove(i,s,t,{x:n.x,y:n.y})},viewPort:t,children:(0,a.jsx)(l.Fragment,{children:(0,a.jsx)(f.Tooltip,{content:(()=>{const t=(0,h.calcHistoryContent)(S),n=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:q})," (",i,")"," "]}),n,(0,a.jsx)("hr",{}),t]})})(),children:(0,a.jsx)(f.ContextMenu,{onMouseEnter:D,onMouseOut:T,onMouseUp:F,onMouseDown:G,"data-tip":"","data-html":!0,"data-for":s+e.currentInsId,className:(0,p.default)("node-io-view-inner",{closest:_,selected:n,dark:U}),id:(0,g.getPinDomId)({fullInsIdPath:(0,c.fullInsIdPath)(e.currentInsId,e.ancestorInsIds),pinId:s,pinType:i,isMain:!0}),onClick:$,onDoubleClick:z,content:H(),children:s})})})})}))},66005:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37488),t)},83782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcNodeIoWidth=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0,t.PIECE_HORIZONTAL_PADDING=15,t.PIECE_CHAR_WIDTH=9,t.MIN_WIDTH_PER_PIN=40;t.calcNodeIoWidth=e=>Math.max(t.MIN_WIDTH_PER_PIN,e.length*t.PIECE_CHAR_WIDTH+2*t.PIECE_HORIZONTAL_PADDING)},99942:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderVisualNode=t.layoutToInstances=void 0;const i=n(63521),s=n(74762),r=n(90794),a=o(n(53865)),u=n(83782),l=n(60190),c=n(53159),d=n(41032);t.layoutToInstances=(e,t)=>(0,a.default)(t,(t=>{(0,s.entries)(e.nodes).forEach((e=>{let[n,o]=e;if(n.startsWith("ins-")){const e=n.replace("ins-",""),i=t.instances.find((t=>t.id===e));i?i.pos=o.p:console.warn("WAT")}if(n.startsWith("node-input-")){const e=n.replace("node-input-","");t.inputsPosition[e]=o.p}if(n.startsWith("node-output-")){const e=n.replace("node-output-","");t.outputsPosition[e]=o.p}}))}));t.orderVisualNode=(e,n,o,a)=>{const{instances:p,connections:f}=e,m={...p.reduce(((e,t)=>{const o=(0,l.size)((0,c.calcNodeWidth)(t,(0,d.safelyGetNodeDef)(t,n)),i.NODE_HEIGHT);return{...e,[`ins-${t.id}`]:{p:t.pos,s:o}}}),{}),...(0,s.okeys)(e.inputsPosition).reduce(((t,n)=>({...t,[`node-input-${n}`]:{p:e.inputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{}),...(0,s.okeys)(e.outputsPosition).reduce(((t,n)=>({...t,[`node-output-${n}`]:{p:e.outputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{})},h=f.map((e=>[(0,s.isExternalConnectionNode)(e.from)?`node-input-${e.from.pinId}`:`ins-${e.from.insId}`,(0,s.isExternalConnectionNode)(e.to)?`node-output-${e.to.pinId}`:`ins-${e.to.insId}`])),v=(0,r.orderLayout)({nodes:m,edges:h},o,((n,o)=>{a&&a((0,t.layoutToInstances)(n,e),o)}));return(0,t.layoutToInstances)(v,e)}},90794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderLayout=void 0;const o=n(60190),i=400,s=e=>e.reduce(((e,t)=>{const n=(0,o.vSub)(t.p,(0,o.vec)(t.s.width/2,t.s.height/2));return{...e,[t.id]:{p:n,s:t.s}}}),{});t.orderLayout=(e,t,n)=>{let{nodes:r,edges:a}=e,u=Object.entries(r).map((e=>{let[t,n]=e;return{id:t,p:(0,o.vAdd)(n.p,(0,o.vec)(n.s.width/2,n.s.height/2)),f:(0,o.vec)(0,0),v:(0,o.vec)(0,0),m:1,s:n.s}})),l=0;for(;l.01);){let e=u;for(let t=0;t{let n=e.find((e=>e.id===t[0])),i=e.find((e=>e.id===t[1]));if(!n||!i)return void console.warn("weoops",t[0],t[1]);const s=(0,o.vec)(0,-200),r=(0,o.vSub)(n.p,i.p),a=(0,o.vSub)(s,r),u=1e3*(0,o.vLen)(a),l=(0,o.vMul)((0,o.vNorm)(a),.5*u),c=(0,o.vMul)((0,o.vNorm)(a),-.5*u);n.f=(0,o.vAdd)(n.f,l),i.f=(0,o.vAdd)(i.f,c)})),e=e.map((e=>(0,o.itrPhysics)(15,e))),e=e.map((e=>{const t=(0,o.vMul)(e.v,.5),n=(0,o.vLen)(t)>100?(0,o.vMul)((0,o.vNorm)(t),100):t;return{...e,v:n}})),u=e,n&&n({nodes:s(e),edges:a},l),l++}return{nodes:s(u),edges:a,itrs:l,timeout:l>=t,total:(0,o.totalEnergy)(u)}}},2036:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PinView=t.PIN_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=n(50382),d=n(18420),p=n(74762),f=n(30994),m=n(96233),h=n(66189),v=n(30653);t.PIN_HEIGHT=23;t.PinView=u.memo((function(e){const{selected:t,type:n,connected:o,optional:i,currentInsId:s,isClosestToMouse:r,id:g,onMouseDown:y,onMouseUp:b}=e,{history:I,resetHistory:C,refreshHistory:x}=(0,h.useHistoryHelpers)(s,g,n),w=(0,v.useDarkMode)(),_="input"===n?(0,p.getInputName)(g):(0,p.getOutputName)(g),j="input"===e.type&&(0,d.isDefined)(e.constValue)?e.constValue:void 0,N=u.useCallback((e=>{0===e.button&&y(g,n,e)}),[g,n,y]),O=u.useCallback((e=>{0===e.button&&b(g,n,e)}),[g,n,b]);return(0,a.jsxs)("div",{className:(()=>{if("input"===e.type){const{isSticky:s,constValue:a}=e;return(0,l.default)("pin",{sticky:s,selected:t,closest:r,optional:i,connected:o,"const-value":(0,d.isDefined)(a),"env-value":(0,d.isDefined)(a)&&(0,p.isEnvValue)(a),minimized:e.minimized,dark:w},n)}return(0,l.default)("pin",{selected:t,connected:o,closest:r,optional:i,minimized:e.minimized,"error-pin":g===p.ERROR_PIN_ID,dark:w},n)})(),"data-pin-id":g,children:[(0,a.jsx)(c.Tooltip,{className:"pin-info-tooltip",content:(()=>{const t=(0,h.calcHistoryContent)(I,"input"===n?e.queuedValues:void 0),o=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:_})," (",n,")"," "]}),o,(0,a.jsx)("hr",{}),(0,d.isDefined)(j)?(0,a.jsxs)("div",{children:["Static value:"," ",(0,a.jsx)("strong",{children:(0,m.valuePreview)(j).substring(0,200)})]}):t]})})(),children:(0,a.jsxs)(c.ContextMenu,{onMouseEnter:x,onMouseOut:C,onMouseDown:N,onMouseUp:O,"data-tip":"","data-html":!0,"data-for":g+e.currentInsId,id:(0,f.getPinDomId)({fullInsIdPath:(0,p.fullInsIdPath)(e.currentInsId,e.ancestorsInsIds),pinId:g,pinType:n,isMain:!1}),onDoubleClick:t=>e.onDoubleClick&&e.onDoubleClick(g,t),className:(0,l.default)("pin-inner",{dark:w}),onClick:t=>{const{onShiftClick:o,onClick:i,id:s}=e;t.shiftKey&&o?o(s,t):i(s,n,t)},content:(()=>{const t=(0,a.jsx)(c.MenuItem,{onClick:()=>e.onInspect(e.currentInsId,{id:e.id,type:e.type}),text:"Inspect"});if("input"===e.type){const{onConvertConstToEnv:n}=e;return(0,d.isDefined)(j)?(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onDetachConstValue(e.id),text:"Detach value"}),(0,a.jsx)(c.MenuItem,{onClick:()=>e.onCopyConstValue(e.id),text:"Copy value"}),(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null,n?(0,a.jsx)(c.MenuItem,{onClick:()=>n(e.id),text:"Convert to Env Var"}):null]}):(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onToggleSticky(e.id),text:"Toggle sticky (square means sticky)"}),t,(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null]})}return(0,a.jsx)(c.Menu,{children:t})})(),children:[_," ",(0,d.isDefined)(j)?(0,a.jsxs)(u.Fragment,{children:[":",(0,a.jsx)("span",{className:"value",children:(0,d.toString)(j)})]}):null,"input"===e.type&&e.isSticky?(0,a.jsx)("span",{className:"suffix",children:"s"}):null,"input"===e.type&&e.queueSize?(0,a.jsxs)("span",{className:"suffix",children:[e.queueSize," in Q"]}):null]})}),(0,a.jsx)("div",{className:"wire"})]})}))},66189:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHistoryHelpers=t.calcHistoryContent=void 0;const i=n(35250),s=n(96233),r=o(n(70079)),a=n(70079),u=n(98158);t.calcHistoryContent=(e,t)=>{if(e){const{total:n,lastSamples:o}=e,a=(0,i.jsxs)("strong",{children:["Activated ",n," times this session"]}),u=o.length>0?(0,i.jsxs)("div",{children:["Last value:"," ",(0,i.jsx)("strong",{children:(0,s.valuePreview)(o[0].val).substring(0,200)}),(0,i.jsx)("br",{}),(0,i.jsx)("em",{children:"Inspect instance for the full value"})]}):"",l=t?(0,i.jsx)(r.default.Fragment,{children:(0,i.jsxs)("div",{children:["Queued values: ",(0,i.jsx)("strong",{children:t})]})}):"";return(0,i.jsxs)(r.default.Fragment,{children:[a,u,l]})}return"Loading session data.."};t.useHistoryHelpers=(e,t,n)=>{const o=(0,a.useRef)(),{onRequestHistory:i}=(0,u.useDebuggerContext)(),[s,l]=(0,a.useState)();return{history:s,refreshHistory:(0,a.useCallback)((()=>{clearInterval(o.current),i(e,t,n).then((e=>{l(e)})),o.current=setInterval((()=>{i(e,t,n).then((e=>{l(e)}))}),500)}),[e,i,t,n]),resetHistory:r.default.useCallback((()=>{clearInterval(o.current),l(void 0)}),[])}}},89440:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAddMenu=void 0;const r=n(35250),a=s(n(70079)),u=n(74762),l=n(50382),c=n(70457),d=n(9958),p=n(86125),f=c.Select.ofType(),m=e=>{switch(e.type){case"node":return`${e.node.id}`;case"value":return"Add inline value or function";case"import":return`Import ${e.importableNode.node.id} from ${e.importableNode.module}`}},h=(e,t)=>{let{handleClick:n,modifiers:o,query:i}=t;if(!o.matchesPredicate)return null;const s=m(e);return"value"===e.type?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(l.MenuDivider,{}),(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))]}):(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))},v=(e,t,n,o)=>{const i=m(t).toLocaleLowerCase(),s=e.toLowerCase();return o?i===s:i.includes(s)};t.QuickAddMenu=e=>{const{resolvedDependencies:t,targetNode:n}=e,o={left:e.pos.x,top:e.pos.y},{onRequestImportables:i}=(0,p.useDependenciesContext)(),[s,c]=a.useState();a.useEffect((()=>{i().then((e=>c(e.importables)))}),[i]);const d=(0,u.values)({...t,[n.id]:n}),m=d.map((e=>({type:"node",node:e}))),g=new Set(d.map((e=>e.id))),y=s?s.filter((e=>!g.has(e.node.id))).map((e=>({type:"import",importableNode:e}))):[],b=m.concat(y).concat({type:"value"});return(0,r.jsx)("div",{className:"quick-add-menu",style:o,children:(0,r.jsx)(f,{className:"quick-add-nodes-select",items:b,itemPredicate:v,itemRenderer:h,inputProps:{className:"quick-add-input"},noResults:(0,r.jsx)(l.MenuItem,{disabled:!0,text:"No results."}),onItemSelect:t=>e.onAdd(t),popoverProps:{isOpen:!0,onClose:()=>e.onClose()}})})}},71033:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89440),t)},73470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimePlayer=void 0;const o=n(74762),i=n(64955),s=(0,o.debugLogger)("runtime-player");t.createRuntimePlayer=()=>{let e=0,t=[];let n=!1,r=Date.now(),a=e;const u=()=>requestAnimationFrame((()=>{const l=Date.now();a=e,e+=l-r,r=l,((e,n)=>{const r=t;t=[],r.length&&s(`Playing ${r.length} events from`,e,n),r.forEach((e=>{s("Playing event",e),(0,i.playEvent)(e),e.insId===o.ROOT_INS_ID&&e.type===o.DebuggerEventType.PROCESSING_CHANGE&&!1===e.val&&(s("Main instance is done processing, clearing runtime UI",e),c())}))})(a,e),n&&u()})),l=()=>{n=!1},c=()=>{document.querySelectorAll("[data-runtime]").forEach((e=>{e.removeAttribute("data-runtime")})),document.querySelectorAll("[data-runtime-queue]").forEach((e=>{e.removeAttribute("data-runtime-queue")})),t=[]};return{stop:l,start:function(t){void 0===t&&(t=0),n=!0,e=t,r=Date.now(),u()},addEvents:e=>{t.push(...e)},destroy:()=>{l(),c()},clear:c,status:()=>({running:n,currDt:e,lastDt:a,queue:t,last:r})}}},64955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playEvent=t.cancelTimers=void 0;const o=n(74762),i=n(30994),s=5e3,r=(0,o.debugLogger)("runtime-player:play-event"),a=(e,t)=>e.type===o.DebuggerEventType.INPUT_CHANGE||e.type===o.DebuggerEventType.OUTPUT_CHANGE?`${(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds)}.${e.pinId}`:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds);t.cancelTimers=new Map;t.playEvent=e=>{switch(e.type){case o.DebuggerEventType.INPUT_CHANGE:case o.DebuggerEventType.OUTPUT_CHANGE:{const{pinId:n,insId:u,ancestorsInsIds:l}=e,c=e.type===o.DebuggerEventType.INPUT_CHANGE?"input":"output",d=[(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!0})];u!==o.ROOT_INS_ID&&d.push((0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!1})),d.forEach(((i,l)=>{const c=a(e);clearTimeout(t.cancelTimers.get(c));const d=document.getElementById(i),p=`${u}.${n}`,f=e.type===o.DebuggerEventType.OUTPUT_CHANGE?document.querySelectorAll(`[data-from-id="${p}"]`):[];if(d){clearTimeout(t.cancelTimers.get(c)),d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),setTimeout((()=>{d.setAttribute("data-runtime","active"),f.forEach((e=>{e.setAttribute("data-runtime","active")}))}),0);const n=setTimeout((()=>{d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),t.cancelTimers.delete(c)}),s);t.cancelTimers.set(a(e),n)}else console.warn(`No DOM element with Id [${i}] found to play event`),r(`No DOM element with Id [${i}] found to play event`,e)}));break}case o.DebuggerEventType.PROCESSING_CHANGE:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(l)if(!0===e.val)l.setAttribute("data-runtime","processing"),clearTimeout(t.cancelTimers.get(u));else{l.removeAttribute("data-runtime"),setTimeout((()=>{"error"!==l.getAttribute("data-runtime")&&l.setAttribute("data-runtime","done")}),0);const e=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,e)}else r(`No DOM element with Id [${n}] found to play event`,e)}));break}case o.DebuggerEventType.ERROR:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(!l)return void r(`No DOM element with Id [${n}] found to play event`,e);clearTimeout(t.cancelTimers.get(u)),l.removeAttribute("data-runtime"),setTimeout((()=>{l.setAttribute("data-runtime","error")}));const c=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,c)}));const c={...e,type:o.DebuggerEventType.OUTPUT_CHANGE,pinId:o.ERROR_PIN_ID};(0,t.playEvent)(c);break}case o.DebuggerEventType.INPUTS_STATE_CHANGE:(0,o.entries)(e.val).forEach((t=>{let[n,s]=t;const{insId:a,ancestorsInsIds:u}=e,l=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(a,u),pinId:n,pinType:"input",isMain:!1}),c=document.getElementById(l);c?s>0?c.setAttribute("data-runtime-queue",`${s}`):c.removeAttribute("data-runtime-queue"):r(`No DOM element with Id [${l}] found to play event`,e)}))}}},25804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounce=void 0;const o=n(70079);t.useDebounce=function(e,t){const[n,i]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}},7047:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.handleChangeNodeInputType=t.handleIoPinRename=t.handleInstanceDrag=t.getInstancesInRect=t.isJsxValue=t.getMiddleOfViewPort=t.fitViewPortToNode=t.centerBoardPosOnTarget=t.renderedPosToLogicalPos=t.logicalPosToRenderedPos=t.getEffectiveNodeDimensions=t.calcNodesPositions=t.calcSelectionBoxArea=t.animateViewPort=t.easeInOutNum=t.easeInOutPos=t.easeInOutQuad=t.center=t.distance=t.clamp=t.domToViewPort=t.roundNumber=t.createNewNodeInstance=t.createNewInlineNodeInstance=t.parseInputOutputTypes=t.parsePromptValue=t.getSelectionBoxRect=t.findClosestPin=t.changePinConfig=t.getInstancePinConfig=t.emptyList=t.emptyObj=void 0;const r=s(n(53865)),a=n(30721),u=n(63521),l=n(74762),c=n(18243),d=n(74762),p=n(53159),f=n(83782),m=n(60190),h=n(38259),v=n(83651),g=n(41032);t.emptyObj={},t.emptyList=[],t.getInstancePinConfig=function(e,n,o){var i;const s=e.instances.find((e=>e.id===n));if(!s)throw new Error(`Instance ${n} not found`);return null!==(i=(s.inputConfig||t.emptyObj)[o])&&void 0!==i?i:(0,l.queueInputPinConfig)()};t.changePinConfig=(e,t,n,o)=>r.produce(e,(e=>{var i;const{instances:s}=e,r=s.find((e=>e.id===t));if(!r)throw new Error("blah");const a=null!==(i=r.inputConfig)&&void 0!==i?i:{};a[n]=o,e.instances=s.map((e=>e===r?{...r,inputConfig:a}:e))}));t.findClosestPin=(e,t,n,o,i,s,r)=>{const a=(0,l.nodeInstance)(e.id,e.id),u=(0,d.okeys)(e.inputs).map((e=>({id:e,type:"input",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),p=(0,d.okeys)(e.outputs).map((e=>({id:e,type:"output",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),f=[...u,...e.instances.reduce(((n,a)=>{const u=(0,g.safelyGetNodeDef)(a,t),d=(0,v.getVisibleInputs)(a,u,e.connections),p=(0,v.getVisibleOutputs)(a,u,e.connections);return[...n,...d.map((e=>({ins:a,type:"input",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!1}),id:e}))),...p.map((e=>({ins:a,type:"output",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!1}),id:e})))]}),[]),...p];let m={dis:1e5,item:f[0]};return f.forEach((e=>{const t=e.pos.x-n.x,o=e.pos.y-n.y,i=Math.sqrt(t*t+o*o);i{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x,t.x)-n,h:Math.max(e.y,t.y)-o}};t.parsePromptValue=e=>{if(null===e)return;const t=parseInt(e,10);let n=e;return t.toString()!=e||isNaN(t)||(n=t),n};t.parseInputOutputTypes=e=>{const[,t,n]=e.match(/node\((.+)\|(.+)\)/)||[],o=(0,d.entries)(JSON.parse(t)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]})),i=(0,d.entries)(JSON.parse(n)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]}));return{inputs:(0,d.fromEntries)(o),outputs:(0,d.fromEntries)(i)}};t.createNewInlineNodeInstance=function(e,t,n){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const o=(0,l.inlineNodeInstance)(`${e.id}-${(0,d.randomInt)(999)}`,e,{},{x:0,y:0}),i=(0,p.calcNodeWidth)(o,e),{x:s,y:r}=n,a={x:s-i/2,y:r+t};return{...o,pos:a}};t.createNewNodeInstance=function(e,t,n,o){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const i="string"==typeof e?(0,g.safelyGetNodeDef)(e,o):e;if(!i)throw new Error(`${e} node not found in resolvedNodes`);const s=(0,d.entries)(i.inputs).reduce(((e,t)=>{let[n,o]=t;return o.defaultValue&&(e[n]=(0,l.staticInputPinConfig)(o.defaultValue)),e}),{}),r=(0,l.nodeInstance)((0,a.createId)(),i.id,s,{x:0,y:0}),c=(0,p.calcNodeWidth)(r,i),{x:f,y:m}=n,h={x:f-c/2,y:m+t};return{...r,pos:h}};t.roundNumber=e=>Math.round(100*e)/100;t.domToViewPort=(e,n,o)=>({x:(0,t.roundNumber)(n.pos.x+e.x/n.zoom/o.zoom),y:(0,t.roundNumber)(n.pos.y+e.y/n.zoom/o.zoom)});t.clamp=(e,t,n)=>Math.max(e,Math.min(t,n));t.distance=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)};t.center=(e,t,n)=>{let{zoom:o}=n;const i=e.x+e.w/2,s=e.y+e.h/2,{w:r,h:a}=t;return{x:i-r/o/2,y:s-a/o/2}};t.easeInOutQuad=e=>e<.5?2*e*e:(4-2*e)*e-1;t.easeInOutPos=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i),a=(0,t.easeInOutQuad)(r),u=n.x-e.x,l=n.y-e.y;return{x:e.x+u*a,y:e.y+l*a}};t.easeInOutNum=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i);return e+(n-e)*(0,t.easeInOutQuad)(r)};t.animateViewPort=(e,n,o,i)=>{const s=(0,t.distance)(e.pos,n.pos),r=Date.now(),a=o;if(0===s)return void i(e);const u=()=>{const o=Date.now(),s=(0,t.easeInOutPos)(e.pos,n.pos,r,a,o),l=(0,t.easeInOutNum)(e.zoom,n.zoom,r,a,o);o-r{const n=(0,t.getSelectionBoxRect)(e.from,e.to);return n.h*n.w};const y=(e,t,n,o)=>({left:n.x,right:n.x+e,top:n.y,bottom:n.y+t,tag:o,center:(0,l.calcCenter)({w:e,h:t,...n})});t.calcNodesPositions=(e,t)=>[...e.instances.map((e=>{const n=(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,t)),o=u.NODE_HEIGHT;return y(n,o,e.pos,e.id)})),...(0,d.okeys)(e.inputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.inputsPosition[t]||{x:0,y:0};return y(n,o,i,"input_"+t)})),...(0,d.okeys)(e.outputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.outputsPosition[t]||{x:0,y:0};return y(n,o,i,"output"+t)}))];t.getEffectiveNodeDimensions=(e,n)=>{const o=(0,t.calcNodesPositions)(e,n),i=o[0]||{left:0,right:0,top:0,bottom:0},s=o.reduce(((e,t)=>t.leftt.right>e?t.right:e),i.right),a=o.reduce(((e,t)=>t.topt.bottom>e?t.bottom:e),i.bottom)-a,d={x:s,y:a};return{size:{width:u,height:c},pos:d,center:(0,l.calcCenter)({w:u,h:c,...d})}};t.logicalPosToRenderedPos=(e,t)=>{const n=(0,m.vSub)(e,t.pos);return(0,m.vMul)(n,t.zoom)};t.renderedPosToLogicalPos=(e,t)=>{const n=(0,m.vDiv)(e,t.zoom);return(0,m.vAdd)(t.pos,n)};t.centerBoardPosOnTarget=(e,n,o,i)=>{const s=(0,t.logicalPosToRenderedPos)(e,i),r=(0,t.renderedPosToLogicalPos)(s,{...i,zoom:o}),a=Math.max(e.x,r.x)-Math.min(e.x,r.x),u=Math.max(e.y,r.y)-Math.min(e.y,r.y);return{x:o>i.zoom?i.pos.x+a:i.pos.x-a,y:o>i.zoom?i.pos.y+u:i.pos.y-u}};t.fitViewPortToNode=function(e,n,o,i){void 0===i&&(i=[20,150]);const{size:s,center:r}=(0,t.getEffectiveNodeDimensions)(e,n),a=i[0],u=i[1],l=s.width+a,c=s.height+u,d=o.width/l,p=o.height/c,f=Math.min(d,p)/1.15,m=(0,t.clamp)(.3,1.2,f);return{zoom:m,pos:{x:r.x-o.width/2/m,y:r.y-o.height/2/m+20}}};t.getMiddleOfViewPort=(e,n)=>{const o={x:n.width/2,y:n.height/2};return(0,t.renderedPosToLogicalPos)(o,e)};t.isJsxValue=e=>{const t=e=>(0,d.isDefined)(e.ref)&&(0,d.isDefined)(e.type)&&(0,d.isDefined)(e.props);try{const n=JSON.parse(e);return t(n)||Array.isArray(n)&&t(n[0])}catch(n){return!1}};t.getInstancesInRect=(e,n,o,i,s,r,a)=>{const{from:c,to:d}=e,f=(0,t.getSelectionBoxRect)(c,d);return s.filter((e=>{const{pos:t}=e,i={...t,w:(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,n))*o.zoom*a.zoom,h:u.NODE_HEIGHT*o.zoom*a.zoom};return(0,l.intersectRect)(f,i)||(0,l.intersectRect)(i,f)})).map((e=>e.id))};t.handleInstanceDrag=(e,t,n,o,i,s)=>{o.preventDefault(),o.stopPropagation();const a=(0,m.vSub)(n,t.pos);let u;const l=r.produce(e,(e=>{const r=e.instances.find((e=>e.id===t.id));if(!r)throw new Error("impossible state dragging instance that does not exist");!o.shiftKey&&s&&(u=[s]);const l=e.instances.filter((e=>i.includes(e.id)&&e!==r)),c=[r,...l],d=(0,h.getLeafInstancesOfSelection)(c,e.instances,e.connections);[...l,...d].forEach((e=>{e.pos=(0,m.vAdd)(e.pos,a)})),r.pos=n,!o.shiftKey&&s&&(u=[s])}));return{newValue:l,newSelected:u}};t.handleIoPinRename=(e,t,n,o)=>r.produce(e,(e=>{"input"===t?(e.inputs[o]=e.inputs[n],e.inputsPosition[o]=e.inputsPosition[n],delete e.inputs[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===n?{...e,from:{...e.from,pinId:o}}:e))):(e.outputs[o]=e.outputs[n],e.outputsPosition[o]=e.outputsPosition[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===n?{...e,to:{...e.to,pinId:o}}:e)),e.completionOutputs=(e.completionOutputs||[]).map((e=>e.split("+").map((e=>e===n?o:n)).join("+"))),delete e.outputs[n])}));t.handleChangeNodeInputType=(e,t,n)=>r.produce(e,(e=>{const o=e.inputs[t];if(!o)throw new Error("Wat");o.mode=n}))},42403:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorClient=void 0;const i=n(74762),s=o(n(18706)),r=n(32048),a=n(31758),u=(0,i.debugLogger)("remote-debugger:editor-client");t.createEditorClient=(e,t)=>{const n=new URL(e),o=(0,r.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/editor`,timeout:3e4});return o.emit("join-room-editor",t),{emitChange:e=>{o.emit(a.DebuggerServerEventType.CHANGE_EVENT_NAME,e)},emitBreakpointsChange:e=>{o.emit(a.DebuggerServerEventType.UPDATE_BREAKPOINTS,e)},interceptInput:e=>{o.emit(a.DebuggerServerEventType.INPUT_VALUE_OVERRIDE,e)},interceptOutput:e=>{o.emit(a.DebuggerServerEventType.OUTPUT_VALUE_OVERRIDE,e)},onRuntimeReady:e=>(o.on(a.DebuggerServerEventType.RUNTIME_READY,e),()=>o.off(a.DebuggerServerEventType.RUNTIME_READY,e)),onChangeAwk:e=>(o.on(a.DebuggerServerEventType.CHANGE_AWK,e),()=>o.off(a.DebuggerServerEventType.CHANGE_AWK,e)),onChangeError:e=>(o.on(a.DebuggerServerEventType.CHANGE_ERROR,e),()=>o.off(a.DebuggerServerEventType.CHANGE_ERROR,e)),onIsAlive:e=>(o.on(a.DebuggerServerEventType.IS_ALIVE,e),()=>o.off(a.DebuggerServerEventType.IS_ALIVE,e)),emitInputValue:(e,t)=>{u(`Emitting push input value to ${e} %o`,t),o.emit(a.DebuggerServerEventType.PUSH_INPUT_VALUE,{pinId:e,value:t})},destroy:()=>{o.disconnect(),(0,a.enumToArray)(a.DebuggerServerEventType).forEach((e=>o.off(e)))},onDisconnect:e=>(o.on("disconnect",e),()=>o.off("disconnect",e)),debugInfo:()=>`Remote debugger for ${e}`,onBatchedEvents:e=>(o.on(a.DebuggerServerEventType.EVENTS_BATCH,e),()=>o.off(a.DebuggerServerEventType.EVENTS_BATCH,e)),requestState:()=>s.default.get(`${e}/state`).then((e=>e.data.state)),getHistory:n=>s.default.get(`${e}/history`,{params:{insId:n.insId,pinId:n.pinId,limit:n.limit,executionId:t}}).then((e=>e.data)),clearHistory:()=>s.default.delete(`${e}/history`).then((()=>{})),triggerNode:(t,n)=>s.default.post(`${e}/trigger`,{nodeId:t,inputs:n}).then((e=>e.data))}}},58066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeData=void 0;const o=n(74762),i=n(36783),s=(0,o.debugLogger)("remote-debugger:normalize-data");t.normalizeData=e=>{if(e instanceof Error)return(0,i.serializeError)(e);if("object"==typeof e&&null!==e){e={...e};const t=new WeakSet,n=e=>{if("bigint"==typeof e)return e.toString();if("object"!=typeof e||Array.isArray(e))return e;if(null===e)return e;if(t.has(e))return"[Circular]";try{t.add(e)}catch(o){s("Error adding to WeakSet","data:",e,"type:",typeof e,"error:",o)}if(Array.isArray(e))return e.map(n);if("object"==typeof e){const t={};for(const o in e)t[o]=n(e[o]);return t}return e};return n(e)}return e}},39641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimeClient=t.DEFAULT_DT_SCALE=void 0;const o=n(74762),i=n(32048),s=n(31758),r=n(58066),a=(0,o.debugLogger)("remote-debugger:runtime-client");t.DEFAULT_DT_SCALE=1;t.createRuntimeClient=(e,t)=>{const n=new URL(e),u=(0,i.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/runtime`,timeout:1e3,reconnectionAttempts:3});u.emit("join-room-runtime",t),u.on("connection",(e=>{e.join(t)}));let l=new Set;u.on(s.DebuggerServerEventType.UPDATE_BREAKPOINTS,(e=>{l=new Set(e)}));const c=(0,o.cappedArrayDebounce)((e=>{a(`Emitting debounced batched events - ${e.length}`),u.emit(s.DebuggerServerEventType.EVENTS_BATCH,e)}),100,200);return{onChange:e=>(u.on(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e),()=>u.off(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e)),onInput:e=>(u.on(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e),()=>u.off(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e)),emitEvent:e=>{a(`Emitting event ${e.type} change event of ${e.insId}`),e.val=(0,r.normalizeData)(e.val),c.addItem({...e,time:Date.now()})},emitRuntimeReady:()=>{u.emit(s.DebuggerServerEventType.RUNTIME_READY,{})},emitChangeAwk:()=>{u.emit(s.DebuggerServerEventType.CHANGE_AWK,{})},emitChangeError:e=>{u.emit(s.DebuggerServerEventType.CHANGE_ERROR,{error:e})},emitIsAlive:e=>{u.emit(s.DebuggerServerEventType.IS_ALIVE,{time:e})},destroy:async()=>{c.pendingItems()&&(c.flush(),await(0,o.delay)(100)),(0,s.enumToArray)(s.DebuggerServerEventType).forEach((e=>u.off(e))),u.disconnect()},onDisconnect:e=>(u.on("disconnect",e),()=>u.off("disconnect",e)),waitForConnection:()=>new Promise(((e,t)=>{u.connected?e():(u.on("connect_error",(e=>{t(`Socket connect error: ${e}`)})),u.on("connect",(()=>{e()})))}))}}},31758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerServerEventType=t.enumToArray=t.isNumber=t.isSimpleType=t.valuePreview=t.toString=void 0;const o=n(36783);t.toString=e=>{if("object"===typeof e){if(e instanceof Error)return JSON.stringify((0,o.serializeError)(e));try{return JSON.stringify(e).substr(0,250)}catch(t){return"Object (cannot stringify)"}}return`${e}`.substr(0,250)};t.valuePreview=e=>(0,t.toString)(e).substr(0,100);t.isSimpleType=e=>["number","string","boolean"].includes(typeof e);t.isNumber=e=>!1===isNaN(Number(e)),t.enumToArray=function(e){return Object.keys(e).filter(t.isNumber).map((t=>e[t]))},function(e){e.RUNTIME_READY="runtime-ready",e.CHANGE_EVENT_NAME="change",e.PUSH_INPUT_VALUE="push-input-value",e.CHANGE_AWK="live-change-awk",e.CHANGE_ERROR="live-change-error",e.IS_ALIVE="is-alive",e.UPDATE_BREAKPOINTS="update-breakpoints",e.INPUT_VALUE_OVERRIDE="input-value-override",e.OUTPUT_VALUE_OVERRIDE="output-value-override",e.INPUT_VALUE_CHANGE="input-value-changed",e.OUTPUT_VALUE_CHANGE="output-value-changed",e.PROCESSING_CHANGE="processing-changed",e.INPUTS_STATE_CHANGE="inputs-state-changed",e.NODE_ERROR="node-error",e.EVENTS_BATCH="events-batch"}(t.DebuggerServerEventType||(t.DebuggerServerEventType={}))},96233:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31758),t),i(n(42403),t),i(n(39641),t)},43920:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Equals=t.EqualsBoolean=t.Throttle=t.ThrottleError=t.Debounce=t.Interval=t.Delay=t.Switch4=t.Switch2=t.Switch3=t.EmitOnTrigger=t.BooleanSplit=t.Subscribe=t.Publish=t.RoundRobin4=t.RoundRobin2=t.RoundRobin3=t.LimitTimes=void 0;const o=n(11253),i="Control Flow";t.LimitTimes={id:"Limit Times",namespace:i,description:"Item will be emitted until the limit is reached",inputs:{item:{mode:"required",description:"The item to emit"},times:{mode:"required",description:"The number of times to emit the item"},reset:{mode:"optional",description:"Reset the counter"}},outputs:{ok:{}},reactiveInputs:["item","reset"],completionOutputs:[],run:function(e,t,n){const{state:o}=n,{item:i,times:s,reset:r}=e,{ok:a}=t;if(void 0!==r)return void o.set("val",0);let u=o.get("val")||0;u++,o.set("val",u),u>=s?n.onError(new Error(`Limit of ${s} reached`)):a.next(i)}},t.RoundRobin3={id:"Round Robin 3",namespace:i,description:"Item will be emitted to one of the three outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r}=t,a=o.get("curr")||0,u=(a+1)%3;[i,s,r][a].next(e.item),o.set("curr",u)}},t.RoundRobin2={namespace:i,id:"Round Robin 2",description:"Item will be emitted to one of the 2 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s}=t,r=o.get("curr")||0,a=(r+1)%2;[i,s][r].next(e.item),o.set("curr",a)}},t.RoundRobin4={id:"Round Robin 4",namespace:i,description:"Item will be emitted to one of the 4 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves to "r4"\'s turn.'},r4:{description:'The fourth output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r,r4:a}=t,u=o.get("curr")||0,l=(u+1)%4;[i,s,r,a][u].next(e.item),o.set("curr",l)}},t.Publish={id:"Publish",namespace:i,description:"Publishes a value by a key to all listeners in the current flow. Use 'Subscribe' to listen to events.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},value:{mode:"required"}},outputs:{},run:function(e,t,n){const i=`${n.ancestorsInsIds}__${e.key}`;o.publish(i,e.value)}},t.Subscribe={id:"Subscribe",namespace:i,description:"Subscribes to a value published by a key. Use 'Publish' to publish values.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},initial:{mode:"required-if-connected",description:"If passed will be published has the first value"}},completionOutputs:[],outputs:{value:{description:"The value published by the key"}},run:function(e,t,n){const{value:i}=t,s=`${n.ancestorsInsIds}__${e.key}`,r=o.subscribe(s,((e,t)=>{i.next(t)}));void 0!==e.initial&&i.next(e.initial),n.onCleanup((()=>{o.unsubscribe(r)}))}},t.BooleanSplit={namespace:i,id:"Boolean Split",description:"Splits a boolean value into two outputs",inputs:{value:{mode:"required",description:"Boolean value"},trueValue:{mode:"required-if-connected",description:"Value to emit if the input is true. Defaults to true"},falseValue:{mode:"required-if-connected",description:"Value to emit if the input is false. Defaults to false"}},outputs:{true:{description:"The value is true"},false:{description:"The value is false"}},run:function(e,t){const{true:n,false:o}=t,{value:i,trueValue:s,falseValue:r}=e;i?n.next(null==s||s):o.next(null!=r&&r)}},t.EmitOnTrigger={namespace:i,id:"Emit on Trigger",description:"Emits the value when the trigger input receives any value",inputs:{value:{mode:"required",description:"The value to emit"},trigger:{mode:"required",description:"The trigger to emit the value"}},outputs:{result:{description:"The value emitted"}},run:function(e,t){const{result:n}=t,{value:o,trigger:i}=e;void 0!==i&&n.next(o)}},t.Switch3={namespace:i,id:"Switch 3",description:"Switches between 3 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,default:s,outputValue:r}=t,{value:a,firstCase:u,secondCase:l,thirdCase:c}=e;a===u?n.next(null!=r?r:a):a===l?o.next(null!=r?r:a):a===c?i.next(null!=r?r:a):s.next(null!=r?r:a)}},t.Switch2={id:"Switch 2",description:"Switches between 2 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,default:i,outputValue:s}=t,{value:r,firstCase:a,secondCase:u}=e;r===a?n.next(null!=s?s:r):r===u?o.next(null!=s?s:r):i.next(null!=s?s:r)}},t.Switch4={id:"Switch 4",description:"Switches between 4 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},fourthCase:{mode:"required",description:"The value to switch on for the fourth output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},fourth:{description:"The value emitted if the input value is equal to the fourth case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,fourth:s,default:r,outputValue:a}=t,{value:u,firstCase:l,secondCase:c,thirdCase:d,fourthCase:p}=e;u===l?n.next(null!=a?a:u):u===c?o.next(null!=a?a:u):u===d?i.next(null!=a?a:u):u===p?s.next(null!=a?a:u):r.next(null!=a?a:u)}},t.Delay={id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:i,description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:async(e,t)=>{let{value:n,delay:o}=e,{delayedValue:i}=t;await new Promise((e=>setTimeout(e,o))),i.next(n)}},t.Interval={id:"Interval",namespace:i,defaultStyle:{icon:"fa-clock"},description:"Emits a value every interval",inputs:{value:{description:"Value to emit"},interval:{description:"Interval in milliseconds"}},reactiveInputs:["value","interval"],outputs:{value:{description:"Emitted value"}},completionOutputs:[],run:(e,t,n)=>{n.state.get("timer")&&clearInterval(n.state.get("timer"));const o=setInterval((()=>{t.value.next(e.value)}),e.interval);n.state.set("timer",o),n.onCleanup((()=>{clearInterval(o)}))}},t.Debounce={id:"Debounce",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be debounced"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The debounced value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the last value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:s}=t,r=n.state.get("timer");r&&clearTimeout(r);const a=setTimeout((()=>{s.next(o)}),i);n.state.set("timer",a),n.onCleanup((()=>{clearTimeout(r)}))}};class s extends Error{constructor(e){super("Throttle: Value dropped"),this.value=e}}t.ThrottleError=s,t.Throttle={id:"Throttle",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be throttled"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The throttled value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the first value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:r}=t;if(n.state.get("timer"))n.onError(new s(o));else{r.next(o);const e=setTimeout((()=>{n.state.set("timer",null)}),i);n.state.set("timer",e)}}},t.EqualsBoolean={id:"Equals (Bool)",defaultStyle:{icon:"fa-equals"},namespace:i,description:"Emits true if two values are equal (=== equality). Otherwise emits false.",inputs:{a:{description:"First value"},b:{description:"Second value"}},outputs:{result:{description:"true if a is equal to b"}},run:(e,t)=>{let{a:n,b:o}=e,{result:i}=t;return i.next(n===o)}},t.Equals={id:"Equals",namespace:i,description:'Emits the value of "a" to output "true" if "a" is equal to "b". Otherwise emits the value of "a" to output "false".',inputs:{a:{mode:"required",description:"First value"},b:{mode:"required",description:"Second value"}},outputs:{true:{description:"Emits the value of a if a is equal to b"},false:{description:"Emits the value of a if a is not equal to b"}},run:(e,t)=>{const{a:n,b:o}=e,{true:i,false:s}=t;n===o?i.next(n):s.next(n)}}},79118:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Request=t.Put=t.Post=t.Get=void 0;const i=o(n(18706)),s="HTTP";t.Get={id:"GET Request",defaultStyle:{icon:"fa-server"},namespace:s,description:"Performs a HTTP GET request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:(e,t)=>{let{url:n,headers:o,params:s}=e,{data:r}=t;return i.default.get(n,{headers:o,params:s}).then((e=>r.next(e.data)))}},t.Post={id:"POST Request",defaultStyle:{icon:"fa-server"},namespace:s,description:"Performs a HTTP POST request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"},data:{description:"Data to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:(e,t)=>{let{url:n,headers:o,params:s,data:r}=e,{data:a}=t;const u={headers:o,params:s};return i.default.post(n,r,u).then((e=>a.next(e.data)))}},t.Put={id:"PUT Request",defaultStyle:{icon:"fa-server"},namespace:s,description:"Performs a HTTP PUT request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"},data:{description:"Data to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:(e,t)=>{let{url:n,headers:o,params:s,data:r}=e,{data:a}=t;const u={headers:o,params:s};return i.default.put(n,r,u).then((e=>a.next(e.data)))}},t.Request={id:"Request",defaultStyle:{icon:"fa-server"},namespace:s,description:"Performs a HTTP request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},method:{description:"HTTP method to use"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"},data:{description:"Data to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:(e,t)=>{let{url:n,method:o,headers:s,params:r,data:a}=e,{data:u}=t;const l={method:o,headers:s,params:r};return i.default.request({url:n,data:a,...l}).then((e=>u.next(e.data)))}}},67040:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Flatten=t.Slice=t.RemoveAt=t.Remove=t.Prepend=t.Append=t.AccumulateSomeValuesByCount=t.AccumulateValuesByCount=t.AccumulateValuesByTime=t.AccumulateValuesUntilTrigger=t.SplitQuadruple=t.SplitTriple=t.SplitTuple=t.HeadAndRest=t.LoopList=t.Reverse=t.ConcatLists=t.ListFrom5=t.ListFrom4=t.ListFrom3=t.ListFrom2=t.Repeat=t.GetListElement=t.ListIsEmpty=t.ListLength=void 0;const n="Lists";t.ListLength={id:"List Length",defaultStyle:{icon:"fa-list"},namespace:n,description:"Returns the length of a list",inputs:{list:{description:"List"}},outputs:{length:{description:"Length"}},run:(e,t)=>{let{list:n}=e,{length:o}=t;return o.next(n.length)}},t.ListIsEmpty={id:"List Is Empty",defaultStyle:{icon:"fa-list"},namespace:n,description:"Returns true if the list is empty",inputs:{list:{description:"List"}},outputs:{isEmpty:{description:"Is empty"}},run:(e,t)=>{let{list:n}=e,{isEmpty:o}=t;return o.next(0===n.length)}},t.GetListElement={id:"Get List Element",defaultStyle:{icon:"fa-list"},namespace:n,description:"Returns the element at the specified index",inputs:{list:{description:"List"},index:{description:"Index"}},outputs:{element:{description:"Element"}},run:(e,t)=>{let{list:n,index:o}=e,{element:i}=t;return i.next(n[o])}},t.Repeat={id:"Repeat",defaultStyle:{icon:"fa-list"},namespace:n,description:"Repeats a value a number of times",inputs:{value:{description:"Value to repeat"},times:{description:"How many times will the value be repeated"}},outputs:{list:{description:"List"}},run:(e,t)=>{let{value:n,times:o}=e,{list:i}=t;const s=[];for(let r=0;r{let{value1:n,value2:o}=e,{list:i}=t;return i.next([n,o])}},t.ListFrom3={id:"List From 3",defaultStyle:{icon:"fa-list"},namespace:n,description:"Creates a list from three values",inputs:{value1:{description:"First value"},value2:{description:"Second value"},value3:{description:"Third value"}},outputs:{list:{description:"List containing all 3 values"}},run:(e,t)=>{let{value1:n,value2:o,value3:i}=e,{list:s}=t;return s.next([n,o,i])}},t.ListFrom4={id:"List From 4",defaultStyle:{icon:"fa-list"},namespace:n,description:"Creates a list from four values",inputs:{value1:{description:"First value"},value2:{description:"Second value"},value3:{description:"Third value"},value4:{description:"Fourth value"}},outputs:{list:{description:"List containing all 4 values"}},run:(e,t)=>{let{value1:n,value2:o,value3:i,value4:s}=e,{list:r}=t;return r.next([n,o,i,s])}},t.ListFrom5={id:"List From 5",defaultStyle:{icon:"fa-list"},namespace:n,description:"Creates a list from five values",inputs:{value1:{description:"First value"},value2:{description:"Second value"},value3:{description:"Third value"},value4:{description:"Fourth value"},value5:{description:"Fifth value"}},outputs:{list:{description:"List containing all 5 values"}},run:(e,t)=>{let{value1:n,value2:o,value3:i,value4:s,value5:r}=e,{list:a}=t;return a.next([n,o,i,s,r])}},t.ConcatLists={id:"Concat Lists",defaultStyle:{icon:"fa-list"},namespace:n,description:"Concatenates two lists",inputs:{list1:{description:"First list"},list2:{description:"Second list"}},outputs:{list:{description:"Concatenated list"}},run:(e,t)=>{let{list1:n,list2:o}=e,{list:i}=t;return i.next([...n,...o])}},t.Reverse={id:"Reverse",defaultStyle:{icon:"fa-list"},namespace:n,description:"Reverses a list",inputs:{list:{description:"List"}},outputs:{reversed:{description:"Reversed list"}},run:(e,t)=>{let{list:n}=e,{reversed:o}=t;return o.next(n.reverse())}},t.LoopList={id:"Loop List",defaultStyle:{icon:"fa-list"},namespace:n,searchKeywords:["each","spread"],description:"Emits all values in a list",inputs:{list:{description:"The list to loop"}},outputs:{item:{description:"Will emit a value for each item in the list"},index:{description:"Will emit the index of the item"},length:{description:"Will emit the length of the list"}},run:(e,t)=>{const{list:n}=e,{item:o,index:i}=t;for(const s of n)o.next(s),i.next(n.indexOf(s));t.length.next(n.length)}},t.HeadAndRest={id:"Head and rest",defaultStyle:{icon:"fa-list"},namespace:n,description:"Receives a list and emits two outputs: the first item and the rest of the list",inputs:{list:{description:"The list"}},outputs:{head:{description:"The first item in the list"},rest:{description:"The rest of the list"}},run:(e,t)=>{const{list:n}=e,{head:o,rest:i}=t;o.next(n[0]),i.next(n.slice(1))}},t.SplitTuple={id:"Split Pair",defaultStyle:{icon:"fa-list"},namespace:n,description:"Receives a list with 2 items and emits two outputs: the first item and the second item",inputs:{pair:{description:"The pair to split"}},outputs:{item1:{description:"The first item in the pair"},item2:{description:"The second item in the pair"}},run:(e,t)=>{const{pair:n}=e,{item1:o,item2:i}=t;o.next(n[0]),i.next(n[1])}},t.SplitTriple={id:"Split Triple",defaultStyle:{icon:"fa-list"},namespace:n,description:"Receives a list with 3 items and emits three outputs: the first item, the second item and the third item",inputs:{triple:{description:"The triple"}},outputs:{item1:{description:"The first item in the triple"},item2:{description:"The second item in the triple"},item3:{description:"The third item in the triple"}},run:(e,t)=>{const{list:n}=e,{item1:o,item2:i,item3:s}=t;o.next(n[0]),i.next(n[1]),s.next(n[2])}},t.SplitQuadruple={id:"Split Quadruple",defaultStyle:{icon:"fa-list"},namespace:n,description:"Receives a list with 4 items and emits four outputs: the first item, the second item, the third item and the fourth item",inputs:{quadruple:{description:"The quadruple"}},outputs:{item1:{description:"The first item in the quadruple"},item2:{description:"The second item in the quadruple"},item3:{description:"The third item in the quadruple"},item4:{description:"The fourth item in the quadruple"}},run:(e,t)=>{const{list:n}=e,{item1:o,item2:i,item3:s,item4:r}=t;o.next(n[0]),i.next(n[1]),s.next(n[2]),r.next(n[3])}},t.AccumulateValuesUntilTrigger={id:"Accumulate Values by Trigger",defaultStyle:{icon:"fa-basket-shopping"},namespace:n,description:'Accumulates values sent to the "value" input, until the "reset" input is triggered. Then it emits the accumulated values and resets the accumulator.',inputs:{value:{description:"The value to accumulate"},reset:{description:"Resets the accumulator"}},reactiveInputs:["value","reset"],outputs:{accumulated:{description:"The accumulated values"}},run:(e,t,n)=>{const{item:o,until:i}=e,{r:s}=t,{state:r}=n;let a=r.get("list")||[];void 0!==o&&(a.push(o),r.set("list",a)),void 0!==i&&s.next(a)}},t.AccumulateValuesByTime={id:"Accumulate Values by Time",defaultStyle:{icon:"fa-basket-shopping"},namespace:n,description:'Accumulates values sent to the "value" input. After the specified time it emits the accumulated values and resets the accumulator.',inputs:{value:{description:"The value to accumulate"},time:{description:"Time to wait before emitting the accumulated values. Default is 200ms",defaultValue:200,mode:"required-if-connected"}},reactiveInputs:["value"],outputs:{accumulated:{description:"The accumulated values"}},run:(e,t,n)=>{const{value:o,time:i}=e,{accumulated:s}=t,{state:r}=n;let a=r.get("list")||[];const u=Date.now()%1e3;console.log("called",e.value,e.time,u),r.set("bob",2),console.log(Array.from(r.entries())),void 0!==o&&(a.push(o),r.set("list",a)),r.get("timeout")&&clearTimeout(r.get("timeout"));const l=new Promise((e=>{r.set("resolve",e)}));return r.set("timeout",setTimeout((()=>{console.log("emitting",a,u,Date.now()%1e3),s.next(a),r.set("list",[]);const e=r.get("resolve");if(!e)throw new Error("resolve is undefined");e()}),i)),l}},t.AccumulateValuesByCount={id:"Accumulate Values by Count",defaultStyle:{icon:"fa-basket-shopping"},namespace:n,description:'Accumulates values sent to the "value" input. After the specified count it emits the accumulated values and resets the accumulator.',inputs:{value:{description:"The value to accumulate"},count:{description:"Number of values to accumulate before emitting them"}},reactiveInputs:["value"],outputs:{accumulated:{description:"The accumulated values"}},completionOutputs:["accumulated"],run:(e,t,n)=>{const{value:o,count:i}=e,{accumulated:s}=t,{state:r}=n;let a=r.get("list")||[];void 0!==o&&(a.push(o),r.set("list",a)),a.length>=i&&s.next(a)}},t.AccumulateSomeValuesByCount={id:"Accumulate Some Values by Count",defaultStyle:{icon:"fa-basket-shopping"},namespace:n,description:'Accumulates values sent to the "accept" input. Emits the list after the total items passed to both "accept" and "ignore" inputs reach the specified count.',inputs:{accept:{description:"Values to accumulate"},ignore:{description:"Values to ignore"},count:{description:"Number of values to accumulate before emitting them"}},reactiveInputs:["accept","ignore"],outputs:{accumulated:{description:"The accumulated accepted values"},ignored:{description:"The accumulated ignored values"}},run:(e,t,n)=>{const{accept:o,ignore:i,count:s}=e,{accumulated:r,ignored:a}=t,{state:u}=n;let l=u.get("list")||[],c=u.get("ignored")||[];void 0!==o&&(l.push(o),u.set("list",l)),void 0!==i&&(c.push(i),u.set("ignored",a)),l.length+c.length>=s&&(r.next(l),a.next(a))}},t.Append={id:"Append",namespace:n,description:"Appends an item to a list",inputs:{list:{description:"The list"},item:{description:"The item to append"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,item:o}=e,{list:i}=t;i.next([...n,o])},defaultStyle:{icon:"fa-plus"}},t.Prepend={id:"Prepend",namespace:n,description:"Prepends an item to a list",inputs:{list:{description:"The list"},item:{description:"The item to prepend"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,item:o}=e,{list:i}=t;i.next([o,...n])},defaultStyle:{icon:"fa-arrow-up"}},t.Remove={id:"Remove",namespace:n,description:"Removes an item from a list",inputs:{list:{description:"The list"},item:{description:"The item to remove"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,item:o}=e,{list:i}=t;i.next(n.filter((e=>e!==o)))},defaultStyle:{icon:"fa-minus"}},t.RemoveAt={id:"Remove At",namespace:n,description:"Removes an item from a list at the specified index",inputs:{list:{description:"The list"},index:{description:"The index of the item to remove"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,index:o}=e,{list:i}=t;i.next(n.filter(((e,t)=>t!==o)))},defaultStyle:{icon:"fa-times"}},t.Slice={id:"Slice",namespace:n,description:"Returns a slice of a list from the specified start index to the specified end index",inputs:{list:{description:"The list"},start:{description:"The index to start slicing from"},end:{description:"The index to end slicing at"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,start:o,end:i}=e,{list:s}=t;s.next(n.slice(o,i))},defaultStyle:{icon:"fa-cut"}},t.Flatten={id:"Flatten",namespace:n,description:"Flattens a list of lists into a single list",inputs:{list:{description:"The list of lists"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n}=e,{list:o}=t;o.next(n.reduce(((e,t)=>[...e,...t]),[]))},defaultStyle:{icon:"fa-compress"}}},21518:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyEquals=t.DeleteAttribute=t.SetAttribute=t.GetAttribute=t.ObjectAssign=t.ObjectFromEntries=t.ObjectEntries=t.ObjectValues=t.ObjectHasOwnProperty=t.ObjectKeys=t.JSONStringify=t.JSONParse=void 0;const n="Objects";t.JSONParse={id:"JSON Parse",defaultStyle:{icon:"fa-glasses"},namespace:n,description:"Parses a JSON string into an object",inputs:{json:{description:"JSON string to parse"}},outputs:{object:{description:"The parsed object"}},run:(e,t)=>{let{json:n}=e,{object:o}=t;return o.next(JSON.parse(n))}},t.JSONStringify={id:"JSON Stringify",defaultStyle:{icon:"fa-pen-fancy"},namespace:n,description:"Stringifies an object into a JSON string",inputs:{object:{description:"Object to stringify"}},outputs:{json:{description:"The stringified JSON"}},run:(e,t)=>{let{object:n}=e,{json:o}=t;return o.next(JSON.stringify(n))}},t.ObjectKeys={id:"Keys",defaultStyle:{icon:"fa-key"},namespace:n,description:"Emits the keys of an object",inputs:{object:{description:"Object to get keys of"}},outputs:{keys:{description:"The keys of object"}},run:(e,t)=>{let{object:n}=e,{keys:o}=t;return o.next(Object.keys(n))}},t.ObjectHasOwnProperty={id:"Has own property",defaultStyle:{icon:"fa-key"},namespace:n,description:"Checks if object has property",inputs:{object:{mode:"required",description:"Object to get keys of"},property:{mode:"required",description:"the property to search for"}},outputs:{true:{description:"The value is true"},false:{description:"The value is false"}},run:function(e,t){const{true:n,false:o}=t,{object:i,property:s}=e;i.hasOwnProperty(s)?n.next(!0):o.next(!1)}},t.ObjectValues={id:"Values",namespace:n,description:"Emits the values of an object",inputs:{object:{description:"Object to get values of"}},outputs:{values:{description:"The values of object"}},run:(e,t)=>{let{object:n}=e,{values:o}=t;return o.next(Object.values(n))}},t.ObjectEntries={id:"Entries",defaultStyle:{icon:"fa-box"},namespace:n,description:"Emits the entries of an object",inputs:{object:{description:"Object to get entries of"}},outputs:{entries:{description:"The entries of object"}},run:(e,t)=>{let{object:n}=e,{entries:o}=t;return o.next(Object.entries(n))}},t.ObjectFromEntries={id:"From Entries",namespace:n,defaultStyle:{icon:"fa-box"},description:"Creates an object from an array of entries",inputs:{entries:{description:"Array of entries to create object from"}},outputs:{object:{description:"The created object"}},run:(e,t)=>{let{entries:n}=e,{object:o}=t;return o.next(Object.fromEntries(n))}},t.ObjectAssign={id:"Assign",namespace:n,defaultStyle:{icon:"fa-box"},description:"Assigns properties from one or more objects to a target object",inputs:{target:{description:"Target object to assign properties to"},sources:{description:"One or more objects to assign properties from"}},outputs:{object:{description:"The target object"}},run:(e,t)=>{let{target:n,sources:o}=e,{object:i}=t;return i.next(Object.assign(n,...o))}},t.GetAttribute={id:"Get Attribute",searchKeywords:["pick","dot"],namespace:n,defaultStyle:{icon:"fa-magnifying-glass"},description:"Gets an attribute from an object",inputs:{object:{description:"Object to get attribute from"},attribute:{description:"Attribute to get"}},outputs:{value:{description:"The value of the attribute"}},customViewCode:'{{#if inputs.attribute}}\n Get "{{inputs.attribute}}"\n{{else}}\n Get Attribute\n{{/if}}',run:(e,t)=>{let{object:n,attribute:o}=e,{value:i}=t;return i.next(o.split(".").reduce(((e,t)=>e[t]),n))}},t.SetAttribute={id:"Set Attribute",searchKeywords:["dot"],namespace:n,defaultStyle:{icon:"fa-box"},description:"Sets an attribute on an object",inputs:{object:{description:"Object to set attribute on"},attribute:{description:"Attribute to set"},value:{description:"Value to set attribute to"}},outputs:{object:{description:"The object with the attribute set"}},customViewCode:'{{#if inputs.attribute}}\n Set "{{inputs.attribute}}"\n{{else}}\n Set Attribute\n{{/if}}',run:(e,t)=>{let{object:n,attribute:o,value:i}=e,{object:s}=t;const r=o.split("."),a=r.pop();return r.reduce(((e,t)=>e[t]),n)[a]=i,s.next(n)}},t.DeleteAttribute={id:"Delete Attribute",defaultStyle:{icon:"fa-box"},namespace:n,description:"Deletes an attribute from an object",inputs:{object:{description:"Object to delete attribute from"},attribute:{description:"Attribute to delete"}},customViewCode:'{{#if inputs.attribute.value}}\n Delete "{{inputs.attribute.value}}"\n{{else}}\n Delete Attribute\n{{/if}}',outputs:{object:{description:"The object with the attribute deleted"}},run:(e,t)=>{let{object:n,attribute:o}=e,{object:i}=t;const s=o.value.split("."),r=s.pop();delete s.reduce(((e,t)=>e[t]),n.value)[r],i.next(n.value)}},t.PropertyEquals={id:"Property Equals",namespace:n,defaultStyle:{icon:"fa-equals"},description:'Emits the object to the "true" output if an object\'s property equals a value, otherwise emits to the "false" output',inputs:{object:{description:"Object to check property of"},attribute:{description:"Attribute to check"},value:{description:"Value to check attribute against"}},outputs:{true:{description:"Emitted if the attribute equals the value"},false:{description:"Emitted if the attribute does not equal the value"}},customViewCode:'{{#if inputs.attribute}}\n "{{inputs.attribute}}" equals "{{inputs.value}}"\n{{else}}\n Property Equals\n{{/if}}',run:(e,t)=>{e.attribute.split(".").reduce(((e,t)=>e[t]),e.object)===e.value?t.true.next(e.object):t.false.next(e.object)}}},40863:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyString=t.MatchRegex=t.IsEmpty=t.EndsWith=t.StartsWith=t.Includes=t.ToTitleCase=t.ToSnakeCase=t.ToPascalCase=t.ToCamelCase=t.ToKebabCase=t.CharAt=t.LastIndexOf=t.IndexOf=t.Length=t.Substring=t.ToUpperCase=t.ToLowerCase=t.Trim=t.Replace=t.Join=t.Split=t.Concat=void 0;const n="Strings";t.Concat={id:"Concat",defaultStyle:{icon:"fa-font"},namespace:n,description:"Concatenates two strings",inputs:{a:{description:"String a"},b:{description:"String b"}},outputs:{value:{description:"Concatenated value"}},run:(e,t)=>{let{a:n,b:o}=e,{value:i}=t;return i.next(n+o)}},t.Split={id:"Split",defaultStyle:{icon:"fa-font"},namespace:n,description:"Splits a string",inputs:{string:{description:"String to split"},separator:{description:"Separator"}},outputs:{value:{description:"Splitted value"}},run:(e,t)=>{let{string:n,separator:o}=e,{value:i}=t;return i.next(n.split(o))}},t.Join={id:"Join",defaultStyle:{icon:"fa-font"},namespace:n,description:"Joins an array of strings",inputs:{array:{description:"Array to join"},separator:{description:"Separator"}},outputs:{value:{description:"Joined value"}},run:(e,t)=>{let{array:n,separator:o}=e,{value:i}=t;return i.next(n.join(o))}},t.Replace={id:"Replace",defaultStyle:{icon:"fa-font"},namespace:n,description:"Replaces a string",inputs:{string:{description:"String to replace"},searchValue:{description:"Value to search for"},replaceValue:{description:"Value to replace with"}},outputs:{value:{description:"Replaced value"}},run:(e,t)=>{let{string:n,searchValue:o,replaceValue:i}=e,{value:s}=t;return s.next(n.replace(o,i))}},t.Trim={id:"Trim",defaultStyle:{icon:"fa-font"},namespace:n,description:"Trims a string",inputs:{string:{description:"String to trim"}},outputs:{value:{description:"Trimmed value"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(n.trim())}},t.ToLowerCase={id:"To Lower Case",defaultStyle:{icon:"fa-font"},namespace:n,description:"Converts a string to lower case",inputs:{string:{description:"String to convert to lower case"}},outputs:{value:{description:"Converted value"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(n.toLowerCase())}},t.ToUpperCase={id:"To Upper Case",defaultStyle:{icon:"fa-font"},namespace:n,description:"Converts a string to upper case",inputs:{string:{description:"String to convert to upper case"}},outputs:{value:{description:"Converted value"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(n.toUpperCase())}},t.Substring={id:"Substring",defaultStyle:{icon:"fa-font"},namespace:n,description:"Returns the node of the string between the start and end indexes",inputs:{string:{description:"String to get substring from"},start:{description:"Start index"},end:{description:"End index"}},outputs:{value:{description:"Substring"}},run:(e,t)=>{let{string:n,start:o,end:i}=e,{value:s}=t;return s.next(n.substring(o,i))}},t.Length={id:"Length",defaultStyle:{icon:"fa-font"},namespace:n,description:"Returns the length of a string",inputs:{string:{description:"String to get length from"}},outputs:{value:{description:"Length"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(n.length)}},t.IndexOf={id:"Index Of",defaultStyle:{icon:"fa-font"},namespace:n,description:"Returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex",inputs:{string:{description:"String to search in"},searchValue:{description:"Value to search for"},fromIndex:{description:"Index to start searching from"}},outputs:{value:{description:"Index"}},run:(e,t)=>{let{string:n,searchValue:o,fromIndex:i}=e,{value:s}=t;return s.next(n.indexOf(o,i))}},t.LastIndexOf={id:"Last Index Of",defaultStyle:{icon:"fa-font"},namespace:n,description:"Returns the index within the calling String object of the last occurrence of the specified value, or -1 if not found. The calling string is searched backward, starting at fromIndex",inputs:{string:{description:"String to search in"},searchValue:{description:"Value to search for"},fromIndex:{description:"Index to start searching from"}},outputs:{value:{description:"Index"}},run:(e,t)=>{let{string:n,searchValue:o,fromIndex:i}=e,{value:s}=t;return s.next(n.lastIndexOf(o,i))}},t.CharAt={id:"Char At",defaultStyle:{icon:"fa-font"},namespace:n,description:"Returns the character at the specified index",inputs:{string:{description:"String to get character from"},index:{description:"Index to get character from"}},outputs:{value:{description:"Character"}},run:(e,t)=>{let{string:n,index:o}=e,{value:i}=t;return i.next(n.charAt(o))}},t.ToKebabCase={id:"To Kebab Case",defaultStyle:{icon:"fa-font"},namespace:n,description:"Converts a string to kebab case",inputs:{string:{description:"String to convert to kebab case"}},outputs:{value:{description:"Converted value"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(n.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase())}},t.ToCamelCase={id:"To Camel Case",defaultStyle:{icon:"fa-font"},namespace:n,description:"Converts a string to camel case",inputs:{string:{description:"String to convert to camel case"}},outputs:{value:{description:"Converted value"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(n.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g,((e,t)=>0==+e?"":0===t?e.toLowerCase():e.toUpperCase())))}},t.ToPascalCase={id:"To Pascal Case",defaultStyle:{icon:"fa-font"},namespace:n,description:"Converts a string to pascal case",inputs:{string:{description:"String to convert to pascal case"}},outputs:{value:{description:"Converted value"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(n.replace(/(?:^\w|[A-Z]|\b\w)/g,((e,t)=>0===t?e.toUpperCase():e.toLowerCase())).replace(/\s+/g,""))}},t.ToSnakeCase={id:"To Snake Case",defaultStyle:{icon:"fa-font"},namespace:n,description:"Converts a string to snake case",inputs:{string:{description:"String to convert to snake case"}},outputs:{value:{description:"Converted value"}},run:e=>e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/\s+/g,"_").toLowerCase()},t.ToTitleCase={id:"To Title Case",defaultStyle:{icon:"fa-font"},namespace:n,description:"Converts a string to title case",inputs:{string:{description:"String to convert to title case"}},outputs:{value:{description:"Converted value"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(n.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase())))}},t.Includes={id:"Includes",namespace:n,defaultStyle:{icon:"fa-font"},description:"Determines whether one string may be found within another string, returning true or false as appropriate",inputs:{string:{description:"String to search in"},searchValue:{description:"Value to search for"},fromIndex:{description:"Index to start searching from"}},outputs:{value:{description:"Result"}},run:(e,t)=>{let{string:n,searchValue:o,fromIndex:i}=e,{value:s}=t;return s.next(n.includes(o,i))}},t.StartsWith={id:"Starts With",namespace:n,defaultStyle:{icon:"fa-font"},description:"Determines whether a string begins with the characters of another string, returning true or false as appropriate",inputs:{string:{description:"String to search in"},searchValue:{description:"Value to search for"},fromIndex:{description:"Index to start searching from"}},outputs:{value:{description:"Result"}},run:(e,t)=>{let{string:n,searchValue:o,fromIndex:i}=e,{value:s}=t;return s.next(n.startsWith(o,i))}},t.EndsWith={id:"Ends With",namespace:n,defaultStyle:{icon:"fa-font"},description:"Determines whether a string ends with the characters of another string, returning true or false as appropriate",inputs:{string:{description:"String to search in"},searchValue:{description:"Value to search for"},fromIndex:{description:"Index to start searching from"}},outputs:{value:{description:"Result"}},run:(e,t,n)=>e.endsWith(t,n)},t.IsEmpty={id:"Is Empty",namespace:n,defaultStyle:{icon:"fa-font"},description:"Determines whether a string is empty",inputs:{string:{description:"String to check"}},outputs:{value:{description:"Result"}},run:(e,t)=>{let{string:n}=e,{value:o}=t;return o.next(0===n.length)}},t.MatchRegex={id:"Match Regex",namespace:n,defaultStyle:{icon:"fa-font"},description:"Determines whether a string matches a regular expression",inputs:{string:{description:"String to check"},regex:{description:"Regular expression to match"}},outputs:{value:{description:"Result"}},run:(e,t)=>{let{string:n,regex:o}=e,{value:i}=t;return i.next(n.match(o))}},t.EmptyString={id:"Empty String",namespace:n,defaultStyle:{icon:"fa-font",size:"small"},description:"Creates an empty string",inputs:{},outputs:{string:{description:"The empty string"}},run:(e,t)=>{let{}=e,{string:n}=t;return n.next("")}}},65645:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var o=n(70079),i=n(11253),s=n(74089),r=n(74762),a=n(21766);var u=n(10831),l=n(61997),c=n(77852);const d=(0,a.S)(),p=[0,20],f=e=>{let{flow:t,output:n,inputs:o,onError:s,debugDelay:a,onCompleted:u,dependencies:l,player:c}=e;const p=((e,t)=>{const n=new Set;return{onEvent:o=>{const i={...o,time:Date.now(),executionId:"n/a"};console.info("Got debugger event",o),t.addEvents([i]),e.addEvents([i]),n.forEach((e=>e([i])))},onBatchedEvents:e=>(n.add(e),()=>n.delete(e))}})(c,d);p.debugDelay=a;const f=(0,r.keys)(t.node.outputs)[0];return{executeResult:(0,r.execute)({node:t.node,inputs:o,outputs:{[f]:n},resolvedDeps:{...l,[t.node.id]:t.node},_debugger:p,onCompleted:u,onBubbleError:e=>{s(e)},extraContext:{PubSub:i}}),localDebugger:p}},m=e=>{const{debugDelay:t,onOutput:i,flowProps:a}=e,{flow:m,inputs:h,output:v}=a,g=(0,o.useRef)((0,s.createRuntimePlayer)()),[y,b]=(0,o.useState)(e.flowProps.dependencies),[I,C]=(0,o.useState)(),[x]=(0,s.useDebounce)(y,500),w=(0,c.useDarkMode)(),_=async(e,t)=>{const{node:o}=e,i=Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).find((e=>(0,r.isBaseNode)(e)&&e.id===o.id));let a;b((e=>({...e,[i.id]:{...i,source:{path:"@flyde/stdlib/dist/all-browser",export:i.id}}})));const l=(0,u.ZP)(m,(n=>{if(t){const o=(0,s.vAdd)({x:0,y:0},t.pos);if(a=(0,s.createNewNodeInstance)(e.node,0,o,y),n.node.instances.push(a),t.connectTo){const{insId:e,outputId:o}=t.connectTo;n.node.connections.push({from:{insId:e,pinId:o},to:{insId:a.id,pinId:r.TRIGGER_PIN_ID}})}}}));await new Promise((e=>setTimeout(e,10)));const c=(0,u.ZP)(N,(e=>{e.flow=l,t?.selectAfterAdding&&a&&(e.boardData.selected=[a?.id])}));return O(c),(0,s.toastMsg)(`Node ${o.id} successfully imported from ${e.module}`),y},j=async()=>({importables:Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).filter(r.isBaseNode).map((e=>({node:{...e,source:{path:"n/a",export:"n/a"}},module:"@flyde/stdlib"}))),errors:[]}),[N,O]=(0,o.useState)({flow:m,boardData:{viewPort:{pos:{x:0,y:0},zoom:1},lastMousePos:{x:0,y:0},selected:[]}});(0,o.useEffect)((()=>{O((e=>({...e,flow:m})))}),[m]),(0,o.useEffect)((()=>{b((e=>({...e,main:N.flow.node})))}),[N.flow.node]);const P={state:N,onChangeEditorState:O,hideTemplatingTips:!0,initialPadding:p,onExtractInlineNode:r.noop,disableScrolling:!0,darkMode:w.isDarkMode};(0,o.useEffect)((()=>{g.current.start()}),[]),(0,o.useEffect)((()=>{const{executeResult:n,localDebugger:o}=f({flow:N.flow,dependencies:y,output:v,inputs:h,onError:r.noop,debugDelay:t,player:g.current,onCompleted:e.onCompleted}),s=e.flowProps.output.subscribe((e=>i(e)));return C(o),()=>{n(),s.unsubscribe()}}),[t,x]);const E=(0,o.useMemo)((()=>({resolvedDependencies:y,onImportNode:_,onRequestImportables:j})),[]),S=(0,o.useMemo)((()=>({debuggerClient:I,onRequestHistory:d.requestHistory})),[I]);return o.createElement(l.Z,null,(()=>o.createElement(s.DependenciesContextProvider,{value:E},o.createElement(s.DebuggerContextProvider,{value:S},o.createElement(s.FlowEditor,P)))))}},21766:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var o=n(74762);const i=200,s=()=>{const e=new Map,t=new Map;return{requestHistory:async(n,s,r)=>{const a="input"===r?o.DebuggerEventType.INPUT_CHANGE:o.DebuggerEventType.OUTPUT_CHANGE;if(console.log({insId:n,pinId:s,type:a}),s){const t=`${n}.${s}.${a}`,o=e.get(t)||{total:0,lastSamples:[]},r=o.lastSamples.slice(0,i);return{...o,lastSamples:r}}{const e=t.get(n)||{total:0,lastSamples:[]},o=e.lastSamples.slice(0,i);return{...e,lastSamples:o}}},addEvents:n=>{n.forEach((n=>{if(n.type===o.DebuggerEventType.ERROR){const e=n;e.type=o.DebuggerEventType.OUTPUT_CHANGE,e.pinId=o.ERROR_PIN_ID}if(n.type===o.DebuggerEventType.INPUT_CHANGE||n.type===o.DebuggerEventType.OUTPUT_CHANGE){const{insId:o,type:s,pinId:r}=n;{const t=`${o}.${r}.${s}`,a=e.get(t)||{total:0,lastSamples:[]};a.lastSamples.unshift(n),a.lastSamples.length>i&&a.lastSamples.splice(i,a.lastSamples.length-i),a.total++,e.set(t,a)}{const s=t.get(o)||{total:0,lastSamples:[]};s.lastSamples.unshift(n),s.lastSamples.length>i&&s.lastSamples.splice(i,s.lastSamples.length-i),s.total++,e.set(o,s)}}}))}}}},70974:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>_,examples:()=>x});var o=n(70079),i=n(31918),s=n(65092),r=n(73949),a=n(19841),u=n(74762),l=n(65645),c=n(28648);const d=c.BV,p="Example.flyde",f=`import {loadFlow} from '@flyde/runtime';\n\nconst executeFlow = loadFlow('${p}');\nconst {result} = executeFlow();\nconst {output} = await result;\nconsole.log(\`Output: \${output}\`);`,m=e=>{const t=e.example,[n,i]=o.useState([]),[s,r]=o.useState("Example.flyde"),m=(0,o.useRef)({__trigger:(0,u.dynamicNodeInput)()}),h=(0,o.useRef)((0,u.dynamicOutput)()),v={flow:t.flow.flow,dependencies:t.flow.dependencies,inputs:m.current,output:h.current},g=o.useCallback((()=>{m.current.__trigger.subject.next("run")}),[]);return o.useEffect((()=>{const e=setTimeout((()=>{g()}),1500),t=setInterval((()=>{g()}),10500);return()=>{clearTimeout(e),clearInterval(t)}}),[g]),o.createElement("div",{className:"hero-example"},o.createElement("div",{className:"hero-example__tabs"},o.createElement("div",{onClick:()=>r(p),className:(0,a.default)("file-tag",s===p&&"selected")},p),o.createElement("div",{className:(0,a.default)("file-tag","index.ts"===s&&"selected"),onClick:()=>r("index.ts")},"index.ts")),s===p?o.createElement("div",{className:"flow-wrapper"},o.createElement(l.Y,{flowProps:v,debugDelay:100,onOutput:e=>{i((t=>[`[${(new Date).toLocaleTimeString()}] Output: ${e}`,...t]))}})):null,"index.ts"===s?o.createElement("div",{className:"code-wrapper"},o.createElement(c.dn,{className:"code-example",showLineNumbers:!1,text:f,language:"typescript",theme:d,codeBlock:!0,width:"100%"})):null,o.createElement("div",{className:"terminal-wrapper"},o.createElement("div",{className:"file-tag"},"Terminal"),o.createElement("div",{className:"terminal-emulator"},n.length?n.map(((e,t)=>o.createElement("div",null,e))):o.createElement("em",null,"Waiting for the example to run.."))))};var h=n(49794);function v(){return o.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("path",{d:"M21.9937 9.23411C21.9305 9.05119 21.8157 8.89053 21.663 8.77161C21.5104 8.65268 21.3265 8.5806 21.1337 8.56411L15.4437 7.73411L12.8937 2.56411C12.8118 2.39504 12.6839 2.25245 12.5248 2.15268C12.3656 2.05291 12.1815 2 11.9937 2C11.8058 2 11.6218 2.05291 11.4626 2.15268C11.3034 2.25245 11.1756 2.39504 11.0937 2.56411L8.54363 7.72411L2.85363 8.56411C2.66855 8.59041 2.49455 8.66807 2.35138 8.78826C2.2082 8.90846 2.10159 9.06638 2.04363 9.24411C1.99057 9.41778 1.98581 9.60265 2.02986 9.77875C2.0739 9.95495 2.16509 10.1159 2.29363 10.2442L6.42363 14.2442L5.42363 19.9241C5.38325 20.1125 5.39818 20.3086 5.46661 20.4887C5.53504 20.6688 5.65406 20.8254 5.80936 20.9395C5.96465 21.0535 6.1496 21.1203 6.34196 21.1318C6.53431 21.1433 6.72589 21.0989 6.89363 21.0041L11.9937 18.3341L17.0937 21.0041C17.234 21.0832 17.3925 21.1246 17.5537 21.1241C17.7655 21.1248 17.9721 21.0583 18.1437 20.9341C18.2988 20.8229 18.4189 20.6697 18.4898 20.4925C18.5607 20.3153 18.5794 20.1215 18.5437 19.9341L17.5437 14.2542L21.6737 10.2542C21.8181 10.1318 21.9248 9.97105 21.9814 9.79045C22.0381 9.60995 22.0423 9.41698 21.9937 9.23411ZM15.8437 13.2341C15.7279 13.3465 15.6411 13.4853 15.5906 13.6385C15.5401 13.7918 15.5274 13.955 15.5537 14.1142L16.2737 18.3141L12.5137 16.3142C12.3675 16.2419 12.2067 16.2042 12.0437 16.2042C11.8806 16.2042 11.7198 16.2419 11.5737 16.3142L7.81363 18.3141L8.53363 14.1142C8.55987 13.955 8.54719 13.7918 8.4967 13.6385C8.4462 13.4853 8.35937 13.3465 8.24363 13.2341L5.24363 10.2341L9.45363 9.62415C9.61563 9.60155 9.76963 9.53965 9.90213 9.44376C10.0347 9.34787 10.1416 9.22094 10.2137 9.07411L11.9937 5.26411L13.8737 9.08411C13.9457 9.23094 14.0527 9.35787 14.1852 9.45376C14.3177 9.54965 14.4717 9.61155 14.6337 9.63415L18.8437 10.2442L15.8437 13.2341Z",fill:"currentColor"}))}const g={dependencies:{Delay:{id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:"Control Flow",description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:n(43920).Delay.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Delay"}},Concat:{id:"Concat",defaultStyle:{icon:"fa-font"},namespace:"Strings",description:"Concatenates two strings",inputs:{a:{description:"String a"},b:{description:"String b"}},outputs:{value:{description:"Concatenated value"}},run:n(40863).Concat.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Strings.flyde.js",export:"Concat"}}},flow:{imports:{"@flyde/stdlib":["Delay","Concat"]},node:{instances:[{pos:{x:-745.6308628148531,y:-164.62084499951794},id:"hvnxp46iusf1g91k6dua576w",inputConfig:{delay:{mode:"static",value:4200}},nodeId:"Delay",style:{size:"small",icon:"fa-clock",color:"#00bbf9"}},{pos:{x:-890.0921093750001,y:-381.6685205078125},id:"Inline-value-Hello, -7i048oa",inputConfig:{},node:{id:"Inline-value-Hello, ",inputs:{},outputs:{value:{delayed:!1}},runFnRawCode:'const result = ("Hello, "); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"Hello, "',dataBuilderSource:"IkhlbGxvLCAi",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"},style:{size:"regular",icon:"code",color:"#00f5d4",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-769.3590283203125,y:-276.35265625},id:"ApisCombination-4z1481x",inputConfig:{},node:{id:"Inline-value-World!",inputs:{},outputs:{value:{delayed:!1}},runFnRawCode:'const result = ("World!"); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"World!"',dataBuilderSource:"IldvcmxkISI=",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"},style:{size:"regular",icon:"code",color:"#00f5d4",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-798.6117734787176,y:-85.88893284501296},id:"ldrz8aku7b0eiiettjq0q8rt",inputConfig:{},nodeId:"Concat",style:{size:"small",icon:"fa-font",color:"#fee440"}}],connections:[{from:{insId:"Inline-value-Hello, -7i048oa",pinId:"value"},to:{insId:"ApisCombination-4z1481x",pinId:"__trigger"}},{from:{insId:"ApisCombination-4z1481x",pinId:"value"},to:{insId:"hvnxp46iusf1g91k6dua576w",pinId:"value"}},{from:{insId:"hvnxp46iusf1g91k6dua576w",pinId:"delayedValue"},to:{insId:"ldrz8aku7b0eiiettjq0q8rt",pinId:"b"}},{from:{insId:"ldrz8aku7b0eiiettjq0q8rt",pinId:"value"},to:{insId:"__this",pinId:"output"}},{from:{insId:"Inline-value-Hello, -7i048oa",pinId:"value"},to:{insId:"ldrz8aku7b0eiiettjq0q8rt",pinId:"a"}}],id:"ApisCombination",inputs:{},outputs:{output:{type:"any",optional:!1,delayed:!1}},inputsPosition:{city:{x:-187.27285824815934,y:-14.13215209416181},Bob:{x:-464.39225613814307,y:-267.86263932413937},"\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x92\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x9b\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\xa2\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x9b\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x92\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\xa2":{x:-879.2823974609375,y:-510.9079638671875}},outputsPosition:{json:{x:-441.98276309426666,y:480.38719404276554},na:{x:-441.98276309426666,y:480.38719404276554},result:{x:-499.82438378976735,y:706.7650396699393},output:{x:-783.232804865152,y:11.154386263028243},response:{x:-506.3386688159596,y:488.67302443385125},"Bob 42":{x:-736.217912287027,y:209.40813992513762},"\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x92\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x9b\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x9b\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x92":{x:-589.98,y:-561}}}}},y={dependencies:{Throttle:{id:"Throttle",namespace:"Control Flow",inputs:{value:{mode:"required",description:"The data that needs to be throttled"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The throttled value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the first value received after being idle for "wait" amount of milliseconds',run:n(43920).Throttle.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Throttle"}},Debounce:{id:"Debounce",namespace:"Control Flow",inputs:{value:{mode:"required",description:"The data that needs to be debounced"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The debounced value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the last value received after being idle for "wait" amount of milliseconds',run:n(43920).Debounce.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Debounce"}},Repeat:{id:"Repeat",defaultStyle:{icon:"fa-list"},namespace:"Lists",description:"Repeats a value a number of times",inputs:{value:{description:"Value to repeat"},times:{description:"How many times will the value be repeated"}},outputs:{list:{description:"List"}},run:n(67040).Repeat.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Lists.flyde.js",export:"Repeat"}},"Loop List":{id:"Loop List",defaultStyle:{icon:"fa-list"},namespace:"Lists",searchKeywords:["each","spread"],description:"Emits all values in a list",inputs:{list:{description:"The list to loop"}},outputs:{item:{description:"Will emit a value for each item in the list"},index:{description:"Will emit the index of the item"},length:{description:"Will emit the length of the list"}},run:n(67040).LoopList.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Lists.flyde.js",export:"LoopList"}}},flow:{imports:{"@flyde/stdlib":["Repeat","Throttle","Debounce","Loop List"]},node:{instances:[{pos:{x:-777.6441479492187,y:-230.75769625127003},id:"wj31gd73i5l111q999pv4kor",inputConfig:{wait:{mode:"static",value:4200}},visibleOutputs:["result","__error"],nodeId:"Throttle"},{pos:{x:-960.8631420898437,y:-227.77420626103566},id:"eaa2b80mmdusjvxi3fve0du1",inputConfig:{wait:{mode:"static",value:4200}},nodeId:"Debounce"},{pos:{x:-1007.762890625,y:-141.30592895507812},id:"Inline-value-Debounce: ${in-qj1486n",inputConfig:{},node:{id:"Inline-value-Debounced",inputs:{},outputs:{value:{delayed:!1}},runFnRawCode:"const result = (`Debounced`); Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"`Debounced`",dataBuilderSource:"YERlYm91bmNlZGA=",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"},style:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-897.3139318847655,y:-411.8869211850429},id:"dimxqnz6n9uhawffzb6urp0y",inputConfig:{value:{mode:"static",value:"beep boop"},times:{mode:"static",value:2}},nodeId:"Repeat",style:{size:"small",icon:"fa-list"}},{pos:{x:-882.643474601553,y:-350.2880555829314},id:"dsqx2xve1xghrrhtx1o0ep60",inputConfig:{},nodeId:"Loop List",style:{size:"small",icon:"fa-list"}},{pos:{x:-764.763251953125,y:-141.78481811523437},id:"ApisCombination-7b048r2",inputConfig:{},node:{id:"Inline-value-Throttled",inputs:{},outputs:{value:{delayed:!1}},runFnRawCode:"const result = (`Throttled`); Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"`Throttled`",dataBuilderSource:"YFRocm90dGxlZGA=",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"},style:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}}],connections:[{from:{insId:"Inline-value-Debounce: ${in-qj1486n",pinId:"value"},to:{insId:"__this",pinId:"output"}},{from:{insId:"wj31gd73i5l111q999pv4kor",pinId:"result"},to:{insId:"__this",pinId:"output"}},{from:{insId:"dimxqnz6n9uhawffzb6urp0y",pinId:"list"},to:{insId:"dsqx2xve1xghrrhtx1o0ep60",pinId:"list"}},{from:{insId:"dsqx2xve1xghrrhtx1o0ep60",pinId:"item"},to:{insId:"eaa2b80mmdusjvxi3fve0du1",pinId:"value"}},{from:{insId:"dsqx2xve1xghrrhtx1o0ep60",pinId:"item"},to:{insId:"wj31gd73i5l111q999pv4kor",pinId:"value"}},{from:{insId:"eaa2b80mmdusjvxi3fve0du1",pinId:"result"},to:{insId:"Inline-value-Debounce: ${in-qj1486n",pinId:"__trigger"}},{from:{insId:"wj31gd73i5l111q999pv4kor",pinId:"__error"},to:{insId:"ApisCombination-7b048r2",pinId:"__trigger"}},{from:{insId:"ApisCombination-7b048r2",pinId:"value"},to:{insId:"__this",pinId:"output"}}],id:"ApisCombination",inputs:{},outputs:{output:{type:"any",optional:!1,delayed:!1}},inputsPosition:{city:{x:-187.27285824815934,y:-14.13215209416181},Bob:{x:-464.39225613814307,y:-267.86263932413937},"\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x92\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x9b\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\xa2\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x9b\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x92\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\xa2":{x:-879.2823974609375,y:-510.9079638671875}},outputsPosition:{json:{x:-441.98276309426666,y:480.38719404276554},na:{x:-441.98276309426666,y:480.38719404276554},result:{x:-499.82438378976735,y:706.7650396699393},output:{x:-836.6342941229645,y:-37.81857516275301},response:{x:-506.3386688159596,y:488.67302443385125},"Bob 42":{x:-736.217912287027,y:209.40813992513762},"\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x92\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x9b\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x9b\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x97\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x83\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\x82\xc3\x83\xc2\x83\xc3\x82\xc2\x82\xc3\x83\xc2\x82\xc3\x82\xc2\x92":{x:-589.98,y:-561}}}}},b={dependencies:{"GET Request":{id:"GET Request",defaultStyle:{icon:"fa-server"},namespace:"HTTP",description:"Performs a HTTP GET request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:n(79118).Get.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Http.flyde.js",export:"Get"}},"Get Attribute":{id:"Get Attribute",searchKeywords:["pick","dot"],namespace:"Objects",defaultStyle:{icon:"fa-magnifying-glass"},description:"Gets an attribute from an object",inputs:{object:{description:"Object to get attribute from"},attribute:{description:"Attribute to get"}},outputs:{value:{description:"The value of the attribute"}},customViewCode:'{{#if inputs.attribute}}\n Get "{{inputs.attribute}}"\n{{else}}\n Get Attribute\n{{/if}}',run:n(21518).GetAttribute.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Objects.flyde.js",export:"GetAttribute"}}},flow:{imports:{"@flyde/stdlib":["GET Request","Get Attribute"]},node:{instances:[{pos:{x:-586.4493664550781,y:56.1908282470703},id:"Format Response-c3048ti",inputConfig:{},node:{id:"Format Response",inputs:{object:{mode:"required"}},outputs:{value:{delayed:!1}},instances:[{id:"Inline-value-Hello from ${i76",node:{id:"Inline-value-Looks like you",inputs:{country:{mode:"required"},capital:{mode:"required"}},outputs:{value:{delayed:!1}},runFnRawCode:"const result = (`Looks like you're from ${inputs.country} (capital - ${inputs.capital})`); Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"`Looks like you're from ${inputs.country} (capital - ${inputs.capital})`",dataBuilderSource:"YExvb2tzIGxpa2UgeW91J3JlIGZyb20gJHtpbnB1dHMuY291bnRyeX0gKGNhcGl0YWwgLSAke2lucHV0cy5jYXBpdGFsfSlg",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"},inputConfig:{},pos:{x:-650.8740991210938,y:270.8550616455078}},{id:"Get Attribute-217",nodeId:"Get Attribute",inputConfig:{attribute:{mode:"static",value:"data.capital"}},pos:{x:-444.1219165039063,y:143.72219421386717}},{id:"Get Country Name And Capital-srp46ei",nodeId:"Get Attribute",inputConfig:{attribute:{mode:"static",value:"data.name"}},pos:{x:-748.3599536132813,y:152.79966308593748}}],defaultStyle:{size:"large",color:"#00f5d4"},inputsPosition:{object:{x:-528.8314208984375,y:21.18914794921875}},outputsPosition:{value:{x:-492.3875732421875,y:445.4477171897888}},connections:[{from:{insId:"Get Country Name And Capital-srp46ei",pinId:"value"},to:{insId:"Inline-value-Hello from ${i76",pinId:"country"}},{from:{insId:"Get Attribute-217",pinId:"value"},to:{insId:"Inline-value-Hello from ${i76",pinId:"capital"}},{from:{insId:"__this",pinId:"object"},to:{insId:"Get Country Name And Capital-srp46ei",pinId:"object"}},{from:{insId:"__this",pinId:"object"},to:{insId:"Get Attribute-217",pinId:"object"}},{from:{insId:"Inline-value-Hello from ${i76",pinId:"value"},to:{pinId:"value",insId:"__this"}}],completionOutputs:["value"]},style:{size:"large",icon:"pencil",color:"#00f5d4"}},{pos:{x:-568.6907110608287,y:-46.22288864604303},id:"j5wyu9nbflija607zg7030gb",inputConfig:{},nodeId:"GET Request"}],connections:[{from:{insId:"Format Response-c3048ti",pinId:"value"},to:{insId:"__this",pinId:"output"}},{from:{insId:"j5wyu9nbflija607zg7030gb",pinId:"data"},to:{insId:"Format Response-c3048ti",pinId:"object"}}],id:"ApisCombination",inputs:{},outputs:{output:{type:"any",optional:!1,delayed:!1}},inputsPosition:{city:{x:-187.27285824815934,y:-14.13215209416181}},outputsPosition:{json:{x:-441.98276309426666,y:480.38719404276554},na:{x:-441.98276309426666,y:480.38719404276554},result:{x:-499.82438378976735,y:706.7650396699393},output:{x:-524.3136059489467,y:180.95270159220047},response:{x:-500.61566893722795,y:421.9045791861946}},completionOutputs:["output"]}}},I={dependencies:{Interval:{id:"Interval",namespace:"Control Flow",defaultStyle:{icon:"fa-clock"},description:"Emits a value every interval",inputs:{value:{description:"Value to emit"},interval:{description:"Interval in milliseconds"}},reactiveInputs:["value","interval"],outputs:{value:{description:"Emitted value"}},completionOutputs:[],run:n(43920).Interval.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Interval"}},"Accumulate Values by Count":{id:"Accumulate Values by Count",defaultStyle:{icon:"fa-basket-shopping"},namespace:"Lists",description:'Accumulates values sent to the "value" input. After the specified count it emits the accumulated values and resets the accumulator.',inputs:{value:{description:"The value to accumulate"},count:{description:"Number of values to accumulate before emitting them"}},reactiveInputs:["value"],outputs:{accumulated:{description:"The accumulated values"}},completionOutputs:["accumulated"],run:n(67040).AccumulateValuesByCount.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Lists.flyde.js",export:"AccumulateValuesByCount"}},"Round Robin 3":{id:"Round Robin 3",namespace:"Control Flow",description:"Item will be emitted to one of the three outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:n(43920).RoundRobin3.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"RoundRobin3"}},"Loop List":{id:"Loop List",defaultStyle:{icon:"fa-list"},namespace:"Lists",searchKeywords:["each","spread"],description:"Emits all values in a list",inputs:{list:{description:"The list to loop"}},outputs:{item:{description:"Will emit a value for each item in the list"},index:{description:"Will emit the index of the item"},length:{description:"Will emit the length of the list"}},run:n(67040).LoopList.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Lists.flyde.js",export:"LoopList"}}},flow:{imports:{"@flyde/stdlib":["Interval","Accumulate Values by Count","Loop List","Round Robin 3"]},node:{instances:[{pos:{x:-631.5591588310128,y:-398.1038369497917},id:"ghunnjxvc8lzz9ir1n7a5cv9",inputConfig:{interval:{mode:"static",value:3141},value:{mode:"static",value:""}},visibleInputs:["interval"],nodeId:"Interval"},{pos:{x:-621.8109288505441,y:-147.24308865877606},id:"zhz7csy5btxnhjsy3k51kj9g",inputConfig:{count:{mode:"static",value:3}},nodeId:"Accumulate Values by Count"},{pos:{x:-734.33669921875,y:-223.71463256835938},id:"Inline-value-beep-d5048it",inputConfig:{},node:{id:"Inline-value-beep",inputs:{},outputs:{value:{delayed:!1}},runFnRawCode:'const result = ("beep"); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"beep"',dataBuilderSource:"ImJlZXAi",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"},style:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-606.1128833007813,y:-224.51904541015625},id:"ApisCombination-u01482r",inputConfig:{},node:{id:"Inline-value-boop",inputs:{},outputs:{value:{delayed:!1}},runFnRawCode:'const result = ("boop"); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"boop"',dataBuilderSource:"ImJvb3Ai",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"},style:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-648.7103934472225,y:-316.292033067738},id:"akc8kvij9dns3euqp01iijtd",inputConfig:{},nodeId:"Round Robin 3"},{pos:{x:-480.1188427734375,y:-225.620185546875},id:"ApisCombination-wn048ny",inputConfig:{},node:{id:"Inline-value-bop",inputs:{},outputs:{value:{delayed:!1}},runFnRawCode:'const result = ("bop"); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"bop"',dataBuilderSource:"ImJvcCI=",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"},style:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-545.0292446458609,y:-57.809316679619855},id:"rjyjsbcahykm15dllqw8tlzj",inputConfig:{},nodeId:"Loop List"}],connections:[{from:{insId:"ghunnjxvc8lzz9ir1n7a5cv9",pinId:"value"},to:{insId:"akc8kvij9dns3euqp01iijtd",pinId:"value"}},{from:{insId:"akc8kvij9dns3euqp01iijtd",pinId:"r1"},to:{insId:"Inline-value-beep-d5048it",pinId:"__trigger"}},{from:{insId:"akc8kvij9dns3euqp01iijtd",pinId:"r2"},to:{insId:"ApisCombination-u01482r",pinId:"__trigger"}},{from:{insId:"akc8kvij9dns3euqp01iijtd",pinId:"r3"},to:{insId:"ApisCombination-wn048ny",pinId:"__trigger"}},{from:{insId:"Inline-value-beep-d5048it",pinId:"value"},to:{insId:"zhz7csy5btxnhjsy3k51kj9g",pinId:"value"}},{from:{insId:"ApisCombination-u01482r",pinId:"value"},to:{insId:"zhz7csy5btxnhjsy3k51kj9g",pinId:"value"}},{from:{insId:"ApisCombination-wn048ny",pinId:"value"},to:{insId:"zhz7csy5btxnhjsy3k51kj9g",pinId:"value"}},{from:{insId:"zhz7csy5btxnhjsy3k51kj9g",pinId:"accumulated"},to:{insId:"rjyjsbcahykm15dllqw8tlzj",pinId:"list"}},{from:{insId:"rjyjsbcahykm15dllqw8tlzj",pinId:"item"},to:{insId:"__this",pinId:"output"}}],id:"ApisCombination",inputs:{},outputs:{output:{type:"any",optional:!1,delayed:!1}},inputsPosition:{city:{x:-187.27285824815934,y:-14.13215209416181}},outputsPosition:{json:{x:-441.98276309426666,y:480.38719404276554},na:{x:-441.98276309426666,y:480.38719404276554},result:{x:-499.82438378976735,y:706.7650396699393},output:{x:-565.3591992106655,y:68.60921099161453},response:{x:-500.61566893722795,y:421.9045791861946}}}}},C=[{preview:"Open Source",title:"Open Source and Transparent",description:o.createElement(o.Fragment,null,o.createElement("p",null,"In Flyde, nothing is hidden. From node implementation, to runtime code. Easily access the code behind each node in Flyde\u2019s standard library."),o.createElement("p",null,"Everything needed to run Flyde flows is"," ",o.createElement("strong",null,"open-source and MIT licensed."))),image:n(43033).Z,imageCaption:"Double click on nodes to jump to their implementation",id:"open-source"},{preview:"CI/CD & Git Friendly",title:"Integrates With Existing Workflows. Doesn\u2019t Replace them.",description:o.createElement(o.Fragment,null,o.createElement("p",null,"Create Flyde flows right from your IDE. Wrap existing TypeScript code in a Flyde node and use it in your flows. Run flows from existing TypeScript code, from arbitrary CLI scripts, to HTTP request handlers, and even front-end code."),o.createElement("p",null,"Flows can be version-controlled, and be part ",o.createElement("strong",null,"CI/CD")," ","pipelines, just like regular text-based code.")),image:n(39415).Z,imageCaption:"Flyde flows and TypeScript code live side by side",id:"git-friendly"},{preview:"Visual Editor",title:"Reason About Programs in New Ways",image:n(61744).Z,imageCaption:"Visualize data flow and view data passing through nodes",description:o.createElement(o.Fragment,null,o.createElement("p",null,"Unlock new ways to think about, and debug your programs. Have an always-correct diagram of your program."),o.createElement("p",null,"Flyde\u2019s flow-based, visual approach makes asynchronous and concurrent tasks simpler and intuitive.")),id:"visual-editor"},{preview:"Flexible & Powerful",title:"Flexible and Powerful",description:o.createElement(o.Fragment,null,o.createElement("p",null,"Built on a functional-reactive foundation, Flyde enables more than simple input/output flows. It supports everything you'd expect from a textual-based language; recursions, loops and conditionals.")),image:n(42016).Z,imageCaption:"Fibonacci sequence in Flyde - a recursive flow example",id:"flexible-powerful"}],x=[{label:"Beep Boop",flow:I,playgroundUrl:"https://play.flyde.dev/?flow=hello-world"},{label:"Hello World",flow:g,tip:'Try double clicking on the "World" node to change the string.',playgroundUrl:"https://play.flyde.dev/?flow=hello-world"},{label:"Debounce/Throttle",flow:y,tip:"Try changing the delay time.",playgroundUrl:"https://play.flyde.dev/?flow=hello-world"},{label:"HTTP Requests",flow:b,tip:'Double click "Format Response" to see how it is implemented.',playgroundUrl:"https://play.flyde.dev/?flow=hello-world"}];function w(){const[e,t]=o.useState(x[0]);return o.createElement("div",{className:(0,a.default)("hero hero--primary",r.Z.heroBanner)},o.createElement("div",{className:"container"},o.createElement("div",{className:"content-wrapper"},o.createElement("a",{className:"github-star",href:"https://www.github.com/flydelabs/flyde",target:"_blank"},o.createElement(v,null)," ",o.createElement("span",null,"Star us on GitHub")),o.createElement("h1",{className:"hero__title"},o.createElement("div",{className:"font-thin"},"Visual Programming."),o.createElement("div",null,"For Developers")),o.createElement("p",{className:"hero__subtitle"},"Open source, runs in"," ",o.createElement("a",{href:"https://marketplace.visualstudio.com/items?itemName=flyde.flyde-vscode",target:"_blank"},"VS Code"),", integrates with existing ",o.createElement("strong",null,"TypeScript")," code, browser and Node.js."),o.createElement("div",{className:"buttons-container"},o.createElement(h.Z,{className:"button button--primary button--lg ",href:"https://marketplace.visualstudio.com/items?itemName=flyde.flyde-vscode"},"Quickstart"),o.createElement(h.Z,{className:"button button--secondary button--lg ",to:"https://play.flyde.dev"},"Playground"))),o.createElement("div",{className:"example-container"},o.createElement(m,{example:e,key:e.label}),e.tip?o.createElement("div",{className:"example-tip"},"Pssst.. ",e.tip," \xa0"):null,o.createElement("div",{className:"example-actions"},x.map((n=>o.createElement("button",{key:n.label,className:"button button--sm example-button "+(n.label===e.label?"button--primary":"button--secondary"),onClick:()=>t(n)},n.label)))))))}function _(){const{siteConfig:e}=(0,i.Z)();return(0,o.useEffect)((()=>{document.querySelectorAll('a[href^="#"]').forEach((e=>{e.addEventListener("click",(function(e){e.preventDefault();let t=this.getAttribute("href"),n=document.querySelector(t);n&&window.scrollTo({top:n.offsetTop-100,behavior:"smooth"})}))}))}),[]),o.createElement(s.Z,{title:"Flyde",description:"Flyde, open-source visual programming language. Runs in the IDE, integrates with existing TypeScript code, browser and Node.js."},o.createElement(w,null),o.createElement("section",{className:"features-strip"},C.map((e=>o.createElement("div",{className:"feature-highlight",key:e.title},o.createElement("a",{href:`#${e.id}`},e.preview))))),C.map((e=>o.createElement("section",{className:"feature-strip",id:e.id},o.createElement("div",{className:"feature-strip-inner"},o.createElement("div",{className:"image-container"},o.createElement("img",{src:e.image}),o.createElement("div",{className:"image-caption"},e.imageCaption)),o.createElement("div",{className:"content-container"},o.createElement("h3",null,e.title),o.createElement("div",{className:"feature-description"},e.description)))))))}},73949:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={"flyde-flow-editor":"flyde-flow-editor_AAD4",_hj_feedback_container:"_hj_feedback_container_Af03"}},85721:(e,t,n)=>{var o={"./af":47654,"./af.js":47654,"./ar":61325,"./ar-dz":98344,"./ar-dz.js":98344,"./ar-kw":26230,"./ar-kw.js":26230,"./ar-ly":42524,"./ar-ly.js":42524,"./ar-ma":44119,"./ar-ma.js":44119,"./ar-sa":82625,"./ar-sa.js":82625,"./ar-tn":42182,"./ar-tn.js":42182,"./ar.js":61325,"./az":37093,"./az.js":37093,"./be":32721,"./be.js":32721,"./bg":59919,"./bg.js":59919,"./bm":95594,"./bm.js":95594,"./bn":563,"./bn-bd":41757,"./bn-bd.js":41757,"./bn.js":563,"./bo":73211,"./bo.js":73211,"./br":87438,"./br.js":87438,"./bs":83662,"./bs.js":83662,"./ca":61196,"./ca.js":61196,"./cs":5841,"./cs.js":5841,"./cv":85251,"./cv.js":85251,"./cy":24512,"./cy.js":24512,"./da":37539,"./da.js":37539,"./de":5059,"./de-at":53853,"./de-at.js":53853,"./de-ch":99378,"./de-ch.js":99378,"./de.js":5059,"./dv":91454,"./dv.js":91454,"./el":39651,"./el.js":39651,"./en-au":87953,"./en-au.js":87953,"./en-ca":98193,"./en-ca.js":98193,"./en-gb":61980,"./en-gb.js":61980,"./en-ie":14050,"./en-ie.js":14050,"./en-il":6502,"./en-il.js":6502,"./en-in":555,"./en-in.js":555,"./en-nz":11372,"./en-nz.js":11372,"./en-sg":26568,"./en-sg.js":26568,"./eo":69533,"./eo.js":69533,"./es":68327,"./es-do":17620,"./es-do.js":17620,"./es-mx":96467,"./es-mx.js":96467,"./es-us":83272,"./es-us.js":83272,"./es.js":68327,"./et":68523,"./et.js":68523,"./eu":19066,"./eu.js":19066,"./fa":59087,"./fa.js":59087,"./fi":96443,"./fi.js":96443,"./fil":93979,"./fil.js":93979,"./fo":90383,"./fo.js":90383,"./fr":56327,"./fr-ca":25610,"./fr-ca.js":25610,"./fr-ch":97274,"./fr-ch.js":97274,"./fr.js":56327,"./fy":67442,"./fy.js":67442,"./ga":44291,"./ga.js":44291,"./gd":77342,"./gd.js":77342,"./gl":96248,"./gl.js":96248,"./gom-deva":21404,"./gom-deva.js":21404,"./gom-latn":20833,"./gom-latn.js":20833,"./gu":9122,"./gu.js":9122,"./he":74623,"./he.js":74623,"./hi":60364,"./hi.js":60364,"./hr":30860,"./hr.js":30860,"./hu":70441,"./hu.js":70441,"./hy-am":90425,"./hy-am.js":90425,"./id":29672,"./id.js":29672,"./is":96150,"./is.js":96150,"./it":27852,"./it-ch":55603,"./it-ch.js":55603,"./it.js":27852,"./ja":16465,"./ja.js":16465,"./jv":20120,"./jv.js":20120,"./ka":87245,"./ka.js":87245,"./kk":21479,"./kk.js":21479,"./km":65038,"./km.js":65038,"./kn":63060,"./kn.js":63060,"./ko":85020,"./ko.js":85020,"./ku":90582,"./ku.js":90582,"./ky":34950,"./ky.js":34950,"./lb":94201,"./lb.js":94201,"./lo":87894,"./lo.js":87894,"./lt":70120,"./lt.js":70120,"./lv":4265,"./lv.js":4265,"./me":14030,"./me.js":14030,"./mi":9463,"./mi.js":9463,"./mk":25898,"./mk.js":25898,"./ml":64233,"./ml.js":64233,"./mn":47156,"./mn.js":47156,"./mr":34479,"./mr.js":34479,"./ms":24691,"./ms-my":6456,"./ms-my.js":6456,"./ms.js":24691,"./mt":81789,"./mt.js":81789,"./my":37452,"./my.js":37452,"./nb":91170,"./nb.js":91170,"./ne":87529,"./ne.js":87529,"./nl":81776,"./nl-be":24455,"./nl-be.js":24455,"./nl.js":81776,"./nn":34705,"./nn.js":34705,"./oc-lnc":36139,"./oc-lnc.js":36139,"./pa-in":17960,"./pa-in.js":17960,"./pl":1899,"./pl.js":1899,"./pt":31670,"./pt-br":29159,"./pt-br.js":29159,"./pt.js":31670,"./ro":55115,"./ro.js":55115,"./ru":45149,"./ru.js":45149,"./sd":81231,"./sd.js":81231,"./se":35397,"./se.js":35397,"./si":99786,"./si.js":99786,"./sk":39383,"./sk.js":39383,"./sl":68691,"./sl.js":68691,"./sq":34826,"./sq.js":34826,"./sr":40080,"./sr-cyrl":75673,"./sr-cyrl.js":75673,"./sr.js":40080,"./ss":54309,"./ss.js":54309,"./sv":52245,"./sv.js":52245,"./sw":8967,"./sw.js":8967,"./ta":10454,"./ta.js":10454,"./te":35204,"./te.js":35204,"./tet":81571,"./tet.js":81571,"./tg":15737,"./tg.js":15737,"./th":41786,"./th.js":41786,"./tk":50511,"./tk.js":50511,"./tl-ph":14828,"./tl-ph.js":14828,"./tlh":62422,"./tlh.js":62422,"./tr":97047,"./tr.js":97047,"./tzl":90792,"./tzl.js":90792,"./tzm":67730,"./tzm-latn":59963,"./tzm-latn.js":59963,"./tzm.js":67730,"./ug-cn":42535,"./ug-cn.js":42535,"./uk":33151,"./uk.js":33151,"./ur":22750,"./ur.js":22750,"./uz":61914,"./uz-latn":60231,"./uz-latn.js":60231,"./uz.js":61914,"./vi":55517,"./vi.js":55517,"./x-pseudo":64078,"./x-pseudo.js":64078,"./yo":70046,"./yo.js":70046,"./zh-cn":81832,"./zh-cn.js":81832,"./zh-hk":90953,"./zh-hk.js":90953,"./zh-mo":38236,"./zh-mo.js":38236,"./zh-tw":71001,"./zh-tw.js":71001};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=s,e.exports=i,i.id=85721},42016:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o=n.p+"assets/images/fibo-cdbc5936ed3856df4928019564ef82dd.gif"},39415:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o=n.p+"assets/images/integrates-cd9b83d7c4fb96804f2ff6edb5e19fcd.gif"},43033:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o=n.p+"assets/images/transparent-25618eaa2d7966dceddf11fb5f2c1108.gif"},61744:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o=n.p+"assets/images/visual-b1b598cd76a44cfb7ae65dec6aeaaa41.gif"}}]); \ No newline at end of file diff --git a/assets/js/3f72396a.9bf60090.js b/assets/js/3f72396a.3b1372cf.js similarity index 65% rename from assets/js/3f72396a.9bf60090.js rename to assets/js/3f72396a.3b1372cf.js index 7cf9029b9..c7d5a78d1 100644 --- a/assets/js/3f72396a.9bf60090.js +++ b/assets/js/3f72396a.3b1372cf.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6007],{19121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cappedArrayDebounce=void 0;t.cappedArrayDebounce=function(e,t,n,o){void 0===o&&(o=500);let i=[],s=null,r=null;return{addItem:a=>{clearTimeout(s),i.push(a),r||(r=setTimeout((()=>{e(i),clearTimeout(s),r=null}),o)),i.length>=n?(e(i),clearTimeout(r),r=null,i=[]):s=setTimeout((()=>{e(i),clearTimeout(r),r=null,i=[]}),t)},flush:()=>{i.length&&(e(i),i=[],clearTimeout(r))},pendingItems:()=>i.length}}},59792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.dataShaper=t.DataShapeType=void 0,function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.ARRAY=3]="ARRAY",e[e.OBJECT=4]="OBJECT",e[e.NULL=5]="NULL",e[e.UNSUPPORTED=6]="UNSUPPORTED"}(n=t.DataShapeType||(t.DataShapeType={}));const o={string:n.STRING,number:n.NUMBER,boolean:n.BOOLEAN,object:n.OBJECT,array:n.ARRAY,null:n.NULL,symbol:n.UNSUPPORTED,undefined:n.UNSUPPORTED,function:n.UNSUPPORTED,bigint:n.UNSUPPORTED};t.dataShaper=function(e,n,i){void 0===n&&(n=5),void 0===i&&(i=5);const s=null===(r=e)?"null":typeof r;var r,a;if("object"===s){if(Array.isArray(e))return n>1?e.filter(((e,t)=>t(0,t.dataShaper)(e,n-1,i))):o.array;if(n>1){const o={};for(const s in e)o[s]=(0,t.dataShaper)(e[s],n-1,i);return a=o,Object.keys(a).sort().reduce(((e,t)=>(e[t]=a[t],e)),{})}return o.object}return o[s]}},23046:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.debugLogger=void 0;const i=(0,o(n(55899)).default)("flyde");t.debugLogger=e=>i.extend(e)},24331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullInsIdPath=void 0,t.fullInsIdPath=function(e,t){if(!e)throw new Error("insId is not defined");return t?`${t}.${e}`:e}},34459:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hashFlow=t.hashNode=void 0;const i=o(n(68805)),s=n(30292),r=e=>(0,i.default)(e);t.hashNode=function(e,t){var n;void 0===t&&(t=!0);const{id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:c}=e,l={id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:c};if((0,s.isVisualNode)(e)){const{instances:n,connections:o,inputsPosition:i,outputsPosition:s}=e,a=n.map((e=>{const{pos:t,...n}=e;return n})),u=t?{}:{inputsPosition:i,outputsPosition:s},c=t?a:n;c.sort(((e,t)=>e.id.localeCompare(t.id)));const d=[...o];d.sort(((e,t)=>{const n=`${e.from.insId}.${e.from.pinId}`,o=`${t.from.insId}.${t.from.pinId}`;return n.localeCompare(o)}));const p=JSON.stringify({instancesToUse:c,conns:d,...l,maybeIoPos:u});return r(p)}if((0,s.isInlineValueNode)(e)){const{customViewCode:t}=e,o=null!==(n=e.fnCode)&&void 0!==n?n:e.runFnRawCode,i=JSON.stringify({fnCode:o,customViewCode:t,...l});return r(i)}throw new Error("Hashing code nodes unsupported")};t.hashFlow=e=>{const{node:n,imports:o}=e,i=(0,t.hashNode)(n,!1),s=Object.entries(null!=o?o:{}).sort(((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)})).map((e=>{let[t,n]=e;return[t,n.sort()]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{}),a=JSON.stringify(s);return r(i+a)}},86873:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DepGraph=void 0,i(n(3172),t),i(n(59962),t),i(n(23046),t),i(n(19121),t),i(n(59962),t),i(n(34459),t),i(n(39043),t),i(n(59792),t),i(n(24331),t),t.DepGraph=n(60359).DepGraph},3172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testDataCreator=void 0;t.testDataCreator=e=>function(t){void 0===t&&(t={});return{..."function"==typeof e?e():e,...t}}},59962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplePluralize=t.eventually=t.delay=t.noop=t.removeDupes=t.ensure=t.isOptionalType=t.callFnOrFnPromise=t.isPromise=t.isDefined=t.containsAll=t.shuffle=t.randomInts=t.repeat=t.pickRandom=t.randomPos=t.randomInt=t.pickSecond=t.pickFirst=t.fromEntries=t.entries=t.okeys=t.values=t.keys=t.filterOMap=t.mapOMap=t.middlePos=t.calcCenter=t.intersectRect=void 0;t.intersectRect=(e,t)=>{const n=e.x+e.w,o=t.x+t.w;return!(t.x>n||oe.y+e.h||t.y+t.h{let{w:t,h:n,x:o,y:i}=e;return{x:o+t/2,y:i+n/2}};t.middlePos=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});t.mapOMap=(e,n)=>(0,t.entries)(e).map((e=>{let[t,o]=e;return[t,n(t,o)]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.filterOMap=(e,n)=>(0,t.entries)(e).filter((e=>{let[t,o]=e;return n(t,o)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.keys=e=>Object.keys(e);t.values=e=>Object.values(e),t.okeys=t.keys;t.entries=e=>(0,t.okeys)(e).map((t=>[t,e[t]]));t.fromEntries=e=>e.reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.pickFirst=e=>e[0];t.pickSecond=e=>e[1];t.randomInt=function(e,t){void 0===t&&(t=0);const n=Math.random();return t+Math.floor((e-t)*n)};t.randomPos=function(e,n){void 0===e&&(e=1e3),void 0===n&&(n=0);return{x:(0,t.randomInt)(e,n),y:(0,t.randomInt)(e,n)}};t.pickRandom=e=>e[(0,t.randomInt)(e.length)];t.repeat=(e,t)=>"x".repeat(e).split("").map(((e,n)=>t(n)));t.randomInts=function(e,n,o){return void 0===n&&(n=100),void 0===o&&(o=0),(0,t.repeat)(e,(()=>(0,t.randomInt)(n,o)))};t.shuffle=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t};t.containsAll=(e,t)=>t.every((t=>e.includes(t)));t.isDefined=e=>void 0!==e;t.isPromise=e=>e&&"function"==typeof e.then;t.callFnOrFnPromise=(e,n)=>{if(!(0,t.isDefined)(e))return;const o=e=>{try{e()}catch(t){console.error(n,t)}};"function"==typeof e?o(e):Promise.resolve(e).then((e=>{"function"==typeof e&&o(e)}))};t.isOptionalType=e=>/\?$/.test(e);t.ensure=(e,t)=>{if(void 0===e)throw new Error(t||"Undefined value passed");return e};t.removeDupes=e=>Array.from(new Set(e));t.noop=()=>{};t.delay=e=>new Promise((t=>setTimeout(t,e)));t.eventually=async function(e,n,o,i){if(void 0===n&&(n=1e3),void 0===o&&(o=100),void 0===i&&(i=new Set),n<0){const e=Array.from(i).reduce(((e,t,n)=>`${e}\n\t\t${n+1}. ${t}`),"");throw new Error(`[Eventually timeout exceeded after: timeout with error]: ${e}`)}try{await e()}catch(s){const r=Date.now();await(0,t.delay)(o);const a=Date.now()-r;return i.add(null==s?void 0:s.message),(0,t.eventually)(e,n-a,o,i)}},t.simplePluralize=function(e,t){return`${e} ${t}${1!==e?"s":""}`}},39043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileObjectTemplate=t.compileStringTemplate=void 0;t.compileStringTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=new RegExp("\\$\\{"+e+"\\}","g");n=n.replace(i,o)})),n};t.compileObjectTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=JSON.stringify(o),s=new RegExp('"\\$\\$\\{'+e+'\\}"',"g"),r=new RegExp("\\$\\{"+e+"\\}","g"),a="string"==typeof o?o.replace(/"/g,((e,t,n)=>"\\"!==n[t-1]?'\\"':n[t])):o;n=n.replace(s,i).replace(r,a).replace(/\n/g,"\\n")})),JSON.parse(n)}},69150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connection=t.connectionData=t.connectionDataEquals=t.connectionNodeEquals=t.connectionNode=t.externalConnectionNode=t.isInternalConnection=t.isExternalConnection=t.isInternalConnectionNode=t.isExternalConnectionNode=t.getNodeOutputs=t.getOutputName=t.getInputName=t.getNodeInputs=t.TRIGGER_PIN_ID=t.ERROR_PIN_ID=t.THIS_INS_ID=void 0;const o=n(30292);t.THIS_INS_ID="__this",t.ERROR_PIN_ID="__error",t.TRIGGER_PIN_ID="__trigger";t.getNodeInputs=e=>({...e.inputs,[t.TRIGGER_PIN_ID]:(0,o.nodeInput)()});t.getInputName=e=>e===t.TRIGGER_PIN_ID?"Trigger Node":e;t.getOutputName=e=>e===t.ERROR_PIN_ID?"Error":e;t.getNodeOutputs=e=>({...e.outputs,[t.ERROR_PIN_ID]:(0,o.nodeOutput)()});t.isExternalConnectionNode=e=>e&&e.insId===t.THIS_INS_ID;t.isInternalConnectionNode=e=>e.insId!==t.THIS_INS_ID;t.isExternalConnection=e=>{let{from:n,to:o}=e;return(0,t.isExternalConnectionNode)(n)||(0,t.isExternalConnectionNode)(o)};t.isInternalConnection=e=>!(0,t.isExternalConnection)(e);t.externalConnectionNode=e=>({insId:t.THIS_INS_ID,pinId:e});t.connectionNode=(e,t)=>({insId:e,pinId:t});t.connectionNodeEquals=(e,t)=>e.insId===t.insId&&e.pinId===t.pinId;t.connectionDataEquals=(e,n)=>!(!e||!n)&&((0,t.connectionNodeEquals)(e.from,n.from)&&(0,t.connectionNodeEquals)(e.to,n.to)),t.connectionData=function(e,n,o){const i="string"==typeof e?e.split("."):e,s="string"==typeof n?n.split("."):n;if(i.length>2||s.length>2)throw new Error(`invalid source or target to connection data - ${e} / ${n}`);return{from:2===i.length?(0,t.connectionNode)(i[0],i[1]):(0,t.externalConnectionNode)(i[0]),to:2===s.length?(0,t.connectionNode)(s[0],s[1]):(0,t.externalConnectionNode)(s[0]),delayed:o}};t.connection=function(e,t,n){return void 0===n&&(n=!1),{from:e,to:t,delayed:n}}},6775:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;const s=n(30292),r=n(47025),a=n(86873),u=n(69150);i(n(69150),t);t.connect=function(e,t,n,o,i,c,l,d){void 0===n&&(n={}),void 0===i&&(i={}),void 0===c&&(c=a.noop),void 0===l&&(l={}),void 0===d&&(d={});const{id:p,connections:f,instances:m}=e,g=p||"connected-node"+(0,a.randomInt)(999);return{inputs:e.inputs,outputs:e.outputs,id:g,completionOutputs:e.completionOutputs,reactiveInputs:e.reactiveInputs,run:(p,h)=>{let v=[];const y=new a.DepGraph({}),I=new Map,b=new Map,C=new Map,_=new Map,j=new Map,x=new Map;let N;const P=new Set;m.forEach((e=>{const n=(0,s.getNode)(e,t),o=e.id;I.set(e,o),b.set(o,e),y.addNode(o);const i=Object.keys(n.inputs),r=Object.keys(n.outputs),a={},c={};i.forEach((t=>{const n=(e.inputConfig||{})[t]||(0,s.queueInputPinConfig)();(0,s.isStaticInputPinConfig)(n)?a[t]=(0,s.staticNodeInput)(n.value):a[t]=(0,s.dynamicNodeInput)({config:n})})),a[u.TRIGGER_PIN_ID]=(0,s.dynamicNodeInput)({config:(0,s.queueInputPinConfig)()});if(f.some((t=>(0,u.isInternalConnectionNode)(t.to)&&t.to.insId===e.id&&t.to.pinId===u.TRIGGER_PIN_ID))&&e.inputConfig&&e.inputConfig[u.TRIGGER_PIN_ID])throw"Trigger connection can not be configured";r.forEach((e=>{const t=(0,s.dynamicOutput)();c[e]=t}));f.some((t=>(0,u.isInternalConnectionNode)(t.from)&&t.from.insId===e.id&&t.from.pinId===u.ERROR_PIN_ID))&&(c[u.ERROR_PIN_ID]=(0,s.dynamicOutput)()),C.set(o,a),_.set(o,c)}));const O=new Set;return f.forEach((n=>{const{from:o,to:i}=n,{insId:r,pinId:a}=o,{insId:c,pinId:l}=i,d=_.get(r),p=C.get(c);if((0,u.isInternalConnectionNode)(i)&&O.add(`${i.insId}.${i.pinId}`),(0,u.isExternalConnection)(n)){if((0,u.isExternalConnectionNode)(o)){const e=null==p?void 0:p[i.pinId];if(!e)throw new Error(`Input ${i.pinId} of instance ${c} not found`);const t=j.get(o.pinId)||[];t.push(e),j.set(o.pinId,t)}else{let e=null==d?void 0:d[o.pinId];if(!e)throw new Error(`Output ${o.pinId} of instance ${r} not found`);const t=x.get(i.pinId)||[];t.push(e),x.set(i.pinId,t)}return}if(!d)throw new Error(`No outputs found for instance [${r}]`);if(!p)throw b.has(c)?new Error(`No inputs found for instance [${c}]`):new Error(`Instance with id [${c}] does not exist!`);const f=d[a];if(!f)throw new Error(`Output source - [${a}] not found in node [${g}]`);const m=p[l],h=b.get(r);if(!h&&r!==u.THIS_INS_ID)throw new Error(`Instance [${r}] does not exist! failed to connect [${o}] -> [${i}]`);const I=(h?(0,s.getNode)(h,t):e).outputs[a];if(I&&I.delayed||n.delayed||r!==u.THIS_INS_ID&&c!==u.THIS_INS_ID&&y.addDependency(r,c),!m)throw new Error(`Target arg - [${i}] not found in node [${g}]`);const N=f.subscribe((async e=>{if(!(0,s.isDynamicInput)(m))throw console.info(m),new Error(`Impossible state listening to non dynamic input - ${c}.${l}`);m.subject.next(e)}));v.push((()=>N.unsubscribe()))})),(0,a.okeys)(h).forEach((e=>{(x.get(e)||[]).forEach((t=>{const n=t.subscribe((async t=>{if(!h[e])throw new Error(`Impossible state - output ${e} does not exist`);h[e].next(t)}));v.push((()=>n.unsubscribe()))}))})),y.overallOrder().map((e=>b.get(e))).forEach((e=>{const a=C.get(e.id),u=_.get(e.id),p=(0,s.getNode)(e,t);if(!a)throw new Error(`Unexpected error - args not found when running ${e}`);if(!u)throw new Error(`Unexpected error - outputs not found when running ${e}`);for(const t in a){const n=e.inputConfig[t];O.has(`${e.id}.${t}`)||(0,s.isStaticInputPinConfig)(n)||delete a[t]}const f=(0,r.execute)({node:p,inputs:a,outputs:u,resolvedDeps:t,_debugger:n,insId:e.id,extraContext:d,mainState:i,ancestorsInsIds:o,onBubbleError:c,onCompleted:()=>{return t=e.id,P.delete(t),void(0===P.size&&N&&N());var t},onStarted:()=>{return t=e.id,void P.add(t);var t},env:l});v.push(f)})),Object.keys(p).forEach((async e=>{(j.get(e)||[]).forEach((t=>{const n=p[e];if(!(0,s.isDynamicInput)(t))throw new Error(`Unsure what to do with key ${e}, input: ${t} of ins ${o}`);(0,a.isDefined)(n)&&t.subject.next(n)}))})),void 0===e.completionOutputs&&P.size>0?new Promise((e=>{N=e})):()=>v.forEach((e=>{try{e()}catch(t){console.error("error unsubscribing",t)}}))}}}},26488:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MINOR_DEBUGGER_EVENT_TYPES=t.MAJOR_DEBUGGER_EVENT_TYPES=t.DebuggerEventType=void 0,function(e){e.INPUT_CHANGE="i",e.OUTPUT_CHANGE="o",e.PROCESSING_CHANGE="pc",e.ERROR="err",e.INPUTS_STATE_CHANGE="isc"}(n=t.DebuggerEventType||(t.DebuggerEventType={})),t.MAJOR_DEBUGGER_EVENT_TYPES=[n.INPUT_CHANGE,n.OUTPUT_CHANGE,n.ERROR],t.MINOR_DEBUGGER_EVENT_TYPES=[n.PROCESSING_CHANGE,n.INPUTS_STATE_CHANGE]},43686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatEvent=void 0;const o=n(26488);t.formatEvent=function(e){var t,n,i;const s=[e.insId,...null!==(n=null===(t=e.ancestorsInsIds)||void 0===t?void 0:t.split("."))&&void 0!==n?n:[]];(null===(i=e.ancestorsInsIds)||void 0===i?void 0:i.length)>0&&e.ancestorsInsIds;const r=`Node <${e.nodeId}> `,a=`(${s.join(" -> ")})`;return`${r} - ${function(e){switch(e.type){case o.DebuggerEventType.PROCESSING_CHANGE:return e.val?"started processing":"stopped processing";case o.DebuggerEventType.INPUT_CHANGE:return`Input pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.OUTPUT_CHANGE:return`Output pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.INPUTS_STATE_CHANGE:return`Inputs queue size changed to ${Object.entries(e.val).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join(", ")}`;case o.DebuggerEventType.ERROR:return`Error: ${e.val}`}}(e)} ${a}`}},99896:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26488),t),i(n(43686),t)},47025:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.GLOBAL_STATE_NS=t.ROOT_INS_ID=t.INPUTS_STATE_SUFFIX=t.INNER_STATE_SUFFIX=void 0;const s=n(62600),r=n(87794);i(n(99896),t);const a=n(30292),u=n(6775),c=n(84479),l=n(86873),d=n(23046),p=n(30292),f=n(99896),m=n(79804);t.INNER_STATE_SUFFIX="_inner",t.INPUTS_STATE_SUFFIX="_inputs";t.ROOT_INS_ID="__root",t.GLOBAL_STATE_NS="____global";t.execute=e=>{let{node:n,inputs:o,outputs:i,resolvedDeps:g,_debugger:h={},insId:v=t.ROOT_INS_ID,extraContext:y={},mainState:I={},ancestorsInsIds:b,onBubbleError:C=s.noop,env:_={},onCompleted:j=s.noop,onStarted:x=s.noop}=e;const N=[];I[t.GLOBAL_STATE_NS]||(I[t.GLOBAL_STATE_NS]=new Map);const P={...y,ENV:_},O=(0,m.customNodesToNodesCollection)(g,P),w=e=>{const t=e instanceof a.NodeInstanceError?e:new a.NodeInstanceError(e,(0,l.fullInsIdPath)(v,b),n.id);h.onEvent&&h.onEvent({type:f.DebuggerEventType.ERROR,val:t,insId:v,ancestorsInsIds:b,nodeId:n.id}),i[u.ERROR_PIN_ID]?i[u.ERROR_PIN_ID].next(t):C(t)},E=(e=>(0,a.isVisualNode)(e)?(0,u.connect)(e,O,h,(0,l.fullInsIdPath)(v,b),I,w,_,y):(0,a.isInlineValueNode)(e)?(0,m.inlineValueNodeToNode)(e,P):e)(n),S=h.onEvent||s.noop,D={},M={};(0,l.entries)(o).forEach((e=>{let[t,o]=e;if((0,a.isDynamicInput)(o)){const e=(0,a.dynamicNodeInput)({config:o.config}),i=o.subject.subscribe((async o=>{const i=S({type:f.DebuggerEventType.INPUT_CHANGE,insId:v,pinId:t,val:o,ancestorsInsIds:b,nodeId:n.id});if(i){const t=await i.valuePromise;e.subject.next(t)}else h.debugDelay&&await(0,l.delay)(h.debugDelay),e.subject.next(o)}));N.push((()=>i.unsubscribe())),M[t]=e}else{S({type:f.DebuggerEventType.INPUT_CHANGE,insId:v,pinId:t,val:o.config.value,ancestorsInsIds:b,nodeId:n.id});const e=(0,a.staticNodeInput)((0,a.getStaticValue)(o.config.value,O,v));M[t]=e}})),(0,l.entries)(i).forEach((e=>{let[t,o]=e;const i=(0,a.dynamicOutput)(),s=i.subscribe((async e=>{const i=S({type:f.DebuggerEventType.OUTPUT_CHANGE,insId:v,pinId:t,val:e,ancestorsInsIds:b,nodeId:n.id});if(i){const e=await i.valuePromise;o.next(e)}else o.next(e)}));N.push((()=>s.unsubscribe())),D[t]=i}));const T=(e=>{var n,o;const{node:i,inputs:u,outputs:m,resolvedDeps:g,_debugger:h,insId:v,ancestorsInsIds:y,mainState:I,onError:b,onStarted:C,onCompleted:_,env:j,extraContext:x}=e,{run:N,fn:P}=i,O=(0,d.debugLogger)("core"),w=[];let E;const S=(null==h?void 0:h.onEvent)||s.noop,D=(0,l.fullInsIdPath)(v,y),M=`${D}${t.INNER_STATE_SUFFIX}`,T=`${D}${t.INPUTS_STATE_SUFFIX}`,k=O.extend(D),R=I[t.GLOBAL_STATE_NS];I[M]||(I[M]=new Map),I[T]||(I[T]=new Map);let A=null!==(n=I[T])&&void 0!==n?n:new Map;const V=()=>{const e=Array.from(A.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:(0,a.isQueueInputPinConfig)(u[n].config)?null==o?void 0:o.length:1}}),{});S({type:f.DebuggerEventType.INPUTS_STATE_CHANGE,val:e,insId:v,ancestorsInsIds:y,nodeId:i.id})},H={execute:(e,n,o,i)=>(0,t.execute)({node:e,inputs:n,outputs:o,resolvedDeps:g,_debugger:h,insId:i,onCompleted:_,onStarted:C}),insId:v,state:null!==(o=I[M])&&void 0!==o?o:new Map,onCleanup:e=>{w.push(e)},onError:e=>{b(e)},context:null!=x?x:{},ancestorsInsIds:y,globalState:R};let $,z=!1;const G=(i.reactiveInputs||[]).filter((e=>{var t;return!(0,p.isStaticInputPinConfig)(null===(t=u[e])||void 0===t?void 0:t.config)})),L=()=>{var e;null===(e=I[M])||void 0===e||e.clear(),(0,l.keys)(I).filter((e=>e.startsWith(`${D}.`))).forEach((e=>{I[e]=new Map}))},F=e=>{const t=(null==e?void 0:e.key)&&G.includes(null==e?void 0:e.key);if(z&&!t);else{const o=z&&t;if((0,c.isNodeStateValid)(u,A,i)||o){let t;if(z){if(!e)throw new Error("Unexpected state, got reactive node while not processing and not valid");const n=(0,c.pullValueForExecution)(e.key,u[e.key],A,j);t={...$,[e.key]:n},V()}else t=(0,c.pullValuesForExecution)(u,A,j),$=t,V();let o=new Set,s={};if(z=!0,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:v,ancestorsInsIds:y,nodeId:i.id}),i.completionOutputs){const e=i.completionOutputs.map((e=>e.split("+"))).reduce(((e,t)=>(t.forEach((n=>{e.set(n,t)})),e)),new Map);(0,l.entries)(m).forEach((t=>{let[n,a]=t;a.pipe((0,r.first)()).subscribe((t=>{o.add(n),s[n]=t;let r=e.get(n);r&&(r.splice(r.indexOf(n),1),0===r.length&&(z=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:v,ancestorsInsIds:y,nodeId:i.id}),_&&_(s),L(),(0,l.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),E=void 0,o.clear(),s={},(0,c.hasNewSignificantValues)(u,A,j,i.id)&&F()))}))}))}else(0,l.entries)(m).forEach((e=>{let[t,n]=e;n.subscribe((e=>{s[t]=e}))}));try{k("Running node %s with values %o",i.id,t),C&&C(),E=(null!=P?P:N)(t,m,H),(0,l.isPromise)(E)?E.then((()=>{void 0===i.completionOutputs&&_&&(z=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:v,ancestorsInsIds:y,nodeId:i.id}),_(s),L(),(0,c.hasNewSignificantValues)(u,A,j,i.id)&&F())})).catch((e=>{b(e),z=!1,k("Error in node %s - value %e",i.id,e),S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:v,ancestorsInsIds:y,nodeId:i.id})})):void 0===i.completionOutputs&&_&&(z=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:v,ancestorsInsIds:y,nodeId:i.id}),_(s),L())}catch(n){b(n),z=!1,k("Error in node %s - value %e",i.id,n),S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:v,ancestorsInsIds:y,nodeId:i.id})}const d=G.find((e=>u[e]&&(0,c.peekValueForExecution)(e,u[e],A,j,i.id)));if(d){const e=(0,c.peekValueForExecution)(d,u[d],A,j,i.id);F({key:d,value:e})}else{const e=(0,l.entries)(u).find((e=>{let[t,n]=e;const o=(0,a.isQueueInputPinConfig)(n.config),s=(0,c.peekValueForExecution)(t,n,A,j,i.id);return!!o&&(0,l.isDefined)(s)}));if(e){const[t,n]=e,o=(0,c.peekValueForExecution)(t,n,A,j,i.id);F({key:t,value:o})}}}}};F();const q=(0,c.subscribeInputsToState)(u,A,((e,t)=>{O("Got input %s - value is [%o]",e,t),V();try{F({key:e,value:t})}catch(n){b(n)}}));return w.push(q),()=>{(0,l.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),w.forEach((e=>e()))}})({node:E,inputs:M,outputs:D,resolvedDeps:O,_debugger:h,insId:v,mainState:I,ancestorsInsIds:b,onError:w,onBubbleError:C,env:_,extraContext:y,onCompleted:j,onStarted:x});return()=>{N.forEach((e=>e())),T()}}},84479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeInputsToState=t.isNodeStateValid=t.hasNewSignificantValues=t.peekValuesForExecution=t.pullValuesForExecution=t.pullValueForExecution=t.peekValueForExecution=void 0;const o=n(30292),i=n(86873),s=n(6775),r=(e,t)=>{const n=(0,o.extractStaticValue)(e);if((0,o.isEnvValue)(n)){return((e,t)=>{const n=e.split(".");let o={...t};for(let s of n){if(!o||!(0,i.isDefined)(o[s])||null===o[s])throw new Error(`Cannot find key ${e} inside obj ${t}`);o=o[s]}return o})((0,o.getEnvKeyFromValue)(n),t)}return n};t.peekValueForExecution=(e,t,n,i,s)=>{const a=n.get(e);let u;if(!t)throw new Error(`Trying to peek value of inexsting input in key "${e}" in node "${s}"`);return u=(0,o.isStaticInput)(t)?r(t,i):(0,o.isQueueInputPinConfig)(t.config)?a?[...a].shift():void 0:a,u};t.pullValueForExecution=(e,t,n,i)=>{const s=n.get(e);let a;return(0,o.isStaticInput)(t)?a=r(t,i):(0,o.isQueueInputPinConfig)(t.config)?(a=(s||[]).shift(),n.set(e,s)):(a=s,(0,o.isStickyInputPinConfig)(t.config)||n.delete(e)),a};t.pullValuesForExecution=(e,n,o)=>(0,i.entries)(e).reduce(((e,i)=>{let[s,r]=i;return e[s]=(0,t.pullValueForExecution)(s,r,n,o),e}),{});t.peekValuesForExecution=(e,n,o,s)=>(0,i.entries)(e).reduce(((e,i)=>{let[r,a]=i;return e[r]=(0,t.peekValueForExecution)(r,a,n,o,s),e}),{});t.hasNewSignificantValues=(e,n,s,r)=>(0,i.entries)(e).some((e=>{let[a,u]=e;const c=(0,o.isQueueInputPinConfig)(u.config),l=(0,t.peekValueForExecution)(a,u,n,s,r);return(0,i.isDefined)(l)&&c}));t.isNodeStateValid=(e,t,n)=>{const r=(0,i.keys)(e),a=(0,i.keys)(n.inputs).filter((e=>{var t;const o=null===(t=n.inputs[e])||void 0===t?void 0:t.mode;return!o||"required"===o}));r.includes(s.TRIGGER_PIN_ID)&&a.push(s.TRIGGER_PIN_ID);return!!(0,i.containsAll)(r,a)&&(0,i.entries)(e).filter((e=>{let[t]=e;return!!n.inputs[t]||t===s.TRIGGER_PIN_ID})).every((e=>{let[s,r]=e;var a;const u=t.get(s);return"optional"===((null===(a=n.inputs[s])||void 0===a?void 0:a.mode)||"required")||(!!(0,o.isStaticInput)(r)||((0,o.isQueueInputPinConfig)(r.config)?(0,i.isDefined)(u)&&u.length>0:(0,i.isDefined)(u)))}))};t.subscribeInputsToState=(e,t,n)=>{const s=[];return(0,i.entries)(e).forEach((e=>{let[i,r]=e;if(!r)return;if((0,o.isStaticInput)(r))return;const a=r.subject.subscribe((e=>{if((0,o.isQueueInputPinConfig)(r.config)){const o=t.get(i)||[];if(!Array.isArray(o))throw new Error(`impossible state - state of key ${i} is set but not an array`);o.push(e),t.set(i,o),n(i,e)}else t.set(i,e),n(i,e)}));s.push((()=>a.unsubscribe()))})),()=>s.forEach((e=>e()))}},5474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flydeFlowSchema=void 0;const o=n(29022),i=o.z.record(o.z.string(),o.z.string().or(o.z.array(o.z.string()))),s=o.z.strictObject({x:o.z.number(),y:o.z.number()}),r=o.z.discriminatedUnion("mode",[o.z.strictObject({mode:o.z.literal("static"),value:o.z.any()}),o.z.strictObject({mode:o.z.literal("queue")}),o.z.strictObject({mode:o.z.literal("sticky")})]),a=o.z.object({size:o.z.optional(o.z.enum(["small","regular","large"])),icon:o.z.optional(o.z.any()),color:o.z.optional(o.z.string()),cssOverride:o.z.optional(o.z.record(o.z.string()))}),u=o.z.object({pos:s.default({x:0,y:0}),id:o.z.string(),inputConfig:o.z.optional(o.z.record(o.z.string(),r)).default({}),visibleInputs:o.z.optional(o.z.array(o.z.string())),visibleOutputs:o.z.optional(o.z.array(o.z.string())),nodeId:o.z.optional(o.z.string()),node:o.z.optional(o.z.any()),style:o.z.optional(a)}).refine((e=>e.node||e.nodeId),{message:"Instance must have either an inline node or refer to a nodeId"}),c=o.z.union([o.z.string(),o.z.object({mode:o.z.enum(["required","optional","required-if-connected"]),type:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),defaultValue:o.z.optional(o.z.any())})]),l=o.z.object({type:o.z.optional(o.z.string()),optional:o.z.optional(o.z.boolean()),delayed:o.z.optional(o.z.boolean()),description:o.z.optional(o.z.string())}),d=o.z.object({id:o.z.optional(o.z.string()),inputs:o.z.record(o.z.string(),c),outputs:o.z.record(o.z.string(),l),inputsPosition:o.z.optional(o.z.record(o.z.string(),s)),outputsPosition:o.z.optional(o.z.record(o.z.string(),s)),customViewCode:o.z.optional(o.z.string()),dataBuilderSource:o.z.optional(o.z.string()),templateType:o.z.optional(o.z.string()),completionOutputs:o.z.optional(o.z.array(o.z.string())),reactiveInputs:o.z.optional(o.z.array(o.z.string())),defaultStyle:o.z.optional(a),description:o.z.optional(o.z.string()),searchKeywords:o.z.optional(o.z.array(o.z.string()))}),p=o.z.object({instances:o.z.array(u),connections:o.z.array(o.z.strictObject({from:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),to:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),delayed:o.z.optional(o.z.boolean()),hidden:o.z.optional(o.z.boolean())}))}).and(d);t.flydeFlowSchema=o.z.strictObject({imports:o.z.optional(i).default({}),node:p})},74762:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticValueVisualNode=void 0,i(n(86873),t);const s=n(30292);i(n(6775),t),i(n(47025),t),i(n(10418),t),i(n(30292),t),i(n(3320),t),i(n(79804),t),i(n(5474),t);t.isStaticValueVisualNode=e=>!!e&&!!(0,s.maybeGetStaticValueNodeId)(`${e}`)},87093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fakeVm=t.VM=t.VMScript=void 0;const o=n(86873);class i{constructor(e){this.script=e}}t.VMScript=i;class s{constructor(e){this.context=e}run(e){const t=(0,o.okeys)(this.context.sandbox),n=Object.values(this.context.sandbox);Function(...t,e.script)(...n)}}t.VM=s,t.fakeVm={VMScript:i,VM:s}},28145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVM2Instance=void 0;const o=n(87093);t.getVM2Instance=()=>o.fakeVm},79804:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.customNodesToNodesCollection=t.inlineValueNodeToNode=void 0;const i=o(n(18706)),s=n(86873),r=n(30292),a=(0,n(28145).getVM2Instance)();t.inlineValueNodeToNode=function(e,t){void 0===t&&(t={});const{runFnRawCode:n,...o}=e,u=(0,s.debugLogger)(`code-node:${e.id}`),c=`\n try {\n ${n}\n } catch (e) {\n adv.onError(e);\n }\n `,l=new a.VMScript(c),d={...o,run:(n,o,c)=>{const d=new a.VM({sandbox:{inputs:n,outputs:o,setInterval:setInterval,clearInterval:clearInterval,setTimeout:setTimeout,clearTimeout:clearTimeout,encodeURIComponent:encodeURIComponent,adv:c,log:function(){for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeWithDependencies=void 0;const o=n(30292),i=n(74762),s=n(88270);t.getNodeWithDependencies=function(e,n,r){if(void 0===r&&(r=[]),(0,o.isInlineValueNode)(e))return[e];if(r.includes(e.id))return[];const a=(0,i.removeDupes)(e.instances.filter((e=>(0,s.isRefNodeInstance)(e))).map((e=>e.nodeId)).filter((e=>n[e])));return[e,...a.flatMap((e=>{var t;return null!==(t=n[e])&&void 0!==t?t:[]})).reduce(((e,o)=>[...e,...(0,t.getNodeWithDependencies)(o,n,[...r,...a])]),[])]}},30292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88270),t),i(n(43069),t),i(n(79426),t),i(n(44535),t),i(n(18063),t),i(n(20359),t)},18063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeInstanceError=void 0;class n extends Error{constructor(e,t,n){let o="Unknown error";o="string"==typeof e?e:e instanceof Error?e.message:null!==e&&"object"==typeof e?JSON.stringify(e):String(e),super(`${o} (insId: ${t}, nodeId: ${n})`),this.name=this.constructor.name,this.message=`${o} (insId: ${t}, nodeId: ${n})`,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.fullInsIdsPath=t,this.nodeId=n}}t.NodeInstanceError=n},88270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInsId=t.NodeInstance=t.isRefNodeInstance=t.isInlineNodeInstance=t.inlineNodeInstance=t.nodeInstance=void 0;const o=n(36618);t.nodeInstance=(e,t,n,o)=>({id:e,nodeId:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.inlineNodeInstance=(e,t,n,o)=>({id:e,node:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.isInlineNodeInstance=e=>!!e.node;t.isRefNodeInstance=e=>!(0,t.isInlineNodeInstance)(e);t.NodeInstance=(e,t,n,o)=>({id:e,nodeId:t.id,inputConfig:n||{},pos:o||{x:0,y:0}});t.createInsId=e=>`${e.id}-${(0,o.slug)()}`},43069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvKeyFromValue=t.toEnvValue=t.isEnvValue=t.extractStaticValue=t.isStaticInput=t.isDynamicInput=t.staticNodeInput=t.dynamicNodeInputs=t.dynamicNodeInput=t.dynamicOutput=t.nodeOutputs=t.nodeOutput=t.nodeInputs=t.isInputPinOptional=t.nodeInput=void 0;const o=n(62600),i=n(30292),s=n(86873),r=n(79426);t.nodeInput=function(e){return void 0===e&&(e="required"),{mode:e}};t.isInputPinOptional=e=>"optional"===e.mode;t.nodeInputs=(e,n)=>(0,s.repeat)(e,(e=>(0,t.nodeInput)((null==n?void 0:n[e])||"required")));t.nodeOutput=function(e){return void 0===e&&(e=!1),{delayed:e}};t.nodeOutputs=e=>(0,s.repeat)(e,(()=>(0,t.nodeOutput)()));t.dynamicOutput=()=>new o.Subject,t.dynamicNodeInput=(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})));t.dynamicNodeInputs=function(e){return void 0===e&&(e=10),(0,s.repeat)(e,(()=>(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})))()))};t.staticNodeInput=e=>({config:(0,r.staticInputPinConfig)(e)});t.isDynamicInput=e=>{const t=e;return t&&t.subject&&!!t.subject.next};t.isStaticInput=e=>(0,i.isStaticInputPinConfig)(null==e?void 0:e.config);t.extractStaticValue=e=>{if((0,t.isStaticInput)(e))return e.config.value;throw new Error("Cannot extract static value from non static arg")};t.isEnvValue=e=>"string"==typeof e&&e.startsWith("$ENV.");t.toEnvValue=e=>`$ENV.${e}`;t.getEnvKeyFromValue=e=>"string"==typeof e?e.replace(/^\$ENV\./,""):e},20359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeFromFunction=t.getNodeDef=t.getNode=t.getStaticValue=t.maybeGetStaticValueNodeId=t.fromSimplified=t.inlineValueNode=t.codeNode=t.visualNode=t.isInlineValueNode=t.isVisualNode=t.isCodeNode=t.isBaseNode=t.InlineValueNodeType=void 0;const o=n(86873),i=n(88270),s=n(43069);!function(e){e.VALUE="value",e.FUNCTION="function"}(t.InlineValueNodeType||(t.InlineValueNodeType={}));t.isBaseNode=e=>e&&e.id&&e.inputs&&e.outputs;t.isCodeNode=e=>(0,t.isBaseNode)(e)&&"function"==typeof e.run;t.isVisualNode=e=>!!e.instances;t.isInlineValueNode=e=>(0,o.isDefined)(e)&&(0,o.isDefined)(e.runFnRawCode),t.visualNode=(0,o.testDataCreator)({id:"visual-node",inputs:{},outputs:{},instances:[],connections:[],outputsPosition:{},inputsPosition:{}}),t.codeNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},run:o.noop}),t.inlineValueNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},runFnRawCode:""});t.fromSimplified=e=>{let{run:t,inputTypes:n,outputTypes:i,id:s}=e;return{id:s,inputs:(0,o.entries)(n).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),outputs:(0,o.entries)(i).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),run:t}};t.maybeGetStaticValueNodeId=e=>{const t="string"==typeof e&&e.match(/^__node\:(.*)/);if(t){return t[1]}return null};t.getStaticValue=(e,n,o)=>{const i=(0,t.maybeGetStaticValueNodeId)(e);if(i){const e=n[i];if(!e)throw new Error(`Instance ${o} referrer to a node reference ${i} that does not exist`);return e}return e};t.getNode=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw new Error(`Node with id ${n} not found`);return o};t.getNodeDef=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw console.error(`Node with id ${n} not found`),new Error(`Node with id ${n} not found`);return o};t.codeFromFunction=e=>{let{id:t,fn:n,inputNames:o,outputName:i,defaultStyle:r}=e;return{id:t,inputs:o.reduce(((e,t)=>({...e,[t]:(0,s.nodeInput)()})),{}),outputs:{[i]:(0,s.nodeOutput)()},run:(e,t)=>{const s=o.map((t=>e[t])),r=t[i],a=n(...s);return Promise.resolve(a).then((e=>null==r?void 0:r.next(e)))},completionOutputs:[i],defaultStyle:r}}},44535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nodeFromSimpleFunction=void 0,t.nodeFromSimpleFunction=function(e){var t;return{...e,id:e.id,description:e.description,namespace:e.namespace,inputs:e.inputs?e.inputs.reduce(((e,t)=>{let{name:n,description:o,mode:i,defaultValue:s}=t;return{...e,[n]:{description:o,mode:null!=i?i:"required",defaultValue:s}}}),{}):{},outputs:e.output?{[e.output.name]:{description:e.output.description}}:{},defaultStyle:{icon:e.icon,size:e.size},run:null!==(t=e.fullRunFn)&&void 0!==t?t:async function(t,n,o){var i,s;const r=(null!==(i=e.inputs)&&void 0!==i?i:[]).map((e=>{let{name:n}=e;return t[n]}));try{const t=await Promise.resolve(e.run(...r));e.output&&(null===(s=n[e.output.name])||void 0===s||s.next(t))}catch(a){console.error("Error in node",a),o.onError(a)}},customViewCode:e.customViewCode}}},79426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticInputPinConfig=t.isStickyInputPinConfig=t.isQueueInputPinConfig=t.staticInputPinConfig=t.stickyInputPinConfig=t.queueInputPinConfig=t.INPUT_MODES=void 0,t.INPUT_MODES=["queue","sticky","static"];t.queueInputPinConfig=()=>({mode:"queue"});t.stickyInputPinConfig=()=>({mode:"sticky"});t.staticInputPinConfig=e=>({mode:"static",value:e});t.isQueueInputPinConfig=e=>"queue"===e.mode;t.isStickyInputPinConfig=e=>!!e&&"sticky"===e.mode,t.isStaticInputPinConfig=function(e){return!!e&&"static"===e.mode}},10418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedExecute=void 0;const o=n(74762),i=n(47025);t.simplifiedExecute=function(e,t,n,s,r){void 0===r&&(r={});const a=(0,o.keys)(e.outputs),u=Object.keys(n).reduce(((e,t)=>{const i=n[t];return{...e,[t]:(0,o.isDynamicInput)(i)?i:(0,o.staticNodeInput)(i)}}),{}),c=a.reduce(((e,t)=>{const n=(0,o.dynamicOutput)();return s&&n.subscribe((e=>{s(t,e)})),{...e,[t]:n}}),{});return(0,i.execute)({node:e,inputs:u,outputs:c,resolvedDeps:t,onBubbleError:e=>{throw e},...r})}},25779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodePreview=void 0;const o=n(35250),i=n(74762),s=n(86553);t.NodePreview=e=>{let{node:t}=e;const n={node:t,instance:(0,i.nodeInstance)("bob",t.id,{}),connections:[],viewPort:{pos:{x:0,y:0},zoom:1},resolvedDeps:{},connectionsPerInput:{},onUngroup:i.noop,onDblClick:i.noop,onDragEnd:i.noop,onDragMove:i.noop,onDragStart:i.noop,onPinClick:i.noop,onPinDblClick:i.noop,onSelect:i.noop,onTogglePinBreakpoint:i.noop,onTogglePinLog:i.noop,onToggleSticky:i.noop,displayMode:!0,onInspectPin:i.noop,onDetachConstValue:i.noop,onCopyConstValue:i.noop,onPasteConstValue:i.noop,ancestorsInsIds:"",onChangeVisibleInputs:i.noop,onChangeVisibleOutputs:i.noop,onConvertConstToEnv:i.noop,forceShowMinimized:"both",onExtractInlineNode:i.noop,onCloseInlineEditor:i.noop,isConnectedInstanceSelected:!1,inlineEditorPortalDomNode:null,onChangeStyle:i.noop,onDeleteInstance:i.noop,onGroupSelected:i.noop,onSetDisplayName:i.noop,hadError:!1,queuedInputsData:{},onPinMouseDown:i.noop,onPinMouseUp:i.noop};return(0,o.jsx)("div",{className:"node-preview",children:(0,o.jsx)(s.InstanceView,{...n})})}},30653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDarkMode=t.DarkModeProvider=void 0;const o=n(70079),i=(0,o.createContext)(!0);t.DarkModeProvider=i.Provider;t.useDarkMode=()=>(0,o.useContext)(i)},29183:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataInspectionModal=void 0;const a=n(35250),u=n(50382),c=r(n(26372)),l=s(n(70079)),d=n(74089),p=n(83938),f=n(17102),m=n(98158);t.DataInspectionModal=e=>{var t;const{onRequestHistory:n}=(0,m.useDebuggerContext)(),{item:o}=e,[i,s]=l.default.useState(),[r,g]=l.default.useState(0),[h,v]=l.default.useState(""),[y,I]=l.default.useState(),[b]=(0,d.useDebounce)(h,300);(0,l.useEffect)((()=>{I(null==i?void 0:i.lastSamples.filter((e=>"object"==typeof e.val?JSON.stringify(e.val).includes(b):e.val.toString().includes(b)))),g(0)}),[null==i?void 0:i.lastSamples,b]),l.default.useEffect((()=>{!async function(){var e,t;const i=await n(o.insId,null===(e=o.pin)||void 0===e?void 0:e.id,null===(t=o.pin)||void 0===t?void 0:t.type);s(i)}()}),[o,n]);const C=e=>{const t=e.val;return"object"==typeof t?(0,a.jsx)(p.BrowserOnlyReactJson,{src:t}):(0,a.jsx)(u.Code,{children:t.toString()})},_=`"${o.insId}" ${(null===(t=o.pin)||void 0===t?void 0:t.id)?`(${o.pin.id})`:""}`;return(0,a.jsx)(u.Dialog,{isOpen:!0,title:`Inspecting data for instance ${_}`,onClose:e.onClose,canEscapeKeyClose:!1,className:"data-inspection-modal",children:(0,a.jsx)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{children:[i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("em",{children:[_," called ",i.total," time(s)"]}),i.total>10&&(0,a.jsx)("span",{children:"Showing last 10 samples"})]}):null,(0,a.jsx)("input",{className:"bp5-input bp5-small bp5-fill",type:"search",placeholder:"Search for values",dir:"auto",onChange:e=>v(e.target.value),value:h}),b.length>0&&(0,a.jsxs)("span",{children:["Showing ",null==y?void 0:y.length," of ",i.lastSamples.length," ",'samples matching query "',b,'"']})]}),(0,a.jsx)("main",{className:"main-wrapper",children:(()=>{if(!i)return(0,a.jsx)(f.Loader,{});if(0===i.total)return(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",(0,a.jsx)("em",{children:o.insId})," ",o.pin?(0,a.jsxs)(l.default.Fragment,{children:["and pin ",(0,a.jsx)("em",{children:o.pin.id})]}):null,". Make sure debugger is running and your program was triggered."]});const e=null==y?void 0:y[r];return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Card,{className:"content-wrapper",children:[e?(0,a.jsxs)("div",{className:"info",children:[(0,a.jsxs)("div",{children:["Showing sample ",r," of event from"," ",(0,a.jsx)("strong",{children:(0,d.timeAgo)(e.time)})," (",new Date(e.time).toLocaleString(),")"]}),(0,a.jsxs)("div",{children:["Instance: ",(0,a.jsx)("strong",{children:e.insId}),", Pin id:"," ",(0,a.jsx)("strong",{children:e.pinId})," "]}),(0,a.jsx)("div",{children:"Value:"})]}):null,C(e)]}),(0,a.jsx)(u.Menu,{className:"samples-menu",children:y.map(((e,t)=>{const n=e.pinId,o=`${i.total-t}. from pin "${n}"`;return(0,a.jsx)(u.MenuItem,{text:o,onClick:()=>g(t)},t)}))})]}):i.lastSamples.length>0&&h.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",children:['No data found for search query "',h,'"']}):(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",o.insId," ",o.pin?`and ${o.pin.id}`:"",". Make sure a debugger is connected and your program was triggered."]})})()})]})})})}},40471:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29183),t)},98158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebuggerContext=t.DebuggerContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({onRequestHistory:()=>Promise.reject(new Error("Not implemented"))});t.DebuggerContextProvider=i.Provider;t.useDebuggerContext=()=>(0,o.useContext)(i)},86125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDependenciesContext=t.DependenciesContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({resolvedDependencies:{},onImportNode:()=>Promise.reject(new Error("Not implemented")),onRequestImportables:()=>Promise.reject(new Error("Not implemented"))});t.DependenciesContextProvider=i.Provider;t.useDependenciesContext=()=>(0,o.useContext)(i)},97106:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FlowEditor=void 0;const u=n(35250),c=s(n(70079)),l=n(74762),d=n(63521),p=a(n(53865)),f=n(68120),m=n(7047),g=n(84472),h=n(82232),v=n(49283),y=n(43490),I=n(68840),b=n(78087),C=n(20079),_=n(60190),j=n(40471),x=n(98158),N=n(86125),P=n(30653),O=n(77852);r(n(43490),t),r(n(98158),t),r(n(86125),t),I.library.add(b.fab,C.fas);const w=["select","drag-move","order-step"];t.FlowEditor=c.memo(c.forwardRef(((e,t)=>{const{state:n,onChangeEditorState:o}=e,{resolvedDependencies:i,onImportNode:s}=(0,N.useDependenciesContext)(),[r,a]=c.useState([]),[I,b]=c.useState([]),{flow:C,boardData:E}=n,S=n.flow.node,[D,M]=c.useState({}),[T,k]=c.useState(new Set),{debuggerClient:R}=(0,x.useDebuggerContext)();c.useEffect((()=>{if(R)return R.onBatchedEvents((e=>{e.forEach((e=>{e.type===l.DebuggerEventType.INPUTS_STATE_CHANGE&&(console.log("INPUTS_STATE_CHANGE",e.insId,e.val),M((t=>({...t,[e.insId]:e.val})))),e.type===l.DebuggerEventType.ERROR&&k((t=>{const n=new Set(t);return n.add(e.insId),n}))}))}))}),[R]);const{openFile:A,reportEvent:V}=(0,y.usePorts)(),H=c.useCallback(((e,t)=>{console.info("onChangeFlow",t.type),"functional"===t.type&&(a([{flow:{...n.flow,...e}},...r.slice(0,50)]),b([])),o((t=>({...t,flow:{...t.flow,...e}})))}),[o,n.flow,r]),[$,z]=c.useState({instances:[],connections:[]}),[G,L]=c.useState(!1),F=c.useCallback((()=>L(!1)),[]),q=c.useCallback((()=>L(!0)),[]),U=c.useCallback((e=>{o((t=>({...t,boardData:{...t.boardData,...e}})))}),[o]);c.useEffect((()=>{U({selected:[],viewPort:d.defaultViewPort,from:void 0,to:void 0,lastMousePos:{x:0,y:0}})}),[S.id]),(0,f.useHotkeys)("cmd+z",(e=>{b([...I,n]);const[t,...i]=r;t&&(o((e=>({...e,...t}))),a(i)),e.preventDefault()}),{text:"Undo last change",group:"Editing"},[n,r,I]);const B=c.useCallback(((e,t)=>{w.some((e=>t.message.includes(e)))||b([]),H({node:e},t)}),[H]),W=c.useCallback((e=>{A({absPath:e.source.path})}),[A]),J=c.useCallback((function(e,t){void 0===t&&(t=-1*d.NODE_HEIGHT*1.5);const n=(0,m.createNewNodeInstance)(e,t,E.lastMousePos,i);if(n){const e=(0,p.default)(C,(e=>{const t=e.node;if(!(0,l.isVisualNode)(t))throw new Error("Impossible state, adding node to non visual node");t.instances.push(n)}));return H(e,(0,h.functionalChange)("add-node")),F(),n}}),[E.lastMousePos,C,H,F,i]),Z=c.useCallback((async e=>{switch(e.type){case v.OmniBarCmdType.ADD:return V("addNode",{nodeId:e.data,source:"omnibar"}),J(e.data);case v.OmniBarCmdType.ADD_VALUE:{const e=t.current;null==e||e.requestNewInlineValue();break}case v.OmniBarCmdType.IMPORT:{await s(e.data,{pos:E.lastMousePos});const t=(0,_.vAdd)({x:0,y:0},E.lastMousePos),n=(0,m.createNewNodeInstance)(e.data.node,0,t,i),o=(0,p.default)(C,(e=>{e.node.instances.push(n)}));H(o,(0,h.functionalChange)("add-imported-node")),V("addNode",{nodeId:e.data.node.id,source:"omnibar"});break}default:g.AppToaster.show({intent:"warning",message:"Not supported yet"})}F()}),[F,V,J,t,s,E.lastMousePos,i,C,H]),[Y,K]=c.useState(),Q=c.useCallback((()=>K(void 0)),[]),X=c.useCallback(((e,t)=>{K({insId:e,pin:t})}),[]),{isDarkMode:ee}=(0,O.useDarkMode)();return(0,u.jsx)("div",{className:"flyde-flow-editor",children:(()=>{var n;if((0,l.isInlineValueNode)(S))throw new Error("Impossible state");return(0,u.jsx)(P.DarkModeProvider,{value:null!==(n=e.darkMode)&&void 0!==n?n:ee,children:(0,u.jsxs)(c.Fragment,{children:[Y?(0,u.jsx)(j.DataInspectionModal,{item:Y,onClose:Q}):null,(0,u.jsx)(d.VisualNodeEditor,{currentInsId:l.ROOT_INS_ID,ref:t,boardData:E,onChangeBoardData:U,node:S,onGoToNodeDef:W,onChangeNode:B,resolvedDependencies:i,clipboardData:$,onCopy:z,nodeIoEditable:!S.id.startsWith("Trigger"),onInspectPin:X,onShowOmnibar:q,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:D,initialPadding:e.initialPadding,instancesWithErrors:T,disableScrolling:e.disableScrolling},S.id),G?(0,u.jsx)(v.Omnibar,{flow:C,resolvedNodes:i,onCommand:Z,visible:G,onClose:F}):null]})})})()})})))},9001:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeEditor=t.renderCreateIOOption=void 0;const i=n(35250),s=o(n(70079)),r=n(74762),a=n(50382),u=o(n(53865)),c=n(70457),l=n(25779);t.renderCreateIOOption=(e,t,n)=>(0,i.jsx)(a.MenuItem,{icon:"add",text:`Create "${e}"`,active:t,onClick:n,shouldDismissPopover:!1});const d=c.MultiSelect.ofType();t.BaseNodeEditor=e=>{var n,o;const{node:c,onChange:p}=e,f=(0,r.entries)(c.inputs),m=f.filter((e=>{let[,t]=e;return"required"===t.mode})).map((e=>{let[t]=e;return t})),g=f.filter((e=>{let[,t]=e;return"optional"===t.mode})).map((e=>{let[t]=e;return t})),h=f.filter((e=>{let[,t]=e;return"required-if-connected"===t.mode})).map((e=>{let[t]=e;return t})),[v,y]=s.default.useState(!1),I=(0,r.okeys)(c.outputs),b=s.default.useCallback((e=>{p({...c,id:e})}),[c,p]),C=s.default.useCallback((e=>{let t=e?e.split(","):void 0;"[]"===e&&(t=[]),p({...c,completionOutputs:t})}),[c,p]),_=s.default.useCallback((e=>{let t=e?e.split(","):void 0;p({...c,reactiveInputs:t})}),[c,p]),j=s.default.useCallback(((e,t)=>{const n=(0,u.default)(c,(n=>{n.inputs[e]=(0,r.nodeInput)(t)}));p(n)}),[c,p]),x=s.default.useCallback((e=>{const t=(0,u.default)(c,(t=>{delete t.inputs[e]}));p(t)}),[c,p]),N=s.default.useCallback((e=>{const t=(0,u.default)(c,(t=>{t.outputs[e]=(0,r.nodeOutput)()}));p(t)}),[c,p]),P=s.default.useCallback((e=>{const t=(0,u.default)(c,(t=>{delete t.outputs[e]}));p(t)}),[c,p]);return(0,i.jsxs)("div",{className:"base-node-editor",children:[(0,i.jsx)("div",{className:"form-row",children:(0,i.jsx)(a.FormGroup,{label:"Node Name",labelFor:"text-input",labelInfo:"(required)",children:(0,i.jsx)(a.InputGroup,{id:"node-name",disabled:e.idDisabled,placeholder:"Node ID",value:c.id,onChange:e=>b(e.target.value)})})}),(0,i.jsx)(a.FormGroup,{label:"Required Inputs",children:(0,i.jsx)(d,{selectedItems:m,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>j(e,"required"),onRemove:x,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),!0!==e.hiddenOutputs?(0,i.jsx)(a.FormGroup,{label:"Outputs",children:(0,i.jsx)(d,{selectedItems:I,placeholder:"Enter output names here",items:[],tagRenderer:e=>e,onItemSelect:N,onRemove:P,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}):null,(0,i.jsx)(a.Checkbox,{checked:v,onChange:e=>y(e.target.checked),children:"Show advanced options"}),(0,i.jsxs)(a.Collapse,{isOpen:v,children:[(0,i.jsx)(a.FormGroup,{label:"Optional Inputs",children:(0,i.jsx)(d,{selectedItems:g,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>j(e,"optional"),onRemove:x,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Required-if-connected Inputs",children:(0,i.jsx)(d,{selectedItems:h,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>j(e,"required-if-connected"),onRemove:x,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Completion Outputs",children:(0,i.jsx)(a.InputGroup,{id:"completion-outputs",placeholder:"completion outputs",value:(null===(n=c.completionOutputs)||void 0===n?void 0:n.join(","))||"",onChange:e=>C(e.target.value)})}),(0,i.jsx)(a.FormGroup,{label:"Reactive Inputs",children:(0,i.jsx)(a.InputGroup,{id:"reactive-inputs",placeholder:"Reactive inputs",value:(null===(o=c.reactiveInputs)||void 0===o?void 0:o.join(","))||"",onChange:e=>_(e.target.value)})})]}),(0,i.jsx)(a.FormGroup,{label:"Preview",children:(0,i.jsx)("div",{className:"preview-wrapper",children:(0,i.jsx)(l.NodePreview,{node:c})})})]})}},82232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metaChange=t.functionalChange=void 0;t.functionalChange=e=>({type:"functional",message:e});t.metaChange=function(e){return void 0===e&&(e="n/a"),{type:"meta",message:e}}},41032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safelyGetNodeDef=t.loadingDef=void 0;const o=n(74762);t.loadingDef={id:"Loading",inputs:{},outputs:{}};t.safelyGetNodeDef=(e,n)=>{try{return(0,o.getNodeDef)(e,n)}catch(i){const n="string"==typeof e?e:e.nodeId;return{...t.loadingDef,id:n}}}},72125:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCodeModal=void 0;const a=n(35250),u=s(n(70079)),c=r(n(51848)),l=n(50382),d=r(n(26372)),p=n(68371),f=n(74762),m=n(31745),g="`Result is ${inputs.a + inputs.b}`";t.InlineCodeModal=u.memo((function(e){const{initialValue:t,initialType:n}=e,[o,i]=u.useState((0,f.isDefined)(t)?t:g),[s,r]=u.useState(n||f.InlineValueNodeType.VALUE),h=(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:['You can add variables to by referrencing the "inputs" object.',(0,a.jsx)("br",{})," For example:",(0,a.jsx)(l.Code,{children:"`Hello {inputs.name}`"}),' will expose an input pin named "name"']}),(0,a.jsxs)("p",{children:["You can also use ternery expressions, arithmetic operators and more!",(0,a.jsx)("br",{}),"For example:",(0,a.jsx)(l.Code,{children:"inputs.a > inputs.b ? inputs.a + 42 : Math.random() * inputs.b"})]})]}),v=(0,a.jsxs)("span",{children:["Type in any valid JS value, such as ",(0,a.jsx)(l.Code,{children:"true"}),", ",(0,a.jsx)(l.Code,{children:"42"}),","," ",(0,a.jsx)(l.Code,{children:'["bob", "alice", "dave"]'}),".",(0,a.jsx)("br",{})," Dynamic inputs may also be used"]}),y=(0,a.jsxs)("span",{children:["Write any JS code and return a value.",(0,a.jsx)("br",{})," The returned value will be the output.",(0,a.jsx)("br",{})," Example:",(0,a.jsx)(l.Code,{children:"const a = inputs.a; const b = inputs.b; return Math.floor(a/b);"})]}),I=(0,p.getVariables)(o);return u.useEffect((()=>{o===g&&s===f.InlineValueNodeType.FUNCTION&&i(`return ${g}`),o===`return ${g}`&&s===f.InlineValueNodeType.VALUE&&i(g)}),[o,s]),(0,a.jsxs)(l.Dialog,{isOpen:!0,title:"Inline Value / Code",onClose:e.onCancel,className:"inline-code-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(l.Classes.DIALOG_BODY),onKeyDown:t=>{"Enter"===t.key&&t.metaKey&&e.onSubmit(s,o)},tabIndex:0,children:[(0,a.jsxs)(l.RadioGroup,{inline:!0,onChange:e=>r(e.target.value),selectedValue:s,children:[(0,a.jsx)(l.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Value ",(0,a.jsx)(m.InfoTooltip,{content:v})]}),value:f.InlineValueNodeType.VALUE}),(0,a.jsx)(l.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Function ",(0,a.jsx)(m.InfoTooltip,{content:y})]}),value:f.InlineValueNodeType.FUNCTION})]}),(0,a.jsx)(c.default,{height:"80px",theme:"vs-dark",defaultLanguage:"javascript",value:o,onChange:e=>i(e||""),onMount:e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})}}),(()=>{const e=o.includes("return");return e&&s===f.InlineValueNodeType.VALUE?(0,a.jsx)(l.Callout,{intent:l.Intent.WARNING,children:'When using the "value" type you are not expected to return anything'}):e||s!==f.InlineValueNodeType.FUNCTION?null:(0,a.jsxs)(l.Callout,{intent:l.Intent.DANGER,children:['When using the "function" type you are expected to'," ",(0,a.jsx)(l.Code,{children:"return"})," a value.",(0,a.jsx)("br",{}),"Example: ",(0,a.jsx)(l.Code,{children:"return 42 + Date.now();"})]})})(),(0,a.jsxs)(l.Callout,{intent:l.Intent.NONE,children:["Input pins detected:"," ",I.length?I.map((e=>(0,a.jsx)(l.Code,{children:e},e))):"None",(0,a.jsx)(m.InfoTooltip,{content:h})]})]}),(0,a.jsx)("div",{className:l.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:l.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(l.Button,{onClick:e.onCancel,children:"Cancel"}),(0,a.jsx)(l.Button,{onClick:()=>e.onSubmit(s,o),intent:l.Intent.PRIMARY,className:"save-btn",children:"Save"})]})})]})}))},18594:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(72125),t)},68371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInlineValueNode=t.getVariables=void 0;const o=n(74762),i=n(74762);t.getVariables=e=>(e.match(/inputs\.([a-zA-Z]\w*)/g)||[]).map((e=>e.replace(/inputs\./,"")));t.createInlineValueNode=e=>{let{code:n,customView:s,nodeId:r,type:a}=e;const u=(0,t.getVariables)(n).reduce(((e,t)=>({...e,[t]:(0,o.nodeInput)()})),{}),c={value:(0,o.nodeOutput)()},l=a===o.InlineValueNodeType.FUNCTION?`const result = (function() { ${n}}());\n Promise.resolve(result).then(val => outputs.value.next(val))`:`const result = (${n}); Promise.resolve(result).then(val => outputs.value.next(val))`,d=btoa(n);return(0,i.inlineValueNode)({id:r||`Inline Code ${(0,o.randomInt)(99999)}`,inputs:u,outputs:c,runFnRawCode:l,customViewCode:s||n,dataBuilderSource:d,templateType:a,completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline "+(a===o.InlineValueNodeType.VALUE?"value":"function")})}},49283:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Omnibar=t.OmniBarCmdType=void 0;const a=n(35250),u=s(n(70079)),c=n(70457),l=n(74762),d=n(50382),p=r(n(26372));var f;!function(e){e.ADD="add",e.ADD_VALUE="add-value",e.IMPORT="import"}(f=t.OmniBarCmdType||(t.OmniBarCmdType={}));const m=[];t.Omnibar=e=>{const{resolvedNodes:t}=e,[n,o]=u.useState(""),[i,s]=u.useState(null),[r,g]=u.useState([]);u.useEffect((()=>{const e=(0,l.keys)(t).map((e=>({title:`${t[e].id}`,cmd:{type:f.ADD,data:e},extra:"current flow"}))),n=r.map((e=>({title:`${e.node.id}`,description:e.node.description,cmd:{type:f.IMPORT,data:e},extra:`${e.module}`}))),o={title:"Add inline value or code",suggestOnEmpty:!0,cmd:{type:f.ADD_VALUE}},i=[...m,...n,o,...e];s(i)}),[t,r]),u.useEffect((()=>{e.onRequestImportables&&e.onRequestImportables(n).then((e=>{g(e)}))}),[e,n]);const h=u.useCallback(((e,t)=>{let{handleClick:n,modifiers:o,query:i,index:s}=t;if(!o.matchesPredicate)return null;const r=`${e.title}`;return(0,a.jsx)(d.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,a.jsxs)("div",{className:(0,p.default)("omnibar-item",{active:o.active}),children:[(0,a.jsxs)("div",{className:"title",children:[r," ",e.extra?(0,a.jsx)("span",{className:"extra",children:e.extra}):null]}),e.description?(0,a.jsx)("div",{className:"description",children:e.description}):null]})},s)}),[]),v=u.useCallback(((e,t)=>{const n=e.toLowerCase().split("").map((e=>{return`${t=e,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*`;var t})).join(""),o=new RegExp(n);return!!t.title.toLowerCase().match(o)}),[]),y=u.useCallback((t=>{e.onCommand(t.cmd),e.onClose()}),[e]);return i?(0,a.jsx)(c.Omnibar,{query:n,onQueryChange:o,onClose:e.onClose,noResults:(0,a.jsx)(d.MenuItem,{disabled:!0,text:"No results."}),itemPredicate:v,isOpen:e.visible,items:i,initialContent:void 0,onItemSelect:y,itemRenderer:h,inputProps:{placeholder:"Search for nodes or commands.."}}):null}},60698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43490:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31874),t)},31874:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.usePorts=t.useConfirm=t.usePrompt=t.PortsContext=t.defaultPorts=void 0;const s=n(70079),r=n(74762),a=n(84472);i(n(60698),t);const u=e=>async()=>{console.warn(`${e} Not implemented`),(0,a.toastMsg)("Feature not implemented in this context yet","warning")};t.defaultPorts={prompt:async e=>{let{text:t,defaultValue:n}=e;return prompt(`${t}`,n)},openFile:async e=>{},confirm:async e=>{let{text:t}=e;return confirm(t)},readFlow:u("readFlow"),setFlow:u("setFlow"),resolveDeps:u("resolveDeps"),getImportables:u("getImportables"),onExternalFlowChange:u("onExternalFlowChange"),onInstallRuntimeRequest:u("onInstallRuntimeRequest"),onRunFlow:u("onRunFlow"),onStopFlow:u("onStopFlow"),reportEvent:r.noop,generateNodeFromPrompt:u("generateNodeFromPrompt"),hasOpenAiToken:()=>Promise.resolve(!1)},t.PortsContext=(0,s.createContext)(t.defaultPorts);t.usePrompt=()=>{const e=(0,s.useContext)(t.PortsContext).prompt;return(t,n)=>e({text:t,defaultValue:n})};t.useConfirm=()=>{const e=(0,s.useContext)(t.PortsContext).confirm;return t=>e({text:t})};t.usePorts=()=>(0,s.useContext)(t.PortsContext)},65758:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelected=void 0;const i=n(74762),s=o(n(53865)),r=n(22513);t.groupSelected=async(e,t,n,o,a)=>{const{instances:u,connections:c}=t,l=u.filter((t=>e.includes(t.id))),d=c.filter((t=>{let{from:n,to:o}=t;return-1!==e.indexOf(n.insId)||-1!==e.indexOf(o.insId)}));if(!l.length)throw new Error("visual without selections");const{visualNode:p,renamedInputs:f,renamedOutputs:m}=await(0,r.createGroup)(l,d,n,a),g=l.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),u[0].pos),h="ref"===o?(0,i.nodeInstance)((0,i.createInsId)(p),p.id,{},g):(0,i.inlineNodeInstance)((0,i.createInsId)(p),p,{},g),v=u.filter((t=>-1===e.indexOf(t.id))),y=c.map((e=>{const t=`${e.from.insId}.${e.from.pinId}`,n=`${e.to.insId}.${e.to.pinId}`;return f[n]?{...e,to:{insId:h.id,pinId:f[n]}}:m[t]?{...e,from:{insId:h.id,pinId:m[t]}}:e})).filter((t=>-1===e.indexOf(t.from.insId)&&-1===e.indexOf(t.to.insId)));return{newNode:p,currentNode:(0,s.default)(t,(e=>{e.instances=[...v,h],e.connections=y}))}}},74089:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(97106),t),i(n(18420),t),i(n(90680),t),i(n(84472),t),i(n(17102),t),i(n(82232),t),i(n(25779),t),i(n(25804),t),i(n(9958),t),i(n(68120),t),i(n(94651),t),i(n(73470),t),i(n(94007),t),i(n(60190),t),i(n(9001),t),i(n(7047),t),i(n(23386),t)},31745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoTooltip=void 0;const o=n(35250),i=n(50382),s=n(50382),r=n(44470),a=n(50382);t.InfoTooltip=e=>{const{content:t}=e;return(0,o.jsx)(s.Tooltip,{content:t,placement:"top",className:"info-tooltip",children:(0,o.jsx)(i.Icon,{icon:(0,o.jsx)(r.InfoSign,{className:a.Classes.INTENT_PRIMARY}),intent:i.Intent.SUCCESS,className:"info-tooltip-icon"})})}},83938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserOnlyReactJson=void 0;const o=n(35250);t.BrowserOnlyReactJson=e=>{if("undefined"==typeof window)return null;const t=n(73541).Z;return(0,o.jsx)(t,{...e})}},94651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsValueRenderer=void 0;const o=n(35250),i=n(74762),s=n(83938);t.AnalyticsValueRenderer=e=>{let{val:t}=e;try{const e=JSON.parse(t),n="object"==typeof e?e:{value:e},r=e&&[e.type,e.key,e.props,e.ref].every(i.isDefined),a=r?{jsxValue:e}:n;return(0,o.jsx)(s.BrowserOnlyReactJson,{src:a,collapseStringsAfterLength:50,collapsed:r})}catch(n){return(0,o.jsx)(s.BrowserOnlyReactJson,{src:{value:t},collapseStringsAfterLength:50})}}},22513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=void 0;const o=n(74762),i=n(74762),s=n(60190),r=n(88593);t.createGroup=async(e,t,n,a)=>{if(0===e.length)throw new Error("cannot create group without instances");const u=e.map((e=>e.id)),c=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return!t&&n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.to,e.to)))===t)),l=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return t&&!n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.from,e.from)))===t));let d={},p={},f={},m={};const g=[],h={};for(const o of c){const e=`${o.to.insId}.${o.to.pinId}`,t=`${o.from.insId}.${o.from.pinId}`,n=o.to.pinId;if(f[t]){g.push({from:(0,i.externalConnectionNode)(f[t]),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)});continue}const r=h[n]?await a(`Name this input (${n} of ${o.to.insId}) is already taken:`)||`i${(0,s.rnd)()}`:n;d[e]=r,f[t]=r,g.push({from:(0,i.externalConnectionNode)(r),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)}),h[r]=(0,i.nodeInput)()}const v={};for(const r of l){const e=`${r.to.insId}.${r.to.pinId}`,t=`${r.from.insId}.${r.from.pinId}`,n=r.from.pinId;if(m[e]){g.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(m[e])});continue}const u=v[n]?await a(`Name this output (${n} of ${r.from.insId} is already taken:`)||`i${(0,s.rnd)()}`:n;p[t]=u,m[e]=u,g.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(u)}),v[u]=(0,o.nodeOutput)()}e.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),e[0].pos);const y=t.filter((e=>u.includes(e.from.insId)&&u.includes(e.to.insId)));return{visualNode:{id:n,inputs:h,outputs:v,instances:e,defaultStyle:{size:"large",color:(0,o.pickRandom)(r.nodeStylePresetColors.map((e=>e.color)))},inputsPosition:(0,o.okeys)(h).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:0}})),{}),outputsPosition:(0,o.okeys)(v).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:400}})),{}),connections:[...y,...g],completionOutputs:(0,o.okeys)(v)},renamedInputs:d,renamedOutputs:p}}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightText=void 0;const o=n(35250);function i(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}t.highlightText=(e,t)=>{let n=0;const s=t.split(/\s+/).filter((e=>e.length>0)).map(i);if(0===s.length)return[e];const r=new RegExp(s.join("|"),"gi"),a=[];for(;;){const t=r.exec(e);if(!t)break;const i=t[0].length,s=e.slice(n,r.lastIndex-i);s.length>0&&a.push(s),n=r.lastIndex,a.push((0,o.jsx)("strong",{children:t[0]},n))}const u=e.slice(n);return u.length>0&&a.push(u),a}},17102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Loader=void 0;const o=n(35250);t.Loader=()=>(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)("svg",{width:"38",height:"38",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:"#007ec6",children:(0,o.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,o.jsxs)("g",{transform:"translate(1 1)",strokeWidth:"2",children:[(0,o.jsx)("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),(0,o.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:(0,o.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})})})},23386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;const o=n(74762);t.logger=(0,o.debugLogger)("editor")},561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadMonaco=void 0;const o=n(51848),i=n(23386);let s=!1;t.preloadMonaco=()=>{s||o.loader.init().then((()=>{(0,i.logger)("monaco preloaded"),s=!0}))}},68120:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHotkeys=t.currentHotkeys=void 0;const i=o(n(45240)),s=n(70079);t.currentHotkeys=new Map,t.useHotkeys=function(e,n,o,r,a){void 0===r&&(r=[]);const u=(0,s.useCallback)((function(){a&&!a.current||n(...arguments)}),[...r,n]);(0,s.useEffect)((()=>((0,i.default)(e,{},u),t.currentHotkeys.set(e,o),()=>{t.currentHotkeys.delete(e),i.default.unbind(e,u)})),[e,u,o])}},94007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeSessionStorage=t.safeLocalStorage=void 0,t.safeLocalStorage={getItem:function(){try{return localStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return localStorage.setItem(...arguments)}catch(e){return null}}},t.safeSessionStorage={getItem:function(){try{return sessionStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return sessionStorage.setItem(...arguments)}catch(e){return null}}}},90680:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocalStorage=t.useResizePref=t.userPreferences=t.useUserPref=void 0;const r=s(n(70079)),a=n(18420),u=n(94007);t.useUserPref=(e,n)=>{const[o,i]=r.useState((()=>{const o=t.userPreferences.getItem(e);return(0,a.isDefined)(o)?o:n}));r.useEffect((()=>{const o=t.userPreferences.getItem(e),s=(0,a.isDefined)(o)?o:n;i(s)}),[e]);return[o,n=>{t.userPreferences.setItem(e,n),i(n)}]},t.userPreferences=(()=>{const e=e=>`up.${e}`;return{getItem:t=>{const n=u.safeLocalStorage.getItem(e(t))||"",o=u.safeSessionStorage.getItem(e(t))||"";try{return JSON.parse(o||n).value}catch(i){return}},setItem:function(t,n,o){void 0===o&&(o=!1);const i=o?sessionStorage:u.safeLocalStorage;try{const o=JSON.stringify({value:n});return i.setItem(e(t),o),!0}catch(s){return console.error("Error saving user preference",s),!1}}}})();t.useResizePref=(e,n)=>{const o=`resize.${e}`;return(0,t.useUserPref)(o,n)};const c=e=>{const t=u.safeLocalStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch(n){return null}};t.useLocalStorage=(e,t)=>{const[n,o]=r.useState(c(e)||t),i=r.useCallback((t=>{u.safeLocalStorage.setItem(e,JSON.stringify({value:t})),o(t)}),[e]);return r.useEffect((()=>{c(e)||u.safeLocalStorage.setItem(e,JSON.stringify({value:t}))}),[e,t,i]),[n,i]}},60190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.totalEnergy=t.itrPhysics=t.hookes=t.coulombs=t.vToStr=t.vNorm=t.vLen=t.vSub=t.vAdd=t.vDiv=t.vMul=t.vZero=t.rnd=t.vec=t.size=void 0;t.size=(e,t)=>({width:e,height:t});t.vec=(e,t)=>({x:e,y:t});t.rnd=function(e,t){return void 0===e&&(e=100),void 0===t&&(t=0),Math.floor(Math.random()*(e-t))+t},t.vZero={x:0,y:0};t.vMul=(e,t)=>{let{x:n,y:o}=e;return{x:n*t,y:o*t}};t.vDiv=(e,n)=>{let{x:o,y:i}=e;return(0,t.vMul)({x:o,y:i},1/n)};t.vAdd=(e,t)=>({x:e.x+t.x,y:e.y+t.y});t.vSub=(e,n)=>(0,t.vAdd)(e,(0,t.vMul)(n,-1));t.vLen=e=>{let{x:t,y:n}=e;return Math.sqrt(t*t+n*n)};t.vNorm=e=>(0,t.vDiv)(e,(0,t.vLen)(e)||1);t.vToStr=e=>{let{x:t,y:n}=e;return`${t.toFixed(1)},${n.toFixed(1)}`};t.coulombs=(e,n,o)=>{const i=(0,t.vLen)((0,t.vSub)(e.p,n.p));if(0===i){const i=(0,t.vec)(2*Math.random()-1,2*Math.random()-1),s=e.m*n.m/Math.pow(10,2);return(0,t.vMul)(i,s*o)}{const s=(0,t.vNorm)((0,t.vSub)(n.p,e.p)),r=e.m*n.m/Math.pow(i+.1,2);return(0,t.vMul)(s,r*o)}};t.hookes=(e,n,o,i,s)=>{const r=(0,t.vLen)((0,t.vSub)(e.p,n.p)),a=(0,t.vNorm)((0,t.vSub)(e.p,n.p));let u=0;return ri&&(u=i-r),(0,t.vMul)(a,s*u)};t.itrPhysics=(e,n)=>{const{p:o,v:i,f:s,m:r}=n,a=(0,t.vDiv)(s,r),u=e/1e3,c=(0,t.vAdd)((0,t.vMul)(a,u),i),l=(0,t.vAdd)((0,t.vMul)(c,u),o);return{...n,p:l,v:c,f:(0,t.vec)(0,0)}};t.totalEnergy=e=>e.reduce(((e,n)=>{const o=(0,t.vLen)(n.v);return e+.5*n.m*o*o}),0)},84472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateToast=t.toastMsg=t.AppToaster=void 0;const o=n(50382);t.AppToaster=(()=>{try{return o.OverlayToaster.create({className:"app-toaster",position:o.Position.BOTTOM_RIGHT})}catch(e){return{}}})();t.toastMsg=(e,n,o)=>t.AppToaster.show({message:e,intent:n,timeout:o});t.updateToast=(e,n,o)=>t.AppToaster.show({message:n,intent:o},e)},18420:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultAnd=t.isLocal=t.fullTime=t.timeAgoFromDt=t.timeAgo=t.toString=t.isDefined=t.set=t.createOmap=t.toOmap=t.values=t.keys=t.entries=void 0;const i=n(7047),s=n(74762),r=o(n(73136));t.entries=e=>Object.keys(e).map((t=>[t,e[t]]));t.keys=e=>Object.keys(e);t.values=e=>Object.keys(e).map((t=>e[t]));t.toOmap=e=>Array.from(e.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.createOmap=function(e){return void 0===e&&(e=[]),e.reduce(((e,t)=>({...e,[t[0]]:t[1]})),{})};t.set=(e,t,n)=>{e[t]=n};t.isDefined=e=>void 0!==e;t.toString=e=>{const t=typeof e;if(""===e)return"(empty string)";if((0,i.isJsxValue)(e))return"JSX Value";if((0,s.isStaticValueVisualNode)(e))return"Embedded Node";if((0,s.isEnvValue)(e))return(0,s.getEnvKeyFromValue)(e);if("object"===t)try{const t=JSON.stringify(e);return"{}"===t?"Empty object":t}catch(n){return"Object (cannot stringify)"}return`${e}`};t.timeAgo=e=>(0,r.default)(new Date(e)).fromNow();t.timeAgoFromDt=e=>(0,r.default)(Date.now()-e).fromNow();t.fullTime=e=>(0,r.default)(new Date(e)).toString();t.isLocal=()=>location.href.includes(":300");t.preventDefaultAnd=e=>t=>{t.preventDefault(),e(t)}},67181:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ActionButton=t.ActionsMenu=t.ActionType=void 0;const r=n(35250),a=n(50382),u=n(50382),c=n(74762),l=s(n(70079)),d=n(86125),p=n(43490),f=n(68120),m=n(90680),g=n(84472),h=n(9971),v=n(47749),y=n(46334),I=n(47230),b=n(41032);var C;!function(e){e.AddNode="add-node",e.RemoveNode="remove-node",e.Group="group",e.UnGroup="un-group",e.AddInlineValue="add-inline-value",e.Inspect="inspect",e.Run="run",e.AI="ai"}(C=t.ActionType||(t.ActionType={}));t.ActionsMenu=e=>{const{onAction:n,selectedInstances:o,resolvedNodes:i,node:s,from:u,to:v,hotkeysEnabled:j,showRunFlowOptions:x}=e,{onRequestImportables:N}=(0,d.useDependenciesContext)(),[P,O]=l.default.useState(!1),[w,E]=l.default.useState(!1),[S,D]=l.default.useState(!1),[M,T]=l.default.useState(null),[k,R]=(0,m.useLocalStorage)("hideHotkeyHintMap",{}),A=(0,l.useCallback)((()=>{O(!1)}),[]),{onRunFlow:V,generateNodeFromPrompt:H,reportEvent:$}=(0,p.usePorts)(),z=(0,l.useCallback)(((e,t)=>(E(!1),V(e,t))),[V]),G=[];if(G.push(C.AddNode),G.push(C.AddInlineValue),1===o.length){const e=s.instances.find((e=>e.id===o[0]));if(e)try{const t=(0,b.safelyGetNodeDef)(e,i);(0,c.isVisualNode)(t)&&G.push(C.UnGroup)}catch(B){console.error(`Could not find node with id ${o[0]} - ${B}`)}else console.error(`Could not find instance with id ${o[0]}`)}x&&G.push(C.Run),o.length>0&&G.push(C.Group),(1===o.length||u||v)&&G.push(C.Inspect),o.length>0&&G.push(C.RemoveNode),G.push(C.AI);const L=(0,l.useCallback)(((e,t)=>{R({...k,[e]:!0}),g.AppToaster.dismiss(t)}),[k,R]),F=(0,l.useCallback)(((e,t)=>{const{hotkey:o}=_[e];if("click"===t.type&&o&&!k[o]){const t=(0,g.toastMsg)((0,r.jsxs)(r.Fragment,{children:["Did you know? you can also use the hotkey"," ",(0,r.jsx)("kbd",{className:"hotkey",children:o})," to"," ",_[e].text.replace(/^[A-Z]/,(e=>e.toLowerCase())),(0,r.jsxs)(a.Button,{minimal:!0,small:!0,onClick:()=>L(o,t),children:[" ","Don't show again"," "]})]}),"none",3e3)}switch(e){case C.AddNode:O(!0);break;case C.Run:!async function(){E(!0)}();break;case C.AI:D(!0);break;default:n({type:e,data:void 0})}}),[k,n,L,s.inputs]);Object.entries(_).forEach((e=>{let[t,n]=e;n.hotkey&&(0,f.useHotkeys)(n.hotkey,(e=>{e.preventDefault(),G.includes(t)&&(F(t,e),R({...k,[n.hotkey]:!0}))}),{text:n.text,group:"Action menu hotkeys"},[G],j)}));const q=(0,l.useCallback)((e=>{n({type:C.AddNode,data:{importableNode:e}})}),[n]),U=(0,l.useCallback)((async e=>{const t=Date.now();T(t);try{$("generateNodeFromPrompt:start",{promptLength:e.length});const o=await H({prompt:e}),{inputs:i,outputs:s}=o.importableNode.node,r=Date.now()-t;$("generateNodeFromPrompt:success",{totalTime:r,inputs:Object.keys(i),outputs:Object.keys(s)}),T(null),n({type:C.AI,data:o}),D(!1)}catch(B){T(null),g.AppToaster.show({message:"Failed to generate node",intent:"danger"}),$("generateNodeFromPrompt:failure",{error:B.message})}}),[H,n,$]);return(0,r.jsxs)("div",{className:"actions-menu",children:[G.map((e=>(0,r.jsx)(t.ActionButton,{type:e,onClick:F},e))),P?(0,r.jsx)(h.AddNodeMenu,{onRequestImportables:N,onAddNode:q,onClose:A}):null,w?(0,r.jsx)(I.RunFlowModal,{onClose:()=>E(!1),onRun:z,node:s}):null,S?(0,r.jsx)(y.PromptAIMenu,{onClose:()=>{D(!1),T(null)},onSubmit:U,submitting:null!==M,submitTime:M}):null]})};const _={[C.AddNode]:{icon:v.addNodeIcon,text:'Open the "add node" menu',hotkey:"a"},[C.RemoveNode]:{icon:v.removeNodeIcon,text:"Remove selected instances",hotkey:"backspace"},[C.Group]:{icon:v.groupIcon,text:"Group selection into a new node",hotkey:"g"},[C.UnGroup]:{icon:v.ungroupIcon,text:"Ungroup selected visual node"},[C.Inspect]:{icon:v.inspectIcon,text:"Inspect data",hotkey:"i"},[C.AddInlineValue]:{icon:v.pencilIcon,text:"Add value / inline function",hotkey:"v"},[C.Run]:{icon:v.playIcon,text:"Run flow",hotkey:"r"},[C.AI]:{icon:v.starIcon,text:"Generate new code node using AI \u2728"}},j={icon:"",text:"N/A",hotkey:void 0};t.ActionButton=e=>{var t;const{onClick:n,type:o}=e,i=(0,l.useCallback)((e=>n(o,e)),[n,o]),s=null!==(t=_[o])&&void 0!==t?t:j,a=s.hotkey?(0,r.jsxs)("span",{children:[s.text," ",(0,r.jsx)("kbd",{className:"hotkey",children:s.hotkey})]}):s.text;return(0,r.jsx)("div",{className:"action-button",onClick:i,"data-type":o,children:(0,r.jsx)(u.Tooltip,{hoverOpenDelay:100,content:a,className:"icon-wrapper",popoverClassName:"action-button-tooltip",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s.icon}})})})}},40149:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenu=t.AddNodeMenuFilterTree=void 0;const a=n(35250),u=n(50382),c=n(74762),l=r(n(26372)),d=s(n(70079)),p=n(43490),f=n(31745),m=n(17102),g=n(87935),h=n(74657),v=n(44470);t.AddNodeMenuFilterTree=u.Tree.ofType();function y(e,t,n){return[...e.external.map((e=>({id:e.module,label:e.module,hasCaret:!0,nodeData:{type:"external",module:e.module},isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module,isExpanded:n.has(e.module),childNodes:e.namespaces.map((o=>({id:`${e.module}/${o}`,label:o,hasCaret:!1,isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module&&t.namespace===o,isExpanded:n.has(`${e.module}/${o}`),nodeData:{type:"external",module:e.module,namespace:o}})))}))),{id:"internal",label:"Current Project",nodeData:{type:"internal"},isExpanded:n.has("internal"),hasCaret:!0,isSelected:"internal"===t.type,childNodes:e.internal.files.map((e=>({id:e,label:e,isSelected:"internal"===t.type&&t.file===e,hasCaret:!1,isExpanded:n.has(e),nodeData:{type:"internal",file:e}})))}]}function I(e){return/\.flyde(\.[jt]s)?$/.test(e.module)}t.AddNodeMenu=e=>{const{onRequestImportables:n,onAddNode:o,onClose:i}=e,[s,r]=d.default.useState(),[b,C]=d.default.useState([]),[_,j]=d.default.useState(new Set),[x,N]=d.default.useState(""),[P,O]=d.default.useState({type:"all"}),[w,E]=d.default.useState(null),[S,D]=d.default.useState(null),[M,T]=d.default.useState(null),k=(0,d.useCallback)((e=>{_.add(e.id),j(new Set(_))}),[_]),R=(0,d.useCallback)((e=>{_.delete(e.id),j(new Set(_))}),[_]),A=(0,d.useCallback)((e=>{o(e),i()}),[o,i]),{onInstallRuntimeRequest:V,reportEvent:H}=(0,p.usePorts)();(0,d.useEffect)((()=>{H("addNodeMenuOpen",{})}),[H]),(0,d.useEffect)((()=>{D(null==s?void 0:s.flatMap((e=>{var t,n,o;if(P)if("external"===P.type){if((e.module!==P.module||P.namespace)&&e.node.namespace!==P.namespace)return[]}else if("internal"===P.type&&(!I(e)||P.file&&e.module!==P.file))return[];if(x){const i=`${null!==(n=null===(t=e.node.searchKeywords)||void 0===t?void 0:t.join(" "))&&void 0!==n?n:[]} ${e.node.id} ${null!==(o=e.node.namespace)&&void 0!==o?o:""} ${e.node.description}`.toLowerCase().indexOf(x.toLowerCase());return-1===i?[]:[{importable:e,score:i}]}return[{importable:e,score:1}]})).sort(((e,t)=>e.score-t.score)).map((e=>{let{importable:t}=e;return t})))}),[s,P,x]),(0,d.useEffect)((()=>{n().then((e=>{let{importables:t,errors:n}=e;C(n);const o=t.filter((e=>!I(e))).reduce(((e,t)=>{var n,o,i;null!==(n=e[i=t.module])&&void 0!==n||(e[i]=[]);const s=null!==(o=t.node.namespace)&&void 0!==o?o:"";return e[t.module].includes(s)||e[t.module].push(s),e}),{}),i=t.filter(I).map((e=>e.module));E({external:Object.entries(o).map((e=>{let[t,n]=e;return{module:t,namespaces:n}})),internal:{files:i}}),r(t),j(new Set(["internal",...Object.keys(o)]))}))}),[n]);const $=(0,d.useCallback)((e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),S&&!M)return void T(S["ArrowDown"===e.key?0:S.length-1]);if(S&&M){const t=S.findIndex((e=>e===M));let n="ArrowDown"===e.key?t+1:t-1;n=n<0?S.length-1:n,n=n>=S.length?0:n,T(S[n])}break;case"Enter":M&&A(M)}}),[S,M,A]),z=(0,d.useCallback)((e=>{let{nodeData:t}=e;JSON.stringify(t)===JSON.stringify(P)?"external"===t.type?t.namespace?O({type:"external",module:t.module}):O({type:"all"}):"internal"===t.type&&(t.file?O({type:"internal"}):O({type:"all"})):O(t)}),[P]),G=!s||s.some((e=>e.module.includes("@flyde/stdlib"))),L=(0,d.useCallback)((()=>{V(),i()}),[i,V]);return(0,a.jsx)(u.Dialog,{isOpen:!0,title:"Add Node Menu",onClose:e.onClose,className:"add-node-menu",isCloseButtonShown:!0,children:(0,a.jsxs)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),children:[(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"bp5-input-group",children:[(0,a.jsx)(v.Search,{}),(0,a.jsx)("input",{className:"bp5-input",type:"search",placeholder:"Search input",dir:"auto",autoFocus:!0,onChange:e=>N(e.target.value),value:x,onKeyDown:$})]}),G?null:(0,a.jsxs)(u.Callout,{intent:u.Intent.NONE,style:{marginTop:10},children:["Using built-in @flyde/stdlib. It's recommended to explicitly install it instead."," ",(0,a.jsx)(u.Button,{minimal:!0,small:!0,intent:u.Intent.PRIMARY,onClick:L,children:"Click here to install it using npm/yarn"})]})]}),(0,a.jsx)("div",{className:"content-wrapper",children:s?(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsxs)("aside",{children:[(0,a.jsxs)("div",{className:"filter-header",children:["Filter by package"," ",(0,a.jsx)(u.Tooltip,{content:(0,a.jsxs)("span",{children:["Click to learn more about how packages work in Flyde"," "]}),hoverCloseDelay:1500,children:(0,a.jsx)("a",{target:"_blank",href:"https://www.flyde.dev/docs/packages",rel:"noreferrer",children:(0,a.jsx)(u.Icon,{icon:(0,a.jsx)(v.Help,{}),intent:"primary",iconSize:12})})})]}),(0,a.jsx)("div",{className:"tree-container",children:(0,a.jsx)(t.AddNodeMenuFilterTree,{contents:y(w,P,_),onNodeCollapse:R,onNodeExpand:k,onNodeClick:z,className:u.Classes.ELEVATION_0})})]}),(0,a.jsx)("main",{children:S?0===S.length?(0,a.jsxs)("div",{className:"no-results",children:[(0,a.jsx)(h.AddNodeMenuResultsSummary,{filter:P,onChangeFilter:O,query:x,onChangeQuery:N,resultsCount:S.length}),(0,a.jsxs)(u.Callout,{className:"callout",intent:"primary",children:["Can't find a suitable node? Create one yourself!"," ",(0,a.jsx)("a",{href:"https://www.flyde.dev/docs/code-nodes",target:"_blank",rel:"noreferrer",children:"Learn more"})]})]}):(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsx)(h.AddNodeMenuResultsSummary,{filter:P,onChangeFilter:O,query:x,onChangeQuery:N,resultsCount:S.length}),(0,a.jsx)("div",{className:"results",children:S.map((e=>(0,a.jsx)(g.AddNodeMenuListItem,{importableNode:e,onAdd:A,selected:(null==M?void 0:M.node)===e.node,onSelect:T,onSetFilter:O},e.node.id+e.node.namespace+e.module)))})]}):(0,a.jsx)(m.Loader,{})})]}):(0,a.jsx)(m.Loader,{})}),b.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",style:{marginTop:"10px"},children:["Found ",(0,c.simplePluralize)(b.length,"corrupt flow"),(0,a.jsx)(f.InfoTooltip,{content:b.map((e=>{let{path:t,message:n}=e;return`${t}: ${n}`})).join(", ")})," "]}):null]})})}},8470:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuListItem=void 0;const a=n(35250),u=n(50382),c=r(n(26372)),l=s(n(70079));t.AddNodeMenuListItem=e=>{const{importableNode:t,onSetFilter:n,onAdd:o,onSelect:i}=e,{node:s,module:r}=t,{id:d,description:p}=s,f=l.default.useRef(null);l.default.useEffect((()=>{e.selected&&f.current&&f.current.scrollIntoView({block:"center"})}),[e.selected]);const m=(0,l.useCallback)((()=>{o(t)}),[o,t]),g=(0,l.useCallback)((()=>{i(t)}),[i,t]);return(0,a.jsxs)("div",{className:(0,c.default)("add-node-menu-list-item",{selected:e.selected}),ref:f,onClick:g,children:[(0,a.jsxs)("div",{className:"content",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("span",{className:"id",children:d}),(0,a.jsxs)(u.Tag,{interactive:!0,onClick:()=>n({type:"external",module:r,namespace:s.namespace}),className:"source",minimal:!0,children:[r,s.namespace?` / ${s.namespace}`:null]})]}),(0,a.jsx)("div",{className:"description",children:p||(0,a.jsx)("em",{children:"No description"})})]}),(0,a.jsx)("aside",{children:(0,a.jsx)(u.Button,{onClick:m,children:"Add"})})]})}},87935:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8470),t)},88671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuResultsSummary=void 0;const o=n(35250),i=n(50382);t.AddNodeMenuResultsSummary=e=>{const{resultsCount:t,query:n,filter:s,onChangeFilter:r,onChangeQuery:a}=e;return(0,o.jsxs)("div",{className:"add-node-menu-results-summary",children:[t?`Showing ${t} result${t>1?"s":""}`:"No results found","\xa0",n?(0,o.jsxs)(o.Fragment,{children:["matching query\xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>a(""),children:['"',n,'"']})]}):null,"all"===s.type?null:"external"===s.type?(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["package ",s.module,s.namespace?` / ${s.namespace}`:null]})]}):(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["\xa0this project ",s.file?` / ${s.file}`:null]})]})]})}},74657:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88671),t)},9971:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40149),t)},83159:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PromptAIMenu=void 0;const a=n(35250),u=n(50382),c=r(n(26372)),l=s(n(70079)),d=1e4;t.PromptAIMenu=e=>{const{onClose:t}=e,[n,o]=l.default.useState(""),[i,s]=l.default.useState(0);return(0,l.useEffect)((()=>{s(0);const t=setInterval((()=>{s((t=>{const n=(Date.now()-e.submitTime)/d;return Math.min(n+.05*Math.random()/2,.95)}))}),500);return()=>clearInterval(t)}),[e.submitTime]),(0,a.jsxs)(u.Dialog,{isOpen:!0,onClose:t,className:"prompt-ai-menu",title:"\u2728 Generate Code Node using AI",children:[(0,a.jsx)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsx)(u.TextArea,{value:n,disabled:e.submitting,onChange:e=>o(e.target.value),placeholder:"Describe your node in details",fill:!0})}),e.submitTime?(0,a.jsx)("div",{className:"progress-bar-container",children:(0,a.jsx)(u.ProgressBar,{value:i})}):null,(0,a.jsx)("div",{className:u.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:u.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(u.Button,{onClick:t,children:"Close"}),(0,a.jsx)(u.Button,{intent:u.Intent.PRIMARY,className:"run-btn",disabled:e.submitting||!n,loading:e.submitting,onClick:()=>{s(0),e.onSubmit(n)},children:"Create \u2728"})]})})]})}},46334:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(83159),t)},3152:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RunFlowModal=void 0;const a=n(35250),u=s(n(70079)),c=r(n(51848)),l=n(50382),d=r(n(26372)),p=n(90680),f=n(31745);t.RunFlowModal=u.memo((function(e){const{onRun:t,onClose:n,node:o}=e,[i,s]=u.useState(0),[r,m]=(0,p.useLocalStorage)(`run-inputs-${o.id}`,Object.keys(o.inputs).reduce(((e,t)=>(e[t]=`Enter a value for input ${t}`,e)),{})),[g,h]=u.useState(JSON.stringify(r,null,2)),v=e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})},y=u.useCallback((()=>{const e=JSON.parse(g);m(e),t(e,i)}),[t,m,g,i]),I=Object.keys(o.inputs),b=I.filter((e=>"required"!==o.inputs[e].mode)),C=u.useMemo((()=>I.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:"This node receives external inputs. Enter values for each input below:"}),(0,a.jsx)(c.default,{height:"80px",theme:"vs-dark",defaultLanguage:"json",value:g,onChange:e=>h(null!=e?e:""),onMount:v}),b.length>0?(0,a.jsxs)(l.Callout,{intent:l.Intent.NONE,children:["Note: input(s) ",(0,a.jsx)("code",{children:b.join(", ")})," are optional"]}):null]}):(0,a.jsx)("strong",{children:"This node does not receive any external inputs."})),[I.length,b,g]);return(0,a.jsxs)(l.Dialog,{isOpen:!0,onClose:e.onClose,className:"run-flow-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(l.Classes.DIALOG_BODY),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&y()},tabIndex:0,children:[C,(0,a.jsxs)("div",{className:"execution-delay-wrapper",children:[(0,a.jsxs)("label",{children:["Execution delay:"," ",(0,a.jsx)(f.InfoTooltip,{content:"Delay between each node execution. Useful for debugging."})]}),(0,a.jsx)(l.Slider,{value:i,onChange:s,min:0,labelStepSize:500,stepSize:100,labelRenderer:e=>`${e}ms`,max:1e3})]})]}),(0,a.jsx)("div",{className:l.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:l.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(l.Button,{onClick:n,children:"Close"}),(0,a.jsx)(l.Button,{onClick:y,intent:l.Intent.PRIMARY,className:"run-btn",children:"Run"})]})})]})}))},47230:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3152),t)},47749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starIcon=t.stopIcon=t.playIcon=t.pencilIcon=t.ungroupIcon=t.groupIcon=t.inspectIcon=t.removeNodeIcon=t.addNodeIcon=void 0,t.addNodeIcon='\n\n',t.removeNodeIcon='\n\n',t.inspectIcon='\n\n\n',t.groupIcon='\n\n\n',t.ungroupIcon='\n\n\n',t.pencilIcon='\n\n',t.playIcon='\n\n\n',t.stopIcon='\n\n\n',t.starIcon='\n\n\n\n\n'},1237:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HelpBubble=void 0;const i=n(70079),s=n(35250),r=n(50382),a=n(99489),u=n(50382),c=o(n(70079)),l=n(68120),d=n(71644),p=n(43490),f={offset:{enabled:!0,options:{offset:[0,20]}},preventOverflow:{enabled:!0,options:{padding:10}}};const m=["Viewport Controls","Editing","Selection"];t.HelpBubble=()=>{const[e,t]=c.default.useState(!1),n=Array.from(l.currentHotkeys.entries()).map((e=>{let[t,n]=e;return{combo:(o={key:t,menuData:n}).key,label:o.menuData.text,group:o.menuData.group};var o})).reduce(((e,t)=>(e[t.group]||(e[t.group]=[]),e[t.group].push(t),e)),{}),o=Object.entries(n).sort(((e,t)=>m.indexOf(t[0])-m.indexOf(e[0]))),{reportEvent:g}=(0,p.usePorts)(),h=(0,s.jsx)(r.Dialog,{isOpen:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:r.Classes.DIALOG_BODY,children:o.map((e=>{let[t,n]=e;return(0,s.jsxs)(c.default.Fragment,{children:[(0,s.jsx)(r.H4,{children:t}),n.map((e=>(0,i.createElement)(a.Hotkey,{...e,key:e.combo})))]},t)}))})}),v=(0,s.jsxs)(r.Menu,{children:[(0,s.jsx)(r.MenuItem,{text:"Hotkeys",onClick:()=>{t(!0),g("helpMenuItem",{item:"hotkeys"})}}),(0,s.jsx)(r.MenuItem,{text:"Documentation",onClick:()=>g("helpMenuItem",{item:"documentation"}),href:"https://www.flyde.dev/docs",target:"_blank"}),(0,s.jsx)(r.MenuDivider,{}),(0,s.jsx)(r.MenuItem,{text:"Discord",onClick:()=>g("helpMenuItem",{item:"discord"}),href:"https://discord.gg/x7t4tjZQP8",target:"_blank"})]});return(0,s.jsxs)("div",{className:"help-bubble","data-tip":"Help",children:[(0,s.jsx)(u.Popover,{content:v,modifiers:f,onOpened:()=>g("helpMenuOpen",{}),children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:d.helpIcon}})}),h]})}},71644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpIcon=void 0,t.helpIcon='\n\n\n'},3354:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1237),t)},7011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainInstanceEventsIndicator=void 0;const o=n(35250),i=n(30994),s=n(66189),r=n(50382);t.MainInstanceEventsIndicator=e=>{const{currentInsId:t,ancestorsInsIds:n}=e,{history:a,refreshHistory:u,resetHistory:c}=(0,s.useHistoryHelpers)(t),l=`main-indicator-${t}}`;return(0,o.jsx)("div",{className:"main-instance-events-indicator",children:(0,o.jsx)(r.Tooltip,{content:(0,s.calcHistoryContent)(a),children:(0,o.jsx)("span",{onMouseEnter:u,onMouseOut:c,id:(0,i.getMainInstanceIndicatorDomId)(t,n),className:"status-text","data-tip":"","data-html":!0,"data-for":l})})})}},22714:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7011),t)},63521:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VisualNodeEditor=t.defaultBoardData=t.defaultViewPort=t.NODE_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),c=n(74762),l=n(86553),d=n(65082),p=n(18420),f=n(26701),m=n(7047),g=n(53865),h=n(70079),v=n(68120),y=r(n(27942)),I=n(50382),b=n(66005),C=n(60190),_=n(71033),j=n(74762),x=n(99942),N=n(44338),P=n(561),O=n(84472),w=n(82232),E=n(18594),S=n(68371),D=r(n(61888)),M=n(65758),T=n(43490),k=r(n(26372)),R=n(25044),A=n(80510),V=n(1788),H=n(2130),$=n(88593),z=n(97106),G=n(67181),L=n(22714),F=n(3354),q=n(41032),U=n(30653),B=u.memo(I.Slider),W=()=>null;t.NODE_HEIGHT=28;t.defaultViewPort={pos:{x:0,y:0},zoom:1},t.defaultBoardData={selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}},t.VisualNodeEditor=u.memo(u.forwardRef(((e,n)=>{const{onChangeNode:o,nodeIoEditable:i,onCopy:s,onGoToNodeDef:r,onInspectPin:Z,boardData:Y,onChangeBoardData:K,currentInsId:Q,ancestorsInsIds:X,node:ee,onShowOmnibar:te,resolvedDependencies:ne,queuedInputsData:oe,initialPadding:ie,disableScrolling:se}=e,{onImportNode:re}=(0,z.useDependenciesContext)(),ae=(0,U.useDarkMode)(),{reportEvent:ue}=(0,T.usePorts)(),ce=e.parentViewport||t.defaultViewPort,[le,de]=(0,h.useState)({...ne,[ee.id]:ee});(0,h.useEffect)((()=>{de({...ne,[ee.id]:ee})}),[ne,ee]);const{selected:pe,from:fe,to:me}=Y,{instances:ge,connections:he,inputsPosition:ve,outputsPosition:ye,inputs:Ie,outputs:be}=ee,[Ce,_e]=(0,h.useState)(),[je,xe]=(0,h.useState)(),Ne=void 0===X,[Pe,Oe]=(0,h.useState)(0),[we,Ee]=(0,h.useState)(),[Se,De]=(0,h.useState)(!1),[Me,Te]=(0,h.useState)(),[ke,Re]=(0,h.useState)(),[Ae,Ve]=(0,h.useState)(),[He,$e]=(0,h.useState)(),ze=(0,h.useRef)();(0,f.useDidMount)((()=>{ze.current=Xe.current.querySelector(".inline-editor-portal-root")}));const Ge=(0,T.useConfirm)(),Le=(0,T.usePrompt)(),Fe=Y.viewPort,qe=(0,h.useRef)(!0),[Ue,Be]=(0,h.useState)(null),We=u.useCallback((e=>{K({viewPort:e})}),[K]),Je=u.useCallback(((e,t)=>Z(e,t)),[Z]),Ze=u.useCallback(((e,t,n)=>{const i=(0,A.handleConnectionCloseEditorCommand)(ee,{from:e,to:t}),s=(0,c.isInternalConnectionNode)(t)?ge.find((e=>e.id===t.insId)):null,r=(s?s.inputConfig:{})[t.pinId],a=(0,c.isStaticInputPinConfig)(r)?(0,V.handleDetachConstEditorCommand)(i,t.insId,t.pinId):i;o(a,(0,w.functionalChange)("close-connection")),K({from:void 0,to:void 0}),ue("createConnection",{source:n})}),[ge,o,K,ee,ue]),Ye=u.useCallback((async()=>{const e=await Le("New visual node name?");if(!e)return;const{currentNode:t}=await(0,M.groupSelected)(Y.selected,ee,e,"inline",Le);o(t,(0,w.functionalChange)("group node")),(0,O.toastMsg)("Node grouped"),ue("groupSelected",{count:Y.selected.length})}),[Le,Y.selected,o,ee,ue]);(0,h.useEffect)((()=>{if(we){const e=setTimeout((()=>{Ee(void 0)}),350);return()=>clearTimeout(e)}}),[we]);const[Ke,Qe]=(0,h.useState)();(0,h.useEffect)((()=>{(0,P.preloadMonaco)()}),[]);const Xe=(0,h.useRef)(),et=(0,y.default)(Xe),tt=u.useRef({x:400,y:400}),nt=(0,f.useBoundingclientrect)(Xe)||C.vZero,ot=()=>{const e=(0,m.fitViewPortToNode)(ee,le,et);(0,m.animateViewPort)(Fe,e,500,(e=>{We(e)}))},it=u.useCallback(((e,t)=>{const{to:n,from:o}=Y,i="input"===t?o:n,s="input"===t?n:o,r={pinId:e,insId:c.THIS_INS_ID},a="input"===t?{from:r}:{to:r};i&&i.pinId===e?K({from:void 0,to:void 0}):s?"input"===t&&n?Ze(r,n,"nodeIoClick"):o&&Ze(o,r,"nodeIoClick"):K(a)}),[Y,K,Ze]),st=u.useCallback(((e,t,n)=>{const i=(0,g.produce)(ee,(o=>{"input"===e?o.inputs[t].description=n:o.outputs[t].description=n}));o(i,(0,w.functionalChange)("Node io description"))}),[o,ee]),rt=u.useCallback(((e,t,n)=>{const{from:o,to:i}=Y;if(fe&&fe.insId===e.id||me&&me.insId===e.id)K({from:void 0,to:void 0});else if("input"===n){const n={insId:e.id,pinId:t};!i||i.pinId!==t||(0,c.isInternalConnectionNode)(i)&&i.insId!==e.id?fe?Ze(fe,n,"pinClick"):K({to:n,selected:[]}):K({to:void 0})}else{const n={insId:e.id,pinId:t};!o||o.pinId!==t||(0,c.isInternalConnectionNode)(o)&&o.insId!==e.id?me?Ze(n,me,"pinClick"):K({from:n,selected:[]}):K({from:void 0})}}),[Y,fe,K,Ze,me]);(0,h.useEffect)((()=>{if(!Se&&et.width){const t=(0,m.fitViewPortToNode)(ee,le,et,ie);We(t);const n=setTimeout((()=>{const t=(0,m.fitViewPortToNode)(ee,le,et,ie);e.thumbnailMode||We(t),De(!0)}),100);return()=>clearTimeout(n)}}),[ee,ie,et,e.thumbnailMode,Se,le,We]);const at=u.useCallback((()=>{const{selected:e}=Y,t=ee.instances.filter((t=>e.includes(t.id))).map((e=>({...e,id:e.id+"-copy"}))),n=ee.connections.filter((t=>{let{from:n,to:o}=t;return e.includes(n.insId)&&e.includes(o.insId)}));s({instances:t,connections:n})}),[Y,s,ee]),ut=u.useCallback((()=>{const{newNode:t,newInstances:n}=(0,R.pasteInstancesCommand)(ee,tt.current,e.clipboardData);o(t,(0,w.functionalChange)("paste instances")),K({selected:n.map((e=>e.id))})}),[o,K,ee,e.clipboardData]),ct=u.useCallback((()=>{const e=ee.id;Ke?"input"===Ke.type?Ke.ins.id===e?it(Ke.pin,"input"):rt(Ke.ins,Ke.pin,"input"):Ke.ins.id===e?it(Ke.pin,"output"):rt(Ke.ins,Ke.pin,"output"):console.warn("tried selecting closest with no pin nearby")}),[ee.id,Ke,it,rt]),lt=u.useCallback(((e,t)=>{const n=Math.min(Math.max(e,.1),3),o="mouse"===t?tt.current:{x:Fe.pos.x+et.width/2,y:Fe.pos.y+et.height/2},i=(0,m.centerBoardPosOnTarget)(o,et,n,Fe);We({...Fe,zoom:n,pos:i})}),[We,Fe,et]);(0,v.useHotkeys)("cmd+=",(e=>{lt(Fe.zoom+.1,"hotkey"),e.preventDefault()}),{text:"Zoom in board",group:"Viewport Controls"},[Fe,lt],qe),(0,v.useHotkeys)("cmd+-",(e=>{lt(Fe.zoom-.1,"hotkey"),e.preventDefault()}),{text:"Zoom out board",group:"Viewport Controls"},[lt,Fe.zoom],qe),(0,v.useHotkeys)("cmd+o",(e=>{e.preventDefault(),(0,O.toastMsg)("Ordering");const t=[];(0,x.orderVisualNode)(ee,le,200,((e,n)=>{n%3==0&&t.push(e)})),(async()=>{for(;t.length;){const e=t.shift();(0,O.toastMsg)(`Step ${t.length}!`),await(0,c.delay)(200),o(e,(0,w.metaChange)("order-step")),(0,O.toastMsg)(`Step ${t.length}! done`)}})()}),{text:"Auto-layout (experimental)",group:"Misc."},[o,ee,ne],qe),(0,v.useHotkeys)("cmd+0",(e=>{lt(1),e.preventDefault()}),{text:"Reset zoom",group:"Viewport Controls"},[Fe,lt],qe);const dt=()=>{K({from:void 0,to:void 0,selected:[]})},pt=u.useCallback(((e,t)=>{_e(e.id),o({...ee},(0,w.metaChange)("drag-start"))}),[o,ee]),ft=u.useCallback(((e,t,n)=>{const{newValue:i,newSelected:s}=(0,m.handleInstanceDrag)(ee,e,n,t,pe,Ce);o(i,(0,w.metaChange)("drag-move")),s&&K({selected:s})}),[Ce,o,K,pe,ee]),mt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(void 0)}),[]),gt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(c.THIS_INS_ID)}),[]),ht=u.useCallback((async(t,n,o,i)=>{o.preventDefault(),o.stopPropagation();const{x:s,y:r}=i,a=(0,g.produce)(ee,(e=>{"input"===t?e.inputsPosition[n]={x:s,y:r}:e.outputsPosition[n]={x:s,y:r}}));e.onChangeNode(a,(0,w.metaChange)("node-io-drag-move"))}),[e,ee]),vt=u.useCallback((async(e,t,n,o)=>{n.preventDefault(),n.stopPropagation(),_e(void 0)}),[]),yt=u.useCallback(((e,t)=>{let{id:n}=e;const o=t.shiftKey?pe.filter((e=>e!==n)):[],i=t.shiftKey?[...pe,n]:[n],s=pe.includes(n)?o:i;K({selected:s,from:void 0,to:void 0})}),[K,pe]),It=u.useCallback((()=>{const e=ee.instances.map((e=>e.id));K({selected:e,from:void 0,to:void 0})}),[K,ee.instances]),bt=u.useCallback((e=>{const t=he.filter((t=>{let{from:n,to:o}=t;return-1===e.indexOf(n.insId)&&-1===e.indexOf(o.insId)})),n=(0,g.produce)(ee,(n=>{n.connections=t,n.instances=n.instances.filter((t=>!e.includes(t.id)))}));K({selected:[]}),o(n,(0,w.functionalChange)("delete-ins"))}),[he,o,K,ee]),Ct=u.useCallback((e=>{bt([e.id])}),[bt]),_t=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{"input"===e?(delete n.inputs[t],n.connections=n.connections.filter((e=>!((0,c.isExternalConnectionNode)(e.from)&&e.from.pinId===t)))):(n.connections=n.connections.filter((e=>!((0,c.isExternalConnectionNode)(e.to)&&e.to.pinId===t))),n.completionOutputs=(n.completionOutputs||[]).map((e=>e.split("+").filter((e=>e!==t)).join("+"))).filter((e=>!!e)),delete n.outputs[t])}));fe&&fe.insId===c.THIS_INS_ID&&fe.pinId===t?K({from:void 0}):me&&me.insId===c.THIS_INS_ID&&me.pinId===t&&K({to:void 0}),o(n,(0,w.functionalChange)("remove io pin"))}),[ee,fe,me,o,K]),jt=u.useCallback((async()=>{const{selected:e,from:t,to:n}=Y;0===e.length?t&&(0,c.isExternalConnectionNode)(t)?await Ge(`Are you sure you want to remove main input ${t.pinId}?`)&&_t("input",t.pinId):n&&(0,c.isExternalConnectionNode)(n)&&await Ge(`Are you sure you want to remove main output ${n.pinId}?`)&&_t("output",n.pinId):bt(e)}),[Ge,Y,bt,_t]),xt=u.useCallback(((e,t,n)=>{const i=(0,m.getInstancePinConfig)(ee,e.id,t),s=(0,c.isStickyInputPinConfig)(i)?(0,j.queueInputPinConfig)():(0,c.stickyInputPinConfig)();o((0,m.changePinConfig)(ee,e.id,t,s),(0,w.functionalChange)("toggle-sticky")),ue("togglePinSticky",{isSticky:(0,c.isStickyInputPinConfig)(s)})}),[o,ee,ue]),Nt=u.useCallback((()=>{const{newNode:e,newInstances:t}=(0,H.handleDuplicateSelectedEditorCommand)(ee,pe);o(e,(0,w.functionalChange)("duplicated instances")),K({selected:t.map((e=>e.id))})}),[o,K,ee,pe]),Pt=u.useCallback((e=>{const t=e.nativeEvent.target;if(0===e.button&&J(e.nativeEvent,ee.id)&&t&&"board-editor-inner"===t.className){if(Date.now()-Pe<300)return void te(e);Oe(Date.now());const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,nt),o=(0,m.domToViewPort)(n,Fe,ce);xe({from:o,to:o})}}),[ee.id,Fe,Pe,nt,ce,te]),Ot=u.useCallback((e=>{if(Be(null),J(e.nativeEvent,ee.id)&&je){if((0,m.calcSelectionBoxArea)(je)>50){const t=(0,m.getInstancesInRect)(je,le,Fe,Kt.current,ee.instances,nt,ce),n=e.shiftKey?[...pe,...t]:t;K({selected:n})}xe(void 0)}}),[ee.id,ee.instances,je,le,Fe,nt,ce,pe,K]),wt=u.useCallback((e=>{if(!J(e.nativeEvent,ee.id))return void(qe.current=!1);qe.current=!0;const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,(0,C.vAdd)(nt,C.vZero)),o=(0,m.domToViewPort)(n,Fe,ce);je&&xe({...je,to:o});const i=(0,m.findClosestPin)(ee,le,n,nt,Q,X,Fe),s=Ke;if(i){(!s||s.ins!==i.ins||s.ins===i.ins&&s.pin!==i.pin)&&Qe({ins:i.ins,type:i.type,pin:i.id})}tt.current=o,K({lastMousePos:tt.current})}),[ee,nt,Fe,ce,je,le,Q,X,Ke,K]),Et=u.useCallback((e=>{var t;"bp5-menu"!==(null===(t=e.relatedTarget)||void 0===t?void 0:t.className)&&(Qe(void 0),qe.current=!1)}),[]),St=u.useCallback(((e,t)=>{if(t){const t=(0,c.isInlineNodeInstance)(e)?e.node:(0,q.safelyGetNodeDef)(e.nodeId,le);if(!t)throw new Error("Impossible state inspecting inexisting node");if(!(0,c.isVisualNode)(t))return void(0,O.toastMsg)("Cannot inspect a non visual node","warning");$e({insId:`${Q}.${e.id}`,node:t})}else if((0,c.isRefNodeInstance)(e)){const t=(0,q.safelyGetNodeDef)(e,le);r(t)}else{const t=e.node;if(!(0,c.isInlineValueNode)(t))return void((0,c.isVisualNode)(t)?$e({insId:e.id,node:t}):(0,O.toastMsg)("Editing this type of node is not supported"));const n=atob(t.dataBuilderSource);Ve({insId:e.id,templateType:t.templateType,value:n,type:"existing"}),(0,O.toastMsg)("Editing inline visual node not supported yet")}}),[r,le,Q]),Dt=u.useCallback((e=>{if((0,c.isInlineNodeInstance)(e)){const t=e.node;if(!(0,c.isVisualNode)(t))return void(0,O.toastMsg)("Not supported","warning");const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.filter((t=>t.id!==e.id)),n.connections=n.connections.filter((t=>{let{from:n,to:o}=t;return n.insId!==e.id&&o.insId!==e.id})),n.instances.push(...t.instances),n.connections.push(...t.connections.filter((e=>(0,c.isInternalConnectionNode)(e.from)&&(0,c.isInternalConnectionNode)(e.to))))}));o(n,{type:"functional",message:"ungroup"}),K({selected:[]})}else{const t=(0,q.safelyGetNodeDef)(e.nodeId,le);if(!(0,c.isVisualNode)(t))return void(0,O.toastMsg)("Not supported","warning")}}),[ee,o,K,le]),Mt=u.useCallback((async e=>{}),[]),Tt=u.useCallback(((e,t)=>{const n=(0,V.handleDetachConstEditorCommand)(ee,e.id,t);o(n,(0,w.functionalChange)("detach-const"))}),[o,ee]),kt=u.useCallback(((e,t)=>{const n=e.inputConfig[t]||(0,j.queueInputPinConfig)();(0,c.isStaticInputPinConfig)(n)&&(Re(n.value),O.AppToaster.show({message:"Value copied"}))}),[]),Rt=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{const o=n.instances.find((t=>t.id===e.id));if(!o)throw new Error("Impossible state");o.inputConfig[t]=(0,c.staticInputPinConfig)(ke),n.connections=n.connections.filter((n=>!(0,c.isInternalConnectionNode)(n.to)||!(n.to.insId===e.id&&n.to.pinId===t)))}));o(n,(0,w.functionalChange)("paste const value"))}),[ee,o,ke]),At=u.useCallback((async e=>{const t=await Le("New name?");if(!t)return;const n=(0,g.produce)(ee,(n=>{var o;"input"===e?(ee.inputs||(n.inputs={}),n.inputs[t]=(0,c.nodeInput)(),n.inputsPosition[t]=tt.current):(ee.outputs||(n.outputs={}),n.outputs[t]=(0,c.nodeOutput)(),n.outputsPosition[t]=tt.current,(null===(o=n.completionOutputs)||void 0===o?void 0:o.length)&&(0,O.toastMsg)("Note that this node has explicit completion outputs set. You may need to update them."))}));o(n,(0,w.functionalChange)("add new io pin")),ue("addIoPin",{type:e})}),[Le,ee,o,ue]),Vt=u.useCallback((async()=>{var e;const t=null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","),n=await Le("Edit completion outputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,g.produce)(ee,(e=>{e.completionOutputs=""===n?void 0:n.split(",")}));o(e,(0,w.functionalChange)("change node completions")),ue("editCompletionOutputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),Ht=u.useCallback((async()=>{var e;const t=null===(e=ee.reactiveInputs)||void 0===e?void 0:e.join(","),n=await Le("Edit reactive inputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,g.produce)(ee,(e=>{e.reactiveInputs=""===n?void 0:n.split(",")}));o(e,(0,w.functionalChange)("change reactive inputs")),ue("editReactiveInputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),$t=u.useCallback((async()=>{const e=await Le("Description?",ee.description),t=(0,g.produce)(ee,(t=>{t.description=e}));o(t,(0,w.functionalChange)("Edit node description"))}),[Le,o,ee]),zt=u.useCallback((e=>{const t=(0,g.produce)(ee,(t=>{t.defaultStyle=e}));o(t,(0,w.functionalChange)("change default style")),ue("changeStyle",{isDefault:!0})}),[o,ee,ue]),Gt=u.useCallback((async(e,t)=>{const n=await Le("New name?",t)||t,i=(0,m.handleIoPinRename)(ee,e,t,n);o(i,(0,w.functionalChange)("rename io pin"))}),[ee,o,Le]),Lt=u.useCallback(((e,t)=>{const n=(0,m.handleChangeNodeInputType)(ee,e,t);o(n,(0,w.functionalChange)("toggle io pin optional"))}),[ee,o]),Ft=u.useCallback((e=>{switch(e.type){case G.ActionType.RemoveNode:{const e=(0,g.produce)(ee,(e=>{if(!(0,c.isVisualNode)(ee))throw new Error("Impossible state, deleting instances opf non visual node");e.instances=e.instances.filter((e=>!pe.includes(e.id))),e.connections=e.connections.filter((e=>!pe.includes(e.from.insId)&&!pe.includes(e.to.insId)))}));K({selected:[]}),o(e,(0,w.functionalChange)("remove-instances")),(0,O.toastMsg)(`Removed ${pe.length} instances(s)`),ue("deleteInstances",{count:pe.length});break}case G.ActionType.Inspect:if(1===pe.length)Z(pe[0]);else if(fe||me){const e=null!=fe?fe:me,t=(0,c.isExternalConnectionNode)(e)?c.ROOT_INS_ID:e.insId;Z(t,{type:fe?"output":"input",id:e.pinId})}ue("openInspectMenu",{source:"actionMenu"});break;case G.ActionType.Group:(async()=>{await Ye()})();break;case G.ActionType.UnGroup:{const e=ee.instances.find((e=>e.id===pe[0]));Dt(e);const t=(0,q.safelyGetNodeDef)(e,le);(0,O.toastMsg)(`Ungrouped inline node ${t.id}`),ue("unGroupNode",{instancesCount:t.instances.length});break}case G.ActionType.AddInlineValue:Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"actionMenu"});break;case G.ActionType.AddNode:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,g.produce)(ee,(e=>{e.instances.push(r)})),u=(0,g.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,w.functionalChange)("add new instance")),K(u),(0,O.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;case G.ActionType.AI:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,g.produce)(ee,(e=>{e.instances.push(r)})),u=(0,g.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,w.functionalChange)("add new instance")),K(u),(0,O.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;default:(0,O.toastMsg)(`${e.type} not supported yet`)}}),[Y,fe,o,K,Ye,re,Z,Dt,ee,le,ue,pe,me,Fe,et]),qt=()=>{const t=Y.from;return(0,p.entries)(Ie).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"input",pos:ve[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,onDblClick:Jt,closest:!(!Ke||"input"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,inputMode:s.mode,onChangeInputMode:Lt,viewPort:Fe,onDragStart:gt,onDragEnd:vt,onDragMove:ht,onSelect:it,onSetDescription:st,selected:(null==t?void 0:t.pinId)===o,description:s.description,onMouseUp:xn,onMouseDown:jn},o)}))},Ut=()=>{const{to:t}=Y;return(0,p.entries)(be).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"output",pos:ye[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,closest:!(!Ke||"output"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,viewPort:Fe,onDragStart:gt,onDragEnd:vt,onDragMove:ht,onSelect:it,onSetDescription:st,description:s.description,selected:(null==t?void 0:t.pinId)===o,onMouseUp:xn,onMouseDown:jn},o)}))},Bt=()=>{if(je){const{from:e,to:t}=je,n=(0,m.logicalPosToRenderedPos)(e,Fe),o=(0,m.logicalPosToRenderedPos)(t,Fe),{x:i,y:s,w:r,h:u}=(0,m.getSelectionBoxRect)(n,o);return(0,a.jsx)("div",{className:"selection-box",style:{top:s,left:i,width:r,height:u}})}return null},Wt=u.useCallback((async(e,t,n,o)=>{if("input"===n){const n=e.inputConfig[t],o=(0,c.isStaticInputPinConfig)(n)?JSON.stringify(n.value):void 0;Ve({type:"static-input",insId:e.id,pinId:t,value:null!=o?o:JSON.stringify("Some static value")}),ue("addValueModalOpen",{source:"dblClickPin"})}else{const i=(0,q.safelyGetNodeDef)(e,le);if(!(0,c.getNodeOutputs)(i)[t])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:o.clientX,y:o.clientY},ins:e,targetNode:i,pinId:t,pinType:n})}}),[le,ue]),Jt=u.useCallback((async(e,t)=>{if(!ee.inputs[e])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:t.clientX,y:t.clientY},pinId:e,pinType:"input",targetNode:ee})}),[ee]),Zt=u.useCallback((e=>{if(e.metaKey||e.ctrlKey){const t=-.005*e.deltaY;lt(Fe.zoom+t,"mouse"),e.preventDefault(),e.stopPropagation()}else{if(se)return;const t=e.deltaX,n=e.deltaY,o=(0,g.produce)(Fe,(e=>{e.pos.x=e.pos.x+t/e.zoom,e.pos.y=e.pos.y+n/e.zoom}));We(o),e.stopPropagation(),e.preventDefault()}}),[se,lt,We,Fe]);(0,h.useEffect)((()=>{const{current:e}=Xe;if(e)return e.addEventListener("wheel",Zt),()=>{e.removeEventListener("wheel",Zt)}}),[Zt]);const Yt={backgroundPositionX:(0,m.roundNumber)(-Fe.pos.x*Fe.zoom),backgroundPositionY:(0,m.roundNumber)(-Fe.pos.y*Fe.zoom),backgroundSize:(0,m.roundNumber)(10*Fe.zoom)+"px"},Kt=u.useRef(new Map);u.useEffect((()=>{const e=ge.reduce(((e,t)=>{const n=(0,q.safelyGetNodeDef)(t,le);return n&&e.set(t.id,(0,c.keys)((0,c.getNodeInputs)(n))),e}),new Map),t=ge.reduce(((e,t)=>{const n=(0,q.safelyGetNodeDef)(t,le);return n&&e.set(t.id,(0,c.keys)((0,c.getNodeOutputs)(n))),e}),new Map);e.set(c.THIS_INS_ID,(0,c.keys)(ee.outputs)),t.set(c.THIS_INS_ID,(0,c.keys)(ee.inputs));const n=he.filter((n=>{const o=e.get(n.to.insId)&&e.get(n.to.insId).includes(n.to.pinId),i=t.get(n.from.insId)&&t.get(n.from.insId).includes(n.from.pinId);return!(o&&i)}));if(n.length>0){(0,O.toastMsg)(`${n.length} orphan connections removed`,"warning"),console.warn(`${n.length} orphan connections removed`,n);const e=(0,g.produce)(ee,(e=>{e.connections=ee.connections.filter((e=>!n.includes(e)))}));o(e,(0,w.functionalChange)("prune orphan connections"))}}),[ge,o,he,ee,le]),u.useEffect((()=>{let e=[];const t=(0,g.produce)(ee,(t=>{t.instances=t.instances.map((t=>{const n=(0,q.safelyGetNodeDef)(t,le);if(n){const o=(0,c.getNodeInputs)(n),i=(0,c.getNodeOutputs)(n);if(t.visibleInputs){const n=t.visibleInputs.filter((e=>!o[e]));n.length>0&&(t.visibleInputs=(0,c.keys)(o),e.push(...n))}if(t.visibleOutputs){const n=t.visibleOutputs.filter((e=>!i[e]));n.length>0&&(t.visibleOutputs=(0,c.keys)(i),e.push(...n))}}return t}))}));e.length>0&&((0,O.toastMsg)(`Found ${e.length} invalid visible inputs/outputs: ${e.join(", ")}. Reset them`,"warning"),o(t,(0,w.functionalChange)("reset corrupt visible inputs/outputs")))}),[ge,o,ee,le]),(0,h.useEffect)((()=>{const e=new Map(ge.map((e=>[e.id,e])));Kt.current=he.reduce(((t,n)=>{const o=t.get(n.to.insId)||{},i=o[n.to.pinId]||[],s={...o,[n.to.pinId]:[...i,e.get(n.from.insId)]};return t.set(n.to.insId,s),t}),new Map)}),[he,ge]);const Qt=u.useCallback((()=>{Te(void 0)}),[]),Xt=u.useCallback((async e=>{if(!Me)throw new Error("impossible state - quick add menu invoked but not available");const{ins:t,pinId:n}=Me;switch(e.type){case"import":case"node":{const i="import"===e.type?await re(e.importableNode):le,s="import"===e.type?e.importableNode.node:e.node,r=(0,m.createNewNodeInstance)(s.id,100,tt.current,i);if(r){const e=(0,g.produce)(ee,(e=>{e.instances.push(r),e.connections.push({from:{insId:t?t.id:c.THIS_INS_ID,pinId:n},to:{insId:r.id,pinId:c.TRIGGER_PIN_ID}})}));o(e,(0,w.functionalChange)("add-item-quick-menu")),Qt()}ue("addNode",{nodeId:s.id,source:"quickAdd"});break}case"value":if(!t)return void(0,O.toastMsg)("Cannot add value to main input");Ve({type:"new-output",insId:t.id,pinId:n}),ue("addValueModalOpen",{source:"quickAdd"})}}),[Me,le,ue,ee,o,Qt,re]),en=u.useCallback((async()=>{const e=JSON.stringify(ee);await navigator.clipboard.writeText(e),O.AppToaster.show({message:"Copied!"})}),[ee]),tn=u.useCallback((()=>{var e,t;const n=i?"":" (cannot edit main node, only visual)";return(0,a.jsxs)(I.Menu,{children:[(0,a.jsx)(I.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"New Value",onClick:(0,p.preventDefaultAnd)((()=>{Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"contextMenu"})}))}),(0,a.jsx)(I.MenuItem,{text:`New input ${n}`,onMouseDown:e=>e.stopPropagation(),onClick:(0,p.preventDefaultAnd)((()=>At("input"))),disabled:!i}),(0,a.jsx)(I.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`New output ${n}`,onClick:(0,p.preventDefaultAnd)((()=>At("output"))),disabled:!i}),(0,a.jsx)(I.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Copy node to clipboard",onClick:(0,p.preventDefaultAnd)(en)}),(0,a.jsx)(I.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Completion Outputs (${(null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Vt()))}),(0,a.jsx)(I.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Reactive inputs (${(null===(t=ee.reactiveInputs)||void 0===t?void 0:t.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Ht()))}),(0,a.jsx)(I.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Edit description",onClick:(0,p.preventDefaultAnd)((()=>$t()))}),(0,a.jsx)(I.MenuDivider,{}),(0,a.jsx)(I.MenuItem,{text:"Default Style",children:(0,a.jsx)($.NodeStyleMenu,{style:ee.defaultStyle,onChange:zt,promptFn:Le})})]})}),[i,en,ee.completionOutputs,ee.reactiveInputs,ee.defaultStyle,zt,Le,ue,At,Vt,Ht,$t]);(0,v.useHotkeys)("shift+c",ot,{text:"Center viewport",group:"Viewport Controls"},[],qe),(0,v.useHotkeys)("cmd+c",at,{text:"Copy instances",group:"Editing"},[],qe),(0,v.useHotkeys)("cmd+v",ut,{text:"Paste instances",group:"Editing"},[],qe),(0,v.useHotkeys)("esc",dt,{text:"Clear selections",group:"Selection"},[],qe),(0,v.useHotkeys)("backspace",jt,{text:"Delete instances",group:"Editing"},[],qe),(0,v.useHotkeys)("shift+d",Nt,{text:"Duplicate selected instances",group:"Editing"},[],qe),(0,v.useHotkeys)("cmd+a",It,{text:"Select all",group:"Selection"},[],qe),(0,v.useHotkeys)("s",ct,{text:"Select pin closest to mouse",group:"Selection"},[],qe);const nn=u.useCallback(((e,t)=>{if(!He)throw new Error("impossible state");const n=(0,g.produce)(ee,(t=>{const n=t.instances.find((e=>e.id===He.insId));if(!n||!(0,c.isInlineNodeInstance)(n))throw new Error("impossible state");n.node=e}));o(n,(0,w.functionalChange)("Inner change: "+t.message)),$e((t=>({...t,node:e})))}),[o,He,ee]),[on,sn]=(0,h.useState)({selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}}),rn=u.useCallback((e=>sn((t=>({...t,...e})))),[]),an=n=>He&&He.insId===n.id?{currentInsId:He.insId,ancestorsInsIds:(0,c.fullInsIdPath)(Q,X),boardData:on,onChangeBoardData:rn,resolvedDependencies:ne,onCopy:s,clipboardData:e.clipboardData,onInspectPin:e.onInspectPin,onGoToNodeDef:e.onGoToNodeDef,nodeIoEditable:e.nodeIoEditable,node:He.node,onChangeNode:nn,onShowOmnibar:te,parentViewport:t.defaultViewPort,parentBoardPos:nt,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:e.queuedInputsData}:void 0,un=()=>{if(fe&&("input"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"output"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:c.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,c.isInternalConnectionNode)(e)&&!(0,c.isInternalConnectionNode)(fe))return;return{from:fe,to:e}}if(me&&("output"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"input"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:c.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,c.isInternalConnectionNode)(me)&&!(0,c.isInternalConnectionNode)(e))return;return{from:e,to:me}}},cn=()=>{const e=un();if(e){const{from:t,to:n}=e;return{connection:{from:t,to:n},type:he.some((t=>(0,c.connectionDataEquals)(t,e)))?"future-remove":"future-add"}}},ln=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleInputs:t}:n))}));o(n,(0,w.functionalChange)("change instance visible inputs"))}),[ee,o]),dn=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,style:t}:n))}));o(n,(0,w.functionalChange)("change instance style")),ue("changeStyle",{isDefault:!1})}),[o,ee,ue]),pn=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleOutputs:t}:n))}));o(n,(0,w.functionalChange)("change instance visible outputs"))}),[ee,o]),fn=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,displayName:t}:n))}));o(n,(0,w.functionalChange)("change instance display name"))}),[ee,o]);u.useImperativeHandle(n,(()=>({centerInstance(e){const t=ee.instances.find((t=>t.id===e));if(t){const e=(0,C.vSub)(t.pos,(0,C.vec)(et.width/2,et.height/2));We({...Fe,pos:e})}},centerViewPort(){ot()},getViewPort:()=>Fe,clearSelection:()=>{dt()},requestNewInlineValue:()=>{Ve({type:"new-floating",pos:tt.current})}})));const[mn,gn]=u.useState([]),hn=u.useCallback(((e,t)=>{const n=t.trim().substr(0,100),i=`Inline-value-${n.substr(0,15).replace(/["'`]/g,"")}`,s=(0,S.createInlineValueNode)({code:t,customView:n,nodeId:i,type:e});switch(Ae.type){case"existing":{const[e]=ee.instances.filter((e=>e.id===Ae.insId)).filter((e=>(0,c.isInlineNodeInstance)(e))).map((e=>e.node));if(!e)throw new Error("Unable to find inline node to save to");const t=(0,c.keys)(e.inputs),n=(0,c.keys)(s.inputs),i=new Set(D.default.difference(t,n)),r=(0,g.produce)(ee,(e=>{e.instances=e.instances.map((e=>e.id===Ae.insId?(0,c.inlineNodeInstance)(e.id,s,e.inputConfig,e.pos):e)),e.connections=e.connections.filter((e=>!(e.to.insId===Ae.insId&&i.has(e.to.pinId))))}));o(r,(0,w.functionalChange)("change inline value")),Ve(void 0);break}case"static-input":{let e;try{const n=t.replace(/^['`]/,'"').replace(/['`]$/,'"');e=JSON.parse(n)}catch(r){return void(0,O.toastMsg)("Input values must not be formulas or code")}const n=(0,g.produce)(ee,(t=>{t.instances.find((e=>e.id===Ae.insId)).inputConfig[Ae.pinId]=(0,c.staticInputPinConfig)(e)}));o(n,(0,w.functionalChange)("set static input value")),Ve(void 0);break}case"new-floating":{const e=(0,c.inlineNodeInstance)((0,c.createInsId)(s),s,{},Ae.pos),t=(0,g.produce)(ee,(t=>{t.instances.push(e)}));o(t,(0,w.functionalChange)("new floating value")),Ve(void 0);break}case"new-output":{const{insId:e,pinId:t}=Ae,n=ee.instances.find((t=>t.id===e));if(!n)throw new Error("Impossible state");const i=(0,c.inlineNodeInstance)((0,c.createInsId)(s),s,{},(0,C.vAdd)(n.pos,{x:-50,y:150})),r=(0,g.produce)(ee,(n=>{n.instances.push(i),n.connections.push({from:(0,c.connectionNode)(e,t),to:(0,c.connectionNode)(i.id,c.TRIGGER_PIN_ID)})}));o(r,(0,w.functionalChange)("new value connected to output")),Ve(void 0)}}ue("addValue",{type:e,placeholdersCount:(0,c.keys)(s.inputs).length})}),[Ae,o,ee,ue]),vn=he.filter((e=>{const t=un();return!t||!(0,c.connectionDataEquals)(t,e)})),yn=u.useCallback((()=>{$e(void 0),sn(t.defaultBoardData)}),[]),In=u.useCallback((e=>{const t=(0,g.produce)(ee,(t=>{const n=t.connections.find((t=>(0,c.connectionDataEquals)(t,e)));n.hidden=!n.hidden}));o(t,(0,w.functionalChange)("toggle connection hidden"))}),[o,ee]),bn=u.useCallback((e=>{const t=(0,g.produce)(ee,(t=>{t.connections=t.connections.filter((t=>!(0,c.connectionDataEquals)(t,e)))}));o(t,(0,w.functionalChange)("remove connection"))}),[o,ee]),Cn=u.useCallback(((e,t,n)=>{Be("input"===n?{to:(0,c.connectionNode)(e.id,t),from:void 0}:{from:(0,c.connectionNode)(e.id,t),to:void 0})}),[]),_n=u.useCallback(((e,t,n)=>{Ue&&(Ue.from&&"input"===n?Ze(Ue.from,(0,c.connectionNode)(e.id,t),"pinDrag"):Ue.to&&"output"===n&&Ze((0,c.connectionNode)(e.id,t),Ue.to,"pinDrag")),Be(null)}),[Ue,Ze]),jn=u.useCallback(((e,t)=>{}),[]),xn=u.useCallback(((e,t)=>{Ue&&(Ue.from&&"output"===t?Ze(Ue.from,(0,c.externalConnectionNode)(e),"nodeIoPinDrag"):Ue.to&&"input"===t&&Ze((0,c.externalConnectionNode)(e),Ue.to,"nodeIoPinDrag"))}),[Ue,Ze]);try{return(0,a.jsxs)(I.ContextMenu,{className:(0,k.default)("visual-node-editor",e.className,{dark:ae}),"data-id":ee.id,content:tn(),disabled:!qe.current,children:[(0,a.jsxs)("main",{className:"board-editor-inner",onMouseDown:Pt,onMouseUp:Ot,onMouseMove:wt,onMouseLeave:Et,ref:Xe,style:Yt,children:[(0,a.jsx)(u.Fragment,{children:(0,a.jsx)(N.LayoutDebugger,{vp:Fe,node:ee,extraDebug:m.emptyList,mousePos:tt.current})}),(0,a.jsx)(d.ConnectionView,{resolvedNodes:le,currentInsId:Q,ancestorsInsIds:X,size:et,node:ee,boardPos:nt,instances:ge,connections:vn,futureConnection:cn(),onDblClick:c.noop,viewPort:Fe,parentVp:ce,selectedInstances:pe,toggleHidden:In,removeConnection:bn,lastMousePos:tt.current,draggedSource:Ue}),qt(),ge.map((t=>{var n,o,i,s,r;return(0,a.jsx)(l.InstanceView,{onUngroup:Dt,onExtractInlineNode:Mt,onDetachConstValue:Tt,onCopyConstValue:kt,onPasteConstValue:Rt,copiedConstValue:ke,connectionsPerInput:Kt.current.get(t.id)||m.emptyObj,node:(0,q.safelyGetNodeDef)(t,le),ancestorsInsIds:(0,c.fullInsIdPath)(Q,X),onPinClick:rt,onPinDblClick:Wt,onDragStart:pt,onDragEnd:mt,resolvedDeps:le,onDragMove:ft,onDblClick:St,onSelect:yt,onToggleSticky:xt,selected:-1!==pe.indexOf(t.id),dragged:Ce===t.id,onInspectPin:Je,selectedInput:me&&(0,c.isInternalConnectionNode)(me)&&me.insId===t.id?me.pinId:void 0,selectedOutput:fe&&(0,c.isInternalConnectionNode)(fe)&&fe.insId===t.id?fe.pinId:void 0,closestPin:Ke&&Ke.ins.id===t.id?Ke:void 0,queuedInputsData:null!==(n=oe[t.id])&&void 0!==n?n:m.emptyObj,instance:t,connections:he,onTogglePinBreakpoint:c.noop,onTogglePinLog:c.noop,viewPort:Fe,onChangeVisibleInputs:ln,onChangeVisibleOutputs:pn,onSetDisplayName:fn,onDeleteInstance:Ct,forceShowMinimized:fe||(null===(o=null==Ue?void 0:Ue.to)||void 0===o?void 0:o.insId)===t.id?"input":me||(null===(i=null==Ue?void 0:Ue.from)||void 0===i?void 0:i.insId)===t.id?"output":void 0,isConnectedInstanceSelected:pe.some((e=>he.some((n=>{let{from:o,to:i}=n;return o.insId===t.id&&i.insId===e||o.insId===e&&i.insId===t.id})))),inlineGroupProps:an(t),onCloseInlineEditor:yn,inlineEditorPortalDomNode:ze.current,onChangeStyle:dn,onGroupSelected:Ye,onPinMouseDown:Cn,onPinMouseUp:_n,hadError:null!==(r=null===(s=e.instancesWithErrors)||void 0===s?void 0:s.has((0,c.fullInsIdPath)(t.id)))&&void 0!==r&&r},t.id)})),Bt(),Ut(),(0,a.jsx)(L.MainInstanceEventsIndicator,{currentInsId:Q,ancestorsInsIds:X,viewPort:Fe}),Me?(0,a.jsx)(_.QuickAddMenu,{targetNode:Me.targetNode,pinId:Me.pinId,pinType:Me.pinType,pos:Me.pos,resolvedDependencies:ne,node:ee,onAdd:Xt,onClose:Qt}):null,(0,a.jsxs)("div",{className:"viewport-controls-and-help",children:[(0,a.jsx)(I.Button,{small:!0,onClick:ot,minimal:!0,intent:"primary",children:"Center"}),(0,a.jsx)(B,{min:.15,max:3,stepSize:.05,labelStepSize:10,labelRenderer:W,onChange:lt,value:Fe.zoom}),Ne?(0,a.jsx)(F.HelpBubble,{}):null]}),Ae?(0,a.jsx)(E.InlineCodeModal,{env:m.emptyObj,initialValue:Ae.value,initialType:"existing"===Ae.type?Ae.templateType:void 0,onCancel:()=>Ve(void 0),onSubmit:hn}):null,(0,a.jsx)("div",{className:"inline-editor-portal-root"})]}),(0,a.jsx)(G.ActionsMenu,{showRunFlowOptions:Ne,onAction:Ft,selectedInstances:pe,node:ee,resolvedNodes:le,to:me,from:fe,hotkeysEnabled:qe})]})}catch(Nn){return console.error(Nn),(0,a.jsxs)("div",{children:["Error rendering board - ",Nn.toString()]})}})));const J=(e,t)=>{const n=e.target.closest(".visual-node-editor");return n&&n.getAttribute("data-id")===t}},83234:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeView=void 0;const a=n(35250),u=s(n(70079)),c=r(n(26372)),l=r(n(59349)),d=n(30653);t.BaseNodeView=function(e){const{dragged:t,viewPort:n,pos:o,onDragEnd:i,onDragMove:s,onDragStart:r,displayMode:p}=e,f=(0,d.useDarkMode)(),m=u.useCallback(((e,t)=>{r(e,t)}),[r]),g=u.useCallback(((e,t)=>{const s=o,r=(t.x-s.x)/n.zoom,a=(t.y-s.y)/n.zoom,u=s.x+r,c=s.y+a;i(e,{...t,x:u,y:c})}),[o,i,n]),h=u.useCallback(((e,t)=>{s(e,{x:t.x,y:t.y})}),[s]),v={transform:`scale(${n.zoom})`},y=(0,c.default)("base-node-view",e.className,{dragged:t,dark:f,"display-mode":p}),I=o.x*n.zoom-n.pos.x*n.zoom,b=o.y*n.zoom-n.pos.y*n.zoom,C={transform:`translate(${I-o.x}px, ${b-o.y}px)`},_=(0,c.default)("base-node-view-vp-fixer",{"display-mode":p}),j=(0,a.jsx)("span",{className:"base-node-view-wrapper",children:(0,a.jsx)("div",{className:y,style:v,id:e.domId,children:e.children})});return(0,a.jsx)("div",{className:_,style:C,children:(0,a.jsx)(l.default,{onStop:g,onStart:m,onDrag:h,position:o,cancel:".no-drag",children:j})})}},80510:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleConnectionCloseEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleConnectionCloseEditorCommand=(e,t)=>{let{from:n,to:o}=t;return(0,s.default)(e,(e=>{const t=e.connections.find((e=>{const t=(0,i.connectionNodeEquals)(n,e.from),s=(0,i.connectionNodeEquals)(o,e.to);return t&&s}));t?e.connections=e.connections.filter((e=>e!==t)):e.connections.push({from:n,to:o})}))}},1788:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDetachConstEditorCommand=void 0;const i=n(74762),s=o(n(53865)),r=n(68371);t.handleDetachConstEditorCommand=(e,t,n)=>(0,s.default)(e,(e=>{const{instances:o}=e,s=o.find((e=>e.id===t));if(!s)throw new Error("Impossible state ins id with no matching instance");const a=s.inputConfig[n];if(!a)throw new Error("impossible state detaching const from unexistent config");if(!(0,i.isStaticInputPinConfig)(a))throw new Error("impossible state detaching const with no value");const u=JSON.stringify(a.value),c=(0,r.createInlineValueNode)({code:`${u}`,type:i.InlineValueNodeType.VALUE}),l=(0,i.inlineNodeInstance)(`value-${(0,i.randomInt)(999)}`,c,{},{x:s.pos.x,y:s.pos.y-100});if(!e.instances.find((e=>e.id===s.id)))throw new Error("impossible state instance not found");s.inputConfig[n]=(0,i.queueInputPinConfig)(),e.instances.push(l),e.connections.push((0,i.connectionData)(`${l.id}.value`,`${s.id}.${n}`))}))},2130:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDuplicateSelectedEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleDuplicateSelectedEditorCommand=(e,t)=>{const n=[];return{newNode:(0,s.default)(e,(o=>{const s=o.instances;t.forEach((t=>{const o=s.find((e=>e.id===t));if(!o)throw new Error("impossible state duplicate selected no matching instance");if(o){const{pos:t}=o,r={...o,pos:{x:t.x+20,y:t.y+20},id:(0,i.createInsId)(e)};s.push(r),n.push(r.id)}}))})),newInstances:n}}},25044:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.pasteInstancesCommand=void 0;const i=n(74762),s=o(n(53865));t.pasteInstancesCommand=(e,t,n)=>{const o=n.instances.map((n=>({...n,pos:t,id:(0,i.createInsId)(e)}))),r=new Map(o.map(((e,t)=>[n.instances[t].id,e.id])));return{newNode:(0,s.default)(e,(e=>{e.instances.push(...o);const t=n.connections.map((e=>{let{from:t,to:n}=e;return{from:{...t,insId:r.get(t.insId)||t.insId},to:{...n,insId:r.get(n.insId)||n.insId}}}));e.connections.push(...t)})),newInstances:o}}},65082:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionView=t.SingleConnectionView=void 0;const a=n(70079),u=n(35250),c=s(n(70079)),l=r(n(26372)),d=n(74762),p=n(18243),f=n(77852),m=n(74089),g=n(60190),h=n(50382),v=n(76064),y=n(41032);t.SingleConnectionView=e=>{const{isBrowser:t}=(0,f.useSsr)(),{connection:n,node:o,resolvedNodes:i,instances:s,type:r,viewPort:a,toggleHidden:c,parentSelected:m,removeConnection:I}=e,{from:b}=n,C=(0,d.isInternalConnectionNode)(b)&&s.find((e=>e.id===b.insId));if(!C&&(0,d.isInternalConnectionNode)(b))throw new Error(`impossible state - "from instance id - [${b.insId}] does not exist"`);const _=((0,d.isInternalConnectionNode)(b)&&C?(0,y.safelyGetNodeDef)(C,i):o).outputs[b.pinId],j=_&&_.delayed,x=t?(0,p.calcStartPos)({...e,connectionNode:b}):{x:0,y:0},N=t?(0,p.calcTargetPos)({...e,connectionNode:n.to}):{x:0,y:0},{x:P,y:O}=(0,g.vDiv)(x,e.parentVp.zoom),{x:w,y:E}=(0,g.vDiv)(N,e.parentVp.zoom),S=(0,l.default)({delayed:j,hidden:n.hidden,"parent-selected":m},r),D=(0,u.jsxs)(h.Menu,{children:[(0,u.jsx)(h.MenuItem,{text:n.hidden?"Show connection":"Hide connection",onClick:()=>c(n)}),(0,u.jsx)(h.MenuItem,{text:"Remove connection",onClick:()=>I(n)})]});return(0,u.jsx)(h.ContextMenu,{content:D,children:e=>(0,u.jsx)(v.ConnectionViewPath,{className:S,from:{x:P,y:O},to:{x:w,y:E},dashed:"regular"!==r,zoom:a.zoom,onContextMenu:e.onContextMenu})})};t.ConnectionView=e=>{var n;const{viewPort:o,futureConnection:i,toggleHidden:s,selectedInstances:r,draggedSource:l}=e,[d,f]=c.useState(0),g=c.useCallback((e=>requestAnimationFrame((()=>{f((e=>(e+1)%9)),e>0&&g(e-1)}))),[]);c.useEffect((()=>{const e=g(10);return()=>{cancelAnimationFrame(e)}}),[g]),c.useEffect((()=>{const e=()=>{g(3)};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[g,d]);const h=e.connections.map((n=>{const o=r.includes(n.from.insId)||r.includes(n.to.insId);return(0,a.createElement)(t.SingleConnectionView,{...e,connection:n,type:"regular",parentSelected:o,key:n.from.insId+n.from.pinId+n.to.insId+n.to.pinId})}));if(i&&h.push((0,a.createElement)(t.SingleConnectionView,{...e,connection:i.connection,type:i.type,toggleHidden:s,parentSelected:!1,key:"future"})),l){const t=(l.from?p.calcStartPos:p.calcTargetPos)({connectionNode:null!==(n=l.from)&&void 0!==n?n:l.to,viewPort:o,boardPos:e.boardPos,ancestorsInsIds:e.ancestorsInsIds,currentInsId:e.currentInsId});h.push((0,u.jsx)(v.ConnectionViewPath,{className:"dragged",from:t,to:(0,m.logicalPosToRenderedPos)(e.lastMousePos,o),zoom:o.zoom},"dragged"))}return(0,u.jsx)("span",{className:"connections-view",style:{opacity:o.zoom},children:(0,u.jsx)("svg",{style:{width:"100%"},children:h})})}},76064:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionViewPath=void 0;const i=n(35250),s=o(n(26372)),r=n(70079),a=n(23381);t.ConnectionViewPath=(0,r.forwardRef)(((e,t)=>{const{from:n,to:o,className:r,onContextMenu:u,zoom:c,dashed:l}=e,{x:d,y:p}=n,{x:f,y:m}=o,g=(0,a.calcBezierPath)({sourceX:d,sourceY:p,targetX:f,targetY:m,curvature:.15}),h=2.5*c,v=l?6*c:void 0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:g,ref:t,className:(0,s.default)("connection",r),style:{strokeWidth:h,strokeDasharray:v},onContextMenu:u}),e.label?(0,i.jsx)("text",{className:"label",x:(d+f)/2,y:(p+m)/2,fontSize:"12px"}):null,(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%"}),(0,i.jsx)("stop",{offset:"100%"})]})]})}))},23381:(e,t)=>{"use strict";var n;function o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i(e){let t,i,{pos:s,x1:r,y1:a,x2:u,y2:c,c:l}=e;switch(s){case n.Left:t=r-o(r-u,l),i=a;break;case n.Right:t=r+o(u-r,l),i=a;break;case n.Top:t=r,i=a-o(a-c,l);break;case n.Bottom:t=r,i=a+o(c-a,l)}return[t,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.getBezierCenter=t.calcBezierPath=t.Position=void 0,function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(n=t.Position||(t.Position={}));t.calcBezierPath=e=>{let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:c=.25}=e;const[l,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:c}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:c});return`M${t},${o} C${l},${d} ${p},${f} ${r},${a}`},t.getBezierCenter=function(e){let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:c=.25}=e;const[l,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:c}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:c}),m=.125*t+.375*l+.375*p+.125*r,g=.125*o+.375*d+.375*f+.125*a;return[m,g,Math.abs(m-t),Math.abs(g-o)]}},18243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcTargetPos=t.calcStartPos=t.calcPinPosition=void 0;const o=n(74762),i=n(30994),s={x:99999,y:99999};function r(e){const t=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds),pinId:e.pinId,pinType:e.pinType,isMain:e.isMain});return((e,t,n,o)=>{if(!e)return console.warn(`Cannot find element ${n} to calculate position.`),s;const{x:i,y:r,width:a,height:u}=e.getBoundingClientRect(),c=r+u/2;return{x:i+a/2-t.x,y:c-t.y}})(document.getElementById(t),e.boardPos,t,e.viewPort)}t.calcPinPosition=r;t.calcStartPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"input",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"output",boardPos:n,viewPort:s})};t.calcTargetPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"output",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"input",boardPos:n,viewPort:s})}},30994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPinDomId=t.getMainInstanceIndicatorDomId=t.getInstanceDomId=void 0;const o=n(74762);t.getInstanceDomId=(e,t)=>`ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getMainInstanceIndicatorDomId=(e,t)=>`main-ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getPinDomId=e=>{let{pinType:t,fullInsIdPath:n,pinId:o,isMain:i}=e;return`${i?"main-":""}pin:${t}:${n}:${o}`.replace(/\s+/g,"-")}},86553:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceView=t.getVisibleOutputs=t.getVisibleInputs=t.INSTANCE_INFO_TOOLTIP_DELAY=t.MAX_INSTANCE_WIDTH=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0;const a=n(70079),u=n(35250),c=s(n(70079)),l=n(66074),d=n(74762),p=r(n(26372)),f=n(2036),m=n(74762),g=n(74762),h=n(53159),v=n(83234),y=n(74762),I=n(30994),b=n(63521),C=n(74089),_=n(50382),j=r(n(99581)),x=n(88593),N=n(30653);t.PIECE_HORIZONTAL_PADDING=25,t.PIECE_CHAR_WIDTH=11,t.MIN_WIDTH_PER_PIN=40,t.MAX_INSTANCE_WIDTH=400,t.INSTANCE_INFO_TOOLTIP_DELAY=400;t.getVisibleInputs=(e,t,n)=>{const{visibleInputs:o}=e;if(o)return o;const i=(0,d.keys)((0,g.getNodeInputs)(t)).filter(((o,i)=>{var s;const r=n.some((t=>t.to.insId===e.id&&t.to.pinId===o)),a=t.inputs[o]&&"optional"===(null===(s=t.inputs[o])||void 0===s?void 0:s.mode);return r||!a&&o!==m.TRIGGER_PIN_ID}));return 0===i.length?[m.TRIGGER_PIN_ID]:i};t.getVisibleOutputs=(e,t,n)=>{const{visibleOutputs:o}=e;if(o)return o;const i=Object.keys(t.outputs);return n.some((t=>t.from.insId===e.id&&t.from.pinId===m.ERROR_PIN_ID))?[...i,m.ERROR_PIN_ID]:i};t.InstanceView=function(e){const{selected:n,selectedInput:o,selectedOutput:i,closestPin:s,dragged:r,onTogglePinLog:P,onTogglePinBreakpoint:O,onDetachConstValue:w,onCopyConstValue:E,onPasteConstValue:S,displayMode:D,connections:M,instance:T,viewPort:k,node:R,onPinClick:A,onPinDblClick:V,onDragStart:H,onDragEnd:$,onDragMove:z,onToggleSticky:G,onSelect:L,onDblClick:F,onChangeVisibleInputs:q,onChangeVisibleOutputs:U,onConvertConstToEnv:B,inlineGroupProps:W,onUngroup:J,onExtractInlineNode:Z,onGroupSelected:Y,isConnectedInstanceSelected:K,inlineEditorPortalDomNode:Q,onChangeStyle:X,onDeleteInstance:ee,onSetDisplayName:te,onPinMouseUp:ne,onPinMouseDown:oe}=e,ie=(0,N.useDarkMode)(),{id:se}=T,re=c.useMemo((()=>{const e=(0,d.randomInt)(6,1);return{icon:(0,d.pickRandom)([["fab","discord"],["fab","slack"],"bug","cube"]),color:e,size:(0,d.randomInt)(3,1),variation:(0,d.randomInt)(5,1)}}),[]),ae=c.useRef(),ue=c.useMemo((()=>T.style||R.defaultStyle||{}),[R,T]),ce=ue.size||"regular",le=c.useMemo((()=>new Map(M.filter((e=>{let{to:t}=e;return t.insId===se})).map((e=>{let{to:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),de=c.useMemo((()=>new Map(M.filter((e=>{let{from:t}=e;return t.insId===se})).map((e=>{let{from:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),pe=(0,C.usePrompt)(),fe=c.useCallback((e=>A(T,e,"input")),[T,A]),me=c.useCallback(((e,t)=>V(T,e,"input",t)),[T,V]),ge=c.useCallback(((e,t)=>V(T,e,"output",t)),[T,V]),he=c.useCallback((e=>A(T,e,"output")),[T,A]),ve=c.useCallback(((e,t)=>{H(T,e,t)}),[T,H]),ye=c.useCallback(((e,t)=>{const n=T.pos,o=(t.x-n.x)/k.zoom,i=(t.y-n.y)/k.zoom,s=n.x+o,r=n.y+i;$(T,e,{...t,x:s,y:r})}),[T,$,k.zoom]),Ie=c.useCallback(((e,t)=>{z(T,e,{x:t.x,y:t.y})}),[T,z]),be=c.useCallback((e=>G(T,e)),[T,G]),Ce=c.useCallback((e=>w(T,e)),[T,w]),_e=c.useCallback((e=>E(T,e)),[T,E]),je=c.useCallback((e=>S(T,e)),[T,S]),xe=c.useCallback((e=>L(T,e)),[T,L]),Ne=c.useCallback((e=>F(T,e.shiftKey)),[T,F]),Pe=(0,d.entries)(R.inputs),{visibleInputs:Oe,visibleOutputs:we}=T;Oe&&Pe.sort(((e,t)=>Oe.indexOf(e[0])-Oe.indexOf(t[0])));const Ee=(0,d.entries)(R.outputs);we&&Ee.sort(((e,t)=>we.indexOf(e[0])-we.indexOf(t[0])));const Se=(0,t.getVisibleInputs)(T,R,M),De=(0,t.getVisibleOutputs)(T,R,M);Pe.push([m.TRIGGER_PIN_ID,{...(0,d.nodeInput)(),description:"Use this pin to manually trigger the node. If not connected, the node will be triggered automatically when all required inputs have data."}]),Ee.push([m.ERROR_PIN_ID,{...(0,m.nodeOutput)(),description:"Use this pin to catch errors that happen inside this node. If not connected, errors will bubble up to the parent node."}]);const Me=Pe.filter((e=>{let[t]=e;return Se.includes(t)||(n||K)&&le.has(t)})),Te=Ee.filter((t=>{let[o]=t;return De.includes(o)||(n||K)&&de.has(o)||o===m.ERROR_PIN_ID&&e.hadError})),ke=M.some((e=>e.from.insId===se&&e.from.pinId===m.ERROR_PIN_ID)),Re=(0,p.default)("ins-view",{"no-inputs":0===Pe.length,"no-outputs":0===Ee.length,"display-mode":D,"force-minimized-input":"input"===e.forceShowMinimized||"both"===e.forceShowMinimized,"force-minimized-output":"output"===e.forceShowMinimized||"both"===e.forceShowMinimized,"inline-node-edited":!!W,"error-caught":ke}),Ae=(0,p.default)({selected:n,dragged:r,closest:s&&s.ins.id===T.id},`size-${ce}`),Ve=new Set((0,d.entries)(R.inputs).filter((e=>{let[t,n]=e;return(0,m.isInputPinOptional)(n)})).map(d.pickFirst)),He=(0,d.entries)(T.inputConfig).reduce(((e,t)=>{let[n,o]=t;return(0,m.isStickyInputPinConfig)(o)||o.sticky?{...e,[n]:!0}:e}),{}),$e=(0,h.calcNodeContent)(T,R),ze=e=>{const t=T.inputConfig[e];if((0,y.isStaticInputPinConfig)(t))return t.value},Ge=c.useCallback((async()=>{const e=(0,d.okeys)(R.inputs),t=await pe("New order?",(T.visibleInputs||e).join(","));t&&q(T,t.split(","))}),[R.inputs,pe,T,q]),Le=c.useCallback((async()=>{const e=(0,d.okeys)(R.outputs),t=await pe("New order?",(T.visibleOutputs||e).join(","));t&&U(T,t.split(","))}),[R.outputs,pe,T,U]),Fe=c.useCallback((()=>{ee(T)}),[ee,T]),qe=c.useCallback((async()=>{const e=await pe("Set custom display name",T.displayName||R.id);te(T,e)}),[pe,T,te,R.id]),Ue=Object.keys((0,g.getNodeInputs)(R)),Be=Object.keys((0,d.getNodeOutputs)(R)),We=c.useCallback((e=>{B&&B(T,e)}),[T,B]),Je=c.useCallback(((e,t)=>{ne&&ne(T,e,t)}),[T,ne]),Ze=c.useCallback(((e,t)=>{oe&&oe(T,e,t)}),[T,oe]),Ye=()=>(0,u.jsx)("div",{className:"inputs no-drag",children:Me.map((t=>{let[i,r]=t;var a;return(0,u.jsx)(f.PinView,{type:"input",currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,id:i,optional:Ve.has(i),connected:le.has(i),isSticky:He[i],minimized:!n&&1===Me.length,onToggleSticky:be,onDetachConstValue:Ce,onCopyConstValue:_e,onPasteConstValue:je,copiedConstValue:e.copiedConstValue,selected:i===o,onClick:fe,onDoubleClick:me,isClosestToMouse:!!s&&"input"===s.type&&s.pin===i,onToggleLogged:P,onToggleBreakpoint:O,onInspect:e.onInspectPin,constValue:ze(i),onConvertConstToEnv:e.onConvertConstToEnv?We:void 0,description:r.description,queuedValues:null!==(a=e.queuedInputsData[i])&&void 0!==a?a:0,onMouseUp:Je,onMouseDown:Ze},i)}))}),Ke=()=>(0,u.jsx)("div",{className:"outputs no-drag",children:Te.map((t=>{let[o,r]=t;return(0,u.jsx)(f.PinView,{currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,connected:de.has(o),type:"output",id:o,minimized:!n&&1===Te.length,isClosestToMouse:!!s&&"output"===s.type&&s.pin===o,selected:o===i,onClick:he,onDoubleClick:ge,onToggleLogged:P,onToggleBreakpoint:O,onInspect:e.onInspectPin,description:r.description,onMouseUp:Je,onMouseDown:Ze},o)}))}),Qe=c.useCallback((e=>{X(T,e)}),[T,X]),Xe=c.useCallback((()=>{const e=[...Ue.map((e=>{const t=Se.includes(e),n=le.has(e)&&!0!==le.get(e),o=(0,d.getInputName)(e);return{text:t?n?`Hide input "${o}" (disconnect first)`:`Hide input "${o}"`:`Show input "${o}"`,onClick:()=>q(T,t?Se.filter((t=>t!==e)):[...Se,e]),disabled:n&&t}})),...Be.map((e=>{const t=De.includes(e),n=de.has(e),o=(0,d.getOutputName)(e);return{text:t?n?`Hide output "${o}" (disconnect first)`:`Hide output "${o}"`:`Show output "${o}"`,onClick:()=>U(T,t?De.filter((t=>t!==e)):[...De,e]),disabled:n&&t}})),...(0,d.isInlineNodeInstance)(T)&&(0,g.isVisualNode)(T.node)?[{text:"Ungroup inline node",onClick:()=>J(T)}]:[],...(0,d.isInlineNodeInstance)(T)?[{text:"Extract inline node to file",onClick:()=>Z(T)}]:[],{text:"Reorder inputs",onClick:Ge},{text:"Reorder outputs",onClick:Le},{text:"Set display name",onClick:qe},{text:"Group selected instances",onClick:Y},{text:"Delete instance",intent:"danger",onClick:Fe}];return(0,u.jsxs)(_.Menu,{children:[(0,u.jsx)(_.MenuItem,{text:"Style",children:(0,u.jsx)(x.NodeStyleMenu,{style:ue,onChange:Qe,promptFn:pe})}),e.map(((e,t)=>(0,a.createElement)(_.MenuItem,{...e,key:t})))]})}),[Ue,Be,T,Ge,Le,qe,Fe,ue,Qe,pe,Se,le,q,De,de,U,J,Z,Y]),et={"--node-color":ue.color,...ue.cssOverride||{}},tt=(0,I.getInstanceDomId)(T.id,e.ancestorsInsIds);return(0,u.jsx)("div",{className:Re,children:(0,u.jsx)(v.BaseNodeView,{pos:T.pos,viewPort:k,onDragStart:ve,onDragMove:Ie,onDragEnd:ye,upperRenderer:Ye,bottomRenderer:Ke,displayMode:D,domId:tt,children:(0,u.jsxs)(c.Fragment,{children:[Ye(),W?j.default.createPortal((0,u.jsxs)("div",{className:"inline-group-editor-container no-drag",children:[(0,u.jsxs)("header",{children:[$e," ",(0,u.jsx)("button",{onClick:e.onCloseInlineEditor,children:"close"})]}),(0,u.jsx)(b.VisualNodeEditor,{...e.inlineGroupProps,className:"no-drag",ref:ae})]}),Q):(0,u.jsx)(_.ContextMenu,{className:(0,p.default)("ins-view-inner",Ae,`size-${re.size}`,{dark:ie}),onClick:xe,onDoubleClick:Ne,content:Xe(),style:et,children:(0,u.jsx)(_.Tooltip,{content:R.description,children:(0,u.jsxs)(c.Fragment,{children:[ue.icon?(0,u.jsx)(l.FontAwesomeIcon,{icon:ue.icon}):null," ",$e]})})}),Ke()]})})})}},53568:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStyleMenu=t.nodeStylePresetColors=void 0;const r=n(35250),a=n(50382),u=s(n(70079)),c=n(84472);t.nodeStylePresetColors=[{name:"Amethyst",color:"#9b5de5"},{name:"Magenta",color:"#f15bb5"},{name:"Yellow",color:"#fee440"},{name:"Capri",color:"#00bbf9"},{name:"Sea Green",color:"#00f5d4"},{name:"Orange",color:"#ff7f00"}];const l={size:"regular"};t.NodeStyleMenu=e=>{var n;const{onChange:o,style:i}=e,s=i||l,d=e.promptFn,p=u.default.useCallback(((e,t)=>{o({...s,[e]:t})}),[s,o]),f=u.default.useCallback((async()=>{const e=await d("Icon name? (Font Awesome conventions)","rocket"),t=e.includes(",")?e.split(","):e;p("icon",t)}),[d,p]),m=(0,u.useCallback)((async()=>{const e=await d("Enter a custom style (valid JSON representing a React CSS object)",s.cssOverride?JSON.stringify(s.cssOverride):"");try{const t=JSON.parse(e);p("cssOverride",t)}catch(t){console.error(t),(0,c.toastMsg)("Invalid object","danger")}}),[d,p,s.cssOverride]);return(0,r.jsxs)(u.default.Fragment,{children:[(0,r.jsxs)(a.MenuItem,{text:"Color",children:[t.nodeStylePresetColors.map((e=>(0,r.jsx)(a.MenuItem,{text:e.name,onClick:()=>p("color",e.color)},e.name))),(0,r.jsx)(a.MenuDivider,{}),(0,r.jsx)(a.MenuItem,{text:"Remove Color",onClick:()=>p("color",void 0)})]}),(0,r.jsxs)(a.MenuItem,{text:`Size (${null!==(n=s.size)&&void 0!==n?n:"regular"})`,children:[(0,r.jsx)(a.MenuItem,{text:"Small",onClick:()=>p("size","small")}),(0,r.jsx)(a.MenuItem,{text:"Regular",onClick:()=>p("size","regular")}),(0,r.jsx)(a.MenuItem,{text:"Large",onClick:()=>p("size","large")})]}),(0,r.jsxs)(a.MenuItem,{text:"Icon",children:[(0,r.jsx)(a.MenuItem,{text:"Choose Icon",onClick:f}),(0,r.jsx)(a.MenuItem,{text:"Remove Icon",onClick:()=>p("icon",void 0)})]}),(0,r.jsx)(a.MenuItem,{text:"Custom Styling",onClick:m})]})}},88593:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(53568),t)},83651:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86553),t)},53159:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calcInstancePosition=t.calcNodeWidth=t.calcNodeContent=void 0;const i=n(74762),s=o(n(6576)),r=n(86553),a=n(61888),u=n(30994);t.calcNodeContent=(e,t)=>{if(e.displayName)return e.displayName;if(t.customViewCode)try{const n=Object.entries(e.inputConfig).filter((e=>{let[,t]=e;return(0,i.isStaticInputPinConfig)(t)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o.value}}),{});return s.default.compile(t.customViewCode)({inputs:n}).trim()}catch(n){return console.error("Error with custom view",n),`Error in custom view [${t.id}]`}return t.id};t.calcNodeWidth=(e,n)=>{const o=(0,i.okeys)(n.inputs).length*r.MIN_WIDTH_PER_PIN,s=(0,t.calcNodeContent)(e,n),u=r.PIECE_CHAR_WIDTH;return(0,a.clamp)(s.length*u+2*r.PIECE_HORIZONTAL_PADDING,o,r.MAX_INSTANCE_WIDTH)};t.calcInstancePosition=(e,t,n)=>{const o=(0,u.getInstanceDomId)(e,t),i=document.getElementById(o);if(i){const{x:e,y:t,width:o,height:s}=i.getBoundingClientRect(),r=t+s/2;return{x:e+o/2-n.x,y:r-n.y}}return console.warn("Cannot find element to draw connection to",o),{x:99999,y:99999}}},17841:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutDebugger=t.LayoutDebuggerItem=t.PosDebugger=void 0;const i=n(70079),s=n(35250),r=n(74762),a=o(n(70079)),u=n(7047),c=e=>{let{pos:t}=e;return(0,s.jsxs)("span",{children:[t.x.toFixed(1),", ",t.y.toFixed(1)]})};t.PosDebugger=e=>(0,s.jsx)("span",{className:"pos-debugger",children:(0,s.jsx)(c,{pos:e.pos})});t.LayoutDebuggerItem=e=>{const{pos:n,viewPort:o,size:i,color:r}=e,a=o.zoom,u=n.x*a-o.pos.x*a,c=n.y*a-o.pos.y*a,l={transform:`translate(${u-n.x}px, ${c-n.y}px)`},d={transform:`scale(${o.zoom})`},p={transform:`translate(${n.x}px, ${n.y}px)`},f={width:`${i.width}px`,height:`${i.height}px`,backgroundColor:r};return(0,s.jsx)("div",{className:"layout-debugger",style:l,children:(0,s.jsxs)("span",{className:"drag-sim",style:p,children:[(0,s.jsx)(t.PosDebugger,{pos:n}),(0,s.jsx)("div",{className:"layout-debugger-zoom-wrapper",style:d,children:(0,s.jsx)("div",{className:"layout-debugger-inner",style:f})})]})})};const l=(()=>{try{return"true"===localStorage.getItem("pos-debugger")}catch(e){return!1}})();t.LayoutDebugger=e=>{const{extraDebug:n,vp:o,node:d,mousePos:p}=e;if(!l)return null;const f=n.map(((e,n)=>(0,i.createElement)(t.LayoutDebuggerItem,{...e,key:n}))),m=[...d.instances.map((e=>e.pos)),...(0,r.values)(d.inputsPosition),...(0,r.values)(d.outputsPosition)].map((e=>(0,s.jsx)(t.LayoutDebuggerItem,{pos:e,viewPort:o,size:{width:0,height:0},color:"red"}))),g=(0,u.logicalPosToRenderedPos)(p,o),h=(0,s.jsxs)("div",{className:"viewport-data",children:[(0,s.jsxs)("div",{children:["Pos: ",(0,s.jsx)(c,{pos:o.pos})]}),(0,s.jsxs)("div",{children:["Zoom: ",o.zoom.toFixed(2)," "]}),(0,s.jsxs)("div",{children:["Mouse (logical): ",(0,s.jsx)(c,{pos:p})]}),(0,s.jsxs)("div",{children:["Rendered (rendered): ",(0,s.jsx)(c,{pos:g})]})]});return(0,s.jsxs)(a.default.Fragment,{children:[h,f,m]})}},44338:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(17841),t)},38259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateInstancesWithSingleConstPinsMap=t.getLeafInstancesOfSelection=void 0;t.getLeafInstancesOfSelection=(e,t,n)=>e.reduce(((e,o)=>[...e,...n.filter((e=>e.to.insId===o.id)).map((e=>t.find((t=>t.id===e.from.insId)))).filter((e=>!!e))]),[]).filter((t=>1===n.filter((e=>e.from.insId===t.id||e.to.insId===t.id)).length&&!e.includes(t)));t.calculateInstancesWithSingleConstPinsMap=(e,t)=>{const{connections:n}=e;return n.filter((e=>t.has(e.from.insId))).reduce(((e,n)=>{const o=t.get(n.from.insId),i=n.to.insId,s=e.get(i)||new Map;return s.set(n.to.pinId,{val:o,insId:n.from.insId}),e.set(i,s),e}),new Map)}},37488:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeIoView=void 0;const a=n(35250),u=n(70079),c=s(n(70079)),l=n(74762),d=n(83234),p=r(n(26372)),f=n(50382),m=n(43490),g=n(66189),h=n(74762),v=n(30994),y=n(30653);t.NodeIoView=c.memo((function(e){const{viewPort:t,selected:n,pos:o,type:i,id:s,onDblClick:r,onRename:I,onDelete:b,onChangeInputMode:C,inputMode:_,onSelect:j,closest:x,onSetDescription:N,description:P,onMouseUp:O,onMouseDown:w,currentInsId:E}=e,{history:S,resetHistory:D,refreshHistory:M}=(0,g.useHistoryHelpers)(E,s,i),T=(0,m.usePrompt)(),k=c.useCallback((async()=>{const e=await T("Description?",P);N(i,s,e)}),[T,P,N,i,s]),R=c.useCallback((()=>{b&&b(i,s)}),[i,s,b]),A=c.useCallback((()=>{I&&I(i,s)}),[i,s,I]),V=c.useCallback((e=>{C&&C(s,e)}),[s,C]),H=c.useCallback((()=>[{text:`Current mode - ${_}`,onClick:l.noop},{text:"Make required",onClick:()=>V("required")},{text:"Make optional",onClick:()=>V("optional")},{text:"Make required-if-connected",onClick:()=>V("required-if-connected")},{text:"Set description",onClick:k},...e.onRename?[{text:"Rename",onClick:A}]:[],...e.onDelete?[{text:"Delete",onClick:R}]:[]]),[k,_,V,R,A,e.onDelete,e.onRename]),$=c.useCallback((t=>{r&&r(e.id,t)}),[r,e.id]),z=c.useCallback((()=>{j(s,i)}),[s,i,j]),G=c.useCallback((()=>(0,a.jsx)(f.Menu,{children:H().map(((e,t)=>(0,u.createElement)(f.MenuItem,{...e,key:t})))})),[H]),L="input"===i?(0,h.getInputName)(s):(0,l.getOutputName)(s),F=c.useCallback((e=>{O(s,i,e)}),[s,O,i]),q=c.useCallback((e=>{w(s,i,e)}),[s,w,i]),U=(0,y.useDarkMode)();return(0,a.jsx)(d.BaseNodeView,{className:(0,p.default)("node-io-view",i,{dark:U}),pos:o,onDragEnd:(n,o)=>{const r=e.pos,a=(o.x-r.x)/t.zoom,u=(o.y-r.y)/t.zoom,c=r.x+a,l=r.y+u;e.onDragEnd(i,s,n,{...o,x:c,y:l})},onDragStart:(t,n)=>{e.onDragStart(s,t,n)},onDragMove:(t,n)=>{e.onDragMove(i,s,t,{x:n.x,y:n.y})},viewPort:t,children:(0,a.jsx)(c.Fragment,{children:(0,a.jsx)(f.Tooltip,{content:(()=>{const t=(0,g.calcHistoryContent)(S),n=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:L})," (",i,")"," "]}),n,(0,a.jsx)("hr",{}),t]})})(),children:(0,a.jsx)(f.ContextMenu,{onMouseEnter:M,onMouseOut:D,onMouseUp:F,onMouseDown:q,"data-tip":"","data-html":!0,"data-for":s+e.currentInsId,className:(0,p.default)("node-io-view-inner",{closest:x,selected:n,dark:U}),id:(0,v.getPinDomId)({fullInsIdPath:(0,l.fullInsIdPath)(e.currentInsId,e.ancestorInsIds),pinId:s,pinType:i,isMain:!0}),onClick:z,onDoubleClick:$,content:G(),children:s})})})})}))},66005:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37488),t)},83782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcNodeIoWidth=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0,t.PIECE_HORIZONTAL_PADDING=15,t.PIECE_CHAR_WIDTH=9,t.MIN_WIDTH_PER_PIN=40;t.calcNodeIoWidth=e=>Math.max(t.MIN_WIDTH_PER_PIN,e.length*t.PIECE_CHAR_WIDTH+2*t.PIECE_HORIZONTAL_PADDING)},99942:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderVisualNode=t.layoutToInstances=void 0;const i=n(63521),s=n(74762),r=n(90794),a=o(n(53865)),u=n(83782),c=n(60190),l=n(53159),d=n(41032);t.layoutToInstances=(e,t)=>(0,a.default)(t,(t=>{(0,s.entries)(e.nodes).forEach((e=>{let[n,o]=e;if(n.startsWith("ins-")){const e=n.replace("ins-",""),i=t.instances.find((t=>t.id===e));i?i.pos=o.p:console.warn("WAT")}if(n.startsWith("node-input-")){const e=n.replace("node-input-","");t.inputsPosition[e]=o.p}if(n.startsWith("node-output-")){const e=n.replace("node-output-","");t.outputsPosition[e]=o.p}}))}));t.orderVisualNode=(e,n,o,a)=>{const{instances:p,connections:f}=e,m={...p.reduce(((e,t)=>{const o=(0,c.size)((0,l.calcNodeWidth)(t,(0,d.safelyGetNodeDef)(t,n)),i.NODE_HEIGHT);return{...e,[`ins-${t.id}`]:{p:t.pos,s:o}}}),{}),...(0,s.okeys)(e.inputsPosition).reduce(((t,n)=>({...t,[`node-input-${n}`]:{p:e.inputsPosition[n],s:(0,c.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{}),...(0,s.okeys)(e.outputsPosition).reduce(((t,n)=>({...t,[`node-output-${n}`]:{p:e.outputsPosition[n],s:(0,c.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{})},g=f.map((e=>[(0,s.isExternalConnectionNode)(e.from)?`node-input-${e.from.pinId}`:`ins-${e.from.insId}`,(0,s.isExternalConnectionNode)(e.to)?`node-output-${e.to.pinId}`:`ins-${e.to.insId}`])),h=(0,r.orderLayout)({nodes:m,edges:g},o,((n,o)=>{a&&a((0,t.layoutToInstances)(n,e),o)}));return(0,t.layoutToInstances)(h,e)}},90794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderLayout=void 0;const o=n(60190),i=400,s=e=>e.reduce(((e,t)=>{const n=(0,o.vSub)(t.p,(0,o.vec)(t.s.width/2,t.s.height/2));return{...e,[t.id]:{p:n,s:t.s}}}),{});t.orderLayout=(e,t,n)=>{let{nodes:r,edges:a}=e,u=Object.entries(r).map((e=>{let[t,n]=e;return{id:t,p:(0,o.vAdd)(n.p,(0,o.vec)(n.s.width/2,n.s.height/2)),f:(0,o.vec)(0,0),v:(0,o.vec)(0,0),m:1,s:n.s}})),c=0;for(;c.01);){let e=u;for(let t=0;t{let n=e.find((e=>e.id===t[0])),i=e.find((e=>e.id===t[1]));if(!n||!i)return void console.warn("weoops",t[0],t[1]);const s=(0,o.vec)(0,-200),r=(0,o.vSub)(n.p,i.p),a=(0,o.vSub)(s,r),u=1e3*(0,o.vLen)(a),c=(0,o.vMul)((0,o.vNorm)(a),.5*u),l=(0,o.vMul)((0,o.vNorm)(a),-.5*u);n.f=(0,o.vAdd)(n.f,c),i.f=(0,o.vAdd)(i.f,l)})),e=e.map((e=>(0,o.itrPhysics)(15,e))),e=e.map((e=>{const t=(0,o.vMul)(e.v,.5),n=(0,o.vLen)(t)>100?(0,o.vMul)((0,o.vNorm)(t),100):t;return{...e,v:n}})),u=e,n&&n({nodes:s(e),edges:a},c),c++}return{nodes:s(u),edges:a,itrs:c,timeout:c>=t,total:(0,o.totalEnergy)(u)}}},2036:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PinView=t.PIN_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),c=r(n(26372)),l=n(50382),d=n(18420),p=n(74762),f=n(30994),m=n(96233),g=n(66189),h=n(30653);t.PIN_HEIGHT=23;t.PinView=u.memo((function(e){const{selected:t,type:n,connected:o,optional:i,currentInsId:s,isClosestToMouse:r,id:v,onMouseDown:y,onMouseUp:I}=e,{history:b,resetHistory:C,refreshHistory:_}=(0,g.useHistoryHelpers)(s,v,n),j=(0,h.useDarkMode)(),x="input"===n?(0,p.getInputName)(v):(0,p.getOutputName)(v),N="input"===e.type&&(0,d.isDefined)(e.constValue)?e.constValue:void 0,P=u.useCallback((e=>{0===e.button&&y(v,n,e)}),[v,n,y]),O=u.useCallback((e=>{0===e.button&&I(v,n,e)}),[v,n,I]);return(0,a.jsxs)("div",{className:(()=>{if("input"===e.type){const{isSticky:s,constValue:a}=e;return(0,c.default)("pin",{sticky:s,selected:t,closest:r,optional:i,connected:o,"const-value":(0,d.isDefined)(a),"env-value":(0,d.isDefined)(a)&&(0,p.isEnvValue)(a),minimized:e.minimized,dark:j},n)}return(0,c.default)("pin",{selected:t,connected:o,closest:r,optional:i,minimized:e.minimized,"error-pin":v===p.ERROR_PIN_ID,dark:j},n)})(),"data-pin-id":v,children:[(0,a.jsx)(l.Tooltip,{className:"pin-info-tooltip",content:(()=>{const t=(0,g.calcHistoryContent)(b,"input"===n?e.queuedValues:void 0),o=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:x})," (",n,")"," "]}),o,(0,a.jsx)("hr",{}),(0,d.isDefined)(N)?(0,a.jsxs)("div",{children:["Static value:"," ",(0,a.jsx)("strong",{children:(0,m.valuePreview)(N).substring(0,200)})]}):t]})})(),children:(0,a.jsxs)(l.ContextMenu,{onMouseEnter:_,onMouseOut:C,onMouseDown:P,onMouseUp:O,"data-tip":"","data-html":!0,"data-for":v+e.currentInsId,id:(0,f.getPinDomId)({fullInsIdPath:(0,p.fullInsIdPath)(e.currentInsId,e.ancestorsInsIds),pinId:v,pinType:n,isMain:!1}),onDoubleClick:t=>e.onDoubleClick&&e.onDoubleClick(v,t),className:(0,c.default)("pin-inner",{dark:j}),onClick:t=>{const{onShiftClick:o,onClick:i,id:s}=e;t.shiftKey&&o?o(s,t):i(s,n,t)},content:(()=>{const t=(0,a.jsx)(l.MenuItem,{onClick:()=>e.onInspect(e.currentInsId,{id:e.id,type:e.type}),text:"Inspect"});if("input"===e.type){const{onConvertConstToEnv:n}=e;return(0,d.isDefined)(N)?(0,a.jsxs)(l.Menu,{children:[(0,a.jsx)(l.MenuItem,{onClick:()=>e.onDetachConstValue(e.id),text:"Detach value"}),(0,a.jsx)(l.MenuItem,{onClick:()=>e.onCopyConstValue(e.id),text:"Copy value"}),(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(l.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null,n?(0,a.jsx)(l.MenuItem,{onClick:()=>n(e.id),text:"Convert to Env Var"}):null]}):(0,a.jsxs)(l.Menu,{children:[(0,a.jsx)(l.MenuItem,{onClick:()=>e.onToggleSticky(e.id),text:"Toggle sticky (square means sticky)"}),t,(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(l.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null]})}return(0,a.jsx)(l.Menu,{children:t})})(),children:[x," ",(0,d.isDefined)(N)?(0,a.jsxs)(u.Fragment,{children:[":",(0,a.jsx)("span",{className:"value",children:(0,d.toString)(N)})]}):null,"input"===e.type&&e.isSticky?(0,a.jsx)("span",{className:"suffix",children:"s"}):null,"input"===e.type&&e.queueSize?(0,a.jsxs)("span",{className:"suffix",children:[e.queueSize," in Q"]}):null]})}),(0,a.jsx)("div",{className:"wire"})]})}))},66189:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHistoryHelpers=t.calcHistoryContent=void 0;const i=n(35250),s=n(96233),r=o(n(70079)),a=n(70079),u=n(98158);t.calcHistoryContent=(e,t)=>{if(e){const{total:n,lastSamples:o}=e,a=(0,i.jsxs)("strong",{children:["Activated ",n," times this session"]}),u=o.length>0?(0,i.jsxs)("div",{children:["Last value:"," ",(0,i.jsx)("strong",{children:(0,s.valuePreview)(o[0].val).substring(0,200)}),(0,i.jsx)("br",{}),(0,i.jsx)("em",{children:"Inspect instance for the full value"})]}):"",c=t?(0,i.jsx)(r.default.Fragment,{children:(0,i.jsxs)("div",{children:["Queued values: ",(0,i.jsx)("strong",{children:t})]})}):"";return(0,i.jsxs)(r.default.Fragment,{children:[a,u,c]})}return"Loading session data.."};t.useHistoryHelpers=(e,t,n)=>{const o=(0,a.useRef)(),{onRequestHistory:i}=(0,u.useDebuggerContext)(),[s,c]=(0,a.useState)();return{history:s,refreshHistory:(0,a.useCallback)((()=>{clearInterval(o.current),i(e,t,n).then((e=>{c(e)})),o.current=setInterval((()=>{i(e,t,n).then((e=>{c(e)}))}),500)}),[e,i,t,n]),resetHistory:r.default.useCallback((()=>{clearInterval(o.current),c(void 0)}),[])}}},89440:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAddMenu=void 0;const r=n(35250),a=s(n(70079)),u=n(74762),c=n(50382),l=n(70457),d=n(9958),p=n(86125),f=l.Select.ofType(),m=e=>{switch(e.type){case"node":return`${e.node.id}`;case"value":return"Add inline value or function";case"import":return`Import ${e.importableNode.node.id} from ${e.importableNode.module}`}},g=(e,t)=>{let{handleClick:n,modifiers:o,query:i}=t;if(!o.matchesPredicate)return null;const s=m(e);return"value"===e.type?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(c.MenuDivider,{}),(0,r.jsx)(c.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))]}):(0,r.jsx)(c.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))},h=(e,t,n,o)=>{const i=m(t).toLocaleLowerCase(),s=e.toLowerCase();return o?i===s:i.includes(s)};t.QuickAddMenu=e=>{const{resolvedDependencies:t,targetNode:n}=e,o={left:e.pos.x,top:e.pos.y},{onRequestImportables:i}=(0,p.useDependenciesContext)(),[s,l]=a.useState();a.useEffect((()=>{i().then((e=>l(e.importables)))}),[i]);const d=(0,u.values)({...t,[n.id]:n}),m=d.map((e=>({type:"node",node:e}))),v=new Set(d.map((e=>e.id))),y=s?s.filter((e=>!v.has(e.node.id))).map((e=>({type:"import",importableNode:e}))):[],I=m.concat(y).concat({type:"value"});return(0,r.jsx)("div",{className:"quick-add-menu",style:o,children:(0,r.jsx)(f,{className:"quick-add-nodes-select",items:I,itemPredicate:h,itemRenderer:g,inputProps:{className:"quick-add-input"},noResults:(0,r.jsx)(c.MenuItem,{disabled:!0,text:"No results."}),onItemSelect:t=>e.onAdd(t),popoverProps:{isOpen:!0,onClose:()=>e.onClose()}})})}},71033:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89440),t)},73470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimePlayer=void 0;const o=n(74762),i=n(64955),s=(0,o.debugLogger)("runtime-player");t.createRuntimePlayer=()=>{let e=0,t=[];let n=!1,r=Date.now(),a=e;const u=()=>requestAnimationFrame((()=>{const c=Date.now();a=e,e+=c-r,r=c,((e,n)=>{const r=t;t=[],r.length&&s(`Playing ${r.length} events from`,e,n),r.forEach((e=>{s("Playing event",e),(0,i.playEvent)(e),e.insId===o.ROOT_INS_ID&&e.type===o.DebuggerEventType.PROCESSING_CHANGE&&!1===e.val&&(s("Main instance is done processing, clearing runtime UI",e),l())}))})(a,e),n&&u()})),c=()=>{n=!1},l=()=>{document.querySelectorAll("[data-runtime]").forEach((e=>{e.removeAttribute("data-runtime")})),document.querySelectorAll("[data-runtime-queue]").forEach((e=>{e.removeAttribute("data-runtime-queue")})),t=[]};return{stop:c,start:function(t){void 0===t&&(t=0),n=!0,e=t,r=Date.now(),u()},addEvents:e=>{t.push(...e)},destroy:()=>{c(),l()},clear:l,status:()=>({running:n,currDt:e,lastDt:a,queue:t,last:r})}}},64955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playEvent=t.cancelTimers=void 0;const o=n(74762),i=n(30994),s=5e3,r=(0,o.debugLogger)("runtime-player:play-event"),a=(e,t)=>e.type===o.DebuggerEventType.INPUT_CHANGE||e.type===o.DebuggerEventType.OUTPUT_CHANGE?`${(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds)}.${e.pinId}`:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds);t.cancelTimers=new Map;t.playEvent=e=>{switch(e.type){case o.DebuggerEventType.INPUT_CHANGE:case o.DebuggerEventType.OUTPUT_CHANGE:{const{pinId:n,insId:u,ancestorsInsIds:c}=e,l=e.type===o.DebuggerEventType.INPUT_CHANGE?"input":"output",d=[(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,c),pinId:n,pinType:l,isMain:!0})];u!==o.ROOT_INS_ID&&d.push((0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,c),pinId:n,pinType:l,isMain:!1})),d.forEach(((i,c)=>{const l=a(e);clearTimeout(t.cancelTimers.get(l));const d=document.getElementById(i),p=`${u}.${n}`,f=e.type===o.DebuggerEventType.OUTPUT_CHANGE?document.querySelectorAll(`[data-from-id="${p}"]`):[];if(d){clearTimeout(t.cancelTimers.get(l)),d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),setTimeout((()=>{d.setAttribute("data-runtime","active"),f.forEach((e=>{e.setAttribute("data-runtime","active")}))}),0);const n=setTimeout((()=>{d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),t.cancelTimers.delete(l)}),s);t.cancelTimers.set(a(e),n)}else console.warn(`No DOM element with Id [${i}] found to play event`),r(`No DOM element with Id [${i}] found to play event`,e)}));break}case o.DebuggerEventType.PROCESSING_CHANGE:{const{insId:n,ancestorsInsIds:u}=e,c=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&c.push((0,i.getInstanceDomId)(n,u)),c.forEach(((n,o)=>{var i;const u=a(e),c=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(c)if(!0===e.val)c.setAttribute("data-runtime","processing"),clearTimeout(t.cancelTimers.get(u));else{c.removeAttribute("data-runtime"),setTimeout((()=>{"error"!==c.getAttribute("data-runtime")&&c.setAttribute("data-runtime","done")}),0);const e=setTimeout((()=>{c.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,e)}else r(`No DOM element with Id [${n}] found to play event`,e)}));break}case o.DebuggerEventType.ERROR:{const{insId:n,ancestorsInsIds:u}=e,c=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&c.push((0,i.getInstanceDomId)(n,u)),c.forEach(((n,o)=>{var i;const u=a(e),c=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(!c)return void r(`No DOM element with Id [${n}] found to play event`,e);clearTimeout(t.cancelTimers.get(u)),c.removeAttribute("data-runtime"),setTimeout((()=>{c.setAttribute("data-runtime","error")}));const l=setTimeout((()=>{c.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,l)}));const l={...e,type:o.DebuggerEventType.OUTPUT_CHANGE,pinId:o.ERROR_PIN_ID};(0,t.playEvent)(l);break}case o.DebuggerEventType.INPUTS_STATE_CHANGE:(0,o.entries)(e.val).forEach((t=>{let[n,s]=t;const{insId:a,ancestorsInsIds:u}=e,c=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(a,u),pinId:n,pinType:"input",isMain:!1}),l=document.getElementById(c);l?s>0?l.setAttribute("data-runtime-queue",`${s}`):l.removeAttribute("data-runtime-queue"):r(`No DOM element with Id [${c}] found to play event`,e)}))}}},25804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounce=void 0;const o=n(70079);t.useDebounce=function(e,t){const[n,i]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}},7047:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.handleChangeNodeInputType=t.handleIoPinRename=t.handleInstanceDrag=t.getInstancesInRect=t.isJsxValue=t.getMiddleOfViewPort=t.fitViewPortToNode=t.centerBoardPosOnTarget=t.renderedPosToLogicalPos=t.logicalPosToRenderedPos=t.getEffectiveNodeDimensions=t.calcNodesPositions=t.calcSelectionBoxArea=t.animateViewPort=t.easeInOutNum=t.easeInOutPos=t.easeInOutQuad=t.center=t.distance=t.clamp=t.domToViewPort=t.roundNumber=t.createNewNodeInstance=t.createNewInlineNodeInstance=t.parseInputOutputTypes=t.parsePromptValue=t.getSelectionBoxRect=t.findClosestPin=t.changePinConfig=t.getInstancePinConfig=t.emptyList=t.emptyObj=void 0;const r=s(n(53865)),a=n(30721),u=n(63521),c=n(74762),l=n(18243),d=n(74762),p=n(53159),f=n(83782),m=n(60190),g=n(38259),h=n(83651),v=n(41032);t.emptyObj={},t.emptyList=[],t.getInstancePinConfig=function(e,n,o){var i;const s=e.instances.find((e=>e.id===n));if(!s)throw new Error(`Instance ${n} not found`);return null!==(i=(s.inputConfig||t.emptyObj)[o])&&void 0!==i?i:(0,c.queueInputPinConfig)()};t.changePinConfig=(e,t,n,o)=>r.produce(e,(e=>{var i;const{instances:s}=e,r=s.find((e=>e.id===t));if(!r)throw new Error("blah");const a=null!==(i=r.inputConfig)&&void 0!==i?i:{};a[n]=o,e.instances=s.map((e=>e===r?{...r,inputConfig:a}:e))}));t.findClosestPin=(e,t,n,o,i,s,r)=>{const a=(0,c.nodeInstance)(e.id,e.id),u=(0,d.okeys)(e.inputs).map((e=>({id:e,type:"input",pos:(0,l.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),p=(0,d.okeys)(e.outputs).map((e=>({id:e,type:"output",pos:(0,l.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),f=[...u,...e.instances.reduce(((n,a)=>{const u=(0,v.safelyGetNodeDef)(a,t),d=(0,h.getVisibleInputs)(a,u,e.connections),p=(0,h.getVisibleOutputs)(a,u,e.connections);return[...n,...d.map((e=>({ins:a,type:"input",pos:(0,l.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,c.fullInsIdPath)(i,s),pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!1}),id:e}))),...p.map((e=>({ins:a,type:"output",pos:(0,l.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,c.fullInsIdPath)(i,s),pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!1}),id:e})))]}),[]),...p];let m={dis:1e5,item:f[0]};return f.forEach((e=>{const t=e.pos.x-n.x,o=e.pos.y-n.y,i=Math.sqrt(t*t+o*o);i{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x,t.x)-n,h:Math.max(e.y,t.y)-o}};t.parsePromptValue=e=>{if(null===e)return;const t=parseInt(e,10);let n=e;return t.toString()!=e||isNaN(t)||(n=t),n};t.parseInputOutputTypes=e=>{const[,t,n]=e.match(/node\((.+)\|(.+)\)/)||[],o=(0,d.entries)(JSON.parse(t)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]})),i=(0,d.entries)(JSON.parse(n)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]}));return{inputs:(0,d.fromEntries)(o),outputs:(0,d.fromEntries)(i)}};t.createNewInlineNodeInstance=function(e,t,n){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const o=(0,c.inlineNodeInstance)(`${e.id}-${(0,d.randomInt)(999)}`,e,{},{x:0,y:0}),i=(0,p.calcNodeWidth)(o,e),{x:s,y:r}=n,a={x:s-i/2,y:r+t};return{...o,pos:a}};t.createNewNodeInstance=function(e,t,n,o){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const i="string"==typeof e?(0,v.safelyGetNodeDef)(e,o):e;if(!i)throw new Error(`${e} node not found in resolvedNodes`);const s=(0,d.entries)(i.inputs).reduce(((e,t)=>{let[n,o]=t;return o.defaultValue&&(e[n]=(0,c.staticInputPinConfig)(o.defaultValue)),e}),{}),r=(0,c.nodeInstance)((0,a.createId)(),i.id,s,{x:0,y:0}),l=(0,p.calcNodeWidth)(r,i),{x:f,y:m}=n,g={x:f-l/2,y:m+t};return{...r,pos:g}};t.roundNumber=e=>Math.round(100*e)/100;t.domToViewPort=(e,n,o)=>({x:(0,t.roundNumber)(n.pos.x+e.x/n.zoom/o.zoom),y:(0,t.roundNumber)(n.pos.y+e.y/n.zoom/o.zoom)});t.clamp=(e,t,n)=>Math.max(e,Math.min(t,n));t.distance=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)};t.center=(e,t,n)=>{let{zoom:o}=n;const i=e.x+e.w/2,s=e.y+e.h/2,{w:r,h:a}=t;return{x:i-r/o/2,y:s-a/o/2}};t.easeInOutQuad=e=>e<.5?2*e*e:(4-2*e)*e-1;t.easeInOutPos=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i),a=(0,t.easeInOutQuad)(r),u=n.x-e.x,c=n.y-e.y;return{x:e.x+u*a,y:e.y+c*a}};t.easeInOutNum=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i);return e+(n-e)*(0,t.easeInOutQuad)(r)};t.animateViewPort=(e,n,o,i)=>{const s=(0,t.distance)(e.pos,n.pos),r=Date.now(),a=o;if(0===s)return void i(e);const u=()=>{const o=Date.now(),s=(0,t.easeInOutPos)(e.pos,n.pos,r,a,o),c=(0,t.easeInOutNum)(e.zoom,n.zoom,r,a,o);o-r{const n=(0,t.getSelectionBoxRect)(e.from,e.to);return n.h*n.w};const y=(e,t,n,o)=>({left:n.x,right:n.x+e,top:n.y,bottom:n.y+t,tag:o,center:(0,c.calcCenter)({w:e,h:t,...n})});t.calcNodesPositions=(e,t)=>[...e.instances.map((e=>{const n=(0,p.calcNodeWidth)(e,(0,v.safelyGetNodeDef)(e,t)),o=u.NODE_HEIGHT;return y(n,o,e.pos,e.id)})),...(0,d.okeys)(e.inputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.inputsPosition[t]||{x:0,y:0};return y(n,o,i,"input_"+t)})),...(0,d.okeys)(e.outputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.outputsPosition[t]||{x:0,y:0};return y(n,o,i,"output"+t)}))];t.getEffectiveNodeDimensions=(e,n)=>{const o=(0,t.calcNodesPositions)(e,n),i=o[0]||{left:0,right:0,top:0,bottom:0},s=o.reduce(((e,t)=>t.leftt.right>e?t.right:e),i.right),a=o.reduce(((e,t)=>t.topt.bottom>e?t.bottom:e),i.bottom)-a,d={x:s,y:a};return{size:{width:u,height:l},pos:d,center:(0,c.calcCenter)({w:u,h:l,...d})}};t.logicalPosToRenderedPos=(e,t)=>{const n=(0,m.vSub)(e,t.pos);return(0,m.vMul)(n,t.zoom)};t.renderedPosToLogicalPos=(e,t)=>{const n=(0,m.vDiv)(e,t.zoom);return(0,m.vAdd)(t.pos,n)};t.centerBoardPosOnTarget=(e,n,o,i)=>{const s=(0,t.logicalPosToRenderedPos)(e,i),r=(0,t.renderedPosToLogicalPos)(s,{...i,zoom:o}),a=Math.max(e.x,r.x)-Math.min(e.x,r.x),u=Math.max(e.y,r.y)-Math.min(e.y,r.y);return{x:o>i.zoom?i.pos.x+a:i.pos.x-a,y:o>i.zoom?i.pos.y+u:i.pos.y-u}};t.fitViewPortToNode=function(e,n,o,i){void 0===i&&(i=[20,150]);const{size:s,center:r}=(0,t.getEffectiveNodeDimensions)(e,n),a=i[0],u=i[1],c=s.width+a,l=s.height+u,d=o.width/c,p=o.height/l,f=Math.min(d,p)/1.15,m=(0,t.clamp)(.3,1.2,f);return{zoom:m,pos:{x:r.x-o.width/2/m,y:r.y-o.height/2/m+20}}};t.getMiddleOfViewPort=(e,n)=>{const o={x:n.width/2,y:n.height/2};return(0,t.renderedPosToLogicalPos)(o,e)};t.isJsxValue=e=>{const t=e=>(0,d.isDefined)(e.ref)&&(0,d.isDefined)(e.type)&&(0,d.isDefined)(e.props);try{const n=JSON.parse(e);return t(n)||Array.isArray(n)&&t(n[0])}catch(n){return!1}};t.getInstancesInRect=(e,n,o,i,s,r,a)=>{const{from:l,to:d}=e,f=(0,t.getSelectionBoxRect)(l,d);return s.filter((e=>{const{pos:t}=e,i={...t,w:(0,p.calcNodeWidth)(e,(0,v.safelyGetNodeDef)(e,n))*o.zoom*a.zoom,h:u.NODE_HEIGHT*o.zoom*a.zoom};return(0,c.intersectRect)(f,i)||(0,c.intersectRect)(i,f)})).map((e=>e.id))};t.handleInstanceDrag=(e,t,n,o,i,s)=>{o.preventDefault(),o.stopPropagation();const a=(0,m.vSub)(n,t.pos);let u;const c=r.produce(e,(e=>{const r=e.instances.find((e=>e.id===t.id));if(!r)throw new Error("impossible state dragging instance that does not exist");!o.shiftKey&&s&&(u=[s]);const c=e.instances.filter((e=>i.includes(e.id)&&e!==r)),l=[r,...c],d=(0,g.getLeafInstancesOfSelection)(l,e.instances,e.connections);[...c,...d].forEach((e=>{e.pos=(0,m.vAdd)(e.pos,a)})),r.pos=n,!o.shiftKey&&s&&(u=[s])}));return{newValue:c,newSelected:u}};t.handleIoPinRename=(e,t,n,o)=>r.produce(e,(e=>{"input"===t?(e.inputs[o]=e.inputs[n],e.inputsPosition[o]=e.inputsPosition[n],delete e.inputs[n],e.connections=e.connections.map((e=>(0,c.isExternalConnectionNode)(e.from)&&e.from.pinId===n?{...e,from:{...e.from,pinId:o}}:e))):(e.outputs[o]=e.outputs[n],e.outputsPosition[o]=e.outputsPosition[n],e.connections=e.connections.map((e=>(0,c.isExternalConnectionNode)(e.to)&&e.to.pinId===n?{...e,to:{...e.to,pinId:o}}:e)),e.completionOutputs=(e.completionOutputs||[]).map((e=>e.split("+").map((e=>e===n?o:n)).join("+"))),delete e.outputs[n])}));t.handleChangeNodeInputType=(e,t,n)=>r.produce(e,(e=>{const o=e.inputs[t];if(!o)throw new Error("Wat");o.mode=n}))},42403:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorClient=void 0;const i=n(74762),s=o(n(18706)),r=n(32048),a=n(31758),u=(0,i.debugLogger)("remote-debugger:editor-client");t.createEditorClient=(e,t)=>{const n=new URL(e),o=(0,r.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/editor`,timeout:3e4});return o.emit("join-room-editor",t),{emitChange:e=>{o.emit(a.DebuggerServerEventType.CHANGE_EVENT_NAME,e)},emitBreakpointsChange:e=>{o.emit(a.DebuggerServerEventType.UPDATE_BREAKPOINTS,e)},interceptInput:e=>{o.emit(a.DebuggerServerEventType.INPUT_VALUE_OVERRIDE,e)},interceptOutput:e=>{o.emit(a.DebuggerServerEventType.OUTPUT_VALUE_OVERRIDE,e)},onRuntimeReady:e=>(o.on(a.DebuggerServerEventType.RUNTIME_READY,e),()=>o.off(a.DebuggerServerEventType.RUNTIME_READY,e)),onChangeAwk:e=>(o.on(a.DebuggerServerEventType.CHANGE_AWK,e),()=>o.off(a.DebuggerServerEventType.CHANGE_AWK,e)),onChangeError:e=>(o.on(a.DebuggerServerEventType.CHANGE_ERROR,e),()=>o.off(a.DebuggerServerEventType.CHANGE_ERROR,e)),onIsAlive:e=>(o.on(a.DebuggerServerEventType.IS_ALIVE,e),()=>o.off(a.DebuggerServerEventType.IS_ALIVE,e)),emitInputValue:(e,t)=>{u(`Emitting push input value to ${e} %o`,t),o.emit(a.DebuggerServerEventType.PUSH_INPUT_VALUE,{pinId:e,value:t})},destroy:()=>{o.disconnect(),(0,a.enumToArray)(a.DebuggerServerEventType).forEach((e=>o.off(e)))},onDisconnect:e=>(o.on("disconnect",e),()=>o.off("disconnect",e)),debugInfo:()=>`Remote debugger for ${e}`,onBatchedEvents:e=>(o.on(a.DebuggerServerEventType.EVENTS_BATCH,e),()=>o.off(a.DebuggerServerEventType.EVENTS_BATCH,e)),requestState:()=>s.default.get(`${e}/state`).then((e=>e.data.state)),getHistory:n=>s.default.get(`${e}/history`,{params:{insId:n.insId,pinId:n.pinId,limit:n.limit,executionId:t}}).then((e=>e.data)),clearHistory:()=>s.default.delete(`${e}/history`).then((()=>{})),triggerNode:(t,n)=>s.default.post(`${e}/trigger`,{nodeId:t,inputs:n}).then((e=>e.data))}}},58066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeData=void 0;const o=n(74762),i=n(36783),s=(0,o.debugLogger)("remote-debugger:normalize-data");t.normalizeData=e=>{if(e instanceof Error)return(0,i.serializeError)(e);if("object"==typeof e&&null!==e){e={...e};const t=new WeakSet,n=e=>{if("bigint"==typeof e)return e.toString();if("object"!=typeof e||Array.isArray(e))return e;if(null===e)return e;if(t.has(e))return"[Circular]";try{t.add(e)}catch(o){s("Error adding to WeakSet","data:",e,"type:",typeof e,"error:",o)}if(Array.isArray(e))return e.map(n);if("object"==typeof e){const t={};for(const o in e)t[o]=n(e[o]);return t}return e};return n(e)}return e}},39641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimeClient=t.DEFAULT_DT_SCALE=void 0;const o=n(74762),i=n(32048),s=n(31758),r=n(58066),a=(0,o.debugLogger)("remote-debugger:runtime-client");t.DEFAULT_DT_SCALE=1;t.createRuntimeClient=(e,t)=>{const n=new URL(e),u=(0,i.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/runtime`,timeout:1e3,reconnectionAttempts:3});u.emit("join-room-runtime",t),u.on("connection",(e=>{e.join(t)}));let c=new Set;u.on(s.DebuggerServerEventType.UPDATE_BREAKPOINTS,(e=>{c=new Set(e)}));const l=(0,o.cappedArrayDebounce)((e=>{a(`Emitting debounced batched events - ${e.length}`),u.emit(s.DebuggerServerEventType.EVENTS_BATCH,e)}),100,200);return{onChange:e=>(u.on(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e),()=>u.off(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e)),onInput:e=>(u.on(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e),()=>u.off(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e)),emitEvent:e=>{a(`Emitting event ${e.type} change event of ${e.insId}`),e.val=(0,r.normalizeData)(e.val),l.addItem({...e,time:Date.now()})},emitRuntimeReady:()=>{u.emit(s.DebuggerServerEventType.RUNTIME_READY,{})},emitChangeAwk:()=>{u.emit(s.DebuggerServerEventType.CHANGE_AWK,{})},emitChangeError:e=>{u.emit(s.DebuggerServerEventType.CHANGE_ERROR,{error:e})},emitIsAlive:e=>{u.emit(s.DebuggerServerEventType.IS_ALIVE,{time:e})},destroy:async()=>{l.pendingItems()&&(l.flush(),await(0,o.delay)(100)),(0,s.enumToArray)(s.DebuggerServerEventType).forEach((e=>u.off(e))),u.disconnect()},onDisconnect:e=>(u.on("disconnect",e),()=>u.off("disconnect",e)),waitForConnection:()=>new Promise(((e,t)=>{u.connected?e():(u.on("connect_error",(e=>{t(`Socket connect error: ${e}`)})),u.on("connect",(()=>{e()})))}))}}},31758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerServerEventType=t.enumToArray=t.isNumber=t.isSimpleType=t.valuePreview=t.toString=void 0;const o=n(36783);t.toString=e=>{if("object"===typeof e){if(e instanceof Error)return JSON.stringify((0,o.serializeError)(e));try{return JSON.stringify(e).substr(0,250)}catch(t){return"Object (cannot stringify)"}}return`${e}`.substr(0,250)};t.valuePreview=e=>(0,t.toString)(e).substr(0,100);t.isSimpleType=e=>["number","string","boolean"].includes(typeof e);t.isNumber=e=>!1===isNaN(Number(e)),t.enumToArray=function(e){return Object.keys(e).filter(t.isNumber).map((t=>e[t]))},function(e){e.RUNTIME_READY="runtime-ready",e.CHANGE_EVENT_NAME="change",e.PUSH_INPUT_VALUE="push-input-value",e.CHANGE_AWK="live-change-awk",e.CHANGE_ERROR="live-change-error",e.IS_ALIVE="is-alive",e.UPDATE_BREAKPOINTS="update-breakpoints",e.INPUT_VALUE_OVERRIDE="input-value-override",e.OUTPUT_VALUE_OVERRIDE="output-value-override",e.INPUT_VALUE_CHANGE="input-value-changed",e.OUTPUT_VALUE_CHANGE="output-value-changed",e.PROCESSING_CHANGE="processing-changed",e.INPUTS_STATE_CHANGE="inputs-state-changed",e.NODE_ERROR="node-error",e.EVENTS_BATCH="events-batch"}(t.DebuggerServerEventType||(t.DebuggerServerEventType={}))},96233:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31758),t),i(n(42403),t),i(n(39641),t)},79118:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Request=t.Put=t.Post=t.Get=void 0;const i=o(n(18706)),s="HTTP";t.Get={id:"GET Request",defaultStyle:{icon:"fa-server"},namespace:s,description:"Performs a HTTP GET request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:(e,t)=>{let{url:n,headers:o,params:s}=e,{data:r}=t;return i.default.get(n,{headers:o,params:s}).then((e=>r.next(e.data)))}},t.Post={id:"POST Request",defaultStyle:{icon:"fa-server"},namespace:s,description:"Performs a HTTP POST request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"},data:{description:"Data to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:(e,t)=>{let{url:n,headers:o,params:s,data:r}=e,{data:a}=t;const u={headers:o,params:s};return i.default.post(n,r,u).then((e=>a.next(e.data)))}},t.Put={id:"PUT Request",defaultStyle:{icon:"fa-server"},namespace:s,description:"Performs a HTTP PUT request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"},data:{description:"Data to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:(e,t)=>{let{url:n,headers:o,params:s,data:r}=e,{data:a}=t;const u={headers:o,params:s};return i.default.put(n,r,u).then((e=>a.next(e.data)))}},t.Request={id:"Request",defaultStyle:{icon:"fa-server"},namespace:s,description:"Performs a HTTP request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},method:{description:"HTTP method to use"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"},data:{description:"Data to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:(e,t)=>{let{url:n,method:o,headers:s,params:r,data:a}=e,{data:u}=t;const c={method:o,headers:s,params:r};return i.default.request({url:n,data:a,...c}).then((e=>u.next(e.data)))}}},21518:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyEquals=t.DeleteAttribute=t.SetAttribute=t.GetAttribute=t.ObjectAssign=t.ObjectFromEntries=t.ObjectEntries=t.ObjectValues=t.ObjectHasOwnProperty=t.ObjectKeys=t.JSONStringify=t.JSONParse=void 0;const n="Objects";t.JSONParse={id:"JSON Parse",defaultStyle:{icon:"fa-glasses"},namespace:n,description:"Parses a JSON string into an object",inputs:{json:{description:"JSON string to parse"}},outputs:{object:{description:"The parsed object"}},run:(e,t)=>{let{json:n}=e,{object:o}=t;return o.next(JSON.parse(n))}},t.JSONStringify={id:"JSON Stringify",defaultStyle:{icon:"fa-pen-fancy"},namespace:n,description:"Stringifies an object into a JSON string",inputs:{object:{description:"Object to stringify"}},outputs:{json:{description:"The stringified JSON"}},run:(e,t)=>{let{object:n}=e,{json:o}=t;return o.next(JSON.stringify(n))}},t.ObjectKeys={id:"Keys",defaultStyle:{icon:"fa-key"},namespace:n,description:"Emits the keys of an object",inputs:{object:{description:"Object to get keys of"}},outputs:{keys:{description:"The keys of object"}},run:(e,t)=>{let{object:n}=e,{keys:o}=t;return o.next(Object.keys(n))}},t.ObjectHasOwnProperty={id:"Has own property",defaultStyle:{icon:"fa-key"},namespace:n,description:"Checks if object has property",inputs:{object:{mode:"required",description:"Object to get keys of"},property:{mode:"required",description:"the property to search for"}},outputs:{true:{description:"The value is true"},false:{description:"The value is false"}},run:function(e,t){const{true:n,false:o}=t,{object:i,property:s}=e;i.hasOwnProperty(s)?n.next(!0):o.next(!1)}},t.ObjectValues={id:"Values",namespace:n,description:"Emits the values of an object",inputs:{object:{description:"Object to get values of"}},outputs:{values:{description:"The values of object"}},run:(e,t)=>{let{object:n}=e,{values:o}=t;return o.next(Object.values(n))}},t.ObjectEntries={id:"Entries",defaultStyle:{icon:"fa-box"},namespace:n,description:"Emits the entries of an object",inputs:{object:{description:"Object to get entries of"}},outputs:{entries:{description:"The entries of object"}},run:(e,t)=>{let{object:n}=e,{entries:o}=t;return o.next(Object.entries(n))}},t.ObjectFromEntries={id:"From Entries",namespace:n,defaultStyle:{icon:"fa-box"},description:"Creates an object from an array of entries",inputs:{entries:{description:"Array of entries to create object from"}},outputs:{object:{description:"The created object"}},run:(e,t)=>{let{entries:n}=e,{object:o}=t;return o.next(Object.fromEntries(n))}},t.ObjectAssign={id:"Assign",namespace:n,defaultStyle:{icon:"fa-box"},description:"Assigns properties from one or more objects to a target object",inputs:{target:{description:"Target object to assign properties to"},sources:{description:"One or more objects to assign properties from"}},outputs:{object:{description:"The target object"}},run:(e,t)=>{let{target:n,sources:o}=e,{object:i}=t;return i.next(Object.assign(n,...o))}},t.GetAttribute={id:"Get Attribute",searchKeywords:["pick","dot"],namespace:n,defaultStyle:{icon:"fa-magnifying-glass"},description:"Gets an attribute from an object",inputs:{object:{description:"Object to get attribute from"},attribute:{description:"Attribute to get"}},outputs:{value:{description:"The value of the attribute"}},customViewCode:'{{#if inputs.attribute}}\n Get "{{inputs.attribute}}"\n{{else}}\n Get Attribute\n{{/if}}',run:(e,t)=>{let{object:n,attribute:o}=e,{value:i}=t;return i.next(o.split(".").reduce(((e,t)=>e[t]),n))}},t.SetAttribute={id:"Set Attribute",searchKeywords:["dot"],namespace:n,defaultStyle:{icon:"fa-box"},description:"Sets an attribute on an object",inputs:{object:{description:"Object to set attribute on"},attribute:{description:"Attribute to set"},value:{description:"Value to set attribute to"}},outputs:{object:{description:"The object with the attribute set"}},customViewCode:'{{#if inputs.attribute}}\n Set "{{inputs.attribute}}"\n{{else}}\n Set Attribute\n{{/if}}',run:(e,t)=>{let{object:n,attribute:o,value:i}=e,{object:s}=t;const r=o.split("."),a=r.pop();return r.reduce(((e,t)=>e[t]),n)[a]=i,s.next(n)}},t.DeleteAttribute={id:"Delete Attribute",defaultStyle:{icon:"fa-box"},namespace:n,description:"Deletes an attribute from an object",inputs:{object:{description:"Object to delete attribute from"},attribute:{description:"Attribute to delete"}},customViewCode:'{{#if inputs.attribute.value}}\n Delete "{{inputs.attribute.value}}"\n{{else}}\n Delete Attribute\n{{/if}}',outputs:{object:{description:"The object with the attribute deleted"}},run:(e,t)=>{let{object:n,attribute:o}=e,{object:i}=t;const s=o.value.split("."),r=s.pop();delete s.reduce(((e,t)=>e[t]),n.value)[r],i.next(n.value)}},t.PropertyEquals={id:"Property Equals",namespace:n,defaultStyle:{icon:"fa-equals"},description:'Emits the object to the "true" output if an object\'s property equals a value, otherwise emits to the "false" output',inputs:{object:{description:"Object to check property of"},attribute:{description:"Attribute to check"},value:{description:"Value to check attribute against"}},outputs:{true:{description:"Emitted if the attribute equals the value"},false:{description:"Emitted if the attribute does not equal the value"}},customViewCode:'{{#if inputs.attribute}}\n "{{inputs.attribute}}" equals "{{inputs.value}}"\n{{else}}\n Property Equals\n{{/if}}',run:(e,t)=>{e.attribute.split(".").reduce(((e,t)=>e[t]),e.object)===e.value?t.true.next(e.object):t.false.next(e.object)}}},65645:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var o=n(70079),i=n(11253),s=n(74089),r=n(74762),a=n(21766);var u=n(10831),c=n(61997),l=n(77852);const d=(0,a.S)(),p=[0,20],f=e=>{let{flow:t,output:n,inputs:o,onError:s,debugDelay:a,onCompleted:u,dependencies:c,player:l}=e;const p=((e,t)=>{const n=new Set;return{onEvent:o=>{const i={...o,time:Date.now(),executionId:"n/a"};console.info("Got debugger event",o),t.addEvents([i]),e.addEvents([i]),n.forEach((e=>e([i])))},onBatchedEvents:e=>(n.add(e),()=>n.delete(e))}})(l,d);p.debugDelay=a;const f=(0,r.keys)(t.node.outputs)[0];return{executeResult:(0,r.execute)({node:t.node,inputs:o,outputs:{[f]:n},resolvedDeps:{...c,[t.node.id]:t.node},_debugger:p,onCompleted:u,onBubbleError:e=>{s(e)},extraContext:{PubSub:i}}),localDebugger:p}},m=e=>{const{debugDelay:t,onOutput:i,flowProps:a}=e,{flow:m,inputs:g,output:h}=a,v=(0,o.useRef)((0,s.createRuntimePlayer)()),[y,I]=(0,o.useState)(e.flowProps.dependencies),[b,C]=(0,o.useState)(),[_]=(0,s.useDebounce)(y,500),j=(0,l.useDarkMode)(),x=async(e,t)=>{const{node:o}=e,i=Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).find((e=>(0,r.isBaseNode)(e)&&e.id===o.id));let a;I((e=>({...e,[i.id]:{...i,source:{path:"@flyde/stdlib/dist/all-browser",export:i.id}}})));const c=(0,u.ZP)(m,(n=>{if(t){const o=(0,s.vAdd)({x:0,y:0},t.pos);if(a=(0,s.createNewNodeInstance)(e.node,0,o,y),n.node.instances.push(a),t.connectTo){const{insId:e,outputId:o}=t.connectTo;n.node.connections.push({from:{insId:e,pinId:o},to:{insId:a.id,pinId:r.TRIGGER_PIN_ID}})}}}));await new Promise((e=>setTimeout(e,10)));const l=(0,u.ZP)(P,(e=>{e.flow=c,t?.selectAfterAdding&&a&&(e.boardData.selected=[a?.id])}));return O(l),(0,s.toastMsg)(`Node ${o.id} successfully imported from ${e.module}`),y},N=async()=>({importables:Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).filter(r.isBaseNode).map((e=>({node:{...e,source:{path:"n/a",export:"n/a"}},module:"@flyde/stdlib"}))),errors:[]}),[P,O]=(0,o.useState)({flow:m,boardData:{viewPort:{pos:{x:0,y:0},zoom:1},lastMousePos:{x:0,y:0},selected:[]}});(0,o.useEffect)((()=>{O((e=>({...e,flow:m})))}),[m]),(0,o.useEffect)((()=>{I((e=>({...e,main:P.flow.node})))}),[P.flow.node]);const w={state:P,onChangeEditorState:O,hideTemplatingTips:!0,initialPadding:p,onExtractInlineNode:r.noop,disableScrolling:!0,darkMode:j.isDarkMode};(0,o.useEffect)((()=>{v.current.start()}),[]),(0,o.useEffect)((()=>{const{executeResult:n,localDebugger:o}=f({flow:P.flow,dependencies:y,output:h,inputs:g,onError:r.noop,debugDelay:t,player:v.current,onCompleted:e.onCompleted}),s=e.flowProps.output.subscribe((e=>i(e)));return C(o),()=>{n(),s.unsubscribe()}}),[t,_]);const E=(0,o.useMemo)((()=>({resolvedDependencies:y,onImportNode:x,onRequestImportables:N})),[]),S=(0,o.useMemo)((()=>({debuggerClient:b,onRequestHistory:d.requestHistory})),[b]);return o.createElement(c.Z,null,(()=>o.createElement(s.DependenciesContextProvider,{value:E},o.createElement(s.DebuggerContextProvider,{value:S},o.createElement(s.FlowEditor,w)))))}},21766:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var o=n(74762);const i=200,s=()=>{const e=new Map,t=new Map;return{requestHistory:async(n,s,r)=>{const a="input"===r?o.DebuggerEventType.INPUT_CHANGE:o.DebuggerEventType.OUTPUT_CHANGE;if(console.log({insId:n,pinId:s,type:a}),s){const t=`${n}.${s}.${a}`,o=e.get(t)||{total:0,lastSamples:[]},r=o.lastSamples.slice(0,i);return{...o,lastSamples:r}}{const e=t.get(n)||{total:0,lastSamples:[]},o=e.lastSamples.slice(0,i);return{...e,lastSamples:o}}},addEvents:n=>{n.forEach((n=>{if(n.type===o.DebuggerEventType.ERROR){const e=n;e.type=o.DebuggerEventType.OUTPUT_CHANGE,e.pinId=o.ERROR_PIN_ID}if(n.type===o.DebuggerEventType.INPUT_CHANGE||n.type===o.DebuggerEventType.OUTPUT_CHANGE){const{insId:o,type:s,pinId:r}=n;{const t=`${o}.${r}.${s}`,a=e.get(t)||{total:0,lastSamples:[]};a.lastSamples.unshift(n),a.lastSamples.length>i&&a.lastSamples.splice(i,a.lastSamples.length-i),a.total++,e.set(t,a)}{const s=t.get(o)||{total:0,lastSamples:[]};s.lastSamples.unshift(n),s.lastSamples.length>i&&s.lastSamples.splice(i,s.lastSamples.length-i),s.total++,e.set(o,s)}}}))}}}},4144:(e,t,n)=>{"use strict";n.d(t,{V:()=>r});var o=n(10328),i=n(70079);const s=e=>i.createElement("li",{className:"log-item"},i.createElement("main",{className:"content"},e.value),i.createElement("aside",null,new Date(e.time).toLocaleTimeString())),r=e=>{const[t,n]=i.useState([]);return i.useEffect((()=>{e.output.subscribe((e=>{const t="object"==typeof e&&i.isValidElement(e)?e:`${e}`;n((e=>[...e,{value:t,time:Date.now()}]))}))}),[]),i.createElement("div",{className:"output-log"},i.createElement("header",null,"Output Log"," ",i.createElement("button",{className:"clear-btn button button--outline button--secondary button--sm",onClick:()=>n([])},"Clear")),i.createElement("main",null,i.createElement("ul",null,t.map(((e,t)=>i.createElement(s,(0,o.Z)({},e,{key:t}))))),0===t.length?i.createElement("div",{className:"empty-state"},"Nothing to show. Interact with the example to emit some outputs!"):null))}},79256:(e,t,n)=>{"use strict";n.d(t,{I:()=>p});var o=n(70079),i=n(65092),s=n(19841),r=n(49794),a=n(21766),u=n(73949),c=n(81098),l=n(65645);(0,a.S)();const d=[{title:"Hello World",key:"hello-world"},{title:"React Counter",key:"react-counter"},{title:"BMI Calculator",key:"bmi"},{title:"REST API Usage",key:"apis"},{title:"Debounce vs. Throttling",key:"debounce-throttling"},{title:"Fibonacci Seq.",key:"fibonacci"}],p=e=>{const[t,n]=(0,o.useState)(e.initWidth||500),[a,p]=(0,o.useState)(e.defaultDelay||0),[f,m]=(0,o.useState)(!1),g=(0,o.useCallback)(((e,t)=>{let{size:o}=t;n(o.width)}),[]),h=o.createElement("div",{className:"delay-container"},o.createElement("input",{type:"range",id:"volume",name:"delay",value:a,step:"100",min:"0",max:"300",onChange:e=>p(Number(e.target.value))}),o.createElement("label",{htmlFor:"volume"},"Debug Delay: ",a,"ms")),v=d.findIndex((t=>t.key===e.meta.key)),y=d[v+1],I=d[v-1];return o.createElement(i.Z,{title:`${e.meta.title} | Playground`,description:`Flyde Playground - ${e.meta.title} example`},o.createElement("header",{className:(0,s.default)("hero hero--primary",u.Z.heroBanner,"playground-hero")},o.createElement("div",{className:"container"},o.createElement("h1",{className:"hero__title"},"Welcome to Flyde's Online Playground"),o.createElement("p",{className:"hero__subtitle"},"Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!"))),o.createElement("div",{className:"mobile-warning"},"Flyde is currently not optimized for mobile devices. Please"," ",o.createElement("strong",null,"use a desktop computer for the best experience"),"."),o.createElement("ul",{className:"examples__menu"},d.map((e=>o.createElement("li",{key:e.key},o.createElement(r.Z,{to:`/playground/${e.key}`,className:"button button--primary"},e.title))))),o.createElement("div",{className:"playground-container"},o.createElement("header",null,o.createElement("h2",{className:"playground-title"},e.meta.title),o.createElement("div",{className:"playground-description"},e.meta.description),f?o.createElement(o.Fragment,null,o.createElement("hr",null),o.createElement("div",{className:"playground-extra"},e.extraInfo||e.meta.extraInfo,o.createElement("div",{className:"star-hint"},o.createElement("span",null,"\xa0 PS: Did you like this example?"),"Please consider giving a \u2b50\ufe0f to the project"," ",o.createElement("span",{className:"star-wrapper"},o.createElement("iframe",{className:"gh-stars-frame",src:"https://ghbtns.com/github-btn.html?user=flydelabs&repo=flyde&type=star&count=true&size=small",width:100,height:20,title:"GitHub Stars"}))))):null,e.prefixComponent),o.createElement("div",{className:"playground"},o.createElement("div",{className:"flow-container"},!0!==e.hideDelay?h:null,o.createElement(l.Y,{flowProps:e.flowProps,debugDelay:a,onOutput:()=>m(!0)})),o.createElement(c.Resizable,{height:0,width:t,onResize:g,handle:o.createElement("div",{className:"handle"}),axis:"x",resizeHandles:["w"]},o.createElement("div",{className:"output-container",style:{flexBasis:t}},e.children))),o.createElement("nav",{className:"pagination-nav"},o.createElement("div",{className:"pagination-nav__item"},I?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${I.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Previous Example"),o.createElement("div",{className:"pagination-nav__label"},I.title)):null),o.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},y?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${y.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Next Example"),o.createElement("div",{className:"pagination-nav__label"},y.title)):null))))}},24373:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var o=n(70079),i=n(74762),s=n(79256);const r={dependencies:{"GET Request":{id:"GET Request",defaultStyle:{icon:"fa-server"},namespace:"HTTP",description:"Performs a HTTP GET request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:n(79118).Get.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Http.flyde.js",export:"Get"}},"POST Request":{id:"POST Request",defaultStyle:{icon:"fa-server"},namespace:"HTTP",description:"Performs a HTTP POST request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"},data:{description:"Data to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:n(79118).Post.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Http.flyde.js",export:"Post"}},"Get Attribute":{id:"Get Attribute",searchKeywords:["pick","dot"],namespace:"Objects",defaultStyle:{icon:"fa-magnifying-glass"},description:"Gets an attribute from an object",inputs:{object:{description:"Object to get attribute from"},attribute:{description:"Attribute to get"}},outputs:{value:{description:"The value of the attribute"}},customViewCode:'{{#if inputs.attribute}}\n Get "{{inputs.attribute}}"\n{{else}}\n Get Attribute\n{{/if}}',run:n(21518).GetAttribute.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Objects.flyde.js",export:"GetAttribute"}}},flow:{imports:{"@flyde/stdlib":["GET Request","POST Request","Get Attribute"]},node:{instances:[{pos:{x:-652.4219506835938,y:281.67776977539063},id:"Inline-value-Hello from ${i76",inputConfig:{},node:{id:"Inline-value-Hello visitor ",inputs:{country:{mode:"required"},capital:{mode:"required"},population:{mode:"required"}},outputs:{value:{delayed:!1}},runFnRawCode:"const result = (`Hello visitor from ${inputs.country}! The capital is ${inputs.capital} (population of ${inputs.population})`); Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"`Hello visitor from ${inputs.country}! The capital is ${inputs.capital} (population of ${inputs.popu",dataBuilderSource:"YEhlbGxvIHZpc2l0b3IgZnJvbSAke2lucHV0cy5jb3VudHJ5fSEgVGhlIGNhcGl0YWwgaXMgJHtpbnB1dHMuY2FwaXRhbH0gKHBvcHVsYXRpb24gb2YgJHtpbnB1dHMucG9wdWxhdGlvbn0pYA==",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"}},{pos:{x:-616.065219116211,y:-228.04816649675365},id:"Get User's Country-ins",inputConfig:{},node:{id:"Get User's Country",inputs:{},outputs:{country:{type:"any",delayed:!1,optional:!1}},instances:[{pos:{x:-335.7258349609375,y:-194.68226864814756},id:"GET Request-907",inputConfig:{url:{mode:"static",value:"https://api.country.is/"}},visibleInputs:["url","__trigger"],visibleOutputs:["r","__error","response","data"],nodeId:"GET Request"},{id:"Inline-value-{iso2: ${input76",node:{id:"Inline-value-{iso2: inputs.d",inputs:{data:{type:"any",mode:"required"}},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"const result = ({iso2: inputs.data.country}); Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"{iso2: inputs.data.country}",dataBuilderSource:"e2lzbzI6IGlucHV0cy5kYXRhLmNvdW50cnl9",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},inputConfig:{},pos:{x:-468.5056274414062,y:-39.30523986816405}}],inputsPosition:{},outputsPosition:{r:{x:-363.42401672132144,y:105.34149194113161},country:{x:-322.5739794922268,y:138.57280736180334}},connections:[{from:{insId:"Inline-value-{iso2: ${input76",pinId:"value"},to:{pinId:"country",insId:"__this"}},{from:{insId:"GET Request-907",pinId:"data"},to:{insId:"Inline-value-{iso2: ${input76",pinId:"data"}}],completionOutputs:["country"]},style:{size:"large",color:"#f15bb5"}},{pos:{x:-675.1473986816407,y:-88.80973440885543},id:"Get Country Name And Capital-ins",inputConfig:{},visibleOutputs:["name","capital"],node:{id:"Get Country Name And Capital",inputs:{body:{type:"any",mode:"required"}},outputs:{capital:{type:"any",delayed:!1,optional:!1},name:{type:"any",delayed:!1,optional:!1}},instances:[{pos:{x:-455.39787109375004,y:43.691497802734375},id:"POST Request-624",inputConfig:{url:{mode:"static",value:"https://countriesnow.space/api/v0.1/countries/capital"}},visibleInputs:["url","body","data"],nodeId:"POST Request"},{id:"Get Attribute-217",nodeId:"Get Attribute",inputConfig:{attribute:{mode:"static",value:"data.capital"}},pos:{x:-285.6922900390625,y:219.88888122558592}},{id:"Get Country Name And Capital-srp46ei",nodeId:"Get Attribute",inputConfig:{attribute:{mode:"static",value:"data.name"}},pos:{x:-608.0307299804688,y:225.56220581054686}}],inputsPosition:{body:{x:-333.75691140339336,y:-63.66470402308542}},outputsPosition:{value:{x:-514.1541695281439,y:411.8457371232514},i10:{x:-280.88783057750686,y:411.581705357324},capital:{x:-214.78486673798952,y:473.65942918140723},name:{x:-523.761854810908,y:479.9947571097377}},connections:[{from:{pinId:"body",insId:"__this"},to:{insId:"POST Request-624",pinId:"data"}},{from:{insId:"Get Attribute-217",pinId:"value"},to:{pinId:"capital",insId:"__this"}},{from:{insId:"POST Request-624",pinId:"data"},to:{insId:"Get Country Name And Capital-srp46ei",pinId:"object"}},{from:{insId:"Get Country Name And Capital-srp46ei",pinId:"value"},to:{pinId:"name",insId:"__this"}},{from:{insId:"POST Request-624",pinId:"data"},to:{insId:"Get Attribute-217",pinId:"object"}}],completionOutputs:["name+capital"]},style:{size:"large",color:"#9b5de5"}},{pos:{x:-283.9292150878906,y:175.29793395996091},id:"Format Number-ins",inputConfig:{},node:{id:"Format Number",inputs:{number:{type:"any",mode:"required"}},outputs:{string:{type:"any",delayed:!1,optional:!1}},instances:[{id:"Inline-value-Result is ${in47",node:{id:"Inline-value-new Intl.Number",inputs:{population:{type:"any",mode:"required"}},outputs:{r:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"outputs.r.next((new Intl.NumberFormat().format(inputs.population)))",customViewCode:"new Intl.NumberFormat().format(inputs.population)",dataBuilderSource:"bmV3IEludGwuTnVtYmVyRm9ybWF0KCkuZm9ybWF0KGlucHV0cy5wb3B1bGF0aW9uKQ==",templateType:"value",completionOutputs:["r"]},inputConfig:{},pos:{x:-452.21022216796877,y:176.39826171875}}],inputsPosition:{population:{x:0,y:0},number:{x:0,y:0}},outputsPosition:{r:{x:0,y:400},string:{x:0,y:400}},connections:[{from:{insId:"__this",pinId:"number"},to:{insId:"Inline-value-Result is ${in47",pinId:"population"}},{from:{insId:"Inline-value-Result is ${in47",pinId:"r"},to:{insId:"__this",pinId:"string"}}],completionOutputs:["string"]},style:{size:"regular",color:"#fee440"}},{pos:{x:-347.9215673828125,y:54.336173706054694},id:"cl8x5r4qp00074666lb382z1c",inputConfig:{},node:{id:"Get Population By City",inputs:{city:{type:"any",mode:"required"}},outputs:{value:{type:"any",delayed:!1,optional:!1}},instances:[{pos:{x:-204.90311279296873,y:349.60314422607416},id:"POST Request-775",inputConfig:{url:{mode:"static",value:"https://countriesnow.space/api/v0.1/countries/population/cities"}},visibleInputs:["url","body","data"],nodeId:"POST Request"},{pos:{x:-143.08780761718754,y:233.70198646545413},id:"Inline-value-{city: inputs.c75",inputConfig:{},node:{id:"Inline-value-{city: inputs.c",inputs:{city:{type:"any",mode:"required"}},outputs:{r:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"outputs.r.next(({city: inputs.city}))",customViewCode:"{city: inputs.city}",dataBuilderSource:"e2NpdHk6IGlucHV0cy5jaXR5fQ==",templateType:"value",completionOutputs:["r"]}},{id:"Get Attribute-893",nodeId:"Get Attribute",inputConfig:{attribute:{mode:"static",value:"data.populationCounts.0.value"}},pos:{x:-196.82018798828125,y:535.9137713623047},style:{icon:"fa-box",size:"small"}}],inputsPosition:{city:{x:-59.242744173605615,y:192.73141904118035}},outputsPosition:{value:{x:-116.77230284586054,y:698.5630767231784}},connections:[{from:{pinId:"city",insId:"__this"},to:{insId:"Inline-value-{city: inputs.c75",pinId:"city"}},{from:{insId:"Inline-value-{city: inputs.c75",pinId:"r"},to:{insId:"POST Request-775",pinId:"data"}},{from:{insId:"Get Attribute-893",pinId:"value"},to:{pinId:"value",insId:"__this"}},{from:{insId:"POST Request-775",pinId:"data"},to:{insId:"Get Attribute-893",pinId:"object"}}],completionOutputs:["value"]},style:{size:"large",color:"#00bbf9"}}],connections:[{from:{insId:"Get Country Name And Capital-ins",pinId:"name"},to:{insId:"Inline-value-Hello from ${i76",pinId:"country"}},{from:{insId:"Get Country Name And Capital-ins",pinId:"capital"},to:{insId:"Inline-value-Hello from ${i76",pinId:"capital"}},{from:{insId:"Format Number-ins",pinId:"string"},to:{insId:"Inline-value-Hello from ${i76",pinId:"population"}},{from:{insId:"cl8x5r4qp00074666lb382z1c",pinId:"value"},to:{insId:"Format Number-ins",pinId:"number"}},{from:{insId:"Get Country Name And Capital-ins",pinId:"capital"},to:{insId:"cl8x5r4qp00074666lb382z1c",pinId:"city"}},{from:{insId:"Get User's Country-ins",pinId:"country"},to:{insId:"Get Country Name And Capital-ins",pinId:"body"}},{from:{insId:"Inline-value-Hello from ${i76",pinId:"value"},to:{insId:"__this",pinId:"response"}}],id:"ApisCombination",inputs:{},outputs:{response:{type:"any",optional:!1,delayed:!1}},inputsPosition:{city:{x:-187.27285824815934,y:-14.13215209416181}},outputsPosition:{json:{x:-441.98276309426666,y:480.38719404276554},na:{x:-441.98276309426666,y:480.38719404276554},result:{x:-499.82438378976735,y:706.7650396699393},output:{x:-474.64252250807056,y:437.71313745088565},response:{x:-500.61566893722795,y:421.9045791861946}},completionOutputs:["response"]}}};var a=n(4144);const u={title:"HTTP Requests",description:"Flyde works great for heavy asynchronous & concurrent tasks, like combining several REST APIs together. This example shows exactly that, by combining 3 different REST APIs, the population of the capital of the country your IP is assigned with is retrieved",key:"api",extraInfo:o.createElement("strong",null,o.createElement("h3",null,"Try double-clicking each API node to see it's underlying implementation! In Flyde, nothing is hidden, only abstracted"))};function c(){const e=(0,o.useRef)((0,i.dynamicOutput)()),t=(0,o.useRef)({__trigger:(0,i.dynamicNodeInput)()}),[n,c]=(0,o.useState)({flow:r.flow,dependencies:r.dependencies,inputs:t.current,output:e.current}),l=o.createElement("button",{className:"button button--success",onClick:()=>t.current.__trigger.subject.next("run")},"Run!");return o.createElement(s.I,{meta:u,flowProps:n,defaultDelay:100,prefixComponent:l},o.createElement(a.V,{output:e.current}))}},73949:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={"flyde-flow-editor":"flyde-flow-editor_AAD4",_hj_feedback_container:"_hj_feedback_container_Af03"}},85721:(e,t,n)=>{var o={"./af":47654,"./af.js":47654,"./ar":61325,"./ar-dz":98344,"./ar-dz.js":98344,"./ar-kw":26230,"./ar-kw.js":26230,"./ar-ly":42524,"./ar-ly.js":42524,"./ar-ma":44119,"./ar-ma.js":44119,"./ar-sa":82625,"./ar-sa.js":82625,"./ar-tn":42182,"./ar-tn.js":42182,"./ar.js":61325,"./az":37093,"./az.js":37093,"./be":32721,"./be.js":32721,"./bg":59919,"./bg.js":59919,"./bm":95594,"./bm.js":95594,"./bn":563,"./bn-bd":41757,"./bn-bd.js":41757,"./bn.js":563,"./bo":73211,"./bo.js":73211,"./br":87438,"./br.js":87438,"./bs":83662,"./bs.js":83662,"./ca":61196,"./ca.js":61196,"./cs":5841,"./cs.js":5841,"./cv":85251,"./cv.js":85251,"./cy":24512,"./cy.js":24512,"./da":37539,"./da.js":37539,"./de":5059,"./de-at":53853,"./de-at.js":53853,"./de-ch":99378,"./de-ch.js":99378,"./de.js":5059,"./dv":91454,"./dv.js":91454,"./el":39651,"./el.js":39651,"./en-au":87953,"./en-au.js":87953,"./en-ca":98193,"./en-ca.js":98193,"./en-gb":61980,"./en-gb.js":61980,"./en-ie":14050,"./en-ie.js":14050,"./en-il":6502,"./en-il.js":6502,"./en-in":555,"./en-in.js":555,"./en-nz":11372,"./en-nz.js":11372,"./en-sg":26568,"./en-sg.js":26568,"./eo":69533,"./eo.js":69533,"./es":68327,"./es-do":17620,"./es-do.js":17620,"./es-mx":96467,"./es-mx.js":96467,"./es-us":83272,"./es-us.js":83272,"./es.js":68327,"./et":68523,"./et.js":68523,"./eu":19066,"./eu.js":19066,"./fa":59087,"./fa.js":59087,"./fi":96443,"./fi.js":96443,"./fil":93979,"./fil.js":93979,"./fo":90383,"./fo.js":90383,"./fr":56327,"./fr-ca":25610,"./fr-ca.js":25610,"./fr-ch":97274,"./fr-ch.js":97274,"./fr.js":56327,"./fy":67442,"./fy.js":67442,"./ga":44291,"./ga.js":44291,"./gd":77342,"./gd.js":77342,"./gl":96248,"./gl.js":96248,"./gom-deva":21404,"./gom-deva.js":21404,"./gom-latn":20833,"./gom-latn.js":20833,"./gu":9122,"./gu.js":9122,"./he":74623,"./he.js":74623,"./hi":60364,"./hi.js":60364,"./hr":30860,"./hr.js":30860,"./hu":70441,"./hu.js":70441,"./hy-am":90425,"./hy-am.js":90425,"./id":29672,"./id.js":29672,"./is":96150,"./is.js":96150,"./it":27852,"./it-ch":55603,"./it-ch.js":55603,"./it.js":27852,"./ja":16465,"./ja.js":16465,"./jv":20120,"./jv.js":20120,"./ka":87245,"./ka.js":87245,"./kk":21479,"./kk.js":21479,"./km":65038,"./km.js":65038,"./kn":63060,"./kn.js":63060,"./ko":85020,"./ko.js":85020,"./ku":90582,"./ku.js":90582,"./ky":34950,"./ky.js":34950,"./lb":94201,"./lb.js":94201,"./lo":87894,"./lo.js":87894,"./lt":70120,"./lt.js":70120,"./lv":4265,"./lv.js":4265,"./me":14030,"./me.js":14030,"./mi":9463,"./mi.js":9463,"./mk":25898,"./mk.js":25898,"./ml":64233,"./ml.js":64233,"./mn":47156,"./mn.js":47156,"./mr":34479,"./mr.js":34479,"./ms":24691,"./ms-my":6456,"./ms-my.js":6456,"./ms.js":24691,"./mt":81789,"./mt.js":81789,"./my":37452,"./my.js":37452,"./nb":91170,"./nb.js":91170,"./ne":87529,"./ne.js":87529,"./nl":81776,"./nl-be":24455,"./nl-be.js":24455,"./nl.js":81776,"./nn":34705,"./nn.js":34705,"./oc-lnc":36139,"./oc-lnc.js":36139,"./pa-in":17960,"./pa-in.js":17960,"./pl":1899,"./pl.js":1899,"./pt":31670,"./pt-br":29159,"./pt-br.js":29159,"./pt.js":31670,"./ro":55115,"./ro.js":55115,"./ru":45149,"./ru.js":45149,"./sd":81231,"./sd.js":81231,"./se":35397,"./se.js":35397,"./si":99786,"./si.js":99786,"./sk":39383,"./sk.js":39383,"./sl":68691,"./sl.js":68691,"./sq":34826,"./sq.js":34826,"./sr":40080,"./sr-cyrl":75673,"./sr-cyrl.js":75673,"./sr.js":40080,"./ss":54309,"./ss.js":54309,"./sv":52245,"./sv.js":52245,"./sw":8967,"./sw.js":8967,"./ta":10454,"./ta.js":10454,"./te":35204,"./te.js":35204,"./tet":81571,"./tet.js":81571,"./tg":15737,"./tg.js":15737,"./th":41786,"./th.js":41786,"./tk":50511,"./tk.js":50511,"./tl-ph":14828,"./tl-ph.js":14828,"./tlh":62422,"./tlh.js":62422,"./tr":97047,"./tr.js":97047,"./tzl":90792,"./tzl.js":90792,"./tzm":67730,"./tzm-latn":59963,"./tzm-latn.js":59963,"./tzm.js":67730,"./ug-cn":42535,"./ug-cn.js":42535,"./uk":33151,"./uk.js":33151,"./ur":22750,"./ur.js":22750,"./uz":61914,"./uz-latn":60231,"./uz-latn.js":60231,"./uz.js":61914,"./vi":55517,"./vi.js":55517,"./x-pseudo":64078,"./x-pseudo.js":64078,"./yo":70046,"./yo.js":70046,"./zh-cn":81832,"./zh-cn.js":81832,"./zh-hk":90953,"./zh-hk.js":90953,"./zh-mo":38236,"./zh-mo.js":38236,"./zh-tw":71001,"./zh-tw.js":71001};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=s,e.exports=i,i.id=85721}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6007],{19121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cappedArrayDebounce=void 0;t.cappedArrayDebounce=function(e,t,n,o){void 0===o&&(o=500);let i=[],s=null,r=null;return{addItem:a=>{clearTimeout(s),i.push(a),r||(r=setTimeout((()=>{e(i),clearTimeout(s),r=null}),o)),i.length>=n?(e(i),clearTimeout(r),r=null,i=[]):s=setTimeout((()=>{e(i),clearTimeout(r),r=null,i=[]}),t)},flush:()=>{i.length&&(e(i),i=[],clearTimeout(r))},pendingItems:()=>i.length}}},59792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.dataShaper=t.DataShapeType=void 0,function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.ARRAY=3]="ARRAY",e[e.OBJECT=4]="OBJECT",e[e.NULL=5]="NULL",e[e.UNSUPPORTED=6]="UNSUPPORTED"}(n=t.DataShapeType||(t.DataShapeType={}));const o={string:n.STRING,number:n.NUMBER,boolean:n.BOOLEAN,object:n.OBJECT,array:n.ARRAY,null:n.NULL,symbol:n.UNSUPPORTED,undefined:n.UNSUPPORTED,function:n.UNSUPPORTED,bigint:n.UNSUPPORTED};t.dataShaper=function(e,n,i){void 0===n&&(n=5),void 0===i&&(i=5);const s=null===(r=e)?"null":typeof r;var r,a;if("object"===s){if(Array.isArray(e))return n>1?e.filter(((e,t)=>t(0,t.dataShaper)(e,n-1,i))):o.array;if(n>1){const o={};for(const s in e)o[s]=(0,t.dataShaper)(e[s],n-1,i);return a=o,Object.keys(a).sort().reduce(((e,t)=>(e[t]=a[t],e)),{})}return o.object}return o[s]}},23046:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.debugLogger=void 0;const i=(0,o(n(55899)).default)("flyde");t.debugLogger=e=>i.extend(e)},24331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullInsIdPath=void 0,t.fullInsIdPath=function(e,t){if(!e)throw new Error("insId is not defined");return t?`${t}.${e}`:e}},34459:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hashFlow=t.hashNode=void 0;const i=o(n(68805)),s=n(30292),r=e=>(0,i.default)(e);t.hashNode=function(e,t){var n;void 0===t&&(t=!0);const{id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:c}=e,l={id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:c};if((0,s.isVisualNode)(e)){const{instances:n,connections:o,inputsPosition:i,outputsPosition:s}=e,a=n.map((e=>{const{pos:t,...n}=e;return n})),u=t?{}:{inputsPosition:i,outputsPosition:s},c=t?a:n;c.sort(((e,t)=>e.id.localeCompare(t.id)));const d=[...o];d.sort(((e,t)=>{const n=`${e.from.insId}.${e.from.pinId}`,o=`${t.from.insId}.${t.from.pinId}`;return n.localeCompare(o)}));const p=JSON.stringify({instancesToUse:c,conns:d,...l,maybeIoPos:u});return r(p)}if((0,s.isInlineValueNode)(e)){const{customViewCode:t}=e,o=null!==(n=e.fnCode)&&void 0!==n?n:e.runFnRawCode,i=JSON.stringify({fnCode:o,customViewCode:t,...l});return r(i)}throw new Error("Hashing code nodes unsupported")};t.hashFlow=e=>{const{node:n,imports:o}=e,i=(0,t.hashNode)(n,!1),s=Object.entries(null!=o?o:{}).sort(((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)})).map((e=>{let[t,n]=e;return[t,n.sort()]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{}),a=JSON.stringify(s);return r(i+a)}},86873:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DepGraph=void 0,i(n(3172),t),i(n(59962),t),i(n(23046),t),i(n(19121),t),i(n(59962),t),i(n(34459),t),i(n(39043),t),i(n(59792),t),i(n(24331),t),t.DepGraph=n(60359).DepGraph},3172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testDataCreator=void 0;t.testDataCreator=e=>function(t){void 0===t&&(t={});return{..."function"==typeof e?e():e,...t}}},59962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplePluralize=t.eventually=t.delay=t.noop=t.removeDupes=t.ensure=t.isOptionalType=t.callFnOrFnPromise=t.isPromise=t.isDefined=t.containsAll=t.shuffle=t.randomInts=t.repeat=t.pickRandom=t.randomPos=t.randomInt=t.pickSecond=t.pickFirst=t.fromEntries=t.entries=t.okeys=t.values=t.keys=t.filterOMap=t.mapOMap=t.middlePos=t.calcCenter=t.intersectRect=void 0;t.intersectRect=(e,t)=>{const n=e.x+e.w,o=t.x+t.w;return!(t.x>n||oe.y+e.h||t.y+t.h{let{w:t,h:n,x:o,y:i}=e;return{x:o+t/2,y:i+n/2}};t.middlePos=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});t.mapOMap=(e,n)=>(0,t.entries)(e).map((e=>{let[t,o]=e;return[t,n(t,o)]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.filterOMap=(e,n)=>(0,t.entries)(e).filter((e=>{let[t,o]=e;return n(t,o)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.keys=e=>Object.keys(e);t.values=e=>Object.values(e),t.okeys=t.keys;t.entries=e=>(0,t.okeys)(e).map((t=>[t,e[t]]));t.fromEntries=e=>e.reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.pickFirst=e=>e[0];t.pickSecond=e=>e[1];t.randomInt=function(e,t){void 0===t&&(t=0);const n=Math.random();return t+Math.floor((e-t)*n)};t.randomPos=function(e,n){void 0===e&&(e=1e3),void 0===n&&(n=0);return{x:(0,t.randomInt)(e,n),y:(0,t.randomInt)(e,n)}};t.pickRandom=e=>e[(0,t.randomInt)(e.length)];t.repeat=(e,t)=>"x".repeat(e).split("").map(((e,n)=>t(n)));t.randomInts=function(e,n,o){return void 0===n&&(n=100),void 0===o&&(o=0),(0,t.repeat)(e,(()=>(0,t.randomInt)(n,o)))};t.shuffle=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t};t.containsAll=(e,t)=>t.every((t=>e.includes(t)));t.isDefined=e=>void 0!==e;t.isPromise=e=>e&&"function"==typeof e.then;t.callFnOrFnPromise=(e,n)=>{if(!(0,t.isDefined)(e))return;const o=e=>{try{e()}catch(t){console.error(n,t)}};"function"==typeof e?o(e):Promise.resolve(e).then((e=>{"function"==typeof e&&o(e)}))};t.isOptionalType=e=>/\?$/.test(e);t.ensure=(e,t)=>{if(void 0===e)throw new Error(t||"Undefined value passed");return e};t.removeDupes=e=>Array.from(new Set(e));t.noop=()=>{};t.delay=e=>new Promise((t=>setTimeout(t,e)));t.eventually=async function(e,n,o,i){if(void 0===n&&(n=1e3),void 0===o&&(o=100),void 0===i&&(i=new Set),n<0){const e=Array.from(i).reduce(((e,t,n)=>`${e}\n\t\t${n+1}. ${t}`),"");throw new Error(`[Eventually timeout exceeded after: timeout with error]: ${e}`)}try{await e()}catch(s){const r=Date.now();await(0,t.delay)(o);const a=Date.now()-r;return i.add(null==s?void 0:s.message),(0,t.eventually)(e,n-a,o,i)}},t.simplePluralize=function(e,t){return`${e} ${t}${1!==e?"s":""}`}},39043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileObjectTemplate=t.compileStringTemplate=void 0;t.compileStringTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=new RegExp("\\$\\{"+e+"\\}","g");n=n.replace(i,o)})),n};t.compileObjectTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=JSON.stringify(o),s=new RegExp('"\\$\\$\\{'+e+'\\}"',"g"),r=new RegExp("\\$\\{"+e+"\\}","g"),a="string"==typeof o?o.replace(/"/g,((e,t,n)=>"\\"!==n[t-1]?'\\"':n[t])):o;n=n.replace(s,i).replace(r,a).replace(/\n/g,"\\n")})),JSON.parse(n)}},69150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connection=t.connectionData=t.connectionDataEquals=t.connectionNodeEquals=t.connectionNode=t.externalConnectionNode=t.isInternalConnection=t.isExternalConnection=t.isInternalConnectionNode=t.isExternalConnectionNode=t.getNodeOutputs=t.getOutputName=t.getInputName=t.getNodeInputs=t.TRIGGER_PIN_ID=t.ERROR_PIN_ID=t.THIS_INS_ID=void 0;const o=n(30292);t.THIS_INS_ID="__this",t.ERROR_PIN_ID="__error",t.TRIGGER_PIN_ID="__trigger";t.getNodeInputs=e=>({...e.inputs,[t.TRIGGER_PIN_ID]:(0,o.nodeInput)()});t.getInputName=e=>e===t.TRIGGER_PIN_ID?"Trigger Node":e;t.getOutputName=e=>e===t.ERROR_PIN_ID?"Error":e;t.getNodeOutputs=e=>({...e.outputs,[t.ERROR_PIN_ID]:(0,o.nodeOutput)()});t.isExternalConnectionNode=e=>e&&e.insId===t.THIS_INS_ID;t.isInternalConnectionNode=e=>e.insId!==t.THIS_INS_ID;t.isExternalConnection=e=>{let{from:n,to:o}=e;return(0,t.isExternalConnectionNode)(n)||(0,t.isExternalConnectionNode)(o)};t.isInternalConnection=e=>!(0,t.isExternalConnection)(e);t.externalConnectionNode=e=>({insId:t.THIS_INS_ID,pinId:e});t.connectionNode=(e,t)=>({insId:e,pinId:t});t.connectionNodeEquals=(e,t)=>e.insId===t.insId&&e.pinId===t.pinId;t.connectionDataEquals=(e,n)=>!(!e||!n)&&((0,t.connectionNodeEquals)(e.from,n.from)&&(0,t.connectionNodeEquals)(e.to,n.to)),t.connectionData=function(e,n,o){const i="string"==typeof e?e.split("."):e,s="string"==typeof n?n.split("."):n;if(i.length>2||s.length>2)throw new Error(`invalid source or target to connection data - ${e} / ${n}`);return{from:2===i.length?(0,t.connectionNode)(i[0],i[1]):(0,t.externalConnectionNode)(i[0]),to:2===s.length?(0,t.connectionNode)(s[0],s[1]):(0,t.externalConnectionNode)(s[0]),delayed:o}};t.connection=function(e,t,n){return void 0===n&&(n=!1),{from:e,to:t,delayed:n}}},6775:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;const s=n(30292),r=n(47025),a=n(86873),u=n(69150);i(n(69150),t);t.connect=function(e,t,n,o,i,c,l,d){void 0===n&&(n={}),void 0===i&&(i={}),void 0===c&&(c=a.noop),void 0===l&&(l={}),void 0===d&&(d={});const{id:p,connections:f,instances:m}=e,g=p||"connected-node"+(0,a.randomInt)(999);return{inputs:e.inputs,outputs:e.outputs,id:g,completionOutputs:e.completionOutputs,reactiveInputs:e.reactiveInputs,run:(p,h)=>{let v=[];const y=new a.DepGraph({}),I=new Map,b=new Map,C=new Map,_=new Map,j=new Map,x=new Map;let N;const P=new Set;m.forEach((e=>{const n=(0,s.getNode)(e,t),o=e.id;I.set(e,o),b.set(o,e),y.addNode(o);const i=Object.keys(n.inputs),r=Object.keys(n.outputs),a={},c={};i.forEach((t=>{const n=(e.inputConfig||{})[t]||(0,s.queueInputPinConfig)();(0,s.isStaticInputPinConfig)(n)?a[t]=(0,s.staticNodeInput)(n.value):a[t]=(0,s.dynamicNodeInput)({config:n})})),a[u.TRIGGER_PIN_ID]=(0,s.dynamicNodeInput)({config:(0,s.queueInputPinConfig)()});if(f.some((t=>(0,u.isInternalConnectionNode)(t.to)&&t.to.insId===e.id&&t.to.pinId===u.TRIGGER_PIN_ID))&&e.inputConfig&&e.inputConfig[u.TRIGGER_PIN_ID])throw"Trigger connection can not be configured";r.forEach((e=>{const t=(0,s.dynamicOutput)();c[e]=t}));f.some((t=>(0,u.isInternalConnectionNode)(t.from)&&t.from.insId===e.id&&t.from.pinId===u.ERROR_PIN_ID))&&(c[u.ERROR_PIN_ID]=(0,s.dynamicOutput)()),C.set(o,a),_.set(o,c)}));const O=new Set;return f.forEach((n=>{const{from:o,to:i}=n,{insId:r,pinId:a}=o,{insId:c,pinId:l}=i,d=_.get(r),p=C.get(c);if((0,u.isInternalConnectionNode)(i)&&O.add(`${i.insId}.${i.pinId}`),(0,u.isExternalConnection)(n)){if((0,u.isExternalConnectionNode)(o)){const e=null==p?void 0:p[i.pinId];if(!e)throw new Error(`Input ${i.pinId} of instance ${c} not found`);const t=j.get(o.pinId)||[];t.push(e),j.set(o.pinId,t)}else{let e=null==d?void 0:d[o.pinId];if(!e)throw new Error(`Output ${o.pinId} of instance ${r} not found`);const t=x.get(i.pinId)||[];t.push(e),x.set(i.pinId,t)}return}if(!d)throw new Error(`No outputs found for instance [${r}]`);if(!p)throw b.has(c)?new Error(`No inputs found for instance [${c}]`):new Error(`Instance with id [${c}] does not exist!`);const f=d[a];if(!f)throw new Error(`Output source - [${a}] not found in node [${g}]`);const m=p[l],h=b.get(r);if(!h&&r!==u.THIS_INS_ID)throw new Error(`Instance [${r}] does not exist! failed to connect [${o}] -> [${i}]`);const I=(h?(0,s.getNode)(h,t):e).outputs[a];if(I&&I.delayed||n.delayed||r!==u.THIS_INS_ID&&c!==u.THIS_INS_ID&&y.addDependency(r,c),!m)throw new Error(`Target arg - [${i}] not found in node [${g}]`);const N=f.subscribe((async e=>{if(!(0,s.isDynamicInput)(m))throw console.info(m),new Error(`Impossible state listening to non dynamic input - ${c}.${l}`);m.subject.next(e)}));v.push((()=>N.unsubscribe()))})),(0,a.okeys)(h).forEach((e=>{(x.get(e)||[]).forEach((t=>{const n=t.subscribe((async t=>{if(!h[e])throw new Error(`Impossible state - output ${e} does not exist`);h[e].next(t)}));v.push((()=>n.unsubscribe()))}))})),y.overallOrder().map((e=>b.get(e))).forEach((e=>{const a=C.get(e.id),u=_.get(e.id),p=(0,s.getNode)(e,t);if(!a)throw new Error(`Unexpected error - args not found when running ${e}`);if(!u)throw new Error(`Unexpected error - outputs not found when running ${e}`);for(const t in a){const n=e.inputConfig[t];O.has(`${e.id}.${t}`)||(0,s.isStaticInputPinConfig)(n)||delete a[t]}const f=(0,r.execute)({node:p,inputs:a,outputs:u,resolvedDeps:t,_debugger:n,insId:e.id,extraContext:d,mainState:i,ancestorsInsIds:o,onBubbleError:c,onCompleted:()=>{return t=e.id,P.delete(t),void(0===P.size&&N&&N());var t},onStarted:()=>{return t=e.id,void P.add(t);var t},env:l});v.push(f)})),Object.keys(p).forEach((async e=>{(j.get(e)||[]).forEach((t=>{const n=p[e];if(!(0,s.isDynamicInput)(t))throw new Error(`Unsure what to do with key ${e}, input: ${t} of ins ${o}`);(0,a.isDefined)(n)&&t.subject.next(n)}))})),void 0===e.completionOutputs&&P.size>0?new Promise((e=>{N=e})):()=>v.forEach((e=>{try{e()}catch(t){console.error("error unsubscribing",t)}}))}}}},26488:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MINOR_DEBUGGER_EVENT_TYPES=t.MAJOR_DEBUGGER_EVENT_TYPES=t.DebuggerEventType=void 0,function(e){e.INPUT_CHANGE="i",e.OUTPUT_CHANGE="o",e.PROCESSING_CHANGE="pc",e.ERROR="err",e.INPUTS_STATE_CHANGE="isc"}(n=t.DebuggerEventType||(t.DebuggerEventType={})),t.MAJOR_DEBUGGER_EVENT_TYPES=[n.INPUT_CHANGE,n.OUTPUT_CHANGE,n.ERROR],t.MINOR_DEBUGGER_EVENT_TYPES=[n.PROCESSING_CHANGE,n.INPUTS_STATE_CHANGE]},43686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatEvent=void 0;const o=n(26488);t.formatEvent=function(e){var t,n,i;const s=[e.insId,...null!==(n=null===(t=e.ancestorsInsIds)||void 0===t?void 0:t.split("."))&&void 0!==n?n:[]];(null===(i=e.ancestorsInsIds)||void 0===i?void 0:i.length)>0&&e.ancestorsInsIds;const r=`Node <${e.nodeId}> `,a=`(${s.join(" -> ")})`;return`${r} - ${function(e){switch(e.type){case o.DebuggerEventType.PROCESSING_CHANGE:return e.val?"started processing":"stopped processing";case o.DebuggerEventType.INPUT_CHANGE:return`Input pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.OUTPUT_CHANGE:return`Output pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.INPUTS_STATE_CHANGE:return`Inputs queue size changed to ${Object.entries(e.val).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join(", ")}`;case o.DebuggerEventType.ERROR:return`Error: ${e.val}`}}(e)} ${a}`}},99896:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26488),t),i(n(43686),t)},47025:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.GLOBAL_STATE_NS=t.ROOT_INS_ID=t.INPUTS_STATE_SUFFIX=t.INNER_STATE_SUFFIX=void 0;const s=n(62600),r=n(87794);i(n(99896),t);const a=n(30292),u=n(6775),c=n(84479),l=n(86873),d=n(23046),p=n(30292),f=n(99896),m=n(79804);t.INNER_STATE_SUFFIX="_inner",t.INPUTS_STATE_SUFFIX="_inputs";t.ROOT_INS_ID="__root",t.GLOBAL_STATE_NS="____global";t.execute=e=>{let{node:n,inputs:o,outputs:i,resolvedDeps:g,_debugger:h={},insId:v=t.ROOT_INS_ID,extraContext:y={},mainState:I={},ancestorsInsIds:b,onBubbleError:C=s.noop,env:_={},onCompleted:j=s.noop,onStarted:x=s.noop}=e;const N=[];I[t.GLOBAL_STATE_NS]||(I[t.GLOBAL_STATE_NS]=new Map);const P={...y,ENV:_},O=(0,m.customNodesToNodesCollection)(g,P),w=e=>{const t=e instanceof a.NodeInstanceError?e:new a.NodeInstanceError(e,(0,l.fullInsIdPath)(v,b),n.id);h.onEvent&&h.onEvent({type:f.DebuggerEventType.ERROR,val:t,insId:v,ancestorsInsIds:b,nodeId:n.id}),i[u.ERROR_PIN_ID]?i[u.ERROR_PIN_ID].next(t):C(t)},E=(e=>(0,a.isVisualNode)(e)?(0,u.connect)(e,O,h,(0,l.fullInsIdPath)(v,b),I,w,_,y):(0,a.isInlineValueNode)(e)?(0,m.inlineValueNodeToNode)(e,P):e)(n),S=h.onEvent||s.noop,D={},M={};(0,l.entries)(o).forEach((e=>{let[t,o]=e;if((0,a.isDynamicInput)(o)){const e=(0,a.dynamicNodeInput)({config:o.config}),i=o.subject.subscribe((async o=>{const i=S({type:f.DebuggerEventType.INPUT_CHANGE,insId:v,pinId:t,val:o,ancestorsInsIds:b,nodeId:n.id});if(i){const t=await i.valuePromise;e.subject.next(t)}else h.debugDelay&&await(0,l.delay)(h.debugDelay),e.subject.next(o)}));N.push((()=>i.unsubscribe())),M[t]=e}else{S({type:f.DebuggerEventType.INPUT_CHANGE,insId:v,pinId:t,val:o.config.value,ancestorsInsIds:b,nodeId:n.id});const e=(0,a.staticNodeInput)((0,a.getStaticValue)(o.config.value,O,v));M[t]=e}})),(0,l.entries)(i).forEach((e=>{let[t,o]=e;const i=(0,a.dynamicOutput)(),s=i.subscribe((async e=>{const i=S({type:f.DebuggerEventType.OUTPUT_CHANGE,insId:v,pinId:t,val:e,ancestorsInsIds:b,nodeId:n.id});if(i){const e=await i.valuePromise;o.next(e)}else o.next(e)}));N.push((()=>s.unsubscribe())),D[t]=i}));const T=(e=>{var n,o;const{node:i,inputs:u,outputs:m,resolvedDeps:g,_debugger:h,insId:v,ancestorsInsIds:y,mainState:I,onError:b,onStarted:C,onCompleted:_,env:j,extraContext:x}=e,{run:N,fn:P}=i,O=(0,d.debugLogger)("core"),w=[];let E;const S=(null==h?void 0:h.onEvent)||s.noop,D=(0,l.fullInsIdPath)(v,y),M=`${D}${t.INNER_STATE_SUFFIX}`,T=`${D}${t.INPUTS_STATE_SUFFIX}`,k=O.extend(D),R=I[t.GLOBAL_STATE_NS];I[M]||(I[M]=new Map),I[T]||(I[T]=new Map);let A=null!==(n=I[T])&&void 0!==n?n:new Map;const V=()=>{const e=Array.from(A.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:(0,a.isQueueInputPinConfig)(u[n].config)?null==o?void 0:o.length:1}}),{});S({type:f.DebuggerEventType.INPUTS_STATE_CHANGE,val:e,insId:v,ancestorsInsIds:y,nodeId:i.id})},H={execute:(e,n,o,i)=>(0,t.execute)({node:e,inputs:n,outputs:o,resolvedDeps:g,_debugger:h,insId:i,onCompleted:_,onStarted:C}),insId:v,state:null!==(o=I[M])&&void 0!==o?o:new Map,onCleanup:e=>{w.push(e)},onError:e=>{b(e)},context:null!=x?x:{},ancestorsInsIds:y,globalState:R};let $,z=!1;const G=(i.reactiveInputs||[]).filter((e=>{var t;return!(0,p.isStaticInputPinConfig)(null===(t=u[e])||void 0===t?void 0:t.config)})),L=()=>{var e;null===(e=I[M])||void 0===e||e.clear(),(0,l.keys)(I).filter((e=>e.startsWith(`${D}.`))).forEach((e=>{I[e]=new Map}))},F=e=>{const t=(null==e?void 0:e.key)&&G.includes(null==e?void 0:e.key);if(z&&!t);else{const o=z&&t;if((0,c.isNodeStateValid)(u,A,i)||o){let t;if(z){if(!e)throw new Error("Unexpected state, got reactive node while not processing and not valid");const n=(0,c.pullValueForExecution)(e.key,u[e.key],A,j);t={...$,[e.key]:n},V()}else t=(0,c.pullValuesForExecution)(u,A,j),$=t,V();let o=new Set,s={};if(z=!0,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:v,ancestorsInsIds:y,nodeId:i.id}),i.completionOutputs){const e=i.completionOutputs.map((e=>e.split("+"))).reduce(((e,t)=>(t.forEach((n=>{e.set(n,t)})),e)),new Map);(0,l.entries)(m).forEach((t=>{let[n,a]=t;a.pipe((0,r.first)()).subscribe((t=>{o.add(n),s[n]=t;let r=e.get(n);r&&(r.splice(r.indexOf(n),1),0===r.length&&(z=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:v,ancestorsInsIds:y,nodeId:i.id}),_&&_(s),L(),(0,l.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),E=void 0,o.clear(),s={},(0,c.hasNewSignificantValues)(u,A,j,i.id)&&F()))}))}))}else(0,l.entries)(m).forEach((e=>{let[t,n]=e;n.subscribe((e=>{s[t]=e}))}));try{k("Running node %s with values %o",i.id,t),C&&C(),E=(null!=P?P:N)(t,m,H),(0,l.isPromise)(E)?E.then((()=>{void 0===i.completionOutputs&&_&&(z=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:v,ancestorsInsIds:y,nodeId:i.id}),_(s),L(),(0,c.hasNewSignificantValues)(u,A,j,i.id)&&F())})).catch((e=>{b(e),z=!1,k("Error in node %s - value %e",i.id,e),S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:v,ancestorsInsIds:y,nodeId:i.id})})):void 0===i.completionOutputs&&_&&(z=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:v,ancestorsInsIds:y,nodeId:i.id}),_(s),L())}catch(n){b(n),z=!1,k("Error in node %s - value %e",i.id,n),S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:v,ancestorsInsIds:y,nodeId:i.id})}const d=G.find((e=>u[e]&&(0,c.peekValueForExecution)(e,u[e],A,j,i.id)));if(d){const e=(0,c.peekValueForExecution)(d,u[d],A,j,i.id);F({key:d,value:e})}else{const e=(0,l.entries)(u).find((e=>{let[t,n]=e;const o=(0,a.isQueueInputPinConfig)(n.config),s=(0,c.peekValueForExecution)(t,n,A,j,i.id);return!!o&&(0,l.isDefined)(s)}));if(e){const[t,n]=e,o=(0,c.peekValueForExecution)(t,n,A,j,i.id);F({key:t,value:o})}}}}};F();const q=(0,c.subscribeInputsToState)(u,A,((e,t)=>{O("Got input %s - value is [%o]",e,t),V();try{F({key:e,value:t})}catch(n){b(n)}}));return w.push(q),()=>{(0,l.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),w.forEach((e=>e()))}})({node:E,inputs:M,outputs:D,resolvedDeps:O,_debugger:h,insId:v,mainState:I,ancestorsInsIds:b,onError:w,onBubbleError:C,env:_,extraContext:y,onCompleted:j,onStarted:x});return()=>{N.forEach((e=>e())),T()}}},84479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeInputsToState=t.isNodeStateValid=t.hasNewSignificantValues=t.peekValuesForExecution=t.pullValuesForExecution=t.pullValueForExecution=t.peekValueForExecution=void 0;const o=n(30292),i=n(86873),s=n(6775),r=(e,t)=>{const n=(0,o.extractStaticValue)(e);if((0,o.isEnvValue)(n)){return((e,t)=>{const n=e.split(".");let o={...t};for(let s of n){if(!o||!(0,i.isDefined)(o[s])||null===o[s])throw new Error(`Cannot find key ${e} inside obj ${t}`);o=o[s]}return o})((0,o.getEnvKeyFromValue)(n),t)}return n};t.peekValueForExecution=(e,t,n,i,s)=>{const a=n.get(e);let u;if(!t)throw new Error(`Trying to peek value of inexsting input in key "${e}" in node "${s}"`);return u=(0,o.isStaticInput)(t)?r(t,i):(0,o.isQueueInputPinConfig)(t.config)?a?[...a].shift():void 0:a,u};t.pullValueForExecution=(e,t,n,i)=>{const s=n.get(e);let a;return(0,o.isStaticInput)(t)?a=r(t,i):(0,o.isQueueInputPinConfig)(t.config)?(a=(s||[]).shift(),n.set(e,s)):(a=s,(0,o.isStickyInputPinConfig)(t.config)||n.delete(e)),a};t.pullValuesForExecution=(e,n,o)=>(0,i.entries)(e).reduce(((e,i)=>{let[s,r]=i;return e[s]=(0,t.pullValueForExecution)(s,r,n,o),e}),{});t.peekValuesForExecution=(e,n,o,s)=>(0,i.entries)(e).reduce(((e,i)=>{let[r,a]=i;return e[r]=(0,t.peekValueForExecution)(r,a,n,o,s),e}),{});t.hasNewSignificantValues=(e,n,s,r)=>(0,i.entries)(e).some((e=>{let[a,u]=e;const c=(0,o.isQueueInputPinConfig)(u.config),l=(0,t.peekValueForExecution)(a,u,n,s,r);return(0,i.isDefined)(l)&&c}));t.isNodeStateValid=(e,t,n)=>{const r=(0,i.keys)(e),a=(0,i.keys)(n.inputs).filter((e=>{var t;const o=null===(t=n.inputs[e])||void 0===t?void 0:t.mode;return!o||"required"===o}));r.includes(s.TRIGGER_PIN_ID)&&a.push(s.TRIGGER_PIN_ID);return!!(0,i.containsAll)(r,a)&&(0,i.entries)(e).filter((e=>{let[t]=e;return!!n.inputs[t]||t===s.TRIGGER_PIN_ID})).every((e=>{let[s,r]=e;var a;const u=t.get(s);return"optional"===((null===(a=n.inputs[s])||void 0===a?void 0:a.mode)||"required")||(!!(0,o.isStaticInput)(r)||((0,o.isQueueInputPinConfig)(r.config)?(0,i.isDefined)(u)&&u.length>0:(0,i.isDefined)(u)))}))};t.subscribeInputsToState=(e,t,n)=>{const s=[];return(0,i.entries)(e).forEach((e=>{let[i,r]=e;if(!r)return;if((0,o.isStaticInput)(r))return;const a=r.subject.subscribe((e=>{if((0,o.isQueueInputPinConfig)(r.config)){const o=t.get(i)||[];if(!Array.isArray(o))throw new Error(`impossible state - state of key ${i} is set but not an array`);o.push(e),t.set(i,o),n(i,e)}else t.set(i,e),n(i,e)}));s.push((()=>a.unsubscribe()))})),()=>s.forEach((e=>e()))}},5474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flydeFlowSchema=void 0;const o=n(29022),i=o.z.record(o.z.string(),o.z.string().or(o.z.array(o.z.string()))),s=o.z.strictObject({x:o.z.number(),y:o.z.number()}),r=o.z.discriminatedUnion("mode",[o.z.strictObject({mode:o.z.literal("static"),value:o.z.any()}),o.z.strictObject({mode:o.z.literal("queue")}),o.z.strictObject({mode:o.z.literal("sticky")})]),a=o.z.object({size:o.z.optional(o.z.enum(["small","regular","large"])),icon:o.z.optional(o.z.any()),color:o.z.optional(o.z.string()),cssOverride:o.z.optional(o.z.record(o.z.string()))}),u=o.z.object({pos:s.default({x:0,y:0}),id:o.z.string(),inputConfig:o.z.optional(o.z.record(o.z.string(),r)).default({}),visibleInputs:o.z.optional(o.z.array(o.z.string())),visibleOutputs:o.z.optional(o.z.array(o.z.string())),nodeId:o.z.optional(o.z.string()),node:o.z.optional(o.z.any()),style:o.z.optional(a)}).refine((e=>e.node||e.nodeId),{message:"Instance must have either an inline node or refer to a nodeId"}),c=o.z.union([o.z.string(),o.z.object({mode:o.z.enum(["required","optional","required-if-connected"]),type:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),defaultValue:o.z.optional(o.z.any())})]),l=o.z.object({type:o.z.optional(o.z.string()),optional:o.z.optional(o.z.boolean()),delayed:o.z.optional(o.z.boolean()),description:o.z.optional(o.z.string())}),d=o.z.object({id:o.z.optional(o.z.string()),inputs:o.z.record(o.z.string(),c),outputs:o.z.record(o.z.string(),l),inputsPosition:o.z.optional(o.z.record(o.z.string(),s)),outputsPosition:o.z.optional(o.z.record(o.z.string(),s)),customViewCode:o.z.optional(o.z.string()),dataBuilderSource:o.z.optional(o.z.string()),templateType:o.z.optional(o.z.string()),completionOutputs:o.z.optional(o.z.array(o.z.string())),reactiveInputs:o.z.optional(o.z.array(o.z.string())),defaultStyle:o.z.optional(a),description:o.z.optional(o.z.string()),searchKeywords:o.z.optional(o.z.array(o.z.string()))}),p=o.z.object({instances:o.z.array(u),connections:o.z.array(o.z.strictObject({from:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),to:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),delayed:o.z.optional(o.z.boolean()),hidden:o.z.optional(o.z.boolean())}))}).and(d);t.flydeFlowSchema=o.z.strictObject({imports:o.z.optional(i).default({}),node:p})},74762:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticValueVisualNode=void 0,i(n(86873),t);const s=n(30292);i(n(6775),t),i(n(47025),t),i(n(10418),t),i(n(30292),t),i(n(3320),t),i(n(79804),t),i(n(5474),t);t.isStaticValueVisualNode=e=>!!e&&!!(0,s.maybeGetStaticValueNodeId)(`${e}`)},87093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fakeVm=t.VM=t.VMScript=void 0;const o=n(86873);class i{constructor(e){this.script=e}}t.VMScript=i;class s{constructor(e){this.context=e}run(e){const t=(0,o.okeys)(this.context.sandbox),n=Object.values(this.context.sandbox);Function(...t,e.script)(...n)}}t.VM=s,t.fakeVm={VMScript:i,VM:s}},28145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVM2Instance=void 0;const o=n(87093);t.getVM2Instance=()=>o.fakeVm},79804:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.customNodesToNodesCollection=t.inlineValueNodeToNode=void 0;const i=o(n(18706)),s=n(86873),r=n(30292),a=(0,n(28145).getVM2Instance)();t.inlineValueNodeToNode=function(e,t){void 0===t&&(t={});const{runFnRawCode:n,...o}=e,u=(0,s.debugLogger)(`code-node:${e.id}`),c=`\n try {\n ${n}\n } catch (e) {\n adv.onError(e);\n }\n `,l=new a.VMScript(c),d={...o,run:(n,o,c)=>{const d=new a.VM({sandbox:{inputs:n,outputs:o,setInterval:setInterval,clearInterval:clearInterval,setTimeout:setTimeout,clearTimeout:clearTimeout,encodeURIComponent:encodeURIComponent,adv:c,log:function(){for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeWithDependencies=void 0;const o=n(30292),i=n(74762),s=n(88270);t.getNodeWithDependencies=function(e,n,r){if(void 0===r&&(r=[]),(0,o.isInlineValueNode)(e))return[e];if(r.includes(e.id))return[];const a=(0,i.removeDupes)(e.instances.filter((e=>(0,s.isRefNodeInstance)(e))).map((e=>e.nodeId)).filter((e=>n[e])));return[e,...a.flatMap((e=>{var t;return null!==(t=n[e])&&void 0!==t?t:[]})).reduce(((e,o)=>[...e,...(0,t.getNodeWithDependencies)(o,n,[...r,...a])]),[])]}},30292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88270),t),i(n(43069),t),i(n(79426),t),i(n(44535),t),i(n(18063),t),i(n(20359),t)},18063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeInstanceError=void 0;class n extends Error{constructor(e,t,n){let o="Unknown error";o="string"==typeof e?e:e instanceof Error?e.message:null!==e&&"object"==typeof e?JSON.stringify(e):String(e),super(`${o} (insId: ${t}, nodeId: ${n})`),this.name=this.constructor.name,this.message=`${o} (insId: ${t}, nodeId: ${n})`,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.fullInsIdsPath=t,this.nodeId=n}}t.NodeInstanceError=n},88270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInsId=t.NodeInstance=t.isRefNodeInstance=t.isInlineNodeInstance=t.inlineNodeInstance=t.nodeInstance=void 0;const o=n(36618);t.nodeInstance=(e,t,n,o)=>({id:e,nodeId:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.inlineNodeInstance=(e,t,n,o)=>({id:e,node:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.isInlineNodeInstance=e=>!!e.node;t.isRefNodeInstance=e=>!(0,t.isInlineNodeInstance)(e);t.NodeInstance=(e,t,n,o)=>({id:e,nodeId:t.id,inputConfig:n||{},pos:o||{x:0,y:0}});t.createInsId=e=>`${e.id}-${(0,o.slug)()}`},43069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvKeyFromValue=t.toEnvValue=t.isEnvValue=t.extractStaticValue=t.isStaticInput=t.isDynamicInput=t.staticNodeInput=t.dynamicNodeInputs=t.dynamicNodeInput=t.dynamicOutput=t.nodeOutputs=t.nodeOutput=t.nodeInputs=t.isInputPinOptional=t.nodeInput=void 0;const o=n(62600),i=n(30292),s=n(86873),r=n(79426);t.nodeInput=function(e){return void 0===e&&(e="required"),{mode:e}};t.isInputPinOptional=e=>"optional"===e.mode;t.nodeInputs=(e,n)=>(0,s.repeat)(e,(e=>(0,t.nodeInput)((null==n?void 0:n[e])||"required")));t.nodeOutput=function(e){return void 0===e&&(e=!1),{delayed:e}};t.nodeOutputs=e=>(0,s.repeat)(e,(()=>(0,t.nodeOutput)()));t.dynamicOutput=()=>new o.Subject,t.dynamicNodeInput=(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})));t.dynamicNodeInputs=function(e){return void 0===e&&(e=10),(0,s.repeat)(e,(()=>(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})))()))};t.staticNodeInput=e=>({config:(0,r.staticInputPinConfig)(e)});t.isDynamicInput=e=>{const t=e;return t&&t.subject&&!!t.subject.next};t.isStaticInput=e=>(0,i.isStaticInputPinConfig)(null==e?void 0:e.config);t.extractStaticValue=e=>{if((0,t.isStaticInput)(e))return e.config.value;throw new Error("Cannot extract static value from non static arg")};t.isEnvValue=e=>"string"==typeof e&&e.startsWith("$ENV.");t.toEnvValue=e=>`$ENV.${e}`;t.getEnvKeyFromValue=e=>"string"==typeof e?e.replace(/^\$ENV\./,""):e},20359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeFromFunction=t.getNodeDef=t.getNode=t.getStaticValue=t.maybeGetStaticValueNodeId=t.fromSimplified=t.inlineValueNode=t.codeNode=t.visualNode=t.isInlineValueNode=t.isVisualNode=t.isCodeNode=t.isBaseNode=t.InlineValueNodeType=void 0;const o=n(86873),i=n(88270),s=n(43069);!function(e){e.VALUE="value",e.FUNCTION="function"}(t.InlineValueNodeType||(t.InlineValueNodeType={}));t.isBaseNode=e=>e&&e.id&&e.inputs&&e.outputs;t.isCodeNode=e=>(0,t.isBaseNode)(e)&&"function"==typeof e.run;t.isVisualNode=e=>!!e.instances;t.isInlineValueNode=e=>(0,o.isDefined)(e)&&(0,o.isDefined)(e.runFnRawCode),t.visualNode=(0,o.testDataCreator)({id:"visual-node",inputs:{},outputs:{},instances:[],connections:[],outputsPosition:{},inputsPosition:{}}),t.codeNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},run:o.noop}),t.inlineValueNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},runFnRawCode:""});t.fromSimplified=e=>{let{run:t,inputTypes:n,outputTypes:i,id:s}=e;return{id:s,inputs:(0,o.entries)(n).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),outputs:(0,o.entries)(i).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),run:t}};t.maybeGetStaticValueNodeId=e=>{const t="string"==typeof e&&e.match(/^__node\:(.*)/);if(t){return t[1]}return null};t.getStaticValue=(e,n,o)=>{const i=(0,t.maybeGetStaticValueNodeId)(e);if(i){const e=n[i];if(!e)throw new Error(`Instance ${o} referrer to a node reference ${i} that does not exist`);return e}return e};t.getNode=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw new Error(`Node with id ${n} not found`);return o};t.getNodeDef=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw console.error(`Node with id ${n} not found`),new Error(`Node with id ${n} not found`);return o};t.codeFromFunction=e=>{let{id:t,fn:n,inputNames:o,outputName:i,defaultStyle:r}=e;return{id:t,inputs:o.reduce(((e,t)=>({...e,[t]:(0,s.nodeInput)()})),{}),outputs:{[i]:(0,s.nodeOutput)()},run:(e,t)=>{const s=o.map((t=>e[t])),r=t[i],a=n(...s);return Promise.resolve(a).then((e=>null==r?void 0:r.next(e)))},completionOutputs:[i],defaultStyle:r}}},44535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nodeFromSimpleFunction=void 0,t.nodeFromSimpleFunction=function(e){var t;return{...e,id:e.id,description:e.description,namespace:e.namespace,inputs:e.inputs?e.inputs.reduce(((e,t)=>{let{name:n,description:o,mode:i,defaultValue:s}=t;return{...e,[n]:{description:o,mode:null!=i?i:"required",defaultValue:s}}}),{}):{},outputs:e.output?{[e.output.name]:{description:e.output.description}}:{},defaultStyle:{icon:e.icon,size:e.size},run:null!==(t=e.fullRunFn)&&void 0!==t?t:async function(t,n,o){var i,s;const r=(null!==(i=e.inputs)&&void 0!==i?i:[]).map((e=>{let{name:n}=e;return t[n]}));try{const t=await Promise.resolve(e.run(...r));e.output&&(null===(s=n[e.output.name])||void 0===s||s.next(t))}catch(a){console.error("Error in node",a),o.onError(a)}},customViewCode:e.customViewCode}}},79426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticInputPinConfig=t.isStickyInputPinConfig=t.isQueueInputPinConfig=t.staticInputPinConfig=t.stickyInputPinConfig=t.queueInputPinConfig=t.INPUT_MODES=void 0,t.INPUT_MODES=["queue","sticky","static"];t.queueInputPinConfig=()=>({mode:"queue"});t.stickyInputPinConfig=()=>({mode:"sticky"});t.staticInputPinConfig=e=>({mode:"static",value:e});t.isQueueInputPinConfig=e=>"queue"===e.mode;t.isStickyInputPinConfig=e=>!!e&&"sticky"===e.mode,t.isStaticInputPinConfig=function(e){return!!e&&"static"===e.mode}},10418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedExecute=void 0;const o=n(74762),i=n(47025);t.simplifiedExecute=function(e,t,n,s,r){void 0===r&&(r={});const a=(0,o.keys)(e.outputs),u=Object.keys(n).reduce(((e,t)=>{const i=n[t];return{...e,[t]:(0,o.isDynamicInput)(i)?i:(0,o.staticNodeInput)(i)}}),{}),c=a.reduce(((e,t)=>{const n=(0,o.dynamicOutput)();return s&&n.subscribe((e=>{s(t,e)})),{...e,[t]:n}}),{});return(0,i.execute)({node:e,inputs:u,outputs:c,resolvedDeps:t,onBubbleError:e=>{throw e},...r})}},25779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodePreview=void 0;const o=n(35250),i=n(74762),s=n(86553);t.NodePreview=e=>{let{node:t}=e;const n={node:t,instance:(0,i.nodeInstance)("bob",t.id,{}),connections:[],viewPort:{pos:{x:0,y:0},zoom:1},resolvedDeps:{},connectionsPerInput:{},onUngroup:i.noop,onDblClick:i.noop,onDragEnd:i.noop,onDragMove:i.noop,onDragStart:i.noop,onPinClick:i.noop,onPinDblClick:i.noop,onSelect:i.noop,onTogglePinBreakpoint:i.noop,onTogglePinLog:i.noop,onToggleSticky:i.noop,displayMode:!0,onInspectPin:i.noop,onDetachConstValue:i.noop,onCopyConstValue:i.noop,onPasteConstValue:i.noop,ancestorsInsIds:"",onChangeVisibleInputs:i.noop,onChangeVisibleOutputs:i.noop,onConvertConstToEnv:i.noop,forceShowMinimized:"both",onExtractInlineNode:i.noop,onCloseInlineEditor:i.noop,isConnectedInstanceSelected:!1,inlineEditorPortalDomNode:null,onChangeStyle:i.noop,onDeleteInstance:i.noop,onGroupSelected:i.noop,onSetDisplayName:i.noop,hadError:!1,queuedInputsData:{},onPinMouseDown:i.noop,onPinMouseUp:i.noop};return(0,o.jsx)("div",{className:"node-preview",children:(0,o.jsx)(s.InstanceView,{...n})})}},30653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDarkMode=t.DarkModeProvider=void 0;const o=n(70079),i=(0,o.createContext)(!0);t.DarkModeProvider=i.Provider;t.useDarkMode=()=>(0,o.useContext)(i)},29183:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataInspectionModal=void 0;const a=n(35250),u=n(50382),c=r(n(26372)),l=s(n(70079)),d=n(74089),p=n(83938),f=n(17102),m=n(98158);t.DataInspectionModal=e=>{var t;const{onRequestHistory:n}=(0,m.useDebuggerContext)(),{item:o}=e,[i,s]=l.default.useState(),[r,g]=l.default.useState(0),[h,v]=l.default.useState(""),[y,I]=l.default.useState(),[b]=(0,d.useDebounce)(h,300);(0,l.useEffect)((()=>{I(null==i?void 0:i.lastSamples.filter((e=>"object"==typeof e.val?JSON.stringify(e.val).includes(b):e.val.toString().includes(b)))),g(0)}),[null==i?void 0:i.lastSamples,b]),l.default.useEffect((()=>{!async function(){var e,t;const i=await n(o.insId,null===(e=o.pin)||void 0===e?void 0:e.id,null===(t=o.pin)||void 0===t?void 0:t.type);s(i)}()}),[o,n]);const C=e=>{const t=e.val;return"object"==typeof t?(0,a.jsx)(p.BrowserOnlyReactJson,{src:t}):(0,a.jsx)(u.Code,{children:t.toString()})},_=`"${o.insId}" ${(null===(t=o.pin)||void 0===t?void 0:t.id)?`(${o.pin.id})`:""}`;return(0,a.jsx)(u.Dialog,{isOpen:!0,title:`Inspecting data for instance ${_}`,onClose:e.onClose,canEscapeKeyClose:!1,className:"data-inspection-modal",children:(0,a.jsx)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{children:[i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("em",{children:[_," called ",i.total," time(s)"]}),i.total>10&&(0,a.jsx)("span",{children:"Showing last 10 samples"})]}):null,(0,a.jsx)("input",{className:"bp5-input bp5-small bp5-fill",type:"search",placeholder:"Search for values",dir:"auto",onChange:e=>v(e.target.value),value:h}),b.length>0&&(0,a.jsxs)("span",{children:["Showing ",null==y?void 0:y.length," of ",i.lastSamples.length," ",'samples matching query "',b,'"']})]}),(0,a.jsx)("main",{className:"main-wrapper",children:(()=>{if(!i)return(0,a.jsx)(f.Loader,{});if(0===i.total)return(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",(0,a.jsx)("em",{children:o.insId})," ",o.pin?(0,a.jsxs)(l.default.Fragment,{children:["and pin ",(0,a.jsx)("em",{children:o.pin.id})]}):null,". Make sure debugger is running and your program was triggered."]});const e=null==y?void 0:y[r];return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Card,{className:"content-wrapper",children:[e?(0,a.jsxs)("div",{className:"info",children:[(0,a.jsxs)("div",{children:["Showing sample ",r," of event from"," ",(0,a.jsx)("strong",{children:(0,d.timeAgo)(e.time)})," (",new Date(e.time).toLocaleString(),")"]}),(0,a.jsxs)("div",{children:["Instance: ",(0,a.jsx)("strong",{children:e.insId}),", Pin id:"," ",(0,a.jsx)("strong",{children:e.pinId})," "]}),(0,a.jsx)("div",{children:"Value:"})]}):null,C(e)]}),(0,a.jsx)(u.Menu,{className:"samples-menu",children:y.map(((e,t)=>{const n=e.pinId,o=`${i.total-t}. from pin "${n}"`;return(0,a.jsx)(u.MenuItem,{text:o,onClick:()=>g(t)},t)}))})]}):i.lastSamples.length>0&&h.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",children:['No data found for search query "',h,'"']}):(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",o.insId," ",o.pin?`and ${o.pin.id}`:"",". Make sure a debugger is connected and your program was triggered."]})})()})]})})})}},40471:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29183),t)},98158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebuggerContext=t.DebuggerContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({onRequestHistory:()=>Promise.reject(new Error("Not implemented"))});t.DebuggerContextProvider=i.Provider;t.useDebuggerContext=()=>(0,o.useContext)(i)},86125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDependenciesContext=t.DependenciesContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({resolvedDependencies:{},onImportNode:()=>Promise.reject(new Error("Not implemented")),onRequestImportables:()=>Promise.reject(new Error("Not implemented"))});t.DependenciesContextProvider=i.Provider;t.useDependenciesContext=()=>(0,o.useContext)(i)},97106:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FlowEditor=void 0;const u=n(35250),c=s(n(70079)),l=n(74762),d=n(63521),p=a(n(53865)),f=n(68120),m=n(7047),g=n(84472),h=n(82232),v=n(49283),y=n(43490),I=n(68840),b=n(78087),C=n(20079),_=n(60190),j=n(40471),x=n(98158),N=n(86125),P=n(30653),O=n(77852);r(n(43490),t),r(n(98158),t),r(n(86125),t),I.library.add(b.fab,C.fas);const w=["select","drag-move","order-step"];t.FlowEditor=c.memo(c.forwardRef(((e,t)=>{const{state:n,onChangeEditorState:o}=e,{resolvedDependencies:i,onImportNode:s}=(0,N.useDependenciesContext)(),[r,a]=c.useState([]),[I,b]=c.useState([]),{flow:C,boardData:E}=n,S=n.flow.node,[D,M]=c.useState({}),[T,k]=c.useState(new Set),{debuggerClient:R}=(0,x.useDebuggerContext)();c.useEffect((()=>{if(R)return R.onBatchedEvents((e=>{e.forEach((e=>{e.type===l.DebuggerEventType.INPUTS_STATE_CHANGE&&(console.log("INPUTS_STATE_CHANGE",e.insId,e.val),M((t=>({...t,[e.insId]:e.val})))),e.type===l.DebuggerEventType.ERROR&&k((t=>{const n=new Set(t);return n.add(e.insId),n}))}))}))}),[R]);const{openFile:A,reportEvent:V}=(0,y.usePorts)(),H=c.useCallback(((e,t)=>{console.info("onChangeFlow",t.type),"functional"===t.type&&(a([{flow:{...n.flow,...e}},...r.slice(0,50)]),b([])),o((t=>({...t,flow:{...t.flow,...e}})))}),[o,n.flow,r]),[$,z]=c.useState({instances:[],connections:[]}),[G,L]=c.useState(!1),F=c.useCallback((()=>L(!1)),[]),q=c.useCallback((()=>L(!0)),[]),U=c.useCallback((e=>{o((t=>({...t,boardData:{...t.boardData,...e}})))}),[o]);c.useEffect((()=>{U({selected:[],viewPort:d.defaultViewPort,from:void 0,to:void 0,lastMousePos:{x:0,y:0}})}),[S.id]),(0,f.useHotkeys)("cmd+z",(e=>{b([...I,n]);const[t,...i]=r;t&&(o((e=>({...e,...t}))),a(i)),e.preventDefault()}),{text:"Undo last change",group:"Editing"},[n,r,I]);const B=c.useCallback(((e,t)=>{w.some((e=>t.message.includes(e)))||b([]),H({node:e},t)}),[H]),W=c.useCallback((e=>{A({absPath:e.source.path})}),[A]),J=c.useCallback((function(e,t){void 0===t&&(t=-1*d.NODE_HEIGHT*1.5);const n=(0,m.createNewNodeInstance)(e,t,E.lastMousePos,i);if(n){const e=(0,p.default)(C,(e=>{const t=e.node;if(!(0,l.isVisualNode)(t))throw new Error("Impossible state, adding node to non visual node");t.instances.push(n)}));return H(e,(0,h.functionalChange)("add-node")),F(),n}}),[E.lastMousePos,C,H,F,i]),Z=c.useCallback((async e=>{switch(e.type){case v.OmniBarCmdType.ADD:return V("addNode",{nodeId:e.data,source:"omnibar"}),J(e.data);case v.OmniBarCmdType.ADD_VALUE:{const e=t.current;null==e||e.requestNewInlineValue();break}case v.OmniBarCmdType.IMPORT:{await s(e.data,{pos:E.lastMousePos});const t=(0,_.vAdd)({x:0,y:0},E.lastMousePos),n=(0,m.createNewNodeInstance)(e.data.node,0,t,i),o=(0,p.default)(C,(e=>{e.node.instances.push(n)}));H(o,(0,h.functionalChange)("add-imported-node")),V("addNode",{nodeId:e.data.node.id,source:"omnibar"});break}default:g.AppToaster.show({intent:"warning",message:"Not supported yet"})}F()}),[F,V,J,t,s,E.lastMousePos,i,C,H]),[Y,K]=c.useState(),Q=c.useCallback((()=>K(void 0)),[]),X=c.useCallback(((e,t)=>{K({insId:e,pin:t})}),[]),{isDarkMode:ee}=(0,O.useDarkMode)();return(0,u.jsx)("div",{className:"flyde-flow-editor",children:(()=>{var n;if((0,l.isInlineValueNode)(S))throw new Error("Impossible state");return(0,u.jsx)(P.DarkModeProvider,{value:null!==(n=e.darkMode)&&void 0!==n?n:ee,children:(0,u.jsxs)(c.Fragment,{children:[Y?(0,u.jsx)(j.DataInspectionModal,{item:Y,onClose:Q}):null,(0,u.jsx)(d.VisualNodeEditor,{currentInsId:l.ROOT_INS_ID,ref:t,boardData:E,onChangeBoardData:U,node:S,onGoToNodeDef:W,onChangeNode:B,resolvedDependencies:i,clipboardData:$,onCopy:z,nodeIoEditable:!S.id.startsWith("Trigger"),onInspectPin:X,onShowOmnibar:q,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:D,initialPadding:e.initialPadding,instancesWithErrors:T,disableScrolling:e.disableScrolling},S.id),G?(0,u.jsx)(v.Omnibar,{flow:C,resolvedNodes:i,onCommand:Z,visible:G,onClose:F}):null]})})})()})})))},9001:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeEditor=t.renderCreateIOOption=void 0;const i=n(35250),s=o(n(70079)),r=n(74762),a=n(50382),u=o(n(53865)),c=n(70457),l=n(25779);t.renderCreateIOOption=(e,t,n)=>(0,i.jsx)(a.MenuItem,{icon:"add",text:`Create "${e}"`,active:t,onClick:n,shouldDismissPopover:!1});const d=c.MultiSelect.ofType();t.BaseNodeEditor=e=>{var n,o;const{node:c,onChange:p}=e,f=(0,r.entries)(c.inputs),m=f.filter((e=>{let[,t]=e;return"required"===t.mode})).map((e=>{let[t]=e;return t})),g=f.filter((e=>{let[,t]=e;return"optional"===t.mode})).map((e=>{let[t]=e;return t})),h=f.filter((e=>{let[,t]=e;return"required-if-connected"===t.mode})).map((e=>{let[t]=e;return t})),[v,y]=s.default.useState(!1),I=(0,r.okeys)(c.outputs),b=s.default.useCallback((e=>{p({...c,id:e})}),[c,p]),C=s.default.useCallback((e=>{let t=e?e.split(","):void 0;"[]"===e&&(t=[]),p({...c,completionOutputs:t})}),[c,p]),_=s.default.useCallback((e=>{let t=e?e.split(","):void 0;p({...c,reactiveInputs:t})}),[c,p]),j=s.default.useCallback(((e,t)=>{const n=(0,u.default)(c,(n=>{n.inputs[e]=(0,r.nodeInput)(t)}));p(n)}),[c,p]),x=s.default.useCallback((e=>{const t=(0,u.default)(c,(t=>{delete t.inputs[e]}));p(t)}),[c,p]),N=s.default.useCallback((e=>{const t=(0,u.default)(c,(t=>{t.outputs[e]=(0,r.nodeOutput)()}));p(t)}),[c,p]),P=s.default.useCallback((e=>{const t=(0,u.default)(c,(t=>{delete t.outputs[e]}));p(t)}),[c,p]);return(0,i.jsxs)("div",{className:"base-node-editor",children:[(0,i.jsx)("div",{className:"form-row",children:(0,i.jsx)(a.FormGroup,{label:"Node Name",labelFor:"text-input",labelInfo:"(required)",children:(0,i.jsx)(a.InputGroup,{id:"node-name",disabled:e.idDisabled,placeholder:"Node ID",value:c.id,onChange:e=>b(e.target.value)})})}),(0,i.jsx)(a.FormGroup,{label:"Required Inputs",children:(0,i.jsx)(d,{selectedItems:m,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>j(e,"required"),onRemove:x,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),!0!==e.hiddenOutputs?(0,i.jsx)(a.FormGroup,{label:"Outputs",children:(0,i.jsx)(d,{selectedItems:I,placeholder:"Enter output names here",items:[],tagRenderer:e=>e,onItemSelect:N,onRemove:P,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}):null,(0,i.jsx)(a.Checkbox,{checked:v,onChange:e=>y(e.target.checked),children:"Show advanced options"}),(0,i.jsxs)(a.Collapse,{isOpen:v,children:[(0,i.jsx)(a.FormGroup,{label:"Optional Inputs",children:(0,i.jsx)(d,{selectedItems:g,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>j(e,"optional"),onRemove:x,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Required-if-connected Inputs",children:(0,i.jsx)(d,{selectedItems:h,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>j(e,"required-if-connected"),onRemove:x,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Completion Outputs",children:(0,i.jsx)(a.InputGroup,{id:"completion-outputs",placeholder:"completion outputs",value:(null===(n=c.completionOutputs)||void 0===n?void 0:n.join(","))||"",onChange:e=>C(e.target.value)})}),(0,i.jsx)(a.FormGroup,{label:"Reactive Inputs",children:(0,i.jsx)(a.InputGroup,{id:"reactive-inputs",placeholder:"Reactive inputs",value:(null===(o=c.reactiveInputs)||void 0===o?void 0:o.join(","))||"",onChange:e=>_(e.target.value)})})]}),(0,i.jsx)(a.FormGroup,{label:"Preview",children:(0,i.jsx)("div",{className:"preview-wrapper",children:(0,i.jsx)(l.NodePreview,{node:c})})})]})}},82232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metaChange=t.functionalChange=void 0;t.functionalChange=e=>({type:"functional",message:e});t.metaChange=function(e){return void 0===e&&(e="n/a"),{type:"meta",message:e}}},41032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safelyGetNodeDef=t.loadingDef=void 0;const o=n(74762);t.loadingDef={id:"Loading",inputs:{},outputs:{}};t.safelyGetNodeDef=(e,n)=>{try{return(0,o.getNodeDef)(e,n)}catch(i){const n="string"==typeof e?e:e.nodeId;return{...t.loadingDef,id:n}}}},72125:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCodeModal=void 0;const a=n(35250),u=s(n(70079)),c=r(n(51848)),l=n(50382),d=r(n(26372)),p=n(68371),f=n(74762),m=n(31745),g="`Result is ${inputs.a + inputs.b}`";t.InlineCodeModal=u.memo((function(e){const{initialValue:t,initialType:n}=e,[o,i]=u.useState((0,f.isDefined)(t)?t:g),[s,r]=u.useState(n||f.InlineValueNodeType.VALUE),h=(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:['You can add variables to by referrencing the "inputs" object.',(0,a.jsx)("br",{})," For example:",(0,a.jsx)(l.Code,{children:"`Hello {inputs.name}`"}),' will expose an input pin named "name"']}),(0,a.jsxs)("p",{children:["You can also use ternery expressions, arithmetic operators and more!",(0,a.jsx)("br",{}),"For example:",(0,a.jsx)(l.Code,{children:"inputs.a > inputs.b ? inputs.a + 42 : Math.random() * inputs.b"})]})]}),v=(0,a.jsxs)("span",{children:["Type in any valid JS value, such as ",(0,a.jsx)(l.Code,{children:"true"}),", ",(0,a.jsx)(l.Code,{children:"42"}),","," ",(0,a.jsx)(l.Code,{children:'["bob", "alice", "dave"]'}),".",(0,a.jsx)("br",{})," Dynamic inputs may also be used"]}),y=(0,a.jsxs)("span",{children:["Write any JS code and return a value.",(0,a.jsx)("br",{})," The returned value will be the output.",(0,a.jsx)("br",{})," Example:",(0,a.jsx)(l.Code,{children:"const a = inputs.a; const b = inputs.b; return Math.floor(a/b);"})]}),I=(0,p.getVariables)(o);return u.useEffect((()=>{o===g&&s===f.InlineValueNodeType.FUNCTION&&i(`return ${g}`),o===`return ${g}`&&s===f.InlineValueNodeType.VALUE&&i(g)}),[o,s]),(0,a.jsxs)(l.Dialog,{isOpen:!0,title:"Inline Value / Code",onClose:e.onCancel,className:"inline-code-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(l.Classes.DIALOG_BODY),onKeyDown:t=>{"Enter"===t.key&&t.metaKey&&e.onSubmit(s,o)},tabIndex:0,children:[(0,a.jsxs)(l.RadioGroup,{inline:!0,onChange:e=>r(e.target.value),selectedValue:s,children:[(0,a.jsx)(l.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Value ",(0,a.jsx)(m.InfoTooltip,{content:v})]}),value:f.InlineValueNodeType.VALUE}),(0,a.jsx)(l.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Function ",(0,a.jsx)(m.InfoTooltip,{content:y})]}),value:f.InlineValueNodeType.FUNCTION})]}),(0,a.jsx)(c.default,{height:"80px",theme:"vs-dark",defaultLanguage:"javascript",value:o,onChange:e=>i(e||""),onMount:e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})}}),(()=>{const e=o.includes("return");return e&&s===f.InlineValueNodeType.VALUE?(0,a.jsx)(l.Callout,{intent:l.Intent.WARNING,children:'When using the "value" type you are not expected to return anything'}):e||s!==f.InlineValueNodeType.FUNCTION?null:(0,a.jsxs)(l.Callout,{intent:l.Intent.DANGER,children:['When using the "function" type you are expected to'," ",(0,a.jsx)(l.Code,{children:"return"})," a value.",(0,a.jsx)("br",{}),"Example: ",(0,a.jsx)(l.Code,{children:"return 42 + Date.now();"})]})})(),(0,a.jsxs)(l.Callout,{intent:l.Intent.NONE,children:["Input pins detected:"," ",I.length?I.map((e=>(0,a.jsx)(l.Code,{children:e},e))):"None",(0,a.jsx)(m.InfoTooltip,{content:h})]})]}),(0,a.jsx)("div",{className:l.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:l.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(l.Button,{onClick:e.onCancel,children:"Cancel"}),(0,a.jsx)(l.Button,{onClick:()=>e.onSubmit(s,o),intent:l.Intent.PRIMARY,className:"save-btn",children:"Save"})]})})]})}))},18594:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(72125),t)},68371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInlineValueNode=t.getVariables=void 0;const o=n(74762),i=n(74762);t.getVariables=e=>(e.match(/inputs\.([a-zA-Z]\w*)/g)||[]).map((e=>e.replace(/inputs\./,"")));t.createInlineValueNode=e=>{let{code:n,customView:s,nodeId:r,type:a}=e;const u=(0,t.getVariables)(n).reduce(((e,t)=>({...e,[t]:(0,o.nodeInput)()})),{}),c={value:(0,o.nodeOutput)()},l=a===o.InlineValueNodeType.FUNCTION?`const result = (function() { ${n}}());\n Promise.resolve(result).then(val => outputs.value.next(val))`:`const result = (${n}); Promise.resolve(result).then(val => outputs.value.next(val))`,d=btoa(n);return(0,i.inlineValueNode)({id:r||`Inline Code ${(0,o.randomInt)(99999)}`,inputs:u,outputs:c,runFnRawCode:l,customViewCode:s||n,dataBuilderSource:d,templateType:a,completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline "+(a===o.InlineValueNodeType.VALUE?"value":"function")})}},49283:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Omnibar=t.OmniBarCmdType=void 0;const a=n(35250),u=s(n(70079)),c=n(70457),l=n(74762),d=n(50382),p=r(n(26372));var f;!function(e){e.ADD="add",e.ADD_VALUE="add-value",e.IMPORT="import"}(f=t.OmniBarCmdType||(t.OmniBarCmdType={}));const m=[];t.Omnibar=e=>{const{resolvedNodes:t}=e,[n,o]=u.useState(""),[i,s]=u.useState(null),[r,g]=u.useState([]);u.useEffect((()=>{const e=(0,l.keys)(t).map((e=>({title:`${t[e].id}`,cmd:{type:f.ADD,data:e},extra:"current flow"}))),n=r.map((e=>({title:`${e.node.id}`,description:e.node.description,cmd:{type:f.IMPORT,data:e},extra:`${e.module}`}))),o={title:"Add inline value or code",suggestOnEmpty:!0,cmd:{type:f.ADD_VALUE}},i=[...m,...n,o,...e];s(i)}),[t,r]),u.useEffect((()=>{e.onRequestImportables&&e.onRequestImportables(n).then((e=>{g(e)}))}),[e,n]);const h=u.useCallback(((e,t)=>{let{handleClick:n,modifiers:o,query:i,index:s}=t;if(!o.matchesPredicate)return null;const r=`${e.title}`;return(0,a.jsx)(d.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,a.jsxs)("div",{className:(0,p.default)("omnibar-item",{active:o.active}),children:[(0,a.jsxs)("div",{className:"title",children:[r," ",e.extra?(0,a.jsx)("span",{className:"extra",children:e.extra}):null]}),e.description?(0,a.jsx)("div",{className:"description",children:e.description}):null]})},s)}),[]),v=u.useCallback(((e,t)=>{const n=e.toLowerCase().split("").map((e=>{return`${t=e,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*`;var t})).join(""),o=new RegExp(n);return!!t.title.toLowerCase().match(o)}),[]),y=u.useCallback((t=>{e.onCommand(t.cmd),e.onClose()}),[e]);return i?(0,a.jsx)(c.Omnibar,{query:n,onQueryChange:o,onClose:e.onClose,noResults:(0,a.jsx)(d.MenuItem,{disabled:!0,text:"No results."}),itemPredicate:v,isOpen:e.visible,items:i,initialContent:void 0,onItemSelect:y,itemRenderer:h,inputProps:{placeholder:"Search for nodes or commands.."}}):null}},60698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43490:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31874),t)},31874:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.usePorts=t.useConfirm=t.usePrompt=t.PortsContext=t.defaultPorts=void 0;const s=n(70079),r=n(74762),a=n(84472);i(n(60698),t);const u=e=>async()=>{console.warn(`${e} Not implemented`),(0,a.toastMsg)("Feature not implemented in this context yet","warning")};t.defaultPorts={prompt:async e=>{let{text:t,defaultValue:n}=e;return prompt(`${t}`,n)},openFile:async e=>{},confirm:async e=>{let{text:t}=e;return confirm(t)},readFlow:u("readFlow"),setFlow:u("setFlow"),resolveDeps:u("resolveDeps"),getImportables:u("getImportables"),onExternalFlowChange:u("onExternalFlowChange"),onInstallRuntimeRequest:u("onInstallRuntimeRequest"),onRunFlow:u("onRunFlow"),onStopFlow:u("onStopFlow"),reportEvent:r.noop,generateNodeFromPrompt:u("generateNodeFromPrompt"),hasOpenAiToken:()=>Promise.resolve(!1)},t.PortsContext=(0,s.createContext)(t.defaultPorts);t.usePrompt=()=>{const e=(0,s.useContext)(t.PortsContext).prompt;return(t,n)=>e({text:t,defaultValue:n})};t.useConfirm=()=>{const e=(0,s.useContext)(t.PortsContext).confirm;return t=>e({text:t})};t.usePorts=()=>(0,s.useContext)(t.PortsContext)},65758:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelected=void 0;const i=n(74762),s=o(n(53865)),r=n(22513);t.groupSelected=async(e,t,n,o,a)=>{const{instances:u,connections:c}=t,l=u.filter((t=>e.includes(t.id))),d=c.filter((t=>{let{from:n,to:o}=t;return-1!==e.indexOf(n.insId)||-1!==e.indexOf(o.insId)}));if(!l.length)throw new Error("visual without selections");const{visualNode:p,renamedInputs:f,renamedOutputs:m}=await(0,r.createGroup)(l,d,n,a),g=l.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),u[0].pos),h="ref"===o?(0,i.nodeInstance)((0,i.createInsId)(p),p.id,{},g):(0,i.inlineNodeInstance)((0,i.createInsId)(p),p,{},g),v=u.filter((t=>-1===e.indexOf(t.id))),y=c.map((e=>{const t=`${e.from.insId}.${e.from.pinId}`,n=`${e.to.insId}.${e.to.pinId}`;return f[n]?{...e,to:{insId:h.id,pinId:f[n]}}:m[t]?{...e,from:{insId:h.id,pinId:m[t]}}:e})).filter((t=>-1===e.indexOf(t.from.insId)&&-1===e.indexOf(t.to.insId)));return{newNode:p,currentNode:(0,s.default)(t,(e=>{e.instances=[...v,h],e.connections=y}))}}},74089:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(97106),t),i(n(18420),t),i(n(90680),t),i(n(84472),t),i(n(17102),t),i(n(82232),t),i(n(25779),t),i(n(25804),t),i(n(9958),t),i(n(68120),t),i(n(94651),t),i(n(73470),t),i(n(94007),t),i(n(60190),t),i(n(9001),t),i(n(7047),t),i(n(23386),t)},31745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoTooltip=void 0;const o=n(35250),i=n(50382),s=n(50382),r=n(44470),a=n(50382);t.InfoTooltip=e=>{const{content:t}=e;return(0,o.jsx)(s.Tooltip,{content:t,placement:"top",className:"info-tooltip",children:(0,o.jsx)(i.Icon,{icon:(0,o.jsx)(r.InfoSign,{className:a.Classes.INTENT_PRIMARY}),intent:i.Intent.SUCCESS,className:"info-tooltip-icon"})})}},83938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserOnlyReactJson=void 0;const o=n(35250);t.BrowserOnlyReactJson=e=>{if("undefined"==typeof window)return null;const t=n(73541).Z;return(0,o.jsx)(t,{...e})}},94651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsValueRenderer=void 0;const o=n(35250),i=n(74762),s=n(83938);t.AnalyticsValueRenderer=e=>{let{val:t}=e;try{const e=JSON.parse(t),n="object"==typeof e?e:{value:e},r=e&&[e.type,e.key,e.props,e.ref].every(i.isDefined),a=r?{jsxValue:e}:n;return(0,o.jsx)(s.BrowserOnlyReactJson,{src:a,collapseStringsAfterLength:50,collapsed:r})}catch(n){return(0,o.jsx)(s.BrowserOnlyReactJson,{src:{value:t},collapseStringsAfterLength:50})}}},22513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=void 0;const o=n(74762),i=n(74762),s=n(60190),r=n(88593);t.createGroup=async(e,t,n,a)=>{if(0===e.length)throw new Error("cannot create group without instances");const u=e.map((e=>e.id)),c=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return!t&&n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.to,e.to)))===t)),l=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return t&&!n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.from,e.from)))===t));let d={},p={},f={},m={};const g=[],h={};for(const o of c){const e=`${o.to.insId}.${o.to.pinId}`,t=`${o.from.insId}.${o.from.pinId}`,n=o.to.pinId;if(f[t]){g.push({from:(0,i.externalConnectionNode)(f[t]),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)});continue}const r=h[n]?await a(`Name this input (${n} of ${o.to.insId}) is already taken:`)||`i${(0,s.rnd)()}`:n;d[e]=r,f[t]=r,g.push({from:(0,i.externalConnectionNode)(r),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)}),h[r]=(0,i.nodeInput)()}const v={};for(const r of l){const e=`${r.to.insId}.${r.to.pinId}`,t=`${r.from.insId}.${r.from.pinId}`,n=r.from.pinId;if(m[e]){g.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(m[e])});continue}const u=v[n]?await a(`Name this output (${n} of ${r.from.insId} is already taken:`)||`i${(0,s.rnd)()}`:n;p[t]=u,m[e]=u,g.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(u)}),v[u]=(0,o.nodeOutput)()}e.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),e[0].pos);const y=t.filter((e=>u.includes(e.from.insId)&&u.includes(e.to.insId)));return{visualNode:{id:n,inputs:h,outputs:v,instances:e,defaultStyle:{size:"large",color:(0,o.pickRandom)(r.nodeStylePresetColors.map((e=>e.color)))},inputsPosition:(0,o.okeys)(h).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:0}})),{}),outputsPosition:(0,o.okeys)(v).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:400}})),{}),connections:[...y,...g],completionOutputs:(0,o.okeys)(v)},renamedInputs:d,renamedOutputs:p}}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightText=void 0;const o=n(35250);function i(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}t.highlightText=(e,t)=>{let n=0;const s=t.split(/\s+/).filter((e=>e.length>0)).map(i);if(0===s.length)return[e];const r=new RegExp(s.join("|"),"gi"),a=[];for(;;){const t=r.exec(e);if(!t)break;const i=t[0].length,s=e.slice(n,r.lastIndex-i);s.length>0&&a.push(s),n=r.lastIndex,a.push((0,o.jsx)("strong",{children:t[0]},n))}const u=e.slice(n);return u.length>0&&a.push(u),a}},17102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Loader=void 0;const o=n(35250);t.Loader=()=>(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)("svg",{width:"38",height:"38",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:"#007ec6",children:(0,o.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,o.jsxs)("g",{transform:"translate(1 1)",strokeWidth:"2",children:[(0,o.jsx)("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),(0,o.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:(0,o.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})})})},23386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;const o=n(74762);t.logger=(0,o.debugLogger)("editor")},561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadMonaco=void 0;const o=n(51848),i=n(23386);let s=!1;t.preloadMonaco=()=>{s||o.loader.init().then((()=>{(0,i.logger)("monaco preloaded"),s=!0}))}},68120:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHotkeys=t.currentHotkeys=void 0;const i=o(n(45240)),s=n(70079);t.currentHotkeys=new Map,t.useHotkeys=function(e,n,o,r,a){void 0===r&&(r=[]);const u=(0,s.useCallback)((function(){a&&!a.current||n(...arguments)}),[...r,n]);(0,s.useEffect)((()=>((0,i.default)(e,{},u),t.currentHotkeys.set(e,o),()=>{t.currentHotkeys.delete(e),i.default.unbind(e,u)})),[e,u,o])}},94007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeSessionStorage=t.safeLocalStorage=void 0,t.safeLocalStorage={getItem:function(){try{return localStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return localStorage.setItem(...arguments)}catch(e){return null}}},t.safeSessionStorage={getItem:function(){try{return sessionStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return sessionStorage.setItem(...arguments)}catch(e){return null}}}},90680:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocalStorage=t.useResizePref=t.userPreferences=t.useUserPref=void 0;const r=s(n(70079)),a=n(18420),u=n(94007);t.useUserPref=(e,n)=>{const[o,i]=r.useState((()=>{const o=t.userPreferences.getItem(e);return(0,a.isDefined)(o)?o:n}));r.useEffect((()=>{const o=t.userPreferences.getItem(e),s=(0,a.isDefined)(o)?o:n;i(s)}),[e]);return[o,n=>{t.userPreferences.setItem(e,n),i(n)}]},t.userPreferences=(()=>{const e=e=>`up.${e}`;return{getItem:t=>{const n=u.safeLocalStorage.getItem(e(t))||"",o=u.safeSessionStorage.getItem(e(t))||"";try{return JSON.parse(o||n).value}catch(i){return}},setItem:function(t,n,o){void 0===o&&(o=!1);const i=o?sessionStorage:u.safeLocalStorage;try{const o=JSON.stringify({value:n});return i.setItem(e(t),o),!0}catch(s){return console.error("Error saving user preference",s),!1}}}})();t.useResizePref=(e,n)=>{const o=`resize.${e}`;return(0,t.useUserPref)(o,n)};const c=e=>{const t=u.safeLocalStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch(n){return null}};t.useLocalStorage=(e,t)=>{const[n,o]=r.useState(c(e)||t),i=r.useCallback((t=>{u.safeLocalStorage.setItem(e,JSON.stringify({value:t})),o(t)}),[e]);return r.useEffect((()=>{c(e)||u.safeLocalStorage.setItem(e,JSON.stringify({value:t}))}),[e,t,i]),[n,i]}},60190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.totalEnergy=t.itrPhysics=t.hookes=t.coulombs=t.vToStr=t.vNorm=t.vLen=t.vSub=t.vAdd=t.vDiv=t.vMul=t.vZero=t.rnd=t.vec=t.size=void 0;t.size=(e,t)=>({width:e,height:t});t.vec=(e,t)=>({x:e,y:t});t.rnd=function(e,t){return void 0===e&&(e=100),void 0===t&&(t=0),Math.floor(Math.random()*(e-t))+t},t.vZero={x:0,y:0};t.vMul=(e,t)=>{let{x:n,y:o}=e;return{x:n*t,y:o*t}};t.vDiv=(e,n)=>{let{x:o,y:i}=e;return(0,t.vMul)({x:o,y:i},1/n)};t.vAdd=(e,t)=>({x:e.x+t.x,y:e.y+t.y});t.vSub=(e,n)=>(0,t.vAdd)(e,(0,t.vMul)(n,-1));t.vLen=e=>{let{x:t,y:n}=e;return Math.sqrt(t*t+n*n)};t.vNorm=e=>(0,t.vDiv)(e,(0,t.vLen)(e)||1);t.vToStr=e=>{let{x:t,y:n}=e;return`${t.toFixed(1)},${n.toFixed(1)}`};t.coulombs=(e,n,o)=>{const i=(0,t.vLen)((0,t.vSub)(e.p,n.p));if(0===i){const i=(0,t.vec)(2*Math.random()-1,2*Math.random()-1),s=e.m*n.m/Math.pow(10,2);return(0,t.vMul)(i,s*o)}{const s=(0,t.vNorm)((0,t.vSub)(n.p,e.p)),r=e.m*n.m/Math.pow(i+.1,2);return(0,t.vMul)(s,r*o)}};t.hookes=(e,n,o,i,s)=>{const r=(0,t.vLen)((0,t.vSub)(e.p,n.p)),a=(0,t.vNorm)((0,t.vSub)(e.p,n.p));let u=0;return ri&&(u=i-r),(0,t.vMul)(a,s*u)};t.itrPhysics=(e,n)=>{const{p:o,v:i,f:s,m:r}=n,a=(0,t.vDiv)(s,r),u=e/1e3,c=(0,t.vAdd)((0,t.vMul)(a,u),i),l=(0,t.vAdd)((0,t.vMul)(c,u),o);return{...n,p:l,v:c,f:(0,t.vec)(0,0)}};t.totalEnergy=e=>e.reduce(((e,n)=>{const o=(0,t.vLen)(n.v);return e+.5*n.m*o*o}),0)},84472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateToast=t.toastMsg=t.AppToaster=void 0;const o=n(50382);t.AppToaster=(()=>{try{return o.OverlayToaster.create({className:"app-toaster",position:o.Position.BOTTOM_RIGHT})}catch(e){return{}}})();t.toastMsg=(e,n,o)=>t.AppToaster.show({message:e,intent:n,timeout:o});t.updateToast=(e,n,o)=>t.AppToaster.show({message:n,intent:o},e)},18420:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultAnd=t.isLocal=t.fullTime=t.timeAgoFromDt=t.timeAgo=t.toString=t.isDefined=t.set=t.createOmap=t.toOmap=t.values=t.keys=t.entries=void 0;const i=n(7047),s=n(74762),r=o(n(73136));t.entries=e=>Object.keys(e).map((t=>[t,e[t]]));t.keys=e=>Object.keys(e);t.values=e=>Object.keys(e).map((t=>e[t]));t.toOmap=e=>Array.from(e.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.createOmap=function(e){return void 0===e&&(e=[]),e.reduce(((e,t)=>({...e,[t[0]]:t[1]})),{})};t.set=(e,t,n)=>{e[t]=n};t.isDefined=e=>void 0!==e;t.toString=e=>{const t=typeof e;if(""===e)return"(empty string)";if((0,i.isJsxValue)(e))return"JSX Value";if((0,s.isStaticValueVisualNode)(e))return"Embedded Node";if((0,s.isEnvValue)(e))return(0,s.getEnvKeyFromValue)(e);if("object"===t)try{const t=JSON.stringify(e);return"{}"===t?"Empty object":t}catch(n){return"Object (cannot stringify)"}return`${e}`};t.timeAgo=e=>(0,r.default)(new Date(e)).fromNow();t.timeAgoFromDt=e=>(0,r.default)(Date.now()-e).fromNow();t.fullTime=e=>(0,r.default)(new Date(e)).toString();t.isLocal=()=>location.href.includes(":300");t.preventDefaultAnd=e=>t=>{t.preventDefault(),e(t)}},67181:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ActionButton=t.ActionsMenu=t.ActionType=void 0;const r=n(35250),a=n(50382),u=n(50382),c=n(74762),l=s(n(70079)),d=n(86125),p=n(43490),f=n(68120),m=n(90680),g=n(84472),h=n(9971),v=n(47749),y=n(46334),I=n(47230),b=n(41032);var C;!function(e){e.AddNode="add-node",e.RemoveNode="remove-node",e.Group="group",e.UnGroup="un-group",e.AddInlineValue="add-inline-value",e.Inspect="inspect",e.Run="run",e.AI="ai"}(C=t.ActionType||(t.ActionType={}));t.ActionsMenu=e=>{const{onAction:n,selectedInstances:o,resolvedNodes:i,node:s,from:u,to:v,hotkeysEnabled:j,showRunFlowOptions:x}=e,{onRequestImportables:N}=(0,d.useDependenciesContext)(),[P,O]=l.default.useState(!1),[w,E]=l.default.useState(!1),[S,D]=l.default.useState(!1),[M,T]=l.default.useState(null),[k,R]=(0,m.useLocalStorage)("hideHotkeyHintMap",{}),A=(0,l.useCallback)((()=>{O(!1)}),[]),{onRunFlow:V,generateNodeFromPrompt:H,reportEvent:$}=(0,p.usePorts)(),z=(0,l.useCallback)(((e,t)=>(E(!1),V(e,t))),[V]),G=[];if(G.push(C.AddNode),G.push(C.AddInlineValue),1===o.length){const e=s.instances.find((e=>e.id===o[0]));if(e)try{const t=(0,b.safelyGetNodeDef)(e,i);(0,c.isVisualNode)(t)&&G.push(C.UnGroup)}catch(B){console.error(`Could not find node with id ${o[0]} - ${B}`)}else console.error(`Could not find instance with id ${o[0]}`)}x&&G.push(C.Run),o.length>0&&G.push(C.Group),(1===o.length||u||v)&&G.push(C.Inspect),o.length>0&&G.push(C.RemoveNode),G.push(C.AI);const L=(0,l.useCallback)(((e,t)=>{R({...k,[e]:!0}),g.AppToaster.dismiss(t)}),[k,R]),F=(0,l.useCallback)(((e,t)=>{const{hotkey:o}=_[e];if("click"===t.type&&o&&!k[o]){const t=(0,g.toastMsg)((0,r.jsxs)(r.Fragment,{children:["Did you know? you can also use the hotkey"," ",(0,r.jsx)("kbd",{className:"hotkey",children:o})," to"," ",_[e].text.replace(/^[A-Z]/,(e=>e.toLowerCase())),(0,r.jsxs)(a.Button,{minimal:!0,small:!0,onClick:()=>L(o,t),children:[" ","Don't show again"," "]})]}),"none",3e3)}switch(e){case C.AddNode:O(!0);break;case C.Run:!async function(){E(!0)}();break;case C.AI:D(!0);break;default:n({type:e,data:void 0})}}),[k,n,L,s.inputs]);Object.entries(_).forEach((e=>{let[t,n]=e;n.hotkey&&(0,f.useHotkeys)(n.hotkey,(e=>{e.preventDefault(),G.includes(t)&&(F(t,e),R({...k,[n.hotkey]:!0}))}),{text:n.text,group:"Action menu hotkeys"},[G],j)}));const q=(0,l.useCallback)((e=>{n({type:C.AddNode,data:{importableNode:e}})}),[n]),U=(0,l.useCallback)((async e=>{const t=Date.now();T(t);try{$("generateNodeFromPrompt:start",{promptLength:e.length});const o=await H({prompt:e}),{inputs:i,outputs:s}=o.importableNode.node,r=Date.now()-t;$("generateNodeFromPrompt:success",{totalTime:r,inputs:Object.keys(i),outputs:Object.keys(s)}),T(null),n({type:C.AI,data:o}),D(!1)}catch(B){T(null),g.AppToaster.show({message:"Failed to generate node",intent:"danger"}),$("generateNodeFromPrompt:failure",{error:B.message})}}),[H,n,$]);return(0,r.jsxs)("div",{className:"actions-menu",children:[G.map((e=>(0,r.jsx)(t.ActionButton,{type:e,onClick:F},e))),P?(0,r.jsx)(h.AddNodeMenu,{onRequestImportables:N,onAddNode:q,onClose:A}):null,w?(0,r.jsx)(I.RunFlowModal,{onClose:()=>E(!1),onRun:z,node:s}):null,S?(0,r.jsx)(y.PromptAIMenu,{onClose:()=>{D(!1),T(null)},onSubmit:U,submitting:null!==M,submitTime:M}):null]})};const _={[C.AddNode]:{icon:v.addNodeIcon,text:'Open the "add node" menu',hotkey:"a"},[C.RemoveNode]:{icon:v.removeNodeIcon,text:"Remove selected instances",hotkey:"backspace"},[C.Group]:{icon:v.groupIcon,text:"Group selection into a new node",hotkey:"g"},[C.UnGroup]:{icon:v.ungroupIcon,text:"Ungroup selected visual node"},[C.Inspect]:{icon:v.inspectIcon,text:"Inspect data",hotkey:"i"},[C.AddInlineValue]:{icon:v.pencilIcon,text:"Add value / inline function",hotkey:"v"},[C.Run]:{icon:v.playIcon,text:"Run flow",hotkey:"r"},[C.AI]:{icon:v.starIcon,text:"Generate new code node using AI \u2728"}},j={icon:"",text:"N/A",hotkey:void 0};t.ActionButton=e=>{var t;const{onClick:n,type:o}=e,i=(0,l.useCallback)((e=>n(o,e)),[n,o]),s=null!==(t=_[o])&&void 0!==t?t:j,a=s.hotkey?(0,r.jsxs)("span",{children:[s.text," ",(0,r.jsx)("kbd",{className:"hotkey",children:s.hotkey})]}):s.text;return(0,r.jsx)("div",{className:"action-button",onClick:i,"data-type":o,children:(0,r.jsx)(u.Tooltip,{hoverOpenDelay:100,content:a,className:"icon-wrapper",popoverClassName:"action-button-tooltip",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s.icon}})})})}},40149:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenu=t.AddNodeMenuFilterTree=void 0;const a=n(35250),u=n(50382),c=n(74762),l=r(n(26372)),d=s(n(70079)),p=n(43490),f=n(31745),m=n(17102),g=n(87935),h=n(74657),v=n(44470);t.AddNodeMenuFilterTree=u.Tree.ofType();function y(e,t,n){return[...e.external.map((e=>({id:e.module,label:e.module,hasCaret:!0,nodeData:{type:"external",module:e.module},isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module,isExpanded:n.has(e.module),childNodes:e.namespaces.map((o=>({id:`${e.module}/${o}`,label:o,hasCaret:!1,isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module&&t.namespace===o,isExpanded:n.has(`${e.module}/${o}`),nodeData:{type:"external",module:e.module,namespace:o}})))}))),{id:"internal",label:"Current Project",nodeData:{type:"internal"},isExpanded:n.has("internal"),hasCaret:!0,isSelected:"internal"===t.type,childNodes:e.internal.files.map((e=>({id:e,label:e,isSelected:"internal"===t.type&&t.file===e,hasCaret:!1,isExpanded:n.has(e),nodeData:{type:"internal",file:e}})))}]}function I(e){return/\.flyde(\.[jt]s)?$/.test(e.module)}t.AddNodeMenu=e=>{const{onRequestImportables:n,onAddNode:o,onClose:i}=e,[s,r]=d.default.useState(),[b,C]=d.default.useState([]),[_,j]=d.default.useState(new Set),[x,N]=d.default.useState(""),[P,O]=d.default.useState({type:"all"}),[w,E]=d.default.useState(null),[S,D]=d.default.useState(null),[M,T]=d.default.useState(null),k=(0,d.useCallback)((e=>{_.add(e.id),j(new Set(_))}),[_]),R=(0,d.useCallback)((e=>{_.delete(e.id),j(new Set(_))}),[_]),A=(0,d.useCallback)((e=>{o(e),i()}),[o,i]),{onInstallRuntimeRequest:V,reportEvent:H}=(0,p.usePorts)();(0,d.useEffect)((()=>{H("addNodeMenuOpen",{})}),[H]),(0,d.useEffect)((()=>{D(null==s?void 0:s.flatMap((e=>{var t,n,o;if(P)if("external"===P.type){if((e.module!==P.module||P.namespace)&&e.node.namespace!==P.namespace)return[]}else if("internal"===P.type&&(!I(e)||P.file&&e.module!==P.file))return[];if(x){const i=`${null!==(n=null===(t=e.node.searchKeywords)||void 0===t?void 0:t.join(" "))&&void 0!==n?n:[]} ${e.node.id} ${null!==(o=e.node.namespace)&&void 0!==o?o:""} ${e.node.description}`.toLowerCase().indexOf(x.toLowerCase());return-1===i?[]:[{importable:e,score:i}]}return[{importable:e,score:1}]})).sort(((e,t)=>e.score-t.score)).map((e=>{let{importable:t}=e;return t})))}),[s,P,x]),(0,d.useEffect)((()=>{n().then((e=>{let{importables:t,errors:n}=e;C(n);const o=t.filter((e=>!I(e))).reduce(((e,t)=>{var n,o,i;null!==(n=e[i=t.module])&&void 0!==n||(e[i]=[]);const s=null!==(o=t.node.namespace)&&void 0!==o?o:"";return e[t.module].includes(s)||e[t.module].push(s),e}),{}),i=t.filter(I).map((e=>e.module));E({external:Object.entries(o).map((e=>{let[t,n]=e;return{module:t,namespaces:n}})),internal:{files:i}}),r(t),j(new Set(["internal",...Object.keys(o)]))}))}),[n]);const $=(0,d.useCallback)((e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),S&&!M)return void T(S["ArrowDown"===e.key?0:S.length-1]);if(S&&M){const t=S.findIndex((e=>e===M));let n="ArrowDown"===e.key?t+1:t-1;n=n<0?S.length-1:n,n=n>=S.length?0:n,T(S[n])}break;case"Enter":M&&A(M)}}),[S,M,A]),z=(0,d.useCallback)((e=>{let{nodeData:t}=e;JSON.stringify(t)===JSON.stringify(P)?"external"===t.type?t.namespace?O({type:"external",module:t.module}):O({type:"all"}):"internal"===t.type&&(t.file?O({type:"internal"}):O({type:"all"})):O(t)}),[P]),G=!s||s.some((e=>e.module.includes("@flyde/stdlib"))),L=(0,d.useCallback)((()=>{V(),i()}),[i,V]);return(0,a.jsx)(u.Dialog,{isOpen:!0,title:"Add Node Menu",onClose:e.onClose,className:"add-node-menu",isCloseButtonShown:!0,children:(0,a.jsxs)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),children:[(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"bp5-input-group",children:[(0,a.jsx)(v.Search,{}),(0,a.jsx)("input",{className:"bp5-input",type:"search",placeholder:"Search input",dir:"auto",autoFocus:!0,onChange:e=>N(e.target.value),value:x,onKeyDown:$})]}),G?null:(0,a.jsxs)(u.Callout,{intent:u.Intent.NONE,style:{marginTop:10},children:["Using built-in @flyde/stdlib. It's recommended to explicitly install it instead."," ",(0,a.jsx)(u.Button,{minimal:!0,small:!0,intent:u.Intent.PRIMARY,onClick:L,children:"Click here to install it using npm/yarn"})]})]}),(0,a.jsx)("div",{className:"content-wrapper",children:s?(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsxs)("aside",{children:[(0,a.jsxs)("div",{className:"filter-header",children:["Filter by package"," ",(0,a.jsx)(u.Tooltip,{content:(0,a.jsxs)("span",{children:["Click to learn more about how packages work in Flyde"," "]}),hoverCloseDelay:1500,children:(0,a.jsx)("a",{target:"_blank",href:"https://www.flyde.dev/docs/packages",rel:"noreferrer",children:(0,a.jsx)(u.Icon,{icon:(0,a.jsx)(v.Help,{}),intent:"primary",iconSize:12})})})]}),(0,a.jsx)("div",{className:"tree-container",children:(0,a.jsx)(t.AddNodeMenuFilterTree,{contents:y(w,P,_),onNodeCollapse:R,onNodeExpand:k,onNodeClick:z,className:u.Classes.ELEVATION_0})})]}),(0,a.jsx)("main",{children:S?0===S.length?(0,a.jsxs)("div",{className:"no-results",children:[(0,a.jsx)(h.AddNodeMenuResultsSummary,{filter:P,onChangeFilter:O,query:x,onChangeQuery:N,resultsCount:S.length}),(0,a.jsxs)(u.Callout,{className:"callout",intent:"primary",children:["Can't find a suitable node? Create one yourself!"," ",(0,a.jsx)("a",{href:"https://www.flyde.dev/docs/code-nodes",target:"_blank",rel:"noreferrer",children:"Learn more"})]})]}):(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsx)(h.AddNodeMenuResultsSummary,{filter:P,onChangeFilter:O,query:x,onChangeQuery:N,resultsCount:S.length}),(0,a.jsx)("div",{className:"results",children:S.map((e=>(0,a.jsx)(g.AddNodeMenuListItem,{importableNode:e,onAdd:A,selected:(null==M?void 0:M.node)===e.node,onSelect:T,onSetFilter:O},e.node.id+e.node.namespace+e.module)))})]}):(0,a.jsx)(m.Loader,{})})]}):(0,a.jsx)(m.Loader,{})}),b.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",style:{marginTop:"10px"},children:["Found ",(0,c.simplePluralize)(b.length,"corrupt flow"),(0,a.jsx)(f.InfoTooltip,{content:b.map((e=>{let{path:t,message:n}=e;return`${t}: ${n}`})).join(", ")})," "]}):null]})})}},8470:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuListItem=void 0;const a=n(35250),u=n(50382),c=r(n(26372)),l=s(n(70079));t.AddNodeMenuListItem=e=>{const{importableNode:t,onSetFilter:n,onAdd:o,onSelect:i}=e,{node:s,module:r}=t,{id:d,description:p}=s,f=l.default.useRef(null);l.default.useEffect((()=>{e.selected&&f.current&&f.current.scrollIntoView({block:"center"})}),[e.selected]);const m=(0,l.useCallback)((()=>{o(t)}),[o,t]),g=(0,l.useCallback)((()=>{i(t)}),[i,t]);return(0,a.jsxs)("div",{className:(0,c.default)("add-node-menu-list-item",{selected:e.selected}),ref:f,onClick:g,children:[(0,a.jsxs)("div",{className:"content",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("span",{className:"id",children:d}),(0,a.jsxs)(u.Tag,{interactive:!0,onClick:()=>n({type:"external",module:r,namespace:s.namespace}),className:"source",minimal:!0,children:[r,s.namespace?` / ${s.namespace}`:null]})]}),(0,a.jsx)("div",{className:"description",children:p||(0,a.jsx)("em",{children:"No description"})})]}),(0,a.jsx)("aside",{children:(0,a.jsx)(u.Button,{onClick:m,children:"Add"})})]})}},87935:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8470),t)},88671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuResultsSummary=void 0;const o=n(35250),i=n(50382);t.AddNodeMenuResultsSummary=e=>{const{resultsCount:t,query:n,filter:s,onChangeFilter:r,onChangeQuery:a}=e;return(0,o.jsxs)("div",{className:"add-node-menu-results-summary",children:[t?`Showing ${t} result${t>1?"s":""}`:"No results found","\xa0",n?(0,o.jsxs)(o.Fragment,{children:["matching query\xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>a(""),children:['"',n,'"']})]}):null,"all"===s.type?null:"external"===s.type?(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["package ",s.module,s.namespace?` / ${s.namespace}`:null]})]}):(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["\xa0this project ",s.file?` / ${s.file}`:null]})]})]})}},74657:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88671),t)},9971:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40149),t)},83159:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PromptAIMenu=void 0;const a=n(35250),u=n(50382),c=r(n(26372)),l=s(n(70079)),d=1e4;t.PromptAIMenu=e=>{const{onClose:t}=e,[n,o]=l.default.useState(""),[i,s]=l.default.useState(0);return(0,l.useEffect)((()=>{s(0);const t=setInterval((()=>{s((t=>{const n=(Date.now()-e.submitTime)/d;return Math.min(n+.05*Math.random()/2,.95)}))}),500);return()=>clearInterval(t)}),[e.submitTime]),(0,a.jsxs)(u.Dialog,{isOpen:!0,onClose:t,className:"prompt-ai-menu",title:"\u2728 Generate Code Node using AI",children:[(0,a.jsx)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsx)(u.TextArea,{value:n,disabled:e.submitting,onChange:e=>o(e.target.value),placeholder:"Describe your node in details",fill:!0})}),e.submitTime?(0,a.jsx)("div",{className:"progress-bar-container",children:(0,a.jsx)(u.ProgressBar,{value:i})}):null,(0,a.jsx)("div",{className:u.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:u.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(u.Button,{onClick:t,children:"Close"}),(0,a.jsx)(u.Button,{intent:u.Intent.PRIMARY,className:"run-btn",disabled:e.submitting||!n,loading:e.submitting,onClick:()=>{s(0),e.onSubmit(n)},children:"Create \u2728"})]})})]})}},46334:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(83159),t)},3152:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RunFlowModal=void 0;const a=n(35250),u=s(n(70079)),c=r(n(51848)),l=n(50382),d=r(n(26372)),p=n(90680),f=n(31745);t.RunFlowModal=u.memo((function(e){const{onRun:t,onClose:n,node:o}=e,[i,s]=u.useState(0),[r,m]=(0,p.useLocalStorage)(`run-inputs-${o.id}`,Object.keys(o.inputs).reduce(((e,t)=>(e[t]=`Enter a value for input ${t}`,e)),{})),[g,h]=u.useState(JSON.stringify(r,null,2)),v=e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})},y=u.useCallback((()=>{const e=JSON.parse(g);m(e),t(e,i)}),[t,m,g,i]),I=Object.keys(o.inputs),b=I.filter((e=>"required"!==o.inputs[e].mode)),C=u.useMemo((()=>I.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:"This node receives external inputs. Enter values for each input below:"}),(0,a.jsx)(c.default,{height:"80px",theme:"vs-dark",defaultLanguage:"json",value:g,onChange:e=>h(null!=e?e:""),onMount:v}),b.length>0?(0,a.jsxs)(l.Callout,{intent:l.Intent.NONE,children:["Note: input(s) ",(0,a.jsx)("code",{children:b.join(", ")})," are optional"]}):null]}):(0,a.jsx)("strong",{children:"This node does not receive any external inputs."})),[I.length,b,g]);return(0,a.jsxs)(l.Dialog,{isOpen:!0,onClose:e.onClose,className:"run-flow-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(l.Classes.DIALOG_BODY),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&y()},tabIndex:0,children:[C,(0,a.jsxs)("div",{className:"execution-delay-wrapper",children:[(0,a.jsxs)("label",{children:["Execution delay:"," ",(0,a.jsx)(f.InfoTooltip,{content:"Delay between each node execution. Useful for debugging."})]}),(0,a.jsx)(l.Slider,{value:i,onChange:s,min:0,labelStepSize:500,stepSize:100,labelRenderer:e=>`${e}ms`,max:1e3})]})]}),(0,a.jsx)("div",{className:l.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:l.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(l.Button,{onClick:n,children:"Close"}),(0,a.jsx)(l.Button,{onClick:y,intent:l.Intent.PRIMARY,className:"run-btn",children:"Run"})]})})]})}))},47230:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3152),t)},47749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starIcon=t.stopIcon=t.playIcon=t.pencilIcon=t.ungroupIcon=t.groupIcon=t.inspectIcon=t.removeNodeIcon=t.addNodeIcon=void 0,t.addNodeIcon='\n\n',t.removeNodeIcon='\n\n',t.inspectIcon='\n\n\n',t.groupIcon='\n\n\n',t.ungroupIcon='\n\n\n',t.pencilIcon='\n\n',t.playIcon='\n\n\n',t.stopIcon='\n\n\n',t.starIcon='\n\n\n\n\n'},1237:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HelpBubble=void 0;const i=n(70079),s=n(35250),r=n(50382),a=n(99489),u=n(50382),c=o(n(70079)),l=n(68120),d=n(71644),p=n(43490),f={offset:{enabled:!0,options:{offset:[0,20]}},preventOverflow:{enabled:!0,options:{padding:10}}};const m=["Viewport Controls","Editing","Selection"];t.HelpBubble=()=>{const[e,t]=c.default.useState(!1),n=Array.from(l.currentHotkeys.entries()).map((e=>{let[t,n]=e;return{combo:(o={key:t,menuData:n}).key,label:o.menuData.text,group:o.menuData.group};var o})).reduce(((e,t)=>(e[t.group]||(e[t.group]=[]),e[t.group].push(t),e)),{}),o=Object.entries(n).sort(((e,t)=>m.indexOf(t[0])-m.indexOf(e[0]))),{reportEvent:g}=(0,p.usePorts)(),h=(0,s.jsx)(r.Dialog,{isOpen:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:r.Classes.DIALOG_BODY,children:o.map((e=>{let[t,n]=e;return(0,s.jsxs)(c.default.Fragment,{children:[(0,s.jsx)(r.H4,{children:t}),n.map((e=>(0,i.createElement)(a.Hotkey,{...e,key:e.combo})))]},t)}))})}),v=(0,s.jsxs)(r.Menu,{children:[(0,s.jsx)(r.MenuItem,{text:"Hotkeys",onClick:()=>{t(!0),g("helpMenuItem",{item:"hotkeys"})}}),(0,s.jsx)(r.MenuItem,{text:"Documentation",onClick:()=>g("helpMenuItem",{item:"documentation"}),href:"https://www.flyde.dev/docs",target:"_blank"}),(0,s.jsx)(r.MenuDivider,{}),(0,s.jsx)(r.MenuItem,{text:"Discord",onClick:()=>g("helpMenuItem",{item:"discord"}),href:"https://discord.gg/x7t4tjZQP8",target:"_blank"})]});return(0,s.jsxs)("div",{className:"help-bubble","data-tip":"Help",children:[(0,s.jsx)(u.Popover,{content:v,modifiers:f,onOpened:()=>g("helpMenuOpen",{}),children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:d.helpIcon}})}),h]})}},71644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpIcon=void 0,t.helpIcon='\n\n\n'},3354:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1237),t)},7011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainInstanceEventsIndicator=void 0;const o=n(35250),i=n(30994),s=n(66189),r=n(50382);t.MainInstanceEventsIndicator=e=>{const{currentInsId:t,ancestorsInsIds:n}=e,{history:a,refreshHistory:u,resetHistory:c}=(0,s.useHistoryHelpers)(t),l=`main-indicator-${t}}`;return(0,o.jsx)("div",{className:"main-instance-events-indicator",children:(0,o.jsx)(r.Tooltip,{content:(0,s.calcHistoryContent)(a),children:(0,o.jsx)("span",{onMouseEnter:u,onMouseOut:c,id:(0,i.getMainInstanceIndicatorDomId)(t,n),className:"status-text","data-tip":"","data-html":!0,"data-for":l})})})}},22714:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7011),t)},63521:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VisualNodeEditor=t.defaultBoardData=t.defaultViewPort=t.NODE_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),c=n(74762),l=n(86553),d=n(65082),p=n(18420),f=n(26701),m=n(7047),g=n(53865),h=n(70079),v=n(68120),y=r(n(27942)),I=n(50382),b=n(66005),C=n(60190),_=n(71033),j=n(74762),x=n(99942),N=n(44338),P=n(561),O=n(84472),w=n(82232),E=n(18594),S=n(68371),D=r(n(61888)),M=n(65758),T=n(43490),k=r(n(26372)),R=n(25044),A=n(80510),V=n(1788),H=n(2130),$=n(88593),z=n(97106),G=n(67181),L=n(22714),F=n(3354),q=n(41032),U=n(30653),B=u.memo(I.Slider),W=()=>null;t.NODE_HEIGHT=28;t.defaultViewPort={pos:{x:0,y:0},zoom:1},t.defaultBoardData={selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}},t.VisualNodeEditor=u.memo(u.forwardRef(((e,n)=>{const{onChangeNode:o,nodeIoEditable:i,onCopy:s,onGoToNodeDef:r,onInspectPin:Z,boardData:Y,onChangeBoardData:K,currentInsId:Q,ancestorsInsIds:X,node:ee,onShowOmnibar:te,resolvedDependencies:ne,queuedInputsData:oe,initialPadding:ie,disableScrolling:se}=e,{onImportNode:re}=(0,z.useDependenciesContext)(),ae=(0,U.useDarkMode)(),{reportEvent:ue}=(0,T.usePorts)(),ce=e.parentViewport||t.defaultViewPort,[le,de]=(0,h.useState)({...ne,[ee.id]:ee});(0,h.useEffect)((()=>{de({...ne,[ee.id]:ee})}),[ne,ee]);const{selected:pe,from:fe,to:me}=Y,{instances:ge,connections:he,inputsPosition:ve,outputsPosition:ye,inputs:Ie,outputs:be}=ee,[Ce,_e]=(0,h.useState)(),[je,xe]=(0,h.useState)(),Ne=void 0===X,[Pe,Oe]=(0,h.useState)(0),[we,Ee]=(0,h.useState)(),[Se,De]=(0,h.useState)(!1),[Me,Te]=(0,h.useState)(),[ke,Re]=(0,h.useState)(),[Ae,Ve]=(0,h.useState)(),[He,$e]=(0,h.useState)(),ze=(0,h.useRef)();(0,f.useDidMount)((()=>{ze.current=Xe.current.querySelector(".inline-editor-portal-root")}));const Ge=(0,T.useConfirm)(),Le=(0,T.usePrompt)(),Fe=Y.viewPort,qe=(0,h.useRef)(!0),[Ue,Be]=(0,h.useState)(null),We=u.useCallback((e=>{K({viewPort:e})}),[K]),Je=u.useCallback(((e,t)=>Z(e,t)),[Z]),Ze=u.useCallback(((e,t,n)=>{const i=(0,A.handleConnectionCloseEditorCommand)(ee,{from:e,to:t}),s=(0,c.isInternalConnectionNode)(t)?ge.find((e=>e.id===t.insId)):null,r=(s?s.inputConfig:{})[t.pinId],a=(0,c.isStaticInputPinConfig)(r)?(0,V.handleDetachConstEditorCommand)(i,t.insId,t.pinId):i;o(a,(0,w.functionalChange)("close-connection")),K({from:void 0,to:void 0}),ue("createConnection",{source:n})}),[ge,o,K,ee,ue]),Ye=u.useCallback((async()=>{const e=await Le("New visual node name?");if(!e)return;const{currentNode:t}=await(0,M.groupSelected)(Y.selected,ee,e,"inline",Le);o(t,(0,w.functionalChange)("group node")),(0,O.toastMsg)("Node grouped"),ue("groupSelected",{count:Y.selected.length})}),[Le,Y.selected,o,ee,ue]);(0,h.useEffect)((()=>{if(we){const e=setTimeout((()=>{Ee(void 0)}),350);return()=>clearTimeout(e)}}),[we]);const[Ke,Qe]=(0,h.useState)();(0,h.useEffect)((()=>{(0,P.preloadMonaco)()}),[]);const Xe=(0,h.useRef)(),et=(0,y.default)(Xe),tt=u.useRef({x:400,y:400}),nt=(0,f.useBoundingclientrect)(Xe)||C.vZero,ot=()=>{const e=(0,m.fitViewPortToNode)(ee,le,et);(0,m.animateViewPort)(Fe,e,500,(e=>{We(e)}))},it=u.useCallback(((e,t)=>{const{to:n,from:o}=Y,i="input"===t?o:n,s="input"===t?n:o,r={pinId:e,insId:c.THIS_INS_ID},a="input"===t?{from:r}:{to:r};i&&i.pinId===e?K({from:void 0,to:void 0}):s?"input"===t&&n?Ze(r,n,"nodeIoClick"):o&&Ze(o,r,"nodeIoClick"):K(a)}),[Y,K,Ze]),st=u.useCallback(((e,t,n)=>{const i=(0,g.produce)(ee,(o=>{"input"===e?o.inputs[t].description=n:o.outputs[t].description=n}));o(i,(0,w.functionalChange)("Node io description"))}),[o,ee]),rt=u.useCallback(((e,t,n)=>{const{from:o,to:i}=Y;if(fe&&fe.insId===e.id||me&&me.insId===e.id)K({from:void 0,to:void 0});else if("input"===n){const n={insId:e.id,pinId:t};!i||i.pinId!==t||(0,c.isInternalConnectionNode)(i)&&i.insId!==e.id?fe?Ze(fe,n,"pinClick"):K({to:n,selected:[]}):K({to:void 0})}else{const n={insId:e.id,pinId:t};!o||o.pinId!==t||(0,c.isInternalConnectionNode)(o)&&o.insId!==e.id?me?Ze(n,me,"pinClick"):K({from:n,selected:[]}):K({from:void 0})}}),[Y,fe,K,Ze,me]);(0,h.useEffect)((()=>{if(!Se&&et.width){const t=(0,m.fitViewPortToNode)(ee,le,et,ie);We(t);const n=setTimeout((()=>{const t=(0,m.fitViewPortToNode)(ee,le,et,ie);e.thumbnailMode||We(t),De(!0)}),100);return()=>clearTimeout(n)}}),[ee,ie,et,e.thumbnailMode,Se,le,We]);const at=u.useCallback((()=>{const{selected:e}=Y,t=ee.instances.filter((t=>e.includes(t.id))).map((e=>({...e,id:e.id+"-copy"}))),n=ee.connections.filter((t=>{let{from:n,to:o}=t;return e.includes(n.insId)&&e.includes(o.insId)}));s({instances:t,connections:n})}),[Y,s,ee]),ut=u.useCallback((()=>{const{newNode:t,newInstances:n}=(0,R.pasteInstancesCommand)(ee,tt.current,e.clipboardData);o(t,(0,w.functionalChange)("paste instances")),K({selected:n.map((e=>e.id))})}),[o,K,ee,e.clipboardData]),ct=u.useCallback((()=>{const e=ee.id;Ke?"input"===Ke.type?Ke.ins.id===e?it(Ke.pin,"input"):rt(Ke.ins,Ke.pin,"input"):Ke.ins.id===e?it(Ke.pin,"output"):rt(Ke.ins,Ke.pin,"output"):console.warn("tried selecting closest with no pin nearby")}),[ee.id,Ke,it,rt]),lt=u.useCallback(((e,t)=>{const n=Math.min(Math.max(e,.1),3),o="mouse"===t?tt.current:{x:Fe.pos.x+et.width/2,y:Fe.pos.y+et.height/2},i=(0,m.centerBoardPosOnTarget)(o,et,n,Fe);We({...Fe,zoom:n,pos:i})}),[We,Fe,et]);(0,v.useHotkeys)("cmd+=",(e=>{lt(Fe.zoom+.1,"hotkey"),e.preventDefault()}),{text:"Zoom in board",group:"Viewport Controls"},[Fe,lt],qe),(0,v.useHotkeys)("cmd+-",(e=>{lt(Fe.zoom-.1,"hotkey"),e.preventDefault()}),{text:"Zoom out board",group:"Viewport Controls"},[lt,Fe.zoom],qe),(0,v.useHotkeys)("cmd+o",(e=>{e.preventDefault(),(0,O.toastMsg)("Ordering");const t=[];(0,x.orderVisualNode)(ee,le,200,((e,n)=>{n%3==0&&t.push(e)})),(async()=>{for(;t.length;){const e=t.shift();(0,O.toastMsg)(`Step ${t.length}!`),await(0,c.delay)(200),o(e,(0,w.metaChange)("order-step")),(0,O.toastMsg)(`Step ${t.length}! done`)}})()}),{text:"Auto-layout (experimental)",group:"Misc."},[o,ee,ne],qe),(0,v.useHotkeys)("cmd+0",(e=>{lt(1),e.preventDefault()}),{text:"Reset zoom",group:"Viewport Controls"},[Fe,lt],qe);const dt=()=>{K({from:void 0,to:void 0,selected:[]})},pt=u.useCallback(((e,t)=>{_e(e.id),o({...ee},(0,w.metaChange)("drag-start"))}),[o,ee]),ft=u.useCallback(((e,t,n)=>{const{newValue:i,newSelected:s}=(0,m.handleInstanceDrag)(ee,e,n,t,pe,Ce);o(i,(0,w.metaChange)("drag-move")),s&&K({selected:s})}),[Ce,o,K,pe,ee]),mt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(void 0)}),[]),gt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(c.THIS_INS_ID)}),[]),ht=u.useCallback((async(t,n,o,i)=>{o.preventDefault(),o.stopPropagation();const{x:s,y:r}=i,a=(0,g.produce)(ee,(e=>{"input"===t?e.inputsPosition[n]={x:s,y:r}:e.outputsPosition[n]={x:s,y:r}}));e.onChangeNode(a,(0,w.metaChange)("node-io-drag-move"))}),[e,ee]),vt=u.useCallback((async(e,t,n,o)=>{n.preventDefault(),n.stopPropagation(),_e(void 0)}),[]),yt=u.useCallback(((e,t)=>{let{id:n}=e;const o=t.shiftKey?pe.filter((e=>e!==n)):[],i=t.shiftKey?[...pe,n]:[n],s=pe.includes(n)?o:i;K({selected:s,from:void 0,to:void 0})}),[K,pe]),It=u.useCallback((()=>{const e=ee.instances.map((e=>e.id));K({selected:e,from:void 0,to:void 0})}),[K,ee.instances]),bt=u.useCallback((e=>{const t=he.filter((t=>{let{from:n,to:o}=t;return-1===e.indexOf(n.insId)&&-1===e.indexOf(o.insId)})),n=(0,g.produce)(ee,(n=>{n.connections=t,n.instances=n.instances.filter((t=>!e.includes(t.id)))}));K({selected:[]}),o(n,(0,w.functionalChange)("delete-ins"))}),[he,o,K,ee]),Ct=u.useCallback((e=>{bt([e.id])}),[bt]),_t=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{"input"===e?(delete n.inputs[t],n.connections=n.connections.filter((e=>!((0,c.isExternalConnectionNode)(e.from)&&e.from.pinId===t)))):(n.connections=n.connections.filter((e=>!((0,c.isExternalConnectionNode)(e.to)&&e.to.pinId===t))),n.completionOutputs=(n.completionOutputs||[]).map((e=>e.split("+").filter((e=>e!==t)).join("+"))).filter((e=>!!e)),delete n.outputs[t])}));fe&&fe.insId===c.THIS_INS_ID&&fe.pinId===t?K({from:void 0}):me&&me.insId===c.THIS_INS_ID&&me.pinId===t&&K({to:void 0}),o(n,(0,w.functionalChange)("remove io pin"))}),[ee,fe,me,o,K]),jt=u.useCallback((async()=>{const{selected:e,from:t,to:n}=Y;0===e.length?t&&(0,c.isExternalConnectionNode)(t)?await Ge(`Are you sure you want to remove main input ${t.pinId}?`)&&_t("input",t.pinId):n&&(0,c.isExternalConnectionNode)(n)&&await Ge(`Are you sure you want to remove main output ${n.pinId}?`)&&_t("output",n.pinId):bt(e)}),[Ge,Y,bt,_t]),xt=u.useCallback(((e,t,n)=>{const i=(0,m.getInstancePinConfig)(ee,e.id,t),s=(0,c.isStickyInputPinConfig)(i)?(0,j.queueInputPinConfig)():(0,c.stickyInputPinConfig)();o((0,m.changePinConfig)(ee,e.id,t,s),(0,w.functionalChange)("toggle-sticky")),ue("togglePinSticky",{isSticky:(0,c.isStickyInputPinConfig)(s)})}),[o,ee,ue]),Nt=u.useCallback((()=>{const{newNode:e,newInstances:t}=(0,H.handleDuplicateSelectedEditorCommand)(ee,pe);o(e,(0,w.functionalChange)("duplicated instances")),K({selected:t.map((e=>e.id))})}),[o,K,ee,pe]),Pt=u.useCallback((e=>{const t=e.nativeEvent.target;if(0===e.button&&J(e.nativeEvent,ee.id)&&t&&"board-editor-inner"===t.className){if(Date.now()-Pe<300)return void te(e);Oe(Date.now());const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,nt),o=(0,m.domToViewPort)(n,Fe,ce);xe({from:o,to:o})}}),[ee.id,Fe,Pe,nt,ce,te]),Ot=u.useCallback((e=>{if(Be(null),J(e.nativeEvent,ee.id)&&je){if((0,m.calcSelectionBoxArea)(je)>50){const t=(0,m.getInstancesInRect)(je,le,Fe,Kt.current,ee.instances,nt,ce),n=e.shiftKey?[...pe,...t]:t;K({selected:n})}xe(void 0)}}),[ee.id,ee.instances,je,le,Fe,nt,ce,pe,K]),wt=u.useCallback((e=>{if(!J(e.nativeEvent,ee.id))return void(qe.current=!1);qe.current=!0;const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,(0,C.vAdd)(nt,C.vZero)),o=(0,m.domToViewPort)(n,Fe,ce);je&&xe({...je,to:o});const i=(0,m.findClosestPin)(ee,le,n,nt,Q,X,Fe),s=Ke;if(i){(!s||s.ins!==i.ins||s.ins===i.ins&&s.pin!==i.pin)&&Qe({ins:i.ins,type:i.type,pin:i.id})}tt.current=o,K({lastMousePos:tt.current})}),[ee,nt,Fe,ce,je,le,Q,X,Ke,K]),Et=u.useCallback((e=>{var t;"bp5-menu"!==(null===(t=e.relatedTarget)||void 0===t?void 0:t.className)&&(Qe(void 0),qe.current=!1)}),[]),St=u.useCallback(((e,t)=>{if(t){const t=(0,c.isInlineNodeInstance)(e)?e.node:(0,q.safelyGetNodeDef)(e.nodeId,le);if(!t)throw new Error("Impossible state inspecting inexisting node");if(!(0,c.isVisualNode)(t))return void(0,O.toastMsg)("Cannot inspect a non visual node","warning");$e({insId:`${Q}.${e.id}`,node:t})}else if((0,c.isRefNodeInstance)(e)){const t=(0,q.safelyGetNodeDef)(e,le);r(t)}else{const t=e.node;if(!(0,c.isInlineValueNode)(t))return void((0,c.isVisualNode)(t)?$e({insId:e.id,node:t}):(0,O.toastMsg)("Editing this type of node is not supported"));const n=atob(t.dataBuilderSource);Ve({insId:e.id,templateType:t.templateType,value:n,type:"existing"}),(0,O.toastMsg)("Editing inline visual node not supported yet")}}),[r,le,Q]),Dt=u.useCallback((e=>{if((0,c.isInlineNodeInstance)(e)){const t=e.node;if(!(0,c.isVisualNode)(t))return void(0,O.toastMsg)("Not supported","warning");const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.filter((t=>t.id!==e.id)),n.connections=n.connections.filter((t=>{let{from:n,to:o}=t;return n.insId!==e.id&&o.insId!==e.id})),n.instances.push(...t.instances),n.connections.push(...t.connections.filter((e=>(0,c.isInternalConnectionNode)(e.from)&&(0,c.isInternalConnectionNode)(e.to))))}));o(n,{type:"functional",message:"ungroup"}),K({selected:[]})}else{const t=(0,q.safelyGetNodeDef)(e.nodeId,le);if(!(0,c.isVisualNode)(t))return void(0,O.toastMsg)("Not supported","warning")}}),[ee,o,K,le]),Mt=u.useCallback((async e=>{}),[]),Tt=u.useCallback(((e,t)=>{const n=(0,V.handleDetachConstEditorCommand)(ee,e.id,t);o(n,(0,w.functionalChange)("detach-const"))}),[o,ee]),kt=u.useCallback(((e,t)=>{const n=e.inputConfig[t]||(0,j.queueInputPinConfig)();(0,c.isStaticInputPinConfig)(n)&&(Re(n.value),O.AppToaster.show({message:"Value copied"}))}),[]),Rt=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{const o=n.instances.find((t=>t.id===e.id));if(!o)throw new Error("Impossible state");o.inputConfig[t]=(0,c.staticInputPinConfig)(ke),n.connections=n.connections.filter((n=>!(0,c.isInternalConnectionNode)(n.to)||!(n.to.insId===e.id&&n.to.pinId===t)))}));o(n,(0,w.functionalChange)("paste const value"))}),[ee,o,ke]),At=u.useCallback((async e=>{const t=await Le("New name?");if(!t)return;const n=(0,g.produce)(ee,(n=>{var o;"input"===e?(ee.inputs||(n.inputs={}),n.inputs[t]=(0,c.nodeInput)(),n.inputsPosition[t]=tt.current):(ee.outputs||(n.outputs={}),n.outputs[t]=(0,c.nodeOutput)(),n.outputsPosition[t]=tt.current,(null===(o=n.completionOutputs)||void 0===o?void 0:o.length)&&(0,O.toastMsg)("Note that this node has explicit completion outputs set. You may need to update them."))}));o(n,(0,w.functionalChange)("add new io pin")),ue("addIoPin",{type:e})}),[Le,ee,o,ue]),Vt=u.useCallback((async()=>{var e;const t=null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","),n=await Le("Edit completion outputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,g.produce)(ee,(e=>{e.completionOutputs=""===n?void 0:n.split(",")}));o(e,(0,w.functionalChange)("change node completions")),ue("editCompletionOutputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),Ht=u.useCallback((async()=>{var e;const t=null===(e=ee.reactiveInputs)||void 0===e?void 0:e.join(","),n=await Le("Edit reactive inputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,g.produce)(ee,(e=>{e.reactiveInputs=""===n?void 0:n.split(",")}));o(e,(0,w.functionalChange)("change reactive inputs")),ue("editReactiveInputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),$t=u.useCallback((async()=>{const e=await Le("Description?",ee.description),t=(0,g.produce)(ee,(t=>{t.description=e}));o(t,(0,w.functionalChange)("Edit node description"))}),[Le,o,ee]),zt=u.useCallback((e=>{const t=(0,g.produce)(ee,(t=>{t.defaultStyle=e}));o(t,(0,w.functionalChange)("change default style")),ue("changeStyle",{isDefault:!0})}),[o,ee,ue]),Gt=u.useCallback((async(e,t)=>{const n=await Le("New name?",t)||t,i=(0,m.handleIoPinRename)(ee,e,t,n);o(i,(0,w.functionalChange)("rename io pin"))}),[ee,o,Le]),Lt=u.useCallback(((e,t)=>{const n=(0,m.handleChangeNodeInputType)(ee,e,t);o(n,(0,w.functionalChange)("toggle io pin optional"))}),[ee,o]),Ft=u.useCallback((e=>{switch(e.type){case G.ActionType.RemoveNode:{const e=(0,g.produce)(ee,(e=>{if(!(0,c.isVisualNode)(ee))throw new Error("Impossible state, deleting instances opf non visual node");e.instances=e.instances.filter((e=>!pe.includes(e.id))),e.connections=e.connections.filter((e=>!pe.includes(e.from.insId)&&!pe.includes(e.to.insId)))}));K({selected:[]}),o(e,(0,w.functionalChange)("remove-instances")),(0,O.toastMsg)(`Removed ${pe.length} instances(s)`),ue("deleteInstances",{count:pe.length});break}case G.ActionType.Inspect:if(1===pe.length)Z(pe[0]);else if(fe||me){const e=null!=fe?fe:me,t=(0,c.isExternalConnectionNode)(e)?c.ROOT_INS_ID:e.insId;Z(t,{type:fe?"output":"input",id:e.pinId})}ue("openInspectMenu",{source:"actionMenu"});break;case G.ActionType.Group:(async()=>{await Ye()})();break;case G.ActionType.UnGroup:{const e=ee.instances.find((e=>e.id===pe[0]));Dt(e);const t=(0,q.safelyGetNodeDef)(e,le);(0,O.toastMsg)(`Ungrouped inline node ${t.id}`),ue("unGroupNode",{instancesCount:t.instances.length});break}case G.ActionType.AddInlineValue:Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"actionMenu"});break;case G.ActionType.AddNode:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,g.produce)(ee,(e=>{e.instances.push(r)})),u=(0,g.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,w.functionalChange)("add new instance")),K(u),(0,O.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;case G.ActionType.AI:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,g.produce)(ee,(e=>{e.instances.push(r)})),u=(0,g.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,w.functionalChange)("add new instance")),K(u),(0,O.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;default:(0,O.toastMsg)(`${e.type} not supported yet`)}}),[Y,fe,o,K,Ye,re,Z,Dt,ee,le,ue,pe,me,Fe,et]),qt=()=>{const t=Y.from;return(0,p.entries)(Ie).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"input",pos:ve[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,onDblClick:Jt,closest:!(!Ke||"input"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,inputMode:s.mode,onChangeInputMode:Lt,viewPort:Fe,onDragStart:gt,onDragEnd:vt,onDragMove:ht,onSelect:it,onSetDescription:st,selected:(null==t?void 0:t.pinId)===o,description:s.description,onMouseUp:xn,onMouseDown:jn},o)}))},Ut=()=>{const{to:t}=Y;return(0,p.entries)(be).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"output",pos:ye[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,closest:!(!Ke||"output"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,viewPort:Fe,onDragStart:gt,onDragEnd:vt,onDragMove:ht,onSelect:it,onSetDescription:st,description:s.description,selected:(null==t?void 0:t.pinId)===o,onMouseUp:xn,onMouseDown:jn},o)}))},Bt=()=>{if(je){const{from:e,to:t}=je,n=(0,m.logicalPosToRenderedPos)(e,Fe),o=(0,m.logicalPosToRenderedPos)(t,Fe),{x:i,y:s,w:r,h:u}=(0,m.getSelectionBoxRect)(n,o);return(0,a.jsx)("div",{className:"selection-box",style:{top:s,left:i,width:r,height:u}})}return null},Wt=u.useCallback((async(e,t,n,o)=>{if("input"===n){const n=e.inputConfig[t],o=(0,c.isStaticInputPinConfig)(n)?JSON.stringify(n.value):void 0;Ve({type:"static-input",insId:e.id,pinId:t,value:null!=o?o:JSON.stringify("Some static value")}),ue("addValueModalOpen",{source:"dblClickPin"})}else{const i=(0,q.safelyGetNodeDef)(e,le);if(!(0,c.getNodeOutputs)(i)[t])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:o.clientX,y:o.clientY},ins:e,targetNode:i,pinId:t,pinType:n})}}),[le,ue]),Jt=u.useCallback((async(e,t)=>{if(!ee.inputs[e])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:t.clientX,y:t.clientY},pinId:e,pinType:"input",targetNode:ee})}),[ee]),Zt=u.useCallback((e=>{if(e.metaKey||e.ctrlKey){const t=-.005*e.deltaY;lt(Fe.zoom+t,"mouse"),e.preventDefault(),e.stopPropagation()}else{if(se)return;const t=e.deltaX,n=e.deltaY,o=(0,g.produce)(Fe,(e=>{e.pos.x=e.pos.x+t/e.zoom,e.pos.y=e.pos.y+n/e.zoom}));We(o),e.stopPropagation(),e.preventDefault()}}),[se,lt,We,Fe]);(0,h.useEffect)((()=>{const{current:e}=Xe;if(e)return e.addEventListener("wheel",Zt),()=>{e.removeEventListener("wheel",Zt)}}),[Zt]);const Yt={backgroundPositionX:(0,m.roundNumber)(-Fe.pos.x*Fe.zoom),backgroundPositionY:(0,m.roundNumber)(-Fe.pos.y*Fe.zoom),backgroundSize:(0,m.roundNumber)(10*Fe.zoom)+"px"},Kt=u.useRef(new Map);u.useEffect((()=>{const e=ge.reduce(((e,t)=>{const n=(0,q.safelyGetNodeDef)(t,le);return n&&e.set(t.id,(0,c.keys)((0,c.getNodeInputs)(n))),e}),new Map),t=ge.reduce(((e,t)=>{const n=(0,q.safelyGetNodeDef)(t,le);return n&&e.set(t.id,(0,c.keys)((0,c.getNodeOutputs)(n))),e}),new Map);e.set(c.THIS_INS_ID,(0,c.keys)(ee.outputs)),t.set(c.THIS_INS_ID,(0,c.keys)(ee.inputs));const n=he.filter((n=>{const o=e.get(n.to.insId)&&e.get(n.to.insId).includes(n.to.pinId),i=t.get(n.from.insId)&&t.get(n.from.insId).includes(n.from.pinId);return!(o&&i)}));if(n.length>0){(0,O.toastMsg)(`${n.length} orphan connections removed`,"warning"),console.warn(`${n.length} orphan connections removed`,n);const e=(0,g.produce)(ee,(e=>{e.connections=ee.connections.filter((e=>!n.includes(e)))}));o(e,(0,w.functionalChange)("prune orphan connections"))}}),[ge,o,he,ee,le]),u.useEffect((()=>{let e=[];const t=(0,g.produce)(ee,(t=>{t.instances=t.instances.map((t=>{const n=(0,q.safelyGetNodeDef)(t,le);if(n){const o=(0,c.getNodeInputs)(n),i=(0,c.getNodeOutputs)(n);if(t.visibleInputs){const n=t.visibleInputs.filter((e=>!o[e]));n.length>0&&(t.visibleInputs=(0,c.keys)(o),e.push(...n))}if(t.visibleOutputs){const n=t.visibleOutputs.filter((e=>!i[e]));n.length>0&&(t.visibleOutputs=(0,c.keys)(i),e.push(...n))}}return t}))}));e.length>0&&((0,O.toastMsg)(`Found ${e.length} invalid visible inputs/outputs: ${e.join(", ")}. Reset them`,"warning"),o(t,(0,w.functionalChange)("reset corrupt visible inputs/outputs")))}),[ge,o,ee,le]),(0,h.useEffect)((()=>{const e=new Map(ge.map((e=>[e.id,e])));Kt.current=he.reduce(((t,n)=>{const o=t.get(n.to.insId)||{},i=o[n.to.pinId]||[],s={...o,[n.to.pinId]:[...i,e.get(n.from.insId)]};return t.set(n.to.insId,s),t}),new Map)}),[he,ge]);const Qt=u.useCallback((()=>{Te(void 0)}),[]),Xt=u.useCallback((async e=>{if(!Me)throw new Error("impossible state - quick add menu invoked but not available");const{ins:t,pinId:n}=Me;switch(e.type){case"import":case"node":{const i="import"===e.type?await re(e.importableNode):le,s="import"===e.type?e.importableNode.node:e.node,r=(0,m.createNewNodeInstance)(s.id,100,tt.current,i);if(r){const e=(0,g.produce)(ee,(e=>{e.instances.push(r),e.connections.push({from:{insId:t?t.id:c.THIS_INS_ID,pinId:n},to:{insId:r.id,pinId:c.TRIGGER_PIN_ID}})}));o(e,(0,w.functionalChange)("add-item-quick-menu")),Qt()}ue("addNode",{nodeId:s.id,source:"quickAdd"});break}case"value":if(!t)return void(0,O.toastMsg)("Cannot add value to main input");Ve({type:"new-output",insId:t.id,pinId:n}),ue("addValueModalOpen",{source:"quickAdd"})}}),[Me,le,ue,ee,o,Qt,re]),en=u.useCallback((async()=>{const e=JSON.stringify(ee);await navigator.clipboard.writeText(e),O.AppToaster.show({message:"Copied!"})}),[ee]),tn=u.useCallback((()=>{var e,t;const n=i?"":" (cannot edit main node, only visual)";return(0,a.jsxs)(I.Menu,{children:[(0,a.jsx)(I.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"New Value",onClick:(0,p.preventDefaultAnd)((()=>{Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"contextMenu"})}))}),(0,a.jsx)(I.MenuItem,{text:`New input ${n}`,onMouseDown:e=>e.stopPropagation(),onClick:(0,p.preventDefaultAnd)((()=>At("input"))),disabled:!i}),(0,a.jsx)(I.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`New output ${n}`,onClick:(0,p.preventDefaultAnd)((()=>At("output"))),disabled:!i}),(0,a.jsx)(I.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Copy node to clipboard",onClick:(0,p.preventDefaultAnd)(en)}),(0,a.jsx)(I.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Completion Outputs (${(null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Vt()))}),(0,a.jsx)(I.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Reactive inputs (${(null===(t=ee.reactiveInputs)||void 0===t?void 0:t.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Ht()))}),(0,a.jsx)(I.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Edit description",onClick:(0,p.preventDefaultAnd)((()=>$t()))}),(0,a.jsx)(I.MenuDivider,{}),(0,a.jsx)(I.MenuItem,{text:"Default Style",children:(0,a.jsx)($.NodeStyleMenu,{style:ee.defaultStyle,onChange:zt,promptFn:Le})})]})}),[i,en,ee.completionOutputs,ee.reactiveInputs,ee.defaultStyle,zt,Le,ue,At,Vt,Ht,$t]);(0,v.useHotkeys)("shift+c",ot,{text:"Center viewport",group:"Viewport Controls"},[],qe),(0,v.useHotkeys)("cmd+c",at,{text:"Copy instances",group:"Editing"},[],qe),(0,v.useHotkeys)("cmd+v",ut,{text:"Paste instances",group:"Editing"},[],qe),(0,v.useHotkeys)("esc",dt,{text:"Clear selections",group:"Selection"},[],qe),(0,v.useHotkeys)("backspace",jt,{text:"Delete instances",group:"Editing"},[],qe),(0,v.useHotkeys)("shift+d",Nt,{text:"Duplicate selected instances",group:"Editing"},[],qe),(0,v.useHotkeys)("cmd+a",It,{text:"Select all",group:"Selection"},[],qe),(0,v.useHotkeys)("s",ct,{text:"Select pin closest to mouse",group:"Selection"},[],qe);const nn=u.useCallback(((e,t)=>{if(!He)throw new Error("impossible state");const n=(0,g.produce)(ee,(t=>{const n=t.instances.find((e=>e.id===He.insId));if(!n||!(0,c.isInlineNodeInstance)(n))throw new Error("impossible state");n.node=e}));o(n,(0,w.functionalChange)("Inner change: "+t.message)),$e((t=>({...t,node:e})))}),[o,He,ee]),[on,sn]=(0,h.useState)({selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}}),rn=u.useCallback((e=>sn((t=>({...t,...e})))),[]),an=n=>He&&He.insId===n.id?{currentInsId:He.insId,ancestorsInsIds:(0,c.fullInsIdPath)(Q,X),boardData:on,onChangeBoardData:rn,resolvedDependencies:ne,onCopy:s,clipboardData:e.clipboardData,onInspectPin:e.onInspectPin,onGoToNodeDef:e.onGoToNodeDef,nodeIoEditable:e.nodeIoEditable,node:He.node,onChangeNode:nn,onShowOmnibar:te,parentViewport:t.defaultViewPort,parentBoardPos:nt,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:e.queuedInputsData}:void 0,un=()=>{if(fe&&("input"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"output"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:c.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,c.isInternalConnectionNode)(e)&&!(0,c.isInternalConnectionNode)(fe))return;return{from:fe,to:e}}if(me&&("output"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"input"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:c.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,c.isInternalConnectionNode)(me)&&!(0,c.isInternalConnectionNode)(e))return;return{from:e,to:me}}},cn=()=>{const e=un();if(e){const{from:t,to:n}=e;return{connection:{from:t,to:n},type:he.some((t=>(0,c.connectionDataEquals)(t,e)))?"future-remove":"future-add"}}},ln=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleInputs:t}:n))}));o(n,(0,w.functionalChange)("change instance visible inputs"))}),[ee,o]),dn=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,style:t}:n))}));o(n,(0,w.functionalChange)("change instance style")),ue("changeStyle",{isDefault:!1})}),[o,ee,ue]),pn=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleOutputs:t}:n))}));o(n,(0,w.functionalChange)("change instance visible outputs"))}),[ee,o]),fn=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,displayName:t}:n))}));o(n,(0,w.functionalChange)("change instance display name"))}),[ee,o]);u.useImperativeHandle(n,(()=>({centerInstance(e){const t=ee.instances.find((t=>t.id===e));if(t){const e=(0,C.vSub)(t.pos,(0,C.vec)(et.width/2,et.height/2));We({...Fe,pos:e})}},centerViewPort(){ot()},getViewPort:()=>Fe,clearSelection:()=>{dt()},requestNewInlineValue:()=>{Ve({type:"new-floating",pos:tt.current})}})));const[mn,gn]=u.useState([]),hn=u.useCallback(((e,t)=>{const n=t.trim().substr(0,100),i=`Inline-value-${n.substr(0,15).replace(/["'`]/g,"")}`,s=(0,S.createInlineValueNode)({code:t,customView:n,nodeId:i,type:e});switch(Ae.type){case"existing":{const[e]=ee.instances.filter((e=>e.id===Ae.insId)).filter((e=>(0,c.isInlineNodeInstance)(e))).map((e=>e.node));if(!e)throw new Error("Unable to find inline node to save to");const t=(0,c.keys)(e.inputs),n=(0,c.keys)(s.inputs),i=new Set(D.default.difference(t,n)),r=(0,g.produce)(ee,(e=>{e.instances=e.instances.map((e=>e.id===Ae.insId?(0,c.inlineNodeInstance)(e.id,s,e.inputConfig,e.pos):e)),e.connections=e.connections.filter((e=>!(e.to.insId===Ae.insId&&i.has(e.to.pinId))))}));o(r,(0,w.functionalChange)("change inline value")),Ve(void 0);break}case"static-input":{let e;try{const n=t.replace(/^['`]/,'"').replace(/['`]$/,'"');e=JSON.parse(n)}catch(r){return void(0,O.toastMsg)("Input values must not be formulas or code")}const n=(0,g.produce)(ee,(t=>{t.instances.find((e=>e.id===Ae.insId)).inputConfig[Ae.pinId]=(0,c.staticInputPinConfig)(e)}));o(n,(0,w.functionalChange)("set static input value")),Ve(void 0);break}case"new-floating":{const e=(0,c.inlineNodeInstance)((0,c.createInsId)(s),s,{},Ae.pos),t=(0,g.produce)(ee,(t=>{t.instances.push(e)}));o(t,(0,w.functionalChange)("new floating value")),Ve(void 0);break}case"new-output":{const{insId:e,pinId:t}=Ae,n=ee.instances.find((t=>t.id===e));if(!n)throw new Error("Impossible state");const i=(0,c.inlineNodeInstance)((0,c.createInsId)(s),s,{},(0,C.vAdd)(n.pos,{x:-50,y:150})),r=(0,g.produce)(ee,(n=>{n.instances.push(i),n.connections.push({from:(0,c.connectionNode)(e,t),to:(0,c.connectionNode)(i.id,c.TRIGGER_PIN_ID)})}));o(r,(0,w.functionalChange)("new value connected to output")),Ve(void 0)}}ue("addValue",{type:e,placeholdersCount:(0,c.keys)(s.inputs).length})}),[Ae,o,ee,ue]),vn=he.filter((e=>{const t=un();return!t||!(0,c.connectionDataEquals)(t,e)})),yn=u.useCallback((()=>{$e(void 0),sn(t.defaultBoardData)}),[]),In=u.useCallback((e=>{const t=(0,g.produce)(ee,(t=>{const n=t.connections.find((t=>(0,c.connectionDataEquals)(t,e)));n.hidden=!n.hidden}));o(t,(0,w.functionalChange)("toggle connection hidden"))}),[o,ee]),bn=u.useCallback((e=>{const t=(0,g.produce)(ee,(t=>{t.connections=t.connections.filter((t=>!(0,c.connectionDataEquals)(t,e)))}));o(t,(0,w.functionalChange)("remove connection"))}),[o,ee]),Cn=u.useCallback(((e,t,n)=>{Be("input"===n?{to:(0,c.connectionNode)(e.id,t),from:void 0}:{from:(0,c.connectionNode)(e.id,t),to:void 0})}),[]),_n=u.useCallback(((e,t,n)=>{Ue&&(Ue.from&&"input"===n?Ze(Ue.from,(0,c.connectionNode)(e.id,t),"pinDrag"):Ue.to&&"output"===n&&Ze((0,c.connectionNode)(e.id,t),Ue.to,"pinDrag")),Be(null)}),[Ue,Ze]),jn=u.useCallback(((e,t)=>{}),[]),xn=u.useCallback(((e,t)=>{Ue&&(Ue.from&&"output"===t?Ze(Ue.from,(0,c.externalConnectionNode)(e),"nodeIoPinDrag"):Ue.to&&"input"===t&&Ze((0,c.externalConnectionNode)(e),Ue.to,"nodeIoPinDrag"))}),[Ue,Ze]);try{return(0,a.jsxs)(I.ContextMenu,{className:(0,k.default)("visual-node-editor",e.className,{dark:ae}),"data-id":ee.id,content:tn(),disabled:!qe.current,children:[(0,a.jsxs)("main",{className:"board-editor-inner",onMouseDown:Pt,onMouseUp:Ot,onMouseMove:wt,onMouseLeave:Et,ref:Xe,style:Yt,children:[(0,a.jsx)(u.Fragment,{children:(0,a.jsx)(N.LayoutDebugger,{vp:Fe,node:ee,extraDebug:m.emptyList,mousePos:tt.current})}),(0,a.jsx)(d.ConnectionView,{resolvedNodes:le,currentInsId:Q,ancestorsInsIds:X,size:et,node:ee,boardPos:nt,instances:ge,connections:vn,futureConnection:cn(),onDblClick:c.noop,viewPort:Fe,parentVp:ce,selectedInstances:pe,toggleHidden:In,removeConnection:bn,lastMousePos:tt.current,draggedSource:Ue}),qt(),ge.map((t=>{var n,o,i,s,r;return(0,a.jsx)(l.InstanceView,{onUngroup:Dt,onExtractInlineNode:Mt,onDetachConstValue:Tt,onCopyConstValue:kt,onPasteConstValue:Rt,copiedConstValue:ke,connectionsPerInput:Kt.current.get(t.id)||m.emptyObj,node:(0,q.safelyGetNodeDef)(t,le),ancestorsInsIds:(0,c.fullInsIdPath)(Q,X),onPinClick:rt,onPinDblClick:Wt,onDragStart:pt,onDragEnd:mt,resolvedDeps:le,onDragMove:ft,onDblClick:St,onSelect:yt,onToggleSticky:xt,selected:-1!==pe.indexOf(t.id),dragged:Ce===t.id,onInspectPin:Je,selectedInput:me&&(0,c.isInternalConnectionNode)(me)&&me.insId===t.id?me.pinId:void 0,selectedOutput:fe&&(0,c.isInternalConnectionNode)(fe)&&fe.insId===t.id?fe.pinId:void 0,closestPin:Ke&&Ke.ins.id===t.id?Ke:void 0,queuedInputsData:null!==(n=oe[t.id])&&void 0!==n?n:m.emptyObj,instance:t,connections:he,onTogglePinBreakpoint:c.noop,onTogglePinLog:c.noop,viewPort:Fe,onChangeVisibleInputs:ln,onChangeVisibleOutputs:pn,onSetDisplayName:fn,onDeleteInstance:Ct,forceShowMinimized:fe||(null===(o=null==Ue?void 0:Ue.to)||void 0===o?void 0:o.insId)===t.id?"input":me||(null===(i=null==Ue?void 0:Ue.from)||void 0===i?void 0:i.insId)===t.id?"output":void 0,isConnectedInstanceSelected:pe.some((e=>he.some((n=>{let{from:o,to:i}=n;return o.insId===t.id&&i.insId===e||o.insId===e&&i.insId===t.id})))),inlineGroupProps:an(t),onCloseInlineEditor:yn,inlineEditorPortalDomNode:ze.current,onChangeStyle:dn,onGroupSelected:Ye,onPinMouseDown:Cn,onPinMouseUp:_n,hadError:null!==(r=null===(s=e.instancesWithErrors)||void 0===s?void 0:s.has((0,c.fullInsIdPath)(t.id)))&&void 0!==r&&r},t.id)})),Bt(),Ut(),(0,a.jsx)(L.MainInstanceEventsIndicator,{currentInsId:Q,ancestorsInsIds:X,viewPort:Fe}),Me?(0,a.jsx)(_.QuickAddMenu,{targetNode:Me.targetNode,pinId:Me.pinId,pinType:Me.pinType,pos:Me.pos,resolvedDependencies:ne,node:ee,onAdd:Xt,onClose:Qt}):null,(0,a.jsxs)("div",{className:"viewport-controls-and-help",children:[(0,a.jsx)(I.Button,{small:!0,onClick:ot,minimal:!0,intent:"primary",children:"Center"}),(0,a.jsx)(B,{min:.15,max:3,stepSize:.05,labelStepSize:10,labelRenderer:W,onChange:lt,value:Fe.zoom}),Ne?(0,a.jsx)(F.HelpBubble,{}):null]}),Ae?(0,a.jsx)(E.InlineCodeModal,{env:m.emptyObj,initialValue:Ae.value,initialType:"existing"===Ae.type?Ae.templateType:void 0,onCancel:()=>Ve(void 0),onSubmit:hn}):null,(0,a.jsx)("div",{className:"inline-editor-portal-root"})]}),(0,a.jsx)(G.ActionsMenu,{showRunFlowOptions:Ne,onAction:Ft,selectedInstances:pe,node:ee,resolvedNodes:le,to:me,from:fe,hotkeysEnabled:qe})]})}catch(Nn){return console.error(Nn),(0,a.jsxs)("div",{children:["Error rendering board - ",Nn.toString()]})}})));const J=(e,t)=>{const n=e.target.closest(".visual-node-editor");return n&&n.getAttribute("data-id")===t}},83234:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeView=void 0;const a=n(35250),u=s(n(70079)),c=r(n(26372)),l=r(n(59349)),d=n(30653);t.BaseNodeView=function(e){const{dragged:t,viewPort:n,pos:o,onDragEnd:i,onDragMove:s,onDragStart:r,displayMode:p}=e,f=(0,d.useDarkMode)(),m=u.useCallback(((e,t)=>{r(e,t)}),[r]),g=u.useCallback(((e,t)=>{const s=o,r=(t.x-s.x)/n.zoom,a=(t.y-s.y)/n.zoom,u=s.x+r,c=s.y+a;i(e,{...t,x:u,y:c})}),[o,i,n]),h=u.useCallback(((e,t)=>{s(e,{x:t.x,y:t.y})}),[s]),v={transform:`scale(${n.zoom})`},y=(0,c.default)("base-node-view",e.className,{dragged:t,dark:f,"display-mode":p}),I=o.x*n.zoom-n.pos.x*n.zoom,b=o.y*n.zoom-n.pos.y*n.zoom,C={transform:`translate(${I-o.x}px, ${b-o.y}px)`},_=(0,c.default)("base-node-view-vp-fixer",{"display-mode":p}),j=(0,a.jsx)("span",{className:"base-node-view-wrapper",children:(0,a.jsx)("div",{className:y,style:v,id:e.domId,children:e.children})});return(0,a.jsx)("div",{className:_,style:C,children:(0,a.jsx)(l.default,{onStop:g,onStart:m,onDrag:h,position:o,cancel:".no-drag",children:j})})}},80510:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleConnectionCloseEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleConnectionCloseEditorCommand=(e,t)=>{let{from:n,to:o}=t;return(0,s.default)(e,(e=>{const t=e.connections.find((e=>{const t=(0,i.connectionNodeEquals)(n,e.from),s=(0,i.connectionNodeEquals)(o,e.to);return t&&s}));t?e.connections=e.connections.filter((e=>e!==t)):e.connections.push({from:n,to:o})}))}},1788:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDetachConstEditorCommand=void 0;const i=n(74762),s=o(n(53865)),r=n(68371);t.handleDetachConstEditorCommand=(e,t,n)=>(0,s.default)(e,(e=>{const{instances:o}=e,s=o.find((e=>e.id===t));if(!s)throw new Error("Impossible state ins id with no matching instance");const a=s.inputConfig[n];if(!a)throw new Error("impossible state detaching const from unexistent config");if(!(0,i.isStaticInputPinConfig)(a))throw new Error("impossible state detaching const with no value");const u=JSON.stringify(a.value),c=(0,r.createInlineValueNode)({code:`${u}`,type:i.InlineValueNodeType.VALUE}),l=(0,i.inlineNodeInstance)(`value-${(0,i.randomInt)(999)}`,c,{},{x:s.pos.x,y:s.pos.y-100});if(!e.instances.find((e=>e.id===s.id)))throw new Error("impossible state instance not found");s.inputConfig[n]=(0,i.queueInputPinConfig)(),e.instances.push(l),e.connections.push((0,i.connectionData)(`${l.id}.value`,`${s.id}.${n}`))}))},2130:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDuplicateSelectedEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleDuplicateSelectedEditorCommand=(e,t)=>{const n=[];return{newNode:(0,s.default)(e,(o=>{const s=o.instances;t.forEach((t=>{const o=s.find((e=>e.id===t));if(!o)throw new Error("impossible state duplicate selected no matching instance");if(o){const{pos:t}=o,r={...o,pos:{x:t.x+20,y:t.y+20},id:(0,i.createInsId)(e)};s.push(r),n.push(r.id)}}))})),newInstances:n}}},25044:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.pasteInstancesCommand=void 0;const i=n(74762),s=o(n(53865));t.pasteInstancesCommand=(e,t,n)=>{const o=n.instances.map((n=>({...n,pos:t,id:(0,i.createInsId)(e)}))),r=new Map(o.map(((e,t)=>[n.instances[t].id,e.id])));return{newNode:(0,s.default)(e,(e=>{e.instances.push(...o);const t=n.connections.map((e=>{let{from:t,to:n}=e;return{from:{...t,insId:r.get(t.insId)||t.insId},to:{...n,insId:r.get(n.insId)||n.insId}}}));e.connections.push(...t)})),newInstances:o}}},65082:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionView=t.SingleConnectionView=void 0;const a=n(70079),u=n(35250),c=s(n(70079)),l=r(n(26372)),d=n(74762),p=n(18243),f=n(77852),m=n(74089),g=n(60190),h=n(50382),v=n(76064),y=n(41032);t.SingleConnectionView=e=>{const{isBrowser:t}=(0,f.useSsr)(),{connection:n,node:o,resolvedNodes:i,instances:s,type:r,viewPort:a,toggleHidden:c,parentSelected:m,removeConnection:I}=e,{from:b}=n,C=(0,d.isInternalConnectionNode)(b)&&s.find((e=>e.id===b.insId));if(!C&&(0,d.isInternalConnectionNode)(b))throw new Error(`impossible state - "from instance id - [${b.insId}] does not exist"`);const _=((0,d.isInternalConnectionNode)(b)&&C?(0,y.safelyGetNodeDef)(C,i):o).outputs[b.pinId],j=_&&_.delayed,x=t?(0,p.calcStartPos)({...e,connectionNode:b}):{x:0,y:0},N=t?(0,p.calcTargetPos)({...e,connectionNode:n.to}):{x:0,y:0},{x:P,y:O}=(0,g.vDiv)(x,e.parentVp.zoom),{x:w,y:E}=(0,g.vDiv)(N,e.parentVp.zoom),S=(0,l.default)({delayed:j,hidden:n.hidden,"parent-selected":m},r),D=(0,u.jsxs)(h.Menu,{children:[(0,u.jsx)(h.MenuItem,{text:n.hidden?"Show connection":"Hide connection",onClick:()=>c(n)}),(0,u.jsx)(h.MenuItem,{text:"Remove connection",onClick:()=>I(n)})]});return(0,u.jsx)(h.ContextMenu,{content:D,children:e=>(0,u.jsx)(v.ConnectionViewPath,{className:S,from:{x:P,y:O},to:{x:w,y:E},dashed:"regular"!==r,zoom:a.zoom,onContextMenu:e.onContextMenu})})};t.ConnectionView=e=>{var n;const{viewPort:o,futureConnection:i,toggleHidden:s,selectedInstances:r,draggedSource:l}=e,[d,f]=c.useState(0),g=c.useCallback((e=>requestAnimationFrame((()=>{f((e=>(e+1)%9)),e>0&&g(e-1)}))),[]);c.useEffect((()=>{const e=g(10);return()=>{cancelAnimationFrame(e)}}),[g]),c.useEffect((()=>{const e=()=>{g(3)};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[g,d]);const h=e.connections.map((n=>{const o=r.includes(n.from.insId)||r.includes(n.to.insId);return(0,a.createElement)(t.SingleConnectionView,{...e,connection:n,type:"regular",parentSelected:o,key:n.from.insId+n.from.pinId+n.to.insId+n.to.pinId})}));if(i&&h.push((0,a.createElement)(t.SingleConnectionView,{...e,connection:i.connection,type:i.type,toggleHidden:s,parentSelected:!1,key:"future"})),l){const t=(l.from?p.calcStartPos:p.calcTargetPos)({connectionNode:null!==(n=l.from)&&void 0!==n?n:l.to,viewPort:o,boardPos:e.boardPos,ancestorsInsIds:e.ancestorsInsIds,currentInsId:e.currentInsId});h.push((0,u.jsx)(v.ConnectionViewPath,{className:"dragged",from:t,to:(0,m.logicalPosToRenderedPos)(e.lastMousePos,o),zoom:o.zoom},"dragged"))}return(0,u.jsx)("svg",{className:"connections-view",children:h})}},76064:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionViewPath=void 0;const i=n(35250),s=o(n(26372)),r=n(70079),a=n(23381);t.ConnectionViewPath=(0,r.forwardRef)(((e,t)=>{const{from:n,to:o,className:r,onContextMenu:u,zoom:c,dashed:l}=e,{x:d,y:p}=n,{x:f,y:m}=o,g=(0,a.calcBezierPath)({sourceX:d,sourceY:p,targetX:f,targetY:m,curvature:.15}),h=2.5*c,v=l?6*c:void 0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:g,ref:t,className:(0,s.default)("connection",r),style:{strokeWidth:h,strokeDasharray:v},onContextMenu:u}),e.label?(0,i.jsx)("text",{className:"label",x:(d+f)/2,y:(p+m)/2,fontSize:"12px"}):null,(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%"}),(0,i.jsx)("stop",{offset:"100%"})]})]})}))},23381:(e,t)=>{"use strict";var n;function o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i(e){let t,i,{pos:s,x1:r,y1:a,x2:u,y2:c,c:l}=e;switch(s){case n.Left:t=r-o(r-u,l),i=a;break;case n.Right:t=r+o(u-r,l),i=a;break;case n.Top:t=r,i=a-o(a-c,l);break;case n.Bottom:t=r,i=a+o(c-a,l)}return[t,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.getBezierCenter=t.calcBezierPath=t.Position=void 0,function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(n=t.Position||(t.Position={}));t.calcBezierPath=e=>{let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:c=.25}=e;const[l,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:c}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:c});return`M${t},${o} C${l},${d} ${p},${f} ${r},${a}`},t.getBezierCenter=function(e){let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:c=.25}=e;const[l,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:c}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:c}),m=.125*t+.375*l+.375*p+.125*r,g=.125*o+.375*d+.375*f+.125*a;return[m,g,Math.abs(m-t),Math.abs(g-o)]}},18243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcTargetPos=t.calcStartPos=t.calcPinPosition=void 0;const o=n(74762),i=n(30994),s={x:99999,y:99999};function r(e){const t=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds),pinId:e.pinId,pinType:e.pinType,isMain:e.isMain});return((e,t,n,o)=>{if(!e)return console.warn(`Cannot find element ${n} to calculate position.`),s;const{x:i,y:r,width:a,height:u}=e.getBoundingClientRect(),c=r+u/2;return{x:i+a/2-t.x,y:c-t.y}})(document.getElementById(t),e.boardPos,t,e.viewPort)}t.calcPinPosition=r;t.calcStartPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"input",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"output",boardPos:n,viewPort:s})};t.calcTargetPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"output",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"input",boardPos:n,viewPort:s})}},30994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPinDomId=t.getMainInstanceIndicatorDomId=t.getInstanceDomId=void 0;const o=n(74762);t.getInstanceDomId=(e,t)=>`ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getMainInstanceIndicatorDomId=(e,t)=>`main-ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getPinDomId=e=>{let{pinType:t,fullInsIdPath:n,pinId:o,isMain:i}=e;return`${i?"main-":""}pin:${t}:${n}:${o}`.replace(/\s+/g,"-")}},86553:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceView=t.getVisibleOutputs=t.getVisibleInputs=t.INSTANCE_INFO_TOOLTIP_DELAY=t.MAX_INSTANCE_WIDTH=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0;const a=n(70079),u=n(35250),c=s(n(70079)),l=n(66074),d=n(74762),p=r(n(26372)),f=n(2036),m=n(74762),g=n(74762),h=n(53159),v=n(83234),y=n(74762),I=n(30994),b=n(63521),C=n(74089),_=n(50382),j=r(n(99581)),x=n(88593),N=n(30653);t.PIECE_HORIZONTAL_PADDING=25,t.PIECE_CHAR_WIDTH=11,t.MIN_WIDTH_PER_PIN=40,t.MAX_INSTANCE_WIDTH=400,t.INSTANCE_INFO_TOOLTIP_DELAY=400;t.getVisibleInputs=(e,t,n)=>{const{visibleInputs:o}=e;if(o)return o;const i=(0,d.keys)((0,g.getNodeInputs)(t)).filter(((o,i)=>{var s;const r=n.some((t=>t.to.insId===e.id&&t.to.pinId===o)),a=t.inputs[o]&&"optional"===(null===(s=t.inputs[o])||void 0===s?void 0:s.mode);return r||!a&&o!==m.TRIGGER_PIN_ID}));return 0===i.length?[m.TRIGGER_PIN_ID]:i};t.getVisibleOutputs=(e,t,n)=>{const{visibleOutputs:o}=e;if(o)return o;const i=Object.keys(t.outputs);return n.some((t=>t.from.insId===e.id&&t.from.pinId===m.ERROR_PIN_ID))?[...i,m.ERROR_PIN_ID]:i};t.InstanceView=function(e){const{selected:n,selectedInput:o,selectedOutput:i,closestPin:s,dragged:r,onTogglePinLog:P,onTogglePinBreakpoint:O,onDetachConstValue:w,onCopyConstValue:E,onPasteConstValue:S,displayMode:D,connections:M,instance:T,viewPort:k,node:R,onPinClick:A,onPinDblClick:V,onDragStart:H,onDragEnd:$,onDragMove:z,onToggleSticky:G,onSelect:L,onDblClick:F,onChangeVisibleInputs:q,onChangeVisibleOutputs:U,onConvertConstToEnv:B,inlineGroupProps:W,onUngroup:J,onExtractInlineNode:Z,onGroupSelected:Y,isConnectedInstanceSelected:K,inlineEditorPortalDomNode:Q,onChangeStyle:X,onDeleteInstance:ee,onSetDisplayName:te,onPinMouseUp:ne,onPinMouseDown:oe}=e,ie=(0,N.useDarkMode)(),{id:se}=T,re=c.useMemo((()=>{const e=(0,d.randomInt)(6,1);return{icon:(0,d.pickRandom)([["fab","discord"],["fab","slack"],"bug","cube"]),color:e,size:(0,d.randomInt)(3,1),variation:(0,d.randomInt)(5,1)}}),[]),ae=c.useRef(),ue=c.useMemo((()=>T.style||R.defaultStyle||{}),[R,T]),ce=ue.size||"regular",le=c.useMemo((()=>new Map(M.filter((e=>{let{to:t}=e;return t.insId===se})).map((e=>{let{to:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),de=c.useMemo((()=>new Map(M.filter((e=>{let{from:t}=e;return t.insId===se})).map((e=>{let{from:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),pe=(0,C.usePrompt)(),fe=c.useCallback((e=>A(T,e,"input")),[T,A]),me=c.useCallback(((e,t)=>V(T,e,"input",t)),[T,V]),ge=c.useCallback(((e,t)=>V(T,e,"output",t)),[T,V]),he=c.useCallback((e=>A(T,e,"output")),[T,A]),ve=c.useCallback(((e,t)=>{H(T,e,t)}),[T,H]),ye=c.useCallback(((e,t)=>{const n=T.pos,o=(t.x-n.x)/k.zoom,i=(t.y-n.y)/k.zoom,s=n.x+o,r=n.y+i;$(T,e,{...t,x:s,y:r})}),[T,$,k.zoom]),Ie=c.useCallback(((e,t)=>{z(T,e,{x:t.x,y:t.y})}),[T,z]),be=c.useCallback((e=>G(T,e)),[T,G]),Ce=c.useCallback((e=>w(T,e)),[T,w]),_e=c.useCallback((e=>E(T,e)),[T,E]),je=c.useCallback((e=>S(T,e)),[T,S]),xe=c.useCallback((e=>L(T,e)),[T,L]),Ne=c.useCallback((e=>F(T,e.shiftKey)),[T,F]),Pe=(0,d.entries)(R.inputs),{visibleInputs:Oe,visibleOutputs:we}=T;Oe&&Pe.sort(((e,t)=>Oe.indexOf(e[0])-Oe.indexOf(t[0])));const Ee=(0,d.entries)(R.outputs);we&&Ee.sort(((e,t)=>we.indexOf(e[0])-we.indexOf(t[0])));const Se=(0,t.getVisibleInputs)(T,R,M),De=(0,t.getVisibleOutputs)(T,R,M);Pe.push([m.TRIGGER_PIN_ID,{...(0,d.nodeInput)(),description:"Use this pin to manually trigger the node. If not connected, the node will be triggered automatically when all required inputs have data."}]),Ee.push([m.ERROR_PIN_ID,{...(0,m.nodeOutput)(),description:"Use this pin to catch errors that happen inside this node. If not connected, errors will bubble up to the parent node."}]);const Me=Pe.filter((e=>{let[t]=e;return Se.includes(t)||(n||K)&&le.has(t)})),Te=Ee.filter((t=>{let[o]=t;return De.includes(o)||(n||K)&&de.has(o)||o===m.ERROR_PIN_ID&&e.hadError})),ke=M.some((e=>e.from.insId===se&&e.from.pinId===m.ERROR_PIN_ID)),Re=(0,p.default)("ins-view",{"no-inputs":0===Pe.length,"no-outputs":0===Ee.length,"display-mode":D,"force-minimized-input":"input"===e.forceShowMinimized||"both"===e.forceShowMinimized,"force-minimized-output":"output"===e.forceShowMinimized||"both"===e.forceShowMinimized,"inline-node-edited":!!W,"error-caught":ke}),Ae=(0,p.default)({selected:n,dragged:r,closest:s&&s.ins.id===T.id},`size-${ce}`),Ve=new Set((0,d.entries)(R.inputs).filter((e=>{let[t,n]=e;return(0,m.isInputPinOptional)(n)})).map(d.pickFirst)),He=(0,d.entries)(T.inputConfig).reduce(((e,t)=>{let[n,o]=t;return(0,m.isStickyInputPinConfig)(o)||o.sticky?{...e,[n]:!0}:e}),{}),$e=(0,h.calcNodeContent)(T,R),ze=e=>{const t=T.inputConfig[e];if((0,y.isStaticInputPinConfig)(t))return t.value},Ge=c.useCallback((async()=>{const e=(0,d.okeys)(R.inputs),t=await pe("New order?",(T.visibleInputs||e).join(","));t&&q(T,t.split(","))}),[R.inputs,pe,T,q]),Le=c.useCallback((async()=>{const e=(0,d.okeys)(R.outputs),t=await pe("New order?",(T.visibleOutputs||e).join(","));t&&U(T,t.split(","))}),[R.outputs,pe,T,U]),Fe=c.useCallback((()=>{ee(T)}),[ee,T]),qe=c.useCallback((async()=>{const e=await pe("Set custom display name",T.displayName||R.id);te(T,e)}),[pe,T,te,R.id]),Ue=Object.keys((0,g.getNodeInputs)(R)),Be=Object.keys((0,d.getNodeOutputs)(R)),We=c.useCallback((e=>{B&&B(T,e)}),[T,B]),Je=c.useCallback(((e,t)=>{ne&&ne(T,e,t)}),[T,ne]),Ze=c.useCallback(((e,t)=>{oe&&oe(T,e,t)}),[T,oe]),Ye=()=>(0,u.jsx)("div",{className:"inputs no-drag",children:Me.map((t=>{let[i,r]=t;var a;return(0,u.jsx)(f.PinView,{type:"input",currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,id:i,optional:Ve.has(i),connected:le.has(i),isSticky:He[i],minimized:!n&&1===Me.length,onToggleSticky:be,onDetachConstValue:Ce,onCopyConstValue:_e,onPasteConstValue:je,copiedConstValue:e.copiedConstValue,selected:i===o,onClick:fe,onDoubleClick:me,isClosestToMouse:!!s&&"input"===s.type&&s.pin===i,onToggleLogged:P,onToggleBreakpoint:O,onInspect:e.onInspectPin,constValue:ze(i),onConvertConstToEnv:e.onConvertConstToEnv?We:void 0,description:r.description,queuedValues:null!==(a=e.queuedInputsData[i])&&void 0!==a?a:0,onMouseUp:Je,onMouseDown:Ze},i)}))}),Ke=()=>(0,u.jsx)("div",{className:"outputs no-drag",children:Te.map((t=>{let[o,r]=t;return(0,u.jsx)(f.PinView,{currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,connected:de.has(o),type:"output",id:o,minimized:!n&&1===Te.length,isClosestToMouse:!!s&&"output"===s.type&&s.pin===o,selected:o===i,onClick:he,onDoubleClick:ge,onToggleLogged:P,onToggleBreakpoint:O,onInspect:e.onInspectPin,description:r.description,onMouseUp:Je,onMouseDown:Ze},o)}))}),Qe=c.useCallback((e=>{X(T,e)}),[T,X]),Xe=c.useCallback((()=>{const e=[...Ue.map((e=>{const t=Se.includes(e),n=le.has(e)&&!0!==le.get(e),o=(0,d.getInputName)(e);return{text:t?n?`Hide input "${o}" (disconnect first)`:`Hide input "${o}"`:`Show input "${o}"`,onClick:()=>q(T,t?Se.filter((t=>t!==e)):[...Se,e]),disabled:n&&t}})),...Be.map((e=>{const t=De.includes(e),n=de.has(e),o=(0,d.getOutputName)(e);return{text:t?n?`Hide output "${o}" (disconnect first)`:`Hide output "${o}"`:`Show output "${o}"`,onClick:()=>U(T,t?De.filter((t=>t!==e)):[...De,e]),disabled:n&&t}})),...(0,d.isInlineNodeInstance)(T)&&(0,g.isVisualNode)(T.node)?[{text:"Ungroup inline node",onClick:()=>J(T)}]:[],...(0,d.isInlineNodeInstance)(T)?[{text:"Extract inline node to file",onClick:()=>Z(T)}]:[],{text:"Reorder inputs",onClick:Ge},{text:"Reorder outputs",onClick:Le},{text:"Set display name",onClick:qe},{text:"Group selected instances",onClick:Y},{text:"Delete instance",intent:"danger",onClick:Fe}];return(0,u.jsxs)(_.Menu,{children:[(0,u.jsx)(_.MenuItem,{text:"Style",children:(0,u.jsx)(x.NodeStyleMenu,{style:ue,onChange:Qe,promptFn:pe})}),e.map(((e,t)=>(0,a.createElement)(_.MenuItem,{...e,key:t})))]})}),[Ue,Be,T,Ge,Le,qe,Fe,ue,Qe,pe,Se,le,q,De,de,U,J,Z,Y]),et={"--node-color":ue.color,...ue.cssOverride||{}},tt=(0,I.getInstanceDomId)(T.id,e.ancestorsInsIds);return(0,u.jsx)("div",{className:Re,children:(0,u.jsx)(v.BaseNodeView,{pos:T.pos,viewPort:k,onDragStart:ve,onDragMove:Ie,onDragEnd:ye,upperRenderer:Ye,bottomRenderer:Ke,displayMode:D,domId:tt,children:(0,u.jsxs)(c.Fragment,{children:[Ye(),W?j.default.createPortal((0,u.jsxs)("div",{className:"inline-group-editor-container no-drag",children:[(0,u.jsxs)("header",{children:[$e," ",(0,u.jsx)("button",{onClick:e.onCloseInlineEditor,children:"close"})]}),(0,u.jsx)(b.VisualNodeEditor,{...e.inlineGroupProps,className:"no-drag",ref:ae})]}),Q):(0,u.jsx)(_.ContextMenu,{className:(0,p.default)("ins-view-inner",Ae,`size-${re.size}`,{dark:ie}),onClick:xe,onDoubleClick:Ne,content:Xe(),style:et,children:(0,u.jsx)(_.Tooltip,{content:R.description,children:(0,u.jsxs)(c.Fragment,{children:[ue.icon?(0,u.jsx)(l.FontAwesomeIcon,{icon:ue.icon}):null," ",$e]})})}),Ke()]})})})}},53568:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStyleMenu=t.nodeStylePresetColors=void 0;const r=n(35250),a=n(50382),u=s(n(70079)),c=n(84472);t.nodeStylePresetColors=[{name:"Amethyst",color:"#9b5de5"},{name:"Magenta",color:"#f15bb5"},{name:"Yellow",color:"#fee440"},{name:"Capri",color:"#00bbf9"},{name:"Sea Green",color:"#00f5d4"},{name:"Orange",color:"#ff7f00"}];const l={size:"regular"};t.NodeStyleMenu=e=>{var n;const{onChange:o,style:i}=e,s=i||l,d=e.promptFn,p=u.default.useCallback(((e,t)=>{o({...s,[e]:t})}),[s,o]),f=u.default.useCallback((async()=>{const e=await d("Icon name? (Font Awesome conventions)","rocket"),t=e.includes(",")?e.split(","):e;p("icon",t)}),[d,p]),m=(0,u.useCallback)((async()=>{const e=await d("Enter a custom style (valid JSON representing a React CSS object)",s.cssOverride?JSON.stringify(s.cssOverride):"");try{const t=JSON.parse(e);p("cssOverride",t)}catch(t){console.error(t),(0,c.toastMsg)("Invalid object","danger")}}),[d,p,s.cssOverride]);return(0,r.jsxs)(u.default.Fragment,{children:[(0,r.jsxs)(a.MenuItem,{text:"Color",children:[t.nodeStylePresetColors.map((e=>(0,r.jsx)(a.MenuItem,{text:e.name,onClick:()=>p("color",e.color)},e.name))),(0,r.jsx)(a.MenuDivider,{}),(0,r.jsx)(a.MenuItem,{text:"Remove Color",onClick:()=>p("color",void 0)})]}),(0,r.jsxs)(a.MenuItem,{text:`Size (${null!==(n=s.size)&&void 0!==n?n:"regular"})`,children:[(0,r.jsx)(a.MenuItem,{text:"Small",onClick:()=>p("size","small")}),(0,r.jsx)(a.MenuItem,{text:"Regular",onClick:()=>p("size","regular")}),(0,r.jsx)(a.MenuItem,{text:"Large",onClick:()=>p("size","large")})]}),(0,r.jsxs)(a.MenuItem,{text:"Icon",children:[(0,r.jsx)(a.MenuItem,{text:"Choose Icon",onClick:f}),(0,r.jsx)(a.MenuItem,{text:"Remove Icon",onClick:()=>p("icon",void 0)})]}),(0,r.jsx)(a.MenuItem,{text:"Custom Styling",onClick:m})]})}},88593:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(53568),t)},83651:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86553),t)},53159:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calcInstancePosition=t.calcNodeWidth=t.calcNodeContent=void 0;const i=n(74762),s=o(n(6576)),r=n(86553),a=n(61888),u=n(30994);t.calcNodeContent=(e,t)=>{if(e.displayName)return e.displayName;if(t.customViewCode)try{const n=Object.entries(e.inputConfig).filter((e=>{let[,t]=e;return(0,i.isStaticInputPinConfig)(t)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o.value}}),{});return s.default.compile(t.customViewCode)({inputs:n}).trim()}catch(n){return console.error("Error with custom view",n),`Error in custom view [${t.id}]`}return t.id};t.calcNodeWidth=(e,n)=>{const o=(0,i.okeys)(n.inputs).length*r.MIN_WIDTH_PER_PIN,s=(0,t.calcNodeContent)(e,n),u=r.PIECE_CHAR_WIDTH;return(0,a.clamp)(s.length*u+2*r.PIECE_HORIZONTAL_PADDING,o,r.MAX_INSTANCE_WIDTH)};t.calcInstancePosition=(e,t,n)=>{const o=(0,u.getInstanceDomId)(e,t),i=document.getElementById(o);if(i){const{x:e,y:t,width:o,height:s}=i.getBoundingClientRect(),r=t+s/2;return{x:e+o/2-n.x,y:r-n.y}}return console.warn("Cannot find element to draw connection to",o),{x:99999,y:99999}}},17841:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutDebugger=t.LayoutDebuggerItem=t.PosDebugger=void 0;const i=n(70079),s=n(35250),r=n(74762),a=o(n(70079)),u=n(7047),c=e=>{let{pos:t}=e;return(0,s.jsxs)("span",{children:[t.x.toFixed(1),", ",t.y.toFixed(1)]})};t.PosDebugger=e=>(0,s.jsx)("span",{className:"pos-debugger",children:(0,s.jsx)(c,{pos:e.pos})});t.LayoutDebuggerItem=e=>{const{pos:n,viewPort:o,size:i,color:r}=e,a=o.zoom,u=n.x*a-o.pos.x*a,c=n.y*a-o.pos.y*a,l={transform:`translate(${u-n.x}px, ${c-n.y}px)`},d={transform:`scale(${o.zoom})`},p={transform:`translate(${n.x}px, ${n.y}px)`},f={width:`${i.width}px`,height:`${i.height}px`,backgroundColor:r};return(0,s.jsx)("div",{className:"layout-debugger",style:l,children:(0,s.jsxs)("span",{className:"drag-sim",style:p,children:[(0,s.jsx)(t.PosDebugger,{pos:n}),(0,s.jsx)("div",{className:"layout-debugger-zoom-wrapper",style:d,children:(0,s.jsx)("div",{className:"layout-debugger-inner",style:f})})]})})};const l=(()=>{try{return"true"===localStorage.getItem("pos-debugger")}catch(e){return!1}})();t.LayoutDebugger=e=>{const{extraDebug:n,vp:o,node:d,mousePos:p}=e;if(!l)return null;const f=n.map(((e,n)=>(0,i.createElement)(t.LayoutDebuggerItem,{...e,key:n}))),m=[...d.instances.map((e=>e.pos)),...(0,r.values)(d.inputsPosition),...(0,r.values)(d.outputsPosition)].map((e=>(0,s.jsx)(t.LayoutDebuggerItem,{pos:e,viewPort:o,size:{width:0,height:0},color:"red"}))),g=(0,u.logicalPosToRenderedPos)(p,o),h=(0,s.jsxs)("div",{className:"viewport-data",children:[(0,s.jsxs)("div",{children:["Pos: ",(0,s.jsx)(c,{pos:o.pos})]}),(0,s.jsxs)("div",{children:["Zoom: ",o.zoom.toFixed(2)," "]}),(0,s.jsxs)("div",{children:["Mouse (logical): ",(0,s.jsx)(c,{pos:p})]}),(0,s.jsxs)("div",{children:["Rendered (rendered): ",(0,s.jsx)(c,{pos:g})]})]});return(0,s.jsxs)(a.default.Fragment,{children:[h,f,m]})}},44338:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(17841),t)},38259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateInstancesWithSingleConstPinsMap=t.getLeafInstancesOfSelection=void 0;t.getLeafInstancesOfSelection=(e,t,n)=>e.reduce(((e,o)=>[...e,...n.filter((e=>e.to.insId===o.id)).map((e=>t.find((t=>t.id===e.from.insId)))).filter((e=>!!e))]),[]).filter((t=>1===n.filter((e=>e.from.insId===t.id||e.to.insId===t.id)).length&&!e.includes(t)));t.calculateInstancesWithSingleConstPinsMap=(e,t)=>{const{connections:n}=e;return n.filter((e=>t.has(e.from.insId))).reduce(((e,n)=>{const o=t.get(n.from.insId),i=n.to.insId,s=e.get(i)||new Map;return s.set(n.to.pinId,{val:o,insId:n.from.insId}),e.set(i,s),e}),new Map)}},37488:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeIoView=void 0;const a=n(35250),u=n(70079),c=s(n(70079)),l=n(74762),d=n(83234),p=r(n(26372)),f=n(50382),m=n(43490),g=n(66189),h=n(74762),v=n(30994),y=n(30653);t.NodeIoView=c.memo((function(e){const{viewPort:t,selected:n,pos:o,type:i,id:s,onDblClick:r,onRename:I,onDelete:b,onChangeInputMode:C,inputMode:_,onSelect:j,closest:x,onSetDescription:N,description:P,onMouseUp:O,onMouseDown:w,currentInsId:E}=e,{history:S,resetHistory:D,refreshHistory:M}=(0,g.useHistoryHelpers)(E,s,i),T=(0,m.usePrompt)(),k=c.useCallback((async()=>{const e=await T("Description?",P);N(i,s,e)}),[T,P,N,i,s]),R=c.useCallback((()=>{b&&b(i,s)}),[i,s,b]),A=c.useCallback((()=>{I&&I(i,s)}),[i,s,I]),V=c.useCallback((e=>{C&&C(s,e)}),[s,C]),H=c.useCallback((()=>[{text:`Current mode - ${_}`,onClick:l.noop},{text:"Make required",onClick:()=>V("required")},{text:"Make optional",onClick:()=>V("optional")},{text:"Make required-if-connected",onClick:()=>V("required-if-connected")},{text:"Set description",onClick:k},...e.onRename?[{text:"Rename",onClick:A}]:[],...e.onDelete?[{text:"Delete",onClick:R}]:[]]),[k,_,V,R,A,e.onDelete,e.onRename]),$=c.useCallback((t=>{r&&r(e.id,t)}),[r,e.id]),z=c.useCallback((()=>{j(s,i)}),[s,i,j]),G=c.useCallback((()=>(0,a.jsx)(f.Menu,{children:H().map(((e,t)=>(0,u.createElement)(f.MenuItem,{...e,key:t})))})),[H]),L="input"===i?(0,h.getInputName)(s):(0,l.getOutputName)(s),F=c.useCallback((e=>{O(s,i,e)}),[s,O,i]),q=c.useCallback((e=>{w(s,i,e)}),[s,w,i]),U=(0,y.useDarkMode)();return(0,a.jsx)(d.BaseNodeView,{className:(0,p.default)("node-io-view",i,{dark:U}),pos:o,onDragEnd:(n,o)=>{const r=e.pos,a=(o.x-r.x)/t.zoom,u=(o.y-r.y)/t.zoom,c=r.x+a,l=r.y+u;e.onDragEnd(i,s,n,{...o,x:c,y:l})},onDragStart:(t,n)=>{e.onDragStart(s,t,n)},onDragMove:(t,n)=>{e.onDragMove(i,s,t,{x:n.x,y:n.y})},viewPort:t,children:(0,a.jsx)(c.Fragment,{children:(0,a.jsx)(f.Tooltip,{content:(()=>{const t=(0,g.calcHistoryContent)(S),n=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:L})," (",i,")"," "]}),n,(0,a.jsx)("hr",{}),t]})})(),children:(0,a.jsx)(f.ContextMenu,{onMouseEnter:M,onMouseOut:D,onMouseUp:F,onMouseDown:q,"data-tip":"","data-html":!0,"data-for":s+e.currentInsId,className:(0,p.default)("node-io-view-inner",{closest:x,selected:n,dark:U}),id:(0,v.getPinDomId)({fullInsIdPath:(0,l.fullInsIdPath)(e.currentInsId,e.ancestorInsIds),pinId:s,pinType:i,isMain:!0}),onClick:z,onDoubleClick:$,content:G(),children:s})})})})}))},66005:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37488),t)},83782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcNodeIoWidth=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0,t.PIECE_HORIZONTAL_PADDING=15,t.PIECE_CHAR_WIDTH=9,t.MIN_WIDTH_PER_PIN=40;t.calcNodeIoWidth=e=>Math.max(t.MIN_WIDTH_PER_PIN,e.length*t.PIECE_CHAR_WIDTH+2*t.PIECE_HORIZONTAL_PADDING)},99942:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderVisualNode=t.layoutToInstances=void 0;const i=n(63521),s=n(74762),r=n(90794),a=o(n(53865)),u=n(83782),c=n(60190),l=n(53159),d=n(41032);t.layoutToInstances=(e,t)=>(0,a.default)(t,(t=>{(0,s.entries)(e.nodes).forEach((e=>{let[n,o]=e;if(n.startsWith("ins-")){const e=n.replace("ins-",""),i=t.instances.find((t=>t.id===e));i?i.pos=o.p:console.warn("WAT")}if(n.startsWith("node-input-")){const e=n.replace("node-input-","");t.inputsPosition[e]=o.p}if(n.startsWith("node-output-")){const e=n.replace("node-output-","");t.outputsPosition[e]=o.p}}))}));t.orderVisualNode=(e,n,o,a)=>{const{instances:p,connections:f}=e,m={...p.reduce(((e,t)=>{const o=(0,c.size)((0,l.calcNodeWidth)(t,(0,d.safelyGetNodeDef)(t,n)),i.NODE_HEIGHT);return{...e,[`ins-${t.id}`]:{p:t.pos,s:o}}}),{}),...(0,s.okeys)(e.inputsPosition).reduce(((t,n)=>({...t,[`node-input-${n}`]:{p:e.inputsPosition[n],s:(0,c.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{}),...(0,s.okeys)(e.outputsPosition).reduce(((t,n)=>({...t,[`node-output-${n}`]:{p:e.outputsPosition[n],s:(0,c.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{})},g=f.map((e=>[(0,s.isExternalConnectionNode)(e.from)?`node-input-${e.from.pinId}`:`ins-${e.from.insId}`,(0,s.isExternalConnectionNode)(e.to)?`node-output-${e.to.pinId}`:`ins-${e.to.insId}`])),h=(0,r.orderLayout)({nodes:m,edges:g},o,((n,o)=>{a&&a((0,t.layoutToInstances)(n,e),o)}));return(0,t.layoutToInstances)(h,e)}},90794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderLayout=void 0;const o=n(60190),i=400,s=e=>e.reduce(((e,t)=>{const n=(0,o.vSub)(t.p,(0,o.vec)(t.s.width/2,t.s.height/2));return{...e,[t.id]:{p:n,s:t.s}}}),{});t.orderLayout=(e,t,n)=>{let{nodes:r,edges:a}=e,u=Object.entries(r).map((e=>{let[t,n]=e;return{id:t,p:(0,o.vAdd)(n.p,(0,o.vec)(n.s.width/2,n.s.height/2)),f:(0,o.vec)(0,0),v:(0,o.vec)(0,0),m:1,s:n.s}})),c=0;for(;c.01);){let e=u;for(let t=0;t{let n=e.find((e=>e.id===t[0])),i=e.find((e=>e.id===t[1]));if(!n||!i)return void console.warn("weoops",t[0],t[1]);const s=(0,o.vec)(0,-200),r=(0,o.vSub)(n.p,i.p),a=(0,o.vSub)(s,r),u=1e3*(0,o.vLen)(a),c=(0,o.vMul)((0,o.vNorm)(a),.5*u),l=(0,o.vMul)((0,o.vNorm)(a),-.5*u);n.f=(0,o.vAdd)(n.f,c),i.f=(0,o.vAdd)(i.f,l)})),e=e.map((e=>(0,o.itrPhysics)(15,e))),e=e.map((e=>{const t=(0,o.vMul)(e.v,.5),n=(0,o.vLen)(t)>100?(0,o.vMul)((0,o.vNorm)(t),100):t;return{...e,v:n}})),u=e,n&&n({nodes:s(e),edges:a},c),c++}return{nodes:s(u),edges:a,itrs:c,timeout:c>=t,total:(0,o.totalEnergy)(u)}}},2036:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PinView=t.PIN_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),c=r(n(26372)),l=n(50382),d=n(18420),p=n(74762),f=n(30994),m=n(96233),g=n(66189),h=n(30653);t.PIN_HEIGHT=23;t.PinView=u.memo((function(e){const{selected:t,type:n,connected:o,optional:i,currentInsId:s,isClosestToMouse:r,id:v,onMouseDown:y,onMouseUp:I}=e,{history:b,resetHistory:C,refreshHistory:_}=(0,g.useHistoryHelpers)(s,v,n),j=(0,h.useDarkMode)(),x="input"===n?(0,p.getInputName)(v):(0,p.getOutputName)(v),N="input"===e.type&&(0,d.isDefined)(e.constValue)?e.constValue:void 0,P=u.useCallback((e=>{0===e.button&&y(v,n,e)}),[v,n,y]),O=u.useCallback((e=>{0===e.button&&I(v,n,e)}),[v,n,I]);return(0,a.jsxs)("div",{className:(()=>{if("input"===e.type){const{isSticky:s,constValue:a}=e;return(0,c.default)("pin",{sticky:s,selected:t,closest:r,optional:i,connected:o,"const-value":(0,d.isDefined)(a),"env-value":(0,d.isDefined)(a)&&(0,p.isEnvValue)(a),minimized:e.minimized,dark:j},n)}return(0,c.default)("pin",{selected:t,connected:o,closest:r,optional:i,minimized:e.minimized,"error-pin":v===p.ERROR_PIN_ID,dark:j},n)})(),"data-pin-id":v,children:[(0,a.jsx)(l.Tooltip,{className:"pin-info-tooltip",content:(()=>{const t=(0,g.calcHistoryContent)(b,"input"===n?e.queuedValues:void 0),o=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:x})," (",n,")"," "]}),o,(0,a.jsx)("hr",{}),(0,d.isDefined)(N)?(0,a.jsxs)("div",{children:["Static value:"," ",(0,a.jsx)("strong",{children:(0,m.valuePreview)(N).substring(0,200)})]}):t]})})(),children:(0,a.jsxs)(l.ContextMenu,{onMouseEnter:_,onMouseOut:C,onMouseDown:P,onMouseUp:O,"data-tip":"","data-html":!0,"data-for":v+e.currentInsId,id:(0,f.getPinDomId)({fullInsIdPath:(0,p.fullInsIdPath)(e.currentInsId,e.ancestorsInsIds),pinId:v,pinType:n,isMain:!1}),onDoubleClick:t=>e.onDoubleClick&&e.onDoubleClick(v,t),className:(0,c.default)("pin-inner",{dark:j}),onClick:t=>{const{onShiftClick:o,onClick:i,id:s}=e;t.shiftKey&&o?o(s,t):i(s,n,t)},content:(()=>{const t=(0,a.jsx)(l.MenuItem,{onClick:()=>e.onInspect(e.currentInsId,{id:e.id,type:e.type}),text:"Inspect"});if("input"===e.type){const{onConvertConstToEnv:n}=e;return(0,d.isDefined)(N)?(0,a.jsxs)(l.Menu,{children:[(0,a.jsx)(l.MenuItem,{onClick:()=>e.onDetachConstValue(e.id),text:"Detach value"}),(0,a.jsx)(l.MenuItem,{onClick:()=>e.onCopyConstValue(e.id),text:"Copy value"}),(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(l.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null,n?(0,a.jsx)(l.MenuItem,{onClick:()=>n(e.id),text:"Convert to Env Var"}):null]}):(0,a.jsxs)(l.Menu,{children:[(0,a.jsx)(l.MenuItem,{onClick:()=>e.onToggleSticky(e.id),text:"Toggle sticky (square means sticky)"}),t,(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(l.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null]})}return(0,a.jsx)(l.Menu,{children:t})})(),children:[x," ",(0,d.isDefined)(N)?(0,a.jsxs)(u.Fragment,{children:[":",(0,a.jsx)("span",{className:"value",children:(0,d.toString)(N)})]}):null,"input"===e.type&&e.isSticky?(0,a.jsx)("span",{className:"suffix",children:"s"}):null,"input"===e.type&&e.queueSize?(0,a.jsxs)("span",{className:"suffix",children:[e.queueSize," in Q"]}):null]})}),(0,a.jsx)("div",{className:"wire"})]})}))},66189:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHistoryHelpers=t.calcHistoryContent=void 0;const i=n(35250),s=n(96233),r=o(n(70079)),a=n(70079),u=n(98158);t.calcHistoryContent=(e,t)=>{if(e){const{total:n,lastSamples:o}=e,a=(0,i.jsxs)("strong",{children:["Activated ",n," times this session"]}),u=o.length>0?(0,i.jsxs)("div",{children:["Last value:"," ",(0,i.jsx)("strong",{children:(0,s.valuePreview)(o[0].val).substring(0,200)}),(0,i.jsx)("br",{}),(0,i.jsx)("em",{children:"Inspect instance for the full value"})]}):"",c=t?(0,i.jsx)(r.default.Fragment,{children:(0,i.jsxs)("div",{children:["Queued values: ",(0,i.jsx)("strong",{children:t})]})}):"";return(0,i.jsxs)(r.default.Fragment,{children:[a,u,c]})}return"Loading session data.."};t.useHistoryHelpers=(e,t,n)=>{const o=(0,a.useRef)(),{onRequestHistory:i}=(0,u.useDebuggerContext)(),[s,c]=(0,a.useState)();return{history:s,refreshHistory:(0,a.useCallback)((()=>{clearInterval(o.current),i(e,t,n).then((e=>{c(e)})),o.current=setInterval((()=>{i(e,t,n).then((e=>{c(e)}))}),500)}),[e,i,t,n]),resetHistory:r.default.useCallback((()=>{clearInterval(o.current),c(void 0)}),[])}}},89440:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAddMenu=void 0;const r=n(35250),a=s(n(70079)),u=n(74762),c=n(50382),l=n(70457),d=n(9958),p=n(86125),f=l.Select.ofType(),m=e=>{switch(e.type){case"node":return`${e.node.id}`;case"value":return"Add inline value or function";case"import":return`Import ${e.importableNode.node.id} from ${e.importableNode.module}`}},g=(e,t)=>{let{handleClick:n,modifiers:o,query:i}=t;if(!o.matchesPredicate)return null;const s=m(e);return"value"===e.type?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(c.MenuDivider,{}),(0,r.jsx)(c.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))]}):(0,r.jsx)(c.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))},h=(e,t,n,o)=>{const i=m(t).toLocaleLowerCase(),s=e.toLowerCase();return o?i===s:i.includes(s)};t.QuickAddMenu=e=>{const{resolvedDependencies:t,targetNode:n}=e,o={left:e.pos.x,top:e.pos.y},{onRequestImportables:i}=(0,p.useDependenciesContext)(),[s,l]=a.useState();a.useEffect((()=>{i().then((e=>l(e.importables)))}),[i]);const d=(0,u.values)({...t,[n.id]:n}),m=d.map((e=>({type:"node",node:e}))),v=new Set(d.map((e=>e.id))),y=s?s.filter((e=>!v.has(e.node.id))).map((e=>({type:"import",importableNode:e}))):[],I=m.concat(y).concat({type:"value"});return(0,r.jsx)("div",{className:"quick-add-menu",style:o,children:(0,r.jsx)(f,{className:"quick-add-nodes-select",items:I,itemPredicate:h,itemRenderer:g,inputProps:{className:"quick-add-input"},noResults:(0,r.jsx)(c.MenuItem,{disabled:!0,text:"No results."}),onItemSelect:t=>e.onAdd(t),popoverProps:{isOpen:!0,onClose:()=>e.onClose()}})})}},71033:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89440),t)},73470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimePlayer=void 0;const o=n(74762),i=n(64955),s=(0,o.debugLogger)("runtime-player");t.createRuntimePlayer=()=>{let e=0,t=[];let n=!1,r=Date.now(),a=e;const u=()=>requestAnimationFrame((()=>{const c=Date.now();a=e,e+=c-r,r=c,((e,n)=>{const r=t;t=[],r.length&&s(`Playing ${r.length} events from`,e,n),r.forEach((e=>{s("Playing event",e),(0,i.playEvent)(e),e.insId===o.ROOT_INS_ID&&e.type===o.DebuggerEventType.PROCESSING_CHANGE&&!1===e.val&&(s("Main instance is done processing, clearing runtime UI",e),l())}))})(a,e),n&&u()})),c=()=>{n=!1},l=()=>{document.querySelectorAll("[data-runtime]").forEach((e=>{e.removeAttribute("data-runtime")})),document.querySelectorAll("[data-runtime-queue]").forEach((e=>{e.removeAttribute("data-runtime-queue")})),t=[]};return{stop:c,start:function(t){void 0===t&&(t=0),n=!0,e=t,r=Date.now(),u()},addEvents:e=>{t.push(...e)},destroy:()=>{c(),l()},clear:l,status:()=>({running:n,currDt:e,lastDt:a,queue:t,last:r})}}},64955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playEvent=t.cancelTimers=void 0;const o=n(74762),i=n(30994),s=5e3,r=(0,o.debugLogger)("runtime-player:play-event"),a=(e,t)=>e.type===o.DebuggerEventType.INPUT_CHANGE||e.type===o.DebuggerEventType.OUTPUT_CHANGE?`${(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds)}.${e.pinId}`:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds);t.cancelTimers=new Map;t.playEvent=e=>{switch(e.type){case o.DebuggerEventType.INPUT_CHANGE:case o.DebuggerEventType.OUTPUT_CHANGE:{const{pinId:n,insId:u,ancestorsInsIds:c}=e,l=e.type===o.DebuggerEventType.INPUT_CHANGE?"input":"output",d=[(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,c),pinId:n,pinType:l,isMain:!0})];u!==o.ROOT_INS_ID&&d.push((0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,c),pinId:n,pinType:l,isMain:!1})),d.forEach(((i,c)=>{const l=a(e);clearTimeout(t.cancelTimers.get(l));const d=document.getElementById(i),p=`${u}.${n}`,f=e.type===o.DebuggerEventType.OUTPUT_CHANGE?document.querySelectorAll(`[data-from-id="${p}"]`):[];if(d){clearTimeout(t.cancelTimers.get(l)),d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),setTimeout((()=>{d.setAttribute("data-runtime","active"),f.forEach((e=>{e.setAttribute("data-runtime","active")}))}),0);const n=setTimeout((()=>{d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),t.cancelTimers.delete(l)}),s);t.cancelTimers.set(a(e),n)}else console.warn(`No DOM element with Id [${i}] found to play event`),r(`No DOM element with Id [${i}] found to play event`,e)}));break}case o.DebuggerEventType.PROCESSING_CHANGE:{const{insId:n,ancestorsInsIds:u}=e,c=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&c.push((0,i.getInstanceDomId)(n,u)),c.forEach(((n,o)=>{var i;const u=a(e),c=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(c)if(!0===e.val)c.setAttribute("data-runtime","processing"),clearTimeout(t.cancelTimers.get(u));else{c.removeAttribute("data-runtime"),setTimeout((()=>{"error"!==c.getAttribute("data-runtime")&&c.setAttribute("data-runtime","done")}),0);const e=setTimeout((()=>{c.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,e)}else r(`No DOM element with Id [${n}] found to play event`,e)}));break}case o.DebuggerEventType.ERROR:{const{insId:n,ancestorsInsIds:u}=e,c=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&c.push((0,i.getInstanceDomId)(n,u)),c.forEach(((n,o)=>{var i;const u=a(e),c=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(!c)return void r(`No DOM element with Id [${n}] found to play event`,e);clearTimeout(t.cancelTimers.get(u)),c.removeAttribute("data-runtime"),setTimeout((()=>{c.setAttribute("data-runtime","error")}));const l=setTimeout((()=>{c.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,l)}));const l={...e,type:o.DebuggerEventType.OUTPUT_CHANGE,pinId:o.ERROR_PIN_ID};(0,t.playEvent)(l);break}case o.DebuggerEventType.INPUTS_STATE_CHANGE:(0,o.entries)(e.val).forEach((t=>{let[n,s]=t;const{insId:a,ancestorsInsIds:u}=e,c=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(a,u),pinId:n,pinType:"input",isMain:!1}),l=document.getElementById(c);l?s>0?l.setAttribute("data-runtime-queue",`${s}`):l.removeAttribute("data-runtime-queue"):r(`No DOM element with Id [${c}] found to play event`,e)}))}}},25804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounce=void 0;const o=n(70079);t.useDebounce=function(e,t){const[n,i]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}},7047:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.handleChangeNodeInputType=t.handleIoPinRename=t.handleInstanceDrag=t.getInstancesInRect=t.isJsxValue=t.getMiddleOfViewPort=t.fitViewPortToNode=t.centerBoardPosOnTarget=t.renderedPosToLogicalPos=t.logicalPosToRenderedPos=t.getEffectiveNodeDimensions=t.calcNodesPositions=t.calcSelectionBoxArea=t.animateViewPort=t.easeInOutNum=t.easeInOutPos=t.easeInOutQuad=t.center=t.distance=t.clamp=t.domToViewPort=t.roundNumber=t.createNewNodeInstance=t.createNewInlineNodeInstance=t.parseInputOutputTypes=t.parsePromptValue=t.getSelectionBoxRect=t.findClosestPin=t.changePinConfig=t.getInstancePinConfig=t.emptyList=t.emptyObj=void 0;const r=s(n(53865)),a=n(30721),u=n(63521),c=n(74762),l=n(18243),d=n(74762),p=n(53159),f=n(83782),m=n(60190),g=n(38259),h=n(83651),v=n(41032);t.emptyObj={},t.emptyList=[],t.getInstancePinConfig=function(e,n,o){var i;const s=e.instances.find((e=>e.id===n));if(!s)throw new Error(`Instance ${n} not found`);return null!==(i=(s.inputConfig||t.emptyObj)[o])&&void 0!==i?i:(0,c.queueInputPinConfig)()};t.changePinConfig=(e,t,n,o)=>r.produce(e,(e=>{var i;const{instances:s}=e,r=s.find((e=>e.id===t));if(!r)throw new Error("blah");const a=null!==(i=r.inputConfig)&&void 0!==i?i:{};a[n]=o,e.instances=s.map((e=>e===r?{...r,inputConfig:a}:e))}));t.findClosestPin=(e,t,n,o,i,s,r)=>{const a=(0,c.nodeInstance)(e.id,e.id),u=(0,d.okeys)(e.inputs).map((e=>({id:e,type:"input",pos:(0,l.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),p=(0,d.okeys)(e.outputs).map((e=>({id:e,type:"output",pos:(0,l.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),f=[...u,...e.instances.reduce(((n,a)=>{const u=(0,v.safelyGetNodeDef)(a,t),d=(0,h.getVisibleInputs)(a,u,e.connections),p=(0,h.getVisibleOutputs)(a,u,e.connections);return[...n,...d.map((e=>({ins:a,type:"input",pos:(0,l.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,c.fullInsIdPath)(i,s),pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!1}),id:e}))),...p.map((e=>({ins:a,type:"output",pos:(0,l.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,c.fullInsIdPath)(i,s),pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!1}),id:e})))]}),[]),...p];let m={dis:1e5,item:f[0]};return f.forEach((e=>{const t=e.pos.x-n.x,o=e.pos.y-n.y,i=Math.sqrt(t*t+o*o);i{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x,t.x)-n,h:Math.max(e.y,t.y)-o}};t.parsePromptValue=e=>{if(null===e)return;const t=parseInt(e,10);let n=e;return t.toString()!=e||isNaN(t)||(n=t),n};t.parseInputOutputTypes=e=>{const[,t,n]=e.match(/node\((.+)\|(.+)\)/)||[],o=(0,d.entries)(JSON.parse(t)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]})),i=(0,d.entries)(JSON.parse(n)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]}));return{inputs:(0,d.fromEntries)(o),outputs:(0,d.fromEntries)(i)}};t.createNewInlineNodeInstance=function(e,t,n){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const o=(0,c.inlineNodeInstance)(`${e.id}-${(0,d.randomInt)(999)}`,e,{},{x:0,y:0}),i=(0,p.calcNodeWidth)(o,e),{x:s,y:r}=n,a={x:s-i/2,y:r+t};return{...o,pos:a}};t.createNewNodeInstance=function(e,t,n,o){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const i="string"==typeof e?(0,v.safelyGetNodeDef)(e,o):e;if(!i)throw new Error(`${e} node not found in resolvedNodes`);const s=(0,d.entries)(i.inputs).reduce(((e,t)=>{let[n,o]=t;return o.defaultValue&&(e[n]=(0,c.staticInputPinConfig)(o.defaultValue)),e}),{}),r=(0,c.nodeInstance)((0,a.createId)(),i.id,s,{x:0,y:0}),l=(0,p.calcNodeWidth)(r,i),{x:f,y:m}=n,g={x:f-l/2,y:m+t};return{...r,pos:g}};t.roundNumber=e=>Math.round(100*e)/100;t.domToViewPort=(e,n,o)=>({x:(0,t.roundNumber)(n.pos.x+e.x/n.zoom/o.zoom),y:(0,t.roundNumber)(n.pos.y+e.y/n.zoom/o.zoom)});t.clamp=(e,t,n)=>Math.max(e,Math.min(t,n));t.distance=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)};t.center=(e,t,n)=>{let{zoom:o}=n;const i=e.x+e.w/2,s=e.y+e.h/2,{w:r,h:a}=t;return{x:i-r/o/2,y:s-a/o/2}};t.easeInOutQuad=e=>e<.5?2*e*e:(4-2*e)*e-1;t.easeInOutPos=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i),a=(0,t.easeInOutQuad)(r),u=n.x-e.x,c=n.y-e.y;return{x:e.x+u*a,y:e.y+c*a}};t.easeInOutNum=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i);return e+(n-e)*(0,t.easeInOutQuad)(r)};t.animateViewPort=(e,n,o,i)=>{const s=(0,t.distance)(e.pos,n.pos),r=Date.now(),a=o;if(0===s)return void i(e);const u=()=>{const o=Date.now(),s=(0,t.easeInOutPos)(e.pos,n.pos,r,a,o),c=(0,t.easeInOutNum)(e.zoom,n.zoom,r,a,o);o-r{const n=(0,t.getSelectionBoxRect)(e.from,e.to);return n.h*n.w};const y=(e,t,n,o)=>({left:n.x,right:n.x+e,top:n.y,bottom:n.y+t,tag:o,center:(0,c.calcCenter)({w:e,h:t,...n})});t.calcNodesPositions=(e,t)=>[...e.instances.map((e=>{const n=(0,p.calcNodeWidth)(e,(0,v.safelyGetNodeDef)(e,t)),o=u.NODE_HEIGHT;return y(n,o,e.pos,e.id)})),...(0,d.okeys)(e.inputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.inputsPosition[t]||{x:0,y:0};return y(n,o,i,"input_"+t)})),...(0,d.okeys)(e.outputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.outputsPosition[t]||{x:0,y:0};return y(n,o,i,"output"+t)}))];t.getEffectiveNodeDimensions=(e,n)=>{const o=(0,t.calcNodesPositions)(e,n),i=o[0]||{left:0,right:0,top:0,bottom:0},s=o.reduce(((e,t)=>t.leftt.right>e?t.right:e),i.right),a=o.reduce(((e,t)=>t.topt.bottom>e?t.bottom:e),i.bottom)-a,d={x:s,y:a};return{size:{width:u,height:l},pos:d,center:(0,c.calcCenter)({w:u,h:l,...d})}};t.logicalPosToRenderedPos=(e,t)=>{const n=(0,m.vSub)(e,t.pos);return(0,m.vMul)(n,t.zoom)};t.renderedPosToLogicalPos=(e,t)=>{const n=(0,m.vDiv)(e,t.zoom);return(0,m.vAdd)(t.pos,n)};t.centerBoardPosOnTarget=(e,n,o,i)=>{const s=(0,t.logicalPosToRenderedPos)(e,i),r=(0,t.renderedPosToLogicalPos)(s,{...i,zoom:o}),a=Math.max(e.x,r.x)-Math.min(e.x,r.x),u=Math.max(e.y,r.y)-Math.min(e.y,r.y);return{x:o>i.zoom?i.pos.x+a:i.pos.x-a,y:o>i.zoom?i.pos.y+u:i.pos.y-u}};t.fitViewPortToNode=function(e,n,o,i){void 0===i&&(i=[20,150]);const{size:s,center:r}=(0,t.getEffectiveNodeDimensions)(e,n),a=i[0],u=i[1],c=s.width+a,l=s.height+u,d=o.width/c,p=o.height/l,f=Math.min(d,p)/1.15,m=(0,t.clamp)(.3,1.2,f);return{zoom:m,pos:{x:r.x-o.width/2/m,y:r.y-o.height/2/m+20}}};t.getMiddleOfViewPort=(e,n)=>{const o={x:n.width/2,y:n.height/2};return(0,t.renderedPosToLogicalPos)(o,e)};t.isJsxValue=e=>{const t=e=>(0,d.isDefined)(e.ref)&&(0,d.isDefined)(e.type)&&(0,d.isDefined)(e.props);try{const n=JSON.parse(e);return t(n)||Array.isArray(n)&&t(n[0])}catch(n){return!1}};t.getInstancesInRect=(e,n,o,i,s,r,a)=>{const{from:l,to:d}=e,f=(0,t.getSelectionBoxRect)(l,d);return s.filter((e=>{const{pos:t}=e,i={...t,w:(0,p.calcNodeWidth)(e,(0,v.safelyGetNodeDef)(e,n))*o.zoom*a.zoom,h:u.NODE_HEIGHT*o.zoom*a.zoom};return(0,c.intersectRect)(f,i)||(0,c.intersectRect)(i,f)})).map((e=>e.id))};t.handleInstanceDrag=(e,t,n,o,i,s)=>{o.preventDefault(),o.stopPropagation();const a=(0,m.vSub)(n,t.pos);let u;const c=r.produce(e,(e=>{const r=e.instances.find((e=>e.id===t.id));if(!r)throw new Error("impossible state dragging instance that does not exist");!o.shiftKey&&s&&(u=[s]);const c=e.instances.filter((e=>i.includes(e.id)&&e!==r)),l=[r,...c],d=(0,g.getLeafInstancesOfSelection)(l,e.instances,e.connections);[...c,...d].forEach((e=>{e.pos=(0,m.vAdd)(e.pos,a)})),r.pos=n,!o.shiftKey&&s&&(u=[s])}));return{newValue:c,newSelected:u}};t.handleIoPinRename=(e,t,n,o)=>r.produce(e,(e=>{"input"===t?(e.inputs[o]=e.inputs[n],e.inputsPosition[o]=e.inputsPosition[n],delete e.inputs[n],e.connections=e.connections.map((e=>(0,c.isExternalConnectionNode)(e.from)&&e.from.pinId===n?{...e,from:{...e.from,pinId:o}}:e))):(e.outputs[o]=e.outputs[n],e.outputsPosition[o]=e.outputsPosition[n],e.connections=e.connections.map((e=>(0,c.isExternalConnectionNode)(e.to)&&e.to.pinId===n?{...e,to:{...e.to,pinId:o}}:e)),e.completionOutputs=(e.completionOutputs||[]).map((e=>e.split("+").map((e=>e===n?o:n)).join("+"))),delete e.outputs[n])}));t.handleChangeNodeInputType=(e,t,n)=>r.produce(e,(e=>{const o=e.inputs[t];if(!o)throw new Error("Wat");o.mode=n}))},42403:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorClient=void 0;const i=n(74762),s=o(n(18706)),r=n(32048),a=n(31758),u=(0,i.debugLogger)("remote-debugger:editor-client");t.createEditorClient=(e,t)=>{const n=new URL(e),o=(0,r.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/editor`,timeout:3e4});return o.emit("join-room-editor",t),{emitChange:e=>{o.emit(a.DebuggerServerEventType.CHANGE_EVENT_NAME,e)},emitBreakpointsChange:e=>{o.emit(a.DebuggerServerEventType.UPDATE_BREAKPOINTS,e)},interceptInput:e=>{o.emit(a.DebuggerServerEventType.INPUT_VALUE_OVERRIDE,e)},interceptOutput:e=>{o.emit(a.DebuggerServerEventType.OUTPUT_VALUE_OVERRIDE,e)},onRuntimeReady:e=>(o.on(a.DebuggerServerEventType.RUNTIME_READY,e),()=>o.off(a.DebuggerServerEventType.RUNTIME_READY,e)),onChangeAwk:e=>(o.on(a.DebuggerServerEventType.CHANGE_AWK,e),()=>o.off(a.DebuggerServerEventType.CHANGE_AWK,e)),onChangeError:e=>(o.on(a.DebuggerServerEventType.CHANGE_ERROR,e),()=>o.off(a.DebuggerServerEventType.CHANGE_ERROR,e)),onIsAlive:e=>(o.on(a.DebuggerServerEventType.IS_ALIVE,e),()=>o.off(a.DebuggerServerEventType.IS_ALIVE,e)),emitInputValue:(e,t)=>{u(`Emitting push input value to ${e} %o`,t),o.emit(a.DebuggerServerEventType.PUSH_INPUT_VALUE,{pinId:e,value:t})},destroy:()=>{o.disconnect(),(0,a.enumToArray)(a.DebuggerServerEventType).forEach((e=>o.off(e)))},onDisconnect:e=>(o.on("disconnect",e),()=>o.off("disconnect",e)),debugInfo:()=>`Remote debugger for ${e}`,onBatchedEvents:e=>(o.on(a.DebuggerServerEventType.EVENTS_BATCH,e),()=>o.off(a.DebuggerServerEventType.EVENTS_BATCH,e)),requestState:()=>s.default.get(`${e}/state`).then((e=>e.data.state)),getHistory:n=>s.default.get(`${e}/history`,{params:{insId:n.insId,pinId:n.pinId,limit:n.limit,executionId:t}}).then((e=>e.data)),clearHistory:()=>s.default.delete(`${e}/history`).then((()=>{})),triggerNode:(t,n)=>s.default.post(`${e}/trigger`,{nodeId:t,inputs:n}).then((e=>e.data))}}},58066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeData=void 0;const o=n(74762),i=n(36783),s=(0,o.debugLogger)("remote-debugger:normalize-data");t.normalizeData=e=>{if(e instanceof Error)return(0,i.serializeError)(e);if("object"==typeof e&&null!==e){e={...e};const t=new WeakSet,n=e=>{if("bigint"==typeof e)return e.toString();if("object"!=typeof e||Array.isArray(e))return e;if(null===e)return e;if(t.has(e))return"[Circular]";try{t.add(e)}catch(o){s("Error adding to WeakSet","data:",e,"type:",typeof e,"error:",o)}if(Array.isArray(e))return e.map(n);if("object"==typeof e){const t={};for(const o in e)t[o]=n(e[o]);return t}return e};return n(e)}return e}},39641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimeClient=t.DEFAULT_DT_SCALE=void 0;const o=n(74762),i=n(32048),s=n(31758),r=n(58066),a=(0,o.debugLogger)("remote-debugger:runtime-client");t.DEFAULT_DT_SCALE=1;t.createRuntimeClient=(e,t)=>{const n=new URL(e),u=(0,i.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/runtime`,timeout:1e3,reconnectionAttempts:3});u.emit("join-room-runtime",t),u.on("connection",(e=>{e.join(t)}));let c=new Set;u.on(s.DebuggerServerEventType.UPDATE_BREAKPOINTS,(e=>{c=new Set(e)}));const l=(0,o.cappedArrayDebounce)((e=>{a(`Emitting debounced batched events - ${e.length}`),u.emit(s.DebuggerServerEventType.EVENTS_BATCH,e)}),100,200);return{onChange:e=>(u.on(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e),()=>u.off(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e)),onInput:e=>(u.on(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e),()=>u.off(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e)),emitEvent:e=>{a(`Emitting event ${e.type} change event of ${e.insId}`),e.val=(0,r.normalizeData)(e.val),l.addItem({...e,time:Date.now()})},emitRuntimeReady:()=>{u.emit(s.DebuggerServerEventType.RUNTIME_READY,{})},emitChangeAwk:()=>{u.emit(s.DebuggerServerEventType.CHANGE_AWK,{})},emitChangeError:e=>{u.emit(s.DebuggerServerEventType.CHANGE_ERROR,{error:e})},emitIsAlive:e=>{u.emit(s.DebuggerServerEventType.IS_ALIVE,{time:e})},destroy:async()=>{l.pendingItems()&&(l.flush(),await(0,o.delay)(100)),(0,s.enumToArray)(s.DebuggerServerEventType).forEach((e=>u.off(e))),u.disconnect()},onDisconnect:e=>(u.on("disconnect",e),()=>u.off("disconnect",e)),waitForConnection:()=>new Promise(((e,t)=>{u.connected?e():(u.on("connect_error",(e=>{t(`Socket connect error: ${e}`)})),u.on("connect",(()=>{e()})))}))}}},31758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerServerEventType=t.enumToArray=t.isNumber=t.isSimpleType=t.valuePreview=t.toString=void 0;const o=n(36783);t.toString=e=>{if("object"===typeof e){if(e instanceof Error)return JSON.stringify((0,o.serializeError)(e));try{return JSON.stringify(e).substr(0,250)}catch(t){return"Object (cannot stringify)"}}return`${e}`.substr(0,250)};t.valuePreview=e=>(0,t.toString)(e).substr(0,100);t.isSimpleType=e=>["number","string","boolean"].includes(typeof e);t.isNumber=e=>!1===isNaN(Number(e)),t.enumToArray=function(e){return Object.keys(e).filter(t.isNumber).map((t=>e[t]))},function(e){e.RUNTIME_READY="runtime-ready",e.CHANGE_EVENT_NAME="change",e.PUSH_INPUT_VALUE="push-input-value",e.CHANGE_AWK="live-change-awk",e.CHANGE_ERROR="live-change-error",e.IS_ALIVE="is-alive",e.UPDATE_BREAKPOINTS="update-breakpoints",e.INPUT_VALUE_OVERRIDE="input-value-override",e.OUTPUT_VALUE_OVERRIDE="output-value-override",e.INPUT_VALUE_CHANGE="input-value-changed",e.OUTPUT_VALUE_CHANGE="output-value-changed",e.PROCESSING_CHANGE="processing-changed",e.INPUTS_STATE_CHANGE="inputs-state-changed",e.NODE_ERROR="node-error",e.EVENTS_BATCH="events-batch"}(t.DebuggerServerEventType||(t.DebuggerServerEventType={}))},96233:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31758),t),i(n(42403),t),i(n(39641),t)},79118:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Request=t.Put=t.Post=t.Get=void 0;const i=o(n(18706)),s="HTTP";t.Get={id:"GET Request",defaultStyle:{icon:"fa-server"},namespace:s,description:"Performs a HTTP GET request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:(e,t)=>{let{url:n,headers:o,params:s}=e,{data:r}=t;return i.default.get(n,{headers:o,params:s}).then((e=>r.next(e.data)))}},t.Post={id:"POST Request",defaultStyle:{icon:"fa-server"},namespace:s,description:"Performs a HTTP POST request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"},data:{description:"Data to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:(e,t)=>{let{url:n,headers:o,params:s,data:r}=e,{data:a}=t;const u={headers:o,params:s};return i.default.post(n,r,u).then((e=>a.next(e.data)))}},t.Put={id:"PUT Request",defaultStyle:{icon:"fa-server"},namespace:s,description:"Performs a HTTP PUT request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"},data:{description:"Data to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:(e,t)=>{let{url:n,headers:o,params:s,data:r}=e,{data:a}=t;const u={headers:o,params:s};return i.default.put(n,r,u).then((e=>a.next(e.data)))}},t.Request={id:"Request",defaultStyle:{icon:"fa-server"},namespace:s,description:"Performs a HTTP request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},method:{description:"HTTP method to use"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"},data:{description:"Data to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:(e,t)=>{let{url:n,method:o,headers:s,params:r,data:a}=e,{data:u}=t;const c={method:o,headers:s,params:r};return i.default.request({url:n,data:a,...c}).then((e=>u.next(e.data)))}}},21518:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyEquals=t.DeleteAttribute=t.SetAttribute=t.GetAttribute=t.ObjectAssign=t.ObjectFromEntries=t.ObjectEntries=t.ObjectValues=t.ObjectHasOwnProperty=t.ObjectKeys=t.JSONStringify=t.JSONParse=void 0;const n="Objects";t.JSONParse={id:"JSON Parse",defaultStyle:{icon:"fa-glasses"},namespace:n,description:"Parses a JSON string into an object",inputs:{json:{description:"JSON string to parse"}},outputs:{object:{description:"The parsed object"}},run:(e,t)=>{let{json:n}=e,{object:o}=t;return o.next(JSON.parse(n))}},t.JSONStringify={id:"JSON Stringify",defaultStyle:{icon:"fa-pen-fancy"},namespace:n,description:"Stringifies an object into a JSON string",inputs:{object:{description:"Object to stringify"}},outputs:{json:{description:"The stringified JSON"}},run:(e,t)=>{let{object:n}=e,{json:o}=t;return o.next(JSON.stringify(n))}},t.ObjectKeys={id:"Keys",defaultStyle:{icon:"fa-key"},namespace:n,description:"Emits the keys of an object",inputs:{object:{description:"Object to get keys of"}},outputs:{keys:{description:"The keys of object"}},run:(e,t)=>{let{object:n}=e,{keys:o}=t;return o.next(Object.keys(n))}},t.ObjectHasOwnProperty={id:"Has own property",defaultStyle:{icon:"fa-key"},namespace:n,description:"Checks if object has property",inputs:{object:{mode:"required",description:"Object to get keys of"},property:{mode:"required",description:"the property to search for"}},outputs:{true:{description:"The value is true"},false:{description:"The value is false"}},run:function(e,t){const{true:n,false:o}=t,{object:i,property:s}=e;i.hasOwnProperty(s)?n.next(!0):o.next(!1)}},t.ObjectValues={id:"Values",namespace:n,description:"Emits the values of an object",inputs:{object:{description:"Object to get values of"}},outputs:{values:{description:"The values of object"}},run:(e,t)=>{let{object:n}=e,{values:o}=t;return o.next(Object.values(n))}},t.ObjectEntries={id:"Entries",defaultStyle:{icon:"fa-box"},namespace:n,description:"Emits the entries of an object",inputs:{object:{description:"Object to get entries of"}},outputs:{entries:{description:"The entries of object"}},run:(e,t)=>{let{object:n}=e,{entries:o}=t;return o.next(Object.entries(n))}},t.ObjectFromEntries={id:"From Entries",namespace:n,defaultStyle:{icon:"fa-box"},description:"Creates an object from an array of entries",inputs:{entries:{description:"Array of entries to create object from"}},outputs:{object:{description:"The created object"}},run:(e,t)=>{let{entries:n}=e,{object:o}=t;return o.next(Object.fromEntries(n))}},t.ObjectAssign={id:"Assign",namespace:n,defaultStyle:{icon:"fa-box"},description:"Assigns properties from one or more objects to a target object",inputs:{target:{description:"Target object to assign properties to"},sources:{description:"One or more objects to assign properties from"}},outputs:{object:{description:"The target object"}},run:(e,t)=>{let{target:n,sources:o}=e,{object:i}=t;return i.next(Object.assign(n,...o))}},t.GetAttribute={id:"Get Attribute",searchKeywords:["pick","dot"],namespace:n,defaultStyle:{icon:"fa-magnifying-glass"},description:"Gets an attribute from an object",inputs:{object:{description:"Object to get attribute from"},attribute:{description:"Attribute to get"}},outputs:{value:{description:"The value of the attribute"}},customViewCode:'{{#if inputs.attribute}}\n Get "{{inputs.attribute}}"\n{{else}}\n Get Attribute\n{{/if}}',run:(e,t)=>{let{object:n,attribute:o}=e,{value:i}=t;return i.next(o.split(".").reduce(((e,t)=>e[t]),n))}},t.SetAttribute={id:"Set Attribute",searchKeywords:["dot"],namespace:n,defaultStyle:{icon:"fa-box"},description:"Sets an attribute on an object",inputs:{object:{description:"Object to set attribute on"},attribute:{description:"Attribute to set"},value:{description:"Value to set attribute to"}},outputs:{object:{description:"The object with the attribute set"}},customViewCode:'{{#if inputs.attribute}}\n Set "{{inputs.attribute}}"\n{{else}}\n Set Attribute\n{{/if}}',run:(e,t)=>{let{object:n,attribute:o,value:i}=e,{object:s}=t;const r=o.split("."),a=r.pop();return r.reduce(((e,t)=>e[t]),n)[a]=i,s.next(n)}},t.DeleteAttribute={id:"Delete Attribute",defaultStyle:{icon:"fa-box"},namespace:n,description:"Deletes an attribute from an object",inputs:{object:{description:"Object to delete attribute from"},attribute:{description:"Attribute to delete"}},customViewCode:'{{#if inputs.attribute.value}}\n Delete "{{inputs.attribute.value}}"\n{{else}}\n Delete Attribute\n{{/if}}',outputs:{object:{description:"The object with the attribute deleted"}},run:(e,t)=>{let{object:n,attribute:o}=e,{object:i}=t;const s=o.value.split("."),r=s.pop();delete s.reduce(((e,t)=>e[t]),n.value)[r],i.next(n.value)}},t.PropertyEquals={id:"Property Equals",namespace:n,defaultStyle:{icon:"fa-equals"},description:'Emits the object to the "true" output if an object\'s property equals a value, otherwise emits to the "false" output',inputs:{object:{description:"Object to check property of"},attribute:{description:"Attribute to check"},value:{description:"Value to check attribute against"}},outputs:{true:{description:"Emitted if the attribute equals the value"},false:{description:"Emitted if the attribute does not equal the value"}},customViewCode:'{{#if inputs.attribute}}\n "{{inputs.attribute}}" equals "{{inputs.value}}"\n{{else}}\n Property Equals\n{{/if}}',run:(e,t)=>{e.attribute.split(".").reduce(((e,t)=>e[t]),e.object)===e.value?t.true.next(e.object):t.false.next(e.object)}}},65645:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var o=n(70079),i=n(11253),s=n(74089),r=n(74762),a=n(21766);var u=n(10831),c=n(61997),l=n(77852);const d=(0,a.S)(),p=[0,20],f=e=>{let{flow:t,output:n,inputs:o,onError:s,debugDelay:a,onCompleted:u,dependencies:c,player:l}=e;const p=((e,t)=>{const n=new Set;return{onEvent:o=>{const i={...o,time:Date.now(),executionId:"n/a"};console.info("Got debugger event",o),t.addEvents([i]),e.addEvents([i]),n.forEach((e=>e([i])))},onBatchedEvents:e=>(n.add(e),()=>n.delete(e))}})(l,d);p.debugDelay=a;const f=(0,r.keys)(t.node.outputs)[0];return{executeResult:(0,r.execute)({node:t.node,inputs:o,outputs:{[f]:n},resolvedDeps:{...c,[t.node.id]:t.node},_debugger:p,onCompleted:u,onBubbleError:e=>{s(e)},extraContext:{PubSub:i}}),localDebugger:p}},m=e=>{const{debugDelay:t,onOutput:i,flowProps:a}=e,{flow:m,inputs:g,output:h}=a,v=(0,o.useRef)((0,s.createRuntimePlayer)()),[y,I]=(0,o.useState)(e.flowProps.dependencies),[b,C]=(0,o.useState)(),[_]=(0,s.useDebounce)(y,500),j=(0,l.useDarkMode)(),x=async(e,t)=>{const{node:o}=e,i=Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).find((e=>(0,r.isBaseNode)(e)&&e.id===o.id));let a;I((e=>({...e,[i.id]:{...i,source:{path:"@flyde/stdlib/dist/all-browser",export:i.id}}})));const c=(0,u.ZP)(m,(n=>{if(t){const o=(0,s.vAdd)({x:0,y:0},t.pos);if(a=(0,s.createNewNodeInstance)(e.node,0,o,y),n.node.instances.push(a),t.connectTo){const{insId:e,outputId:o}=t.connectTo;n.node.connections.push({from:{insId:e,pinId:o},to:{insId:a.id,pinId:r.TRIGGER_PIN_ID}})}}}));await new Promise((e=>setTimeout(e,10)));const l=(0,u.ZP)(P,(e=>{e.flow=c,t?.selectAfterAdding&&a&&(e.boardData.selected=[a?.id])}));return O(l),(0,s.toastMsg)(`Node ${o.id} successfully imported from ${e.module}`),y},N=async()=>({importables:Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).filter(r.isBaseNode).map((e=>({node:{...e,source:{path:"n/a",export:"n/a"}},module:"@flyde/stdlib"}))),errors:[]}),[P,O]=(0,o.useState)({flow:m,boardData:{viewPort:{pos:{x:0,y:0},zoom:1},lastMousePos:{x:0,y:0},selected:[]}});(0,o.useEffect)((()=>{O((e=>({...e,flow:m})))}),[m]),(0,o.useEffect)((()=>{I((e=>({...e,main:P.flow.node})))}),[P.flow.node]);const w={state:P,onChangeEditorState:O,hideTemplatingTips:!0,initialPadding:p,onExtractInlineNode:r.noop,disableScrolling:!0,darkMode:j.isDarkMode};(0,o.useEffect)((()=>{v.current.start()}),[]),(0,o.useEffect)((()=>{const{executeResult:n,localDebugger:o}=f({flow:P.flow,dependencies:y,output:h,inputs:g,onError:r.noop,debugDelay:t,player:v.current,onCompleted:e.onCompleted}),s=e.flowProps.output.subscribe((e=>i(e)));return C(o),()=>{n(),s.unsubscribe()}}),[t,_]);const E=(0,o.useMemo)((()=>({resolvedDependencies:y,onImportNode:x,onRequestImportables:N})),[]),S=(0,o.useMemo)((()=>({debuggerClient:b,onRequestHistory:d.requestHistory})),[b]);return o.createElement(c.Z,null,(()=>o.createElement(s.DependenciesContextProvider,{value:E},o.createElement(s.DebuggerContextProvider,{value:S},o.createElement(s.FlowEditor,w)))))}},21766:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var o=n(74762);const i=200,s=()=>{const e=new Map,t=new Map;return{requestHistory:async(n,s,r)=>{const a="input"===r?o.DebuggerEventType.INPUT_CHANGE:o.DebuggerEventType.OUTPUT_CHANGE;if(console.log({insId:n,pinId:s,type:a}),s){const t=`${n}.${s}.${a}`,o=e.get(t)||{total:0,lastSamples:[]},r=o.lastSamples.slice(0,i);return{...o,lastSamples:r}}{const e=t.get(n)||{total:0,lastSamples:[]},o=e.lastSamples.slice(0,i);return{...e,lastSamples:o}}},addEvents:n=>{n.forEach((n=>{if(n.type===o.DebuggerEventType.ERROR){const e=n;e.type=o.DebuggerEventType.OUTPUT_CHANGE,e.pinId=o.ERROR_PIN_ID}if(n.type===o.DebuggerEventType.INPUT_CHANGE||n.type===o.DebuggerEventType.OUTPUT_CHANGE){const{insId:o,type:s,pinId:r}=n;{const t=`${o}.${r}.${s}`,a=e.get(t)||{total:0,lastSamples:[]};a.lastSamples.unshift(n),a.lastSamples.length>i&&a.lastSamples.splice(i,a.lastSamples.length-i),a.total++,e.set(t,a)}{const s=t.get(o)||{total:0,lastSamples:[]};s.lastSamples.unshift(n),s.lastSamples.length>i&&s.lastSamples.splice(i,s.lastSamples.length-i),s.total++,e.set(o,s)}}}))}}}},4144:(e,t,n)=>{"use strict";n.d(t,{V:()=>r});var o=n(10328),i=n(70079);const s=e=>i.createElement("li",{className:"log-item"},i.createElement("main",{className:"content"},e.value),i.createElement("aside",null,new Date(e.time).toLocaleTimeString())),r=e=>{const[t,n]=i.useState([]);return i.useEffect((()=>{e.output.subscribe((e=>{const t="object"==typeof e&&i.isValidElement(e)?e:`${e}`;n((e=>[...e,{value:t,time:Date.now()}]))}))}),[]),i.createElement("div",{className:"output-log"},i.createElement("header",null,"Output Log"," ",i.createElement("button",{className:"clear-btn button button--outline button--secondary button--sm",onClick:()=>n([])},"Clear")),i.createElement("main",null,i.createElement("ul",null,t.map(((e,t)=>i.createElement(s,(0,o.Z)({},e,{key:t}))))),0===t.length?i.createElement("div",{className:"empty-state"},"Nothing to show. Interact with the example to emit some outputs!"):null))}},79256:(e,t,n)=>{"use strict";n.d(t,{I:()=>p});var o=n(70079),i=n(65092),s=n(19841),r=n(49794),a=n(21766),u=n(73949),c=n(81098),l=n(65645);(0,a.S)();const d=[{title:"Hello World",key:"hello-world"},{title:"React Counter",key:"react-counter"},{title:"BMI Calculator",key:"bmi"},{title:"REST API Usage",key:"apis"},{title:"Debounce vs. Throttling",key:"debounce-throttling"},{title:"Fibonacci Seq.",key:"fibonacci"}],p=e=>{const[t,n]=(0,o.useState)(e.initWidth||500),[a,p]=(0,o.useState)(e.defaultDelay||0),[f,m]=(0,o.useState)(!1),g=(0,o.useCallback)(((e,t)=>{let{size:o}=t;n(o.width)}),[]),h=o.createElement("div",{className:"delay-container"},o.createElement("input",{type:"range",id:"volume",name:"delay",value:a,step:"100",min:"0",max:"300",onChange:e=>p(Number(e.target.value))}),o.createElement("label",{htmlFor:"volume"},"Debug Delay: ",a,"ms")),v=d.findIndex((t=>t.key===e.meta.key)),y=d[v+1],I=d[v-1];return o.createElement(i.Z,{title:`${e.meta.title} | Playground`,description:`Flyde Playground - ${e.meta.title} example`},o.createElement("header",{className:(0,s.default)("hero hero--primary",u.Z.heroBanner,"playground-hero")},o.createElement("div",{className:"container"},o.createElement("h1",{className:"hero__title"},"Welcome to Flyde's Online Playground"),o.createElement("p",{className:"hero__subtitle"},"Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!"))),o.createElement("div",{className:"mobile-warning"},"Flyde is currently not optimized for mobile devices. Please"," ",o.createElement("strong",null,"use a desktop computer for the best experience"),"."),o.createElement("ul",{className:"examples__menu"},d.map((e=>o.createElement("li",{key:e.key},o.createElement(r.Z,{to:`/playground/${e.key}`,className:"button button--primary"},e.title))))),o.createElement("div",{className:"playground-container"},o.createElement("header",null,o.createElement("h2",{className:"playground-title"},e.meta.title),o.createElement("div",{className:"playground-description"},e.meta.description),f?o.createElement(o.Fragment,null,o.createElement("hr",null),o.createElement("div",{className:"playground-extra"},e.extraInfo||e.meta.extraInfo,o.createElement("div",{className:"star-hint"},o.createElement("span",null,"\xa0 PS: Did you like this example?"),"Please consider giving a \u2b50\ufe0f to the project"," ",o.createElement("span",{className:"star-wrapper"},o.createElement("iframe",{className:"gh-stars-frame",src:"https://ghbtns.com/github-btn.html?user=flydelabs&repo=flyde&type=star&count=true&size=small",width:100,height:20,title:"GitHub Stars"}))))):null,e.prefixComponent),o.createElement("div",{className:"playground"},o.createElement("div",{className:"flow-container"},!0!==e.hideDelay?h:null,o.createElement(l.Y,{flowProps:e.flowProps,debugDelay:a,onOutput:()=>m(!0)})),o.createElement(c.Resizable,{height:0,width:t,onResize:g,handle:o.createElement("div",{className:"handle"}),axis:"x",resizeHandles:["w"]},o.createElement("div",{className:"output-container",style:{flexBasis:t}},e.children))),o.createElement("nav",{className:"pagination-nav"},o.createElement("div",{className:"pagination-nav__item"},I?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${I.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Previous Example"),o.createElement("div",{className:"pagination-nav__label"},I.title)):null),o.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},y?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${y.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Next Example"),o.createElement("div",{className:"pagination-nav__label"},y.title)):null))))}},24373:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var o=n(70079),i=n(74762),s=n(79256);const r={dependencies:{"GET Request":{id:"GET Request",defaultStyle:{icon:"fa-server"},namespace:"HTTP",description:"Performs a HTTP GET request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:n(79118).Get.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Http.flyde.js",export:"Get"}},"POST Request":{id:"POST Request",defaultStyle:{icon:"fa-server"},namespace:"HTTP",description:"Performs a HTTP POST request to a URL and emits the response data",inputs:{url:{description:"URL to fetch data from"},headers:{description:"Headers to send with the request",mode:"required-if-connected"},params:{description:"Query parameters to send with the request",mode:"required-if-connected"},data:{description:"Data to send with the request",mode:"required-if-connected"}},outputs:{data:{description:"The response data"}},run:n(79118).Post.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Http.flyde.js",export:"Post"}},"Get Attribute":{id:"Get Attribute",searchKeywords:["pick","dot"],namespace:"Objects",defaultStyle:{icon:"fa-magnifying-glass"},description:"Gets an attribute from an object",inputs:{object:{description:"Object to get attribute from"},attribute:{description:"Attribute to get"}},outputs:{value:{description:"The value of the attribute"}},customViewCode:'{{#if inputs.attribute}}\n Get "{{inputs.attribute}}"\n{{else}}\n Get Attribute\n{{/if}}',run:n(21518).GetAttribute.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Objects.flyde.js",export:"GetAttribute"}}},flow:{imports:{"@flyde/stdlib":["GET Request","POST Request","Get Attribute"]},node:{instances:[{pos:{x:-652.4219506835938,y:281.67776977539063},id:"Inline-value-Hello from ${i76",inputConfig:{},node:{id:"Inline-value-Hello visitor ",inputs:{country:{mode:"required"},capital:{mode:"required"},population:{mode:"required"}},outputs:{value:{delayed:!1}},runFnRawCode:"const result = (`Hello visitor from ${inputs.country}! The capital is ${inputs.capital} (population of ${inputs.population})`); Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"`Hello visitor from ${inputs.country}! The capital is ${inputs.capital} (population of ${inputs.popu",dataBuilderSource:"YEhlbGxvIHZpc2l0b3IgZnJvbSAke2lucHV0cy5jb3VudHJ5fSEgVGhlIGNhcGl0YWwgaXMgJHtpbnB1dHMuY2FwaXRhbH0gKHBvcHVsYXRpb24gb2YgJHtpbnB1dHMucG9wdWxhdGlvbn0pYA==",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline value"}},{pos:{x:-616.065219116211,y:-228.04816649675365},id:"Get User's Country-ins",inputConfig:{},node:{id:"Get User's Country",inputs:{},outputs:{country:{type:"any",delayed:!1,optional:!1}},instances:[{pos:{x:-335.7258349609375,y:-194.68226864814756},id:"GET Request-907",inputConfig:{url:{mode:"static",value:"https://api.country.is/"}},visibleInputs:["url","__trigger"],visibleOutputs:["r","__error","response","data"],nodeId:"GET Request"},{id:"Inline-value-{iso2: ${input76",node:{id:"Inline-value-{iso2: inputs.d",inputs:{data:{type:"any",mode:"required"}},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"const result = ({iso2: inputs.data.country}); Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"{iso2: inputs.data.country}",dataBuilderSource:"e2lzbzI6IGlucHV0cy5kYXRhLmNvdW50cnl9",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},inputConfig:{},pos:{x:-468.5056274414062,y:-39.30523986816405}}],inputsPosition:{},outputsPosition:{r:{x:-363.42401672132144,y:105.34149194113161},country:{x:-322.5739794922268,y:138.57280736180334}},connections:[{from:{insId:"Inline-value-{iso2: ${input76",pinId:"value"},to:{pinId:"country",insId:"__this"}},{from:{insId:"GET Request-907",pinId:"data"},to:{insId:"Inline-value-{iso2: ${input76",pinId:"data"}}],completionOutputs:["country"]},style:{size:"large",color:"#f15bb5"}},{pos:{x:-675.1473986816407,y:-88.80973440885543},id:"Get Country Name And Capital-ins",inputConfig:{},visibleOutputs:["name","capital"],node:{id:"Get Country Name And Capital",inputs:{body:{type:"any",mode:"required"}},outputs:{capital:{type:"any",delayed:!1,optional:!1},name:{type:"any",delayed:!1,optional:!1}},instances:[{pos:{x:-455.39787109375004,y:43.691497802734375},id:"POST Request-624",inputConfig:{url:{mode:"static",value:"https://countriesnow.space/api/v0.1/countries/capital"}},visibleInputs:["url","body","data"],nodeId:"POST Request"},{id:"Get Attribute-217",nodeId:"Get Attribute",inputConfig:{attribute:{mode:"static",value:"data.capital"}},pos:{x:-285.6922900390625,y:219.88888122558592}},{id:"Get Country Name And Capital-srp46ei",nodeId:"Get Attribute",inputConfig:{attribute:{mode:"static",value:"data.name"}},pos:{x:-608.0307299804688,y:225.56220581054686}}],inputsPosition:{body:{x:-333.75691140339336,y:-63.66470402308542}},outputsPosition:{value:{x:-514.1541695281439,y:411.8457371232514},i10:{x:-280.88783057750686,y:411.581705357324},capital:{x:-214.78486673798952,y:473.65942918140723},name:{x:-523.761854810908,y:479.9947571097377}},connections:[{from:{pinId:"body",insId:"__this"},to:{insId:"POST Request-624",pinId:"data"}},{from:{insId:"Get Attribute-217",pinId:"value"},to:{pinId:"capital",insId:"__this"}},{from:{insId:"POST Request-624",pinId:"data"},to:{insId:"Get Country Name And Capital-srp46ei",pinId:"object"}},{from:{insId:"Get Country Name And Capital-srp46ei",pinId:"value"},to:{pinId:"name",insId:"__this"}},{from:{insId:"POST Request-624",pinId:"data"},to:{insId:"Get Attribute-217",pinId:"object"}}],completionOutputs:["name+capital"]},style:{size:"large",color:"#9b5de5"}},{pos:{x:-283.9292150878906,y:175.29793395996091},id:"Format Number-ins",inputConfig:{},node:{id:"Format Number",inputs:{number:{type:"any",mode:"required"}},outputs:{string:{type:"any",delayed:!1,optional:!1}},instances:[{id:"Inline-value-Result is ${in47",node:{id:"Inline-value-new Intl.Number",inputs:{population:{type:"any",mode:"required"}},outputs:{r:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"outputs.r.next((new Intl.NumberFormat().format(inputs.population)))",customViewCode:"new Intl.NumberFormat().format(inputs.population)",dataBuilderSource:"bmV3IEludGwuTnVtYmVyRm9ybWF0KCkuZm9ybWF0KGlucHV0cy5wb3B1bGF0aW9uKQ==",templateType:"value",completionOutputs:["r"]},inputConfig:{},pos:{x:-452.21022216796877,y:176.39826171875}}],inputsPosition:{population:{x:0,y:0},number:{x:0,y:0}},outputsPosition:{r:{x:0,y:400},string:{x:0,y:400}},connections:[{from:{insId:"__this",pinId:"number"},to:{insId:"Inline-value-Result is ${in47",pinId:"population"}},{from:{insId:"Inline-value-Result is ${in47",pinId:"r"},to:{insId:"__this",pinId:"string"}}],completionOutputs:["string"]},style:{size:"regular",color:"#fee440"}},{pos:{x:-347.9215673828125,y:54.336173706054694},id:"cl8x5r4qp00074666lb382z1c",inputConfig:{},node:{id:"Get Population By City",inputs:{city:{type:"any",mode:"required"}},outputs:{value:{type:"any",delayed:!1,optional:!1}},instances:[{pos:{x:-204.90311279296873,y:349.60314422607416},id:"POST Request-775",inputConfig:{url:{mode:"static",value:"https://countriesnow.space/api/v0.1/countries/population/cities"}},visibleInputs:["url","body","data"],nodeId:"POST Request"},{pos:{x:-143.08780761718754,y:233.70198646545413},id:"Inline-value-{city: inputs.c75",inputConfig:{},node:{id:"Inline-value-{city: inputs.c",inputs:{city:{type:"any",mode:"required"}},outputs:{r:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"outputs.r.next(({city: inputs.city}))",customViewCode:"{city: inputs.city}",dataBuilderSource:"e2NpdHk6IGlucHV0cy5jaXR5fQ==",templateType:"value",completionOutputs:["r"]}},{id:"Get Attribute-893",nodeId:"Get Attribute",inputConfig:{attribute:{mode:"static",value:"data.populationCounts.0.value"}},pos:{x:-196.82018798828125,y:535.9137713623047},style:{icon:"fa-box",size:"small"}}],inputsPosition:{city:{x:-59.242744173605615,y:192.73141904118035}},outputsPosition:{value:{x:-116.77230284586054,y:698.5630767231784}},connections:[{from:{pinId:"city",insId:"__this"},to:{insId:"Inline-value-{city: inputs.c75",pinId:"city"}},{from:{insId:"Inline-value-{city: inputs.c75",pinId:"r"},to:{insId:"POST Request-775",pinId:"data"}},{from:{insId:"Get Attribute-893",pinId:"value"},to:{pinId:"value",insId:"__this"}},{from:{insId:"POST Request-775",pinId:"data"},to:{insId:"Get Attribute-893",pinId:"object"}}],completionOutputs:["value"]},style:{size:"large",color:"#00bbf9"}}],connections:[{from:{insId:"Get Country Name And Capital-ins",pinId:"name"},to:{insId:"Inline-value-Hello from ${i76",pinId:"country"}},{from:{insId:"Get Country Name And Capital-ins",pinId:"capital"},to:{insId:"Inline-value-Hello from ${i76",pinId:"capital"}},{from:{insId:"Format Number-ins",pinId:"string"},to:{insId:"Inline-value-Hello from ${i76",pinId:"population"}},{from:{insId:"cl8x5r4qp00074666lb382z1c",pinId:"value"},to:{insId:"Format Number-ins",pinId:"number"}},{from:{insId:"Get Country Name And Capital-ins",pinId:"capital"},to:{insId:"cl8x5r4qp00074666lb382z1c",pinId:"city"}},{from:{insId:"Get User's Country-ins",pinId:"country"},to:{insId:"Get Country Name And Capital-ins",pinId:"body"}},{from:{insId:"Inline-value-Hello from ${i76",pinId:"value"},to:{insId:"__this",pinId:"response"}}],id:"ApisCombination",inputs:{},outputs:{response:{type:"any",optional:!1,delayed:!1}},inputsPosition:{city:{x:-187.27285824815934,y:-14.13215209416181}},outputsPosition:{json:{x:-441.98276309426666,y:480.38719404276554},na:{x:-441.98276309426666,y:480.38719404276554},result:{x:-499.82438378976735,y:706.7650396699393},output:{x:-474.64252250807056,y:437.71313745088565},response:{x:-500.61566893722795,y:421.9045791861946}},completionOutputs:["response"]}}};var a=n(4144);const u={title:"HTTP Requests",description:"Flyde works great for heavy asynchronous & concurrent tasks, like combining several REST APIs together. This example shows exactly that, by combining 3 different REST APIs, the population of the capital of the country your IP is assigned with is retrieved",key:"api",extraInfo:o.createElement("strong",null,o.createElement("h3",null,"Try double-clicking each API node to see it's underlying implementation! In Flyde, nothing is hidden, only abstracted"))};function c(){const e=(0,o.useRef)((0,i.dynamicOutput)()),t=(0,o.useRef)({__trigger:(0,i.dynamicNodeInput)()}),[n,c]=(0,o.useState)({flow:r.flow,dependencies:r.dependencies,inputs:t.current,output:e.current}),l=o.createElement("button",{className:"button button--success",onClick:()=>t.current.__trigger.subject.next("run")},"Run!");return o.createElement(s.I,{meta:u,flowProps:n,defaultDelay:100,prefixComponent:l},o.createElement(a.V,{output:e.current}))}},73949:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={"flyde-flow-editor":"flyde-flow-editor_AAD4",_hj_feedback_container:"_hj_feedback_container_Af03"}},85721:(e,t,n)=>{var o={"./af":47654,"./af.js":47654,"./ar":61325,"./ar-dz":98344,"./ar-dz.js":98344,"./ar-kw":26230,"./ar-kw.js":26230,"./ar-ly":42524,"./ar-ly.js":42524,"./ar-ma":44119,"./ar-ma.js":44119,"./ar-sa":82625,"./ar-sa.js":82625,"./ar-tn":42182,"./ar-tn.js":42182,"./ar.js":61325,"./az":37093,"./az.js":37093,"./be":32721,"./be.js":32721,"./bg":59919,"./bg.js":59919,"./bm":95594,"./bm.js":95594,"./bn":563,"./bn-bd":41757,"./bn-bd.js":41757,"./bn.js":563,"./bo":73211,"./bo.js":73211,"./br":87438,"./br.js":87438,"./bs":83662,"./bs.js":83662,"./ca":61196,"./ca.js":61196,"./cs":5841,"./cs.js":5841,"./cv":85251,"./cv.js":85251,"./cy":24512,"./cy.js":24512,"./da":37539,"./da.js":37539,"./de":5059,"./de-at":53853,"./de-at.js":53853,"./de-ch":99378,"./de-ch.js":99378,"./de.js":5059,"./dv":91454,"./dv.js":91454,"./el":39651,"./el.js":39651,"./en-au":87953,"./en-au.js":87953,"./en-ca":98193,"./en-ca.js":98193,"./en-gb":61980,"./en-gb.js":61980,"./en-ie":14050,"./en-ie.js":14050,"./en-il":6502,"./en-il.js":6502,"./en-in":555,"./en-in.js":555,"./en-nz":11372,"./en-nz.js":11372,"./en-sg":26568,"./en-sg.js":26568,"./eo":69533,"./eo.js":69533,"./es":68327,"./es-do":17620,"./es-do.js":17620,"./es-mx":96467,"./es-mx.js":96467,"./es-us":83272,"./es-us.js":83272,"./es.js":68327,"./et":68523,"./et.js":68523,"./eu":19066,"./eu.js":19066,"./fa":59087,"./fa.js":59087,"./fi":96443,"./fi.js":96443,"./fil":93979,"./fil.js":93979,"./fo":90383,"./fo.js":90383,"./fr":56327,"./fr-ca":25610,"./fr-ca.js":25610,"./fr-ch":97274,"./fr-ch.js":97274,"./fr.js":56327,"./fy":67442,"./fy.js":67442,"./ga":44291,"./ga.js":44291,"./gd":77342,"./gd.js":77342,"./gl":96248,"./gl.js":96248,"./gom-deva":21404,"./gom-deva.js":21404,"./gom-latn":20833,"./gom-latn.js":20833,"./gu":9122,"./gu.js":9122,"./he":74623,"./he.js":74623,"./hi":60364,"./hi.js":60364,"./hr":30860,"./hr.js":30860,"./hu":70441,"./hu.js":70441,"./hy-am":90425,"./hy-am.js":90425,"./id":29672,"./id.js":29672,"./is":96150,"./is.js":96150,"./it":27852,"./it-ch":55603,"./it-ch.js":55603,"./it.js":27852,"./ja":16465,"./ja.js":16465,"./jv":20120,"./jv.js":20120,"./ka":87245,"./ka.js":87245,"./kk":21479,"./kk.js":21479,"./km":65038,"./km.js":65038,"./kn":63060,"./kn.js":63060,"./ko":85020,"./ko.js":85020,"./ku":90582,"./ku.js":90582,"./ky":34950,"./ky.js":34950,"./lb":94201,"./lb.js":94201,"./lo":87894,"./lo.js":87894,"./lt":70120,"./lt.js":70120,"./lv":4265,"./lv.js":4265,"./me":14030,"./me.js":14030,"./mi":9463,"./mi.js":9463,"./mk":25898,"./mk.js":25898,"./ml":64233,"./ml.js":64233,"./mn":47156,"./mn.js":47156,"./mr":34479,"./mr.js":34479,"./ms":24691,"./ms-my":6456,"./ms-my.js":6456,"./ms.js":24691,"./mt":81789,"./mt.js":81789,"./my":37452,"./my.js":37452,"./nb":91170,"./nb.js":91170,"./ne":87529,"./ne.js":87529,"./nl":81776,"./nl-be":24455,"./nl-be.js":24455,"./nl.js":81776,"./nn":34705,"./nn.js":34705,"./oc-lnc":36139,"./oc-lnc.js":36139,"./pa-in":17960,"./pa-in.js":17960,"./pl":1899,"./pl.js":1899,"./pt":31670,"./pt-br":29159,"./pt-br.js":29159,"./pt.js":31670,"./ro":55115,"./ro.js":55115,"./ru":45149,"./ru.js":45149,"./sd":81231,"./sd.js":81231,"./se":35397,"./se.js":35397,"./si":99786,"./si.js":99786,"./sk":39383,"./sk.js":39383,"./sl":68691,"./sl.js":68691,"./sq":34826,"./sq.js":34826,"./sr":40080,"./sr-cyrl":75673,"./sr-cyrl.js":75673,"./sr.js":40080,"./ss":54309,"./ss.js":54309,"./sv":52245,"./sv.js":52245,"./sw":8967,"./sw.js":8967,"./ta":10454,"./ta.js":10454,"./te":35204,"./te.js":35204,"./tet":81571,"./tet.js":81571,"./tg":15737,"./tg.js":15737,"./th":41786,"./th.js":41786,"./tk":50511,"./tk.js":50511,"./tl-ph":14828,"./tl-ph.js":14828,"./tlh":62422,"./tlh.js":62422,"./tr":97047,"./tr.js":97047,"./tzl":90792,"./tzl.js":90792,"./tzm":67730,"./tzm-latn":59963,"./tzm-latn.js":59963,"./tzm.js":67730,"./ug-cn":42535,"./ug-cn.js":42535,"./uk":33151,"./uk.js":33151,"./ur":22750,"./ur.js":22750,"./uz":61914,"./uz-latn":60231,"./uz-latn.js":60231,"./uz.js":61914,"./vi":55517,"./vi.js":55517,"./x-pseudo":64078,"./x-pseudo.js":64078,"./yo":70046,"./yo.js":70046,"./zh-cn":81832,"./zh-cn.js":81832,"./zh-hk":90953,"./zh-hk.js":90953,"./zh-mo":38236,"./zh-mo.js":38236,"./zh-tw":71001,"./zh-tw.js":71001};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=s,e.exports=i,i.id=85721}}]); \ No newline at end of file diff --git a/assets/js/5328e403.96ffad58.js b/assets/js/5328e403.7d01d420.js similarity index 66% rename from assets/js/5328e403.96ffad58.js rename to assets/js/5328e403.7d01d420.js index 7ac1af9e6..afd3c733b 100644 --- a/assets/js/5328e403.96ffad58.js +++ b/assets/js/5328e403.7d01d420.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5976],{19121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cappedArrayDebounce=void 0;t.cappedArrayDebounce=function(e,t,n,o){void 0===o&&(o=500);let i=[],s=null,r=null;return{addItem:a=>{clearTimeout(s),i.push(a),r||(r=setTimeout((()=>{e(i),clearTimeout(s),r=null}),o)),i.length>=n?(e(i),clearTimeout(r),r=null,i=[]):s=setTimeout((()=>{e(i),clearTimeout(r),r=null,i=[]}),t)},flush:()=>{i.length&&(e(i),i=[],clearTimeout(r))},pendingItems:()=>i.length}}},59792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.dataShaper=t.DataShapeType=void 0,function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.ARRAY=3]="ARRAY",e[e.OBJECT=4]="OBJECT",e[e.NULL=5]="NULL",e[e.UNSUPPORTED=6]="UNSUPPORTED"}(n=t.DataShapeType||(t.DataShapeType={}));const o={string:n.STRING,number:n.NUMBER,boolean:n.BOOLEAN,object:n.OBJECT,array:n.ARRAY,null:n.NULL,symbol:n.UNSUPPORTED,undefined:n.UNSUPPORTED,function:n.UNSUPPORTED,bigint:n.UNSUPPORTED};t.dataShaper=function(e,n,i){void 0===n&&(n=5),void 0===i&&(i=5);const s=null===(r=e)?"null":typeof r;var r,a;if("object"===s){if(Array.isArray(e))return n>1?e.filter(((e,t)=>t(0,t.dataShaper)(e,n-1,i))):o.array;if(n>1){const o={};for(const s in e)o[s]=(0,t.dataShaper)(e[s],n-1,i);return a=o,Object.keys(a).sort().reduce(((e,t)=>(e[t]=a[t],e)),{})}return o.object}return o[s]}},23046:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.debugLogger=void 0;const i=(0,o(n(55899)).default)("flyde");t.debugLogger=e=>i.extend(e)},24331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullInsIdPath=void 0,t.fullInsIdPath=function(e,t){if(!e)throw new Error("insId is not defined");return t?`${t}.${e}`:e}},34459:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hashFlow=t.hashNode=void 0;const i=o(n(68805)),s=n(30292),r=e=>(0,i.default)(e);t.hashNode=function(e,t){var n;void 0===t&&(t=!0);const{id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l}=e,c={id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l};if((0,s.isVisualNode)(e)){const{instances:n,connections:o,inputsPosition:i,outputsPosition:s}=e,a=n.map((e=>{const{pos:t,...n}=e;return n})),u=t?{}:{inputsPosition:i,outputsPosition:s},l=t?a:n;l.sort(((e,t)=>e.id.localeCompare(t.id)));const d=[...o];d.sort(((e,t)=>{const n=`${e.from.insId}.${e.from.pinId}`,o=`${t.from.insId}.${t.from.pinId}`;return n.localeCompare(o)}));const p=JSON.stringify({instancesToUse:l,conns:d,...c,maybeIoPos:u});return r(p)}if((0,s.isInlineValueNode)(e)){const{customViewCode:t}=e,o=null!==(n=e.fnCode)&&void 0!==n?n:e.runFnRawCode,i=JSON.stringify({fnCode:o,customViewCode:t,...c});return r(i)}throw new Error("Hashing code nodes unsupported")};t.hashFlow=e=>{const{node:n,imports:o}=e,i=(0,t.hashNode)(n,!1),s=Object.entries(null!=o?o:{}).sort(((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)})).map((e=>{let[t,n]=e;return[t,n.sort()]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{}),a=JSON.stringify(s);return r(i+a)}},86873:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DepGraph=void 0,i(n(3172),t),i(n(59962),t),i(n(23046),t),i(n(19121),t),i(n(59962),t),i(n(34459),t),i(n(39043),t),i(n(59792),t),i(n(24331),t),t.DepGraph=n(60359).DepGraph},3172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testDataCreator=void 0;t.testDataCreator=e=>function(t){void 0===t&&(t={});return{..."function"==typeof e?e():e,...t}}},59962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplePluralize=t.eventually=t.delay=t.noop=t.removeDupes=t.ensure=t.isOptionalType=t.callFnOrFnPromise=t.isPromise=t.isDefined=t.containsAll=t.shuffle=t.randomInts=t.repeat=t.pickRandom=t.randomPos=t.randomInt=t.pickSecond=t.pickFirst=t.fromEntries=t.entries=t.okeys=t.values=t.keys=t.filterOMap=t.mapOMap=t.middlePos=t.calcCenter=t.intersectRect=void 0;t.intersectRect=(e,t)=>{const n=e.x+e.w,o=t.x+t.w;return!(t.x>n||oe.y+e.h||t.y+t.h{let{w:t,h:n,x:o,y:i}=e;return{x:o+t/2,y:i+n/2}};t.middlePos=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});t.mapOMap=(e,n)=>(0,t.entries)(e).map((e=>{let[t,o]=e;return[t,n(t,o)]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.filterOMap=(e,n)=>(0,t.entries)(e).filter((e=>{let[t,o]=e;return n(t,o)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.keys=e=>Object.keys(e);t.values=e=>Object.values(e),t.okeys=t.keys;t.entries=e=>(0,t.okeys)(e).map((t=>[t,e[t]]));t.fromEntries=e=>e.reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.pickFirst=e=>e[0];t.pickSecond=e=>e[1];t.randomInt=function(e,t){void 0===t&&(t=0);const n=Math.random();return t+Math.floor((e-t)*n)};t.randomPos=function(e,n){void 0===e&&(e=1e3),void 0===n&&(n=0);return{x:(0,t.randomInt)(e,n),y:(0,t.randomInt)(e,n)}};t.pickRandom=e=>e[(0,t.randomInt)(e.length)];t.repeat=(e,t)=>"x".repeat(e).split("").map(((e,n)=>t(n)));t.randomInts=function(e,n,o){return void 0===n&&(n=100),void 0===o&&(o=0),(0,t.repeat)(e,(()=>(0,t.randomInt)(n,o)))};t.shuffle=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t};t.containsAll=(e,t)=>t.every((t=>e.includes(t)));t.isDefined=e=>void 0!==e;t.isPromise=e=>e&&"function"==typeof e.then;t.callFnOrFnPromise=(e,n)=>{if(!(0,t.isDefined)(e))return;const o=e=>{try{e()}catch(t){console.error(n,t)}};"function"==typeof e?o(e):Promise.resolve(e).then((e=>{"function"==typeof e&&o(e)}))};t.isOptionalType=e=>/\?$/.test(e);t.ensure=(e,t)=>{if(void 0===e)throw new Error(t||"Undefined value passed");return e};t.removeDupes=e=>Array.from(new Set(e));t.noop=()=>{};t.delay=e=>new Promise((t=>setTimeout(t,e)));t.eventually=async function(e,n,o,i){if(void 0===n&&(n=1e3),void 0===o&&(o=100),void 0===i&&(i=new Set),n<0){const e=Array.from(i).reduce(((e,t,n)=>`${e}\n\t\t${n+1}. ${t}`),"");throw new Error(`[Eventually timeout exceeded after: timeout with error]: ${e}`)}try{await e()}catch(s){const r=Date.now();await(0,t.delay)(o);const a=Date.now()-r;return i.add(null==s?void 0:s.message),(0,t.eventually)(e,n-a,o,i)}},t.simplePluralize=function(e,t){return`${e} ${t}${1!==e?"s":""}`}},39043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileObjectTemplate=t.compileStringTemplate=void 0;t.compileStringTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=new RegExp("\\$\\{"+e+"\\}","g");n=n.replace(i,o)})),n};t.compileObjectTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=JSON.stringify(o),s=new RegExp('"\\$\\$\\{'+e+'\\}"',"g"),r=new RegExp("\\$\\{"+e+"\\}","g"),a="string"==typeof o?o.replace(/"/g,((e,t,n)=>"\\"!==n[t-1]?'\\"':n[t])):o;n=n.replace(s,i).replace(r,a).replace(/\n/g,"\\n")})),JSON.parse(n)}},69150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connection=t.connectionData=t.connectionDataEquals=t.connectionNodeEquals=t.connectionNode=t.externalConnectionNode=t.isInternalConnection=t.isExternalConnection=t.isInternalConnectionNode=t.isExternalConnectionNode=t.getNodeOutputs=t.getOutputName=t.getInputName=t.getNodeInputs=t.TRIGGER_PIN_ID=t.ERROR_PIN_ID=t.THIS_INS_ID=void 0;const o=n(30292);t.THIS_INS_ID="__this",t.ERROR_PIN_ID="__error",t.TRIGGER_PIN_ID="__trigger";t.getNodeInputs=e=>({...e.inputs,[t.TRIGGER_PIN_ID]:(0,o.nodeInput)()});t.getInputName=e=>e===t.TRIGGER_PIN_ID?"Trigger Node":e;t.getOutputName=e=>e===t.ERROR_PIN_ID?"Error":e;t.getNodeOutputs=e=>({...e.outputs,[t.ERROR_PIN_ID]:(0,o.nodeOutput)()});t.isExternalConnectionNode=e=>e&&e.insId===t.THIS_INS_ID;t.isInternalConnectionNode=e=>e.insId!==t.THIS_INS_ID;t.isExternalConnection=e=>{let{from:n,to:o}=e;return(0,t.isExternalConnectionNode)(n)||(0,t.isExternalConnectionNode)(o)};t.isInternalConnection=e=>!(0,t.isExternalConnection)(e);t.externalConnectionNode=e=>({insId:t.THIS_INS_ID,pinId:e});t.connectionNode=(e,t)=>({insId:e,pinId:t});t.connectionNodeEquals=(e,t)=>e.insId===t.insId&&e.pinId===t.pinId;t.connectionDataEquals=(e,n)=>!(!e||!n)&&((0,t.connectionNodeEquals)(e.from,n.from)&&(0,t.connectionNodeEquals)(e.to,n.to)),t.connectionData=function(e,n,o){const i="string"==typeof e?e.split("."):e,s="string"==typeof n?n.split("."):n;if(i.length>2||s.length>2)throw new Error(`invalid source or target to connection data - ${e} / ${n}`);return{from:2===i.length?(0,t.connectionNode)(i[0],i[1]):(0,t.externalConnectionNode)(i[0]),to:2===s.length?(0,t.connectionNode)(s[0],s[1]):(0,t.externalConnectionNode)(s[0]),delayed:o}};t.connection=function(e,t,n){return void 0===n&&(n=!1),{from:e,to:t,delayed:n}}},6775:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;const s=n(30292),r=n(47025),a=n(86873),u=n(69150);i(n(69150),t);t.connect=function(e,t,n,o,i,l,c,d){void 0===n&&(n={}),void 0===i&&(i={}),void 0===l&&(l=a.noop),void 0===c&&(c={}),void 0===d&&(d={});const{id:p,connections:f,instances:m}=e,v=p||"connected-node"+(0,a.randomInt)(999);return{inputs:e.inputs,outputs:e.outputs,id:v,completionOutputs:e.completionOutputs,reactiveInputs:e.reactiveInputs,run:(p,h)=>{let g=[];const I=new a.DepGraph({}),y=new Map,b=new Map,C=new Map,_=new Map,x=new Map,N=new Map;let w;const j=new Set;m.forEach((e=>{const n=(0,s.getNode)(e,t),o=e.id;y.set(e,o),b.set(o,e),I.addNode(o);const i=Object.keys(n.inputs),r=Object.keys(n.outputs),a={},l={};i.forEach((t=>{const n=(e.inputConfig||{})[t]||(0,s.queueInputPinConfig)();(0,s.isStaticInputPinConfig)(n)?a[t]=(0,s.staticNodeInput)(n.value):a[t]=(0,s.dynamicNodeInput)({config:n})})),a[u.TRIGGER_PIN_ID]=(0,s.dynamicNodeInput)({config:(0,s.queueInputPinConfig)()});if(f.some((t=>(0,u.isInternalConnectionNode)(t.to)&&t.to.insId===e.id&&t.to.pinId===u.TRIGGER_PIN_ID))&&e.inputConfig&&e.inputConfig[u.TRIGGER_PIN_ID])throw"Trigger connection can not be configured";r.forEach((e=>{const t=(0,s.dynamicOutput)();l[e]=t}));f.some((t=>(0,u.isInternalConnectionNode)(t.from)&&t.from.insId===e.id&&t.from.pinId===u.ERROR_PIN_ID))&&(l[u.ERROR_PIN_ID]=(0,s.dynamicOutput)()),C.set(o,a),_.set(o,l)}));const P=new Set;return f.forEach((n=>{const{from:o,to:i}=n,{insId:r,pinId:a}=o,{insId:l,pinId:c}=i,d=_.get(r),p=C.get(l);if((0,u.isInternalConnectionNode)(i)&&P.add(`${i.insId}.${i.pinId}`),(0,u.isExternalConnection)(n)){if((0,u.isExternalConnectionNode)(o)){const e=null==p?void 0:p[i.pinId];if(!e)throw new Error(`Input ${i.pinId} of instance ${l} not found`);const t=x.get(o.pinId)||[];t.push(e),x.set(o.pinId,t)}else{let e=null==d?void 0:d[o.pinId];if(!e)throw new Error(`Output ${o.pinId} of instance ${r} not found`);const t=N.get(i.pinId)||[];t.push(e),N.set(i.pinId,t)}return}if(!d)throw new Error(`No outputs found for instance [${r}]`);if(!p)throw b.has(l)?new Error(`No inputs found for instance [${l}]`):new Error(`Instance with id [${l}] does not exist!`);const f=d[a];if(!f)throw new Error(`Output source - [${a}] not found in node [${v}]`);const m=p[c],h=b.get(r);if(!h&&r!==u.THIS_INS_ID)throw new Error(`Instance [${r}] does not exist! failed to connect [${o}] -> [${i}]`);const y=(h?(0,s.getNode)(h,t):e).outputs[a];if(y&&y.delayed||n.delayed||r!==u.THIS_INS_ID&&l!==u.THIS_INS_ID&&I.addDependency(r,l),!m)throw new Error(`Target arg - [${i}] not found in node [${v}]`);const w=f.subscribe((async e=>{if(!(0,s.isDynamicInput)(m))throw console.info(m),new Error(`Impossible state listening to non dynamic input - ${l}.${c}`);m.subject.next(e)}));g.push((()=>w.unsubscribe()))})),(0,a.okeys)(h).forEach((e=>{(N.get(e)||[]).forEach((t=>{const n=t.subscribe((async t=>{if(!h[e])throw new Error(`Impossible state - output ${e} does not exist`);h[e].next(t)}));g.push((()=>n.unsubscribe()))}))})),I.overallOrder().map((e=>b.get(e))).forEach((e=>{const a=C.get(e.id),u=_.get(e.id),p=(0,s.getNode)(e,t);if(!a)throw new Error(`Unexpected error - args not found when running ${e}`);if(!u)throw new Error(`Unexpected error - outputs not found when running ${e}`);for(const t in a){const n=e.inputConfig[t];P.has(`${e.id}.${t}`)||(0,s.isStaticInputPinConfig)(n)||delete a[t]}const f=(0,r.execute)({node:p,inputs:a,outputs:u,resolvedDeps:t,_debugger:n,insId:e.id,extraContext:d,mainState:i,ancestorsInsIds:o,onBubbleError:l,onCompleted:()=>{return t=e.id,j.delete(t),void(0===j.size&&w&&w());var t},onStarted:()=>{return t=e.id,void j.add(t);var t},env:c});g.push(f)})),Object.keys(p).forEach((async e=>{(x.get(e)||[]).forEach((t=>{const n=p[e];if(!(0,s.isDynamicInput)(t))throw new Error(`Unsure what to do with key ${e}, input: ${t} of ins ${o}`);(0,a.isDefined)(n)&&t.subject.next(n)}))})),void 0===e.completionOutputs&&j.size>0?new Promise((e=>{w=e})):()=>g.forEach((e=>{try{e()}catch(t){console.error("error unsubscribing",t)}}))}}}},26488:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MINOR_DEBUGGER_EVENT_TYPES=t.MAJOR_DEBUGGER_EVENT_TYPES=t.DebuggerEventType=void 0,function(e){e.INPUT_CHANGE="i",e.OUTPUT_CHANGE="o",e.PROCESSING_CHANGE="pc",e.ERROR="err",e.INPUTS_STATE_CHANGE="isc"}(n=t.DebuggerEventType||(t.DebuggerEventType={})),t.MAJOR_DEBUGGER_EVENT_TYPES=[n.INPUT_CHANGE,n.OUTPUT_CHANGE,n.ERROR],t.MINOR_DEBUGGER_EVENT_TYPES=[n.PROCESSING_CHANGE,n.INPUTS_STATE_CHANGE]},43686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatEvent=void 0;const o=n(26488);t.formatEvent=function(e){var t,n,i;const s=[e.insId,...null!==(n=null===(t=e.ancestorsInsIds)||void 0===t?void 0:t.split("."))&&void 0!==n?n:[]];(null===(i=e.ancestorsInsIds)||void 0===i?void 0:i.length)>0&&e.ancestorsInsIds;const r=`Node <${e.nodeId}> `,a=`(${s.join(" -> ")})`;return`${r} - ${function(e){switch(e.type){case o.DebuggerEventType.PROCESSING_CHANGE:return e.val?"started processing":"stopped processing";case o.DebuggerEventType.INPUT_CHANGE:return`Input pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.OUTPUT_CHANGE:return`Output pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.INPUTS_STATE_CHANGE:return`Inputs queue size changed to ${Object.entries(e.val).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join(", ")}`;case o.DebuggerEventType.ERROR:return`Error: ${e.val}`}}(e)} ${a}`}},99896:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26488),t),i(n(43686),t)},47025:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.GLOBAL_STATE_NS=t.ROOT_INS_ID=t.INPUTS_STATE_SUFFIX=t.INNER_STATE_SUFFIX=void 0;const s=n(62600),r=n(87794);i(n(99896),t);const a=n(30292),u=n(6775),l=n(84479),c=n(86873),d=n(23046),p=n(30292),f=n(99896),m=n(79804);t.INNER_STATE_SUFFIX="_inner",t.INPUTS_STATE_SUFFIX="_inputs";t.ROOT_INS_ID="__root",t.GLOBAL_STATE_NS="____global";t.execute=e=>{let{node:n,inputs:o,outputs:i,resolvedDeps:v,_debugger:h={},insId:g=t.ROOT_INS_ID,extraContext:I={},mainState:y={},ancestorsInsIds:b,onBubbleError:C=s.noop,env:_={},onCompleted:x=s.noop,onStarted:N=s.noop}=e;const w=[];y[t.GLOBAL_STATE_NS]||(y[t.GLOBAL_STATE_NS]=new Map);const j={...I,ENV:_},P=(0,m.customNodesToNodesCollection)(v,j),O=e=>{const t=e instanceof a.NodeInstanceError?e:new a.NodeInstanceError(e,(0,c.fullInsIdPath)(g,b),n.id);h.onEvent&&h.onEvent({type:f.DebuggerEventType.ERROR,val:t,insId:g,ancestorsInsIds:b,nodeId:n.id}),i[u.ERROR_PIN_ID]?i[u.ERROR_PIN_ID].next(t):C(t)},E=(e=>(0,a.isVisualNode)(e)?(0,u.connect)(e,P,h,(0,c.fullInsIdPath)(g,b),y,O,_,I):(0,a.isInlineValueNode)(e)?(0,m.inlineValueNodeToNode)(e,j):e)(n),D=h.onEvent||s.noop,S={},M={};(0,c.entries)(o).forEach((e=>{let[t,o]=e;if((0,a.isDynamicInput)(o)){const e=(0,a.dynamicNodeInput)({config:o.config}),i=o.subject.subscribe((async o=>{const i=D({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o,ancestorsInsIds:b,nodeId:n.id});if(i){const t=await i.valuePromise;e.subject.next(t)}else h.debugDelay&&await(0,c.delay)(h.debugDelay),e.subject.next(o)}));w.push((()=>i.unsubscribe())),M[t]=e}else{D({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o.config.value,ancestorsInsIds:b,nodeId:n.id});const e=(0,a.staticNodeInput)((0,a.getStaticValue)(o.config.value,P,g));M[t]=e}})),(0,c.entries)(i).forEach((e=>{let[t,o]=e;const i=(0,a.dynamicOutput)(),s=i.subscribe((async e=>{const i=D({type:f.DebuggerEventType.OUTPUT_CHANGE,insId:g,pinId:t,val:e,ancestorsInsIds:b,nodeId:n.id});if(i){const e=await i.valuePromise;o.next(e)}else o.next(e)}));w.push((()=>s.unsubscribe())),S[t]=i}));const T=(e=>{var n,o;const{node:i,inputs:u,outputs:m,resolvedDeps:v,_debugger:h,insId:g,ancestorsInsIds:I,mainState:y,onError:b,onStarted:C,onCompleted:_,env:x,extraContext:N}=e,{run:w,fn:j}=i,P=(0,d.debugLogger)("core"),O=[];let E;const D=(null==h?void 0:h.onEvent)||s.noop,S=(0,c.fullInsIdPath)(g,I),M=`${S}${t.INNER_STATE_SUFFIX}`,T=`${S}${t.INPUTS_STATE_SUFFIX}`,k=P.extend(S),R=y[t.GLOBAL_STATE_NS];y[M]||(y[M]=new Map),y[T]||(y[T]=new Map);let A=null!==(n=y[T])&&void 0!==n?n:new Map;const V=()=>{const e=Array.from(A.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:(0,a.isQueueInputPinConfig)(u[n].config)?null==o?void 0:o.length:1}}),{});D({type:f.DebuggerEventType.INPUTS_STATE_CHANGE,val:e,insId:g,ancestorsInsIds:I,nodeId:i.id})},$={execute:(e,n,o,i)=>(0,t.execute)({node:e,inputs:n,outputs:o,resolvedDeps:v,_debugger:h,insId:i,onCompleted:_,onStarted:C}),insId:g,state:null!==(o=y[M])&&void 0!==o?o:new Map,onCleanup:e=>{O.push(e)},onError:e=>{b(e)},context:null!=N?N:{},ancestorsInsIds:I,globalState:R};let z,H=!1;const G=(i.reactiveInputs||[]).filter((e=>{var t;return!(0,p.isStaticInputPinConfig)(null===(t=u[e])||void 0===t?void 0:t.config)})),L=()=>{var e;null===(e=y[M])||void 0===e||e.clear(),(0,c.keys)(y).filter((e=>e.startsWith(`${S}.`))).forEach((e=>{y[e]=new Map}))},F=e=>{const t=(null==e?void 0:e.key)&&G.includes(null==e?void 0:e.key);if(H&&!t);else{const o=H&&t;if((0,l.isNodeStateValid)(u,A,i)||o){let t;if(H){if(!e)throw new Error("Unexpected state, got reactive node while not processing and not valid");const n=(0,l.pullValueForExecution)(e.key,u[e.key],A,x);t={...z,[e.key]:n},V()}else t=(0,l.pullValuesForExecution)(u,A,x),z=t,V();let o=new Set,s={};if(H=!0,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),i.completionOutputs){const e=i.completionOutputs.map((e=>e.split("+"))).reduce(((e,t)=>(t.forEach((n=>{e.set(n,t)})),e)),new Map);(0,c.entries)(m).forEach((t=>{let[n,a]=t;a.pipe((0,r.first)()).subscribe((t=>{o.add(n),s[n]=t;let r=e.get(n);r&&(r.splice(r.indexOf(n),1),0===r.length&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_&&_(s),L(),(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),E=void 0,o.clear(),s={},(0,l.hasNewSignificantValues)(u,A,x,i.id)&&F()))}))}))}else(0,c.entries)(m).forEach((e=>{let[t,n]=e;n.subscribe((e=>{s[t]=e}))}));try{k("Running node %s with values %o",i.id,t),C&&C(),E=(null!=j?j:w)(t,m,$),(0,c.isPromise)(E)?E.then((()=>{void 0===i.completionOutputs&&_&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_(s),L(),(0,l.hasNewSignificantValues)(u,A,x,i.id)&&F())})).catch((e=>{b(e),H=!1,k("Error in node %s - value %e",i.id,e),D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id})})):void 0===i.completionOutputs&&_&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_(s),L())}catch(n){b(n),H=!1,k("Error in node %s - value %e",i.id,n),D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id})}const d=G.find((e=>u[e]&&(0,l.peekValueForExecution)(e,u[e],A,x,i.id)));if(d){const e=(0,l.peekValueForExecution)(d,u[d],A,x,i.id);F({key:d,value:e})}else{const e=(0,c.entries)(u).find((e=>{let[t,n]=e;const o=(0,a.isQueueInputPinConfig)(n.config),s=(0,l.peekValueForExecution)(t,n,A,x,i.id);return!!o&&(0,c.isDefined)(s)}));if(e){const[t,n]=e,o=(0,l.peekValueForExecution)(t,n,A,x,i.id);F({key:t,value:o})}}}}};F();const B=(0,l.subscribeInputsToState)(u,A,((e,t)=>{P("Got input %s - value is [%o]",e,t),V();try{F({key:e,value:t})}catch(n){b(n)}}));return O.push(B),()=>{(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),O.forEach((e=>e()))}})({node:E,inputs:M,outputs:S,resolvedDeps:P,_debugger:h,insId:g,mainState:y,ancestorsInsIds:b,onError:O,onBubbleError:C,env:_,extraContext:I,onCompleted:x,onStarted:N});return()=>{w.forEach((e=>e())),T()}}},84479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeInputsToState=t.isNodeStateValid=t.hasNewSignificantValues=t.peekValuesForExecution=t.pullValuesForExecution=t.pullValueForExecution=t.peekValueForExecution=void 0;const o=n(30292),i=n(86873),s=n(6775),r=(e,t)=>{const n=(0,o.extractStaticValue)(e);if((0,o.isEnvValue)(n)){return((e,t)=>{const n=e.split(".");let o={...t};for(let s of n){if(!o||!(0,i.isDefined)(o[s])||null===o[s])throw new Error(`Cannot find key ${e} inside obj ${t}`);o=o[s]}return o})((0,o.getEnvKeyFromValue)(n),t)}return n};t.peekValueForExecution=(e,t,n,i,s)=>{const a=n.get(e);let u;if(!t)throw new Error(`Trying to peek value of inexsting input in key "${e}" in node "${s}"`);return u=(0,o.isStaticInput)(t)?r(t,i):(0,o.isQueueInputPinConfig)(t.config)?a?[...a].shift():void 0:a,u};t.pullValueForExecution=(e,t,n,i)=>{const s=n.get(e);let a;return(0,o.isStaticInput)(t)?a=r(t,i):(0,o.isQueueInputPinConfig)(t.config)?(a=(s||[]).shift(),n.set(e,s)):(a=s,(0,o.isStickyInputPinConfig)(t.config)||n.delete(e)),a};t.pullValuesForExecution=(e,n,o)=>(0,i.entries)(e).reduce(((e,i)=>{let[s,r]=i;return e[s]=(0,t.pullValueForExecution)(s,r,n,o),e}),{});t.peekValuesForExecution=(e,n,o,s)=>(0,i.entries)(e).reduce(((e,i)=>{let[r,a]=i;return e[r]=(0,t.peekValueForExecution)(r,a,n,o,s),e}),{});t.hasNewSignificantValues=(e,n,s,r)=>(0,i.entries)(e).some((e=>{let[a,u]=e;const l=(0,o.isQueueInputPinConfig)(u.config),c=(0,t.peekValueForExecution)(a,u,n,s,r);return(0,i.isDefined)(c)&&l}));t.isNodeStateValid=(e,t,n)=>{const r=(0,i.keys)(e),a=(0,i.keys)(n.inputs).filter((e=>{var t;const o=null===(t=n.inputs[e])||void 0===t?void 0:t.mode;return!o||"required"===o}));r.includes(s.TRIGGER_PIN_ID)&&a.push(s.TRIGGER_PIN_ID);return!!(0,i.containsAll)(r,a)&&(0,i.entries)(e).filter((e=>{let[t]=e;return!!n.inputs[t]||t===s.TRIGGER_PIN_ID})).every((e=>{let[s,r]=e;var a;const u=t.get(s);return"optional"===((null===(a=n.inputs[s])||void 0===a?void 0:a.mode)||"required")||(!!(0,o.isStaticInput)(r)||((0,o.isQueueInputPinConfig)(r.config)?(0,i.isDefined)(u)&&u.length>0:(0,i.isDefined)(u)))}))};t.subscribeInputsToState=(e,t,n)=>{const s=[];return(0,i.entries)(e).forEach((e=>{let[i,r]=e;if(!r)return;if((0,o.isStaticInput)(r))return;const a=r.subject.subscribe((e=>{if((0,o.isQueueInputPinConfig)(r.config)){const o=t.get(i)||[];if(!Array.isArray(o))throw new Error(`impossible state - state of key ${i} is set but not an array`);o.push(e),t.set(i,o),n(i,e)}else t.set(i,e),n(i,e)}));s.push((()=>a.unsubscribe()))})),()=>s.forEach((e=>e()))}},5474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flydeFlowSchema=void 0;const o=n(29022),i=o.z.record(o.z.string(),o.z.string().or(o.z.array(o.z.string()))),s=o.z.strictObject({x:o.z.number(),y:o.z.number()}),r=o.z.discriminatedUnion("mode",[o.z.strictObject({mode:o.z.literal("static"),value:o.z.any()}),o.z.strictObject({mode:o.z.literal("queue")}),o.z.strictObject({mode:o.z.literal("sticky")})]),a=o.z.object({size:o.z.optional(o.z.enum(["small","regular","large"])),icon:o.z.optional(o.z.any()),color:o.z.optional(o.z.string()),cssOverride:o.z.optional(o.z.record(o.z.string()))}),u=o.z.object({pos:s.default({x:0,y:0}),id:o.z.string(),inputConfig:o.z.optional(o.z.record(o.z.string(),r)).default({}),visibleInputs:o.z.optional(o.z.array(o.z.string())),visibleOutputs:o.z.optional(o.z.array(o.z.string())),nodeId:o.z.optional(o.z.string()),node:o.z.optional(o.z.any()),style:o.z.optional(a)}).refine((e=>e.node||e.nodeId),{message:"Instance must have either an inline node or refer to a nodeId"}),l=o.z.union([o.z.string(),o.z.object({mode:o.z.enum(["required","optional","required-if-connected"]),type:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),defaultValue:o.z.optional(o.z.any())})]),c=o.z.object({type:o.z.optional(o.z.string()),optional:o.z.optional(o.z.boolean()),delayed:o.z.optional(o.z.boolean()),description:o.z.optional(o.z.string())}),d=o.z.object({id:o.z.optional(o.z.string()),inputs:o.z.record(o.z.string(),l),outputs:o.z.record(o.z.string(),c),inputsPosition:o.z.optional(o.z.record(o.z.string(),s)),outputsPosition:o.z.optional(o.z.record(o.z.string(),s)),customViewCode:o.z.optional(o.z.string()),dataBuilderSource:o.z.optional(o.z.string()),templateType:o.z.optional(o.z.string()),completionOutputs:o.z.optional(o.z.array(o.z.string())),reactiveInputs:o.z.optional(o.z.array(o.z.string())),defaultStyle:o.z.optional(a),description:o.z.optional(o.z.string()),searchKeywords:o.z.optional(o.z.array(o.z.string()))}),p=o.z.object({instances:o.z.array(u),connections:o.z.array(o.z.strictObject({from:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),to:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),delayed:o.z.optional(o.z.boolean()),hidden:o.z.optional(o.z.boolean())}))}).and(d);t.flydeFlowSchema=o.z.strictObject({imports:o.z.optional(i).default({}),node:p})},74762:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticValueVisualNode=void 0,i(n(86873),t);const s=n(30292);i(n(6775),t),i(n(47025),t),i(n(10418),t),i(n(30292),t),i(n(3320),t),i(n(79804),t),i(n(5474),t);t.isStaticValueVisualNode=e=>!!e&&!!(0,s.maybeGetStaticValueNodeId)(`${e}`)},87093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fakeVm=t.VM=t.VMScript=void 0;const o=n(86873);class i{constructor(e){this.script=e}}t.VMScript=i;class s{constructor(e){this.context=e}run(e){const t=(0,o.okeys)(this.context.sandbox),n=Object.values(this.context.sandbox);Function(...t,e.script)(...n)}}t.VM=s,t.fakeVm={VMScript:i,VM:s}},28145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVM2Instance=void 0;const o=n(87093);t.getVM2Instance=()=>o.fakeVm},79804:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.customNodesToNodesCollection=t.inlineValueNodeToNode=void 0;const i=o(n(18706)),s=n(86873),r=n(30292),a=(0,n(28145).getVM2Instance)();t.inlineValueNodeToNode=function(e,t){void 0===t&&(t={});const{runFnRawCode:n,...o}=e,u=(0,s.debugLogger)(`code-node:${e.id}`),l=`\n try {\n ${n}\n } catch (e) {\n adv.onError(e);\n }\n `,c=new a.VMScript(l),d={...o,run:(n,o,l)=>{const d=new a.VM({sandbox:{inputs:n,outputs:o,setInterval:setInterval,clearInterval:clearInterval,setTimeout:setTimeout,clearTimeout:clearTimeout,encodeURIComponent:encodeURIComponent,adv:l,log:function(){for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeWithDependencies=void 0;const o=n(30292),i=n(74762),s=n(88270);t.getNodeWithDependencies=function(e,n,r){if(void 0===r&&(r=[]),(0,o.isInlineValueNode)(e))return[e];if(r.includes(e.id))return[];const a=(0,i.removeDupes)(e.instances.filter((e=>(0,s.isRefNodeInstance)(e))).map((e=>e.nodeId)).filter((e=>n[e])));return[e,...a.flatMap((e=>{var t;return null!==(t=n[e])&&void 0!==t?t:[]})).reduce(((e,o)=>[...e,...(0,t.getNodeWithDependencies)(o,n,[...r,...a])]),[])]}},30292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88270),t),i(n(43069),t),i(n(79426),t),i(n(44535),t),i(n(18063),t),i(n(20359),t)},18063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeInstanceError=void 0;class n extends Error{constructor(e,t,n){let o="Unknown error";o="string"==typeof e?e:e instanceof Error?e.message:null!==e&&"object"==typeof e?JSON.stringify(e):String(e),super(`${o} (insId: ${t}, nodeId: ${n})`),this.name=this.constructor.name,this.message=`${o} (insId: ${t}, nodeId: ${n})`,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.fullInsIdsPath=t,this.nodeId=n}}t.NodeInstanceError=n},88270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInsId=t.NodeInstance=t.isRefNodeInstance=t.isInlineNodeInstance=t.inlineNodeInstance=t.nodeInstance=void 0;const o=n(36618);t.nodeInstance=(e,t,n,o)=>({id:e,nodeId:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.inlineNodeInstance=(e,t,n,o)=>({id:e,node:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.isInlineNodeInstance=e=>!!e.node;t.isRefNodeInstance=e=>!(0,t.isInlineNodeInstance)(e);t.NodeInstance=(e,t,n,o)=>({id:e,nodeId:t.id,inputConfig:n||{},pos:o||{x:0,y:0}});t.createInsId=e=>`${e.id}-${(0,o.slug)()}`},43069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvKeyFromValue=t.toEnvValue=t.isEnvValue=t.extractStaticValue=t.isStaticInput=t.isDynamicInput=t.staticNodeInput=t.dynamicNodeInputs=t.dynamicNodeInput=t.dynamicOutput=t.nodeOutputs=t.nodeOutput=t.nodeInputs=t.isInputPinOptional=t.nodeInput=void 0;const o=n(62600),i=n(30292),s=n(86873),r=n(79426);t.nodeInput=function(e){return void 0===e&&(e="required"),{mode:e}};t.isInputPinOptional=e=>"optional"===e.mode;t.nodeInputs=(e,n)=>(0,s.repeat)(e,(e=>(0,t.nodeInput)((null==n?void 0:n[e])||"required")));t.nodeOutput=function(e){return void 0===e&&(e=!1),{delayed:e}};t.nodeOutputs=e=>(0,s.repeat)(e,(()=>(0,t.nodeOutput)()));t.dynamicOutput=()=>new o.Subject,t.dynamicNodeInput=(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})));t.dynamicNodeInputs=function(e){return void 0===e&&(e=10),(0,s.repeat)(e,(()=>(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})))()))};t.staticNodeInput=e=>({config:(0,r.staticInputPinConfig)(e)});t.isDynamicInput=e=>{const t=e;return t&&t.subject&&!!t.subject.next};t.isStaticInput=e=>(0,i.isStaticInputPinConfig)(null==e?void 0:e.config);t.extractStaticValue=e=>{if((0,t.isStaticInput)(e))return e.config.value;throw new Error("Cannot extract static value from non static arg")};t.isEnvValue=e=>"string"==typeof e&&e.startsWith("$ENV.");t.toEnvValue=e=>`$ENV.${e}`;t.getEnvKeyFromValue=e=>"string"==typeof e?e.replace(/^\$ENV\./,""):e},20359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeFromFunction=t.getNodeDef=t.getNode=t.getStaticValue=t.maybeGetStaticValueNodeId=t.fromSimplified=t.inlineValueNode=t.codeNode=t.visualNode=t.isInlineValueNode=t.isVisualNode=t.isCodeNode=t.isBaseNode=t.InlineValueNodeType=void 0;const o=n(86873),i=n(88270),s=n(43069);!function(e){e.VALUE="value",e.FUNCTION="function"}(t.InlineValueNodeType||(t.InlineValueNodeType={}));t.isBaseNode=e=>e&&e.id&&e.inputs&&e.outputs;t.isCodeNode=e=>(0,t.isBaseNode)(e)&&"function"==typeof e.run;t.isVisualNode=e=>!!e.instances;t.isInlineValueNode=e=>(0,o.isDefined)(e)&&(0,o.isDefined)(e.runFnRawCode),t.visualNode=(0,o.testDataCreator)({id:"visual-node",inputs:{},outputs:{},instances:[],connections:[],outputsPosition:{},inputsPosition:{}}),t.codeNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},run:o.noop}),t.inlineValueNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},runFnRawCode:""});t.fromSimplified=e=>{let{run:t,inputTypes:n,outputTypes:i,id:s}=e;return{id:s,inputs:(0,o.entries)(n).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),outputs:(0,o.entries)(i).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),run:t}};t.maybeGetStaticValueNodeId=e=>{const t="string"==typeof e&&e.match(/^__node\:(.*)/);if(t){return t[1]}return null};t.getStaticValue=(e,n,o)=>{const i=(0,t.maybeGetStaticValueNodeId)(e);if(i){const e=n[i];if(!e)throw new Error(`Instance ${o} referrer to a node reference ${i} that does not exist`);return e}return e};t.getNode=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw new Error(`Node with id ${n} not found`);return o};t.getNodeDef=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw console.error(`Node with id ${n} not found`),new Error(`Node with id ${n} not found`);return o};t.codeFromFunction=e=>{let{id:t,fn:n,inputNames:o,outputName:i,defaultStyle:r}=e;return{id:t,inputs:o.reduce(((e,t)=>({...e,[t]:(0,s.nodeInput)()})),{}),outputs:{[i]:(0,s.nodeOutput)()},run:(e,t)=>{const s=o.map((t=>e[t])),r=t[i],a=n(...s);return Promise.resolve(a).then((e=>null==r?void 0:r.next(e)))},completionOutputs:[i],defaultStyle:r}}},44535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nodeFromSimpleFunction=void 0,t.nodeFromSimpleFunction=function(e){var t;return{...e,id:e.id,description:e.description,namespace:e.namespace,inputs:e.inputs?e.inputs.reduce(((e,t)=>{let{name:n,description:o,mode:i,defaultValue:s}=t;return{...e,[n]:{description:o,mode:null!=i?i:"required",defaultValue:s}}}),{}):{},outputs:e.output?{[e.output.name]:{description:e.output.description}}:{},defaultStyle:{icon:e.icon,size:e.size},run:null!==(t=e.fullRunFn)&&void 0!==t?t:async function(t,n,o){var i,s;const r=(null!==(i=e.inputs)&&void 0!==i?i:[]).map((e=>{let{name:n}=e;return t[n]}));try{const t=await Promise.resolve(e.run(...r));e.output&&(null===(s=n[e.output.name])||void 0===s||s.next(t))}catch(a){console.error("Error in node",a),o.onError(a)}},customViewCode:e.customViewCode}}},79426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticInputPinConfig=t.isStickyInputPinConfig=t.isQueueInputPinConfig=t.staticInputPinConfig=t.stickyInputPinConfig=t.queueInputPinConfig=t.INPUT_MODES=void 0,t.INPUT_MODES=["queue","sticky","static"];t.queueInputPinConfig=()=>({mode:"queue"});t.stickyInputPinConfig=()=>({mode:"sticky"});t.staticInputPinConfig=e=>({mode:"static",value:e});t.isQueueInputPinConfig=e=>"queue"===e.mode;t.isStickyInputPinConfig=e=>!!e&&"sticky"===e.mode,t.isStaticInputPinConfig=function(e){return!!e&&"static"===e.mode}},10418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedExecute=void 0;const o=n(74762),i=n(47025);t.simplifiedExecute=function(e,t,n,s,r){void 0===r&&(r={});const a=(0,o.keys)(e.outputs),u=Object.keys(n).reduce(((e,t)=>{const i=n[t];return{...e,[t]:(0,o.isDynamicInput)(i)?i:(0,o.staticNodeInput)(i)}}),{}),l=a.reduce(((e,t)=>{const n=(0,o.dynamicOutput)();return s&&n.subscribe((e=>{s(t,e)})),{...e,[t]:n}}),{});return(0,i.execute)({node:e,inputs:u,outputs:l,resolvedDeps:t,onBubbleError:e=>{throw e},...r})}},25779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodePreview=void 0;const o=n(35250),i=n(74762),s=n(86553);t.NodePreview=e=>{let{node:t}=e;const n={node:t,instance:(0,i.nodeInstance)("bob",t.id,{}),connections:[],viewPort:{pos:{x:0,y:0},zoom:1},resolvedDeps:{},connectionsPerInput:{},onUngroup:i.noop,onDblClick:i.noop,onDragEnd:i.noop,onDragMove:i.noop,onDragStart:i.noop,onPinClick:i.noop,onPinDblClick:i.noop,onSelect:i.noop,onTogglePinBreakpoint:i.noop,onTogglePinLog:i.noop,onToggleSticky:i.noop,displayMode:!0,onInspectPin:i.noop,onDetachConstValue:i.noop,onCopyConstValue:i.noop,onPasteConstValue:i.noop,ancestorsInsIds:"",onChangeVisibleInputs:i.noop,onChangeVisibleOutputs:i.noop,onConvertConstToEnv:i.noop,forceShowMinimized:"both",onExtractInlineNode:i.noop,onCloseInlineEditor:i.noop,isConnectedInstanceSelected:!1,inlineEditorPortalDomNode:null,onChangeStyle:i.noop,onDeleteInstance:i.noop,onGroupSelected:i.noop,onSetDisplayName:i.noop,hadError:!1,queuedInputsData:{},onPinMouseDown:i.noop,onPinMouseUp:i.noop};return(0,o.jsx)("div",{className:"node-preview",children:(0,o.jsx)(s.InstanceView,{...n})})}},30653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDarkMode=t.DarkModeProvider=void 0;const o=n(70079),i=(0,o.createContext)(!0);t.DarkModeProvider=i.Provider;t.useDarkMode=()=>(0,o.useContext)(i)},29183:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataInspectionModal=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=n(74089),p=n(83938),f=n(17102),m=n(98158);t.DataInspectionModal=e=>{var t;const{onRequestHistory:n}=(0,m.useDebuggerContext)(),{item:o}=e,[i,s]=c.default.useState(),[r,v]=c.default.useState(0),[h,g]=c.default.useState(""),[I,y]=c.default.useState(),[b]=(0,d.useDebounce)(h,300);(0,c.useEffect)((()=>{y(null==i?void 0:i.lastSamples.filter((e=>"object"==typeof e.val?JSON.stringify(e.val).includes(b):e.val.toString().includes(b)))),v(0)}),[null==i?void 0:i.lastSamples,b]),c.default.useEffect((()=>{!async function(){var e,t;const i=await n(o.insId,null===(e=o.pin)||void 0===e?void 0:e.id,null===(t=o.pin)||void 0===t?void 0:t.type);s(i)}()}),[o,n]);const C=e=>{const t=e.val;return"object"==typeof t?(0,a.jsx)(p.BrowserOnlyReactJson,{src:t}):(0,a.jsx)(u.Code,{children:t.toString()})},_=`"${o.insId}" ${(null===(t=o.pin)||void 0===t?void 0:t.id)?`(${o.pin.id})`:""}`;return(0,a.jsx)(u.Dialog,{isOpen:!0,title:`Inspecting data for instance ${_}`,onClose:e.onClose,canEscapeKeyClose:!1,className:"data-inspection-modal",children:(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{children:[i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("em",{children:[_," called ",i.total," time(s)"]}),i.total>10&&(0,a.jsx)("span",{children:"Showing last 10 samples"})]}):null,(0,a.jsx)("input",{className:"bp5-input bp5-small bp5-fill",type:"search",placeholder:"Search for values",dir:"auto",onChange:e=>g(e.target.value),value:h}),b.length>0&&(0,a.jsxs)("span",{children:["Showing ",null==I?void 0:I.length," of ",i.lastSamples.length," ",'samples matching query "',b,'"']})]}),(0,a.jsx)("main",{className:"main-wrapper",children:(()=>{if(!i)return(0,a.jsx)(f.Loader,{});if(0===i.total)return(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",(0,a.jsx)("em",{children:o.insId})," ",o.pin?(0,a.jsxs)(c.default.Fragment,{children:["and pin ",(0,a.jsx)("em",{children:o.pin.id})]}):null,". Make sure debugger is running and your program was triggered."]});const e=null==I?void 0:I[r];return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Card,{className:"content-wrapper",children:[e?(0,a.jsxs)("div",{className:"info",children:[(0,a.jsxs)("div",{children:["Showing sample ",r," of event from"," ",(0,a.jsx)("strong",{children:(0,d.timeAgo)(e.time)})," (",new Date(e.time).toLocaleString(),")"]}),(0,a.jsxs)("div",{children:["Instance: ",(0,a.jsx)("strong",{children:e.insId}),", Pin id:"," ",(0,a.jsx)("strong",{children:e.pinId})," "]}),(0,a.jsx)("div",{children:"Value:"})]}):null,C(e)]}),(0,a.jsx)(u.Menu,{className:"samples-menu",children:I.map(((e,t)=>{const n=e.pinId,o=`${i.total-t}. from pin "${n}"`;return(0,a.jsx)(u.MenuItem,{text:o,onClick:()=>v(t)},t)}))})]}):i.lastSamples.length>0&&h.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",children:['No data found for search query "',h,'"']}):(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",o.insId," ",o.pin?`and ${o.pin.id}`:"",". Make sure a debugger is connected and your program was triggered."]})})()})]})})})}},40471:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29183),t)},98158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebuggerContext=t.DebuggerContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({onRequestHistory:()=>Promise.reject(new Error("Not implemented"))});t.DebuggerContextProvider=i.Provider;t.useDebuggerContext=()=>(0,o.useContext)(i)},86125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDependenciesContext=t.DependenciesContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({resolvedDependencies:{},onImportNode:()=>Promise.reject(new Error("Not implemented")),onRequestImportables:()=>Promise.reject(new Error("Not implemented"))});t.DependenciesContextProvider=i.Provider;t.useDependenciesContext=()=>(0,o.useContext)(i)},97106:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FlowEditor=void 0;const u=n(35250),l=s(n(70079)),c=n(74762),d=n(63521),p=a(n(53865)),f=n(68120),m=n(7047),v=n(84472),h=n(82232),g=n(49283),I=n(43490),y=n(68840),b=n(78087),C=n(20079),_=n(60190),x=n(40471),N=n(98158),w=n(86125),j=n(30653),P=n(77852);r(n(43490),t),r(n(98158),t),r(n(86125),t),y.library.add(b.fab,C.fas);const O=["select","drag-move","order-step"];t.FlowEditor=l.memo(l.forwardRef(((e,t)=>{const{state:n,onChangeEditorState:o}=e,{resolvedDependencies:i,onImportNode:s}=(0,w.useDependenciesContext)(),[r,a]=l.useState([]),[y,b]=l.useState([]),{flow:C,boardData:E}=n,D=n.flow.node,[S,M]=l.useState({}),[T,k]=l.useState(new Set),{debuggerClient:R}=(0,N.useDebuggerContext)();l.useEffect((()=>{if(R)return R.onBatchedEvents((e=>{e.forEach((e=>{e.type===c.DebuggerEventType.INPUTS_STATE_CHANGE&&(console.log("INPUTS_STATE_CHANGE",e.insId,e.val),M((t=>({...t,[e.insId]:e.val})))),e.type===c.DebuggerEventType.ERROR&&k((t=>{const n=new Set(t);return n.add(e.insId),n}))}))}))}),[R]);const{openFile:A,reportEvent:V}=(0,I.usePorts)(),$=l.useCallback(((e,t)=>{console.info("onChangeFlow",t.type),"functional"===t.type&&(a([{flow:{...n.flow,...e}},...r.slice(0,50)]),b([])),o((t=>({...t,flow:{...t.flow,...e}})))}),[o,n.flow,r]),[z,H]=l.useState({instances:[],connections:[]}),[G,L]=l.useState(!1),F=l.useCallback((()=>L(!1)),[]),B=l.useCallback((()=>L(!0)),[]),q=l.useCallback((e=>{o((t=>({...t,boardData:{...t.boardData,...e}})))}),[o]);l.useEffect((()=>{q({selected:[],viewPort:d.defaultViewPort,from:void 0,to:void 0,lastMousePos:{x:0,y:0}})}),[D.id]),(0,f.useHotkeys)("cmd+z",(e=>{b([...y,n]);const[t,...i]=r;t&&(o((e=>({...e,...t}))),a(i)),e.preventDefault()}),{text:"Undo last change",group:"Editing"},[n,r,y]);const U=l.useCallback(((e,t)=>{O.some((e=>t.message.includes(e)))||b([]),$({node:e},t)}),[$]),W=l.useCallback((e=>{A({absPath:e.source.path})}),[A]),Z=l.useCallback((function(e,t){void 0===t&&(t=-1*d.NODE_HEIGHT*1.5);const n=(0,m.createNewNodeInstance)(e,t,E.lastMousePos,i);if(n){const e=(0,p.default)(C,(e=>{const t=e.node;if(!(0,c.isVisualNode)(t))throw new Error("Impossible state, adding node to non visual node");t.instances.push(n)}));return $(e,(0,h.functionalChange)("add-node")),F(),n}}),[E.lastMousePos,C,$,F,i]),J=l.useCallback((async e=>{switch(e.type){case g.OmniBarCmdType.ADD:return V("addNode",{nodeId:e.data,source:"omnibar"}),Z(e.data);case g.OmniBarCmdType.ADD_VALUE:{const e=t.current;null==e||e.requestNewInlineValue();break}case g.OmniBarCmdType.IMPORT:{await s(e.data,{pos:E.lastMousePos});const t=(0,_.vAdd)({x:0,y:0},E.lastMousePos),n=(0,m.createNewNodeInstance)(e.data.node,0,t,i),o=(0,p.default)(C,(e=>{e.node.instances.push(n)}));$(o,(0,h.functionalChange)("add-imported-node")),V("addNode",{nodeId:e.data.node.id,source:"omnibar"});break}default:v.AppToaster.show({intent:"warning",message:"Not supported yet"})}F()}),[F,V,Z,t,s,E.lastMousePos,i,C,$]),[Y,K]=l.useState(),Q=l.useCallback((()=>K(void 0)),[]),X=l.useCallback(((e,t)=>{K({insId:e,pin:t})}),[]),{isDarkMode:ee}=(0,P.useDarkMode)();return(0,u.jsx)("div",{className:"flyde-flow-editor",children:(()=>{var n;if((0,c.isInlineValueNode)(D))throw new Error("Impossible state");return(0,u.jsx)(j.DarkModeProvider,{value:null!==(n=e.darkMode)&&void 0!==n?n:ee,children:(0,u.jsxs)(l.Fragment,{children:[Y?(0,u.jsx)(x.DataInspectionModal,{item:Y,onClose:Q}):null,(0,u.jsx)(d.VisualNodeEditor,{currentInsId:c.ROOT_INS_ID,ref:t,boardData:E,onChangeBoardData:q,node:D,onGoToNodeDef:W,onChangeNode:U,resolvedDependencies:i,clipboardData:z,onCopy:H,nodeIoEditable:!D.id.startsWith("Trigger"),onInspectPin:X,onShowOmnibar:B,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:S,initialPadding:e.initialPadding,instancesWithErrors:T,disableScrolling:e.disableScrolling},D.id),G?(0,u.jsx)(g.Omnibar,{flow:C,resolvedNodes:i,onCommand:J,visible:G,onClose:F}):null]})})})()})})))},9001:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeEditor=t.renderCreateIOOption=void 0;const i=n(35250),s=o(n(70079)),r=n(74762),a=n(50382),u=o(n(53865)),l=n(70457),c=n(25779);t.renderCreateIOOption=(e,t,n)=>(0,i.jsx)(a.MenuItem,{icon:"add",text:`Create "${e}"`,active:t,onClick:n,shouldDismissPopover:!1});const d=l.MultiSelect.ofType();t.BaseNodeEditor=e=>{var n,o;const{node:l,onChange:p}=e,f=(0,r.entries)(l.inputs),m=f.filter((e=>{let[,t]=e;return"required"===t.mode})).map((e=>{let[t]=e;return t})),v=f.filter((e=>{let[,t]=e;return"optional"===t.mode})).map((e=>{let[t]=e;return t})),h=f.filter((e=>{let[,t]=e;return"required-if-connected"===t.mode})).map((e=>{let[t]=e;return t})),[g,I]=s.default.useState(!1),y=(0,r.okeys)(l.outputs),b=s.default.useCallback((e=>{p({...l,id:e})}),[l,p]),C=s.default.useCallback((e=>{let t=e?e.split(","):void 0;"[]"===e&&(t=[]),p({...l,completionOutputs:t})}),[l,p]),_=s.default.useCallback((e=>{let t=e?e.split(","):void 0;p({...l,reactiveInputs:t})}),[l,p]),x=s.default.useCallback(((e,t)=>{const n=(0,u.default)(l,(n=>{n.inputs[e]=(0,r.nodeInput)(t)}));p(n)}),[l,p]),N=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.inputs[e]}));p(t)}),[l,p]),w=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{t.outputs[e]=(0,r.nodeOutput)()}));p(t)}),[l,p]),j=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.outputs[e]}));p(t)}),[l,p]);return(0,i.jsxs)("div",{className:"base-node-editor",children:[(0,i.jsx)("div",{className:"form-row",children:(0,i.jsx)(a.FormGroup,{label:"Node Name",labelFor:"text-input",labelInfo:"(required)",children:(0,i.jsx)(a.InputGroup,{id:"node-name",disabled:e.idDisabled,placeholder:"Node ID",value:l.id,onChange:e=>b(e.target.value)})})}),(0,i.jsx)(a.FormGroup,{label:"Required Inputs",children:(0,i.jsx)(d,{selectedItems:m,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),!0!==e.hiddenOutputs?(0,i.jsx)(a.FormGroup,{label:"Outputs",children:(0,i.jsx)(d,{selectedItems:y,placeholder:"Enter output names here",items:[],tagRenderer:e=>e,onItemSelect:w,onRemove:j,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}):null,(0,i.jsx)(a.Checkbox,{checked:g,onChange:e=>I(e.target.checked),children:"Show advanced options"}),(0,i.jsxs)(a.Collapse,{isOpen:g,children:[(0,i.jsx)(a.FormGroup,{label:"Optional Inputs",children:(0,i.jsx)(d,{selectedItems:v,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"optional"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Required-if-connected Inputs",children:(0,i.jsx)(d,{selectedItems:h,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required-if-connected"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Completion Outputs",children:(0,i.jsx)(a.InputGroup,{id:"completion-outputs",placeholder:"completion outputs",value:(null===(n=l.completionOutputs)||void 0===n?void 0:n.join(","))||"",onChange:e=>C(e.target.value)})}),(0,i.jsx)(a.FormGroup,{label:"Reactive Inputs",children:(0,i.jsx)(a.InputGroup,{id:"reactive-inputs",placeholder:"Reactive inputs",value:(null===(o=l.reactiveInputs)||void 0===o?void 0:o.join(","))||"",onChange:e=>_(e.target.value)})})]}),(0,i.jsx)(a.FormGroup,{label:"Preview",children:(0,i.jsx)("div",{className:"preview-wrapper",children:(0,i.jsx)(c.NodePreview,{node:l})})})]})}},82232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metaChange=t.functionalChange=void 0;t.functionalChange=e=>({type:"functional",message:e});t.metaChange=function(e){return void 0===e&&(e="n/a"),{type:"meta",message:e}}},41032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safelyGetNodeDef=t.loadingDef=void 0;const o=n(74762);t.loadingDef={id:"Loading",inputs:{},outputs:{}};t.safelyGetNodeDef=(e,n)=>{try{return(0,o.getNodeDef)(e,n)}catch(i){const n="string"==typeof e?e:e.nodeId;return{...t.loadingDef,id:n}}}},72125:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCodeModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(68371),f=n(74762),m=n(31745),v="`Result is ${inputs.a + inputs.b}`";t.InlineCodeModal=u.memo((function(e){const{initialValue:t,initialType:n}=e,[o,i]=u.useState((0,f.isDefined)(t)?t:v),[s,r]=u.useState(n||f.InlineValueNodeType.VALUE),h=(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:['You can add variables to by referrencing the "inputs" object.',(0,a.jsx)("br",{})," For example:",(0,a.jsx)(c.Code,{children:"`Hello {inputs.name}`"}),' will expose an input pin named "name"']}),(0,a.jsxs)("p",{children:["You can also use ternery expressions, arithmetic operators and more!",(0,a.jsx)("br",{}),"For example:",(0,a.jsx)(c.Code,{children:"inputs.a > inputs.b ? inputs.a + 42 : Math.random() * inputs.b"})]})]}),g=(0,a.jsxs)("span",{children:["Type in any valid JS value, such as ",(0,a.jsx)(c.Code,{children:"true"}),", ",(0,a.jsx)(c.Code,{children:"42"}),","," ",(0,a.jsx)(c.Code,{children:'["bob", "alice", "dave"]'}),".",(0,a.jsx)("br",{})," Dynamic inputs may also be used"]}),I=(0,a.jsxs)("span",{children:["Write any JS code and return a value.",(0,a.jsx)("br",{})," The returned value will be the output.",(0,a.jsx)("br",{})," Example:",(0,a.jsx)(c.Code,{children:"const a = inputs.a; const b = inputs.b; return Math.floor(a/b);"})]}),y=(0,p.getVariables)(o);return u.useEffect((()=>{o===v&&s===f.InlineValueNodeType.FUNCTION&&i(`return ${v}`),o===`return ${v}`&&s===f.InlineValueNodeType.VALUE&&i(v)}),[o,s]),(0,a.jsxs)(c.Dialog,{isOpen:!0,title:"Inline Value / Code",onClose:e.onCancel,className:"inline-code-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:t=>{"Enter"===t.key&&t.metaKey&&e.onSubmit(s,o)},tabIndex:0,children:[(0,a.jsxs)(c.RadioGroup,{inline:!0,onChange:e=>r(e.target.value),selectedValue:s,children:[(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Value ",(0,a.jsx)(m.InfoTooltip,{content:g})]}),value:f.InlineValueNodeType.VALUE}),(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Function ",(0,a.jsx)(m.InfoTooltip,{content:I})]}),value:f.InlineValueNodeType.FUNCTION})]}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"javascript",value:o,onChange:e=>i(e||""),onMount:e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})}}),(()=>{const e=o.includes("return");return e&&s===f.InlineValueNodeType.VALUE?(0,a.jsx)(c.Callout,{intent:c.Intent.WARNING,children:'When using the "value" type you are not expected to return anything'}):e||s!==f.InlineValueNodeType.FUNCTION?null:(0,a.jsxs)(c.Callout,{intent:c.Intent.DANGER,children:['When using the "function" type you are expected to'," ",(0,a.jsx)(c.Code,{children:"return"})," a value.",(0,a.jsx)("br",{}),"Example: ",(0,a.jsx)(c.Code,{children:"return 42 + Date.now();"})]})})(),(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Input pins detected:"," ",y.length?y.map((e=>(0,a.jsx)(c.Code,{children:e},e))):"None",(0,a.jsx)(m.InfoTooltip,{content:h})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:e.onCancel,children:"Cancel"}),(0,a.jsx)(c.Button,{onClick:()=>e.onSubmit(s,o),intent:c.Intent.PRIMARY,className:"save-btn",children:"Save"})]})})]})}))},18594:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(72125),t)},68371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInlineValueNode=t.getVariables=void 0;const o=n(74762),i=n(74762);t.getVariables=e=>(e.match(/inputs\.([a-zA-Z]\w*)/g)||[]).map((e=>e.replace(/inputs\./,"")));t.createInlineValueNode=e=>{let{code:n,customView:s,nodeId:r,type:a}=e;const u=(0,t.getVariables)(n).reduce(((e,t)=>({...e,[t]:(0,o.nodeInput)()})),{}),l={value:(0,o.nodeOutput)()},c=a===o.InlineValueNodeType.FUNCTION?`const result = (function() { ${n}}());\n Promise.resolve(result).then(val => outputs.value.next(val))`:`const result = (${n}); Promise.resolve(result).then(val => outputs.value.next(val))`,d=btoa(n);return(0,i.inlineValueNode)({id:r||`Inline Code ${(0,o.randomInt)(99999)}`,inputs:u,outputs:l,runFnRawCode:c,customViewCode:s||n,dataBuilderSource:d,templateType:a,completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline "+(a===o.InlineValueNodeType.VALUE?"value":"function")})}},49283:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Omnibar=t.OmniBarCmdType=void 0;const a=n(35250),u=s(n(70079)),l=n(70457),c=n(74762),d=n(50382),p=r(n(26372));var f;!function(e){e.ADD="add",e.ADD_VALUE="add-value",e.IMPORT="import"}(f=t.OmniBarCmdType||(t.OmniBarCmdType={}));const m=[];t.Omnibar=e=>{const{resolvedNodes:t}=e,[n,o]=u.useState(""),[i,s]=u.useState(null),[r,v]=u.useState([]);u.useEffect((()=>{const e=(0,c.keys)(t).map((e=>({title:`${t[e].id}`,cmd:{type:f.ADD,data:e},extra:"current flow"}))),n=r.map((e=>({title:`${e.node.id}`,description:e.node.description,cmd:{type:f.IMPORT,data:e},extra:`${e.module}`}))),o={title:"Add inline value or code",suggestOnEmpty:!0,cmd:{type:f.ADD_VALUE}},i=[...m,...n,o,...e];s(i)}),[t,r]),u.useEffect((()=>{e.onRequestImportables&&e.onRequestImportables(n).then((e=>{v(e)}))}),[e,n]);const h=u.useCallback(((e,t)=>{let{handleClick:n,modifiers:o,query:i,index:s}=t;if(!o.matchesPredicate)return null;const r=`${e.title}`;return(0,a.jsx)(d.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,a.jsxs)("div",{className:(0,p.default)("omnibar-item",{active:o.active}),children:[(0,a.jsxs)("div",{className:"title",children:[r," ",e.extra?(0,a.jsx)("span",{className:"extra",children:e.extra}):null]}),e.description?(0,a.jsx)("div",{className:"description",children:e.description}):null]})},s)}),[]),g=u.useCallback(((e,t)=>{const n=e.toLowerCase().split("").map((e=>{return`${t=e,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*`;var t})).join(""),o=new RegExp(n);return!!t.title.toLowerCase().match(o)}),[]),I=u.useCallback((t=>{e.onCommand(t.cmd),e.onClose()}),[e]);return i?(0,a.jsx)(l.Omnibar,{query:n,onQueryChange:o,onClose:e.onClose,noResults:(0,a.jsx)(d.MenuItem,{disabled:!0,text:"No results."}),itemPredicate:g,isOpen:e.visible,items:i,initialContent:void 0,onItemSelect:I,itemRenderer:h,inputProps:{placeholder:"Search for nodes or commands.."}}):null}},60698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43490:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31874),t)},31874:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.usePorts=t.useConfirm=t.usePrompt=t.PortsContext=t.defaultPorts=void 0;const s=n(70079),r=n(74762),a=n(84472);i(n(60698),t);const u=e=>async()=>{console.warn(`${e} Not implemented`),(0,a.toastMsg)("Feature not implemented in this context yet","warning")};t.defaultPorts={prompt:async e=>{let{text:t,defaultValue:n}=e;return prompt(`${t}`,n)},openFile:async e=>{},confirm:async e=>{let{text:t}=e;return confirm(t)},readFlow:u("readFlow"),setFlow:u("setFlow"),resolveDeps:u("resolveDeps"),getImportables:u("getImportables"),onExternalFlowChange:u("onExternalFlowChange"),onInstallRuntimeRequest:u("onInstallRuntimeRequest"),onRunFlow:u("onRunFlow"),onStopFlow:u("onStopFlow"),reportEvent:r.noop,generateNodeFromPrompt:u("generateNodeFromPrompt"),hasOpenAiToken:()=>Promise.resolve(!1)},t.PortsContext=(0,s.createContext)(t.defaultPorts);t.usePrompt=()=>{const e=(0,s.useContext)(t.PortsContext).prompt;return(t,n)=>e({text:t,defaultValue:n})};t.useConfirm=()=>{const e=(0,s.useContext)(t.PortsContext).confirm;return t=>e({text:t})};t.usePorts=()=>(0,s.useContext)(t.PortsContext)},65758:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelected=void 0;const i=n(74762),s=o(n(53865)),r=n(22513);t.groupSelected=async(e,t,n,o,a)=>{const{instances:u,connections:l}=t,c=u.filter((t=>e.includes(t.id))),d=l.filter((t=>{let{from:n,to:o}=t;return-1!==e.indexOf(n.insId)||-1!==e.indexOf(o.insId)}));if(!c.length)throw new Error("visual without selections");const{visualNode:p,renamedInputs:f,renamedOutputs:m}=await(0,r.createGroup)(c,d,n,a),v=c.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),u[0].pos),h="ref"===o?(0,i.nodeInstance)((0,i.createInsId)(p),p.id,{},v):(0,i.inlineNodeInstance)((0,i.createInsId)(p),p,{},v),g=u.filter((t=>-1===e.indexOf(t.id))),I=l.map((e=>{const t=`${e.from.insId}.${e.from.pinId}`,n=`${e.to.insId}.${e.to.pinId}`;return f[n]?{...e,to:{insId:h.id,pinId:f[n]}}:m[t]?{...e,from:{insId:h.id,pinId:m[t]}}:e})).filter((t=>-1===e.indexOf(t.from.insId)&&-1===e.indexOf(t.to.insId)));return{newNode:p,currentNode:(0,s.default)(t,(e=>{e.instances=[...g,h],e.connections=I}))}}},74089:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(97106),t),i(n(18420),t),i(n(90680),t),i(n(84472),t),i(n(17102),t),i(n(82232),t),i(n(25779),t),i(n(25804),t),i(n(9958),t),i(n(68120),t),i(n(94651),t),i(n(73470),t),i(n(94007),t),i(n(60190),t),i(n(9001),t),i(n(7047),t),i(n(23386),t)},31745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoTooltip=void 0;const o=n(35250),i=n(50382),s=n(50382),r=n(44470),a=n(50382);t.InfoTooltip=e=>{const{content:t}=e;return(0,o.jsx)(s.Tooltip,{content:t,placement:"top",className:"info-tooltip",children:(0,o.jsx)(i.Icon,{icon:(0,o.jsx)(r.InfoSign,{className:a.Classes.INTENT_PRIMARY}),intent:i.Intent.SUCCESS,className:"info-tooltip-icon"})})}},83938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserOnlyReactJson=void 0;const o=n(35250);t.BrowserOnlyReactJson=e=>{if("undefined"==typeof window)return null;const t=n(73541).Z;return(0,o.jsx)(t,{...e})}},94651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsValueRenderer=void 0;const o=n(35250),i=n(74762),s=n(83938);t.AnalyticsValueRenderer=e=>{let{val:t}=e;try{const e=JSON.parse(t),n="object"==typeof e?e:{value:e},r=e&&[e.type,e.key,e.props,e.ref].every(i.isDefined),a=r?{jsxValue:e}:n;return(0,o.jsx)(s.BrowserOnlyReactJson,{src:a,collapseStringsAfterLength:50,collapsed:r})}catch(n){return(0,o.jsx)(s.BrowserOnlyReactJson,{src:{value:t},collapseStringsAfterLength:50})}}},22513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=void 0;const o=n(74762),i=n(74762),s=n(60190),r=n(88593);t.createGroup=async(e,t,n,a)=>{if(0===e.length)throw new Error("cannot create group without instances");const u=e.map((e=>e.id)),l=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return!t&&n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.to,e.to)))===t)),c=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return t&&!n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.from,e.from)))===t));let d={},p={},f={},m={};const v=[],h={};for(const o of l){const e=`${o.to.insId}.${o.to.pinId}`,t=`${o.from.insId}.${o.from.pinId}`,n=o.to.pinId;if(f[t]){v.push({from:(0,i.externalConnectionNode)(f[t]),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)});continue}const r=h[n]?await a(`Name this input (${n} of ${o.to.insId}) is already taken:`)||`i${(0,s.rnd)()}`:n;d[e]=r,f[t]=r,v.push({from:(0,i.externalConnectionNode)(r),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)}),h[r]=(0,i.nodeInput)()}const g={};for(const r of c){const e=`${r.to.insId}.${r.to.pinId}`,t=`${r.from.insId}.${r.from.pinId}`,n=r.from.pinId;if(m[e]){v.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(m[e])});continue}const u=g[n]?await a(`Name this output (${n} of ${r.from.insId} is already taken:`)||`i${(0,s.rnd)()}`:n;p[t]=u,m[e]=u,v.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(u)}),g[u]=(0,o.nodeOutput)()}e.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),e[0].pos);const I=t.filter((e=>u.includes(e.from.insId)&&u.includes(e.to.insId)));return{visualNode:{id:n,inputs:h,outputs:g,instances:e,defaultStyle:{size:"large",color:(0,o.pickRandom)(r.nodeStylePresetColors.map((e=>e.color)))},inputsPosition:(0,o.okeys)(h).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:0}})),{}),outputsPosition:(0,o.okeys)(g).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:400}})),{}),connections:[...I,...v],completionOutputs:(0,o.okeys)(g)},renamedInputs:d,renamedOutputs:p}}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightText=void 0;const o=n(35250);function i(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}t.highlightText=(e,t)=>{let n=0;const s=t.split(/\s+/).filter((e=>e.length>0)).map(i);if(0===s.length)return[e];const r=new RegExp(s.join("|"),"gi"),a=[];for(;;){const t=r.exec(e);if(!t)break;const i=t[0].length,s=e.slice(n,r.lastIndex-i);s.length>0&&a.push(s),n=r.lastIndex,a.push((0,o.jsx)("strong",{children:t[0]},n))}const u=e.slice(n);return u.length>0&&a.push(u),a}},17102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Loader=void 0;const o=n(35250);t.Loader=()=>(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)("svg",{width:"38",height:"38",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:"#007ec6",children:(0,o.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,o.jsxs)("g",{transform:"translate(1 1)",strokeWidth:"2",children:[(0,o.jsx)("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),(0,o.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:(0,o.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})})})},23386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;const o=n(74762);t.logger=(0,o.debugLogger)("editor")},561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadMonaco=void 0;const o=n(51848),i=n(23386);let s=!1;t.preloadMonaco=()=>{s||o.loader.init().then((()=>{(0,i.logger)("monaco preloaded"),s=!0}))}},68120:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHotkeys=t.currentHotkeys=void 0;const i=o(n(45240)),s=n(70079);t.currentHotkeys=new Map,t.useHotkeys=function(e,n,o,r,a){void 0===r&&(r=[]);const u=(0,s.useCallback)((function(){a&&!a.current||n(...arguments)}),[...r,n]);(0,s.useEffect)((()=>((0,i.default)(e,{},u),t.currentHotkeys.set(e,o),()=>{t.currentHotkeys.delete(e),i.default.unbind(e,u)})),[e,u,o])}},94007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeSessionStorage=t.safeLocalStorage=void 0,t.safeLocalStorage={getItem:function(){try{return localStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return localStorage.setItem(...arguments)}catch(e){return null}}},t.safeSessionStorage={getItem:function(){try{return sessionStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return sessionStorage.setItem(...arguments)}catch(e){return null}}}},90680:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocalStorage=t.useResizePref=t.userPreferences=t.useUserPref=void 0;const r=s(n(70079)),a=n(18420),u=n(94007);t.useUserPref=(e,n)=>{const[o,i]=r.useState((()=>{const o=t.userPreferences.getItem(e);return(0,a.isDefined)(o)?o:n}));r.useEffect((()=>{const o=t.userPreferences.getItem(e),s=(0,a.isDefined)(o)?o:n;i(s)}),[e]);return[o,n=>{t.userPreferences.setItem(e,n),i(n)}]},t.userPreferences=(()=>{const e=e=>`up.${e}`;return{getItem:t=>{const n=u.safeLocalStorage.getItem(e(t))||"",o=u.safeSessionStorage.getItem(e(t))||"";try{return JSON.parse(o||n).value}catch(i){return}},setItem:function(t,n,o){void 0===o&&(o=!1);const i=o?sessionStorage:u.safeLocalStorage;try{const o=JSON.stringify({value:n});return i.setItem(e(t),o),!0}catch(s){return console.error("Error saving user preference",s),!1}}}})();t.useResizePref=(e,n)=>{const o=`resize.${e}`;return(0,t.useUserPref)(o,n)};const l=e=>{const t=u.safeLocalStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch(n){return null}};t.useLocalStorage=(e,t)=>{const[n,o]=r.useState(l(e)||t),i=r.useCallback((t=>{u.safeLocalStorage.setItem(e,JSON.stringify({value:t})),o(t)}),[e]);return r.useEffect((()=>{l(e)||u.safeLocalStorage.setItem(e,JSON.stringify({value:t}))}),[e,t,i]),[n,i]}},60190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.totalEnergy=t.itrPhysics=t.hookes=t.coulombs=t.vToStr=t.vNorm=t.vLen=t.vSub=t.vAdd=t.vDiv=t.vMul=t.vZero=t.rnd=t.vec=t.size=void 0;t.size=(e,t)=>({width:e,height:t});t.vec=(e,t)=>({x:e,y:t});t.rnd=function(e,t){return void 0===e&&(e=100),void 0===t&&(t=0),Math.floor(Math.random()*(e-t))+t},t.vZero={x:0,y:0};t.vMul=(e,t)=>{let{x:n,y:o}=e;return{x:n*t,y:o*t}};t.vDiv=(e,n)=>{let{x:o,y:i}=e;return(0,t.vMul)({x:o,y:i},1/n)};t.vAdd=(e,t)=>({x:e.x+t.x,y:e.y+t.y});t.vSub=(e,n)=>(0,t.vAdd)(e,(0,t.vMul)(n,-1));t.vLen=e=>{let{x:t,y:n}=e;return Math.sqrt(t*t+n*n)};t.vNorm=e=>(0,t.vDiv)(e,(0,t.vLen)(e)||1);t.vToStr=e=>{let{x:t,y:n}=e;return`${t.toFixed(1)},${n.toFixed(1)}`};t.coulombs=(e,n,o)=>{const i=(0,t.vLen)((0,t.vSub)(e.p,n.p));if(0===i){const i=(0,t.vec)(2*Math.random()-1,2*Math.random()-1),s=e.m*n.m/Math.pow(10,2);return(0,t.vMul)(i,s*o)}{const s=(0,t.vNorm)((0,t.vSub)(n.p,e.p)),r=e.m*n.m/Math.pow(i+.1,2);return(0,t.vMul)(s,r*o)}};t.hookes=(e,n,o,i,s)=>{const r=(0,t.vLen)((0,t.vSub)(e.p,n.p)),a=(0,t.vNorm)((0,t.vSub)(e.p,n.p));let u=0;return ri&&(u=i-r),(0,t.vMul)(a,s*u)};t.itrPhysics=(e,n)=>{const{p:o,v:i,f:s,m:r}=n,a=(0,t.vDiv)(s,r),u=e/1e3,l=(0,t.vAdd)((0,t.vMul)(a,u),i),c=(0,t.vAdd)((0,t.vMul)(l,u),o);return{...n,p:c,v:l,f:(0,t.vec)(0,0)}};t.totalEnergy=e=>e.reduce(((e,n)=>{const o=(0,t.vLen)(n.v);return e+.5*n.m*o*o}),0)},84472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateToast=t.toastMsg=t.AppToaster=void 0;const o=n(50382);t.AppToaster=(()=>{try{return o.OverlayToaster.create({className:"app-toaster",position:o.Position.BOTTOM_RIGHT})}catch(e){return{}}})();t.toastMsg=(e,n,o)=>t.AppToaster.show({message:e,intent:n,timeout:o});t.updateToast=(e,n,o)=>t.AppToaster.show({message:n,intent:o},e)},18420:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultAnd=t.isLocal=t.fullTime=t.timeAgoFromDt=t.timeAgo=t.toString=t.isDefined=t.set=t.createOmap=t.toOmap=t.values=t.keys=t.entries=void 0;const i=n(7047),s=n(74762),r=o(n(73136));t.entries=e=>Object.keys(e).map((t=>[t,e[t]]));t.keys=e=>Object.keys(e);t.values=e=>Object.keys(e).map((t=>e[t]));t.toOmap=e=>Array.from(e.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.createOmap=function(e){return void 0===e&&(e=[]),e.reduce(((e,t)=>({...e,[t[0]]:t[1]})),{})};t.set=(e,t,n)=>{e[t]=n};t.isDefined=e=>void 0!==e;t.toString=e=>{const t=typeof e;if(""===e)return"(empty string)";if((0,i.isJsxValue)(e))return"JSX Value";if((0,s.isStaticValueVisualNode)(e))return"Embedded Node";if((0,s.isEnvValue)(e))return(0,s.getEnvKeyFromValue)(e);if("object"===t)try{const t=JSON.stringify(e);return"{}"===t?"Empty object":t}catch(n){return"Object (cannot stringify)"}return`${e}`};t.timeAgo=e=>(0,r.default)(new Date(e)).fromNow();t.timeAgoFromDt=e=>(0,r.default)(Date.now()-e).fromNow();t.fullTime=e=>(0,r.default)(new Date(e)).toString();t.isLocal=()=>location.href.includes(":300");t.preventDefaultAnd=e=>t=>{t.preventDefault(),e(t)}},67181:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ActionButton=t.ActionsMenu=t.ActionType=void 0;const r=n(35250),a=n(50382),u=n(50382),l=n(74762),c=s(n(70079)),d=n(86125),p=n(43490),f=n(68120),m=n(90680),v=n(84472),h=n(9971),g=n(47749),I=n(46334),y=n(47230),b=n(41032);var C;!function(e){e.AddNode="add-node",e.RemoveNode="remove-node",e.Group="group",e.UnGroup="un-group",e.AddInlineValue="add-inline-value",e.Inspect="inspect",e.Run="run",e.AI="ai"}(C=t.ActionType||(t.ActionType={}));t.ActionsMenu=e=>{const{onAction:n,selectedInstances:o,resolvedNodes:i,node:s,from:u,to:g,hotkeysEnabled:x,showRunFlowOptions:N}=e,{onRequestImportables:w}=(0,d.useDependenciesContext)(),[j,P]=c.default.useState(!1),[O,E]=c.default.useState(!1),[D,S]=c.default.useState(!1),[M,T]=c.default.useState(null),[k,R]=(0,m.useLocalStorage)("hideHotkeyHintMap",{}),A=(0,c.useCallback)((()=>{P(!1)}),[]),{onRunFlow:V,generateNodeFromPrompt:$,reportEvent:z}=(0,p.usePorts)(),H=(0,c.useCallback)(((e,t)=>(E(!1),V(e,t))),[V]),G=[];if(G.push(C.AddNode),G.push(C.AddInlineValue),1===o.length){const e=s.instances.find((e=>e.id===o[0]));if(e)try{const t=(0,b.safelyGetNodeDef)(e,i);(0,l.isVisualNode)(t)&&G.push(C.UnGroup)}catch(U){console.error(`Could not find node with id ${o[0]} - ${U}`)}else console.error(`Could not find instance with id ${o[0]}`)}N&&G.push(C.Run),o.length>0&&G.push(C.Group),(1===o.length||u||g)&&G.push(C.Inspect),o.length>0&&G.push(C.RemoveNode),G.push(C.AI);const L=(0,c.useCallback)(((e,t)=>{R({...k,[e]:!0}),v.AppToaster.dismiss(t)}),[k,R]),F=(0,c.useCallback)(((e,t)=>{const{hotkey:o}=_[e];if("click"===t.type&&o&&!k[o]){const t=(0,v.toastMsg)((0,r.jsxs)(r.Fragment,{children:["Did you know? you can also use the hotkey"," ",(0,r.jsx)("kbd",{className:"hotkey",children:o})," to"," ",_[e].text.replace(/^[A-Z]/,(e=>e.toLowerCase())),(0,r.jsxs)(a.Button,{minimal:!0,small:!0,onClick:()=>L(o,t),children:[" ","Don't show again"," "]})]}),"none",3e3)}switch(e){case C.AddNode:P(!0);break;case C.Run:!async function(){E(!0)}();break;case C.AI:S(!0);break;default:n({type:e,data:void 0})}}),[k,n,L,s.inputs]);Object.entries(_).forEach((e=>{let[t,n]=e;n.hotkey&&(0,f.useHotkeys)(n.hotkey,(e=>{e.preventDefault(),G.includes(t)&&(F(t,e),R({...k,[n.hotkey]:!0}))}),{text:n.text,group:"Action menu hotkeys"},[G],x)}));const B=(0,c.useCallback)((e=>{n({type:C.AddNode,data:{importableNode:e}})}),[n]),q=(0,c.useCallback)((async e=>{const t=Date.now();T(t);try{z("generateNodeFromPrompt:start",{promptLength:e.length});const o=await $({prompt:e}),{inputs:i,outputs:s}=o.importableNode.node,r=Date.now()-t;z("generateNodeFromPrompt:success",{totalTime:r,inputs:Object.keys(i),outputs:Object.keys(s)}),T(null),n({type:C.AI,data:o}),S(!1)}catch(U){T(null),v.AppToaster.show({message:"Failed to generate node",intent:"danger"}),z("generateNodeFromPrompt:failure",{error:U.message})}}),[$,n,z]);return(0,r.jsxs)("div",{className:"actions-menu",children:[G.map((e=>(0,r.jsx)(t.ActionButton,{type:e,onClick:F},e))),j?(0,r.jsx)(h.AddNodeMenu,{onRequestImportables:w,onAddNode:B,onClose:A}):null,O?(0,r.jsx)(y.RunFlowModal,{onClose:()=>E(!1),onRun:H,node:s}):null,D?(0,r.jsx)(I.PromptAIMenu,{onClose:()=>{S(!1),T(null)},onSubmit:q,submitting:null!==M,submitTime:M}):null]})};const _={[C.AddNode]:{icon:g.addNodeIcon,text:'Open the "add node" menu',hotkey:"a"},[C.RemoveNode]:{icon:g.removeNodeIcon,text:"Remove selected instances",hotkey:"backspace"},[C.Group]:{icon:g.groupIcon,text:"Group selection into a new node",hotkey:"g"},[C.UnGroup]:{icon:g.ungroupIcon,text:"Ungroup selected visual node"},[C.Inspect]:{icon:g.inspectIcon,text:"Inspect data",hotkey:"i"},[C.AddInlineValue]:{icon:g.pencilIcon,text:"Add value / inline function",hotkey:"v"},[C.Run]:{icon:g.playIcon,text:"Run flow",hotkey:"r"},[C.AI]:{icon:g.starIcon,text:"Generate new code node using AI \u2728"}},x={icon:"",text:"N/A",hotkey:void 0};t.ActionButton=e=>{var t;const{onClick:n,type:o}=e,i=(0,c.useCallback)((e=>n(o,e)),[n,o]),s=null!==(t=_[o])&&void 0!==t?t:x,a=s.hotkey?(0,r.jsxs)("span",{children:[s.text," ",(0,r.jsx)("kbd",{className:"hotkey",children:s.hotkey})]}):s.text;return(0,r.jsx)("div",{className:"action-button",onClick:i,"data-type":o,children:(0,r.jsx)(u.Tooltip,{hoverOpenDelay:100,content:a,className:"icon-wrapper",popoverClassName:"action-button-tooltip",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s.icon}})})})}},40149:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenu=t.AddNodeMenuFilterTree=void 0;const a=n(35250),u=n(50382),l=n(74762),c=r(n(26372)),d=s(n(70079)),p=n(43490),f=n(31745),m=n(17102),v=n(87935),h=n(74657),g=n(44470);t.AddNodeMenuFilterTree=u.Tree.ofType();function I(e,t,n){return[...e.external.map((e=>({id:e.module,label:e.module,hasCaret:!0,nodeData:{type:"external",module:e.module},isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module,isExpanded:n.has(e.module),childNodes:e.namespaces.map((o=>({id:`${e.module}/${o}`,label:o,hasCaret:!1,isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module&&t.namespace===o,isExpanded:n.has(`${e.module}/${o}`),nodeData:{type:"external",module:e.module,namespace:o}})))}))),{id:"internal",label:"Current Project",nodeData:{type:"internal"},isExpanded:n.has("internal"),hasCaret:!0,isSelected:"internal"===t.type,childNodes:e.internal.files.map((e=>({id:e,label:e,isSelected:"internal"===t.type&&t.file===e,hasCaret:!1,isExpanded:n.has(e),nodeData:{type:"internal",file:e}})))}]}function y(e){return/\.flyde(\.[jt]s)?$/.test(e.module)}t.AddNodeMenu=e=>{const{onRequestImportables:n,onAddNode:o,onClose:i}=e,[s,r]=d.default.useState(),[b,C]=d.default.useState([]),[_,x]=d.default.useState(new Set),[N,w]=d.default.useState(""),[j,P]=d.default.useState({type:"all"}),[O,E]=d.default.useState(null),[D,S]=d.default.useState(null),[M,T]=d.default.useState(null),k=(0,d.useCallback)((e=>{_.add(e.id),x(new Set(_))}),[_]),R=(0,d.useCallback)((e=>{_.delete(e.id),x(new Set(_))}),[_]),A=(0,d.useCallback)((e=>{o(e),i()}),[o,i]),{onInstallRuntimeRequest:V,reportEvent:$}=(0,p.usePorts)();(0,d.useEffect)((()=>{$("addNodeMenuOpen",{})}),[$]),(0,d.useEffect)((()=>{S(null==s?void 0:s.flatMap((e=>{var t,n,o;if(j)if("external"===j.type){if((e.module!==j.module||j.namespace)&&e.node.namespace!==j.namespace)return[]}else if("internal"===j.type&&(!y(e)||j.file&&e.module!==j.file))return[];if(N){const i=`${null!==(n=null===(t=e.node.searchKeywords)||void 0===t?void 0:t.join(" "))&&void 0!==n?n:[]} ${e.node.id} ${null!==(o=e.node.namespace)&&void 0!==o?o:""} ${e.node.description}`.toLowerCase().indexOf(N.toLowerCase());return-1===i?[]:[{importable:e,score:i}]}return[{importable:e,score:1}]})).sort(((e,t)=>e.score-t.score)).map((e=>{let{importable:t}=e;return t})))}),[s,j,N]),(0,d.useEffect)((()=>{n().then((e=>{let{importables:t,errors:n}=e;C(n);const o=t.filter((e=>!y(e))).reduce(((e,t)=>{var n,o,i;null!==(n=e[i=t.module])&&void 0!==n||(e[i]=[]);const s=null!==(o=t.node.namespace)&&void 0!==o?o:"";return e[t.module].includes(s)||e[t.module].push(s),e}),{}),i=t.filter(y).map((e=>e.module));E({external:Object.entries(o).map((e=>{let[t,n]=e;return{module:t,namespaces:n}})),internal:{files:i}}),r(t),x(new Set(["internal",...Object.keys(o)]))}))}),[n]);const z=(0,d.useCallback)((e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),D&&!M)return void T(D["ArrowDown"===e.key?0:D.length-1]);if(D&&M){const t=D.findIndex((e=>e===M));let n="ArrowDown"===e.key?t+1:t-1;n=n<0?D.length-1:n,n=n>=D.length?0:n,T(D[n])}break;case"Enter":M&&A(M)}}),[D,M,A]),H=(0,d.useCallback)((e=>{let{nodeData:t}=e;JSON.stringify(t)===JSON.stringify(j)?"external"===t.type?t.namespace?P({type:"external",module:t.module}):P({type:"all"}):"internal"===t.type&&(t.file?P({type:"internal"}):P({type:"all"})):P(t)}),[j]),G=!s||s.some((e=>e.module.includes("@flyde/stdlib"))),L=(0,d.useCallback)((()=>{V(),i()}),[i,V]);return(0,a.jsx)(u.Dialog,{isOpen:!0,title:"Add Node Menu",onClose:e.onClose,className:"add-node-menu",isCloseButtonShown:!0,children:(0,a.jsxs)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),children:[(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"bp5-input-group",children:[(0,a.jsx)(g.Search,{}),(0,a.jsx)("input",{className:"bp5-input",type:"search",placeholder:"Search input",dir:"auto",autoFocus:!0,onChange:e=>w(e.target.value),value:N,onKeyDown:z})]}),G?null:(0,a.jsxs)(u.Callout,{intent:u.Intent.NONE,style:{marginTop:10},children:["Using built-in @flyde/stdlib. It's recommended to explicitly install it instead."," ",(0,a.jsx)(u.Button,{minimal:!0,small:!0,intent:u.Intent.PRIMARY,onClick:L,children:"Click here to install it using npm/yarn"})]})]}),(0,a.jsx)("div",{className:"content-wrapper",children:s?(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsxs)("aside",{children:[(0,a.jsxs)("div",{className:"filter-header",children:["Filter by package"," ",(0,a.jsx)(u.Tooltip,{content:(0,a.jsxs)("span",{children:["Click to learn more about how packages work in Flyde"," "]}),hoverCloseDelay:1500,children:(0,a.jsx)("a",{target:"_blank",href:"https://www.flyde.dev/docs/packages",rel:"noreferrer",children:(0,a.jsx)(u.Icon,{icon:(0,a.jsx)(g.Help,{}),intent:"primary",iconSize:12})})})]}),(0,a.jsx)("div",{className:"tree-container",children:(0,a.jsx)(t.AddNodeMenuFilterTree,{contents:I(O,j,_),onNodeCollapse:R,onNodeExpand:k,onNodeClick:H,className:u.Classes.ELEVATION_0})})]}),(0,a.jsx)("main",{children:D?0===D.length?(0,a.jsxs)("div",{className:"no-results",children:[(0,a.jsx)(h.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:P,query:N,onChangeQuery:w,resultsCount:D.length}),(0,a.jsxs)(u.Callout,{className:"callout",intent:"primary",children:["Can't find a suitable node? Create one yourself!"," ",(0,a.jsx)("a",{href:"https://www.flyde.dev/docs/code-nodes",target:"_blank",rel:"noreferrer",children:"Learn more"})]})]}):(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsx)(h.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:P,query:N,onChangeQuery:w,resultsCount:D.length}),(0,a.jsx)("div",{className:"results",children:D.map((e=>(0,a.jsx)(v.AddNodeMenuListItem,{importableNode:e,onAdd:A,selected:(null==M?void 0:M.node)===e.node,onSelect:T,onSetFilter:P},e.node.id+e.node.namespace+e.module)))})]}):(0,a.jsx)(m.Loader,{})})]}):(0,a.jsx)(m.Loader,{})}),b.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",style:{marginTop:"10px"},children:["Found ",(0,l.simplePluralize)(b.length,"corrupt flow"),(0,a.jsx)(f.InfoTooltip,{content:b.map((e=>{let{path:t,message:n}=e;return`${t}: ${n}`})).join(", ")})," "]}):null]})})}},8470:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuListItem=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079));t.AddNodeMenuListItem=e=>{const{importableNode:t,onSetFilter:n,onAdd:o,onSelect:i}=e,{node:s,module:r}=t,{id:d,description:p}=s,f=c.default.useRef(null);c.default.useEffect((()=>{e.selected&&f.current&&f.current.scrollIntoView({block:"center"})}),[e.selected]);const m=(0,c.useCallback)((()=>{o(t)}),[o,t]),v=(0,c.useCallback)((()=>{i(t)}),[i,t]);return(0,a.jsxs)("div",{className:(0,l.default)("add-node-menu-list-item",{selected:e.selected}),ref:f,onClick:v,children:[(0,a.jsxs)("div",{className:"content",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("span",{className:"id",children:d}),(0,a.jsxs)(u.Tag,{interactive:!0,onClick:()=>n({type:"external",module:r,namespace:s.namespace}),className:"source",minimal:!0,children:[r,s.namespace?` / ${s.namespace}`:null]})]}),(0,a.jsx)("div",{className:"description",children:p||(0,a.jsx)("em",{children:"No description"})})]}),(0,a.jsx)("aside",{children:(0,a.jsx)(u.Button,{onClick:m,children:"Add"})})]})}},87935:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8470),t)},88671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuResultsSummary=void 0;const o=n(35250),i=n(50382);t.AddNodeMenuResultsSummary=e=>{const{resultsCount:t,query:n,filter:s,onChangeFilter:r,onChangeQuery:a}=e;return(0,o.jsxs)("div",{className:"add-node-menu-results-summary",children:[t?`Showing ${t} result${t>1?"s":""}`:"No results found","\xa0",n?(0,o.jsxs)(o.Fragment,{children:["matching query\xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>a(""),children:['"',n,'"']})]}):null,"all"===s.type?null:"external"===s.type?(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["package ",s.module,s.namespace?` / ${s.namespace}`:null]})]}):(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["\xa0this project ",s.file?` / ${s.file}`:null]})]})]})}},74657:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88671),t)},9971:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40149),t)},83159:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PromptAIMenu=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=1e4;t.PromptAIMenu=e=>{const{onClose:t}=e,[n,o]=c.default.useState(""),[i,s]=c.default.useState(0);return(0,c.useEffect)((()=>{s(0);const t=setInterval((()=>{s((t=>{const n=(Date.now()-e.submitTime)/d;return Math.min(n+.05*Math.random()/2,.95)}))}),500);return()=>clearInterval(t)}),[e.submitTime]),(0,a.jsxs)(u.Dialog,{isOpen:!0,onClose:t,className:"prompt-ai-menu",title:"\u2728 Generate Code Node using AI",children:[(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsx)(u.TextArea,{value:n,disabled:e.submitting,onChange:e=>o(e.target.value),placeholder:"Describe your node in details",fill:!0})}),e.submitTime?(0,a.jsx)("div",{className:"progress-bar-container",children:(0,a.jsx)(u.ProgressBar,{value:i})}):null,(0,a.jsx)("div",{className:u.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:u.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(u.Button,{onClick:t,children:"Close"}),(0,a.jsx)(u.Button,{intent:u.Intent.PRIMARY,className:"run-btn",disabled:e.submitting||!n,loading:e.submitting,onClick:()=>{s(0),e.onSubmit(n)},children:"Create \u2728"})]})})]})}},46334:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(83159),t)},3152:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RunFlowModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(90680),f=n(31745);t.RunFlowModal=u.memo((function(e){const{onRun:t,onClose:n,node:o}=e,[i,s]=u.useState(0),[r,m]=(0,p.useLocalStorage)(`run-inputs-${o.id}`,Object.keys(o.inputs).reduce(((e,t)=>(e[t]=`Enter a value for input ${t}`,e)),{})),[v,h]=u.useState(JSON.stringify(r,null,2)),g=e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})},I=u.useCallback((()=>{const e=JSON.parse(v);m(e),t(e,i)}),[t,m,v,i]),y=Object.keys(o.inputs),b=y.filter((e=>"required"!==o.inputs[e].mode)),C=u.useMemo((()=>y.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:"This node receives external inputs. Enter values for each input below:"}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"json",value:v,onChange:e=>h(null!=e?e:""),onMount:g}),b.length>0?(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Note: input(s) ",(0,a.jsx)("code",{children:b.join(", ")})," are optional"]}):null]}):(0,a.jsx)("strong",{children:"This node does not receive any external inputs."})),[y.length,b,v]);return(0,a.jsxs)(c.Dialog,{isOpen:!0,onClose:e.onClose,className:"run-flow-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&I()},tabIndex:0,children:[C,(0,a.jsxs)("div",{className:"execution-delay-wrapper",children:[(0,a.jsxs)("label",{children:["Execution delay:"," ",(0,a.jsx)(f.InfoTooltip,{content:"Delay between each node execution. Useful for debugging."})]}),(0,a.jsx)(c.Slider,{value:i,onChange:s,min:0,labelStepSize:500,stepSize:100,labelRenderer:e=>`${e}ms`,max:1e3})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:n,children:"Close"}),(0,a.jsx)(c.Button,{onClick:I,intent:c.Intent.PRIMARY,className:"run-btn",children:"Run"})]})})]})}))},47230:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3152),t)},47749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starIcon=t.stopIcon=t.playIcon=t.pencilIcon=t.ungroupIcon=t.groupIcon=t.inspectIcon=t.removeNodeIcon=t.addNodeIcon=void 0,t.addNodeIcon='\n\n',t.removeNodeIcon='\n\n',t.inspectIcon='\n\n\n',t.groupIcon='\n\n\n',t.ungroupIcon='\n\n\n',t.pencilIcon='\n\n',t.playIcon='\n\n\n',t.stopIcon='\n\n\n',t.starIcon='\n\n\n\n\n'},1237:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HelpBubble=void 0;const i=n(70079),s=n(35250),r=n(50382),a=n(99489),u=n(50382),l=o(n(70079)),c=n(68120),d=n(71644),p=n(43490),f={offset:{enabled:!0,options:{offset:[0,20]}},preventOverflow:{enabled:!0,options:{padding:10}}};const m=["Viewport Controls","Editing","Selection"];t.HelpBubble=()=>{const[e,t]=l.default.useState(!1),n=Array.from(c.currentHotkeys.entries()).map((e=>{let[t,n]=e;return{combo:(o={key:t,menuData:n}).key,label:o.menuData.text,group:o.menuData.group};var o})).reduce(((e,t)=>(e[t.group]||(e[t.group]=[]),e[t.group].push(t),e)),{}),o=Object.entries(n).sort(((e,t)=>m.indexOf(t[0])-m.indexOf(e[0]))),{reportEvent:v}=(0,p.usePorts)(),h=(0,s.jsx)(r.Dialog,{isOpen:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:r.Classes.DIALOG_BODY,children:o.map((e=>{let[t,n]=e;return(0,s.jsxs)(l.default.Fragment,{children:[(0,s.jsx)(r.H4,{children:t}),n.map((e=>(0,i.createElement)(a.Hotkey,{...e,key:e.combo})))]},t)}))})}),g=(0,s.jsxs)(r.Menu,{children:[(0,s.jsx)(r.MenuItem,{text:"Hotkeys",onClick:()=>{t(!0),v("helpMenuItem",{item:"hotkeys"})}}),(0,s.jsx)(r.MenuItem,{text:"Documentation",onClick:()=>v("helpMenuItem",{item:"documentation"}),href:"https://www.flyde.dev/docs",target:"_blank"}),(0,s.jsx)(r.MenuDivider,{}),(0,s.jsx)(r.MenuItem,{text:"Discord",onClick:()=>v("helpMenuItem",{item:"discord"}),href:"https://discord.gg/x7t4tjZQP8",target:"_blank"})]});return(0,s.jsxs)("div",{className:"help-bubble","data-tip":"Help",children:[(0,s.jsx)(u.Popover,{content:g,modifiers:f,onOpened:()=>v("helpMenuOpen",{}),children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:d.helpIcon}})}),h]})}},71644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpIcon=void 0,t.helpIcon='\n\n\n'},3354:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1237),t)},7011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainInstanceEventsIndicator=void 0;const o=n(35250),i=n(30994),s=n(66189),r=n(50382);t.MainInstanceEventsIndicator=e=>{const{currentInsId:t,ancestorsInsIds:n}=e,{history:a,refreshHistory:u,resetHistory:l}=(0,s.useHistoryHelpers)(t),c=`main-indicator-${t}}`;return(0,o.jsx)("div",{className:"main-instance-events-indicator",children:(0,o.jsx)(r.Tooltip,{content:(0,s.calcHistoryContent)(a),children:(0,o.jsx)("span",{onMouseEnter:u,onMouseOut:l,id:(0,i.getMainInstanceIndicatorDomId)(t,n),className:"status-text","data-tip":"","data-html":!0,"data-for":c})})})}},22714:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7011),t)},63521:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VisualNodeEditor=t.defaultBoardData=t.defaultViewPort=t.NODE_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=n(74762),c=n(86553),d=n(65082),p=n(18420),f=n(26701),m=n(7047),v=n(53865),h=n(70079),g=n(68120),I=r(n(27942)),y=n(50382),b=n(66005),C=n(60190),_=n(71033),x=n(74762),N=n(99942),w=n(44338),j=n(561),P=n(84472),O=n(82232),E=n(18594),D=n(68371),S=r(n(61888)),M=n(65758),T=n(43490),k=r(n(26372)),R=n(25044),A=n(80510),V=n(1788),$=n(2130),z=n(88593),H=n(97106),G=n(67181),L=n(22714),F=n(3354),B=n(41032),q=n(30653),U=u.memo(y.Slider),W=()=>null;t.NODE_HEIGHT=28;t.defaultViewPort={pos:{x:0,y:0},zoom:1},t.defaultBoardData={selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}},t.VisualNodeEditor=u.memo(u.forwardRef(((e,n)=>{const{onChangeNode:o,nodeIoEditable:i,onCopy:s,onGoToNodeDef:r,onInspectPin:J,boardData:Y,onChangeBoardData:K,currentInsId:Q,ancestorsInsIds:X,node:ee,onShowOmnibar:te,resolvedDependencies:ne,queuedInputsData:oe,initialPadding:ie,disableScrolling:se}=e,{onImportNode:re}=(0,H.useDependenciesContext)(),ae=(0,q.useDarkMode)(),{reportEvent:ue}=(0,T.usePorts)(),le=e.parentViewport||t.defaultViewPort,[ce,de]=(0,h.useState)({...ne,[ee.id]:ee});(0,h.useEffect)((()=>{de({...ne,[ee.id]:ee})}),[ne,ee]);const{selected:pe,from:fe,to:me}=Y,{instances:ve,connections:he,inputsPosition:ge,outputsPosition:Ie,inputs:ye,outputs:be}=ee,[Ce,_e]=(0,h.useState)(),[xe,Ne]=(0,h.useState)(),we=void 0===X,[je,Pe]=(0,h.useState)(0),[Oe,Ee]=(0,h.useState)(),[De,Se]=(0,h.useState)(!1),[Me,Te]=(0,h.useState)(),[ke,Re]=(0,h.useState)(),[Ae,Ve]=(0,h.useState)(),[$e,ze]=(0,h.useState)(),He=(0,h.useRef)();(0,f.useDidMount)((()=>{He.current=Xe.current.querySelector(".inline-editor-portal-root")}));const Ge=(0,T.useConfirm)(),Le=(0,T.usePrompt)(),Fe=Y.viewPort,Be=(0,h.useRef)(!0),[qe,Ue]=(0,h.useState)(null),We=u.useCallback((e=>{K({viewPort:e})}),[K]),Ze=u.useCallback(((e,t)=>J(e,t)),[J]),Je=u.useCallback(((e,t,n)=>{const i=(0,A.handleConnectionCloseEditorCommand)(ee,{from:e,to:t}),s=(0,l.isInternalConnectionNode)(t)?ve.find((e=>e.id===t.insId)):null,r=(s?s.inputConfig:{})[t.pinId],a=(0,l.isStaticInputPinConfig)(r)?(0,V.handleDetachConstEditorCommand)(i,t.insId,t.pinId):i;o(a,(0,O.functionalChange)("close-connection")),K({from:void 0,to:void 0}),ue("createConnection",{source:n})}),[ve,o,K,ee,ue]),Ye=u.useCallback((async()=>{const e=await Le("New visual node name?");if(!e)return;const{currentNode:t}=await(0,M.groupSelected)(Y.selected,ee,e,"inline",Le);o(t,(0,O.functionalChange)("group node")),(0,P.toastMsg)("Node grouped"),ue("groupSelected",{count:Y.selected.length})}),[Le,Y.selected,o,ee,ue]);(0,h.useEffect)((()=>{if(Oe){const e=setTimeout((()=>{Ee(void 0)}),350);return()=>clearTimeout(e)}}),[Oe]);const[Ke,Qe]=(0,h.useState)();(0,h.useEffect)((()=>{(0,j.preloadMonaco)()}),[]);const Xe=(0,h.useRef)(),et=(0,I.default)(Xe),tt=u.useRef({x:400,y:400}),nt=(0,f.useBoundingclientrect)(Xe)||C.vZero,ot=()=>{const e=(0,m.fitViewPortToNode)(ee,ce,et);(0,m.animateViewPort)(Fe,e,500,(e=>{We(e)}))},it=u.useCallback(((e,t)=>{const{to:n,from:o}=Y,i="input"===t?o:n,s="input"===t?n:o,r={pinId:e,insId:l.THIS_INS_ID},a="input"===t?{from:r}:{to:r};i&&i.pinId===e?K({from:void 0,to:void 0}):s?"input"===t&&n?Je(r,n,"nodeIoClick"):o&&Je(o,r,"nodeIoClick"):K(a)}),[Y,K,Je]),st=u.useCallback(((e,t,n)=>{const i=(0,v.produce)(ee,(o=>{"input"===e?o.inputs[t].description=n:o.outputs[t].description=n}));o(i,(0,O.functionalChange)("Node io description"))}),[o,ee]),rt=u.useCallback(((e,t,n)=>{const{from:o,to:i}=Y;if(fe&&fe.insId===e.id||me&&me.insId===e.id)K({from:void 0,to:void 0});else if("input"===n){const n={insId:e.id,pinId:t};!i||i.pinId!==t||(0,l.isInternalConnectionNode)(i)&&i.insId!==e.id?fe?Je(fe,n,"pinClick"):K({to:n,selected:[]}):K({to:void 0})}else{const n={insId:e.id,pinId:t};!o||o.pinId!==t||(0,l.isInternalConnectionNode)(o)&&o.insId!==e.id?me?Je(n,me,"pinClick"):K({from:n,selected:[]}):K({from:void 0})}}),[Y,fe,K,Je,me]);(0,h.useEffect)((()=>{if(!De&&et.width){const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);We(t);const n=setTimeout((()=>{const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);e.thumbnailMode||We(t),Se(!0)}),100);return()=>clearTimeout(n)}}),[ee,ie,et,e.thumbnailMode,De,ce,We]);const at=u.useCallback((()=>{const{selected:e}=Y,t=ee.instances.filter((t=>e.includes(t.id))).map((e=>({...e,id:e.id+"-copy"}))),n=ee.connections.filter((t=>{let{from:n,to:o}=t;return e.includes(n.insId)&&e.includes(o.insId)}));s({instances:t,connections:n})}),[Y,s,ee]),ut=u.useCallback((()=>{const{newNode:t,newInstances:n}=(0,R.pasteInstancesCommand)(ee,tt.current,e.clipboardData);o(t,(0,O.functionalChange)("paste instances")),K({selected:n.map((e=>e.id))})}),[o,K,ee,e.clipboardData]),lt=u.useCallback((()=>{const e=ee.id;Ke?"input"===Ke.type?Ke.ins.id===e?it(Ke.pin,"input"):rt(Ke.ins,Ke.pin,"input"):Ke.ins.id===e?it(Ke.pin,"output"):rt(Ke.ins,Ke.pin,"output"):console.warn("tried selecting closest with no pin nearby")}),[ee.id,Ke,it,rt]),ct=u.useCallback(((e,t)=>{const n=Math.min(Math.max(e,.1),3),o="mouse"===t?tt.current:{x:Fe.pos.x+et.width/2,y:Fe.pos.y+et.height/2},i=(0,m.centerBoardPosOnTarget)(o,et,n,Fe);We({...Fe,zoom:n,pos:i})}),[We,Fe,et]);(0,g.useHotkeys)("cmd+=",(e=>{ct(Fe.zoom+.1,"hotkey"),e.preventDefault()}),{text:"Zoom in board",group:"Viewport Controls"},[Fe,ct],Be),(0,g.useHotkeys)("cmd+-",(e=>{ct(Fe.zoom-.1,"hotkey"),e.preventDefault()}),{text:"Zoom out board",group:"Viewport Controls"},[ct,Fe.zoom],Be),(0,g.useHotkeys)("cmd+o",(e=>{e.preventDefault(),(0,P.toastMsg)("Ordering");const t=[];(0,N.orderVisualNode)(ee,ce,200,((e,n)=>{n%3==0&&t.push(e)})),(async()=>{for(;t.length;){const e=t.shift();(0,P.toastMsg)(`Step ${t.length}!`),await(0,l.delay)(200),o(e,(0,O.metaChange)("order-step")),(0,P.toastMsg)(`Step ${t.length}! done`)}})()}),{text:"Auto-layout (experimental)",group:"Misc."},[o,ee,ne],Be),(0,g.useHotkeys)("cmd+0",(e=>{ct(1),e.preventDefault()}),{text:"Reset zoom",group:"Viewport Controls"},[Fe,ct],Be);const dt=()=>{K({from:void 0,to:void 0,selected:[]})},pt=u.useCallback(((e,t)=>{_e(e.id),o({...ee},(0,O.metaChange)("drag-start"))}),[o,ee]),ft=u.useCallback(((e,t,n)=>{const{newValue:i,newSelected:s}=(0,m.handleInstanceDrag)(ee,e,n,t,pe,Ce);o(i,(0,O.metaChange)("drag-move")),s&&K({selected:s})}),[Ce,o,K,pe,ee]),mt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(void 0)}),[]),vt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(l.THIS_INS_ID)}),[]),ht=u.useCallback((async(t,n,o,i)=>{o.preventDefault(),o.stopPropagation();const{x:s,y:r}=i,a=(0,v.produce)(ee,(e=>{"input"===t?e.inputsPosition[n]={x:s,y:r}:e.outputsPosition[n]={x:s,y:r}}));e.onChangeNode(a,(0,O.metaChange)("node-io-drag-move"))}),[e,ee]),gt=u.useCallback((async(e,t,n,o)=>{n.preventDefault(),n.stopPropagation(),_e(void 0)}),[]),It=u.useCallback(((e,t)=>{let{id:n}=e;const o=t.shiftKey?pe.filter((e=>e!==n)):[],i=t.shiftKey?[...pe,n]:[n],s=pe.includes(n)?o:i;K({selected:s,from:void 0,to:void 0})}),[K,pe]),yt=u.useCallback((()=>{const e=ee.instances.map((e=>e.id));K({selected:e,from:void 0,to:void 0})}),[K,ee.instances]),bt=u.useCallback((e=>{const t=he.filter((t=>{let{from:n,to:o}=t;return-1===e.indexOf(n.insId)&&-1===e.indexOf(o.insId)})),n=(0,v.produce)(ee,(n=>{n.connections=t,n.instances=n.instances.filter((t=>!e.includes(t.id)))}));K({selected:[]}),o(n,(0,O.functionalChange)("delete-ins"))}),[he,o,K,ee]),Ct=u.useCallback((e=>{bt([e.id])}),[bt]),_t=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{"input"===e?(delete n.inputs[t],n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===t)))):(n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===t))),n.completionOutputs=(n.completionOutputs||[]).map((e=>e.split("+").filter((e=>e!==t)).join("+"))).filter((e=>!!e)),delete n.outputs[t])}));fe&&fe.insId===l.THIS_INS_ID&&fe.pinId===t?K({from:void 0}):me&&me.insId===l.THIS_INS_ID&&me.pinId===t&&K({to:void 0}),o(n,(0,O.functionalChange)("remove io pin"))}),[ee,fe,me,o,K]),xt=u.useCallback((async()=>{const{selected:e,from:t,to:n}=Y;0===e.length?t&&(0,l.isExternalConnectionNode)(t)?await Ge(`Are you sure you want to remove main input ${t.pinId}?`)&&_t("input",t.pinId):n&&(0,l.isExternalConnectionNode)(n)&&await Ge(`Are you sure you want to remove main output ${n.pinId}?`)&&_t("output",n.pinId):bt(e)}),[Ge,Y,bt,_t]),Nt=u.useCallback(((e,t,n)=>{const i=(0,m.getInstancePinConfig)(ee,e.id,t),s=(0,l.isStickyInputPinConfig)(i)?(0,x.queueInputPinConfig)():(0,l.stickyInputPinConfig)();o((0,m.changePinConfig)(ee,e.id,t,s),(0,O.functionalChange)("toggle-sticky")),ue("togglePinSticky",{isSticky:(0,l.isStickyInputPinConfig)(s)})}),[o,ee,ue]),wt=u.useCallback((()=>{const{newNode:e,newInstances:t}=(0,$.handleDuplicateSelectedEditorCommand)(ee,pe);o(e,(0,O.functionalChange)("duplicated instances")),K({selected:t.map((e=>e.id))})}),[o,K,ee,pe]),jt=u.useCallback((e=>{const t=e.nativeEvent.target;if(0===e.button&&Z(e.nativeEvent,ee.id)&&t&&"board-editor-inner"===t.className){if(Date.now()-je<300)return void te(e);Pe(Date.now());const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,nt),o=(0,m.domToViewPort)(n,Fe,le);Ne({from:o,to:o})}}),[ee.id,Fe,je,nt,le,te]),Pt=u.useCallback((e=>{if(Ue(null),Z(e.nativeEvent,ee.id)&&xe){if((0,m.calcSelectionBoxArea)(xe)>50){const t=(0,m.getInstancesInRect)(xe,ce,Fe,Kt.current,ee.instances,nt,le),n=e.shiftKey?[...pe,...t]:t;K({selected:n})}Ne(void 0)}}),[ee.id,ee.instances,xe,ce,Fe,nt,le,pe,K]),Ot=u.useCallback((e=>{if(!Z(e.nativeEvent,ee.id))return void(Be.current=!1);Be.current=!0;const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,(0,C.vAdd)(nt,C.vZero)),o=(0,m.domToViewPort)(n,Fe,le);xe&&Ne({...xe,to:o});const i=(0,m.findClosestPin)(ee,ce,n,nt,Q,X,Fe),s=Ke;if(i){(!s||s.ins!==i.ins||s.ins===i.ins&&s.pin!==i.pin)&&Qe({ins:i.ins,type:i.type,pin:i.id})}tt.current=o,K({lastMousePos:tt.current})}),[ee,nt,Fe,le,xe,ce,Q,X,Ke,K]),Et=u.useCallback((e=>{var t;"bp5-menu"!==(null===(t=e.relatedTarget)||void 0===t?void 0:t.className)&&(Qe(void 0),Be.current=!1)}),[]),Dt=u.useCallback(((e,t)=>{if(t){const t=(0,l.isInlineNodeInstance)(e)?e.node:(0,B.safelyGetNodeDef)(e.nodeId,ce);if(!t)throw new Error("Impossible state inspecting inexisting node");if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Cannot inspect a non visual node","warning");ze({insId:`${Q}.${e.id}`,node:t})}else if((0,l.isRefNodeInstance)(e)){const t=(0,B.safelyGetNodeDef)(e,ce);r(t)}else{const t=e.node;if(!(0,l.isInlineValueNode)(t))return void((0,l.isVisualNode)(t)?ze({insId:e.id,node:t}):(0,P.toastMsg)("Editing this type of node is not supported"));const n=atob(t.dataBuilderSource);Ve({insId:e.id,templateType:t.templateType,value:n,type:"existing"}),(0,P.toastMsg)("Editing inline visual node not supported yet")}}),[r,ce,Q]),St=u.useCallback((e=>{if((0,l.isInlineNodeInstance)(e)){const t=e.node;if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Not supported","warning");const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.filter((t=>t.id!==e.id)),n.connections=n.connections.filter((t=>{let{from:n,to:o}=t;return n.insId!==e.id&&o.insId!==e.id})),n.instances.push(...t.instances),n.connections.push(...t.connections.filter((e=>(0,l.isInternalConnectionNode)(e.from)&&(0,l.isInternalConnectionNode)(e.to))))}));o(n,{type:"functional",message:"ungroup"}),K({selected:[]})}else{const t=(0,B.safelyGetNodeDef)(e.nodeId,ce);if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Not supported","warning")}}),[ee,o,K,ce]),Mt=u.useCallback((async e=>{}),[]),Tt=u.useCallback(((e,t)=>{const n=(0,V.handleDetachConstEditorCommand)(ee,e.id,t);o(n,(0,O.functionalChange)("detach-const"))}),[o,ee]),kt=u.useCallback(((e,t)=>{const n=e.inputConfig[t]||(0,x.queueInputPinConfig)();(0,l.isStaticInputPinConfig)(n)&&(Re(n.value),P.AppToaster.show({message:"Value copied"}))}),[]),Rt=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{const o=n.instances.find((t=>t.id===e.id));if(!o)throw new Error("Impossible state");o.inputConfig[t]=(0,l.staticInputPinConfig)(ke),n.connections=n.connections.filter((n=>!(0,l.isInternalConnectionNode)(n.to)||!(n.to.insId===e.id&&n.to.pinId===t)))}));o(n,(0,O.functionalChange)("paste const value"))}),[ee,o,ke]),At=u.useCallback((async e=>{const t=await Le("New name?");if(!t)return;const n=(0,v.produce)(ee,(n=>{var o;"input"===e?(ee.inputs||(n.inputs={}),n.inputs[t]=(0,l.nodeInput)(),n.inputsPosition[t]=tt.current):(ee.outputs||(n.outputs={}),n.outputs[t]=(0,l.nodeOutput)(),n.outputsPosition[t]=tt.current,(null===(o=n.completionOutputs)||void 0===o?void 0:o.length)&&(0,P.toastMsg)("Note that this node has explicit completion outputs set. You may need to update them."))}));o(n,(0,O.functionalChange)("add new io pin")),ue("addIoPin",{type:e})}),[Le,ee,o,ue]),Vt=u.useCallback((async()=>{var e;const t=null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","),n=await Le("Edit completion outputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,v.produce)(ee,(e=>{e.completionOutputs=""===n?void 0:n.split(",")}));o(e,(0,O.functionalChange)("change node completions")),ue("editCompletionOutputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),$t=u.useCallback((async()=>{var e;const t=null===(e=ee.reactiveInputs)||void 0===e?void 0:e.join(","),n=await Le("Edit reactive inputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,v.produce)(ee,(e=>{e.reactiveInputs=""===n?void 0:n.split(",")}));o(e,(0,O.functionalChange)("change reactive inputs")),ue("editReactiveInputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),zt=u.useCallback((async()=>{const e=await Le("Description?",ee.description),t=(0,v.produce)(ee,(t=>{t.description=e}));o(t,(0,O.functionalChange)("Edit node description"))}),[Le,o,ee]),Ht=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{t.defaultStyle=e}));o(t,(0,O.functionalChange)("change default style")),ue("changeStyle",{isDefault:!0})}),[o,ee,ue]),Gt=u.useCallback((async(e,t)=>{const n=await Le("New name?",t)||t,i=(0,m.handleIoPinRename)(ee,e,t,n);o(i,(0,O.functionalChange)("rename io pin"))}),[ee,o,Le]),Lt=u.useCallback(((e,t)=>{const n=(0,m.handleChangeNodeInputType)(ee,e,t);o(n,(0,O.functionalChange)("toggle io pin optional"))}),[ee,o]),Ft=u.useCallback((e=>{switch(e.type){case G.ActionType.RemoveNode:{const e=(0,v.produce)(ee,(e=>{if(!(0,l.isVisualNode)(ee))throw new Error("Impossible state, deleting instances opf non visual node");e.instances=e.instances.filter((e=>!pe.includes(e.id))),e.connections=e.connections.filter((e=>!pe.includes(e.from.insId)&&!pe.includes(e.to.insId)))}));K({selected:[]}),o(e,(0,O.functionalChange)("remove-instances")),(0,P.toastMsg)(`Removed ${pe.length} instances(s)`),ue("deleteInstances",{count:pe.length});break}case G.ActionType.Inspect:if(1===pe.length)J(pe[0]);else if(fe||me){const e=null!=fe?fe:me,t=(0,l.isExternalConnectionNode)(e)?l.ROOT_INS_ID:e.insId;J(t,{type:fe?"output":"input",id:e.pinId})}ue("openInspectMenu",{source:"actionMenu"});break;case G.ActionType.Group:(async()=>{await Ye()})();break;case G.ActionType.UnGroup:{const e=ee.instances.find((e=>e.id===pe[0]));St(e);const t=(0,B.safelyGetNodeDef)(e,ce);(0,P.toastMsg)(`Ungrouped inline node ${t.id}`),ue("unGroupNode",{instancesCount:t.instances.length});break}case G.ActionType.AddInlineValue:Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"actionMenu"});break;case G.ActionType.AddNode:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,v.produce)(ee,(e=>{e.instances.push(r)})),u=(0,v.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,O.functionalChange)("add new instance")),K(u),(0,P.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;case G.ActionType.AI:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,v.produce)(ee,(e=>{e.instances.push(r)})),u=(0,v.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,O.functionalChange)("add new instance")),K(u),(0,P.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;default:(0,P.toastMsg)(`${e.type} not supported yet`)}}),[Y,fe,o,K,Ye,re,J,St,ee,ce,ue,pe,me,Fe,et]),Bt=()=>{const t=Y.from;return(0,p.entries)(ye).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"input",pos:ge[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,onDblClick:Zt,closest:!(!Ke||"input"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,inputMode:s.mode,onChangeInputMode:Lt,viewPort:Fe,onDragStart:vt,onDragEnd:gt,onDragMove:ht,onSelect:it,onSetDescription:st,selected:(null==t?void 0:t.pinId)===o,description:s.description,onMouseUp:Nn,onMouseDown:xn},o)}))},qt=()=>{const{to:t}=Y;return(0,p.entries)(be).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"output",pos:Ie[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,closest:!(!Ke||"output"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,viewPort:Fe,onDragStart:vt,onDragEnd:gt,onDragMove:ht,onSelect:it,onSetDescription:st,description:s.description,selected:(null==t?void 0:t.pinId)===o,onMouseUp:Nn,onMouseDown:xn},o)}))},Ut=()=>{if(xe){const{from:e,to:t}=xe,n=(0,m.logicalPosToRenderedPos)(e,Fe),o=(0,m.logicalPosToRenderedPos)(t,Fe),{x:i,y:s,w:r,h:u}=(0,m.getSelectionBoxRect)(n,o);return(0,a.jsx)("div",{className:"selection-box",style:{top:s,left:i,width:r,height:u}})}return null},Wt=u.useCallback((async(e,t,n,o)=>{if("input"===n){const n=e.inputConfig[t],o=(0,l.isStaticInputPinConfig)(n)?JSON.stringify(n.value):void 0;Ve({type:"static-input",insId:e.id,pinId:t,value:null!=o?o:JSON.stringify("Some static value")}),ue("addValueModalOpen",{source:"dblClickPin"})}else{const i=(0,B.safelyGetNodeDef)(e,ce);if(!(0,l.getNodeOutputs)(i)[t])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:o.clientX,y:o.clientY},ins:e,targetNode:i,pinId:t,pinType:n})}}),[ce,ue]),Zt=u.useCallback((async(e,t)=>{if(!ee.inputs[e])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:t.clientX,y:t.clientY},pinId:e,pinType:"input",targetNode:ee})}),[ee]),Jt=u.useCallback((e=>{if(e.metaKey||e.ctrlKey){const t=-.005*e.deltaY;ct(Fe.zoom+t,"mouse"),e.preventDefault(),e.stopPropagation()}else{if(se)return;const t=e.deltaX,n=e.deltaY,o=(0,v.produce)(Fe,(e=>{e.pos.x=e.pos.x+t/e.zoom,e.pos.y=e.pos.y+n/e.zoom}));We(o),e.stopPropagation(),e.preventDefault()}}),[se,ct,We,Fe]);(0,h.useEffect)((()=>{const{current:e}=Xe;if(e)return e.addEventListener("wheel",Jt),()=>{e.removeEventListener("wheel",Jt)}}),[Jt]);const Yt={backgroundPositionX:(0,m.roundNumber)(-Fe.pos.x*Fe.zoom),backgroundPositionY:(0,m.roundNumber)(-Fe.pos.y*Fe.zoom),backgroundSize:(0,m.roundNumber)(10*Fe.zoom)+"px"},Kt=u.useRef(new Map);u.useEffect((()=>{const e=ve.reduce(((e,t)=>{const n=(0,B.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeInputs)(n))),e}),new Map),t=ve.reduce(((e,t)=>{const n=(0,B.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeOutputs)(n))),e}),new Map);e.set(l.THIS_INS_ID,(0,l.keys)(ee.outputs)),t.set(l.THIS_INS_ID,(0,l.keys)(ee.inputs));const n=he.filter((n=>{const o=e.get(n.to.insId)&&e.get(n.to.insId).includes(n.to.pinId),i=t.get(n.from.insId)&&t.get(n.from.insId).includes(n.from.pinId);return!(o&&i)}));if(n.length>0){(0,P.toastMsg)(`${n.length} orphan connections removed`,"warning"),console.warn(`${n.length} orphan connections removed`,n);const e=(0,v.produce)(ee,(e=>{e.connections=ee.connections.filter((e=>!n.includes(e)))}));o(e,(0,O.functionalChange)("prune orphan connections"))}}),[ve,o,he,ee,ce]),u.useEffect((()=>{let e=[];const t=(0,v.produce)(ee,(t=>{t.instances=t.instances.map((t=>{const n=(0,B.safelyGetNodeDef)(t,ce);if(n){const o=(0,l.getNodeInputs)(n),i=(0,l.getNodeOutputs)(n);if(t.visibleInputs){const n=t.visibleInputs.filter((e=>!o[e]));n.length>0&&(t.visibleInputs=(0,l.keys)(o),e.push(...n))}if(t.visibleOutputs){const n=t.visibleOutputs.filter((e=>!i[e]));n.length>0&&(t.visibleOutputs=(0,l.keys)(i),e.push(...n))}}return t}))}));e.length>0&&((0,P.toastMsg)(`Found ${e.length} invalid visible inputs/outputs: ${e.join(", ")}. Reset them`,"warning"),o(t,(0,O.functionalChange)("reset corrupt visible inputs/outputs")))}),[ve,o,ee,ce]),(0,h.useEffect)((()=>{const e=new Map(ve.map((e=>[e.id,e])));Kt.current=he.reduce(((t,n)=>{const o=t.get(n.to.insId)||{},i=o[n.to.pinId]||[],s={...o,[n.to.pinId]:[...i,e.get(n.from.insId)]};return t.set(n.to.insId,s),t}),new Map)}),[he,ve]);const Qt=u.useCallback((()=>{Te(void 0)}),[]),Xt=u.useCallback((async e=>{if(!Me)throw new Error("impossible state - quick add menu invoked but not available");const{ins:t,pinId:n}=Me;switch(e.type){case"import":case"node":{const i="import"===e.type?await re(e.importableNode):ce,s="import"===e.type?e.importableNode.node:e.node,r=(0,m.createNewNodeInstance)(s.id,100,tt.current,i);if(r){const e=(0,v.produce)(ee,(e=>{e.instances.push(r),e.connections.push({from:{insId:t?t.id:l.THIS_INS_ID,pinId:n},to:{insId:r.id,pinId:l.TRIGGER_PIN_ID}})}));o(e,(0,O.functionalChange)("add-item-quick-menu")),Qt()}ue("addNode",{nodeId:s.id,source:"quickAdd"});break}case"value":if(!t)return void(0,P.toastMsg)("Cannot add value to main input");Ve({type:"new-output",insId:t.id,pinId:n}),ue("addValueModalOpen",{source:"quickAdd"})}}),[Me,ce,ue,ee,o,Qt,re]),en=u.useCallback((async()=>{const e=JSON.stringify(ee);await navigator.clipboard.writeText(e),P.AppToaster.show({message:"Copied!"})}),[ee]),tn=u.useCallback((()=>{var e,t;const n=i?"":" (cannot edit main node, only visual)";return(0,a.jsxs)(y.Menu,{children:[(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"New Value",onClick:(0,p.preventDefaultAnd)((()=>{Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"contextMenu"})}))}),(0,a.jsx)(y.MenuItem,{text:`New input ${n}`,onMouseDown:e=>e.stopPropagation(),onClick:(0,p.preventDefaultAnd)((()=>At("input"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`New output ${n}`,onClick:(0,p.preventDefaultAnd)((()=>At("output"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Copy node to clipboard",onClick:(0,p.preventDefaultAnd)(en)}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Completion Outputs (${(null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Vt()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Reactive inputs (${(null===(t=ee.reactiveInputs)||void 0===t?void 0:t.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>$t()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Edit description",onClick:(0,p.preventDefaultAnd)((()=>zt()))}),(0,a.jsx)(y.MenuDivider,{}),(0,a.jsx)(y.MenuItem,{text:"Default Style",children:(0,a.jsx)(z.NodeStyleMenu,{style:ee.defaultStyle,onChange:Ht,promptFn:Le})})]})}),[i,en,ee.completionOutputs,ee.reactiveInputs,ee.defaultStyle,Ht,Le,ue,At,Vt,$t,zt]);(0,g.useHotkeys)("shift+c",ot,{text:"Center viewport",group:"Viewport Controls"},[],Be),(0,g.useHotkeys)("cmd+c",at,{text:"Copy instances",group:"Editing"},[],Be),(0,g.useHotkeys)("cmd+v",ut,{text:"Paste instances",group:"Editing"},[],Be),(0,g.useHotkeys)("esc",dt,{text:"Clear selections",group:"Selection"},[],Be),(0,g.useHotkeys)("backspace",xt,{text:"Delete instances",group:"Editing"},[],Be),(0,g.useHotkeys)("shift+d",wt,{text:"Duplicate selected instances",group:"Editing"},[],Be),(0,g.useHotkeys)("cmd+a",yt,{text:"Select all",group:"Selection"},[],Be),(0,g.useHotkeys)("s",lt,{text:"Select pin closest to mouse",group:"Selection"},[],Be);const nn=u.useCallback(((e,t)=>{if(!$e)throw new Error("impossible state");const n=(0,v.produce)(ee,(t=>{const n=t.instances.find((e=>e.id===$e.insId));if(!n||!(0,l.isInlineNodeInstance)(n))throw new Error("impossible state");n.node=e}));o(n,(0,O.functionalChange)("Inner change: "+t.message)),ze((t=>({...t,node:e})))}),[o,$e,ee]),[on,sn]=(0,h.useState)({selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}}),rn=u.useCallback((e=>sn((t=>({...t,...e})))),[]),an=n=>$e&&$e.insId===n.id?{currentInsId:$e.insId,ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),boardData:on,onChangeBoardData:rn,resolvedDependencies:ne,onCopy:s,clipboardData:e.clipboardData,onInspectPin:e.onInspectPin,onGoToNodeDef:e.onGoToNodeDef,nodeIoEditable:e.nodeIoEditable,node:$e.node,onChangeNode:nn,onShowOmnibar:te,parentViewport:t.defaultViewPort,parentBoardPos:nt,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:e.queuedInputsData}:void 0,un=()=>{if(fe&&("input"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"output"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(e)&&!(0,l.isInternalConnectionNode)(fe))return;return{from:fe,to:e}}if(me&&("output"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"input"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(me)&&!(0,l.isInternalConnectionNode)(e))return;return{from:e,to:me}}},ln=()=>{const e=un();if(e){const{from:t,to:n}=e;return{connection:{from:t,to:n},type:he.some((t=>(0,l.connectionDataEquals)(t,e)))?"future-remove":"future-add"}}},cn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleInputs:t}:n))}));o(n,(0,O.functionalChange)("change instance visible inputs"))}),[ee,o]),dn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,style:t}:n))}));o(n,(0,O.functionalChange)("change instance style")),ue("changeStyle",{isDefault:!1})}),[o,ee,ue]),pn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleOutputs:t}:n))}));o(n,(0,O.functionalChange)("change instance visible outputs"))}),[ee,o]),fn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,displayName:t}:n))}));o(n,(0,O.functionalChange)("change instance display name"))}),[ee,o]);u.useImperativeHandle(n,(()=>({centerInstance(e){const t=ee.instances.find((t=>t.id===e));if(t){const e=(0,C.vSub)(t.pos,(0,C.vec)(et.width/2,et.height/2));We({...Fe,pos:e})}},centerViewPort(){ot()},getViewPort:()=>Fe,clearSelection:()=>{dt()},requestNewInlineValue:()=>{Ve({type:"new-floating",pos:tt.current})}})));const[mn,vn]=u.useState([]),hn=u.useCallback(((e,t)=>{const n=t.trim().substr(0,100),i=`Inline-value-${n.substr(0,15).replace(/["'`]/g,"")}`,s=(0,D.createInlineValueNode)({code:t,customView:n,nodeId:i,type:e});switch(Ae.type){case"existing":{const[e]=ee.instances.filter((e=>e.id===Ae.insId)).filter((e=>(0,l.isInlineNodeInstance)(e))).map((e=>e.node));if(!e)throw new Error("Unable to find inline node to save to");const t=(0,l.keys)(e.inputs),n=(0,l.keys)(s.inputs),i=new Set(S.default.difference(t,n)),r=(0,v.produce)(ee,(e=>{e.instances=e.instances.map((e=>e.id===Ae.insId?(0,l.inlineNodeInstance)(e.id,s,e.inputConfig,e.pos):e)),e.connections=e.connections.filter((e=>!(e.to.insId===Ae.insId&&i.has(e.to.pinId))))}));o(r,(0,O.functionalChange)("change inline value")),Ve(void 0);break}case"static-input":{let e;try{const n=t.replace(/^['`]/,'"').replace(/['`]$/,'"');e=JSON.parse(n)}catch(r){return void(0,P.toastMsg)("Input values must not be formulas or code")}const n=(0,v.produce)(ee,(t=>{t.instances.find((e=>e.id===Ae.insId)).inputConfig[Ae.pinId]=(0,l.staticInputPinConfig)(e)}));o(n,(0,O.functionalChange)("set static input value")),Ve(void 0);break}case"new-floating":{const e=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},Ae.pos),t=(0,v.produce)(ee,(t=>{t.instances.push(e)}));o(t,(0,O.functionalChange)("new floating value")),Ve(void 0);break}case"new-output":{const{insId:e,pinId:t}=Ae,n=ee.instances.find((t=>t.id===e));if(!n)throw new Error("Impossible state");const i=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},(0,C.vAdd)(n.pos,{x:-50,y:150})),r=(0,v.produce)(ee,(n=>{n.instances.push(i),n.connections.push({from:(0,l.connectionNode)(e,t),to:(0,l.connectionNode)(i.id,l.TRIGGER_PIN_ID)})}));o(r,(0,O.functionalChange)("new value connected to output")),Ve(void 0)}}ue("addValue",{type:e,placeholdersCount:(0,l.keys)(s.inputs).length})}),[Ae,o,ee,ue]),gn=he.filter((e=>{const t=un();return!t||!(0,l.connectionDataEquals)(t,e)})),In=u.useCallback((()=>{ze(void 0),sn(t.defaultBoardData)}),[]),yn=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{const n=t.connections.find((t=>(0,l.connectionDataEquals)(t,e)));n.hidden=!n.hidden}));o(t,(0,O.functionalChange)("toggle connection hidden"))}),[o,ee]),bn=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{t.connections=t.connections.filter((t=>!(0,l.connectionDataEquals)(t,e)))}));o(t,(0,O.functionalChange)("remove connection"))}),[o,ee]),Cn=u.useCallback(((e,t,n)=>{Ue("input"===n?{to:(0,l.connectionNode)(e.id,t),from:void 0}:{from:(0,l.connectionNode)(e.id,t),to:void 0})}),[]),_n=u.useCallback(((e,t,n)=>{qe&&(qe.from&&"input"===n?Je(qe.from,(0,l.connectionNode)(e.id,t),"pinDrag"):qe.to&&"output"===n&&Je((0,l.connectionNode)(e.id,t),qe.to,"pinDrag")),Ue(null)}),[qe,Je]),xn=u.useCallback(((e,t)=>{}),[]),Nn=u.useCallback(((e,t)=>{qe&&(qe.from&&"output"===t?Je(qe.from,(0,l.externalConnectionNode)(e),"nodeIoPinDrag"):qe.to&&"input"===t&&Je((0,l.externalConnectionNode)(e),qe.to,"nodeIoPinDrag"))}),[qe,Je]);try{return(0,a.jsxs)(y.ContextMenu,{className:(0,k.default)("visual-node-editor",e.className,{dark:ae}),"data-id":ee.id,content:tn(),disabled:!Be.current,children:[(0,a.jsxs)("main",{className:"board-editor-inner",onMouseDown:jt,onMouseUp:Pt,onMouseMove:Ot,onMouseLeave:Et,ref:Xe,style:Yt,children:[(0,a.jsx)(u.Fragment,{children:(0,a.jsx)(w.LayoutDebugger,{vp:Fe,node:ee,extraDebug:m.emptyList,mousePos:tt.current})}),(0,a.jsx)(d.ConnectionView,{resolvedNodes:ce,currentInsId:Q,ancestorsInsIds:X,size:et,node:ee,boardPos:nt,instances:ve,connections:gn,futureConnection:ln(),onDblClick:l.noop,viewPort:Fe,parentVp:le,selectedInstances:pe,toggleHidden:yn,removeConnection:bn,lastMousePos:tt.current,draggedSource:qe}),Bt(),ve.map((t=>{var n,o,i,s,r;return(0,a.jsx)(c.InstanceView,{onUngroup:St,onExtractInlineNode:Mt,onDetachConstValue:Tt,onCopyConstValue:kt,onPasteConstValue:Rt,copiedConstValue:ke,connectionsPerInput:Kt.current.get(t.id)||m.emptyObj,node:(0,B.safelyGetNodeDef)(t,ce),ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),onPinClick:rt,onPinDblClick:Wt,onDragStart:pt,onDragEnd:mt,resolvedDeps:ce,onDragMove:ft,onDblClick:Dt,onSelect:It,onToggleSticky:Nt,selected:-1!==pe.indexOf(t.id),dragged:Ce===t.id,onInspectPin:Ze,selectedInput:me&&(0,l.isInternalConnectionNode)(me)&&me.insId===t.id?me.pinId:void 0,selectedOutput:fe&&(0,l.isInternalConnectionNode)(fe)&&fe.insId===t.id?fe.pinId:void 0,closestPin:Ke&&Ke.ins.id===t.id?Ke:void 0,queuedInputsData:null!==(n=oe[t.id])&&void 0!==n?n:m.emptyObj,instance:t,connections:he,onTogglePinBreakpoint:l.noop,onTogglePinLog:l.noop,viewPort:Fe,onChangeVisibleInputs:cn,onChangeVisibleOutputs:pn,onSetDisplayName:fn,onDeleteInstance:Ct,forceShowMinimized:fe||(null===(o=null==qe?void 0:qe.to)||void 0===o?void 0:o.insId)===t.id?"input":me||(null===(i=null==qe?void 0:qe.from)||void 0===i?void 0:i.insId)===t.id?"output":void 0,isConnectedInstanceSelected:pe.some((e=>he.some((n=>{let{from:o,to:i}=n;return o.insId===t.id&&i.insId===e||o.insId===e&&i.insId===t.id})))),inlineGroupProps:an(t),onCloseInlineEditor:In,inlineEditorPortalDomNode:He.current,onChangeStyle:dn,onGroupSelected:Ye,onPinMouseDown:Cn,onPinMouseUp:_n,hadError:null!==(r=null===(s=e.instancesWithErrors)||void 0===s?void 0:s.has((0,l.fullInsIdPath)(t.id)))&&void 0!==r&&r},t.id)})),Ut(),qt(),(0,a.jsx)(L.MainInstanceEventsIndicator,{currentInsId:Q,ancestorsInsIds:X,viewPort:Fe}),Me?(0,a.jsx)(_.QuickAddMenu,{targetNode:Me.targetNode,pinId:Me.pinId,pinType:Me.pinType,pos:Me.pos,resolvedDependencies:ne,node:ee,onAdd:Xt,onClose:Qt}):null,(0,a.jsxs)("div",{className:"viewport-controls-and-help",children:[(0,a.jsx)(y.Button,{small:!0,onClick:ot,minimal:!0,intent:"primary",children:"Center"}),(0,a.jsx)(U,{min:.15,max:3,stepSize:.05,labelStepSize:10,labelRenderer:W,onChange:ct,value:Fe.zoom}),we?(0,a.jsx)(F.HelpBubble,{}):null]}),Ae?(0,a.jsx)(E.InlineCodeModal,{env:m.emptyObj,initialValue:Ae.value,initialType:"existing"===Ae.type?Ae.templateType:void 0,onCancel:()=>Ve(void 0),onSubmit:hn}):null,(0,a.jsx)("div",{className:"inline-editor-portal-root"})]}),(0,a.jsx)(G.ActionsMenu,{showRunFlowOptions:we,onAction:Ft,selectedInstances:pe,node:ee,resolvedNodes:ce,to:me,from:fe,hotkeysEnabled:Be})]})}catch(wn){return console.error(wn),(0,a.jsxs)("div",{children:["Error rendering board - ",wn.toString()]})}})));const Z=(e,t)=>{const n=e.target.closest(".visual-node-editor");return n&&n.getAttribute("data-id")===t}},83234:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeView=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=r(n(59349)),d=n(30653);t.BaseNodeView=function(e){const{dragged:t,viewPort:n,pos:o,onDragEnd:i,onDragMove:s,onDragStart:r,displayMode:p}=e,f=(0,d.useDarkMode)(),m=u.useCallback(((e,t)=>{r(e,t)}),[r]),v=u.useCallback(((e,t)=>{const s=o,r=(t.x-s.x)/n.zoom,a=(t.y-s.y)/n.zoom,u=s.x+r,l=s.y+a;i(e,{...t,x:u,y:l})}),[o,i,n]),h=u.useCallback(((e,t)=>{s(e,{x:t.x,y:t.y})}),[s]),g={transform:`scale(${n.zoom})`},I=(0,l.default)("base-node-view",e.className,{dragged:t,dark:f,"display-mode":p}),y=o.x*n.zoom-n.pos.x*n.zoom,b=o.y*n.zoom-n.pos.y*n.zoom,C={transform:`translate(${y-o.x}px, ${b-o.y}px)`},_=(0,l.default)("base-node-view-vp-fixer",{"display-mode":p}),x=(0,a.jsx)("span",{className:"base-node-view-wrapper",children:(0,a.jsx)("div",{className:I,style:g,id:e.domId,children:e.children})});return(0,a.jsx)("div",{className:_,style:C,children:(0,a.jsx)(c.default,{onStop:v,onStart:m,onDrag:h,position:o,cancel:".no-drag",children:x})})}},80510:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleConnectionCloseEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleConnectionCloseEditorCommand=(e,t)=>{let{from:n,to:o}=t;return(0,s.default)(e,(e=>{const t=e.connections.find((e=>{const t=(0,i.connectionNodeEquals)(n,e.from),s=(0,i.connectionNodeEquals)(o,e.to);return t&&s}));t?e.connections=e.connections.filter((e=>e!==t)):e.connections.push({from:n,to:o})}))}},1788:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDetachConstEditorCommand=void 0;const i=n(74762),s=o(n(53865)),r=n(68371);t.handleDetachConstEditorCommand=(e,t,n)=>(0,s.default)(e,(e=>{const{instances:o}=e,s=o.find((e=>e.id===t));if(!s)throw new Error("Impossible state ins id with no matching instance");const a=s.inputConfig[n];if(!a)throw new Error("impossible state detaching const from unexistent config");if(!(0,i.isStaticInputPinConfig)(a))throw new Error("impossible state detaching const with no value");const u=JSON.stringify(a.value),l=(0,r.createInlineValueNode)({code:`${u}`,type:i.InlineValueNodeType.VALUE}),c=(0,i.inlineNodeInstance)(`value-${(0,i.randomInt)(999)}`,l,{},{x:s.pos.x,y:s.pos.y-100});if(!e.instances.find((e=>e.id===s.id)))throw new Error("impossible state instance not found");s.inputConfig[n]=(0,i.queueInputPinConfig)(),e.instances.push(c),e.connections.push((0,i.connectionData)(`${c.id}.value`,`${s.id}.${n}`))}))},2130:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDuplicateSelectedEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleDuplicateSelectedEditorCommand=(e,t)=>{const n=[];return{newNode:(0,s.default)(e,(o=>{const s=o.instances;t.forEach((t=>{const o=s.find((e=>e.id===t));if(!o)throw new Error("impossible state duplicate selected no matching instance");if(o){const{pos:t}=o,r={...o,pos:{x:t.x+20,y:t.y+20},id:(0,i.createInsId)(e)};s.push(r),n.push(r.id)}}))})),newInstances:n}}},25044:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.pasteInstancesCommand=void 0;const i=n(74762),s=o(n(53865));t.pasteInstancesCommand=(e,t,n)=>{const o=n.instances.map((n=>({...n,pos:t,id:(0,i.createInsId)(e)}))),r=new Map(o.map(((e,t)=>[n.instances[t].id,e.id])));return{newNode:(0,s.default)(e,(e=>{e.instances.push(...o);const t=n.connections.map((e=>{let{from:t,to:n}=e;return{from:{...t,insId:r.get(t.insId)||t.insId},to:{...n,insId:r.get(n.insId)||n.insId}}}));e.connections.push(...t)})),newInstances:o}}},65082:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionView=t.SingleConnectionView=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=r(n(26372)),d=n(74762),p=n(18243),f=n(77852),m=n(74089),v=n(60190),h=n(50382),g=n(76064),I=n(41032);t.SingleConnectionView=e=>{const{isBrowser:t}=(0,f.useSsr)(),{connection:n,node:o,resolvedNodes:i,instances:s,type:r,viewPort:a,toggleHidden:l,parentSelected:m,removeConnection:y}=e,{from:b}=n,C=(0,d.isInternalConnectionNode)(b)&&s.find((e=>e.id===b.insId));if(!C&&(0,d.isInternalConnectionNode)(b))throw new Error(`impossible state - "from instance id - [${b.insId}] does not exist"`);const _=((0,d.isInternalConnectionNode)(b)&&C?(0,I.safelyGetNodeDef)(C,i):o).outputs[b.pinId],x=_&&_.delayed,N=t?(0,p.calcStartPos)({...e,connectionNode:b}):{x:0,y:0},w=t?(0,p.calcTargetPos)({...e,connectionNode:n.to}):{x:0,y:0},{x:j,y:P}=(0,v.vDiv)(N,e.parentVp.zoom),{x:O,y:E}=(0,v.vDiv)(w,e.parentVp.zoom),D=(0,c.default)({delayed:x,hidden:n.hidden,"parent-selected":m},r),S=(0,u.jsxs)(h.Menu,{children:[(0,u.jsx)(h.MenuItem,{text:n.hidden?"Show connection":"Hide connection",onClick:()=>l(n)}),(0,u.jsx)(h.MenuItem,{text:"Remove connection",onClick:()=>y(n)})]});return(0,u.jsx)(h.ContextMenu,{content:S,children:e=>(0,u.jsx)(g.ConnectionViewPath,{className:D,from:{x:j,y:P},to:{x:O,y:E},dashed:"regular"!==r,zoom:a.zoom,onContextMenu:e.onContextMenu})})};t.ConnectionView=e=>{var n;const{viewPort:o,futureConnection:i,toggleHidden:s,selectedInstances:r,draggedSource:c}=e,[d,f]=l.useState(0),v=l.useCallback((e=>requestAnimationFrame((()=>{f((e=>(e+1)%9)),e>0&&v(e-1)}))),[]);l.useEffect((()=>{const e=v(10);return()=>{cancelAnimationFrame(e)}}),[v]),l.useEffect((()=>{const e=()=>{v(3)};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[v,d]);const h=e.connections.map((n=>{const o=r.includes(n.from.insId)||r.includes(n.to.insId);return(0,a.createElement)(t.SingleConnectionView,{...e,connection:n,type:"regular",parentSelected:o,key:n.from.insId+n.from.pinId+n.to.insId+n.to.pinId})}));if(i&&h.push((0,a.createElement)(t.SingleConnectionView,{...e,connection:i.connection,type:i.type,toggleHidden:s,parentSelected:!1,key:"future"})),c){const t=(c.from?p.calcStartPos:p.calcTargetPos)({connectionNode:null!==(n=c.from)&&void 0!==n?n:c.to,viewPort:o,boardPos:e.boardPos,ancestorsInsIds:e.ancestorsInsIds,currentInsId:e.currentInsId});h.push((0,u.jsx)(g.ConnectionViewPath,{className:"dragged",from:t,to:(0,m.logicalPosToRenderedPos)(e.lastMousePos,o),zoom:o.zoom},"dragged"))}return(0,u.jsx)("span",{className:"connections-view",style:{opacity:o.zoom},children:(0,u.jsx)("svg",{style:{width:"100%"},children:h})})}},76064:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionViewPath=void 0;const i=n(35250),s=o(n(26372)),r=n(70079),a=n(23381);t.ConnectionViewPath=(0,r.forwardRef)(((e,t)=>{const{from:n,to:o,className:r,onContextMenu:u,zoom:l,dashed:c}=e,{x:d,y:p}=n,{x:f,y:m}=o,v=(0,a.calcBezierPath)({sourceX:d,sourceY:p,targetX:f,targetY:m,curvature:.15}),h=2.5*l,g=c?6*l:void 0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:v,ref:t,className:(0,s.default)("connection",r),style:{strokeWidth:h,strokeDasharray:g},onContextMenu:u}),e.label?(0,i.jsx)("text",{className:"label",x:(d+f)/2,y:(p+m)/2,fontSize:"12px"}):null,(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%"}),(0,i.jsx)("stop",{offset:"100%"})]})]})}))},23381:(e,t)=>{"use strict";var n;function o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i(e){let t,i,{pos:s,x1:r,y1:a,x2:u,y2:l,c:c}=e;switch(s){case n.Left:t=r-o(r-u,c),i=a;break;case n.Right:t=r+o(u-r,c),i=a;break;case n.Top:t=r,i=a-o(a-l,c);break;case n.Bottom:t=r,i=a+o(l-a,c)}return[t,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.getBezierCenter=t.calcBezierPath=t.Position=void 0,function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(n=t.Position||(t.Position={}));t.calcBezierPath=e=>{let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l});return`M${t},${o} C${c},${d} ${p},${f} ${r},${a}`},t.getBezierCenter=function(e){let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l}),m=.125*t+.375*c+.375*p+.125*r,v=.125*o+.375*d+.375*f+.125*a;return[m,v,Math.abs(m-t),Math.abs(v-o)]}},18243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcTargetPos=t.calcStartPos=t.calcPinPosition=void 0;const o=n(74762),i=n(30994),s={x:99999,y:99999};function r(e){const t=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds),pinId:e.pinId,pinType:e.pinType,isMain:e.isMain});return((e,t,n,o)=>{if(!e)return console.warn(`Cannot find element ${n} to calculate position.`),s;const{x:i,y:r,width:a,height:u}=e.getBoundingClientRect(),l=r+u/2;return{x:i+a/2-t.x,y:l-t.y}})(document.getElementById(t),e.boardPos,t,e.viewPort)}t.calcPinPosition=r;t.calcStartPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"input",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"output",boardPos:n,viewPort:s})};t.calcTargetPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"output",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"input",boardPos:n,viewPort:s})}},30994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPinDomId=t.getMainInstanceIndicatorDomId=t.getInstanceDomId=void 0;const o=n(74762);t.getInstanceDomId=(e,t)=>`ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getMainInstanceIndicatorDomId=(e,t)=>`main-ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getPinDomId=e=>{let{pinType:t,fullInsIdPath:n,pinId:o,isMain:i}=e;return`${i?"main-":""}pin:${t}:${n}:${o}`.replace(/\s+/g,"-")}},86553:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceView=t.getVisibleOutputs=t.getVisibleInputs=t.INSTANCE_INFO_TOOLTIP_DELAY=t.MAX_INSTANCE_WIDTH=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=n(66074),d=n(74762),p=r(n(26372)),f=n(2036),m=n(74762),v=n(74762),h=n(53159),g=n(83234),I=n(74762),y=n(30994),b=n(63521),C=n(74089),_=n(50382),x=r(n(99581)),N=n(88593),w=n(30653);t.PIECE_HORIZONTAL_PADDING=25,t.PIECE_CHAR_WIDTH=11,t.MIN_WIDTH_PER_PIN=40,t.MAX_INSTANCE_WIDTH=400,t.INSTANCE_INFO_TOOLTIP_DELAY=400;t.getVisibleInputs=(e,t,n)=>{const{visibleInputs:o}=e;if(o)return o;const i=(0,d.keys)((0,v.getNodeInputs)(t)).filter(((o,i)=>{var s;const r=n.some((t=>t.to.insId===e.id&&t.to.pinId===o)),a=t.inputs[o]&&"optional"===(null===(s=t.inputs[o])||void 0===s?void 0:s.mode);return r||!a&&o!==m.TRIGGER_PIN_ID}));return 0===i.length?[m.TRIGGER_PIN_ID]:i};t.getVisibleOutputs=(e,t,n)=>{const{visibleOutputs:o}=e;if(o)return o;const i=Object.keys(t.outputs);return n.some((t=>t.from.insId===e.id&&t.from.pinId===m.ERROR_PIN_ID))?[...i,m.ERROR_PIN_ID]:i};t.InstanceView=function(e){const{selected:n,selectedInput:o,selectedOutput:i,closestPin:s,dragged:r,onTogglePinLog:j,onTogglePinBreakpoint:P,onDetachConstValue:O,onCopyConstValue:E,onPasteConstValue:D,displayMode:S,connections:M,instance:T,viewPort:k,node:R,onPinClick:A,onPinDblClick:V,onDragStart:$,onDragEnd:z,onDragMove:H,onToggleSticky:G,onSelect:L,onDblClick:F,onChangeVisibleInputs:B,onChangeVisibleOutputs:q,onConvertConstToEnv:U,inlineGroupProps:W,onUngroup:Z,onExtractInlineNode:J,onGroupSelected:Y,isConnectedInstanceSelected:K,inlineEditorPortalDomNode:Q,onChangeStyle:X,onDeleteInstance:ee,onSetDisplayName:te,onPinMouseUp:ne,onPinMouseDown:oe}=e,ie=(0,w.useDarkMode)(),{id:se}=T,re=l.useMemo((()=>{const e=(0,d.randomInt)(6,1);return{icon:(0,d.pickRandom)([["fab","discord"],["fab","slack"],"bug","cube"]),color:e,size:(0,d.randomInt)(3,1),variation:(0,d.randomInt)(5,1)}}),[]),ae=l.useRef(),ue=l.useMemo((()=>T.style||R.defaultStyle||{}),[R,T]),le=ue.size||"regular",ce=l.useMemo((()=>new Map(M.filter((e=>{let{to:t}=e;return t.insId===se})).map((e=>{let{to:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),de=l.useMemo((()=>new Map(M.filter((e=>{let{from:t}=e;return t.insId===se})).map((e=>{let{from:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),pe=(0,C.usePrompt)(),fe=l.useCallback((e=>A(T,e,"input")),[T,A]),me=l.useCallback(((e,t)=>V(T,e,"input",t)),[T,V]),ve=l.useCallback(((e,t)=>V(T,e,"output",t)),[T,V]),he=l.useCallback((e=>A(T,e,"output")),[T,A]),ge=l.useCallback(((e,t)=>{$(T,e,t)}),[T,$]),Ie=l.useCallback(((e,t)=>{const n=T.pos,o=(t.x-n.x)/k.zoom,i=(t.y-n.y)/k.zoom,s=n.x+o,r=n.y+i;z(T,e,{...t,x:s,y:r})}),[T,z,k.zoom]),ye=l.useCallback(((e,t)=>{H(T,e,{x:t.x,y:t.y})}),[T,H]),be=l.useCallback((e=>G(T,e)),[T,G]),Ce=l.useCallback((e=>O(T,e)),[T,O]),_e=l.useCallback((e=>E(T,e)),[T,E]),xe=l.useCallback((e=>D(T,e)),[T,D]),Ne=l.useCallback((e=>L(T,e)),[T,L]),we=l.useCallback((e=>F(T,e.shiftKey)),[T,F]),je=(0,d.entries)(R.inputs),{visibleInputs:Pe,visibleOutputs:Oe}=T;Pe&&je.sort(((e,t)=>Pe.indexOf(e[0])-Pe.indexOf(t[0])));const Ee=(0,d.entries)(R.outputs);Oe&&Ee.sort(((e,t)=>Oe.indexOf(e[0])-Oe.indexOf(t[0])));const De=(0,t.getVisibleInputs)(T,R,M),Se=(0,t.getVisibleOutputs)(T,R,M);je.push([m.TRIGGER_PIN_ID,{...(0,d.nodeInput)(),description:"Use this pin to manually trigger the node. If not connected, the node will be triggered automatically when all required inputs have data."}]),Ee.push([m.ERROR_PIN_ID,{...(0,m.nodeOutput)(),description:"Use this pin to catch errors that happen inside this node. If not connected, errors will bubble up to the parent node."}]);const Me=je.filter((e=>{let[t]=e;return De.includes(t)||(n||K)&&ce.has(t)})),Te=Ee.filter((t=>{let[o]=t;return Se.includes(o)||(n||K)&&de.has(o)||o===m.ERROR_PIN_ID&&e.hadError})),ke=M.some((e=>e.from.insId===se&&e.from.pinId===m.ERROR_PIN_ID)),Re=(0,p.default)("ins-view",{"no-inputs":0===je.length,"no-outputs":0===Ee.length,"display-mode":S,"force-minimized-input":"input"===e.forceShowMinimized||"both"===e.forceShowMinimized,"force-minimized-output":"output"===e.forceShowMinimized||"both"===e.forceShowMinimized,"inline-node-edited":!!W,"error-caught":ke}),Ae=(0,p.default)({selected:n,dragged:r,closest:s&&s.ins.id===T.id},`size-${le}`),Ve=new Set((0,d.entries)(R.inputs).filter((e=>{let[t,n]=e;return(0,m.isInputPinOptional)(n)})).map(d.pickFirst)),$e=(0,d.entries)(T.inputConfig).reduce(((e,t)=>{let[n,o]=t;return(0,m.isStickyInputPinConfig)(o)||o.sticky?{...e,[n]:!0}:e}),{}),ze=(0,h.calcNodeContent)(T,R),He=e=>{const t=T.inputConfig[e];if((0,I.isStaticInputPinConfig)(t))return t.value},Ge=l.useCallback((async()=>{const e=(0,d.okeys)(R.inputs),t=await pe("New order?",(T.visibleInputs||e).join(","));t&&B(T,t.split(","))}),[R.inputs,pe,T,B]),Le=l.useCallback((async()=>{const e=(0,d.okeys)(R.outputs),t=await pe("New order?",(T.visibleOutputs||e).join(","));t&&q(T,t.split(","))}),[R.outputs,pe,T,q]),Fe=l.useCallback((()=>{ee(T)}),[ee,T]),Be=l.useCallback((async()=>{const e=await pe("Set custom display name",T.displayName||R.id);te(T,e)}),[pe,T,te,R.id]),qe=Object.keys((0,v.getNodeInputs)(R)),Ue=Object.keys((0,d.getNodeOutputs)(R)),We=l.useCallback((e=>{U&&U(T,e)}),[T,U]),Ze=l.useCallback(((e,t)=>{ne&&ne(T,e,t)}),[T,ne]),Je=l.useCallback(((e,t)=>{oe&&oe(T,e,t)}),[T,oe]),Ye=()=>(0,u.jsx)("div",{className:"inputs no-drag",children:Me.map((t=>{let[i,r]=t;var a;return(0,u.jsx)(f.PinView,{type:"input",currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,id:i,optional:Ve.has(i),connected:ce.has(i),isSticky:$e[i],minimized:!n&&1===Me.length,onToggleSticky:be,onDetachConstValue:Ce,onCopyConstValue:_e,onPasteConstValue:xe,copiedConstValue:e.copiedConstValue,selected:i===o,onClick:fe,onDoubleClick:me,isClosestToMouse:!!s&&"input"===s.type&&s.pin===i,onToggleLogged:j,onToggleBreakpoint:P,onInspect:e.onInspectPin,constValue:He(i),onConvertConstToEnv:e.onConvertConstToEnv?We:void 0,description:r.description,queuedValues:null!==(a=e.queuedInputsData[i])&&void 0!==a?a:0,onMouseUp:Ze,onMouseDown:Je},i)}))}),Ke=()=>(0,u.jsx)("div",{className:"outputs no-drag",children:Te.map((t=>{let[o,r]=t;return(0,u.jsx)(f.PinView,{currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,connected:de.has(o),type:"output",id:o,minimized:!n&&1===Te.length,isClosestToMouse:!!s&&"output"===s.type&&s.pin===o,selected:o===i,onClick:he,onDoubleClick:ve,onToggleLogged:j,onToggleBreakpoint:P,onInspect:e.onInspectPin,description:r.description,onMouseUp:Ze,onMouseDown:Je},o)}))}),Qe=l.useCallback((e=>{X(T,e)}),[T,X]),Xe=l.useCallback((()=>{const e=[...qe.map((e=>{const t=De.includes(e),n=ce.has(e)&&!0!==ce.get(e),o=(0,d.getInputName)(e);return{text:t?n?`Hide input "${o}" (disconnect first)`:`Hide input "${o}"`:`Show input "${o}"`,onClick:()=>B(T,t?De.filter((t=>t!==e)):[...De,e]),disabled:n&&t}})),...Ue.map((e=>{const t=Se.includes(e),n=de.has(e),o=(0,d.getOutputName)(e);return{text:t?n?`Hide output "${o}" (disconnect first)`:`Hide output "${o}"`:`Show output "${o}"`,onClick:()=>q(T,t?Se.filter((t=>t!==e)):[...Se,e]),disabled:n&&t}})),...(0,d.isInlineNodeInstance)(T)&&(0,v.isVisualNode)(T.node)?[{text:"Ungroup inline node",onClick:()=>Z(T)}]:[],...(0,d.isInlineNodeInstance)(T)?[{text:"Extract inline node to file",onClick:()=>J(T)}]:[],{text:"Reorder inputs",onClick:Ge},{text:"Reorder outputs",onClick:Le},{text:"Set display name",onClick:Be},{text:"Group selected instances",onClick:Y},{text:"Delete instance",intent:"danger",onClick:Fe}];return(0,u.jsxs)(_.Menu,{children:[(0,u.jsx)(_.MenuItem,{text:"Style",children:(0,u.jsx)(N.NodeStyleMenu,{style:ue,onChange:Qe,promptFn:pe})}),e.map(((e,t)=>(0,a.createElement)(_.MenuItem,{...e,key:t})))]})}),[qe,Ue,T,Ge,Le,Be,Fe,ue,Qe,pe,De,ce,B,Se,de,q,Z,J,Y]),et={"--node-color":ue.color,...ue.cssOverride||{}},tt=(0,y.getInstanceDomId)(T.id,e.ancestorsInsIds);return(0,u.jsx)("div",{className:Re,children:(0,u.jsx)(g.BaseNodeView,{pos:T.pos,viewPort:k,onDragStart:ge,onDragMove:ye,onDragEnd:Ie,upperRenderer:Ye,bottomRenderer:Ke,displayMode:S,domId:tt,children:(0,u.jsxs)(l.Fragment,{children:[Ye(),W?x.default.createPortal((0,u.jsxs)("div",{className:"inline-group-editor-container no-drag",children:[(0,u.jsxs)("header",{children:[ze," ",(0,u.jsx)("button",{onClick:e.onCloseInlineEditor,children:"close"})]}),(0,u.jsx)(b.VisualNodeEditor,{...e.inlineGroupProps,className:"no-drag",ref:ae})]}),Q):(0,u.jsx)(_.ContextMenu,{className:(0,p.default)("ins-view-inner",Ae,`size-${re.size}`,{dark:ie}),onClick:Ne,onDoubleClick:we,content:Xe(),style:et,children:(0,u.jsx)(_.Tooltip,{content:R.description,children:(0,u.jsxs)(l.Fragment,{children:[ue.icon?(0,u.jsx)(c.FontAwesomeIcon,{icon:ue.icon}):null," ",ze]})})}),Ke()]})})})}},53568:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStyleMenu=t.nodeStylePresetColors=void 0;const r=n(35250),a=n(50382),u=s(n(70079)),l=n(84472);t.nodeStylePresetColors=[{name:"Amethyst",color:"#9b5de5"},{name:"Magenta",color:"#f15bb5"},{name:"Yellow",color:"#fee440"},{name:"Capri",color:"#00bbf9"},{name:"Sea Green",color:"#00f5d4"},{name:"Orange",color:"#ff7f00"}];const c={size:"regular"};t.NodeStyleMenu=e=>{var n;const{onChange:o,style:i}=e,s=i||c,d=e.promptFn,p=u.default.useCallback(((e,t)=>{o({...s,[e]:t})}),[s,o]),f=u.default.useCallback((async()=>{const e=await d("Icon name? (Font Awesome conventions)","rocket"),t=e.includes(",")?e.split(","):e;p("icon",t)}),[d,p]),m=(0,u.useCallback)((async()=>{const e=await d("Enter a custom style (valid JSON representing a React CSS object)",s.cssOverride?JSON.stringify(s.cssOverride):"");try{const t=JSON.parse(e);p("cssOverride",t)}catch(t){console.error(t),(0,l.toastMsg)("Invalid object","danger")}}),[d,p,s.cssOverride]);return(0,r.jsxs)(u.default.Fragment,{children:[(0,r.jsxs)(a.MenuItem,{text:"Color",children:[t.nodeStylePresetColors.map((e=>(0,r.jsx)(a.MenuItem,{text:e.name,onClick:()=>p("color",e.color)},e.name))),(0,r.jsx)(a.MenuDivider,{}),(0,r.jsx)(a.MenuItem,{text:"Remove Color",onClick:()=>p("color",void 0)})]}),(0,r.jsxs)(a.MenuItem,{text:`Size (${null!==(n=s.size)&&void 0!==n?n:"regular"})`,children:[(0,r.jsx)(a.MenuItem,{text:"Small",onClick:()=>p("size","small")}),(0,r.jsx)(a.MenuItem,{text:"Regular",onClick:()=>p("size","regular")}),(0,r.jsx)(a.MenuItem,{text:"Large",onClick:()=>p("size","large")})]}),(0,r.jsxs)(a.MenuItem,{text:"Icon",children:[(0,r.jsx)(a.MenuItem,{text:"Choose Icon",onClick:f}),(0,r.jsx)(a.MenuItem,{text:"Remove Icon",onClick:()=>p("icon",void 0)})]}),(0,r.jsx)(a.MenuItem,{text:"Custom Styling",onClick:m})]})}},88593:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(53568),t)},83651:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86553),t)},53159:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calcInstancePosition=t.calcNodeWidth=t.calcNodeContent=void 0;const i=n(74762),s=o(n(6576)),r=n(86553),a=n(61888),u=n(30994);t.calcNodeContent=(e,t)=>{if(e.displayName)return e.displayName;if(t.customViewCode)try{const n=Object.entries(e.inputConfig).filter((e=>{let[,t]=e;return(0,i.isStaticInputPinConfig)(t)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o.value}}),{});return s.default.compile(t.customViewCode)({inputs:n}).trim()}catch(n){return console.error("Error with custom view",n),`Error in custom view [${t.id}]`}return t.id};t.calcNodeWidth=(e,n)=>{const o=(0,i.okeys)(n.inputs).length*r.MIN_WIDTH_PER_PIN,s=(0,t.calcNodeContent)(e,n),u=r.PIECE_CHAR_WIDTH;return(0,a.clamp)(s.length*u+2*r.PIECE_HORIZONTAL_PADDING,o,r.MAX_INSTANCE_WIDTH)};t.calcInstancePosition=(e,t,n)=>{const o=(0,u.getInstanceDomId)(e,t),i=document.getElementById(o);if(i){const{x:e,y:t,width:o,height:s}=i.getBoundingClientRect(),r=t+s/2;return{x:e+o/2-n.x,y:r-n.y}}return console.warn("Cannot find element to draw connection to",o),{x:99999,y:99999}}},17841:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutDebugger=t.LayoutDebuggerItem=t.PosDebugger=void 0;const i=n(70079),s=n(35250),r=n(74762),a=o(n(70079)),u=n(7047),l=e=>{let{pos:t}=e;return(0,s.jsxs)("span",{children:[t.x.toFixed(1),", ",t.y.toFixed(1)]})};t.PosDebugger=e=>(0,s.jsx)("span",{className:"pos-debugger",children:(0,s.jsx)(l,{pos:e.pos})});t.LayoutDebuggerItem=e=>{const{pos:n,viewPort:o,size:i,color:r}=e,a=o.zoom,u=n.x*a-o.pos.x*a,l=n.y*a-o.pos.y*a,c={transform:`translate(${u-n.x}px, ${l-n.y}px)`},d={transform:`scale(${o.zoom})`},p={transform:`translate(${n.x}px, ${n.y}px)`},f={width:`${i.width}px`,height:`${i.height}px`,backgroundColor:r};return(0,s.jsx)("div",{className:"layout-debugger",style:c,children:(0,s.jsxs)("span",{className:"drag-sim",style:p,children:[(0,s.jsx)(t.PosDebugger,{pos:n}),(0,s.jsx)("div",{className:"layout-debugger-zoom-wrapper",style:d,children:(0,s.jsx)("div",{className:"layout-debugger-inner",style:f})})]})})};const c=(()=>{try{return"true"===localStorage.getItem("pos-debugger")}catch(e){return!1}})();t.LayoutDebugger=e=>{const{extraDebug:n,vp:o,node:d,mousePos:p}=e;if(!c)return null;const f=n.map(((e,n)=>(0,i.createElement)(t.LayoutDebuggerItem,{...e,key:n}))),m=[...d.instances.map((e=>e.pos)),...(0,r.values)(d.inputsPosition),...(0,r.values)(d.outputsPosition)].map((e=>(0,s.jsx)(t.LayoutDebuggerItem,{pos:e,viewPort:o,size:{width:0,height:0},color:"red"}))),v=(0,u.logicalPosToRenderedPos)(p,o),h=(0,s.jsxs)("div",{className:"viewport-data",children:[(0,s.jsxs)("div",{children:["Pos: ",(0,s.jsx)(l,{pos:o.pos})]}),(0,s.jsxs)("div",{children:["Zoom: ",o.zoom.toFixed(2)," "]}),(0,s.jsxs)("div",{children:["Mouse (logical): ",(0,s.jsx)(l,{pos:p})]}),(0,s.jsxs)("div",{children:["Rendered (rendered): ",(0,s.jsx)(l,{pos:v})]})]});return(0,s.jsxs)(a.default.Fragment,{children:[h,f,m]})}},44338:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(17841),t)},38259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateInstancesWithSingleConstPinsMap=t.getLeafInstancesOfSelection=void 0;t.getLeafInstancesOfSelection=(e,t,n)=>e.reduce(((e,o)=>[...e,...n.filter((e=>e.to.insId===o.id)).map((e=>t.find((t=>t.id===e.from.insId)))).filter((e=>!!e))]),[]).filter((t=>1===n.filter((e=>e.from.insId===t.id||e.to.insId===t.id)).length&&!e.includes(t)));t.calculateInstancesWithSingleConstPinsMap=(e,t)=>{const{connections:n}=e;return n.filter((e=>t.has(e.from.insId))).reduce(((e,n)=>{const o=t.get(n.from.insId),i=n.to.insId,s=e.get(i)||new Map;return s.set(n.to.pinId,{val:o,insId:n.from.insId}),e.set(i,s),e}),new Map)}},37488:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeIoView=void 0;const a=n(35250),u=n(70079),l=s(n(70079)),c=n(74762),d=n(83234),p=r(n(26372)),f=n(50382),m=n(43490),v=n(66189),h=n(74762),g=n(30994),I=n(30653);t.NodeIoView=l.memo((function(e){const{viewPort:t,selected:n,pos:o,type:i,id:s,onDblClick:r,onRename:y,onDelete:b,onChangeInputMode:C,inputMode:_,onSelect:x,closest:N,onSetDescription:w,description:j,onMouseUp:P,onMouseDown:O,currentInsId:E}=e,{history:D,resetHistory:S,refreshHistory:M}=(0,v.useHistoryHelpers)(E,s,i),T=(0,m.usePrompt)(),k=l.useCallback((async()=>{const e=await T("Description?",j);w(i,s,e)}),[T,j,w,i,s]),R=l.useCallback((()=>{b&&b(i,s)}),[i,s,b]),A=l.useCallback((()=>{y&&y(i,s)}),[i,s,y]),V=l.useCallback((e=>{C&&C(s,e)}),[s,C]),$=l.useCallback((()=>[{text:`Current mode - ${_}`,onClick:c.noop},{text:"Make required",onClick:()=>V("required")},{text:"Make optional",onClick:()=>V("optional")},{text:"Make required-if-connected",onClick:()=>V("required-if-connected")},{text:"Set description",onClick:k},...e.onRename?[{text:"Rename",onClick:A}]:[],...e.onDelete?[{text:"Delete",onClick:R}]:[]]),[k,_,V,R,A,e.onDelete,e.onRename]),z=l.useCallback((t=>{r&&r(e.id,t)}),[r,e.id]),H=l.useCallback((()=>{x(s,i)}),[s,i,x]),G=l.useCallback((()=>(0,a.jsx)(f.Menu,{children:$().map(((e,t)=>(0,u.createElement)(f.MenuItem,{...e,key:t})))})),[$]),L="input"===i?(0,h.getInputName)(s):(0,c.getOutputName)(s),F=l.useCallback((e=>{P(s,i,e)}),[s,P,i]),B=l.useCallback((e=>{O(s,i,e)}),[s,O,i]),q=(0,I.useDarkMode)();return(0,a.jsx)(d.BaseNodeView,{className:(0,p.default)("node-io-view",i,{dark:q}),pos:o,onDragEnd:(n,o)=>{const r=e.pos,a=(o.x-r.x)/t.zoom,u=(o.y-r.y)/t.zoom,l=r.x+a,c=r.y+u;e.onDragEnd(i,s,n,{...o,x:l,y:c})},onDragStart:(t,n)=>{e.onDragStart(s,t,n)},onDragMove:(t,n)=>{e.onDragMove(i,s,t,{x:n.x,y:n.y})},viewPort:t,children:(0,a.jsx)(l.Fragment,{children:(0,a.jsx)(f.Tooltip,{content:(()=>{const t=(0,v.calcHistoryContent)(D),n=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:L})," (",i,")"," "]}),n,(0,a.jsx)("hr",{}),t]})})(),children:(0,a.jsx)(f.ContextMenu,{onMouseEnter:M,onMouseOut:S,onMouseUp:F,onMouseDown:B,"data-tip":"","data-html":!0,"data-for":s+e.currentInsId,className:(0,p.default)("node-io-view-inner",{closest:N,selected:n,dark:q}),id:(0,g.getPinDomId)({fullInsIdPath:(0,c.fullInsIdPath)(e.currentInsId,e.ancestorInsIds),pinId:s,pinType:i,isMain:!0}),onClick:H,onDoubleClick:z,content:G(),children:s})})})})}))},66005:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37488),t)},83782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcNodeIoWidth=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0,t.PIECE_HORIZONTAL_PADDING=15,t.PIECE_CHAR_WIDTH=9,t.MIN_WIDTH_PER_PIN=40;t.calcNodeIoWidth=e=>Math.max(t.MIN_WIDTH_PER_PIN,e.length*t.PIECE_CHAR_WIDTH+2*t.PIECE_HORIZONTAL_PADDING)},99942:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderVisualNode=t.layoutToInstances=void 0;const i=n(63521),s=n(74762),r=n(90794),a=o(n(53865)),u=n(83782),l=n(60190),c=n(53159),d=n(41032);t.layoutToInstances=(e,t)=>(0,a.default)(t,(t=>{(0,s.entries)(e.nodes).forEach((e=>{let[n,o]=e;if(n.startsWith("ins-")){const e=n.replace("ins-",""),i=t.instances.find((t=>t.id===e));i?i.pos=o.p:console.warn("WAT")}if(n.startsWith("node-input-")){const e=n.replace("node-input-","");t.inputsPosition[e]=o.p}if(n.startsWith("node-output-")){const e=n.replace("node-output-","");t.outputsPosition[e]=o.p}}))}));t.orderVisualNode=(e,n,o,a)=>{const{instances:p,connections:f}=e,m={...p.reduce(((e,t)=>{const o=(0,l.size)((0,c.calcNodeWidth)(t,(0,d.safelyGetNodeDef)(t,n)),i.NODE_HEIGHT);return{...e,[`ins-${t.id}`]:{p:t.pos,s:o}}}),{}),...(0,s.okeys)(e.inputsPosition).reduce(((t,n)=>({...t,[`node-input-${n}`]:{p:e.inputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{}),...(0,s.okeys)(e.outputsPosition).reduce(((t,n)=>({...t,[`node-output-${n}`]:{p:e.outputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{})},v=f.map((e=>[(0,s.isExternalConnectionNode)(e.from)?`node-input-${e.from.pinId}`:`ins-${e.from.insId}`,(0,s.isExternalConnectionNode)(e.to)?`node-output-${e.to.pinId}`:`ins-${e.to.insId}`])),h=(0,r.orderLayout)({nodes:m,edges:v},o,((n,o)=>{a&&a((0,t.layoutToInstances)(n,e),o)}));return(0,t.layoutToInstances)(h,e)}},90794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderLayout=void 0;const o=n(60190),i=400,s=e=>e.reduce(((e,t)=>{const n=(0,o.vSub)(t.p,(0,o.vec)(t.s.width/2,t.s.height/2));return{...e,[t.id]:{p:n,s:t.s}}}),{});t.orderLayout=(e,t,n)=>{let{nodes:r,edges:a}=e,u=Object.entries(r).map((e=>{let[t,n]=e;return{id:t,p:(0,o.vAdd)(n.p,(0,o.vec)(n.s.width/2,n.s.height/2)),f:(0,o.vec)(0,0),v:(0,o.vec)(0,0),m:1,s:n.s}})),l=0;for(;l.01);){let e=u;for(let t=0;t{let n=e.find((e=>e.id===t[0])),i=e.find((e=>e.id===t[1]));if(!n||!i)return void console.warn("weoops",t[0],t[1]);const s=(0,o.vec)(0,-200),r=(0,o.vSub)(n.p,i.p),a=(0,o.vSub)(s,r),u=1e3*(0,o.vLen)(a),l=(0,o.vMul)((0,o.vNorm)(a),.5*u),c=(0,o.vMul)((0,o.vNorm)(a),-.5*u);n.f=(0,o.vAdd)(n.f,l),i.f=(0,o.vAdd)(i.f,c)})),e=e.map((e=>(0,o.itrPhysics)(15,e))),e=e.map((e=>{const t=(0,o.vMul)(e.v,.5),n=(0,o.vLen)(t)>100?(0,o.vMul)((0,o.vNorm)(t),100):t;return{...e,v:n}})),u=e,n&&n({nodes:s(e),edges:a},l),l++}return{nodes:s(u),edges:a,itrs:l,timeout:l>=t,total:(0,o.totalEnergy)(u)}}},2036:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PinView=t.PIN_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=n(50382),d=n(18420),p=n(74762),f=n(30994),m=n(96233),v=n(66189),h=n(30653);t.PIN_HEIGHT=23;t.PinView=u.memo((function(e){const{selected:t,type:n,connected:o,optional:i,currentInsId:s,isClosestToMouse:r,id:g,onMouseDown:I,onMouseUp:y}=e,{history:b,resetHistory:C,refreshHistory:_}=(0,v.useHistoryHelpers)(s,g,n),x=(0,h.useDarkMode)(),N="input"===n?(0,p.getInputName)(g):(0,p.getOutputName)(g),w="input"===e.type&&(0,d.isDefined)(e.constValue)?e.constValue:void 0,j=u.useCallback((e=>{0===e.button&&I(g,n,e)}),[g,n,I]),P=u.useCallback((e=>{0===e.button&&y(g,n,e)}),[g,n,y]);return(0,a.jsxs)("div",{className:(()=>{if("input"===e.type){const{isSticky:s,constValue:a}=e;return(0,l.default)("pin",{sticky:s,selected:t,closest:r,optional:i,connected:o,"const-value":(0,d.isDefined)(a),"env-value":(0,d.isDefined)(a)&&(0,p.isEnvValue)(a),minimized:e.minimized,dark:x},n)}return(0,l.default)("pin",{selected:t,connected:o,closest:r,optional:i,minimized:e.minimized,"error-pin":g===p.ERROR_PIN_ID,dark:x},n)})(),"data-pin-id":g,children:[(0,a.jsx)(c.Tooltip,{className:"pin-info-tooltip",content:(()=>{const t=(0,v.calcHistoryContent)(b,"input"===n?e.queuedValues:void 0),o=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:N})," (",n,")"," "]}),o,(0,a.jsx)("hr",{}),(0,d.isDefined)(w)?(0,a.jsxs)("div",{children:["Static value:"," ",(0,a.jsx)("strong",{children:(0,m.valuePreview)(w).substring(0,200)})]}):t]})})(),children:(0,a.jsxs)(c.ContextMenu,{onMouseEnter:_,onMouseOut:C,onMouseDown:j,onMouseUp:P,"data-tip":"","data-html":!0,"data-for":g+e.currentInsId,id:(0,f.getPinDomId)({fullInsIdPath:(0,p.fullInsIdPath)(e.currentInsId,e.ancestorsInsIds),pinId:g,pinType:n,isMain:!1}),onDoubleClick:t=>e.onDoubleClick&&e.onDoubleClick(g,t),className:(0,l.default)("pin-inner",{dark:x}),onClick:t=>{const{onShiftClick:o,onClick:i,id:s}=e;t.shiftKey&&o?o(s,t):i(s,n,t)},content:(()=>{const t=(0,a.jsx)(c.MenuItem,{onClick:()=>e.onInspect(e.currentInsId,{id:e.id,type:e.type}),text:"Inspect"});if("input"===e.type){const{onConvertConstToEnv:n}=e;return(0,d.isDefined)(w)?(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onDetachConstValue(e.id),text:"Detach value"}),(0,a.jsx)(c.MenuItem,{onClick:()=>e.onCopyConstValue(e.id),text:"Copy value"}),(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null,n?(0,a.jsx)(c.MenuItem,{onClick:()=>n(e.id),text:"Convert to Env Var"}):null]}):(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onToggleSticky(e.id),text:"Toggle sticky (square means sticky)"}),t,(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null]})}return(0,a.jsx)(c.Menu,{children:t})})(),children:[N," ",(0,d.isDefined)(w)?(0,a.jsxs)(u.Fragment,{children:[":",(0,a.jsx)("span",{className:"value",children:(0,d.toString)(w)})]}):null,"input"===e.type&&e.isSticky?(0,a.jsx)("span",{className:"suffix",children:"s"}):null,"input"===e.type&&e.queueSize?(0,a.jsxs)("span",{className:"suffix",children:[e.queueSize," in Q"]}):null]})}),(0,a.jsx)("div",{className:"wire"})]})}))},66189:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHistoryHelpers=t.calcHistoryContent=void 0;const i=n(35250),s=n(96233),r=o(n(70079)),a=n(70079),u=n(98158);t.calcHistoryContent=(e,t)=>{if(e){const{total:n,lastSamples:o}=e,a=(0,i.jsxs)("strong",{children:["Activated ",n," times this session"]}),u=o.length>0?(0,i.jsxs)("div",{children:["Last value:"," ",(0,i.jsx)("strong",{children:(0,s.valuePreview)(o[0].val).substring(0,200)}),(0,i.jsx)("br",{}),(0,i.jsx)("em",{children:"Inspect instance for the full value"})]}):"",l=t?(0,i.jsx)(r.default.Fragment,{children:(0,i.jsxs)("div",{children:["Queued values: ",(0,i.jsx)("strong",{children:t})]})}):"";return(0,i.jsxs)(r.default.Fragment,{children:[a,u,l]})}return"Loading session data.."};t.useHistoryHelpers=(e,t,n)=>{const o=(0,a.useRef)(),{onRequestHistory:i}=(0,u.useDebuggerContext)(),[s,l]=(0,a.useState)();return{history:s,refreshHistory:(0,a.useCallback)((()=>{clearInterval(o.current),i(e,t,n).then((e=>{l(e)})),o.current=setInterval((()=>{i(e,t,n).then((e=>{l(e)}))}),500)}),[e,i,t,n]),resetHistory:r.default.useCallback((()=>{clearInterval(o.current),l(void 0)}),[])}}},89440:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAddMenu=void 0;const r=n(35250),a=s(n(70079)),u=n(74762),l=n(50382),c=n(70457),d=n(9958),p=n(86125),f=c.Select.ofType(),m=e=>{switch(e.type){case"node":return`${e.node.id}`;case"value":return"Add inline value or function";case"import":return`Import ${e.importableNode.node.id} from ${e.importableNode.module}`}},v=(e,t)=>{let{handleClick:n,modifiers:o,query:i}=t;if(!o.matchesPredicate)return null;const s=m(e);return"value"===e.type?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(l.MenuDivider,{}),(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))]}):(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))},h=(e,t,n,o)=>{const i=m(t).toLocaleLowerCase(),s=e.toLowerCase();return o?i===s:i.includes(s)};t.QuickAddMenu=e=>{const{resolvedDependencies:t,targetNode:n}=e,o={left:e.pos.x,top:e.pos.y},{onRequestImportables:i}=(0,p.useDependenciesContext)(),[s,c]=a.useState();a.useEffect((()=>{i().then((e=>c(e.importables)))}),[i]);const d=(0,u.values)({...t,[n.id]:n}),m=d.map((e=>({type:"node",node:e}))),g=new Set(d.map((e=>e.id))),I=s?s.filter((e=>!g.has(e.node.id))).map((e=>({type:"import",importableNode:e}))):[],y=m.concat(I).concat({type:"value"});return(0,r.jsx)("div",{className:"quick-add-menu",style:o,children:(0,r.jsx)(f,{className:"quick-add-nodes-select",items:y,itemPredicate:h,itemRenderer:v,inputProps:{className:"quick-add-input"},noResults:(0,r.jsx)(l.MenuItem,{disabled:!0,text:"No results."}),onItemSelect:t=>e.onAdd(t),popoverProps:{isOpen:!0,onClose:()=>e.onClose()}})})}},71033:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89440),t)},73470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimePlayer=void 0;const o=n(74762),i=n(64955),s=(0,o.debugLogger)("runtime-player");t.createRuntimePlayer=()=>{let e=0,t=[];let n=!1,r=Date.now(),a=e;const u=()=>requestAnimationFrame((()=>{const l=Date.now();a=e,e+=l-r,r=l,((e,n)=>{const r=t;t=[],r.length&&s(`Playing ${r.length} events from`,e,n),r.forEach((e=>{s("Playing event",e),(0,i.playEvent)(e),e.insId===o.ROOT_INS_ID&&e.type===o.DebuggerEventType.PROCESSING_CHANGE&&!1===e.val&&(s("Main instance is done processing, clearing runtime UI",e),c())}))})(a,e),n&&u()})),l=()=>{n=!1},c=()=>{document.querySelectorAll("[data-runtime]").forEach((e=>{e.removeAttribute("data-runtime")})),document.querySelectorAll("[data-runtime-queue]").forEach((e=>{e.removeAttribute("data-runtime-queue")})),t=[]};return{stop:l,start:function(t){void 0===t&&(t=0),n=!0,e=t,r=Date.now(),u()},addEvents:e=>{t.push(...e)},destroy:()=>{l(),c()},clear:c,status:()=>({running:n,currDt:e,lastDt:a,queue:t,last:r})}}},64955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playEvent=t.cancelTimers=void 0;const o=n(74762),i=n(30994),s=5e3,r=(0,o.debugLogger)("runtime-player:play-event"),a=(e,t)=>e.type===o.DebuggerEventType.INPUT_CHANGE||e.type===o.DebuggerEventType.OUTPUT_CHANGE?`${(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds)}.${e.pinId}`:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds);t.cancelTimers=new Map;t.playEvent=e=>{switch(e.type){case o.DebuggerEventType.INPUT_CHANGE:case o.DebuggerEventType.OUTPUT_CHANGE:{const{pinId:n,insId:u,ancestorsInsIds:l}=e,c=e.type===o.DebuggerEventType.INPUT_CHANGE?"input":"output",d=[(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!0})];u!==o.ROOT_INS_ID&&d.push((0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!1})),d.forEach(((i,l)=>{const c=a(e);clearTimeout(t.cancelTimers.get(c));const d=document.getElementById(i),p=`${u}.${n}`,f=e.type===o.DebuggerEventType.OUTPUT_CHANGE?document.querySelectorAll(`[data-from-id="${p}"]`):[];if(d){clearTimeout(t.cancelTimers.get(c)),d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),setTimeout((()=>{d.setAttribute("data-runtime","active"),f.forEach((e=>{e.setAttribute("data-runtime","active")}))}),0);const n=setTimeout((()=>{d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),t.cancelTimers.delete(c)}),s);t.cancelTimers.set(a(e),n)}else console.warn(`No DOM element with Id [${i}] found to play event`),r(`No DOM element with Id [${i}] found to play event`,e)}));break}case o.DebuggerEventType.PROCESSING_CHANGE:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(l)if(!0===e.val)l.setAttribute("data-runtime","processing"),clearTimeout(t.cancelTimers.get(u));else{l.removeAttribute("data-runtime"),setTimeout((()=>{"error"!==l.getAttribute("data-runtime")&&l.setAttribute("data-runtime","done")}),0);const e=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,e)}else r(`No DOM element with Id [${n}] found to play event`,e)}));break}case o.DebuggerEventType.ERROR:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(!l)return void r(`No DOM element with Id [${n}] found to play event`,e);clearTimeout(t.cancelTimers.get(u)),l.removeAttribute("data-runtime"),setTimeout((()=>{l.setAttribute("data-runtime","error")}));const c=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,c)}));const c={...e,type:o.DebuggerEventType.OUTPUT_CHANGE,pinId:o.ERROR_PIN_ID};(0,t.playEvent)(c);break}case o.DebuggerEventType.INPUTS_STATE_CHANGE:(0,o.entries)(e.val).forEach((t=>{let[n,s]=t;const{insId:a,ancestorsInsIds:u}=e,l=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(a,u),pinId:n,pinType:"input",isMain:!1}),c=document.getElementById(l);c?s>0?c.setAttribute("data-runtime-queue",`${s}`):c.removeAttribute("data-runtime-queue"):r(`No DOM element with Id [${l}] found to play event`,e)}))}}},25804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounce=void 0;const o=n(70079);t.useDebounce=function(e,t){const[n,i]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}},7047:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.handleChangeNodeInputType=t.handleIoPinRename=t.handleInstanceDrag=t.getInstancesInRect=t.isJsxValue=t.getMiddleOfViewPort=t.fitViewPortToNode=t.centerBoardPosOnTarget=t.renderedPosToLogicalPos=t.logicalPosToRenderedPos=t.getEffectiveNodeDimensions=t.calcNodesPositions=t.calcSelectionBoxArea=t.animateViewPort=t.easeInOutNum=t.easeInOutPos=t.easeInOutQuad=t.center=t.distance=t.clamp=t.domToViewPort=t.roundNumber=t.createNewNodeInstance=t.createNewInlineNodeInstance=t.parseInputOutputTypes=t.parsePromptValue=t.getSelectionBoxRect=t.findClosestPin=t.changePinConfig=t.getInstancePinConfig=t.emptyList=t.emptyObj=void 0;const r=s(n(53865)),a=n(30721),u=n(63521),l=n(74762),c=n(18243),d=n(74762),p=n(53159),f=n(83782),m=n(60190),v=n(38259),h=n(83651),g=n(41032);t.emptyObj={},t.emptyList=[],t.getInstancePinConfig=function(e,n,o){var i;const s=e.instances.find((e=>e.id===n));if(!s)throw new Error(`Instance ${n} not found`);return null!==(i=(s.inputConfig||t.emptyObj)[o])&&void 0!==i?i:(0,l.queueInputPinConfig)()};t.changePinConfig=(e,t,n,o)=>r.produce(e,(e=>{var i;const{instances:s}=e,r=s.find((e=>e.id===t));if(!r)throw new Error("blah");const a=null!==(i=r.inputConfig)&&void 0!==i?i:{};a[n]=o,e.instances=s.map((e=>e===r?{...r,inputConfig:a}:e))}));t.findClosestPin=(e,t,n,o,i,s,r)=>{const a=(0,l.nodeInstance)(e.id,e.id),u=(0,d.okeys)(e.inputs).map((e=>({id:e,type:"input",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),p=(0,d.okeys)(e.outputs).map((e=>({id:e,type:"output",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),f=[...u,...e.instances.reduce(((n,a)=>{const u=(0,g.safelyGetNodeDef)(a,t),d=(0,h.getVisibleInputs)(a,u,e.connections),p=(0,h.getVisibleOutputs)(a,u,e.connections);return[...n,...d.map((e=>({ins:a,type:"input",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!1}),id:e}))),...p.map((e=>({ins:a,type:"output",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!1}),id:e})))]}),[]),...p];let m={dis:1e5,item:f[0]};return f.forEach((e=>{const t=e.pos.x-n.x,o=e.pos.y-n.y,i=Math.sqrt(t*t+o*o);i{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x,t.x)-n,h:Math.max(e.y,t.y)-o}};t.parsePromptValue=e=>{if(null===e)return;const t=parseInt(e,10);let n=e;return t.toString()!=e||isNaN(t)||(n=t),n};t.parseInputOutputTypes=e=>{const[,t,n]=e.match(/node\((.+)\|(.+)\)/)||[],o=(0,d.entries)(JSON.parse(t)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]})),i=(0,d.entries)(JSON.parse(n)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]}));return{inputs:(0,d.fromEntries)(o),outputs:(0,d.fromEntries)(i)}};t.createNewInlineNodeInstance=function(e,t,n){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const o=(0,l.inlineNodeInstance)(`${e.id}-${(0,d.randomInt)(999)}`,e,{},{x:0,y:0}),i=(0,p.calcNodeWidth)(o,e),{x:s,y:r}=n,a={x:s-i/2,y:r+t};return{...o,pos:a}};t.createNewNodeInstance=function(e,t,n,o){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const i="string"==typeof e?(0,g.safelyGetNodeDef)(e,o):e;if(!i)throw new Error(`${e} node not found in resolvedNodes`);const s=(0,d.entries)(i.inputs).reduce(((e,t)=>{let[n,o]=t;return o.defaultValue&&(e[n]=(0,l.staticInputPinConfig)(o.defaultValue)),e}),{}),r=(0,l.nodeInstance)((0,a.createId)(),i.id,s,{x:0,y:0}),c=(0,p.calcNodeWidth)(r,i),{x:f,y:m}=n,v={x:f-c/2,y:m+t};return{...r,pos:v}};t.roundNumber=e=>Math.round(100*e)/100;t.domToViewPort=(e,n,o)=>({x:(0,t.roundNumber)(n.pos.x+e.x/n.zoom/o.zoom),y:(0,t.roundNumber)(n.pos.y+e.y/n.zoom/o.zoom)});t.clamp=(e,t,n)=>Math.max(e,Math.min(t,n));t.distance=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)};t.center=(e,t,n)=>{let{zoom:o}=n;const i=e.x+e.w/2,s=e.y+e.h/2,{w:r,h:a}=t;return{x:i-r/o/2,y:s-a/o/2}};t.easeInOutQuad=e=>e<.5?2*e*e:(4-2*e)*e-1;t.easeInOutPos=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i),a=(0,t.easeInOutQuad)(r),u=n.x-e.x,l=n.y-e.y;return{x:e.x+u*a,y:e.y+l*a}};t.easeInOutNum=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i);return e+(n-e)*(0,t.easeInOutQuad)(r)};t.animateViewPort=(e,n,o,i)=>{const s=(0,t.distance)(e.pos,n.pos),r=Date.now(),a=o;if(0===s)return void i(e);const u=()=>{const o=Date.now(),s=(0,t.easeInOutPos)(e.pos,n.pos,r,a,o),l=(0,t.easeInOutNum)(e.zoom,n.zoom,r,a,o);o-r{const n=(0,t.getSelectionBoxRect)(e.from,e.to);return n.h*n.w};const I=(e,t,n,o)=>({left:n.x,right:n.x+e,top:n.y,bottom:n.y+t,tag:o,center:(0,l.calcCenter)({w:e,h:t,...n})});t.calcNodesPositions=(e,t)=>[...e.instances.map((e=>{const n=(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,t)),o=u.NODE_HEIGHT;return I(n,o,e.pos,e.id)})),...(0,d.okeys)(e.inputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.inputsPosition[t]||{x:0,y:0};return I(n,o,i,"input_"+t)})),...(0,d.okeys)(e.outputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.outputsPosition[t]||{x:0,y:0};return I(n,o,i,"output"+t)}))];t.getEffectiveNodeDimensions=(e,n)=>{const o=(0,t.calcNodesPositions)(e,n),i=o[0]||{left:0,right:0,top:0,bottom:0},s=o.reduce(((e,t)=>t.leftt.right>e?t.right:e),i.right),a=o.reduce(((e,t)=>t.topt.bottom>e?t.bottom:e),i.bottom)-a,d={x:s,y:a};return{size:{width:u,height:c},pos:d,center:(0,l.calcCenter)({w:u,h:c,...d})}};t.logicalPosToRenderedPos=(e,t)=>{const n=(0,m.vSub)(e,t.pos);return(0,m.vMul)(n,t.zoom)};t.renderedPosToLogicalPos=(e,t)=>{const n=(0,m.vDiv)(e,t.zoom);return(0,m.vAdd)(t.pos,n)};t.centerBoardPosOnTarget=(e,n,o,i)=>{const s=(0,t.logicalPosToRenderedPos)(e,i),r=(0,t.renderedPosToLogicalPos)(s,{...i,zoom:o}),a=Math.max(e.x,r.x)-Math.min(e.x,r.x),u=Math.max(e.y,r.y)-Math.min(e.y,r.y);return{x:o>i.zoom?i.pos.x+a:i.pos.x-a,y:o>i.zoom?i.pos.y+u:i.pos.y-u}};t.fitViewPortToNode=function(e,n,o,i){void 0===i&&(i=[20,150]);const{size:s,center:r}=(0,t.getEffectiveNodeDimensions)(e,n),a=i[0],u=i[1],l=s.width+a,c=s.height+u,d=o.width/l,p=o.height/c,f=Math.min(d,p)/1.15,m=(0,t.clamp)(.3,1.2,f);return{zoom:m,pos:{x:r.x-o.width/2/m,y:r.y-o.height/2/m+20}}};t.getMiddleOfViewPort=(e,n)=>{const o={x:n.width/2,y:n.height/2};return(0,t.renderedPosToLogicalPos)(o,e)};t.isJsxValue=e=>{const t=e=>(0,d.isDefined)(e.ref)&&(0,d.isDefined)(e.type)&&(0,d.isDefined)(e.props);try{const n=JSON.parse(e);return t(n)||Array.isArray(n)&&t(n[0])}catch(n){return!1}};t.getInstancesInRect=(e,n,o,i,s,r,a)=>{const{from:c,to:d}=e,f=(0,t.getSelectionBoxRect)(c,d);return s.filter((e=>{const{pos:t}=e,i={...t,w:(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,n))*o.zoom*a.zoom,h:u.NODE_HEIGHT*o.zoom*a.zoom};return(0,l.intersectRect)(f,i)||(0,l.intersectRect)(i,f)})).map((e=>e.id))};t.handleInstanceDrag=(e,t,n,o,i,s)=>{o.preventDefault(),o.stopPropagation();const a=(0,m.vSub)(n,t.pos);let u;const l=r.produce(e,(e=>{const r=e.instances.find((e=>e.id===t.id));if(!r)throw new Error("impossible state dragging instance that does not exist");!o.shiftKey&&s&&(u=[s]);const l=e.instances.filter((e=>i.includes(e.id)&&e!==r)),c=[r,...l],d=(0,v.getLeafInstancesOfSelection)(c,e.instances,e.connections);[...l,...d].forEach((e=>{e.pos=(0,m.vAdd)(e.pos,a)})),r.pos=n,!o.shiftKey&&s&&(u=[s])}));return{newValue:l,newSelected:u}};t.handleIoPinRename=(e,t,n,o)=>r.produce(e,(e=>{"input"===t?(e.inputs[o]=e.inputs[n],e.inputsPosition[o]=e.inputsPosition[n],delete e.inputs[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===n?{...e,from:{...e.from,pinId:o}}:e))):(e.outputs[o]=e.outputs[n],e.outputsPosition[o]=e.outputsPosition[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===n?{...e,to:{...e.to,pinId:o}}:e)),e.completionOutputs=(e.completionOutputs||[]).map((e=>e.split("+").map((e=>e===n?o:n)).join("+"))),delete e.outputs[n])}));t.handleChangeNodeInputType=(e,t,n)=>r.produce(e,(e=>{const o=e.inputs[t];if(!o)throw new Error("Wat");o.mode=n}))},42403:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorClient=void 0;const i=n(74762),s=o(n(18706)),r=n(32048),a=n(31758),u=(0,i.debugLogger)("remote-debugger:editor-client");t.createEditorClient=(e,t)=>{const n=new URL(e),o=(0,r.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/editor`,timeout:3e4});return o.emit("join-room-editor",t),{emitChange:e=>{o.emit(a.DebuggerServerEventType.CHANGE_EVENT_NAME,e)},emitBreakpointsChange:e=>{o.emit(a.DebuggerServerEventType.UPDATE_BREAKPOINTS,e)},interceptInput:e=>{o.emit(a.DebuggerServerEventType.INPUT_VALUE_OVERRIDE,e)},interceptOutput:e=>{o.emit(a.DebuggerServerEventType.OUTPUT_VALUE_OVERRIDE,e)},onRuntimeReady:e=>(o.on(a.DebuggerServerEventType.RUNTIME_READY,e),()=>o.off(a.DebuggerServerEventType.RUNTIME_READY,e)),onChangeAwk:e=>(o.on(a.DebuggerServerEventType.CHANGE_AWK,e),()=>o.off(a.DebuggerServerEventType.CHANGE_AWK,e)),onChangeError:e=>(o.on(a.DebuggerServerEventType.CHANGE_ERROR,e),()=>o.off(a.DebuggerServerEventType.CHANGE_ERROR,e)),onIsAlive:e=>(o.on(a.DebuggerServerEventType.IS_ALIVE,e),()=>o.off(a.DebuggerServerEventType.IS_ALIVE,e)),emitInputValue:(e,t)=>{u(`Emitting push input value to ${e} %o`,t),o.emit(a.DebuggerServerEventType.PUSH_INPUT_VALUE,{pinId:e,value:t})},destroy:()=>{o.disconnect(),(0,a.enumToArray)(a.DebuggerServerEventType).forEach((e=>o.off(e)))},onDisconnect:e=>(o.on("disconnect",e),()=>o.off("disconnect",e)),debugInfo:()=>`Remote debugger for ${e}`,onBatchedEvents:e=>(o.on(a.DebuggerServerEventType.EVENTS_BATCH,e),()=>o.off(a.DebuggerServerEventType.EVENTS_BATCH,e)),requestState:()=>s.default.get(`${e}/state`).then((e=>e.data.state)),getHistory:n=>s.default.get(`${e}/history`,{params:{insId:n.insId,pinId:n.pinId,limit:n.limit,executionId:t}}).then((e=>e.data)),clearHistory:()=>s.default.delete(`${e}/history`).then((()=>{})),triggerNode:(t,n)=>s.default.post(`${e}/trigger`,{nodeId:t,inputs:n}).then((e=>e.data))}}},58066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeData=void 0;const o=n(74762),i=n(36783),s=(0,o.debugLogger)("remote-debugger:normalize-data");t.normalizeData=e=>{if(e instanceof Error)return(0,i.serializeError)(e);if("object"==typeof e&&null!==e){e={...e};const t=new WeakSet,n=e=>{if("bigint"==typeof e)return e.toString();if("object"!=typeof e||Array.isArray(e))return e;if(null===e)return e;if(t.has(e))return"[Circular]";try{t.add(e)}catch(o){s("Error adding to WeakSet","data:",e,"type:",typeof e,"error:",o)}if(Array.isArray(e))return e.map(n);if("object"==typeof e){const t={};for(const o in e)t[o]=n(e[o]);return t}return e};return n(e)}return e}},39641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimeClient=t.DEFAULT_DT_SCALE=void 0;const o=n(74762),i=n(32048),s=n(31758),r=n(58066),a=(0,o.debugLogger)("remote-debugger:runtime-client");t.DEFAULT_DT_SCALE=1;t.createRuntimeClient=(e,t)=>{const n=new URL(e),u=(0,i.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/runtime`,timeout:1e3,reconnectionAttempts:3});u.emit("join-room-runtime",t),u.on("connection",(e=>{e.join(t)}));let l=new Set;u.on(s.DebuggerServerEventType.UPDATE_BREAKPOINTS,(e=>{l=new Set(e)}));const c=(0,o.cappedArrayDebounce)((e=>{a(`Emitting debounced batched events - ${e.length}`),u.emit(s.DebuggerServerEventType.EVENTS_BATCH,e)}),100,200);return{onChange:e=>(u.on(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e),()=>u.off(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e)),onInput:e=>(u.on(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e),()=>u.off(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e)),emitEvent:e=>{a(`Emitting event ${e.type} change event of ${e.insId}`),e.val=(0,r.normalizeData)(e.val),c.addItem({...e,time:Date.now()})},emitRuntimeReady:()=>{u.emit(s.DebuggerServerEventType.RUNTIME_READY,{})},emitChangeAwk:()=>{u.emit(s.DebuggerServerEventType.CHANGE_AWK,{})},emitChangeError:e=>{u.emit(s.DebuggerServerEventType.CHANGE_ERROR,{error:e})},emitIsAlive:e=>{u.emit(s.DebuggerServerEventType.IS_ALIVE,{time:e})},destroy:async()=>{c.pendingItems()&&(c.flush(),await(0,o.delay)(100)),(0,s.enumToArray)(s.DebuggerServerEventType).forEach((e=>u.off(e))),u.disconnect()},onDisconnect:e=>(u.on("disconnect",e),()=>u.off("disconnect",e)),waitForConnection:()=>new Promise(((e,t)=>{u.connected?e():(u.on("connect_error",(e=>{t(`Socket connect error: ${e}`)})),u.on("connect",(()=>{e()})))}))}}},31758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerServerEventType=t.enumToArray=t.isNumber=t.isSimpleType=t.valuePreview=t.toString=void 0;const o=n(36783);t.toString=e=>{if("object"===typeof e){if(e instanceof Error)return JSON.stringify((0,o.serializeError)(e));try{return JSON.stringify(e).substr(0,250)}catch(t){return"Object (cannot stringify)"}}return`${e}`.substr(0,250)};t.valuePreview=e=>(0,t.toString)(e).substr(0,100);t.isSimpleType=e=>["number","string","boolean"].includes(typeof e);t.isNumber=e=>!1===isNaN(Number(e)),t.enumToArray=function(e){return Object.keys(e).filter(t.isNumber).map((t=>e[t]))},function(e){e.RUNTIME_READY="runtime-ready",e.CHANGE_EVENT_NAME="change",e.PUSH_INPUT_VALUE="push-input-value",e.CHANGE_AWK="live-change-awk",e.CHANGE_ERROR="live-change-error",e.IS_ALIVE="is-alive",e.UPDATE_BREAKPOINTS="update-breakpoints",e.INPUT_VALUE_OVERRIDE="input-value-override",e.OUTPUT_VALUE_OVERRIDE="output-value-override",e.INPUT_VALUE_CHANGE="input-value-changed",e.OUTPUT_VALUE_CHANGE="output-value-changed",e.PROCESSING_CHANGE="processing-changed",e.INPUTS_STATE_CHANGE="inputs-state-changed",e.NODE_ERROR="node-error",e.EVENTS_BATCH="events-batch"}(t.DebuggerServerEventType||(t.DebuggerServerEventType={}))},96233:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31758),t),i(n(42403),t),i(n(39641),t)},43920:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Equals=t.EqualsBoolean=t.Throttle=t.ThrottleError=t.Debounce=t.Interval=t.Delay=t.Switch4=t.Switch2=t.Switch3=t.EmitOnTrigger=t.BooleanSplit=t.Subscribe=t.Publish=t.RoundRobin4=t.RoundRobin2=t.RoundRobin3=t.LimitTimes=void 0;const o=n(11253),i="Control Flow";t.LimitTimes={id:"Limit Times",namespace:i,description:"Item will be emitted until the limit is reached",inputs:{item:{mode:"required",description:"The item to emit"},times:{mode:"required",description:"The number of times to emit the item"},reset:{mode:"optional",description:"Reset the counter"}},outputs:{ok:{}},reactiveInputs:["item","reset"],completionOutputs:[],run:function(e,t,n){const{state:o}=n,{item:i,times:s,reset:r}=e,{ok:a}=t;if(void 0!==r)return void o.set("val",0);let u=o.get("val")||0;u++,o.set("val",u),u>=s?n.onError(new Error(`Limit of ${s} reached`)):a.next(i)}},t.RoundRobin3={id:"Round Robin 3",namespace:i,description:"Item will be emitted to one of the three outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r}=t,a=o.get("curr")||0,u=(a+1)%3;[i,s,r][a].next(e.item),o.set("curr",u)}},t.RoundRobin2={namespace:i,id:"Round Robin 2",description:"Item will be emitted to one of the 2 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s}=t,r=o.get("curr")||0,a=(r+1)%2;[i,s][r].next(e.item),o.set("curr",a)}},t.RoundRobin4={id:"Round Robin 4",namespace:i,description:"Item will be emitted to one of the 4 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves to "r4"\'s turn.'},r4:{description:'The fourth output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r,r4:a}=t,u=o.get("curr")||0,l=(u+1)%4;[i,s,r,a][u].next(e.item),o.set("curr",l)}},t.Publish={id:"Publish",namespace:i,description:"Publishes a value by a key to all listeners in the current flow. Use 'Subscribe' to listen to events.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},value:{mode:"required"}},outputs:{},run:function(e,t,n){const i=`${n.ancestorsInsIds}__${e.key}`;o.publish(i,e.value)}},t.Subscribe={id:"Subscribe",namespace:i,description:"Subscribes to a value published by a key. Use 'Publish' to publish values.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},initial:{mode:"required-if-connected",description:"If passed will be published has the first value"}},completionOutputs:[],outputs:{value:{description:"The value published by the key"}},run:function(e,t,n){const{value:i}=t,s=`${n.ancestorsInsIds}__${e.key}`,r=o.subscribe(s,((e,t)=>{i.next(t)}));void 0!==e.initial&&i.next(e.initial),n.onCleanup((()=>{o.unsubscribe(r)}))}},t.BooleanSplit={namespace:i,id:"Boolean Split",description:"Splits a boolean value into two outputs",inputs:{value:{mode:"required",description:"Boolean value"},trueValue:{mode:"required-if-connected",description:"Value to emit if the input is true. Defaults to true"},falseValue:{mode:"required-if-connected",description:"Value to emit if the input is false. Defaults to false"}},outputs:{true:{description:"The value is true"},false:{description:"The value is false"}},run:function(e,t){const{true:n,false:o}=t,{value:i,trueValue:s,falseValue:r}=e;i?n.next(null==s||s):o.next(null!=r&&r)}},t.EmitOnTrigger={namespace:i,id:"Emit on Trigger",description:"Emits the value when the trigger input receives any value",inputs:{value:{mode:"required",description:"The value to emit"},trigger:{mode:"required",description:"The trigger to emit the value"}},outputs:{result:{description:"The value emitted"}},run:function(e,t){const{result:n}=t,{value:o,trigger:i}=e;void 0!==i&&n.next(o)}},t.Switch3={namespace:i,id:"Switch 3",description:"Switches between 3 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,default:s,outputValue:r}=t,{value:a,firstCase:u,secondCase:l,thirdCase:c}=e;a===u?n.next(null!=r?r:a):a===l?o.next(null!=r?r:a):a===c?i.next(null!=r?r:a):s.next(null!=r?r:a)}},t.Switch2={id:"Switch 2",description:"Switches between 2 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,default:i,outputValue:s}=t,{value:r,firstCase:a,secondCase:u}=e;r===a?n.next(null!=s?s:r):r===u?o.next(null!=s?s:r):i.next(null!=s?s:r)}},t.Switch4={id:"Switch 4",description:"Switches between 4 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},fourthCase:{mode:"required",description:"The value to switch on for the fourth output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},fourth:{description:"The value emitted if the input value is equal to the fourth case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,fourth:s,default:r,outputValue:a}=t,{value:u,firstCase:l,secondCase:c,thirdCase:d,fourthCase:p}=e;u===l?n.next(null!=a?a:u):u===c?o.next(null!=a?a:u):u===d?i.next(null!=a?a:u):u===p?s.next(null!=a?a:u):r.next(null!=a?a:u)}},t.Delay={id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:i,description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:async(e,t)=>{let{value:n,delay:o}=e,{delayedValue:i}=t;await new Promise((e=>setTimeout(e,o))),i.next(n)}},t.Interval={id:"Interval",namespace:i,defaultStyle:{icon:"fa-clock"},description:"Emits a value every interval",inputs:{value:{description:"Value to emit"},interval:{description:"Interval in milliseconds"}},reactiveInputs:["value","interval"],outputs:{value:{description:"Emitted value"}},completionOutputs:[],run:(e,t,n)=>{n.state.get("timer")&&clearInterval(n.state.get("timer"));const o=setInterval((()=>{t.value.next(e.value)}),e.interval);n.state.set("timer",o),n.onCleanup((()=>{clearInterval(o)}))}},t.Debounce={id:"Debounce",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be debounced"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The debounced value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the last value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:s}=t,r=n.state.get("timer");r&&clearTimeout(r);const a=setTimeout((()=>{s.next(o)}),i);n.state.set("timer",a),n.onCleanup((()=>{clearTimeout(r)}))}};class s extends Error{constructor(e){super("Throttle: Value dropped"),this.value=e}}t.ThrottleError=s,t.Throttle={id:"Throttle",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be throttled"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The throttled value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the first value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:r}=t;if(n.state.get("timer"))n.onError(new s(o));else{r.next(o);const e=setTimeout((()=>{n.state.set("timer",null)}),i);n.state.set("timer",e)}}},t.EqualsBoolean={id:"Equals (Bool)",defaultStyle:{icon:"fa-equals"},namespace:i,description:"Emits true if two values are equal (=== equality). Otherwise emits false.",inputs:{a:{description:"First value"},b:{description:"Second value"}},outputs:{result:{description:"true if a is equal to b"}},run:(e,t)=>{let{a:n,b:o}=e,{result:i}=t;return i.next(n===o)}},t.Equals={id:"Equals",namespace:i,description:'Emits the value of "a" to output "true" if "a" is equal to "b". Otherwise emits the value of "a" to output "false".',inputs:{a:{mode:"required",description:"First value"},b:{mode:"required",description:"Second value"}},outputs:{true:{description:"Emits the value of a if a is equal to b"},false:{description:"Emits the value of a if a is not equal to b"}},run:(e,t)=>{const{a:n,b:o}=e,{true:i,false:s}=t;n===o?i.next(n):s.next(n)}}},65645:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var o=n(70079),i=n(11253),s=n(74089),r=n(74762),a=n(21766);var u=n(10831),l=n(61997),c=n(77852);const d=(0,a.S)(),p=[0,20],f=e=>{let{flow:t,output:n,inputs:o,onError:s,debugDelay:a,onCompleted:u,dependencies:l,player:c}=e;const p=((e,t)=>{const n=new Set;return{onEvent:o=>{const i={...o,time:Date.now(),executionId:"n/a"};console.info("Got debugger event",o),t.addEvents([i]),e.addEvents([i]),n.forEach((e=>e([i])))},onBatchedEvents:e=>(n.add(e),()=>n.delete(e))}})(c,d);p.debugDelay=a;const f=(0,r.keys)(t.node.outputs)[0];return{executeResult:(0,r.execute)({node:t.node,inputs:o,outputs:{[f]:n},resolvedDeps:{...l,[t.node.id]:t.node},_debugger:p,onCompleted:u,onBubbleError:e=>{s(e)},extraContext:{PubSub:i}}),localDebugger:p}},m=e=>{const{debugDelay:t,onOutput:i,flowProps:a}=e,{flow:m,inputs:v,output:h}=a,g=(0,o.useRef)((0,s.createRuntimePlayer)()),[I,y]=(0,o.useState)(e.flowProps.dependencies),[b,C]=(0,o.useState)(),[_]=(0,s.useDebounce)(I,500),x=(0,c.useDarkMode)(),N=async(e,t)=>{const{node:o}=e,i=Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).find((e=>(0,r.isBaseNode)(e)&&e.id===o.id));let a;y((e=>({...e,[i.id]:{...i,source:{path:"@flyde/stdlib/dist/all-browser",export:i.id}}})));const l=(0,u.ZP)(m,(n=>{if(t){const o=(0,s.vAdd)({x:0,y:0},t.pos);if(a=(0,s.createNewNodeInstance)(e.node,0,o,I),n.node.instances.push(a),t.connectTo){const{insId:e,outputId:o}=t.connectTo;n.node.connections.push({from:{insId:e,pinId:o},to:{insId:a.id,pinId:r.TRIGGER_PIN_ID}})}}}));await new Promise((e=>setTimeout(e,10)));const c=(0,u.ZP)(j,(e=>{e.flow=l,t?.selectAfterAdding&&a&&(e.boardData.selected=[a?.id])}));return P(c),(0,s.toastMsg)(`Node ${o.id} successfully imported from ${e.module}`),I},w=async()=>({importables:Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).filter(r.isBaseNode).map((e=>({node:{...e,source:{path:"n/a",export:"n/a"}},module:"@flyde/stdlib"}))),errors:[]}),[j,P]=(0,o.useState)({flow:m,boardData:{viewPort:{pos:{x:0,y:0},zoom:1},lastMousePos:{x:0,y:0},selected:[]}});(0,o.useEffect)((()=>{P((e=>({...e,flow:m})))}),[m]),(0,o.useEffect)((()=>{y((e=>({...e,main:j.flow.node})))}),[j.flow.node]);const O={state:j,onChangeEditorState:P,hideTemplatingTips:!0,initialPadding:p,onExtractInlineNode:r.noop,disableScrolling:!0,darkMode:x.isDarkMode};(0,o.useEffect)((()=>{g.current.start()}),[]),(0,o.useEffect)((()=>{const{executeResult:n,localDebugger:o}=f({flow:j.flow,dependencies:I,output:h,inputs:v,onError:r.noop,debugDelay:t,player:g.current,onCompleted:e.onCompleted}),s=e.flowProps.output.subscribe((e=>i(e)));return C(o),()=>{n(),s.unsubscribe()}}),[t,_]);const E=(0,o.useMemo)((()=>({resolvedDependencies:I,onImportNode:N,onRequestImportables:w})),[]),D=(0,o.useMemo)((()=>({debuggerClient:b,onRequestHistory:d.requestHistory})),[b]);return o.createElement(l.Z,null,(()=>o.createElement(s.DependenciesContextProvider,{value:E},o.createElement(s.DebuggerContextProvider,{value:D},o.createElement(s.FlowEditor,O)))))}},21766:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var o=n(74762);const i=200,s=()=>{const e=new Map,t=new Map;return{requestHistory:async(n,s,r)=>{const a="input"===r?o.DebuggerEventType.INPUT_CHANGE:o.DebuggerEventType.OUTPUT_CHANGE;if(console.log({insId:n,pinId:s,type:a}),s){const t=`${n}.${s}.${a}`,o=e.get(t)||{total:0,lastSamples:[]},r=o.lastSamples.slice(0,i);return{...o,lastSamples:r}}{const e=t.get(n)||{total:0,lastSamples:[]},o=e.lastSamples.slice(0,i);return{...e,lastSamples:o}}},addEvents:n=>{n.forEach((n=>{if(n.type===o.DebuggerEventType.ERROR){const e=n;e.type=o.DebuggerEventType.OUTPUT_CHANGE,e.pinId=o.ERROR_PIN_ID}if(n.type===o.DebuggerEventType.INPUT_CHANGE||n.type===o.DebuggerEventType.OUTPUT_CHANGE){const{insId:o,type:s,pinId:r}=n;{const t=`${o}.${r}.${s}`,a=e.get(t)||{total:0,lastSamples:[]};a.lastSamples.unshift(n),a.lastSamples.length>i&&a.lastSamples.splice(i,a.lastSamples.length-i),a.total++,e.set(t,a)}{const s=t.get(o)||{total:0,lastSamples:[]};s.lastSamples.unshift(n),s.lastSamples.length>i&&s.lastSamples.splice(i,s.lastSamples.length-i),s.total++,e.set(o,s)}}}))}}}},4144:(e,t,n)=>{"use strict";n.d(t,{V:()=>r});var o=n(10328),i=n(70079);const s=e=>i.createElement("li",{className:"log-item"},i.createElement("main",{className:"content"},e.value),i.createElement("aside",null,new Date(e.time).toLocaleTimeString())),r=e=>{const[t,n]=i.useState([]);return i.useEffect((()=>{e.output.subscribe((e=>{const t="object"==typeof e&&i.isValidElement(e)?e:`${e}`;n((e=>[...e,{value:t,time:Date.now()}]))}))}),[]),i.createElement("div",{className:"output-log"},i.createElement("header",null,"Output Log"," ",i.createElement("button",{className:"clear-btn button button--outline button--secondary button--sm",onClick:()=>n([])},"Clear")),i.createElement("main",null,i.createElement("ul",null,t.map(((e,t)=>i.createElement(s,(0,o.Z)({},e,{key:t}))))),0===t.length?i.createElement("div",{className:"empty-state"},"Nothing to show. Interact with the example to emit some outputs!"):null))}},79256:(e,t,n)=>{"use strict";n.d(t,{I:()=>p});var o=n(70079),i=n(65092),s=n(19841),r=n(49794),a=n(21766),u=n(73949),l=n(81098),c=n(65645);(0,a.S)();const d=[{title:"Hello World",key:"hello-world"},{title:"React Counter",key:"react-counter"},{title:"BMI Calculator",key:"bmi"},{title:"REST API Usage",key:"apis"},{title:"Debounce vs. Throttling",key:"debounce-throttling"},{title:"Fibonacci Seq.",key:"fibonacci"}],p=e=>{const[t,n]=(0,o.useState)(e.initWidth||500),[a,p]=(0,o.useState)(e.defaultDelay||0),[f,m]=(0,o.useState)(!1),v=(0,o.useCallback)(((e,t)=>{let{size:o}=t;n(o.width)}),[]),h=o.createElement("div",{className:"delay-container"},o.createElement("input",{type:"range",id:"volume",name:"delay",value:a,step:"100",min:"0",max:"300",onChange:e=>p(Number(e.target.value))}),o.createElement("label",{htmlFor:"volume"},"Debug Delay: ",a,"ms")),g=d.findIndex((t=>t.key===e.meta.key)),I=d[g+1],y=d[g-1];return o.createElement(i.Z,{title:`${e.meta.title} | Playground`,description:`Flyde Playground - ${e.meta.title} example`},o.createElement("header",{className:(0,s.default)("hero hero--primary",u.Z.heroBanner,"playground-hero")},o.createElement("div",{className:"container"},o.createElement("h1",{className:"hero__title"},"Welcome to Flyde's Online Playground"),o.createElement("p",{className:"hero__subtitle"},"Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!"))),o.createElement("div",{className:"mobile-warning"},"Flyde is currently not optimized for mobile devices. Please"," ",o.createElement("strong",null,"use a desktop computer for the best experience"),"."),o.createElement("ul",{className:"examples__menu"},d.map((e=>o.createElement("li",{key:e.key},o.createElement(r.Z,{to:`/playground/${e.key}`,className:"button button--primary"},e.title))))),o.createElement("div",{className:"playground-container"},o.createElement("header",null,o.createElement("h2",{className:"playground-title"},e.meta.title),o.createElement("div",{className:"playground-description"},e.meta.description),f?o.createElement(o.Fragment,null,o.createElement("hr",null),o.createElement("div",{className:"playground-extra"},e.extraInfo||e.meta.extraInfo,o.createElement("div",{className:"star-hint"},o.createElement("span",null,"\xa0 PS: Did you like this example?"),"Please consider giving a \u2b50\ufe0f to the project"," ",o.createElement("span",{className:"star-wrapper"},o.createElement("iframe",{className:"gh-stars-frame",src:"https://ghbtns.com/github-btn.html?user=flydelabs&repo=flyde&type=star&count=true&size=small",width:100,height:20,title:"GitHub Stars"}))))):null,e.prefixComponent),o.createElement("div",{className:"playground"},o.createElement("div",{className:"flow-container"},!0!==e.hideDelay?h:null,o.createElement(c.Y,{flowProps:e.flowProps,debugDelay:a,onOutput:()=>m(!0)})),o.createElement(l.Resizable,{height:0,width:t,onResize:v,handle:o.createElement("div",{className:"handle"}),axis:"x",resizeHandles:["w"]},o.createElement("div",{className:"output-container",style:{flexBasis:t}},e.children))),o.createElement("nav",{className:"pagination-nav"},o.createElement("div",{className:"pagination-nav__item"},y?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${y.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Previous Example"),o.createElement("div",{className:"pagination-nav__label"},y.title)):null),o.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},I?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${I.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Next Example"),o.createElement("div",{className:"pagination-nav__label"},I.title)):null))))}},44046:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var o=n(70079),i=n(74762),s=n(79256);const r={dependencies:{Delay:{id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:"Control Flow",description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:n(43920).Delay.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Delay"}}},flow:{imports:{"@flyde/stdlib":["Delay"]},node:{instances:[{pos:{x:-249.638056640625,y:-391.20183471679684},id:"Inline-value-Hello World-673",inputConfig:{},node:{id:"Inline-value-Hello",inputs:{},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:'const result = ("Hello"); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"Hello"',dataBuilderSource:"IkhlbGxvIg==",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},style:{size:"large",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-92.58089599609374,y:-99.73132080078125},id:"clbdutwlh000c4664hu8g9uxd",inputConfig:{},node:{id:"Inline-value-World!",inputs:{},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:'const result = ("World!"); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"World!"',dataBuilderSource:"IldvcmxkISI=",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},style:{size:"large",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-53.302717285156234,y:-233.93417114257812},id:"Delay-621",inputConfig:{delay:{mode:"static",value:3e3}},nodeId:"Delay"}],connections:[{from:{insId:"Inline-value-Hello World-673",pinId:"value"},to:{insId:"__this",pinId:"output"}},{from:{insId:"clbdutwlh000c4664hu8g9uxd",pinId:"value"},to:{insId:"__this",pinId:"output"}},{from:{insId:"Inline-value-Hello World-673",pinId:"value"},to:{insId:"Delay-621",pinId:"value"}},{from:{insId:"Delay-621",pinId:"delayedValue"},to:{insId:"clbdutwlh000c4664hu8g9uxd",pinId:"__trigger"}}],id:"Main",inputs:{},outputs:{output:{type:"any",optional:!1,delayed:!1}},inputsPosition:{},outputsPosition:{result:{x:-205.4333437325436,y:70.46791651575376},output:{x:-193.31878077738958,y:61.65730860559751}}}}};var a=n(4144);const u={title:"Hello World",description:'This is the "Hello, World!" example for Flyde. When you run this flow, it will output "Hello", wait for 3 seconds, and then output "World!". Click the "Run" button below to see it in action. This example highlights one of the key strengths of Flyde: the ability to view your program running in real-time. Note that the delay in the flow is intentional and added to make the example longer.',key:"hello-world"},l='Great job. You can change the strings double-clicking them. Double click on the green "ms: 3000" to edit the delay threshold. Go ahead, try it now!';function c(){const e=(0,o.useRef)((0,i.dynamicOutput)()),t=(0,o.useRef)({__trigger:(0,i.dynamicNodeInput)()}),[n,c]=(0,o.useState)({flow:r.flow,dependencies:r.dependencies,inputs:t.current,output:e.current}),d=o.createElement("button",{className:"button button--success",onClick:()=>t.current.__trigger.subject.next("run")},"Run!");return o.createElement(s.I,{meta:u,flowProps:n,hideDelay:!0,prefixComponent:d,initWidth:300,extraInfo:l},o.createElement(a.V,{output:e.current}))}},73949:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={"flyde-flow-editor":"flyde-flow-editor_AAD4",_hj_feedback_container:"_hj_feedback_container_Af03"}},85721:(e,t,n)=>{var o={"./af":47654,"./af.js":47654,"./ar":61325,"./ar-dz":98344,"./ar-dz.js":98344,"./ar-kw":26230,"./ar-kw.js":26230,"./ar-ly":42524,"./ar-ly.js":42524,"./ar-ma":44119,"./ar-ma.js":44119,"./ar-sa":82625,"./ar-sa.js":82625,"./ar-tn":42182,"./ar-tn.js":42182,"./ar.js":61325,"./az":37093,"./az.js":37093,"./be":32721,"./be.js":32721,"./bg":59919,"./bg.js":59919,"./bm":95594,"./bm.js":95594,"./bn":563,"./bn-bd":41757,"./bn-bd.js":41757,"./bn.js":563,"./bo":73211,"./bo.js":73211,"./br":87438,"./br.js":87438,"./bs":83662,"./bs.js":83662,"./ca":61196,"./ca.js":61196,"./cs":5841,"./cs.js":5841,"./cv":85251,"./cv.js":85251,"./cy":24512,"./cy.js":24512,"./da":37539,"./da.js":37539,"./de":5059,"./de-at":53853,"./de-at.js":53853,"./de-ch":99378,"./de-ch.js":99378,"./de.js":5059,"./dv":91454,"./dv.js":91454,"./el":39651,"./el.js":39651,"./en-au":87953,"./en-au.js":87953,"./en-ca":98193,"./en-ca.js":98193,"./en-gb":61980,"./en-gb.js":61980,"./en-ie":14050,"./en-ie.js":14050,"./en-il":6502,"./en-il.js":6502,"./en-in":555,"./en-in.js":555,"./en-nz":11372,"./en-nz.js":11372,"./en-sg":26568,"./en-sg.js":26568,"./eo":69533,"./eo.js":69533,"./es":68327,"./es-do":17620,"./es-do.js":17620,"./es-mx":96467,"./es-mx.js":96467,"./es-us":83272,"./es-us.js":83272,"./es.js":68327,"./et":68523,"./et.js":68523,"./eu":19066,"./eu.js":19066,"./fa":59087,"./fa.js":59087,"./fi":96443,"./fi.js":96443,"./fil":93979,"./fil.js":93979,"./fo":90383,"./fo.js":90383,"./fr":56327,"./fr-ca":25610,"./fr-ca.js":25610,"./fr-ch":97274,"./fr-ch.js":97274,"./fr.js":56327,"./fy":67442,"./fy.js":67442,"./ga":44291,"./ga.js":44291,"./gd":77342,"./gd.js":77342,"./gl":96248,"./gl.js":96248,"./gom-deva":21404,"./gom-deva.js":21404,"./gom-latn":20833,"./gom-latn.js":20833,"./gu":9122,"./gu.js":9122,"./he":74623,"./he.js":74623,"./hi":60364,"./hi.js":60364,"./hr":30860,"./hr.js":30860,"./hu":70441,"./hu.js":70441,"./hy-am":90425,"./hy-am.js":90425,"./id":29672,"./id.js":29672,"./is":96150,"./is.js":96150,"./it":27852,"./it-ch":55603,"./it-ch.js":55603,"./it.js":27852,"./ja":16465,"./ja.js":16465,"./jv":20120,"./jv.js":20120,"./ka":87245,"./ka.js":87245,"./kk":21479,"./kk.js":21479,"./km":65038,"./km.js":65038,"./kn":63060,"./kn.js":63060,"./ko":85020,"./ko.js":85020,"./ku":90582,"./ku.js":90582,"./ky":34950,"./ky.js":34950,"./lb":94201,"./lb.js":94201,"./lo":87894,"./lo.js":87894,"./lt":70120,"./lt.js":70120,"./lv":4265,"./lv.js":4265,"./me":14030,"./me.js":14030,"./mi":9463,"./mi.js":9463,"./mk":25898,"./mk.js":25898,"./ml":64233,"./ml.js":64233,"./mn":47156,"./mn.js":47156,"./mr":34479,"./mr.js":34479,"./ms":24691,"./ms-my":6456,"./ms-my.js":6456,"./ms.js":24691,"./mt":81789,"./mt.js":81789,"./my":37452,"./my.js":37452,"./nb":91170,"./nb.js":91170,"./ne":87529,"./ne.js":87529,"./nl":81776,"./nl-be":24455,"./nl-be.js":24455,"./nl.js":81776,"./nn":34705,"./nn.js":34705,"./oc-lnc":36139,"./oc-lnc.js":36139,"./pa-in":17960,"./pa-in.js":17960,"./pl":1899,"./pl.js":1899,"./pt":31670,"./pt-br":29159,"./pt-br.js":29159,"./pt.js":31670,"./ro":55115,"./ro.js":55115,"./ru":45149,"./ru.js":45149,"./sd":81231,"./sd.js":81231,"./se":35397,"./se.js":35397,"./si":99786,"./si.js":99786,"./sk":39383,"./sk.js":39383,"./sl":68691,"./sl.js":68691,"./sq":34826,"./sq.js":34826,"./sr":40080,"./sr-cyrl":75673,"./sr-cyrl.js":75673,"./sr.js":40080,"./ss":54309,"./ss.js":54309,"./sv":52245,"./sv.js":52245,"./sw":8967,"./sw.js":8967,"./ta":10454,"./ta.js":10454,"./te":35204,"./te.js":35204,"./tet":81571,"./tet.js":81571,"./tg":15737,"./tg.js":15737,"./th":41786,"./th.js":41786,"./tk":50511,"./tk.js":50511,"./tl-ph":14828,"./tl-ph.js":14828,"./tlh":62422,"./tlh.js":62422,"./tr":97047,"./tr.js":97047,"./tzl":90792,"./tzl.js":90792,"./tzm":67730,"./tzm-latn":59963,"./tzm-latn.js":59963,"./tzm.js":67730,"./ug-cn":42535,"./ug-cn.js":42535,"./uk":33151,"./uk.js":33151,"./ur":22750,"./ur.js":22750,"./uz":61914,"./uz-latn":60231,"./uz-latn.js":60231,"./uz.js":61914,"./vi":55517,"./vi.js":55517,"./x-pseudo":64078,"./x-pseudo.js":64078,"./yo":70046,"./yo.js":70046,"./zh-cn":81832,"./zh-cn.js":81832,"./zh-hk":90953,"./zh-hk.js":90953,"./zh-mo":38236,"./zh-mo.js":38236,"./zh-tw":71001,"./zh-tw.js":71001};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=s,e.exports=i,i.id=85721}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5976],{19121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cappedArrayDebounce=void 0;t.cappedArrayDebounce=function(e,t,n,o){void 0===o&&(o=500);let i=[],s=null,r=null;return{addItem:a=>{clearTimeout(s),i.push(a),r||(r=setTimeout((()=>{e(i),clearTimeout(s),r=null}),o)),i.length>=n?(e(i),clearTimeout(r),r=null,i=[]):s=setTimeout((()=>{e(i),clearTimeout(r),r=null,i=[]}),t)},flush:()=>{i.length&&(e(i),i=[],clearTimeout(r))},pendingItems:()=>i.length}}},59792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.dataShaper=t.DataShapeType=void 0,function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.ARRAY=3]="ARRAY",e[e.OBJECT=4]="OBJECT",e[e.NULL=5]="NULL",e[e.UNSUPPORTED=6]="UNSUPPORTED"}(n=t.DataShapeType||(t.DataShapeType={}));const o={string:n.STRING,number:n.NUMBER,boolean:n.BOOLEAN,object:n.OBJECT,array:n.ARRAY,null:n.NULL,symbol:n.UNSUPPORTED,undefined:n.UNSUPPORTED,function:n.UNSUPPORTED,bigint:n.UNSUPPORTED};t.dataShaper=function(e,n,i){void 0===n&&(n=5),void 0===i&&(i=5);const s=null===(r=e)?"null":typeof r;var r,a;if("object"===s){if(Array.isArray(e))return n>1?e.filter(((e,t)=>t(0,t.dataShaper)(e,n-1,i))):o.array;if(n>1){const o={};for(const s in e)o[s]=(0,t.dataShaper)(e[s],n-1,i);return a=o,Object.keys(a).sort().reduce(((e,t)=>(e[t]=a[t],e)),{})}return o.object}return o[s]}},23046:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.debugLogger=void 0;const i=(0,o(n(55899)).default)("flyde");t.debugLogger=e=>i.extend(e)},24331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullInsIdPath=void 0,t.fullInsIdPath=function(e,t){if(!e)throw new Error("insId is not defined");return t?`${t}.${e}`:e}},34459:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hashFlow=t.hashNode=void 0;const i=o(n(68805)),s=n(30292),r=e=>(0,i.default)(e);t.hashNode=function(e,t){var n;void 0===t&&(t=!0);const{id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l}=e,c={id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l};if((0,s.isVisualNode)(e)){const{instances:n,connections:o,inputsPosition:i,outputsPosition:s}=e,a=n.map((e=>{const{pos:t,...n}=e;return n})),u=t?{}:{inputsPosition:i,outputsPosition:s},l=t?a:n;l.sort(((e,t)=>e.id.localeCompare(t.id)));const d=[...o];d.sort(((e,t)=>{const n=`${e.from.insId}.${e.from.pinId}`,o=`${t.from.insId}.${t.from.pinId}`;return n.localeCompare(o)}));const p=JSON.stringify({instancesToUse:l,conns:d,...c,maybeIoPos:u});return r(p)}if((0,s.isInlineValueNode)(e)){const{customViewCode:t}=e,o=null!==(n=e.fnCode)&&void 0!==n?n:e.runFnRawCode,i=JSON.stringify({fnCode:o,customViewCode:t,...c});return r(i)}throw new Error("Hashing code nodes unsupported")};t.hashFlow=e=>{const{node:n,imports:o}=e,i=(0,t.hashNode)(n,!1),s=Object.entries(null!=o?o:{}).sort(((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)})).map((e=>{let[t,n]=e;return[t,n.sort()]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{}),a=JSON.stringify(s);return r(i+a)}},86873:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DepGraph=void 0,i(n(3172),t),i(n(59962),t),i(n(23046),t),i(n(19121),t),i(n(59962),t),i(n(34459),t),i(n(39043),t),i(n(59792),t),i(n(24331),t),t.DepGraph=n(60359).DepGraph},3172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testDataCreator=void 0;t.testDataCreator=e=>function(t){void 0===t&&(t={});return{..."function"==typeof e?e():e,...t}}},59962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplePluralize=t.eventually=t.delay=t.noop=t.removeDupes=t.ensure=t.isOptionalType=t.callFnOrFnPromise=t.isPromise=t.isDefined=t.containsAll=t.shuffle=t.randomInts=t.repeat=t.pickRandom=t.randomPos=t.randomInt=t.pickSecond=t.pickFirst=t.fromEntries=t.entries=t.okeys=t.values=t.keys=t.filterOMap=t.mapOMap=t.middlePos=t.calcCenter=t.intersectRect=void 0;t.intersectRect=(e,t)=>{const n=e.x+e.w,o=t.x+t.w;return!(t.x>n||oe.y+e.h||t.y+t.h{let{w:t,h:n,x:o,y:i}=e;return{x:o+t/2,y:i+n/2}};t.middlePos=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});t.mapOMap=(e,n)=>(0,t.entries)(e).map((e=>{let[t,o]=e;return[t,n(t,o)]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.filterOMap=(e,n)=>(0,t.entries)(e).filter((e=>{let[t,o]=e;return n(t,o)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.keys=e=>Object.keys(e);t.values=e=>Object.values(e),t.okeys=t.keys;t.entries=e=>(0,t.okeys)(e).map((t=>[t,e[t]]));t.fromEntries=e=>e.reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.pickFirst=e=>e[0];t.pickSecond=e=>e[1];t.randomInt=function(e,t){void 0===t&&(t=0);const n=Math.random();return t+Math.floor((e-t)*n)};t.randomPos=function(e,n){void 0===e&&(e=1e3),void 0===n&&(n=0);return{x:(0,t.randomInt)(e,n),y:(0,t.randomInt)(e,n)}};t.pickRandom=e=>e[(0,t.randomInt)(e.length)];t.repeat=(e,t)=>"x".repeat(e).split("").map(((e,n)=>t(n)));t.randomInts=function(e,n,o){return void 0===n&&(n=100),void 0===o&&(o=0),(0,t.repeat)(e,(()=>(0,t.randomInt)(n,o)))};t.shuffle=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t};t.containsAll=(e,t)=>t.every((t=>e.includes(t)));t.isDefined=e=>void 0!==e;t.isPromise=e=>e&&"function"==typeof e.then;t.callFnOrFnPromise=(e,n)=>{if(!(0,t.isDefined)(e))return;const o=e=>{try{e()}catch(t){console.error(n,t)}};"function"==typeof e?o(e):Promise.resolve(e).then((e=>{"function"==typeof e&&o(e)}))};t.isOptionalType=e=>/\?$/.test(e);t.ensure=(e,t)=>{if(void 0===e)throw new Error(t||"Undefined value passed");return e};t.removeDupes=e=>Array.from(new Set(e));t.noop=()=>{};t.delay=e=>new Promise((t=>setTimeout(t,e)));t.eventually=async function(e,n,o,i){if(void 0===n&&(n=1e3),void 0===o&&(o=100),void 0===i&&(i=new Set),n<0){const e=Array.from(i).reduce(((e,t,n)=>`${e}\n\t\t${n+1}. ${t}`),"");throw new Error(`[Eventually timeout exceeded after: timeout with error]: ${e}`)}try{await e()}catch(s){const r=Date.now();await(0,t.delay)(o);const a=Date.now()-r;return i.add(null==s?void 0:s.message),(0,t.eventually)(e,n-a,o,i)}},t.simplePluralize=function(e,t){return`${e} ${t}${1!==e?"s":""}`}},39043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileObjectTemplate=t.compileStringTemplate=void 0;t.compileStringTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=new RegExp("\\$\\{"+e+"\\}","g");n=n.replace(i,o)})),n};t.compileObjectTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=JSON.stringify(o),s=new RegExp('"\\$\\$\\{'+e+'\\}"',"g"),r=new RegExp("\\$\\{"+e+"\\}","g"),a="string"==typeof o?o.replace(/"/g,((e,t,n)=>"\\"!==n[t-1]?'\\"':n[t])):o;n=n.replace(s,i).replace(r,a).replace(/\n/g,"\\n")})),JSON.parse(n)}},69150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connection=t.connectionData=t.connectionDataEquals=t.connectionNodeEquals=t.connectionNode=t.externalConnectionNode=t.isInternalConnection=t.isExternalConnection=t.isInternalConnectionNode=t.isExternalConnectionNode=t.getNodeOutputs=t.getOutputName=t.getInputName=t.getNodeInputs=t.TRIGGER_PIN_ID=t.ERROR_PIN_ID=t.THIS_INS_ID=void 0;const o=n(30292);t.THIS_INS_ID="__this",t.ERROR_PIN_ID="__error",t.TRIGGER_PIN_ID="__trigger";t.getNodeInputs=e=>({...e.inputs,[t.TRIGGER_PIN_ID]:(0,o.nodeInput)()});t.getInputName=e=>e===t.TRIGGER_PIN_ID?"Trigger Node":e;t.getOutputName=e=>e===t.ERROR_PIN_ID?"Error":e;t.getNodeOutputs=e=>({...e.outputs,[t.ERROR_PIN_ID]:(0,o.nodeOutput)()});t.isExternalConnectionNode=e=>e&&e.insId===t.THIS_INS_ID;t.isInternalConnectionNode=e=>e.insId!==t.THIS_INS_ID;t.isExternalConnection=e=>{let{from:n,to:o}=e;return(0,t.isExternalConnectionNode)(n)||(0,t.isExternalConnectionNode)(o)};t.isInternalConnection=e=>!(0,t.isExternalConnection)(e);t.externalConnectionNode=e=>({insId:t.THIS_INS_ID,pinId:e});t.connectionNode=(e,t)=>({insId:e,pinId:t});t.connectionNodeEquals=(e,t)=>e.insId===t.insId&&e.pinId===t.pinId;t.connectionDataEquals=(e,n)=>!(!e||!n)&&((0,t.connectionNodeEquals)(e.from,n.from)&&(0,t.connectionNodeEquals)(e.to,n.to)),t.connectionData=function(e,n,o){const i="string"==typeof e?e.split("."):e,s="string"==typeof n?n.split("."):n;if(i.length>2||s.length>2)throw new Error(`invalid source or target to connection data - ${e} / ${n}`);return{from:2===i.length?(0,t.connectionNode)(i[0],i[1]):(0,t.externalConnectionNode)(i[0]),to:2===s.length?(0,t.connectionNode)(s[0],s[1]):(0,t.externalConnectionNode)(s[0]),delayed:o}};t.connection=function(e,t,n){return void 0===n&&(n=!1),{from:e,to:t,delayed:n}}},6775:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;const s=n(30292),r=n(47025),a=n(86873),u=n(69150);i(n(69150),t);t.connect=function(e,t,n,o,i,l,c,d){void 0===n&&(n={}),void 0===i&&(i={}),void 0===l&&(l=a.noop),void 0===c&&(c={}),void 0===d&&(d={});const{id:p,connections:f,instances:m}=e,v=p||"connected-node"+(0,a.randomInt)(999);return{inputs:e.inputs,outputs:e.outputs,id:v,completionOutputs:e.completionOutputs,reactiveInputs:e.reactiveInputs,run:(p,h)=>{let g=[];const I=new a.DepGraph({}),y=new Map,b=new Map,C=new Map,_=new Map,x=new Map,N=new Map;let w;const j=new Set;m.forEach((e=>{const n=(0,s.getNode)(e,t),o=e.id;y.set(e,o),b.set(o,e),I.addNode(o);const i=Object.keys(n.inputs),r=Object.keys(n.outputs),a={},l={};i.forEach((t=>{const n=(e.inputConfig||{})[t]||(0,s.queueInputPinConfig)();(0,s.isStaticInputPinConfig)(n)?a[t]=(0,s.staticNodeInput)(n.value):a[t]=(0,s.dynamicNodeInput)({config:n})})),a[u.TRIGGER_PIN_ID]=(0,s.dynamicNodeInput)({config:(0,s.queueInputPinConfig)()});if(f.some((t=>(0,u.isInternalConnectionNode)(t.to)&&t.to.insId===e.id&&t.to.pinId===u.TRIGGER_PIN_ID))&&e.inputConfig&&e.inputConfig[u.TRIGGER_PIN_ID])throw"Trigger connection can not be configured";r.forEach((e=>{const t=(0,s.dynamicOutput)();l[e]=t}));f.some((t=>(0,u.isInternalConnectionNode)(t.from)&&t.from.insId===e.id&&t.from.pinId===u.ERROR_PIN_ID))&&(l[u.ERROR_PIN_ID]=(0,s.dynamicOutput)()),C.set(o,a),_.set(o,l)}));const P=new Set;return f.forEach((n=>{const{from:o,to:i}=n,{insId:r,pinId:a}=o,{insId:l,pinId:c}=i,d=_.get(r),p=C.get(l);if((0,u.isInternalConnectionNode)(i)&&P.add(`${i.insId}.${i.pinId}`),(0,u.isExternalConnection)(n)){if((0,u.isExternalConnectionNode)(o)){const e=null==p?void 0:p[i.pinId];if(!e)throw new Error(`Input ${i.pinId} of instance ${l} not found`);const t=x.get(o.pinId)||[];t.push(e),x.set(o.pinId,t)}else{let e=null==d?void 0:d[o.pinId];if(!e)throw new Error(`Output ${o.pinId} of instance ${r} not found`);const t=N.get(i.pinId)||[];t.push(e),N.set(i.pinId,t)}return}if(!d)throw new Error(`No outputs found for instance [${r}]`);if(!p)throw b.has(l)?new Error(`No inputs found for instance [${l}]`):new Error(`Instance with id [${l}] does not exist!`);const f=d[a];if(!f)throw new Error(`Output source - [${a}] not found in node [${v}]`);const m=p[c],h=b.get(r);if(!h&&r!==u.THIS_INS_ID)throw new Error(`Instance [${r}] does not exist! failed to connect [${o}] -> [${i}]`);const y=(h?(0,s.getNode)(h,t):e).outputs[a];if(y&&y.delayed||n.delayed||r!==u.THIS_INS_ID&&l!==u.THIS_INS_ID&&I.addDependency(r,l),!m)throw new Error(`Target arg - [${i}] not found in node [${v}]`);const w=f.subscribe((async e=>{if(!(0,s.isDynamicInput)(m))throw console.info(m),new Error(`Impossible state listening to non dynamic input - ${l}.${c}`);m.subject.next(e)}));g.push((()=>w.unsubscribe()))})),(0,a.okeys)(h).forEach((e=>{(N.get(e)||[]).forEach((t=>{const n=t.subscribe((async t=>{if(!h[e])throw new Error(`Impossible state - output ${e} does not exist`);h[e].next(t)}));g.push((()=>n.unsubscribe()))}))})),I.overallOrder().map((e=>b.get(e))).forEach((e=>{const a=C.get(e.id),u=_.get(e.id),p=(0,s.getNode)(e,t);if(!a)throw new Error(`Unexpected error - args not found when running ${e}`);if(!u)throw new Error(`Unexpected error - outputs not found when running ${e}`);for(const t in a){const n=e.inputConfig[t];P.has(`${e.id}.${t}`)||(0,s.isStaticInputPinConfig)(n)||delete a[t]}const f=(0,r.execute)({node:p,inputs:a,outputs:u,resolvedDeps:t,_debugger:n,insId:e.id,extraContext:d,mainState:i,ancestorsInsIds:o,onBubbleError:l,onCompleted:()=>{return t=e.id,j.delete(t),void(0===j.size&&w&&w());var t},onStarted:()=>{return t=e.id,void j.add(t);var t},env:c});g.push(f)})),Object.keys(p).forEach((async e=>{(x.get(e)||[]).forEach((t=>{const n=p[e];if(!(0,s.isDynamicInput)(t))throw new Error(`Unsure what to do with key ${e}, input: ${t} of ins ${o}`);(0,a.isDefined)(n)&&t.subject.next(n)}))})),void 0===e.completionOutputs&&j.size>0?new Promise((e=>{w=e})):()=>g.forEach((e=>{try{e()}catch(t){console.error("error unsubscribing",t)}}))}}}},26488:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MINOR_DEBUGGER_EVENT_TYPES=t.MAJOR_DEBUGGER_EVENT_TYPES=t.DebuggerEventType=void 0,function(e){e.INPUT_CHANGE="i",e.OUTPUT_CHANGE="o",e.PROCESSING_CHANGE="pc",e.ERROR="err",e.INPUTS_STATE_CHANGE="isc"}(n=t.DebuggerEventType||(t.DebuggerEventType={})),t.MAJOR_DEBUGGER_EVENT_TYPES=[n.INPUT_CHANGE,n.OUTPUT_CHANGE,n.ERROR],t.MINOR_DEBUGGER_EVENT_TYPES=[n.PROCESSING_CHANGE,n.INPUTS_STATE_CHANGE]},43686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatEvent=void 0;const o=n(26488);t.formatEvent=function(e){var t,n,i;const s=[e.insId,...null!==(n=null===(t=e.ancestorsInsIds)||void 0===t?void 0:t.split("."))&&void 0!==n?n:[]];(null===(i=e.ancestorsInsIds)||void 0===i?void 0:i.length)>0&&e.ancestorsInsIds;const r=`Node <${e.nodeId}> `,a=`(${s.join(" -> ")})`;return`${r} - ${function(e){switch(e.type){case o.DebuggerEventType.PROCESSING_CHANGE:return e.val?"started processing":"stopped processing";case o.DebuggerEventType.INPUT_CHANGE:return`Input pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.OUTPUT_CHANGE:return`Output pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.INPUTS_STATE_CHANGE:return`Inputs queue size changed to ${Object.entries(e.val).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join(", ")}`;case o.DebuggerEventType.ERROR:return`Error: ${e.val}`}}(e)} ${a}`}},99896:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26488),t),i(n(43686),t)},47025:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.GLOBAL_STATE_NS=t.ROOT_INS_ID=t.INPUTS_STATE_SUFFIX=t.INNER_STATE_SUFFIX=void 0;const s=n(62600),r=n(87794);i(n(99896),t);const a=n(30292),u=n(6775),l=n(84479),c=n(86873),d=n(23046),p=n(30292),f=n(99896),m=n(79804);t.INNER_STATE_SUFFIX="_inner",t.INPUTS_STATE_SUFFIX="_inputs";t.ROOT_INS_ID="__root",t.GLOBAL_STATE_NS="____global";t.execute=e=>{let{node:n,inputs:o,outputs:i,resolvedDeps:v,_debugger:h={},insId:g=t.ROOT_INS_ID,extraContext:I={},mainState:y={},ancestorsInsIds:b,onBubbleError:C=s.noop,env:_={},onCompleted:x=s.noop,onStarted:N=s.noop}=e;const w=[];y[t.GLOBAL_STATE_NS]||(y[t.GLOBAL_STATE_NS]=new Map);const j={...I,ENV:_},P=(0,m.customNodesToNodesCollection)(v,j),O=e=>{const t=e instanceof a.NodeInstanceError?e:new a.NodeInstanceError(e,(0,c.fullInsIdPath)(g,b),n.id);h.onEvent&&h.onEvent({type:f.DebuggerEventType.ERROR,val:t,insId:g,ancestorsInsIds:b,nodeId:n.id}),i[u.ERROR_PIN_ID]?i[u.ERROR_PIN_ID].next(t):C(t)},E=(e=>(0,a.isVisualNode)(e)?(0,u.connect)(e,P,h,(0,c.fullInsIdPath)(g,b),y,O,_,I):(0,a.isInlineValueNode)(e)?(0,m.inlineValueNodeToNode)(e,j):e)(n),D=h.onEvent||s.noop,S={},M={};(0,c.entries)(o).forEach((e=>{let[t,o]=e;if((0,a.isDynamicInput)(o)){const e=(0,a.dynamicNodeInput)({config:o.config}),i=o.subject.subscribe((async o=>{const i=D({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o,ancestorsInsIds:b,nodeId:n.id});if(i){const t=await i.valuePromise;e.subject.next(t)}else h.debugDelay&&await(0,c.delay)(h.debugDelay),e.subject.next(o)}));w.push((()=>i.unsubscribe())),M[t]=e}else{D({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o.config.value,ancestorsInsIds:b,nodeId:n.id});const e=(0,a.staticNodeInput)((0,a.getStaticValue)(o.config.value,P,g));M[t]=e}})),(0,c.entries)(i).forEach((e=>{let[t,o]=e;const i=(0,a.dynamicOutput)(),s=i.subscribe((async e=>{const i=D({type:f.DebuggerEventType.OUTPUT_CHANGE,insId:g,pinId:t,val:e,ancestorsInsIds:b,nodeId:n.id});if(i){const e=await i.valuePromise;o.next(e)}else o.next(e)}));w.push((()=>s.unsubscribe())),S[t]=i}));const T=(e=>{var n,o;const{node:i,inputs:u,outputs:m,resolvedDeps:v,_debugger:h,insId:g,ancestorsInsIds:I,mainState:y,onError:b,onStarted:C,onCompleted:_,env:x,extraContext:N}=e,{run:w,fn:j}=i,P=(0,d.debugLogger)("core"),O=[];let E;const D=(null==h?void 0:h.onEvent)||s.noop,S=(0,c.fullInsIdPath)(g,I),M=`${S}${t.INNER_STATE_SUFFIX}`,T=`${S}${t.INPUTS_STATE_SUFFIX}`,k=P.extend(S),R=y[t.GLOBAL_STATE_NS];y[M]||(y[M]=new Map),y[T]||(y[T]=new Map);let A=null!==(n=y[T])&&void 0!==n?n:new Map;const V=()=>{const e=Array.from(A.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:(0,a.isQueueInputPinConfig)(u[n].config)?null==o?void 0:o.length:1}}),{});D({type:f.DebuggerEventType.INPUTS_STATE_CHANGE,val:e,insId:g,ancestorsInsIds:I,nodeId:i.id})},$={execute:(e,n,o,i)=>(0,t.execute)({node:e,inputs:n,outputs:o,resolvedDeps:v,_debugger:h,insId:i,onCompleted:_,onStarted:C}),insId:g,state:null!==(o=y[M])&&void 0!==o?o:new Map,onCleanup:e=>{O.push(e)},onError:e=>{b(e)},context:null!=N?N:{},ancestorsInsIds:I,globalState:R};let z,H=!1;const G=(i.reactiveInputs||[]).filter((e=>{var t;return!(0,p.isStaticInputPinConfig)(null===(t=u[e])||void 0===t?void 0:t.config)})),L=()=>{var e;null===(e=y[M])||void 0===e||e.clear(),(0,c.keys)(y).filter((e=>e.startsWith(`${S}.`))).forEach((e=>{y[e]=new Map}))},F=e=>{const t=(null==e?void 0:e.key)&&G.includes(null==e?void 0:e.key);if(H&&!t);else{const o=H&&t;if((0,l.isNodeStateValid)(u,A,i)||o){let t;if(H){if(!e)throw new Error("Unexpected state, got reactive node while not processing and not valid");const n=(0,l.pullValueForExecution)(e.key,u[e.key],A,x);t={...z,[e.key]:n},V()}else t=(0,l.pullValuesForExecution)(u,A,x),z=t,V();let o=new Set,s={};if(H=!0,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),i.completionOutputs){const e=i.completionOutputs.map((e=>e.split("+"))).reduce(((e,t)=>(t.forEach((n=>{e.set(n,t)})),e)),new Map);(0,c.entries)(m).forEach((t=>{let[n,a]=t;a.pipe((0,r.first)()).subscribe((t=>{o.add(n),s[n]=t;let r=e.get(n);r&&(r.splice(r.indexOf(n),1),0===r.length&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_&&_(s),L(),(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),E=void 0,o.clear(),s={},(0,l.hasNewSignificantValues)(u,A,x,i.id)&&F()))}))}))}else(0,c.entries)(m).forEach((e=>{let[t,n]=e;n.subscribe((e=>{s[t]=e}))}));try{k("Running node %s with values %o",i.id,t),C&&C(),E=(null!=j?j:w)(t,m,$),(0,c.isPromise)(E)?E.then((()=>{void 0===i.completionOutputs&&_&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_(s),L(),(0,l.hasNewSignificantValues)(u,A,x,i.id)&&F())})).catch((e=>{b(e),H=!1,k("Error in node %s - value %e",i.id,e),D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id})})):void 0===i.completionOutputs&&_&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_(s),L())}catch(n){b(n),H=!1,k("Error in node %s - value %e",i.id,n),D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id})}const d=G.find((e=>u[e]&&(0,l.peekValueForExecution)(e,u[e],A,x,i.id)));if(d){const e=(0,l.peekValueForExecution)(d,u[d],A,x,i.id);F({key:d,value:e})}else{const e=(0,c.entries)(u).find((e=>{let[t,n]=e;const o=(0,a.isQueueInputPinConfig)(n.config),s=(0,l.peekValueForExecution)(t,n,A,x,i.id);return!!o&&(0,c.isDefined)(s)}));if(e){const[t,n]=e,o=(0,l.peekValueForExecution)(t,n,A,x,i.id);F({key:t,value:o})}}}}};F();const B=(0,l.subscribeInputsToState)(u,A,((e,t)=>{P("Got input %s - value is [%o]",e,t),V();try{F({key:e,value:t})}catch(n){b(n)}}));return O.push(B),()=>{(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),O.forEach((e=>e()))}})({node:E,inputs:M,outputs:S,resolvedDeps:P,_debugger:h,insId:g,mainState:y,ancestorsInsIds:b,onError:O,onBubbleError:C,env:_,extraContext:I,onCompleted:x,onStarted:N});return()=>{w.forEach((e=>e())),T()}}},84479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeInputsToState=t.isNodeStateValid=t.hasNewSignificantValues=t.peekValuesForExecution=t.pullValuesForExecution=t.pullValueForExecution=t.peekValueForExecution=void 0;const o=n(30292),i=n(86873),s=n(6775),r=(e,t)=>{const n=(0,o.extractStaticValue)(e);if((0,o.isEnvValue)(n)){return((e,t)=>{const n=e.split(".");let o={...t};for(let s of n){if(!o||!(0,i.isDefined)(o[s])||null===o[s])throw new Error(`Cannot find key ${e} inside obj ${t}`);o=o[s]}return o})((0,o.getEnvKeyFromValue)(n),t)}return n};t.peekValueForExecution=(e,t,n,i,s)=>{const a=n.get(e);let u;if(!t)throw new Error(`Trying to peek value of inexsting input in key "${e}" in node "${s}"`);return u=(0,o.isStaticInput)(t)?r(t,i):(0,o.isQueueInputPinConfig)(t.config)?a?[...a].shift():void 0:a,u};t.pullValueForExecution=(e,t,n,i)=>{const s=n.get(e);let a;return(0,o.isStaticInput)(t)?a=r(t,i):(0,o.isQueueInputPinConfig)(t.config)?(a=(s||[]).shift(),n.set(e,s)):(a=s,(0,o.isStickyInputPinConfig)(t.config)||n.delete(e)),a};t.pullValuesForExecution=(e,n,o)=>(0,i.entries)(e).reduce(((e,i)=>{let[s,r]=i;return e[s]=(0,t.pullValueForExecution)(s,r,n,o),e}),{});t.peekValuesForExecution=(e,n,o,s)=>(0,i.entries)(e).reduce(((e,i)=>{let[r,a]=i;return e[r]=(0,t.peekValueForExecution)(r,a,n,o,s),e}),{});t.hasNewSignificantValues=(e,n,s,r)=>(0,i.entries)(e).some((e=>{let[a,u]=e;const l=(0,o.isQueueInputPinConfig)(u.config),c=(0,t.peekValueForExecution)(a,u,n,s,r);return(0,i.isDefined)(c)&&l}));t.isNodeStateValid=(e,t,n)=>{const r=(0,i.keys)(e),a=(0,i.keys)(n.inputs).filter((e=>{var t;const o=null===(t=n.inputs[e])||void 0===t?void 0:t.mode;return!o||"required"===o}));r.includes(s.TRIGGER_PIN_ID)&&a.push(s.TRIGGER_PIN_ID);return!!(0,i.containsAll)(r,a)&&(0,i.entries)(e).filter((e=>{let[t]=e;return!!n.inputs[t]||t===s.TRIGGER_PIN_ID})).every((e=>{let[s,r]=e;var a;const u=t.get(s);return"optional"===((null===(a=n.inputs[s])||void 0===a?void 0:a.mode)||"required")||(!!(0,o.isStaticInput)(r)||((0,o.isQueueInputPinConfig)(r.config)?(0,i.isDefined)(u)&&u.length>0:(0,i.isDefined)(u)))}))};t.subscribeInputsToState=(e,t,n)=>{const s=[];return(0,i.entries)(e).forEach((e=>{let[i,r]=e;if(!r)return;if((0,o.isStaticInput)(r))return;const a=r.subject.subscribe((e=>{if((0,o.isQueueInputPinConfig)(r.config)){const o=t.get(i)||[];if(!Array.isArray(o))throw new Error(`impossible state - state of key ${i} is set but not an array`);o.push(e),t.set(i,o),n(i,e)}else t.set(i,e),n(i,e)}));s.push((()=>a.unsubscribe()))})),()=>s.forEach((e=>e()))}},5474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flydeFlowSchema=void 0;const o=n(29022),i=o.z.record(o.z.string(),o.z.string().or(o.z.array(o.z.string()))),s=o.z.strictObject({x:o.z.number(),y:o.z.number()}),r=o.z.discriminatedUnion("mode",[o.z.strictObject({mode:o.z.literal("static"),value:o.z.any()}),o.z.strictObject({mode:o.z.literal("queue")}),o.z.strictObject({mode:o.z.literal("sticky")})]),a=o.z.object({size:o.z.optional(o.z.enum(["small","regular","large"])),icon:o.z.optional(o.z.any()),color:o.z.optional(o.z.string()),cssOverride:o.z.optional(o.z.record(o.z.string()))}),u=o.z.object({pos:s.default({x:0,y:0}),id:o.z.string(),inputConfig:o.z.optional(o.z.record(o.z.string(),r)).default({}),visibleInputs:o.z.optional(o.z.array(o.z.string())),visibleOutputs:o.z.optional(o.z.array(o.z.string())),nodeId:o.z.optional(o.z.string()),node:o.z.optional(o.z.any()),style:o.z.optional(a)}).refine((e=>e.node||e.nodeId),{message:"Instance must have either an inline node or refer to a nodeId"}),l=o.z.union([o.z.string(),o.z.object({mode:o.z.enum(["required","optional","required-if-connected"]),type:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),defaultValue:o.z.optional(o.z.any())})]),c=o.z.object({type:o.z.optional(o.z.string()),optional:o.z.optional(o.z.boolean()),delayed:o.z.optional(o.z.boolean()),description:o.z.optional(o.z.string())}),d=o.z.object({id:o.z.optional(o.z.string()),inputs:o.z.record(o.z.string(),l),outputs:o.z.record(o.z.string(),c),inputsPosition:o.z.optional(o.z.record(o.z.string(),s)),outputsPosition:o.z.optional(o.z.record(o.z.string(),s)),customViewCode:o.z.optional(o.z.string()),dataBuilderSource:o.z.optional(o.z.string()),templateType:o.z.optional(o.z.string()),completionOutputs:o.z.optional(o.z.array(o.z.string())),reactiveInputs:o.z.optional(o.z.array(o.z.string())),defaultStyle:o.z.optional(a),description:o.z.optional(o.z.string()),searchKeywords:o.z.optional(o.z.array(o.z.string()))}),p=o.z.object({instances:o.z.array(u),connections:o.z.array(o.z.strictObject({from:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),to:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),delayed:o.z.optional(o.z.boolean()),hidden:o.z.optional(o.z.boolean())}))}).and(d);t.flydeFlowSchema=o.z.strictObject({imports:o.z.optional(i).default({}),node:p})},74762:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticValueVisualNode=void 0,i(n(86873),t);const s=n(30292);i(n(6775),t),i(n(47025),t),i(n(10418),t),i(n(30292),t),i(n(3320),t),i(n(79804),t),i(n(5474),t);t.isStaticValueVisualNode=e=>!!e&&!!(0,s.maybeGetStaticValueNodeId)(`${e}`)},87093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fakeVm=t.VM=t.VMScript=void 0;const o=n(86873);class i{constructor(e){this.script=e}}t.VMScript=i;class s{constructor(e){this.context=e}run(e){const t=(0,o.okeys)(this.context.sandbox),n=Object.values(this.context.sandbox);Function(...t,e.script)(...n)}}t.VM=s,t.fakeVm={VMScript:i,VM:s}},28145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVM2Instance=void 0;const o=n(87093);t.getVM2Instance=()=>o.fakeVm},79804:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.customNodesToNodesCollection=t.inlineValueNodeToNode=void 0;const i=o(n(18706)),s=n(86873),r=n(30292),a=(0,n(28145).getVM2Instance)();t.inlineValueNodeToNode=function(e,t){void 0===t&&(t={});const{runFnRawCode:n,...o}=e,u=(0,s.debugLogger)(`code-node:${e.id}`),l=`\n try {\n ${n}\n } catch (e) {\n adv.onError(e);\n }\n `,c=new a.VMScript(l),d={...o,run:(n,o,l)=>{const d=new a.VM({sandbox:{inputs:n,outputs:o,setInterval:setInterval,clearInterval:clearInterval,setTimeout:setTimeout,clearTimeout:clearTimeout,encodeURIComponent:encodeURIComponent,adv:l,log:function(){for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeWithDependencies=void 0;const o=n(30292),i=n(74762),s=n(88270);t.getNodeWithDependencies=function(e,n,r){if(void 0===r&&(r=[]),(0,o.isInlineValueNode)(e))return[e];if(r.includes(e.id))return[];const a=(0,i.removeDupes)(e.instances.filter((e=>(0,s.isRefNodeInstance)(e))).map((e=>e.nodeId)).filter((e=>n[e])));return[e,...a.flatMap((e=>{var t;return null!==(t=n[e])&&void 0!==t?t:[]})).reduce(((e,o)=>[...e,...(0,t.getNodeWithDependencies)(o,n,[...r,...a])]),[])]}},30292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88270),t),i(n(43069),t),i(n(79426),t),i(n(44535),t),i(n(18063),t),i(n(20359),t)},18063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeInstanceError=void 0;class n extends Error{constructor(e,t,n){let o="Unknown error";o="string"==typeof e?e:e instanceof Error?e.message:null!==e&&"object"==typeof e?JSON.stringify(e):String(e),super(`${o} (insId: ${t}, nodeId: ${n})`),this.name=this.constructor.name,this.message=`${o} (insId: ${t}, nodeId: ${n})`,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.fullInsIdsPath=t,this.nodeId=n}}t.NodeInstanceError=n},88270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInsId=t.NodeInstance=t.isRefNodeInstance=t.isInlineNodeInstance=t.inlineNodeInstance=t.nodeInstance=void 0;const o=n(36618);t.nodeInstance=(e,t,n,o)=>({id:e,nodeId:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.inlineNodeInstance=(e,t,n,o)=>({id:e,node:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.isInlineNodeInstance=e=>!!e.node;t.isRefNodeInstance=e=>!(0,t.isInlineNodeInstance)(e);t.NodeInstance=(e,t,n,o)=>({id:e,nodeId:t.id,inputConfig:n||{},pos:o||{x:0,y:0}});t.createInsId=e=>`${e.id}-${(0,o.slug)()}`},43069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvKeyFromValue=t.toEnvValue=t.isEnvValue=t.extractStaticValue=t.isStaticInput=t.isDynamicInput=t.staticNodeInput=t.dynamicNodeInputs=t.dynamicNodeInput=t.dynamicOutput=t.nodeOutputs=t.nodeOutput=t.nodeInputs=t.isInputPinOptional=t.nodeInput=void 0;const o=n(62600),i=n(30292),s=n(86873),r=n(79426);t.nodeInput=function(e){return void 0===e&&(e="required"),{mode:e}};t.isInputPinOptional=e=>"optional"===e.mode;t.nodeInputs=(e,n)=>(0,s.repeat)(e,(e=>(0,t.nodeInput)((null==n?void 0:n[e])||"required")));t.nodeOutput=function(e){return void 0===e&&(e=!1),{delayed:e}};t.nodeOutputs=e=>(0,s.repeat)(e,(()=>(0,t.nodeOutput)()));t.dynamicOutput=()=>new o.Subject,t.dynamicNodeInput=(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})));t.dynamicNodeInputs=function(e){return void 0===e&&(e=10),(0,s.repeat)(e,(()=>(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})))()))};t.staticNodeInput=e=>({config:(0,r.staticInputPinConfig)(e)});t.isDynamicInput=e=>{const t=e;return t&&t.subject&&!!t.subject.next};t.isStaticInput=e=>(0,i.isStaticInputPinConfig)(null==e?void 0:e.config);t.extractStaticValue=e=>{if((0,t.isStaticInput)(e))return e.config.value;throw new Error("Cannot extract static value from non static arg")};t.isEnvValue=e=>"string"==typeof e&&e.startsWith("$ENV.");t.toEnvValue=e=>`$ENV.${e}`;t.getEnvKeyFromValue=e=>"string"==typeof e?e.replace(/^\$ENV\./,""):e},20359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeFromFunction=t.getNodeDef=t.getNode=t.getStaticValue=t.maybeGetStaticValueNodeId=t.fromSimplified=t.inlineValueNode=t.codeNode=t.visualNode=t.isInlineValueNode=t.isVisualNode=t.isCodeNode=t.isBaseNode=t.InlineValueNodeType=void 0;const o=n(86873),i=n(88270),s=n(43069);!function(e){e.VALUE="value",e.FUNCTION="function"}(t.InlineValueNodeType||(t.InlineValueNodeType={}));t.isBaseNode=e=>e&&e.id&&e.inputs&&e.outputs;t.isCodeNode=e=>(0,t.isBaseNode)(e)&&"function"==typeof e.run;t.isVisualNode=e=>!!e.instances;t.isInlineValueNode=e=>(0,o.isDefined)(e)&&(0,o.isDefined)(e.runFnRawCode),t.visualNode=(0,o.testDataCreator)({id:"visual-node",inputs:{},outputs:{},instances:[],connections:[],outputsPosition:{},inputsPosition:{}}),t.codeNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},run:o.noop}),t.inlineValueNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},runFnRawCode:""});t.fromSimplified=e=>{let{run:t,inputTypes:n,outputTypes:i,id:s}=e;return{id:s,inputs:(0,o.entries)(n).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),outputs:(0,o.entries)(i).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),run:t}};t.maybeGetStaticValueNodeId=e=>{const t="string"==typeof e&&e.match(/^__node\:(.*)/);if(t){return t[1]}return null};t.getStaticValue=(e,n,o)=>{const i=(0,t.maybeGetStaticValueNodeId)(e);if(i){const e=n[i];if(!e)throw new Error(`Instance ${o} referrer to a node reference ${i} that does not exist`);return e}return e};t.getNode=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw new Error(`Node with id ${n} not found`);return o};t.getNodeDef=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw console.error(`Node with id ${n} not found`),new Error(`Node with id ${n} not found`);return o};t.codeFromFunction=e=>{let{id:t,fn:n,inputNames:o,outputName:i,defaultStyle:r}=e;return{id:t,inputs:o.reduce(((e,t)=>({...e,[t]:(0,s.nodeInput)()})),{}),outputs:{[i]:(0,s.nodeOutput)()},run:(e,t)=>{const s=o.map((t=>e[t])),r=t[i],a=n(...s);return Promise.resolve(a).then((e=>null==r?void 0:r.next(e)))},completionOutputs:[i],defaultStyle:r}}},44535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nodeFromSimpleFunction=void 0,t.nodeFromSimpleFunction=function(e){var t;return{...e,id:e.id,description:e.description,namespace:e.namespace,inputs:e.inputs?e.inputs.reduce(((e,t)=>{let{name:n,description:o,mode:i,defaultValue:s}=t;return{...e,[n]:{description:o,mode:null!=i?i:"required",defaultValue:s}}}),{}):{},outputs:e.output?{[e.output.name]:{description:e.output.description}}:{},defaultStyle:{icon:e.icon,size:e.size},run:null!==(t=e.fullRunFn)&&void 0!==t?t:async function(t,n,o){var i,s;const r=(null!==(i=e.inputs)&&void 0!==i?i:[]).map((e=>{let{name:n}=e;return t[n]}));try{const t=await Promise.resolve(e.run(...r));e.output&&(null===(s=n[e.output.name])||void 0===s||s.next(t))}catch(a){console.error("Error in node",a),o.onError(a)}},customViewCode:e.customViewCode}}},79426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticInputPinConfig=t.isStickyInputPinConfig=t.isQueueInputPinConfig=t.staticInputPinConfig=t.stickyInputPinConfig=t.queueInputPinConfig=t.INPUT_MODES=void 0,t.INPUT_MODES=["queue","sticky","static"];t.queueInputPinConfig=()=>({mode:"queue"});t.stickyInputPinConfig=()=>({mode:"sticky"});t.staticInputPinConfig=e=>({mode:"static",value:e});t.isQueueInputPinConfig=e=>"queue"===e.mode;t.isStickyInputPinConfig=e=>!!e&&"sticky"===e.mode,t.isStaticInputPinConfig=function(e){return!!e&&"static"===e.mode}},10418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedExecute=void 0;const o=n(74762),i=n(47025);t.simplifiedExecute=function(e,t,n,s,r){void 0===r&&(r={});const a=(0,o.keys)(e.outputs),u=Object.keys(n).reduce(((e,t)=>{const i=n[t];return{...e,[t]:(0,o.isDynamicInput)(i)?i:(0,o.staticNodeInput)(i)}}),{}),l=a.reduce(((e,t)=>{const n=(0,o.dynamicOutput)();return s&&n.subscribe((e=>{s(t,e)})),{...e,[t]:n}}),{});return(0,i.execute)({node:e,inputs:u,outputs:l,resolvedDeps:t,onBubbleError:e=>{throw e},...r})}},25779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodePreview=void 0;const o=n(35250),i=n(74762),s=n(86553);t.NodePreview=e=>{let{node:t}=e;const n={node:t,instance:(0,i.nodeInstance)("bob",t.id,{}),connections:[],viewPort:{pos:{x:0,y:0},zoom:1},resolvedDeps:{},connectionsPerInput:{},onUngroup:i.noop,onDblClick:i.noop,onDragEnd:i.noop,onDragMove:i.noop,onDragStart:i.noop,onPinClick:i.noop,onPinDblClick:i.noop,onSelect:i.noop,onTogglePinBreakpoint:i.noop,onTogglePinLog:i.noop,onToggleSticky:i.noop,displayMode:!0,onInspectPin:i.noop,onDetachConstValue:i.noop,onCopyConstValue:i.noop,onPasteConstValue:i.noop,ancestorsInsIds:"",onChangeVisibleInputs:i.noop,onChangeVisibleOutputs:i.noop,onConvertConstToEnv:i.noop,forceShowMinimized:"both",onExtractInlineNode:i.noop,onCloseInlineEditor:i.noop,isConnectedInstanceSelected:!1,inlineEditorPortalDomNode:null,onChangeStyle:i.noop,onDeleteInstance:i.noop,onGroupSelected:i.noop,onSetDisplayName:i.noop,hadError:!1,queuedInputsData:{},onPinMouseDown:i.noop,onPinMouseUp:i.noop};return(0,o.jsx)("div",{className:"node-preview",children:(0,o.jsx)(s.InstanceView,{...n})})}},30653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDarkMode=t.DarkModeProvider=void 0;const o=n(70079),i=(0,o.createContext)(!0);t.DarkModeProvider=i.Provider;t.useDarkMode=()=>(0,o.useContext)(i)},29183:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataInspectionModal=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=n(74089),p=n(83938),f=n(17102),m=n(98158);t.DataInspectionModal=e=>{var t;const{onRequestHistory:n}=(0,m.useDebuggerContext)(),{item:o}=e,[i,s]=c.default.useState(),[r,v]=c.default.useState(0),[h,g]=c.default.useState(""),[I,y]=c.default.useState(),[b]=(0,d.useDebounce)(h,300);(0,c.useEffect)((()=>{y(null==i?void 0:i.lastSamples.filter((e=>"object"==typeof e.val?JSON.stringify(e.val).includes(b):e.val.toString().includes(b)))),v(0)}),[null==i?void 0:i.lastSamples,b]),c.default.useEffect((()=>{!async function(){var e,t;const i=await n(o.insId,null===(e=o.pin)||void 0===e?void 0:e.id,null===(t=o.pin)||void 0===t?void 0:t.type);s(i)}()}),[o,n]);const C=e=>{const t=e.val;return"object"==typeof t?(0,a.jsx)(p.BrowserOnlyReactJson,{src:t}):(0,a.jsx)(u.Code,{children:t.toString()})},_=`"${o.insId}" ${(null===(t=o.pin)||void 0===t?void 0:t.id)?`(${o.pin.id})`:""}`;return(0,a.jsx)(u.Dialog,{isOpen:!0,title:`Inspecting data for instance ${_}`,onClose:e.onClose,canEscapeKeyClose:!1,className:"data-inspection-modal",children:(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{children:[i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("em",{children:[_," called ",i.total," time(s)"]}),i.total>10&&(0,a.jsx)("span",{children:"Showing last 10 samples"})]}):null,(0,a.jsx)("input",{className:"bp5-input bp5-small bp5-fill",type:"search",placeholder:"Search for values",dir:"auto",onChange:e=>g(e.target.value),value:h}),b.length>0&&(0,a.jsxs)("span",{children:["Showing ",null==I?void 0:I.length," of ",i.lastSamples.length," ",'samples matching query "',b,'"']})]}),(0,a.jsx)("main",{className:"main-wrapper",children:(()=>{if(!i)return(0,a.jsx)(f.Loader,{});if(0===i.total)return(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",(0,a.jsx)("em",{children:o.insId})," ",o.pin?(0,a.jsxs)(c.default.Fragment,{children:["and pin ",(0,a.jsx)("em",{children:o.pin.id})]}):null,". Make sure debugger is running and your program was triggered."]});const e=null==I?void 0:I[r];return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Card,{className:"content-wrapper",children:[e?(0,a.jsxs)("div",{className:"info",children:[(0,a.jsxs)("div",{children:["Showing sample ",r," of event from"," ",(0,a.jsx)("strong",{children:(0,d.timeAgo)(e.time)})," (",new Date(e.time).toLocaleString(),")"]}),(0,a.jsxs)("div",{children:["Instance: ",(0,a.jsx)("strong",{children:e.insId}),", Pin id:"," ",(0,a.jsx)("strong",{children:e.pinId})," "]}),(0,a.jsx)("div",{children:"Value:"})]}):null,C(e)]}),(0,a.jsx)(u.Menu,{className:"samples-menu",children:I.map(((e,t)=>{const n=e.pinId,o=`${i.total-t}. from pin "${n}"`;return(0,a.jsx)(u.MenuItem,{text:o,onClick:()=>v(t)},t)}))})]}):i.lastSamples.length>0&&h.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",children:['No data found for search query "',h,'"']}):(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",o.insId," ",o.pin?`and ${o.pin.id}`:"",". Make sure a debugger is connected and your program was triggered."]})})()})]})})})}},40471:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29183),t)},98158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebuggerContext=t.DebuggerContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({onRequestHistory:()=>Promise.reject(new Error("Not implemented"))});t.DebuggerContextProvider=i.Provider;t.useDebuggerContext=()=>(0,o.useContext)(i)},86125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDependenciesContext=t.DependenciesContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({resolvedDependencies:{},onImportNode:()=>Promise.reject(new Error("Not implemented")),onRequestImportables:()=>Promise.reject(new Error("Not implemented"))});t.DependenciesContextProvider=i.Provider;t.useDependenciesContext=()=>(0,o.useContext)(i)},97106:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FlowEditor=void 0;const u=n(35250),l=s(n(70079)),c=n(74762),d=n(63521),p=a(n(53865)),f=n(68120),m=n(7047),v=n(84472),h=n(82232),g=n(49283),I=n(43490),y=n(68840),b=n(78087),C=n(20079),_=n(60190),x=n(40471),N=n(98158),w=n(86125),j=n(30653),P=n(77852);r(n(43490),t),r(n(98158),t),r(n(86125),t),y.library.add(b.fab,C.fas);const O=["select","drag-move","order-step"];t.FlowEditor=l.memo(l.forwardRef(((e,t)=>{const{state:n,onChangeEditorState:o}=e,{resolvedDependencies:i,onImportNode:s}=(0,w.useDependenciesContext)(),[r,a]=l.useState([]),[y,b]=l.useState([]),{flow:C,boardData:E}=n,D=n.flow.node,[S,M]=l.useState({}),[T,k]=l.useState(new Set),{debuggerClient:R}=(0,N.useDebuggerContext)();l.useEffect((()=>{if(R)return R.onBatchedEvents((e=>{e.forEach((e=>{e.type===c.DebuggerEventType.INPUTS_STATE_CHANGE&&(console.log("INPUTS_STATE_CHANGE",e.insId,e.val),M((t=>({...t,[e.insId]:e.val})))),e.type===c.DebuggerEventType.ERROR&&k((t=>{const n=new Set(t);return n.add(e.insId),n}))}))}))}),[R]);const{openFile:A,reportEvent:V}=(0,I.usePorts)(),$=l.useCallback(((e,t)=>{console.info("onChangeFlow",t.type),"functional"===t.type&&(a([{flow:{...n.flow,...e}},...r.slice(0,50)]),b([])),o((t=>({...t,flow:{...t.flow,...e}})))}),[o,n.flow,r]),[z,H]=l.useState({instances:[],connections:[]}),[G,L]=l.useState(!1),F=l.useCallback((()=>L(!1)),[]),B=l.useCallback((()=>L(!0)),[]),q=l.useCallback((e=>{o((t=>({...t,boardData:{...t.boardData,...e}})))}),[o]);l.useEffect((()=>{q({selected:[],viewPort:d.defaultViewPort,from:void 0,to:void 0,lastMousePos:{x:0,y:0}})}),[D.id]),(0,f.useHotkeys)("cmd+z",(e=>{b([...y,n]);const[t,...i]=r;t&&(o((e=>({...e,...t}))),a(i)),e.preventDefault()}),{text:"Undo last change",group:"Editing"},[n,r,y]);const U=l.useCallback(((e,t)=>{O.some((e=>t.message.includes(e)))||b([]),$({node:e},t)}),[$]),W=l.useCallback((e=>{A({absPath:e.source.path})}),[A]),Z=l.useCallback((function(e,t){void 0===t&&(t=-1*d.NODE_HEIGHT*1.5);const n=(0,m.createNewNodeInstance)(e,t,E.lastMousePos,i);if(n){const e=(0,p.default)(C,(e=>{const t=e.node;if(!(0,c.isVisualNode)(t))throw new Error("Impossible state, adding node to non visual node");t.instances.push(n)}));return $(e,(0,h.functionalChange)("add-node")),F(),n}}),[E.lastMousePos,C,$,F,i]),J=l.useCallback((async e=>{switch(e.type){case g.OmniBarCmdType.ADD:return V("addNode",{nodeId:e.data,source:"omnibar"}),Z(e.data);case g.OmniBarCmdType.ADD_VALUE:{const e=t.current;null==e||e.requestNewInlineValue();break}case g.OmniBarCmdType.IMPORT:{await s(e.data,{pos:E.lastMousePos});const t=(0,_.vAdd)({x:0,y:0},E.lastMousePos),n=(0,m.createNewNodeInstance)(e.data.node,0,t,i),o=(0,p.default)(C,(e=>{e.node.instances.push(n)}));$(o,(0,h.functionalChange)("add-imported-node")),V("addNode",{nodeId:e.data.node.id,source:"omnibar"});break}default:v.AppToaster.show({intent:"warning",message:"Not supported yet"})}F()}),[F,V,Z,t,s,E.lastMousePos,i,C,$]),[Y,K]=l.useState(),Q=l.useCallback((()=>K(void 0)),[]),X=l.useCallback(((e,t)=>{K({insId:e,pin:t})}),[]),{isDarkMode:ee}=(0,P.useDarkMode)();return(0,u.jsx)("div",{className:"flyde-flow-editor",children:(()=>{var n;if((0,c.isInlineValueNode)(D))throw new Error("Impossible state");return(0,u.jsx)(j.DarkModeProvider,{value:null!==(n=e.darkMode)&&void 0!==n?n:ee,children:(0,u.jsxs)(l.Fragment,{children:[Y?(0,u.jsx)(x.DataInspectionModal,{item:Y,onClose:Q}):null,(0,u.jsx)(d.VisualNodeEditor,{currentInsId:c.ROOT_INS_ID,ref:t,boardData:E,onChangeBoardData:q,node:D,onGoToNodeDef:W,onChangeNode:U,resolvedDependencies:i,clipboardData:z,onCopy:H,nodeIoEditable:!D.id.startsWith("Trigger"),onInspectPin:X,onShowOmnibar:B,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:S,initialPadding:e.initialPadding,instancesWithErrors:T,disableScrolling:e.disableScrolling},D.id),G?(0,u.jsx)(g.Omnibar,{flow:C,resolvedNodes:i,onCommand:J,visible:G,onClose:F}):null]})})})()})})))},9001:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeEditor=t.renderCreateIOOption=void 0;const i=n(35250),s=o(n(70079)),r=n(74762),a=n(50382),u=o(n(53865)),l=n(70457),c=n(25779);t.renderCreateIOOption=(e,t,n)=>(0,i.jsx)(a.MenuItem,{icon:"add",text:`Create "${e}"`,active:t,onClick:n,shouldDismissPopover:!1});const d=l.MultiSelect.ofType();t.BaseNodeEditor=e=>{var n,o;const{node:l,onChange:p}=e,f=(0,r.entries)(l.inputs),m=f.filter((e=>{let[,t]=e;return"required"===t.mode})).map((e=>{let[t]=e;return t})),v=f.filter((e=>{let[,t]=e;return"optional"===t.mode})).map((e=>{let[t]=e;return t})),h=f.filter((e=>{let[,t]=e;return"required-if-connected"===t.mode})).map((e=>{let[t]=e;return t})),[g,I]=s.default.useState(!1),y=(0,r.okeys)(l.outputs),b=s.default.useCallback((e=>{p({...l,id:e})}),[l,p]),C=s.default.useCallback((e=>{let t=e?e.split(","):void 0;"[]"===e&&(t=[]),p({...l,completionOutputs:t})}),[l,p]),_=s.default.useCallback((e=>{let t=e?e.split(","):void 0;p({...l,reactiveInputs:t})}),[l,p]),x=s.default.useCallback(((e,t)=>{const n=(0,u.default)(l,(n=>{n.inputs[e]=(0,r.nodeInput)(t)}));p(n)}),[l,p]),N=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.inputs[e]}));p(t)}),[l,p]),w=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{t.outputs[e]=(0,r.nodeOutput)()}));p(t)}),[l,p]),j=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.outputs[e]}));p(t)}),[l,p]);return(0,i.jsxs)("div",{className:"base-node-editor",children:[(0,i.jsx)("div",{className:"form-row",children:(0,i.jsx)(a.FormGroup,{label:"Node Name",labelFor:"text-input",labelInfo:"(required)",children:(0,i.jsx)(a.InputGroup,{id:"node-name",disabled:e.idDisabled,placeholder:"Node ID",value:l.id,onChange:e=>b(e.target.value)})})}),(0,i.jsx)(a.FormGroup,{label:"Required Inputs",children:(0,i.jsx)(d,{selectedItems:m,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),!0!==e.hiddenOutputs?(0,i.jsx)(a.FormGroup,{label:"Outputs",children:(0,i.jsx)(d,{selectedItems:y,placeholder:"Enter output names here",items:[],tagRenderer:e=>e,onItemSelect:w,onRemove:j,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}):null,(0,i.jsx)(a.Checkbox,{checked:g,onChange:e=>I(e.target.checked),children:"Show advanced options"}),(0,i.jsxs)(a.Collapse,{isOpen:g,children:[(0,i.jsx)(a.FormGroup,{label:"Optional Inputs",children:(0,i.jsx)(d,{selectedItems:v,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"optional"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Required-if-connected Inputs",children:(0,i.jsx)(d,{selectedItems:h,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required-if-connected"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Completion Outputs",children:(0,i.jsx)(a.InputGroup,{id:"completion-outputs",placeholder:"completion outputs",value:(null===(n=l.completionOutputs)||void 0===n?void 0:n.join(","))||"",onChange:e=>C(e.target.value)})}),(0,i.jsx)(a.FormGroup,{label:"Reactive Inputs",children:(0,i.jsx)(a.InputGroup,{id:"reactive-inputs",placeholder:"Reactive inputs",value:(null===(o=l.reactiveInputs)||void 0===o?void 0:o.join(","))||"",onChange:e=>_(e.target.value)})})]}),(0,i.jsx)(a.FormGroup,{label:"Preview",children:(0,i.jsx)("div",{className:"preview-wrapper",children:(0,i.jsx)(c.NodePreview,{node:l})})})]})}},82232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metaChange=t.functionalChange=void 0;t.functionalChange=e=>({type:"functional",message:e});t.metaChange=function(e){return void 0===e&&(e="n/a"),{type:"meta",message:e}}},41032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safelyGetNodeDef=t.loadingDef=void 0;const o=n(74762);t.loadingDef={id:"Loading",inputs:{},outputs:{}};t.safelyGetNodeDef=(e,n)=>{try{return(0,o.getNodeDef)(e,n)}catch(i){const n="string"==typeof e?e:e.nodeId;return{...t.loadingDef,id:n}}}},72125:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCodeModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(68371),f=n(74762),m=n(31745),v="`Result is ${inputs.a + inputs.b}`";t.InlineCodeModal=u.memo((function(e){const{initialValue:t,initialType:n}=e,[o,i]=u.useState((0,f.isDefined)(t)?t:v),[s,r]=u.useState(n||f.InlineValueNodeType.VALUE),h=(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:['You can add variables to by referrencing the "inputs" object.',(0,a.jsx)("br",{})," For example:",(0,a.jsx)(c.Code,{children:"`Hello {inputs.name}`"}),' will expose an input pin named "name"']}),(0,a.jsxs)("p",{children:["You can also use ternery expressions, arithmetic operators and more!",(0,a.jsx)("br",{}),"For example:",(0,a.jsx)(c.Code,{children:"inputs.a > inputs.b ? inputs.a + 42 : Math.random() * inputs.b"})]})]}),g=(0,a.jsxs)("span",{children:["Type in any valid JS value, such as ",(0,a.jsx)(c.Code,{children:"true"}),", ",(0,a.jsx)(c.Code,{children:"42"}),","," ",(0,a.jsx)(c.Code,{children:'["bob", "alice", "dave"]'}),".",(0,a.jsx)("br",{})," Dynamic inputs may also be used"]}),I=(0,a.jsxs)("span",{children:["Write any JS code and return a value.",(0,a.jsx)("br",{})," The returned value will be the output.",(0,a.jsx)("br",{})," Example:",(0,a.jsx)(c.Code,{children:"const a = inputs.a; const b = inputs.b; return Math.floor(a/b);"})]}),y=(0,p.getVariables)(o);return u.useEffect((()=>{o===v&&s===f.InlineValueNodeType.FUNCTION&&i(`return ${v}`),o===`return ${v}`&&s===f.InlineValueNodeType.VALUE&&i(v)}),[o,s]),(0,a.jsxs)(c.Dialog,{isOpen:!0,title:"Inline Value / Code",onClose:e.onCancel,className:"inline-code-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:t=>{"Enter"===t.key&&t.metaKey&&e.onSubmit(s,o)},tabIndex:0,children:[(0,a.jsxs)(c.RadioGroup,{inline:!0,onChange:e=>r(e.target.value),selectedValue:s,children:[(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Value ",(0,a.jsx)(m.InfoTooltip,{content:g})]}),value:f.InlineValueNodeType.VALUE}),(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Function ",(0,a.jsx)(m.InfoTooltip,{content:I})]}),value:f.InlineValueNodeType.FUNCTION})]}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"javascript",value:o,onChange:e=>i(e||""),onMount:e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})}}),(()=>{const e=o.includes("return");return e&&s===f.InlineValueNodeType.VALUE?(0,a.jsx)(c.Callout,{intent:c.Intent.WARNING,children:'When using the "value" type you are not expected to return anything'}):e||s!==f.InlineValueNodeType.FUNCTION?null:(0,a.jsxs)(c.Callout,{intent:c.Intent.DANGER,children:['When using the "function" type you are expected to'," ",(0,a.jsx)(c.Code,{children:"return"})," a value.",(0,a.jsx)("br",{}),"Example: ",(0,a.jsx)(c.Code,{children:"return 42 + Date.now();"})]})})(),(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Input pins detected:"," ",y.length?y.map((e=>(0,a.jsx)(c.Code,{children:e},e))):"None",(0,a.jsx)(m.InfoTooltip,{content:h})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:e.onCancel,children:"Cancel"}),(0,a.jsx)(c.Button,{onClick:()=>e.onSubmit(s,o),intent:c.Intent.PRIMARY,className:"save-btn",children:"Save"})]})})]})}))},18594:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(72125),t)},68371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInlineValueNode=t.getVariables=void 0;const o=n(74762),i=n(74762);t.getVariables=e=>(e.match(/inputs\.([a-zA-Z]\w*)/g)||[]).map((e=>e.replace(/inputs\./,"")));t.createInlineValueNode=e=>{let{code:n,customView:s,nodeId:r,type:a}=e;const u=(0,t.getVariables)(n).reduce(((e,t)=>({...e,[t]:(0,o.nodeInput)()})),{}),l={value:(0,o.nodeOutput)()},c=a===o.InlineValueNodeType.FUNCTION?`const result = (function() { ${n}}());\n Promise.resolve(result).then(val => outputs.value.next(val))`:`const result = (${n}); Promise.resolve(result).then(val => outputs.value.next(val))`,d=btoa(n);return(0,i.inlineValueNode)({id:r||`Inline Code ${(0,o.randomInt)(99999)}`,inputs:u,outputs:l,runFnRawCode:c,customViewCode:s||n,dataBuilderSource:d,templateType:a,completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline "+(a===o.InlineValueNodeType.VALUE?"value":"function")})}},49283:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Omnibar=t.OmniBarCmdType=void 0;const a=n(35250),u=s(n(70079)),l=n(70457),c=n(74762),d=n(50382),p=r(n(26372));var f;!function(e){e.ADD="add",e.ADD_VALUE="add-value",e.IMPORT="import"}(f=t.OmniBarCmdType||(t.OmniBarCmdType={}));const m=[];t.Omnibar=e=>{const{resolvedNodes:t}=e,[n,o]=u.useState(""),[i,s]=u.useState(null),[r,v]=u.useState([]);u.useEffect((()=>{const e=(0,c.keys)(t).map((e=>({title:`${t[e].id}`,cmd:{type:f.ADD,data:e},extra:"current flow"}))),n=r.map((e=>({title:`${e.node.id}`,description:e.node.description,cmd:{type:f.IMPORT,data:e},extra:`${e.module}`}))),o={title:"Add inline value or code",suggestOnEmpty:!0,cmd:{type:f.ADD_VALUE}},i=[...m,...n,o,...e];s(i)}),[t,r]),u.useEffect((()=>{e.onRequestImportables&&e.onRequestImportables(n).then((e=>{v(e)}))}),[e,n]);const h=u.useCallback(((e,t)=>{let{handleClick:n,modifiers:o,query:i,index:s}=t;if(!o.matchesPredicate)return null;const r=`${e.title}`;return(0,a.jsx)(d.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,a.jsxs)("div",{className:(0,p.default)("omnibar-item",{active:o.active}),children:[(0,a.jsxs)("div",{className:"title",children:[r," ",e.extra?(0,a.jsx)("span",{className:"extra",children:e.extra}):null]}),e.description?(0,a.jsx)("div",{className:"description",children:e.description}):null]})},s)}),[]),g=u.useCallback(((e,t)=>{const n=e.toLowerCase().split("").map((e=>{return`${t=e,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*`;var t})).join(""),o=new RegExp(n);return!!t.title.toLowerCase().match(o)}),[]),I=u.useCallback((t=>{e.onCommand(t.cmd),e.onClose()}),[e]);return i?(0,a.jsx)(l.Omnibar,{query:n,onQueryChange:o,onClose:e.onClose,noResults:(0,a.jsx)(d.MenuItem,{disabled:!0,text:"No results."}),itemPredicate:g,isOpen:e.visible,items:i,initialContent:void 0,onItemSelect:I,itemRenderer:h,inputProps:{placeholder:"Search for nodes or commands.."}}):null}},60698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43490:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31874),t)},31874:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.usePorts=t.useConfirm=t.usePrompt=t.PortsContext=t.defaultPorts=void 0;const s=n(70079),r=n(74762),a=n(84472);i(n(60698),t);const u=e=>async()=>{console.warn(`${e} Not implemented`),(0,a.toastMsg)("Feature not implemented in this context yet","warning")};t.defaultPorts={prompt:async e=>{let{text:t,defaultValue:n}=e;return prompt(`${t}`,n)},openFile:async e=>{},confirm:async e=>{let{text:t}=e;return confirm(t)},readFlow:u("readFlow"),setFlow:u("setFlow"),resolveDeps:u("resolveDeps"),getImportables:u("getImportables"),onExternalFlowChange:u("onExternalFlowChange"),onInstallRuntimeRequest:u("onInstallRuntimeRequest"),onRunFlow:u("onRunFlow"),onStopFlow:u("onStopFlow"),reportEvent:r.noop,generateNodeFromPrompt:u("generateNodeFromPrompt"),hasOpenAiToken:()=>Promise.resolve(!1)},t.PortsContext=(0,s.createContext)(t.defaultPorts);t.usePrompt=()=>{const e=(0,s.useContext)(t.PortsContext).prompt;return(t,n)=>e({text:t,defaultValue:n})};t.useConfirm=()=>{const e=(0,s.useContext)(t.PortsContext).confirm;return t=>e({text:t})};t.usePorts=()=>(0,s.useContext)(t.PortsContext)},65758:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelected=void 0;const i=n(74762),s=o(n(53865)),r=n(22513);t.groupSelected=async(e,t,n,o,a)=>{const{instances:u,connections:l}=t,c=u.filter((t=>e.includes(t.id))),d=l.filter((t=>{let{from:n,to:o}=t;return-1!==e.indexOf(n.insId)||-1!==e.indexOf(o.insId)}));if(!c.length)throw new Error("visual without selections");const{visualNode:p,renamedInputs:f,renamedOutputs:m}=await(0,r.createGroup)(c,d,n,a),v=c.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),u[0].pos),h="ref"===o?(0,i.nodeInstance)((0,i.createInsId)(p),p.id,{},v):(0,i.inlineNodeInstance)((0,i.createInsId)(p),p,{},v),g=u.filter((t=>-1===e.indexOf(t.id))),I=l.map((e=>{const t=`${e.from.insId}.${e.from.pinId}`,n=`${e.to.insId}.${e.to.pinId}`;return f[n]?{...e,to:{insId:h.id,pinId:f[n]}}:m[t]?{...e,from:{insId:h.id,pinId:m[t]}}:e})).filter((t=>-1===e.indexOf(t.from.insId)&&-1===e.indexOf(t.to.insId)));return{newNode:p,currentNode:(0,s.default)(t,(e=>{e.instances=[...g,h],e.connections=I}))}}},74089:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(97106),t),i(n(18420),t),i(n(90680),t),i(n(84472),t),i(n(17102),t),i(n(82232),t),i(n(25779),t),i(n(25804),t),i(n(9958),t),i(n(68120),t),i(n(94651),t),i(n(73470),t),i(n(94007),t),i(n(60190),t),i(n(9001),t),i(n(7047),t),i(n(23386),t)},31745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoTooltip=void 0;const o=n(35250),i=n(50382),s=n(50382),r=n(44470),a=n(50382);t.InfoTooltip=e=>{const{content:t}=e;return(0,o.jsx)(s.Tooltip,{content:t,placement:"top",className:"info-tooltip",children:(0,o.jsx)(i.Icon,{icon:(0,o.jsx)(r.InfoSign,{className:a.Classes.INTENT_PRIMARY}),intent:i.Intent.SUCCESS,className:"info-tooltip-icon"})})}},83938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserOnlyReactJson=void 0;const o=n(35250);t.BrowserOnlyReactJson=e=>{if("undefined"==typeof window)return null;const t=n(73541).Z;return(0,o.jsx)(t,{...e})}},94651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsValueRenderer=void 0;const o=n(35250),i=n(74762),s=n(83938);t.AnalyticsValueRenderer=e=>{let{val:t}=e;try{const e=JSON.parse(t),n="object"==typeof e?e:{value:e},r=e&&[e.type,e.key,e.props,e.ref].every(i.isDefined),a=r?{jsxValue:e}:n;return(0,o.jsx)(s.BrowserOnlyReactJson,{src:a,collapseStringsAfterLength:50,collapsed:r})}catch(n){return(0,o.jsx)(s.BrowserOnlyReactJson,{src:{value:t},collapseStringsAfterLength:50})}}},22513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=void 0;const o=n(74762),i=n(74762),s=n(60190),r=n(88593);t.createGroup=async(e,t,n,a)=>{if(0===e.length)throw new Error("cannot create group without instances");const u=e.map((e=>e.id)),l=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return!t&&n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.to,e.to)))===t)),c=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return t&&!n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.from,e.from)))===t));let d={},p={},f={},m={};const v=[],h={};for(const o of l){const e=`${o.to.insId}.${o.to.pinId}`,t=`${o.from.insId}.${o.from.pinId}`,n=o.to.pinId;if(f[t]){v.push({from:(0,i.externalConnectionNode)(f[t]),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)});continue}const r=h[n]?await a(`Name this input (${n} of ${o.to.insId}) is already taken:`)||`i${(0,s.rnd)()}`:n;d[e]=r,f[t]=r,v.push({from:(0,i.externalConnectionNode)(r),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)}),h[r]=(0,i.nodeInput)()}const g={};for(const r of c){const e=`${r.to.insId}.${r.to.pinId}`,t=`${r.from.insId}.${r.from.pinId}`,n=r.from.pinId;if(m[e]){v.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(m[e])});continue}const u=g[n]?await a(`Name this output (${n} of ${r.from.insId} is already taken:`)||`i${(0,s.rnd)()}`:n;p[t]=u,m[e]=u,v.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(u)}),g[u]=(0,o.nodeOutput)()}e.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),e[0].pos);const I=t.filter((e=>u.includes(e.from.insId)&&u.includes(e.to.insId)));return{visualNode:{id:n,inputs:h,outputs:g,instances:e,defaultStyle:{size:"large",color:(0,o.pickRandom)(r.nodeStylePresetColors.map((e=>e.color)))},inputsPosition:(0,o.okeys)(h).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:0}})),{}),outputsPosition:(0,o.okeys)(g).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:400}})),{}),connections:[...I,...v],completionOutputs:(0,o.okeys)(g)},renamedInputs:d,renamedOutputs:p}}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightText=void 0;const o=n(35250);function i(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}t.highlightText=(e,t)=>{let n=0;const s=t.split(/\s+/).filter((e=>e.length>0)).map(i);if(0===s.length)return[e];const r=new RegExp(s.join("|"),"gi"),a=[];for(;;){const t=r.exec(e);if(!t)break;const i=t[0].length,s=e.slice(n,r.lastIndex-i);s.length>0&&a.push(s),n=r.lastIndex,a.push((0,o.jsx)("strong",{children:t[0]},n))}const u=e.slice(n);return u.length>0&&a.push(u),a}},17102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Loader=void 0;const o=n(35250);t.Loader=()=>(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)("svg",{width:"38",height:"38",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:"#007ec6",children:(0,o.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,o.jsxs)("g",{transform:"translate(1 1)",strokeWidth:"2",children:[(0,o.jsx)("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),(0,o.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:(0,o.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})})})},23386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;const o=n(74762);t.logger=(0,o.debugLogger)("editor")},561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadMonaco=void 0;const o=n(51848),i=n(23386);let s=!1;t.preloadMonaco=()=>{s||o.loader.init().then((()=>{(0,i.logger)("monaco preloaded"),s=!0}))}},68120:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHotkeys=t.currentHotkeys=void 0;const i=o(n(45240)),s=n(70079);t.currentHotkeys=new Map,t.useHotkeys=function(e,n,o,r,a){void 0===r&&(r=[]);const u=(0,s.useCallback)((function(){a&&!a.current||n(...arguments)}),[...r,n]);(0,s.useEffect)((()=>((0,i.default)(e,{},u),t.currentHotkeys.set(e,o),()=>{t.currentHotkeys.delete(e),i.default.unbind(e,u)})),[e,u,o])}},94007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeSessionStorage=t.safeLocalStorage=void 0,t.safeLocalStorage={getItem:function(){try{return localStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return localStorage.setItem(...arguments)}catch(e){return null}}},t.safeSessionStorage={getItem:function(){try{return sessionStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return sessionStorage.setItem(...arguments)}catch(e){return null}}}},90680:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocalStorage=t.useResizePref=t.userPreferences=t.useUserPref=void 0;const r=s(n(70079)),a=n(18420),u=n(94007);t.useUserPref=(e,n)=>{const[o,i]=r.useState((()=>{const o=t.userPreferences.getItem(e);return(0,a.isDefined)(o)?o:n}));r.useEffect((()=>{const o=t.userPreferences.getItem(e),s=(0,a.isDefined)(o)?o:n;i(s)}),[e]);return[o,n=>{t.userPreferences.setItem(e,n),i(n)}]},t.userPreferences=(()=>{const e=e=>`up.${e}`;return{getItem:t=>{const n=u.safeLocalStorage.getItem(e(t))||"",o=u.safeSessionStorage.getItem(e(t))||"";try{return JSON.parse(o||n).value}catch(i){return}},setItem:function(t,n,o){void 0===o&&(o=!1);const i=o?sessionStorage:u.safeLocalStorage;try{const o=JSON.stringify({value:n});return i.setItem(e(t),o),!0}catch(s){return console.error("Error saving user preference",s),!1}}}})();t.useResizePref=(e,n)=>{const o=`resize.${e}`;return(0,t.useUserPref)(o,n)};const l=e=>{const t=u.safeLocalStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch(n){return null}};t.useLocalStorage=(e,t)=>{const[n,o]=r.useState(l(e)||t),i=r.useCallback((t=>{u.safeLocalStorage.setItem(e,JSON.stringify({value:t})),o(t)}),[e]);return r.useEffect((()=>{l(e)||u.safeLocalStorage.setItem(e,JSON.stringify({value:t}))}),[e,t,i]),[n,i]}},60190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.totalEnergy=t.itrPhysics=t.hookes=t.coulombs=t.vToStr=t.vNorm=t.vLen=t.vSub=t.vAdd=t.vDiv=t.vMul=t.vZero=t.rnd=t.vec=t.size=void 0;t.size=(e,t)=>({width:e,height:t});t.vec=(e,t)=>({x:e,y:t});t.rnd=function(e,t){return void 0===e&&(e=100),void 0===t&&(t=0),Math.floor(Math.random()*(e-t))+t},t.vZero={x:0,y:0};t.vMul=(e,t)=>{let{x:n,y:o}=e;return{x:n*t,y:o*t}};t.vDiv=(e,n)=>{let{x:o,y:i}=e;return(0,t.vMul)({x:o,y:i},1/n)};t.vAdd=(e,t)=>({x:e.x+t.x,y:e.y+t.y});t.vSub=(e,n)=>(0,t.vAdd)(e,(0,t.vMul)(n,-1));t.vLen=e=>{let{x:t,y:n}=e;return Math.sqrt(t*t+n*n)};t.vNorm=e=>(0,t.vDiv)(e,(0,t.vLen)(e)||1);t.vToStr=e=>{let{x:t,y:n}=e;return`${t.toFixed(1)},${n.toFixed(1)}`};t.coulombs=(e,n,o)=>{const i=(0,t.vLen)((0,t.vSub)(e.p,n.p));if(0===i){const i=(0,t.vec)(2*Math.random()-1,2*Math.random()-1),s=e.m*n.m/Math.pow(10,2);return(0,t.vMul)(i,s*o)}{const s=(0,t.vNorm)((0,t.vSub)(n.p,e.p)),r=e.m*n.m/Math.pow(i+.1,2);return(0,t.vMul)(s,r*o)}};t.hookes=(e,n,o,i,s)=>{const r=(0,t.vLen)((0,t.vSub)(e.p,n.p)),a=(0,t.vNorm)((0,t.vSub)(e.p,n.p));let u=0;return ri&&(u=i-r),(0,t.vMul)(a,s*u)};t.itrPhysics=(e,n)=>{const{p:o,v:i,f:s,m:r}=n,a=(0,t.vDiv)(s,r),u=e/1e3,l=(0,t.vAdd)((0,t.vMul)(a,u),i),c=(0,t.vAdd)((0,t.vMul)(l,u),o);return{...n,p:c,v:l,f:(0,t.vec)(0,0)}};t.totalEnergy=e=>e.reduce(((e,n)=>{const o=(0,t.vLen)(n.v);return e+.5*n.m*o*o}),0)},84472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateToast=t.toastMsg=t.AppToaster=void 0;const o=n(50382);t.AppToaster=(()=>{try{return o.OverlayToaster.create({className:"app-toaster",position:o.Position.BOTTOM_RIGHT})}catch(e){return{}}})();t.toastMsg=(e,n,o)=>t.AppToaster.show({message:e,intent:n,timeout:o});t.updateToast=(e,n,o)=>t.AppToaster.show({message:n,intent:o},e)},18420:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultAnd=t.isLocal=t.fullTime=t.timeAgoFromDt=t.timeAgo=t.toString=t.isDefined=t.set=t.createOmap=t.toOmap=t.values=t.keys=t.entries=void 0;const i=n(7047),s=n(74762),r=o(n(73136));t.entries=e=>Object.keys(e).map((t=>[t,e[t]]));t.keys=e=>Object.keys(e);t.values=e=>Object.keys(e).map((t=>e[t]));t.toOmap=e=>Array.from(e.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.createOmap=function(e){return void 0===e&&(e=[]),e.reduce(((e,t)=>({...e,[t[0]]:t[1]})),{})};t.set=(e,t,n)=>{e[t]=n};t.isDefined=e=>void 0!==e;t.toString=e=>{const t=typeof e;if(""===e)return"(empty string)";if((0,i.isJsxValue)(e))return"JSX Value";if((0,s.isStaticValueVisualNode)(e))return"Embedded Node";if((0,s.isEnvValue)(e))return(0,s.getEnvKeyFromValue)(e);if("object"===t)try{const t=JSON.stringify(e);return"{}"===t?"Empty object":t}catch(n){return"Object (cannot stringify)"}return`${e}`};t.timeAgo=e=>(0,r.default)(new Date(e)).fromNow();t.timeAgoFromDt=e=>(0,r.default)(Date.now()-e).fromNow();t.fullTime=e=>(0,r.default)(new Date(e)).toString();t.isLocal=()=>location.href.includes(":300");t.preventDefaultAnd=e=>t=>{t.preventDefault(),e(t)}},67181:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ActionButton=t.ActionsMenu=t.ActionType=void 0;const r=n(35250),a=n(50382),u=n(50382),l=n(74762),c=s(n(70079)),d=n(86125),p=n(43490),f=n(68120),m=n(90680),v=n(84472),h=n(9971),g=n(47749),I=n(46334),y=n(47230),b=n(41032);var C;!function(e){e.AddNode="add-node",e.RemoveNode="remove-node",e.Group="group",e.UnGroup="un-group",e.AddInlineValue="add-inline-value",e.Inspect="inspect",e.Run="run",e.AI="ai"}(C=t.ActionType||(t.ActionType={}));t.ActionsMenu=e=>{const{onAction:n,selectedInstances:o,resolvedNodes:i,node:s,from:u,to:g,hotkeysEnabled:x,showRunFlowOptions:N}=e,{onRequestImportables:w}=(0,d.useDependenciesContext)(),[j,P]=c.default.useState(!1),[O,E]=c.default.useState(!1),[D,S]=c.default.useState(!1),[M,T]=c.default.useState(null),[k,R]=(0,m.useLocalStorage)("hideHotkeyHintMap",{}),A=(0,c.useCallback)((()=>{P(!1)}),[]),{onRunFlow:V,generateNodeFromPrompt:$,reportEvent:z}=(0,p.usePorts)(),H=(0,c.useCallback)(((e,t)=>(E(!1),V(e,t))),[V]),G=[];if(G.push(C.AddNode),G.push(C.AddInlineValue),1===o.length){const e=s.instances.find((e=>e.id===o[0]));if(e)try{const t=(0,b.safelyGetNodeDef)(e,i);(0,l.isVisualNode)(t)&&G.push(C.UnGroup)}catch(U){console.error(`Could not find node with id ${o[0]} - ${U}`)}else console.error(`Could not find instance with id ${o[0]}`)}N&&G.push(C.Run),o.length>0&&G.push(C.Group),(1===o.length||u||g)&&G.push(C.Inspect),o.length>0&&G.push(C.RemoveNode),G.push(C.AI);const L=(0,c.useCallback)(((e,t)=>{R({...k,[e]:!0}),v.AppToaster.dismiss(t)}),[k,R]),F=(0,c.useCallback)(((e,t)=>{const{hotkey:o}=_[e];if("click"===t.type&&o&&!k[o]){const t=(0,v.toastMsg)((0,r.jsxs)(r.Fragment,{children:["Did you know? you can also use the hotkey"," ",(0,r.jsx)("kbd",{className:"hotkey",children:o})," to"," ",_[e].text.replace(/^[A-Z]/,(e=>e.toLowerCase())),(0,r.jsxs)(a.Button,{minimal:!0,small:!0,onClick:()=>L(o,t),children:[" ","Don't show again"," "]})]}),"none",3e3)}switch(e){case C.AddNode:P(!0);break;case C.Run:!async function(){E(!0)}();break;case C.AI:S(!0);break;default:n({type:e,data:void 0})}}),[k,n,L,s.inputs]);Object.entries(_).forEach((e=>{let[t,n]=e;n.hotkey&&(0,f.useHotkeys)(n.hotkey,(e=>{e.preventDefault(),G.includes(t)&&(F(t,e),R({...k,[n.hotkey]:!0}))}),{text:n.text,group:"Action menu hotkeys"},[G],x)}));const B=(0,c.useCallback)((e=>{n({type:C.AddNode,data:{importableNode:e}})}),[n]),q=(0,c.useCallback)((async e=>{const t=Date.now();T(t);try{z("generateNodeFromPrompt:start",{promptLength:e.length});const o=await $({prompt:e}),{inputs:i,outputs:s}=o.importableNode.node,r=Date.now()-t;z("generateNodeFromPrompt:success",{totalTime:r,inputs:Object.keys(i),outputs:Object.keys(s)}),T(null),n({type:C.AI,data:o}),S(!1)}catch(U){T(null),v.AppToaster.show({message:"Failed to generate node",intent:"danger"}),z("generateNodeFromPrompt:failure",{error:U.message})}}),[$,n,z]);return(0,r.jsxs)("div",{className:"actions-menu",children:[G.map((e=>(0,r.jsx)(t.ActionButton,{type:e,onClick:F},e))),j?(0,r.jsx)(h.AddNodeMenu,{onRequestImportables:w,onAddNode:B,onClose:A}):null,O?(0,r.jsx)(y.RunFlowModal,{onClose:()=>E(!1),onRun:H,node:s}):null,D?(0,r.jsx)(I.PromptAIMenu,{onClose:()=>{S(!1),T(null)},onSubmit:q,submitting:null!==M,submitTime:M}):null]})};const _={[C.AddNode]:{icon:g.addNodeIcon,text:'Open the "add node" menu',hotkey:"a"},[C.RemoveNode]:{icon:g.removeNodeIcon,text:"Remove selected instances",hotkey:"backspace"},[C.Group]:{icon:g.groupIcon,text:"Group selection into a new node",hotkey:"g"},[C.UnGroup]:{icon:g.ungroupIcon,text:"Ungroup selected visual node"},[C.Inspect]:{icon:g.inspectIcon,text:"Inspect data",hotkey:"i"},[C.AddInlineValue]:{icon:g.pencilIcon,text:"Add value / inline function",hotkey:"v"},[C.Run]:{icon:g.playIcon,text:"Run flow",hotkey:"r"},[C.AI]:{icon:g.starIcon,text:"Generate new code node using AI \u2728"}},x={icon:"",text:"N/A",hotkey:void 0};t.ActionButton=e=>{var t;const{onClick:n,type:o}=e,i=(0,c.useCallback)((e=>n(o,e)),[n,o]),s=null!==(t=_[o])&&void 0!==t?t:x,a=s.hotkey?(0,r.jsxs)("span",{children:[s.text," ",(0,r.jsx)("kbd",{className:"hotkey",children:s.hotkey})]}):s.text;return(0,r.jsx)("div",{className:"action-button",onClick:i,"data-type":o,children:(0,r.jsx)(u.Tooltip,{hoverOpenDelay:100,content:a,className:"icon-wrapper",popoverClassName:"action-button-tooltip",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s.icon}})})})}},40149:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenu=t.AddNodeMenuFilterTree=void 0;const a=n(35250),u=n(50382),l=n(74762),c=r(n(26372)),d=s(n(70079)),p=n(43490),f=n(31745),m=n(17102),v=n(87935),h=n(74657),g=n(44470);t.AddNodeMenuFilterTree=u.Tree.ofType();function I(e,t,n){return[...e.external.map((e=>({id:e.module,label:e.module,hasCaret:!0,nodeData:{type:"external",module:e.module},isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module,isExpanded:n.has(e.module),childNodes:e.namespaces.map((o=>({id:`${e.module}/${o}`,label:o,hasCaret:!1,isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module&&t.namespace===o,isExpanded:n.has(`${e.module}/${o}`),nodeData:{type:"external",module:e.module,namespace:o}})))}))),{id:"internal",label:"Current Project",nodeData:{type:"internal"},isExpanded:n.has("internal"),hasCaret:!0,isSelected:"internal"===t.type,childNodes:e.internal.files.map((e=>({id:e,label:e,isSelected:"internal"===t.type&&t.file===e,hasCaret:!1,isExpanded:n.has(e),nodeData:{type:"internal",file:e}})))}]}function y(e){return/\.flyde(\.[jt]s)?$/.test(e.module)}t.AddNodeMenu=e=>{const{onRequestImportables:n,onAddNode:o,onClose:i}=e,[s,r]=d.default.useState(),[b,C]=d.default.useState([]),[_,x]=d.default.useState(new Set),[N,w]=d.default.useState(""),[j,P]=d.default.useState({type:"all"}),[O,E]=d.default.useState(null),[D,S]=d.default.useState(null),[M,T]=d.default.useState(null),k=(0,d.useCallback)((e=>{_.add(e.id),x(new Set(_))}),[_]),R=(0,d.useCallback)((e=>{_.delete(e.id),x(new Set(_))}),[_]),A=(0,d.useCallback)((e=>{o(e),i()}),[o,i]),{onInstallRuntimeRequest:V,reportEvent:$}=(0,p.usePorts)();(0,d.useEffect)((()=>{$("addNodeMenuOpen",{})}),[$]),(0,d.useEffect)((()=>{S(null==s?void 0:s.flatMap((e=>{var t,n,o;if(j)if("external"===j.type){if((e.module!==j.module||j.namespace)&&e.node.namespace!==j.namespace)return[]}else if("internal"===j.type&&(!y(e)||j.file&&e.module!==j.file))return[];if(N){const i=`${null!==(n=null===(t=e.node.searchKeywords)||void 0===t?void 0:t.join(" "))&&void 0!==n?n:[]} ${e.node.id} ${null!==(o=e.node.namespace)&&void 0!==o?o:""} ${e.node.description}`.toLowerCase().indexOf(N.toLowerCase());return-1===i?[]:[{importable:e,score:i}]}return[{importable:e,score:1}]})).sort(((e,t)=>e.score-t.score)).map((e=>{let{importable:t}=e;return t})))}),[s,j,N]),(0,d.useEffect)((()=>{n().then((e=>{let{importables:t,errors:n}=e;C(n);const o=t.filter((e=>!y(e))).reduce(((e,t)=>{var n,o,i;null!==(n=e[i=t.module])&&void 0!==n||(e[i]=[]);const s=null!==(o=t.node.namespace)&&void 0!==o?o:"";return e[t.module].includes(s)||e[t.module].push(s),e}),{}),i=t.filter(y).map((e=>e.module));E({external:Object.entries(o).map((e=>{let[t,n]=e;return{module:t,namespaces:n}})),internal:{files:i}}),r(t),x(new Set(["internal",...Object.keys(o)]))}))}),[n]);const z=(0,d.useCallback)((e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),D&&!M)return void T(D["ArrowDown"===e.key?0:D.length-1]);if(D&&M){const t=D.findIndex((e=>e===M));let n="ArrowDown"===e.key?t+1:t-1;n=n<0?D.length-1:n,n=n>=D.length?0:n,T(D[n])}break;case"Enter":M&&A(M)}}),[D,M,A]),H=(0,d.useCallback)((e=>{let{nodeData:t}=e;JSON.stringify(t)===JSON.stringify(j)?"external"===t.type?t.namespace?P({type:"external",module:t.module}):P({type:"all"}):"internal"===t.type&&(t.file?P({type:"internal"}):P({type:"all"})):P(t)}),[j]),G=!s||s.some((e=>e.module.includes("@flyde/stdlib"))),L=(0,d.useCallback)((()=>{V(),i()}),[i,V]);return(0,a.jsx)(u.Dialog,{isOpen:!0,title:"Add Node Menu",onClose:e.onClose,className:"add-node-menu",isCloseButtonShown:!0,children:(0,a.jsxs)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),children:[(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"bp5-input-group",children:[(0,a.jsx)(g.Search,{}),(0,a.jsx)("input",{className:"bp5-input",type:"search",placeholder:"Search input",dir:"auto",autoFocus:!0,onChange:e=>w(e.target.value),value:N,onKeyDown:z})]}),G?null:(0,a.jsxs)(u.Callout,{intent:u.Intent.NONE,style:{marginTop:10},children:["Using built-in @flyde/stdlib. It's recommended to explicitly install it instead."," ",(0,a.jsx)(u.Button,{minimal:!0,small:!0,intent:u.Intent.PRIMARY,onClick:L,children:"Click here to install it using npm/yarn"})]})]}),(0,a.jsx)("div",{className:"content-wrapper",children:s?(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsxs)("aside",{children:[(0,a.jsxs)("div",{className:"filter-header",children:["Filter by package"," ",(0,a.jsx)(u.Tooltip,{content:(0,a.jsxs)("span",{children:["Click to learn more about how packages work in Flyde"," "]}),hoverCloseDelay:1500,children:(0,a.jsx)("a",{target:"_blank",href:"https://www.flyde.dev/docs/packages",rel:"noreferrer",children:(0,a.jsx)(u.Icon,{icon:(0,a.jsx)(g.Help,{}),intent:"primary",iconSize:12})})})]}),(0,a.jsx)("div",{className:"tree-container",children:(0,a.jsx)(t.AddNodeMenuFilterTree,{contents:I(O,j,_),onNodeCollapse:R,onNodeExpand:k,onNodeClick:H,className:u.Classes.ELEVATION_0})})]}),(0,a.jsx)("main",{children:D?0===D.length?(0,a.jsxs)("div",{className:"no-results",children:[(0,a.jsx)(h.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:P,query:N,onChangeQuery:w,resultsCount:D.length}),(0,a.jsxs)(u.Callout,{className:"callout",intent:"primary",children:["Can't find a suitable node? Create one yourself!"," ",(0,a.jsx)("a",{href:"https://www.flyde.dev/docs/code-nodes",target:"_blank",rel:"noreferrer",children:"Learn more"})]})]}):(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsx)(h.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:P,query:N,onChangeQuery:w,resultsCount:D.length}),(0,a.jsx)("div",{className:"results",children:D.map((e=>(0,a.jsx)(v.AddNodeMenuListItem,{importableNode:e,onAdd:A,selected:(null==M?void 0:M.node)===e.node,onSelect:T,onSetFilter:P},e.node.id+e.node.namespace+e.module)))})]}):(0,a.jsx)(m.Loader,{})})]}):(0,a.jsx)(m.Loader,{})}),b.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",style:{marginTop:"10px"},children:["Found ",(0,l.simplePluralize)(b.length,"corrupt flow"),(0,a.jsx)(f.InfoTooltip,{content:b.map((e=>{let{path:t,message:n}=e;return`${t}: ${n}`})).join(", ")})," "]}):null]})})}},8470:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuListItem=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079));t.AddNodeMenuListItem=e=>{const{importableNode:t,onSetFilter:n,onAdd:o,onSelect:i}=e,{node:s,module:r}=t,{id:d,description:p}=s,f=c.default.useRef(null);c.default.useEffect((()=>{e.selected&&f.current&&f.current.scrollIntoView({block:"center"})}),[e.selected]);const m=(0,c.useCallback)((()=>{o(t)}),[o,t]),v=(0,c.useCallback)((()=>{i(t)}),[i,t]);return(0,a.jsxs)("div",{className:(0,l.default)("add-node-menu-list-item",{selected:e.selected}),ref:f,onClick:v,children:[(0,a.jsxs)("div",{className:"content",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("span",{className:"id",children:d}),(0,a.jsxs)(u.Tag,{interactive:!0,onClick:()=>n({type:"external",module:r,namespace:s.namespace}),className:"source",minimal:!0,children:[r,s.namespace?` / ${s.namespace}`:null]})]}),(0,a.jsx)("div",{className:"description",children:p||(0,a.jsx)("em",{children:"No description"})})]}),(0,a.jsx)("aside",{children:(0,a.jsx)(u.Button,{onClick:m,children:"Add"})})]})}},87935:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8470),t)},88671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuResultsSummary=void 0;const o=n(35250),i=n(50382);t.AddNodeMenuResultsSummary=e=>{const{resultsCount:t,query:n,filter:s,onChangeFilter:r,onChangeQuery:a}=e;return(0,o.jsxs)("div",{className:"add-node-menu-results-summary",children:[t?`Showing ${t} result${t>1?"s":""}`:"No results found","\xa0",n?(0,o.jsxs)(o.Fragment,{children:["matching query\xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>a(""),children:['"',n,'"']})]}):null,"all"===s.type?null:"external"===s.type?(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["package ",s.module,s.namespace?` / ${s.namespace}`:null]})]}):(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["\xa0this project ",s.file?` / ${s.file}`:null]})]})]})}},74657:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88671),t)},9971:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40149),t)},83159:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PromptAIMenu=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=1e4;t.PromptAIMenu=e=>{const{onClose:t}=e,[n,o]=c.default.useState(""),[i,s]=c.default.useState(0);return(0,c.useEffect)((()=>{s(0);const t=setInterval((()=>{s((t=>{const n=(Date.now()-e.submitTime)/d;return Math.min(n+.05*Math.random()/2,.95)}))}),500);return()=>clearInterval(t)}),[e.submitTime]),(0,a.jsxs)(u.Dialog,{isOpen:!0,onClose:t,className:"prompt-ai-menu",title:"\u2728 Generate Code Node using AI",children:[(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsx)(u.TextArea,{value:n,disabled:e.submitting,onChange:e=>o(e.target.value),placeholder:"Describe your node in details",fill:!0})}),e.submitTime?(0,a.jsx)("div",{className:"progress-bar-container",children:(0,a.jsx)(u.ProgressBar,{value:i})}):null,(0,a.jsx)("div",{className:u.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:u.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(u.Button,{onClick:t,children:"Close"}),(0,a.jsx)(u.Button,{intent:u.Intent.PRIMARY,className:"run-btn",disabled:e.submitting||!n,loading:e.submitting,onClick:()=>{s(0),e.onSubmit(n)},children:"Create \u2728"})]})})]})}},46334:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(83159),t)},3152:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RunFlowModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(90680),f=n(31745);t.RunFlowModal=u.memo((function(e){const{onRun:t,onClose:n,node:o}=e,[i,s]=u.useState(0),[r,m]=(0,p.useLocalStorage)(`run-inputs-${o.id}`,Object.keys(o.inputs).reduce(((e,t)=>(e[t]=`Enter a value for input ${t}`,e)),{})),[v,h]=u.useState(JSON.stringify(r,null,2)),g=e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})},I=u.useCallback((()=>{const e=JSON.parse(v);m(e),t(e,i)}),[t,m,v,i]),y=Object.keys(o.inputs),b=y.filter((e=>"required"!==o.inputs[e].mode)),C=u.useMemo((()=>y.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:"This node receives external inputs. Enter values for each input below:"}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"json",value:v,onChange:e=>h(null!=e?e:""),onMount:g}),b.length>0?(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Note: input(s) ",(0,a.jsx)("code",{children:b.join(", ")})," are optional"]}):null]}):(0,a.jsx)("strong",{children:"This node does not receive any external inputs."})),[y.length,b,v]);return(0,a.jsxs)(c.Dialog,{isOpen:!0,onClose:e.onClose,className:"run-flow-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&I()},tabIndex:0,children:[C,(0,a.jsxs)("div",{className:"execution-delay-wrapper",children:[(0,a.jsxs)("label",{children:["Execution delay:"," ",(0,a.jsx)(f.InfoTooltip,{content:"Delay between each node execution. Useful for debugging."})]}),(0,a.jsx)(c.Slider,{value:i,onChange:s,min:0,labelStepSize:500,stepSize:100,labelRenderer:e=>`${e}ms`,max:1e3})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:n,children:"Close"}),(0,a.jsx)(c.Button,{onClick:I,intent:c.Intent.PRIMARY,className:"run-btn",children:"Run"})]})})]})}))},47230:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3152),t)},47749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starIcon=t.stopIcon=t.playIcon=t.pencilIcon=t.ungroupIcon=t.groupIcon=t.inspectIcon=t.removeNodeIcon=t.addNodeIcon=void 0,t.addNodeIcon='\n\n',t.removeNodeIcon='\n\n',t.inspectIcon='\n\n\n',t.groupIcon='\n\n\n',t.ungroupIcon='\n\n\n',t.pencilIcon='\n\n',t.playIcon='\n\n\n',t.stopIcon='\n\n\n',t.starIcon='\n\n\n\n\n'},1237:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HelpBubble=void 0;const i=n(70079),s=n(35250),r=n(50382),a=n(99489),u=n(50382),l=o(n(70079)),c=n(68120),d=n(71644),p=n(43490),f={offset:{enabled:!0,options:{offset:[0,20]}},preventOverflow:{enabled:!0,options:{padding:10}}};const m=["Viewport Controls","Editing","Selection"];t.HelpBubble=()=>{const[e,t]=l.default.useState(!1),n=Array.from(c.currentHotkeys.entries()).map((e=>{let[t,n]=e;return{combo:(o={key:t,menuData:n}).key,label:o.menuData.text,group:o.menuData.group};var o})).reduce(((e,t)=>(e[t.group]||(e[t.group]=[]),e[t.group].push(t),e)),{}),o=Object.entries(n).sort(((e,t)=>m.indexOf(t[0])-m.indexOf(e[0]))),{reportEvent:v}=(0,p.usePorts)(),h=(0,s.jsx)(r.Dialog,{isOpen:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:r.Classes.DIALOG_BODY,children:o.map((e=>{let[t,n]=e;return(0,s.jsxs)(l.default.Fragment,{children:[(0,s.jsx)(r.H4,{children:t}),n.map((e=>(0,i.createElement)(a.Hotkey,{...e,key:e.combo})))]},t)}))})}),g=(0,s.jsxs)(r.Menu,{children:[(0,s.jsx)(r.MenuItem,{text:"Hotkeys",onClick:()=>{t(!0),v("helpMenuItem",{item:"hotkeys"})}}),(0,s.jsx)(r.MenuItem,{text:"Documentation",onClick:()=>v("helpMenuItem",{item:"documentation"}),href:"https://www.flyde.dev/docs",target:"_blank"}),(0,s.jsx)(r.MenuDivider,{}),(0,s.jsx)(r.MenuItem,{text:"Discord",onClick:()=>v("helpMenuItem",{item:"discord"}),href:"https://discord.gg/x7t4tjZQP8",target:"_blank"})]});return(0,s.jsxs)("div",{className:"help-bubble","data-tip":"Help",children:[(0,s.jsx)(u.Popover,{content:g,modifiers:f,onOpened:()=>v("helpMenuOpen",{}),children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:d.helpIcon}})}),h]})}},71644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpIcon=void 0,t.helpIcon='\n\n\n'},3354:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1237),t)},7011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainInstanceEventsIndicator=void 0;const o=n(35250),i=n(30994),s=n(66189),r=n(50382);t.MainInstanceEventsIndicator=e=>{const{currentInsId:t,ancestorsInsIds:n}=e,{history:a,refreshHistory:u,resetHistory:l}=(0,s.useHistoryHelpers)(t),c=`main-indicator-${t}}`;return(0,o.jsx)("div",{className:"main-instance-events-indicator",children:(0,o.jsx)(r.Tooltip,{content:(0,s.calcHistoryContent)(a),children:(0,o.jsx)("span",{onMouseEnter:u,onMouseOut:l,id:(0,i.getMainInstanceIndicatorDomId)(t,n),className:"status-text","data-tip":"","data-html":!0,"data-for":c})})})}},22714:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7011),t)},63521:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VisualNodeEditor=t.defaultBoardData=t.defaultViewPort=t.NODE_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=n(74762),c=n(86553),d=n(65082),p=n(18420),f=n(26701),m=n(7047),v=n(53865),h=n(70079),g=n(68120),I=r(n(27942)),y=n(50382),b=n(66005),C=n(60190),_=n(71033),x=n(74762),N=n(99942),w=n(44338),j=n(561),P=n(84472),O=n(82232),E=n(18594),D=n(68371),S=r(n(61888)),M=n(65758),T=n(43490),k=r(n(26372)),R=n(25044),A=n(80510),V=n(1788),$=n(2130),z=n(88593),H=n(97106),G=n(67181),L=n(22714),F=n(3354),B=n(41032),q=n(30653),U=u.memo(y.Slider),W=()=>null;t.NODE_HEIGHT=28;t.defaultViewPort={pos:{x:0,y:0},zoom:1},t.defaultBoardData={selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}},t.VisualNodeEditor=u.memo(u.forwardRef(((e,n)=>{const{onChangeNode:o,nodeIoEditable:i,onCopy:s,onGoToNodeDef:r,onInspectPin:J,boardData:Y,onChangeBoardData:K,currentInsId:Q,ancestorsInsIds:X,node:ee,onShowOmnibar:te,resolvedDependencies:ne,queuedInputsData:oe,initialPadding:ie,disableScrolling:se}=e,{onImportNode:re}=(0,H.useDependenciesContext)(),ae=(0,q.useDarkMode)(),{reportEvent:ue}=(0,T.usePorts)(),le=e.parentViewport||t.defaultViewPort,[ce,de]=(0,h.useState)({...ne,[ee.id]:ee});(0,h.useEffect)((()=>{de({...ne,[ee.id]:ee})}),[ne,ee]);const{selected:pe,from:fe,to:me}=Y,{instances:ve,connections:he,inputsPosition:ge,outputsPosition:Ie,inputs:ye,outputs:be}=ee,[Ce,_e]=(0,h.useState)(),[xe,Ne]=(0,h.useState)(),we=void 0===X,[je,Pe]=(0,h.useState)(0),[Oe,Ee]=(0,h.useState)(),[De,Se]=(0,h.useState)(!1),[Me,Te]=(0,h.useState)(),[ke,Re]=(0,h.useState)(),[Ae,Ve]=(0,h.useState)(),[$e,ze]=(0,h.useState)(),He=(0,h.useRef)();(0,f.useDidMount)((()=>{He.current=Xe.current.querySelector(".inline-editor-portal-root")}));const Ge=(0,T.useConfirm)(),Le=(0,T.usePrompt)(),Fe=Y.viewPort,Be=(0,h.useRef)(!0),[qe,Ue]=(0,h.useState)(null),We=u.useCallback((e=>{K({viewPort:e})}),[K]),Ze=u.useCallback(((e,t)=>J(e,t)),[J]),Je=u.useCallback(((e,t,n)=>{const i=(0,A.handleConnectionCloseEditorCommand)(ee,{from:e,to:t}),s=(0,l.isInternalConnectionNode)(t)?ve.find((e=>e.id===t.insId)):null,r=(s?s.inputConfig:{})[t.pinId],a=(0,l.isStaticInputPinConfig)(r)?(0,V.handleDetachConstEditorCommand)(i,t.insId,t.pinId):i;o(a,(0,O.functionalChange)("close-connection")),K({from:void 0,to:void 0}),ue("createConnection",{source:n})}),[ve,o,K,ee,ue]),Ye=u.useCallback((async()=>{const e=await Le("New visual node name?");if(!e)return;const{currentNode:t}=await(0,M.groupSelected)(Y.selected,ee,e,"inline",Le);o(t,(0,O.functionalChange)("group node")),(0,P.toastMsg)("Node grouped"),ue("groupSelected",{count:Y.selected.length})}),[Le,Y.selected,o,ee,ue]);(0,h.useEffect)((()=>{if(Oe){const e=setTimeout((()=>{Ee(void 0)}),350);return()=>clearTimeout(e)}}),[Oe]);const[Ke,Qe]=(0,h.useState)();(0,h.useEffect)((()=>{(0,j.preloadMonaco)()}),[]);const Xe=(0,h.useRef)(),et=(0,I.default)(Xe),tt=u.useRef({x:400,y:400}),nt=(0,f.useBoundingclientrect)(Xe)||C.vZero,ot=()=>{const e=(0,m.fitViewPortToNode)(ee,ce,et);(0,m.animateViewPort)(Fe,e,500,(e=>{We(e)}))},it=u.useCallback(((e,t)=>{const{to:n,from:o}=Y,i="input"===t?o:n,s="input"===t?n:o,r={pinId:e,insId:l.THIS_INS_ID},a="input"===t?{from:r}:{to:r};i&&i.pinId===e?K({from:void 0,to:void 0}):s?"input"===t&&n?Je(r,n,"nodeIoClick"):o&&Je(o,r,"nodeIoClick"):K(a)}),[Y,K,Je]),st=u.useCallback(((e,t,n)=>{const i=(0,v.produce)(ee,(o=>{"input"===e?o.inputs[t].description=n:o.outputs[t].description=n}));o(i,(0,O.functionalChange)("Node io description"))}),[o,ee]),rt=u.useCallback(((e,t,n)=>{const{from:o,to:i}=Y;if(fe&&fe.insId===e.id||me&&me.insId===e.id)K({from:void 0,to:void 0});else if("input"===n){const n={insId:e.id,pinId:t};!i||i.pinId!==t||(0,l.isInternalConnectionNode)(i)&&i.insId!==e.id?fe?Je(fe,n,"pinClick"):K({to:n,selected:[]}):K({to:void 0})}else{const n={insId:e.id,pinId:t};!o||o.pinId!==t||(0,l.isInternalConnectionNode)(o)&&o.insId!==e.id?me?Je(n,me,"pinClick"):K({from:n,selected:[]}):K({from:void 0})}}),[Y,fe,K,Je,me]);(0,h.useEffect)((()=>{if(!De&&et.width){const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);We(t);const n=setTimeout((()=>{const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);e.thumbnailMode||We(t),Se(!0)}),100);return()=>clearTimeout(n)}}),[ee,ie,et,e.thumbnailMode,De,ce,We]);const at=u.useCallback((()=>{const{selected:e}=Y,t=ee.instances.filter((t=>e.includes(t.id))).map((e=>({...e,id:e.id+"-copy"}))),n=ee.connections.filter((t=>{let{from:n,to:o}=t;return e.includes(n.insId)&&e.includes(o.insId)}));s({instances:t,connections:n})}),[Y,s,ee]),ut=u.useCallback((()=>{const{newNode:t,newInstances:n}=(0,R.pasteInstancesCommand)(ee,tt.current,e.clipboardData);o(t,(0,O.functionalChange)("paste instances")),K({selected:n.map((e=>e.id))})}),[o,K,ee,e.clipboardData]),lt=u.useCallback((()=>{const e=ee.id;Ke?"input"===Ke.type?Ke.ins.id===e?it(Ke.pin,"input"):rt(Ke.ins,Ke.pin,"input"):Ke.ins.id===e?it(Ke.pin,"output"):rt(Ke.ins,Ke.pin,"output"):console.warn("tried selecting closest with no pin nearby")}),[ee.id,Ke,it,rt]),ct=u.useCallback(((e,t)=>{const n=Math.min(Math.max(e,.1),3),o="mouse"===t?tt.current:{x:Fe.pos.x+et.width/2,y:Fe.pos.y+et.height/2},i=(0,m.centerBoardPosOnTarget)(o,et,n,Fe);We({...Fe,zoom:n,pos:i})}),[We,Fe,et]);(0,g.useHotkeys)("cmd+=",(e=>{ct(Fe.zoom+.1,"hotkey"),e.preventDefault()}),{text:"Zoom in board",group:"Viewport Controls"},[Fe,ct],Be),(0,g.useHotkeys)("cmd+-",(e=>{ct(Fe.zoom-.1,"hotkey"),e.preventDefault()}),{text:"Zoom out board",group:"Viewport Controls"},[ct,Fe.zoom],Be),(0,g.useHotkeys)("cmd+o",(e=>{e.preventDefault(),(0,P.toastMsg)("Ordering");const t=[];(0,N.orderVisualNode)(ee,ce,200,((e,n)=>{n%3==0&&t.push(e)})),(async()=>{for(;t.length;){const e=t.shift();(0,P.toastMsg)(`Step ${t.length}!`),await(0,l.delay)(200),o(e,(0,O.metaChange)("order-step")),(0,P.toastMsg)(`Step ${t.length}! done`)}})()}),{text:"Auto-layout (experimental)",group:"Misc."},[o,ee,ne],Be),(0,g.useHotkeys)("cmd+0",(e=>{ct(1),e.preventDefault()}),{text:"Reset zoom",group:"Viewport Controls"},[Fe,ct],Be);const dt=()=>{K({from:void 0,to:void 0,selected:[]})},pt=u.useCallback(((e,t)=>{_e(e.id),o({...ee},(0,O.metaChange)("drag-start"))}),[o,ee]),ft=u.useCallback(((e,t,n)=>{const{newValue:i,newSelected:s}=(0,m.handleInstanceDrag)(ee,e,n,t,pe,Ce);o(i,(0,O.metaChange)("drag-move")),s&&K({selected:s})}),[Ce,o,K,pe,ee]),mt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(void 0)}),[]),vt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(l.THIS_INS_ID)}),[]),ht=u.useCallback((async(t,n,o,i)=>{o.preventDefault(),o.stopPropagation();const{x:s,y:r}=i,a=(0,v.produce)(ee,(e=>{"input"===t?e.inputsPosition[n]={x:s,y:r}:e.outputsPosition[n]={x:s,y:r}}));e.onChangeNode(a,(0,O.metaChange)("node-io-drag-move"))}),[e,ee]),gt=u.useCallback((async(e,t,n,o)=>{n.preventDefault(),n.stopPropagation(),_e(void 0)}),[]),It=u.useCallback(((e,t)=>{let{id:n}=e;const o=t.shiftKey?pe.filter((e=>e!==n)):[],i=t.shiftKey?[...pe,n]:[n],s=pe.includes(n)?o:i;K({selected:s,from:void 0,to:void 0})}),[K,pe]),yt=u.useCallback((()=>{const e=ee.instances.map((e=>e.id));K({selected:e,from:void 0,to:void 0})}),[K,ee.instances]),bt=u.useCallback((e=>{const t=he.filter((t=>{let{from:n,to:o}=t;return-1===e.indexOf(n.insId)&&-1===e.indexOf(o.insId)})),n=(0,v.produce)(ee,(n=>{n.connections=t,n.instances=n.instances.filter((t=>!e.includes(t.id)))}));K({selected:[]}),o(n,(0,O.functionalChange)("delete-ins"))}),[he,o,K,ee]),Ct=u.useCallback((e=>{bt([e.id])}),[bt]),_t=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{"input"===e?(delete n.inputs[t],n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===t)))):(n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===t))),n.completionOutputs=(n.completionOutputs||[]).map((e=>e.split("+").filter((e=>e!==t)).join("+"))).filter((e=>!!e)),delete n.outputs[t])}));fe&&fe.insId===l.THIS_INS_ID&&fe.pinId===t?K({from:void 0}):me&&me.insId===l.THIS_INS_ID&&me.pinId===t&&K({to:void 0}),o(n,(0,O.functionalChange)("remove io pin"))}),[ee,fe,me,o,K]),xt=u.useCallback((async()=>{const{selected:e,from:t,to:n}=Y;0===e.length?t&&(0,l.isExternalConnectionNode)(t)?await Ge(`Are you sure you want to remove main input ${t.pinId}?`)&&_t("input",t.pinId):n&&(0,l.isExternalConnectionNode)(n)&&await Ge(`Are you sure you want to remove main output ${n.pinId}?`)&&_t("output",n.pinId):bt(e)}),[Ge,Y,bt,_t]),Nt=u.useCallback(((e,t,n)=>{const i=(0,m.getInstancePinConfig)(ee,e.id,t),s=(0,l.isStickyInputPinConfig)(i)?(0,x.queueInputPinConfig)():(0,l.stickyInputPinConfig)();o((0,m.changePinConfig)(ee,e.id,t,s),(0,O.functionalChange)("toggle-sticky")),ue("togglePinSticky",{isSticky:(0,l.isStickyInputPinConfig)(s)})}),[o,ee,ue]),wt=u.useCallback((()=>{const{newNode:e,newInstances:t}=(0,$.handleDuplicateSelectedEditorCommand)(ee,pe);o(e,(0,O.functionalChange)("duplicated instances")),K({selected:t.map((e=>e.id))})}),[o,K,ee,pe]),jt=u.useCallback((e=>{const t=e.nativeEvent.target;if(0===e.button&&Z(e.nativeEvent,ee.id)&&t&&"board-editor-inner"===t.className){if(Date.now()-je<300)return void te(e);Pe(Date.now());const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,nt),o=(0,m.domToViewPort)(n,Fe,le);Ne({from:o,to:o})}}),[ee.id,Fe,je,nt,le,te]),Pt=u.useCallback((e=>{if(Ue(null),Z(e.nativeEvent,ee.id)&&xe){if((0,m.calcSelectionBoxArea)(xe)>50){const t=(0,m.getInstancesInRect)(xe,ce,Fe,Kt.current,ee.instances,nt,le),n=e.shiftKey?[...pe,...t]:t;K({selected:n})}Ne(void 0)}}),[ee.id,ee.instances,xe,ce,Fe,nt,le,pe,K]),Ot=u.useCallback((e=>{if(!Z(e.nativeEvent,ee.id))return void(Be.current=!1);Be.current=!0;const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,(0,C.vAdd)(nt,C.vZero)),o=(0,m.domToViewPort)(n,Fe,le);xe&&Ne({...xe,to:o});const i=(0,m.findClosestPin)(ee,ce,n,nt,Q,X,Fe),s=Ke;if(i){(!s||s.ins!==i.ins||s.ins===i.ins&&s.pin!==i.pin)&&Qe({ins:i.ins,type:i.type,pin:i.id})}tt.current=o,K({lastMousePos:tt.current})}),[ee,nt,Fe,le,xe,ce,Q,X,Ke,K]),Et=u.useCallback((e=>{var t;"bp5-menu"!==(null===(t=e.relatedTarget)||void 0===t?void 0:t.className)&&(Qe(void 0),Be.current=!1)}),[]),Dt=u.useCallback(((e,t)=>{if(t){const t=(0,l.isInlineNodeInstance)(e)?e.node:(0,B.safelyGetNodeDef)(e.nodeId,ce);if(!t)throw new Error("Impossible state inspecting inexisting node");if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Cannot inspect a non visual node","warning");ze({insId:`${Q}.${e.id}`,node:t})}else if((0,l.isRefNodeInstance)(e)){const t=(0,B.safelyGetNodeDef)(e,ce);r(t)}else{const t=e.node;if(!(0,l.isInlineValueNode)(t))return void((0,l.isVisualNode)(t)?ze({insId:e.id,node:t}):(0,P.toastMsg)("Editing this type of node is not supported"));const n=atob(t.dataBuilderSource);Ve({insId:e.id,templateType:t.templateType,value:n,type:"existing"}),(0,P.toastMsg)("Editing inline visual node not supported yet")}}),[r,ce,Q]),St=u.useCallback((e=>{if((0,l.isInlineNodeInstance)(e)){const t=e.node;if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Not supported","warning");const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.filter((t=>t.id!==e.id)),n.connections=n.connections.filter((t=>{let{from:n,to:o}=t;return n.insId!==e.id&&o.insId!==e.id})),n.instances.push(...t.instances),n.connections.push(...t.connections.filter((e=>(0,l.isInternalConnectionNode)(e.from)&&(0,l.isInternalConnectionNode)(e.to))))}));o(n,{type:"functional",message:"ungroup"}),K({selected:[]})}else{const t=(0,B.safelyGetNodeDef)(e.nodeId,ce);if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Not supported","warning")}}),[ee,o,K,ce]),Mt=u.useCallback((async e=>{}),[]),Tt=u.useCallback(((e,t)=>{const n=(0,V.handleDetachConstEditorCommand)(ee,e.id,t);o(n,(0,O.functionalChange)("detach-const"))}),[o,ee]),kt=u.useCallback(((e,t)=>{const n=e.inputConfig[t]||(0,x.queueInputPinConfig)();(0,l.isStaticInputPinConfig)(n)&&(Re(n.value),P.AppToaster.show({message:"Value copied"}))}),[]),Rt=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{const o=n.instances.find((t=>t.id===e.id));if(!o)throw new Error("Impossible state");o.inputConfig[t]=(0,l.staticInputPinConfig)(ke),n.connections=n.connections.filter((n=>!(0,l.isInternalConnectionNode)(n.to)||!(n.to.insId===e.id&&n.to.pinId===t)))}));o(n,(0,O.functionalChange)("paste const value"))}),[ee,o,ke]),At=u.useCallback((async e=>{const t=await Le("New name?");if(!t)return;const n=(0,v.produce)(ee,(n=>{var o;"input"===e?(ee.inputs||(n.inputs={}),n.inputs[t]=(0,l.nodeInput)(),n.inputsPosition[t]=tt.current):(ee.outputs||(n.outputs={}),n.outputs[t]=(0,l.nodeOutput)(),n.outputsPosition[t]=tt.current,(null===(o=n.completionOutputs)||void 0===o?void 0:o.length)&&(0,P.toastMsg)("Note that this node has explicit completion outputs set. You may need to update them."))}));o(n,(0,O.functionalChange)("add new io pin")),ue("addIoPin",{type:e})}),[Le,ee,o,ue]),Vt=u.useCallback((async()=>{var e;const t=null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","),n=await Le("Edit completion outputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,v.produce)(ee,(e=>{e.completionOutputs=""===n?void 0:n.split(",")}));o(e,(0,O.functionalChange)("change node completions")),ue("editCompletionOutputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),$t=u.useCallback((async()=>{var e;const t=null===(e=ee.reactiveInputs)||void 0===e?void 0:e.join(","),n=await Le("Edit reactive inputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,v.produce)(ee,(e=>{e.reactiveInputs=""===n?void 0:n.split(",")}));o(e,(0,O.functionalChange)("change reactive inputs")),ue("editReactiveInputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),zt=u.useCallback((async()=>{const e=await Le("Description?",ee.description),t=(0,v.produce)(ee,(t=>{t.description=e}));o(t,(0,O.functionalChange)("Edit node description"))}),[Le,o,ee]),Ht=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{t.defaultStyle=e}));o(t,(0,O.functionalChange)("change default style")),ue("changeStyle",{isDefault:!0})}),[o,ee,ue]),Gt=u.useCallback((async(e,t)=>{const n=await Le("New name?",t)||t,i=(0,m.handleIoPinRename)(ee,e,t,n);o(i,(0,O.functionalChange)("rename io pin"))}),[ee,o,Le]),Lt=u.useCallback(((e,t)=>{const n=(0,m.handleChangeNodeInputType)(ee,e,t);o(n,(0,O.functionalChange)("toggle io pin optional"))}),[ee,o]),Ft=u.useCallback((e=>{switch(e.type){case G.ActionType.RemoveNode:{const e=(0,v.produce)(ee,(e=>{if(!(0,l.isVisualNode)(ee))throw new Error("Impossible state, deleting instances opf non visual node");e.instances=e.instances.filter((e=>!pe.includes(e.id))),e.connections=e.connections.filter((e=>!pe.includes(e.from.insId)&&!pe.includes(e.to.insId)))}));K({selected:[]}),o(e,(0,O.functionalChange)("remove-instances")),(0,P.toastMsg)(`Removed ${pe.length} instances(s)`),ue("deleteInstances",{count:pe.length});break}case G.ActionType.Inspect:if(1===pe.length)J(pe[0]);else if(fe||me){const e=null!=fe?fe:me,t=(0,l.isExternalConnectionNode)(e)?l.ROOT_INS_ID:e.insId;J(t,{type:fe?"output":"input",id:e.pinId})}ue("openInspectMenu",{source:"actionMenu"});break;case G.ActionType.Group:(async()=>{await Ye()})();break;case G.ActionType.UnGroup:{const e=ee.instances.find((e=>e.id===pe[0]));St(e);const t=(0,B.safelyGetNodeDef)(e,ce);(0,P.toastMsg)(`Ungrouped inline node ${t.id}`),ue("unGroupNode",{instancesCount:t.instances.length});break}case G.ActionType.AddInlineValue:Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"actionMenu"});break;case G.ActionType.AddNode:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,v.produce)(ee,(e=>{e.instances.push(r)})),u=(0,v.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,O.functionalChange)("add new instance")),K(u),(0,P.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;case G.ActionType.AI:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,v.produce)(ee,(e=>{e.instances.push(r)})),u=(0,v.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,O.functionalChange)("add new instance")),K(u),(0,P.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;default:(0,P.toastMsg)(`${e.type} not supported yet`)}}),[Y,fe,o,K,Ye,re,J,St,ee,ce,ue,pe,me,Fe,et]),Bt=()=>{const t=Y.from;return(0,p.entries)(ye).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"input",pos:ge[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,onDblClick:Zt,closest:!(!Ke||"input"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,inputMode:s.mode,onChangeInputMode:Lt,viewPort:Fe,onDragStart:vt,onDragEnd:gt,onDragMove:ht,onSelect:it,onSetDescription:st,selected:(null==t?void 0:t.pinId)===o,description:s.description,onMouseUp:Nn,onMouseDown:xn},o)}))},qt=()=>{const{to:t}=Y;return(0,p.entries)(be).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"output",pos:Ie[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,closest:!(!Ke||"output"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,viewPort:Fe,onDragStart:vt,onDragEnd:gt,onDragMove:ht,onSelect:it,onSetDescription:st,description:s.description,selected:(null==t?void 0:t.pinId)===o,onMouseUp:Nn,onMouseDown:xn},o)}))},Ut=()=>{if(xe){const{from:e,to:t}=xe,n=(0,m.logicalPosToRenderedPos)(e,Fe),o=(0,m.logicalPosToRenderedPos)(t,Fe),{x:i,y:s,w:r,h:u}=(0,m.getSelectionBoxRect)(n,o);return(0,a.jsx)("div",{className:"selection-box",style:{top:s,left:i,width:r,height:u}})}return null},Wt=u.useCallback((async(e,t,n,o)=>{if("input"===n){const n=e.inputConfig[t],o=(0,l.isStaticInputPinConfig)(n)?JSON.stringify(n.value):void 0;Ve({type:"static-input",insId:e.id,pinId:t,value:null!=o?o:JSON.stringify("Some static value")}),ue("addValueModalOpen",{source:"dblClickPin"})}else{const i=(0,B.safelyGetNodeDef)(e,ce);if(!(0,l.getNodeOutputs)(i)[t])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:o.clientX,y:o.clientY},ins:e,targetNode:i,pinId:t,pinType:n})}}),[ce,ue]),Zt=u.useCallback((async(e,t)=>{if(!ee.inputs[e])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:t.clientX,y:t.clientY},pinId:e,pinType:"input",targetNode:ee})}),[ee]),Jt=u.useCallback((e=>{if(e.metaKey||e.ctrlKey){const t=-.005*e.deltaY;ct(Fe.zoom+t,"mouse"),e.preventDefault(),e.stopPropagation()}else{if(se)return;const t=e.deltaX,n=e.deltaY,o=(0,v.produce)(Fe,(e=>{e.pos.x=e.pos.x+t/e.zoom,e.pos.y=e.pos.y+n/e.zoom}));We(o),e.stopPropagation(),e.preventDefault()}}),[se,ct,We,Fe]);(0,h.useEffect)((()=>{const{current:e}=Xe;if(e)return e.addEventListener("wheel",Jt),()=>{e.removeEventListener("wheel",Jt)}}),[Jt]);const Yt={backgroundPositionX:(0,m.roundNumber)(-Fe.pos.x*Fe.zoom),backgroundPositionY:(0,m.roundNumber)(-Fe.pos.y*Fe.zoom),backgroundSize:(0,m.roundNumber)(10*Fe.zoom)+"px"},Kt=u.useRef(new Map);u.useEffect((()=>{const e=ve.reduce(((e,t)=>{const n=(0,B.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeInputs)(n))),e}),new Map),t=ve.reduce(((e,t)=>{const n=(0,B.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeOutputs)(n))),e}),new Map);e.set(l.THIS_INS_ID,(0,l.keys)(ee.outputs)),t.set(l.THIS_INS_ID,(0,l.keys)(ee.inputs));const n=he.filter((n=>{const o=e.get(n.to.insId)&&e.get(n.to.insId).includes(n.to.pinId),i=t.get(n.from.insId)&&t.get(n.from.insId).includes(n.from.pinId);return!(o&&i)}));if(n.length>0){(0,P.toastMsg)(`${n.length} orphan connections removed`,"warning"),console.warn(`${n.length} orphan connections removed`,n);const e=(0,v.produce)(ee,(e=>{e.connections=ee.connections.filter((e=>!n.includes(e)))}));o(e,(0,O.functionalChange)("prune orphan connections"))}}),[ve,o,he,ee,ce]),u.useEffect((()=>{let e=[];const t=(0,v.produce)(ee,(t=>{t.instances=t.instances.map((t=>{const n=(0,B.safelyGetNodeDef)(t,ce);if(n){const o=(0,l.getNodeInputs)(n),i=(0,l.getNodeOutputs)(n);if(t.visibleInputs){const n=t.visibleInputs.filter((e=>!o[e]));n.length>0&&(t.visibleInputs=(0,l.keys)(o),e.push(...n))}if(t.visibleOutputs){const n=t.visibleOutputs.filter((e=>!i[e]));n.length>0&&(t.visibleOutputs=(0,l.keys)(i),e.push(...n))}}return t}))}));e.length>0&&((0,P.toastMsg)(`Found ${e.length} invalid visible inputs/outputs: ${e.join(", ")}. Reset them`,"warning"),o(t,(0,O.functionalChange)("reset corrupt visible inputs/outputs")))}),[ve,o,ee,ce]),(0,h.useEffect)((()=>{const e=new Map(ve.map((e=>[e.id,e])));Kt.current=he.reduce(((t,n)=>{const o=t.get(n.to.insId)||{},i=o[n.to.pinId]||[],s={...o,[n.to.pinId]:[...i,e.get(n.from.insId)]};return t.set(n.to.insId,s),t}),new Map)}),[he,ve]);const Qt=u.useCallback((()=>{Te(void 0)}),[]),Xt=u.useCallback((async e=>{if(!Me)throw new Error("impossible state - quick add menu invoked but not available");const{ins:t,pinId:n}=Me;switch(e.type){case"import":case"node":{const i="import"===e.type?await re(e.importableNode):ce,s="import"===e.type?e.importableNode.node:e.node,r=(0,m.createNewNodeInstance)(s.id,100,tt.current,i);if(r){const e=(0,v.produce)(ee,(e=>{e.instances.push(r),e.connections.push({from:{insId:t?t.id:l.THIS_INS_ID,pinId:n},to:{insId:r.id,pinId:l.TRIGGER_PIN_ID}})}));o(e,(0,O.functionalChange)("add-item-quick-menu")),Qt()}ue("addNode",{nodeId:s.id,source:"quickAdd"});break}case"value":if(!t)return void(0,P.toastMsg)("Cannot add value to main input");Ve({type:"new-output",insId:t.id,pinId:n}),ue("addValueModalOpen",{source:"quickAdd"})}}),[Me,ce,ue,ee,o,Qt,re]),en=u.useCallback((async()=>{const e=JSON.stringify(ee);await navigator.clipboard.writeText(e),P.AppToaster.show({message:"Copied!"})}),[ee]),tn=u.useCallback((()=>{var e,t;const n=i?"":" (cannot edit main node, only visual)";return(0,a.jsxs)(y.Menu,{children:[(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"New Value",onClick:(0,p.preventDefaultAnd)((()=>{Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"contextMenu"})}))}),(0,a.jsx)(y.MenuItem,{text:`New input ${n}`,onMouseDown:e=>e.stopPropagation(),onClick:(0,p.preventDefaultAnd)((()=>At("input"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`New output ${n}`,onClick:(0,p.preventDefaultAnd)((()=>At("output"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Copy node to clipboard",onClick:(0,p.preventDefaultAnd)(en)}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Completion Outputs (${(null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Vt()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Reactive inputs (${(null===(t=ee.reactiveInputs)||void 0===t?void 0:t.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>$t()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Edit description",onClick:(0,p.preventDefaultAnd)((()=>zt()))}),(0,a.jsx)(y.MenuDivider,{}),(0,a.jsx)(y.MenuItem,{text:"Default Style",children:(0,a.jsx)(z.NodeStyleMenu,{style:ee.defaultStyle,onChange:Ht,promptFn:Le})})]})}),[i,en,ee.completionOutputs,ee.reactiveInputs,ee.defaultStyle,Ht,Le,ue,At,Vt,$t,zt]);(0,g.useHotkeys)("shift+c",ot,{text:"Center viewport",group:"Viewport Controls"},[],Be),(0,g.useHotkeys)("cmd+c",at,{text:"Copy instances",group:"Editing"},[],Be),(0,g.useHotkeys)("cmd+v",ut,{text:"Paste instances",group:"Editing"},[],Be),(0,g.useHotkeys)("esc",dt,{text:"Clear selections",group:"Selection"},[],Be),(0,g.useHotkeys)("backspace",xt,{text:"Delete instances",group:"Editing"},[],Be),(0,g.useHotkeys)("shift+d",wt,{text:"Duplicate selected instances",group:"Editing"},[],Be),(0,g.useHotkeys)("cmd+a",yt,{text:"Select all",group:"Selection"},[],Be),(0,g.useHotkeys)("s",lt,{text:"Select pin closest to mouse",group:"Selection"},[],Be);const nn=u.useCallback(((e,t)=>{if(!$e)throw new Error("impossible state");const n=(0,v.produce)(ee,(t=>{const n=t.instances.find((e=>e.id===$e.insId));if(!n||!(0,l.isInlineNodeInstance)(n))throw new Error("impossible state");n.node=e}));o(n,(0,O.functionalChange)("Inner change: "+t.message)),ze((t=>({...t,node:e})))}),[o,$e,ee]),[on,sn]=(0,h.useState)({selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}}),rn=u.useCallback((e=>sn((t=>({...t,...e})))),[]),an=n=>$e&&$e.insId===n.id?{currentInsId:$e.insId,ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),boardData:on,onChangeBoardData:rn,resolvedDependencies:ne,onCopy:s,clipboardData:e.clipboardData,onInspectPin:e.onInspectPin,onGoToNodeDef:e.onGoToNodeDef,nodeIoEditable:e.nodeIoEditable,node:$e.node,onChangeNode:nn,onShowOmnibar:te,parentViewport:t.defaultViewPort,parentBoardPos:nt,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:e.queuedInputsData}:void 0,un=()=>{if(fe&&("input"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"output"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(e)&&!(0,l.isInternalConnectionNode)(fe))return;return{from:fe,to:e}}if(me&&("output"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"input"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(me)&&!(0,l.isInternalConnectionNode)(e))return;return{from:e,to:me}}},ln=()=>{const e=un();if(e){const{from:t,to:n}=e;return{connection:{from:t,to:n},type:he.some((t=>(0,l.connectionDataEquals)(t,e)))?"future-remove":"future-add"}}},cn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleInputs:t}:n))}));o(n,(0,O.functionalChange)("change instance visible inputs"))}),[ee,o]),dn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,style:t}:n))}));o(n,(0,O.functionalChange)("change instance style")),ue("changeStyle",{isDefault:!1})}),[o,ee,ue]),pn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleOutputs:t}:n))}));o(n,(0,O.functionalChange)("change instance visible outputs"))}),[ee,o]),fn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,displayName:t}:n))}));o(n,(0,O.functionalChange)("change instance display name"))}),[ee,o]);u.useImperativeHandle(n,(()=>({centerInstance(e){const t=ee.instances.find((t=>t.id===e));if(t){const e=(0,C.vSub)(t.pos,(0,C.vec)(et.width/2,et.height/2));We({...Fe,pos:e})}},centerViewPort(){ot()},getViewPort:()=>Fe,clearSelection:()=>{dt()},requestNewInlineValue:()=>{Ve({type:"new-floating",pos:tt.current})}})));const[mn,vn]=u.useState([]),hn=u.useCallback(((e,t)=>{const n=t.trim().substr(0,100),i=`Inline-value-${n.substr(0,15).replace(/["'`]/g,"")}`,s=(0,D.createInlineValueNode)({code:t,customView:n,nodeId:i,type:e});switch(Ae.type){case"existing":{const[e]=ee.instances.filter((e=>e.id===Ae.insId)).filter((e=>(0,l.isInlineNodeInstance)(e))).map((e=>e.node));if(!e)throw new Error("Unable to find inline node to save to");const t=(0,l.keys)(e.inputs),n=(0,l.keys)(s.inputs),i=new Set(S.default.difference(t,n)),r=(0,v.produce)(ee,(e=>{e.instances=e.instances.map((e=>e.id===Ae.insId?(0,l.inlineNodeInstance)(e.id,s,e.inputConfig,e.pos):e)),e.connections=e.connections.filter((e=>!(e.to.insId===Ae.insId&&i.has(e.to.pinId))))}));o(r,(0,O.functionalChange)("change inline value")),Ve(void 0);break}case"static-input":{let e;try{const n=t.replace(/^['`]/,'"').replace(/['`]$/,'"');e=JSON.parse(n)}catch(r){return void(0,P.toastMsg)("Input values must not be formulas or code")}const n=(0,v.produce)(ee,(t=>{t.instances.find((e=>e.id===Ae.insId)).inputConfig[Ae.pinId]=(0,l.staticInputPinConfig)(e)}));o(n,(0,O.functionalChange)("set static input value")),Ve(void 0);break}case"new-floating":{const e=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},Ae.pos),t=(0,v.produce)(ee,(t=>{t.instances.push(e)}));o(t,(0,O.functionalChange)("new floating value")),Ve(void 0);break}case"new-output":{const{insId:e,pinId:t}=Ae,n=ee.instances.find((t=>t.id===e));if(!n)throw new Error("Impossible state");const i=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},(0,C.vAdd)(n.pos,{x:-50,y:150})),r=(0,v.produce)(ee,(n=>{n.instances.push(i),n.connections.push({from:(0,l.connectionNode)(e,t),to:(0,l.connectionNode)(i.id,l.TRIGGER_PIN_ID)})}));o(r,(0,O.functionalChange)("new value connected to output")),Ve(void 0)}}ue("addValue",{type:e,placeholdersCount:(0,l.keys)(s.inputs).length})}),[Ae,o,ee,ue]),gn=he.filter((e=>{const t=un();return!t||!(0,l.connectionDataEquals)(t,e)})),In=u.useCallback((()=>{ze(void 0),sn(t.defaultBoardData)}),[]),yn=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{const n=t.connections.find((t=>(0,l.connectionDataEquals)(t,e)));n.hidden=!n.hidden}));o(t,(0,O.functionalChange)("toggle connection hidden"))}),[o,ee]),bn=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{t.connections=t.connections.filter((t=>!(0,l.connectionDataEquals)(t,e)))}));o(t,(0,O.functionalChange)("remove connection"))}),[o,ee]),Cn=u.useCallback(((e,t,n)=>{Ue("input"===n?{to:(0,l.connectionNode)(e.id,t),from:void 0}:{from:(0,l.connectionNode)(e.id,t),to:void 0})}),[]),_n=u.useCallback(((e,t,n)=>{qe&&(qe.from&&"input"===n?Je(qe.from,(0,l.connectionNode)(e.id,t),"pinDrag"):qe.to&&"output"===n&&Je((0,l.connectionNode)(e.id,t),qe.to,"pinDrag")),Ue(null)}),[qe,Je]),xn=u.useCallback(((e,t)=>{}),[]),Nn=u.useCallback(((e,t)=>{qe&&(qe.from&&"output"===t?Je(qe.from,(0,l.externalConnectionNode)(e),"nodeIoPinDrag"):qe.to&&"input"===t&&Je((0,l.externalConnectionNode)(e),qe.to,"nodeIoPinDrag"))}),[qe,Je]);try{return(0,a.jsxs)(y.ContextMenu,{className:(0,k.default)("visual-node-editor",e.className,{dark:ae}),"data-id":ee.id,content:tn(),disabled:!Be.current,children:[(0,a.jsxs)("main",{className:"board-editor-inner",onMouseDown:jt,onMouseUp:Pt,onMouseMove:Ot,onMouseLeave:Et,ref:Xe,style:Yt,children:[(0,a.jsx)(u.Fragment,{children:(0,a.jsx)(w.LayoutDebugger,{vp:Fe,node:ee,extraDebug:m.emptyList,mousePos:tt.current})}),(0,a.jsx)(d.ConnectionView,{resolvedNodes:ce,currentInsId:Q,ancestorsInsIds:X,size:et,node:ee,boardPos:nt,instances:ve,connections:gn,futureConnection:ln(),onDblClick:l.noop,viewPort:Fe,parentVp:le,selectedInstances:pe,toggleHidden:yn,removeConnection:bn,lastMousePos:tt.current,draggedSource:qe}),Bt(),ve.map((t=>{var n,o,i,s,r;return(0,a.jsx)(c.InstanceView,{onUngroup:St,onExtractInlineNode:Mt,onDetachConstValue:Tt,onCopyConstValue:kt,onPasteConstValue:Rt,copiedConstValue:ke,connectionsPerInput:Kt.current.get(t.id)||m.emptyObj,node:(0,B.safelyGetNodeDef)(t,ce),ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),onPinClick:rt,onPinDblClick:Wt,onDragStart:pt,onDragEnd:mt,resolvedDeps:ce,onDragMove:ft,onDblClick:Dt,onSelect:It,onToggleSticky:Nt,selected:-1!==pe.indexOf(t.id),dragged:Ce===t.id,onInspectPin:Ze,selectedInput:me&&(0,l.isInternalConnectionNode)(me)&&me.insId===t.id?me.pinId:void 0,selectedOutput:fe&&(0,l.isInternalConnectionNode)(fe)&&fe.insId===t.id?fe.pinId:void 0,closestPin:Ke&&Ke.ins.id===t.id?Ke:void 0,queuedInputsData:null!==(n=oe[t.id])&&void 0!==n?n:m.emptyObj,instance:t,connections:he,onTogglePinBreakpoint:l.noop,onTogglePinLog:l.noop,viewPort:Fe,onChangeVisibleInputs:cn,onChangeVisibleOutputs:pn,onSetDisplayName:fn,onDeleteInstance:Ct,forceShowMinimized:fe||(null===(o=null==qe?void 0:qe.to)||void 0===o?void 0:o.insId)===t.id?"input":me||(null===(i=null==qe?void 0:qe.from)||void 0===i?void 0:i.insId)===t.id?"output":void 0,isConnectedInstanceSelected:pe.some((e=>he.some((n=>{let{from:o,to:i}=n;return o.insId===t.id&&i.insId===e||o.insId===e&&i.insId===t.id})))),inlineGroupProps:an(t),onCloseInlineEditor:In,inlineEditorPortalDomNode:He.current,onChangeStyle:dn,onGroupSelected:Ye,onPinMouseDown:Cn,onPinMouseUp:_n,hadError:null!==(r=null===(s=e.instancesWithErrors)||void 0===s?void 0:s.has((0,l.fullInsIdPath)(t.id)))&&void 0!==r&&r},t.id)})),Ut(),qt(),(0,a.jsx)(L.MainInstanceEventsIndicator,{currentInsId:Q,ancestorsInsIds:X,viewPort:Fe}),Me?(0,a.jsx)(_.QuickAddMenu,{targetNode:Me.targetNode,pinId:Me.pinId,pinType:Me.pinType,pos:Me.pos,resolvedDependencies:ne,node:ee,onAdd:Xt,onClose:Qt}):null,(0,a.jsxs)("div",{className:"viewport-controls-and-help",children:[(0,a.jsx)(y.Button,{small:!0,onClick:ot,minimal:!0,intent:"primary",children:"Center"}),(0,a.jsx)(U,{min:.15,max:3,stepSize:.05,labelStepSize:10,labelRenderer:W,onChange:ct,value:Fe.zoom}),we?(0,a.jsx)(F.HelpBubble,{}):null]}),Ae?(0,a.jsx)(E.InlineCodeModal,{env:m.emptyObj,initialValue:Ae.value,initialType:"existing"===Ae.type?Ae.templateType:void 0,onCancel:()=>Ve(void 0),onSubmit:hn}):null,(0,a.jsx)("div",{className:"inline-editor-portal-root"})]}),(0,a.jsx)(G.ActionsMenu,{showRunFlowOptions:we,onAction:Ft,selectedInstances:pe,node:ee,resolvedNodes:ce,to:me,from:fe,hotkeysEnabled:Be})]})}catch(wn){return console.error(wn),(0,a.jsxs)("div",{children:["Error rendering board - ",wn.toString()]})}})));const Z=(e,t)=>{const n=e.target.closest(".visual-node-editor");return n&&n.getAttribute("data-id")===t}},83234:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeView=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=r(n(59349)),d=n(30653);t.BaseNodeView=function(e){const{dragged:t,viewPort:n,pos:o,onDragEnd:i,onDragMove:s,onDragStart:r,displayMode:p}=e,f=(0,d.useDarkMode)(),m=u.useCallback(((e,t)=>{r(e,t)}),[r]),v=u.useCallback(((e,t)=>{const s=o,r=(t.x-s.x)/n.zoom,a=(t.y-s.y)/n.zoom,u=s.x+r,l=s.y+a;i(e,{...t,x:u,y:l})}),[o,i,n]),h=u.useCallback(((e,t)=>{s(e,{x:t.x,y:t.y})}),[s]),g={transform:`scale(${n.zoom})`},I=(0,l.default)("base-node-view",e.className,{dragged:t,dark:f,"display-mode":p}),y=o.x*n.zoom-n.pos.x*n.zoom,b=o.y*n.zoom-n.pos.y*n.zoom,C={transform:`translate(${y-o.x}px, ${b-o.y}px)`},_=(0,l.default)("base-node-view-vp-fixer",{"display-mode":p}),x=(0,a.jsx)("span",{className:"base-node-view-wrapper",children:(0,a.jsx)("div",{className:I,style:g,id:e.domId,children:e.children})});return(0,a.jsx)("div",{className:_,style:C,children:(0,a.jsx)(c.default,{onStop:v,onStart:m,onDrag:h,position:o,cancel:".no-drag",children:x})})}},80510:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleConnectionCloseEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleConnectionCloseEditorCommand=(e,t)=>{let{from:n,to:o}=t;return(0,s.default)(e,(e=>{const t=e.connections.find((e=>{const t=(0,i.connectionNodeEquals)(n,e.from),s=(0,i.connectionNodeEquals)(o,e.to);return t&&s}));t?e.connections=e.connections.filter((e=>e!==t)):e.connections.push({from:n,to:o})}))}},1788:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDetachConstEditorCommand=void 0;const i=n(74762),s=o(n(53865)),r=n(68371);t.handleDetachConstEditorCommand=(e,t,n)=>(0,s.default)(e,(e=>{const{instances:o}=e,s=o.find((e=>e.id===t));if(!s)throw new Error("Impossible state ins id with no matching instance");const a=s.inputConfig[n];if(!a)throw new Error("impossible state detaching const from unexistent config");if(!(0,i.isStaticInputPinConfig)(a))throw new Error("impossible state detaching const with no value");const u=JSON.stringify(a.value),l=(0,r.createInlineValueNode)({code:`${u}`,type:i.InlineValueNodeType.VALUE}),c=(0,i.inlineNodeInstance)(`value-${(0,i.randomInt)(999)}`,l,{},{x:s.pos.x,y:s.pos.y-100});if(!e.instances.find((e=>e.id===s.id)))throw new Error("impossible state instance not found");s.inputConfig[n]=(0,i.queueInputPinConfig)(),e.instances.push(c),e.connections.push((0,i.connectionData)(`${c.id}.value`,`${s.id}.${n}`))}))},2130:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDuplicateSelectedEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleDuplicateSelectedEditorCommand=(e,t)=>{const n=[];return{newNode:(0,s.default)(e,(o=>{const s=o.instances;t.forEach((t=>{const o=s.find((e=>e.id===t));if(!o)throw new Error("impossible state duplicate selected no matching instance");if(o){const{pos:t}=o,r={...o,pos:{x:t.x+20,y:t.y+20},id:(0,i.createInsId)(e)};s.push(r),n.push(r.id)}}))})),newInstances:n}}},25044:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.pasteInstancesCommand=void 0;const i=n(74762),s=o(n(53865));t.pasteInstancesCommand=(e,t,n)=>{const o=n.instances.map((n=>({...n,pos:t,id:(0,i.createInsId)(e)}))),r=new Map(o.map(((e,t)=>[n.instances[t].id,e.id])));return{newNode:(0,s.default)(e,(e=>{e.instances.push(...o);const t=n.connections.map((e=>{let{from:t,to:n}=e;return{from:{...t,insId:r.get(t.insId)||t.insId},to:{...n,insId:r.get(n.insId)||n.insId}}}));e.connections.push(...t)})),newInstances:o}}},65082:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionView=t.SingleConnectionView=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=r(n(26372)),d=n(74762),p=n(18243),f=n(77852),m=n(74089),v=n(60190),h=n(50382),g=n(76064),I=n(41032);t.SingleConnectionView=e=>{const{isBrowser:t}=(0,f.useSsr)(),{connection:n,node:o,resolvedNodes:i,instances:s,type:r,viewPort:a,toggleHidden:l,parentSelected:m,removeConnection:y}=e,{from:b}=n,C=(0,d.isInternalConnectionNode)(b)&&s.find((e=>e.id===b.insId));if(!C&&(0,d.isInternalConnectionNode)(b))throw new Error(`impossible state - "from instance id - [${b.insId}] does not exist"`);const _=((0,d.isInternalConnectionNode)(b)&&C?(0,I.safelyGetNodeDef)(C,i):o).outputs[b.pinId],x=_&&_.delayed,N=t?(0,p.calcStartPos)({...e,connectionNode:b}):{x:0,y:0},w=t?(0,p.calcTargetPos)({...e,connectionNode:n.to}):{x:0,y:0},{x:j,y:P}=(0,v.vDiv)(N,e.parentVp.zoom),{x:O,y:E}=(0,v.vDiv)(w,e.parentVp.zoom),D=(0,c.default)({delayed:x,hidden:n.hidden,"parent-selected":m},r),S=(0,u.jsxs)(h.Menu,{children:[(0,u.jsx)(h.MenuItem,{text:n.hidden?"Show connection":"Hide connection",onClick:()=>l(n)}),(0,u.jsx)(h.MenuItem,{text:"Remove connection",onClick:()=>y(n)})]});return(0,u.jsx)(h.ContextMenu,{content:S,children:e=>(0,u.jsx)(g.ConnectionViewPath,{className:D,from:{x:j,y:P},to:{x:O,y:E},dashed:"regular"!==r,zoom:a.zoom,onContextMenu:e.onContextMenu})})};t.ConnectionView=e=>{var n;const{viewPort:o,futureConnection:i,toggleHidden:s,selectedInstances:r,draggedSource:c}=e,[d,f]=l.useState(0),v=l.useCallback((e=>requestAnimationFrame((()=>{f((e=>(e+1)%9)),e>0&&v(e-1)}))),[]);l.useEffect((()=>{const e=v(10);return()=>{cancelAnimationFrame(e)}}),[v]),l.useEffect((()=>{const e=()=>{v(3)};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[v,d]);const h=e.connections.map((n=>{const o=r.includes(n.from.insId)||r.includes(n.to.insId);return(0,a.createElement)(t.SingleConnectionView,{...e,connection:n,type:"regular",parentSelected:o,key:n.from.insId+n.from.pinId+n.to.insId+n.to.pinId})}));if(i&&h.push((0,a.createElement)(t.SingleConnectionView,{...e,connection:i.connection,type:i.type,toggleHidden:s,parentSelected:!1,key:"future"})),c){const t=(c.from?p.calcStartPos:p.calcTargetPos)({connectionNode:null!==(n=c.from)&&void 0!==n?n:c.to,viewPort:o,boardPos:e.boardPos,ancestorsInsIds:e.ancestorsInsIds,currentInsId:e.currentInsId});h.push((0,u.jsx)(g.ConnectionViewPath,{className:"dragged",from:t,to:(0,m.logicalPosToRenderedPos)(e.lastMousePos,o),zoom:o.zoom},"dragged"))}return(0,u.jsx)("svg",{className:"connections-view",children:h})}},76064:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionViewPath=void 0;const i=n(35250),s=o(n(26372)),r=n(70079),a=n(23381);t.ConnectionViewPath=(0,r.forwardRef)(((e,t)=>{const{from:n,to:o,className:r,onContextMenu:u,zoom:l,dashed:c}=e,{x:d,y:p}=n,{x:f,y:m}=o,v=(0,a.calcBezierPath)({sourceX:d,sourceY:p,targetX:f,targetY:m,curvature:.15}),h=2.5*l,g=c?6*l:void 0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:v,ref:t,className:(0,s.default)("connection",r),style:{strokeWidth:h,strokeDasharray:g},onContextMenu:u}),e.label?(0,i.jsx)("text",{className:"label",x:(d+f)/2,y:(p+m)/2,fontSize:"12px"}):null,(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%"}),(0,i.jsx)("stop",{offset:"100%"})]})]})}))},23381:(e,t)=>{"use strict";var n;function o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i(e){let t,i,{pos:s,x1:r,y1:a,x2:u,y2:l,c:c}=e;switch(s){case n.Left:t=r-o(r-u,c),i=a;break;case n.Right:t=r+o(u-r,c),i=a;break;case n.Top:t=r,i=a-o(a-l,c);break;case n.Bottom:t=r,i=a+o(l-a,c)}return[t,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.getBezierCenter=t.calcBezierPath=t.Position=void 0,function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(n=t.Position||(t.Position={}));t.calcBezierPath=e=>{let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l});return`M${t},${o} C${c},${d} ${p},${f} ${r},${a}`},t.getBezierCenter=function(e){let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l}),m=.125*t+.375*c+.375*p+.125*r,v=.125*o+.375*d+.375*f+.125*a;return[m,v,Math.abs(m-t),Math.abs(v-o)]}},18243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcTargetPos=t.calcStartPos=t.calcPinPosition=void 0;const o=n(74762),i=n(30994),s={x:99999,y:99999};function r(e){const t=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds),pinId:e.pinId,pinType:e.pinType,isMain:e.isMain});return((e,t,n,o)=>{if(!e)return console.warn(`Cannot find element ${n} to calculate position.`),s;const{x:i,y:r,width:a,height:u}=e.getBoundingClientRect(),l=r+u/2;return{x:i+a/2-t.x,y:l-t.y}})(document.getElementById(t),e.boardPos,t,e.viewPort)}t.calcPinPosition=r;t.calcStartPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"input",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"output",boardPos:n,viewPort:s})};t.calcTargetPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"output",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"input",boardPos:n,viewPort:s})}},30994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPinDomId=t.getMainInstanceIndicatorDomId=t.getInstanceDomId=void 0;const o=n(74762);t.getInstanceDomId=(e,t)=>`ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getMainInstanceIndicatorDomId=(e,t)=>`main-ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getPinDomId=e=>{let{pinType:t,fullInsIdPath:n,pinId:o,isMain:i}=e;return`${i?"main-":""}pin:${t}:${n}:${o}`.replace(/\s+/g,"-")}},86553:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceView=t.getVisibleOutputs=t.getVisibleInputs=t.INSTANCE_INFO_TOOLTIP_DELAY=t.MAX_INSTANCE_WIDTH=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=n(66074),d=n(74762),p=r(n(26372)),f=n(2036),m=n(74762),v=n(74762),h=n(53159),g=n(83234),I=n(74762),y=n(30994),b=n(63521),C=n(74089),_=n(50382),x=r(n(99581)),N=n(88593),w=n(30653);t.PIECE_HORIZONTAL_PADDING=25,t.PIECE_CHAR_WIDTH=11,t.MIN_WIDTH_PER_PIN=40,t.MAX_INSTANCE_WIDTH=400,t.INSTANCE_INFO_TOOLTIP_DELAY=400;t.getVisibleInputs=(e,t,n)=>{const{visibleInputs:o}=e;if(o)return o;const i=(0,d.keys)((0,v.getNodeInputs)(t)).filter(((o,i)=>{var s;const r=n.some((t=>t.to.insId===e.id&&t.to.pinId===o)),a=t.inputs[o]&&"optional"===(null===(s=t.inputs[o])||void 0===s?void 0:s.mode);return r||!a&&o!==m.TRIGGER_PIN_ID}));return 0===i.length?[m.TRIGGER_PIN_ID]:i};t.getVisibleOutputs=(e,t,n)=>{const{visibleOutputs:o}=e;if(o)return o;const i=Object.keys(t.outputs);return n.some((t=>t.from.insId===e.id&&t.from.pinId===m.ERROR_PIN_ID))?[...i,m.ERROR_PIN_ID]:i};t.InstanceView=function(e){const{selected:n,selectedInput:o,selectedOutput:i,closestPin:s,dragged:r,onTogglePinLog:j,onTogglePinBreakpoint:P,onDetachConstValue:O,onCopyConstValue:E,onPasteConstValue:D,displayMode:S,connections:M,instance:T,viewPort:k,node:R,onPinClick:A,onPinDblClick:V,onDragStart:$,onDragEnd:z,onDragMove:H,onToggleSticky:G,onSelect:L,onDblClick:F,onChangeVisibleInputs:B,onChangeVisibleOutputs:q,onConvertConstToEnv:U,inlineGroupProps:W,onUngroup:Z,onExtractInlineNode:J,onGroupSelected:Y,isConnectedInstanceSelected:K,inlineEditorPortalDomNode:Q,onChangeStyle:X,onDeleteInstance:ee,onSetDisplayName:te,onPinMouseUp:ne,onPinMouseDown:oe}=e,ie=(0,w.useDarkMode)(),{id:se}=T,re=l.useMemo((()=>{const e=(0,d.randomInt)(6,1);return{icon:(0,d.pickRandom)([["fab","discord"],["fab","slack"],"bug","cube"]),color:e,size:(0,d.randomInt)(3,1),variation:(0,d.randomInt)(5,1)}}),[]),ae=l.useRef(),ue=l.useMemo((()=>T.style||R.defaultStyle||{}),[R,T]),le=ue.size||"regular",ce=l.useMemo((()=>new Map(M.filter((e=>{let{to:t}=e;return t.insId===se})).map((e=>{let{to:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),de=l.useMemo((()=>new Map(M.filter((e=>{let{from:t}=e;return t.insId===se})).map((e=>{let{from:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),pe=(0,C.usePrompt)(),fe=l.useCallback((e=>A(T,e,"input")),[T,A]),me=l.useCallback(((e,t)=>V(T,e,"input",t)),[T,V]),ve=l.useCallback(((e,t)=>V(T,e,"output",t)),[T,V]),he=l.useCallback((e=>A(T,e,"output")),[T,A]),ge=l.useCallback(((e,t)=>{$(T,e,t)}),[T,$]),Ie=l.useCallback(((e,t)=>{const n=T.pos,o=(t.x-n.x)/k.zoom,i=(t.y-n.y)/k.zoom,s=n.x+o,r=n.y+i;z(T,e,{...t,x:s,y:r})}),[T,z,k.zoom]),ye=l.useCallback(((e,t)=>{H(T,e,{x:t.x,y:t.y})}),[T,H]),be=l.useCallback((e=>G(T,e)),[T,G]),Ce=l.useCallback((e=>O(T,e)),[T,O]),_e=l.useCallback((e=>E(T,e)),[T,E]),xe=l.useCallback((e=>D(T,e)),[T,D]),Ne=l.useCallback((e=>L(T,e)),[T,L]),we=l.useCallback((e=>F(T,e.shiftKey)),[T,F]),je=(0,d.entries)(R.inputs),{visibleInputs:Pe,visibleOutputs:Oe}=T;Pe&&je.sort(((e,t)=>Pe.indexOf(e[0])-Pe.indexOf(t[0])));const Ee=(0,d.entries)(R.outputs);Oe&&Ee.sort(((e,t)=>Oe.indexOf(e[0])-Oe.indexOf(t[0])));const De=(0,t.getVisibleInputs)(T,R,M),Se=(0,t.getVisibleOutputs)(T,R,M);je.push([m.TRIGGER_PIN_ID,{...(0,d.nodeInput)(),description:"Use this pin to manually trigger the node. If not connected, the node will be triggered automatically when all required inputs have data."}]),Ee.push([m.ERROR_PIN_ID,{...(0,m.nodeOutput)(),description:"Use this pin to catch errors that happen inside this node. If not connected, errors will bubble up to the parent node."}]);const Me=je.filter((e=>{let[t]=e;return De.includes(t)||(n||K)&&ce.has(t)})),Te=Ee.filter((t=>{let[o]=t;return Se.includes(o)||(n||K)&&de.has(o)||o===m.ERROR_PIN_ID&&e.hadError})),ke=M.some((e=>e.from.insId===se&&e.from.pinId===m.ERROR_PIN_ID)),Re=(0,p.default)("ins-view",{"no-inputs":0===je.length,"no-outputs":0===Ee.length,"display-mode":S,"force-minimized-input":"input"===e.forceShowMinimized||"both"===e.forceShowMinimized,"force-minimized-output":"output"===e.forceShowMinimized||"both"===e.forceShowMinimized,"inline-node-edited":!!W,"error-caught":ke}),Ae=(0,p.default)({selected:n,dragged:r,closest:s&&s.ins.id===T.id},`size-${le}`),Ve=new Set((0,d.entries)(R.inputs).filter((e=>{let[t,n]=e;return(0,m.isInputPinOptional)(n)})).map(d.pickFirst)),$e=(0,d.entries)(T.inputConfig).reduce(((e,t)=>{let[n,o]=t;return(0,m.isStickyInputPinConfig)(o)||o.sticky?{...e,[n]:!0}:e}),{}),ze=(0,h.calcNodeContent)(T,R),He=e=>{const t=T.inputConfig[e];if((0,I.isStaticInputPinConfig)(t))return t.value},Ge=l.useCallback((async()=>{const e=(0,d.okeys)(R.inputs),t=await pe("New order?",(T.visibleInputs||e).join(","));t&&B(T,t.split(","))}),[R.inputs,pe,T,B]),Le=l.useCallback((async()=>{const e=(0,d.okeys)(R.outputs),t=await pe("New order?",(T.visibleOutputs||e).join(","));t&&q(T,t.split(","))}),[R.outputs,pe,T,q]),Fe=l.useCallback((()=>{ee(T)}),[ee,T]),Be=l.useCallback((async()=>{const e=await pe("Set custom display name",T.displayName||R.id);te(T,e)}),[pe,T,te,R.id]),qe=Object.keys((0,v.getNodeInputs)(R)),Ue=Object.keys((0,d.getNodeOutputs)(R)),We=l.useCallback((e=>{U&&U(T,e)}),[T,U]),Ze=l.useCallback(((e,t)=>{ne&&ne(T,e,t)}),[T,ne]),Je=l.useCallback(((e,t)=>{oe&&oe(T,e,t)}),[T,oe]),Ye=()=>(0,u.jsx)("div",{className:"inputs no-drag",children:Me.map((t=>{let[i,r]=t;var a;return(0,u.jsx)(f.PinView,{type:"input",currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,id:i,optional:Ve.has(i),connected:ce.has(i),isSticky:$e[i],minimized:!n&&1===Me.length,onToggleSticky:be,onDetachConstValue:Ce,onCopyConstValue:_e,onPasteConstValue:xe,copiedConstValue:e.copiedConstValue,selected:i===o,onClick:fe,onDoubleClick:me,isClosestToMouse:!!s&&"input"===s.type&&s.pin===i,onToggleLogged:j,onToggleBreakpoint:P,onInspect:e.onInspectPin,constValue:He(i),onConvertConstToEnv:e.onConvertConstToEnv?We:void 0,description:r.description,queuedValues:null!==(a=e.queuedInputsData[i])&&void 0!==a?a:0,onMouseUp:Ze,onMouseDown:Je},i)}))}),Ke=()=>(0,u.jsx)("div",{className:"outputs no-drag",children:Te.map((t=>{let[o,r]=t;return(0,u.jsx)(f.PinView,{currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,connected:de.has(o),type:"output",id:o,minimized:!n&&1===Te.length,isClosestToMouse:!!s&&"output"===s.type&&s.pin===o,selected:o===i,onClick:he,onDoubleClick:ve,onToggleLogged:j,onToggleBreakpoint:P,onInspect:e.onInspectPin,description:r.description,onMouseUp:Ze,onMouseDown:Je},o)}))}),Qe=l.useCallback((e=>{X(T,e)}),[T,X]),Xe=l.useCallback((()=>{const e=[...qe.map((e=>{const t=De.includes(e),n=ce.has(e)&&!0!==ce.get(e),o=(0,d.getInputName)(e);return{text:t?n?`Hide input "${o}" (disconnect first)`:`Hide input "${o}"`:`Show input "${o}"`,onClick:()=>B(T,t?De.filter((t=>t!==e)):[...De,e]),disabled:n&&t}})),...Ue.map((e=>{const t=Se.includes(e),n=de.has(e),o=(0,d.getOutputName)(e);return{text:t?n?`Hide output "${o}" (disconnect first)`:`Hide output "${o}"`:`Show output "${o}"`,onClick:()=>q(T,t?Se.filter((t=>t!==e)):[...Se,e]),disabled:n&&t}})),...(0,d.isInlineNodeInstance)(T)&&(0,v.isVisualNode)(T.node)?[{text:"Ungroup inline node",onClick:()=>Z(T)}]:[],...(0,d.isInlineNodeInstance)(T)?[{text:"Extract inline node to file",onClick:()=>J(T)}]:[],{text:"Reorder inputs",onClick:Ge},{text:"Reorder outputs",onClick:Le},{text:"Set display name",onClick:Be},{text:"Group selected instances",onClick:Y},{text:"Delete instance",intent:"danger",onClick:Fe}];return(0,u.jsxs)(_.Menu,{children:[(0,u.jsx)(_.MenuItem,{text:"Style",children:(0,u.jsx)(N.NodeStyleMenu,{style:ue,onChange:Qe,promptFn:pe})}),e.map(((e,t)=>(0,a.createElement)(_.MenuItem,{...e,key:t})))]})}),[qe,Ue,T,Ge,Le,Be,Fe,ue,Qe,pe,De,ce,B,Se,de,q,Z,J,Y]),et={"--node-color":ue.color,...ue.cssOverride||{}},tt=(0,y.getInstanceDomId)(T.id,e.ancestorsInsIds);return(0,u.jsx)("div",{className:Re,children:(0,u.jsx)(g.BaseNodeView,{pos:T.pos,viewPort:k,onDragStart:ge,onDragMove:ye,onDragEnd:Ie,upperRenderer:Ye,bottomRenderer:Ke,displayMode:S,domId:tt,children:(0,u.jsxs)(l.Fragment,{children:[Ye(),W?x.default.createPortal((0,u.jsxs)("div",{className:"inline-group-editor-container no-drag",children:[(0,u.jsxs)("header",{children:[ze," ",(0,u.jsx)("button",{onClick:e.onCloseInlineEditor,children:"close"})]}),(0,u.jsx)(b.VisualNodeEditor,{...e.inlineGroupProps,className:"no-drag",ref:ae})]}),Q):(0,u.jsx)(_.ContextMenu,{className:(0,p.default)("ins-view-inner",Ae,`size-${re.size}`,{dark:ie}),onClick:Ne,onDoubleClick:we,content:Xe(),style:et,children:(0,u.jsx)(_.Tooltip,{content:R.description,children:(0,u.jsxs)(l.Fragment,{children:[ue.icon?(0,u.jsx)(c.FontAwesomeIcon,{icon:ue.icon}):null," ",ze]})})}),Ke()]})})})}},53568:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStyleMenu=t.nodeStylePresetColors=void 0;const r=n(35250),a=n(50382),u=s(n(70079)),l=n(84472);t.nodeStylePresetColors=[{name:"Amethyst",color:"#9b5de5"},{name:"Magenta",color:"#f15bb5"},{name:"Yellow",color:"#fee440"},{name:"Capri",color:"#00bbf9"},{name:"Sea Green",color:"#00f5d4"},{name:"Orange",color:"#ff7f00"}];const c={size:"regular"};t.NodeStyleMenu=e=>{var n;const{onChange:o,style:i}=e,s=i||c,d=e.promptFn,p=u.default.useCallback(((e,t)=>{o({...s,[e]:t})}),[s,o]),f=u.default.useCallback((async()=>{const e=await d("Icon name? (Font Awesome conventions)","rocket"),t=e.includes(",")?e.split(","):e;p("icon",t)}),[d,p]),m=(0,u.useCallback)((async()=>{const e=await d("Enter a custom style (valid JSON representing a React CSS object)",s.cssOverride?JSON.stringify(s.cssOverride):"");try{const t=JSON.parse(e);p("cssOverride",t)}catch(t){console.error(t),(0,l.toastMsg)("Invalid object","danger")}}),[d,p,s.cssOverride]);return(0,r.jsxs)(u.default.Fragment,{children:[(0,r.jsxs)(a.MenuItem,{text:"Color",children:[t.nodeStylePresetColors.map((e=>(0,r.jsx)(a.MenuItem,{text:e.name,onClick:()=>p("color",e.color)},e.name))),(0,r.jsx)(a.MenuDivider,{}),(0,r.jsx)(a.MenuItem,{text:"Remove Color",onClick:()=>p("color",void 0)})]}),(0,r.jsxs)(a.MenuItem,{text:`Size (${null!==(n=s.size)&&void 0!==n?n:"regular"})`,children:[(0,r.jsx)(a.MenuItem,{text:"Small",onClick:()=>p("size","small")}),(0,r.jsx)(a.MenuItem,{text:"Regular",onClick:()=>p("size","regular")}),(0,r.jsx)(a.MenuItem,{text:"Large",onClick:()=>p("size","large")})]}),(0,r.jsxs)(a.MenuItem,{text:"Icon",children:[(0,r.jsx)(a.MenuItem,{text:"Choose Icon",onClick:f}),(0,r.jsx)(a.MenuItem,{text:"Remove Icon",onClick:()=>p("icon",void 0)})]}),(0,r.jsx)(a.MenuItem,{text:"Custom Styling",onClick:m})]})}},88593:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(53568),t)},83651:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86553),t)},53159:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calcInstancePosition=t.calcNodeWidth=t.calcNodeContent=void 0;const i=n(74762),s=o(n(6576)),r=n(86553),a=n(61888),u=n(30994);t.calcNodeContent=(e,t)=>{if(e.displayName)return e.displayName;if(t.customViewCode)try{const n=Object.entries(e.inputConfig).filter((e=>{let[,t]=e;return(0,i.isStaticInputPinConfig)(t)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o.value}}),{});return s.default.compile(t.customViewCode)({inputs:n}).trim()}catch(n){return console.error("Error with custom view",n),`Error in custom view [${t.id}]`}return t.id};t.calcNodeWidth=(e,n)=>{const o=(0,i.okeys)(n.inputs).length*r.MIN_WIDTH_PER_PIN,s=(0,t.calcNodeContent)(e,n),u=r.PIECE_CHAR_WIDTH;return(0,a.clamp)(s.length*u+2*r.PIECE_HORIZONTAL_PADDING,o,r.MAX_INSTANCE_WIDTH)};t.calcInstancePosition=(e,t,n)=>{const o=(0,u.getInstanceDomId)(e,t),i=document.getElementById(o);if(i){const{x:e,y:t,width:o,height:s}=i.getBoundingClientRect(),r=t+s/2;return{x:e+o/2-n.x,y:r-n.y}}return console.warn("Cannot find element to draw connection to",o),{x:99999,y:99999}}},17841:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutDebugger=t.LayoutDebuggerItem=t.PosDebugger=void 0;const i=n(70079),s=n(35250),r=n(74762),a=o(n(70079)),u=n(7047),l=e=>{let{pos:t}=e;return(0,s.jsxs)("span",{children:[t.x.toFixed(1),", ",t.y.toFixed(1)]})};t.PosDebugger=e=>(0,s.jsx)("span",{className:"pos-debugger",children:(0,s.jsx)(l,{pos:e.pos})});t.LayoutDebuggerItem=e=>{const{pos:n,viewPort:o,size:i,color:r}=e,a=o.zoom,u=n.x*a-o.pos.x*a,l=n.y*a-o.pos.y*a,c={transform:`translate(${u-n.x}px, ${l-n.y}px)`},d={transform:`scale(${o.zoom})`},p={transform:`translate(${n.x}px, ${n.y}px)`},f={width:`${i.width}px`,height:`${i.height}px`,backgroundColor:r};return(0,s.jsx)("div",{className:"layout-debugger",style:c,children:(0,s.jsxs)("span",{className:"drag-sim",style:p,children:[(0,s.jsx)(t.PosDebugger,{pos:n}),(0,s.jsx)("div",{className:"layout-debugger-zoom-wrapper",style:d,children:(0,s.jsx)("div",{className:"layout-debugger-inner",style:f})})]})})};const c=(()=>{try{return"true"===localStorage.getItem("pos-debugger")}catch(e){return!1}})();t.LayoutDebugger=e=>{const{extraDebug:n,vp:o,node:d,mousePos:p}=e;if(!c)return null;const f=n.map(((e,n)=>(0,i.createElement)(t.LayoutDebuggerItem,{...e,key:n}))),m=[...d.instances.map((e=>e.pos)),...(0,r.values)(d.inputsPosition),...(0,r.values)(d.outputsPosition)].map((e=>(0,s.jsx)(t.LayoutDebuggerItem,{pos:e,viewPort:o,size:{width:0,height:0},color:"red"}))),v=(0,u.logicalPosToRenderedPos)(p,o),h=(0,s.jsxs)("div",{className:"viewport-data",children:[(0,s.jsxs)("div",{children:["Pos: ",(0,s.jsx)(l,{pos:o.pos})]}),(0,s.jsxs)("div",{children:["Zoom: ",o.zoom.toFixed(2)," "]}),(0,s.jsxs)("div",{children:["Mouse (logical): ",(0,s.jsx)(l,{pos:p})]}),(0,s.jsxs)("div",{children:["Rendered (rendered): ",(0,s.jsx)(l,{pos:v})]})]});return(0,s.jsxs)(a.default.Fragment,{children:[h,f,m]})}},44338:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(17841),t)},38259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateInstancesWithSingleConstPinsMap=t.getLeafInstancesOfSelection=void 0;t.getLeafInstancesOfSelection=(e,t,n)=>e.reduce(((e,o)=>[...e,...n.filter((e=>e.to.insId===o.id)).map((e=>t.find((t=>t.id===e.from.insId)))).filter((e=>!!e))]),[]).filter((t=>1===n.filter((e=>e.from.insId===t.id||e.to.insId===t.id)).length&&!e.includes(t)));t.calculateInstancesWithSingleConstPinsMap=(e,t)=>{const{connections:n}=e;return n.filter((e=>t.has(e.from.insId))).reduce(((e,n)=>{const o=t.get(n.from.insId),i=n.to.insId,s=e.get(i)||new Map;return s.set(n.to.pinId,{val:o,insId:n.from.insId}),e.set(i,s),e}),new Map)}},37488:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeIoView=void 0;const a=n(35250),u=n(70079),l=s(n(70079)),c=n(74762),d=n(83234),p=r(n(26372)),f=n(50382),m=n(43490),v=n(66189),h=n(74762),g=n(30994),I=n(30653);t.NodeIoView=l.memo((function(e){const{viewPort:t,selected:n,pos:o,type:i,id:s,onDblClick:r,onRename:y,onDelete:b,onChangeInputMode:C,inputMode:_,onSelect:x,closest:N,onSetDescription:w,description:j,onMouseUp:P,onMouseDown:O,currentInsId:E}=e,{history:D,resetHistory:S,refreshHistory:M}=(0,v.useHistoryHelpers)(E,s,i),T=(0,m.usePrompt)(),k=l.useCallback((async()=>{const e=await T("Description?",j);w(i,s,e)}),[T,j,w,i,s]),R=l.useCallback((()=>{b&&b(i,s)}),[i,s,b]),A=l.useCallback((()=>{y&&y(i,s)}),[i,s,y]),V=l.useCallback((e=>{C&&C(s,e)}),[s,C]),$=l.useCallback((()=>[{text:`Current mode - ${_}`,onClick:c.noop},{text:"Make required",onClick:()=>V("required")},{text:"Make optional",onClick:()=>V("optional")},{text:"Make required-if-connected",onClick:()=>V("required-if-connected")},{text:"Set description",onClick:k},...e.onRename?[{text:"Rename",onClick:A}]:[],...e.onDelete?[{text:"Delete",onClick:R}]:[]]),[k,_,V,R,A,e.onDelete,e.onRename]),z=l.useCallback((t=>{r&&r(e.id,t)}),[r,e.id]),H=l.useCallback((()=>{x(s,i)}),[s,i,x]),G=l.useCallback((()=>(0,a.jsx)(f.Menu,{children:$().map(((e,t)=>(0,u.createElement)(f.MenuItem,{...e,key:t})))})),[$]),L="input"===i?(0,h.getInputName)(s):(0,c.getOutputName)(s),F=l.useCallback((e=>{P(s,i,e)}),[s,P,i]),B=l.useCallback((e=>{O(s,i,e)}),[s,O,i]),q=(0,I.useDarkMode)();return(0,a.jsx)(d.BaseNodeView,{className:(0,p.default)("node-io-view",i,{dark:q}),pos:o,onDragEnd:(n,o)=>{const r=e.pos,a=(o.x-r.x)/t.zoom,u=(o.y-r.y)/t.zoom,l=r.x+a,c=r.y+u;e.onDragEnd(i,s,n,{...o,x:l,y:c})},onDragStart:(t,n)=>{e.onDragStart(s,t,n)},onDragMove:(t,n)=>{e.onDragMove(i,s,t,{x:n.x,y:n.y})},viewPort:t,children:(0,a.jsx)(l.Fragment,{children:(0,a.jsx)(f.Tooltip,{content:(()=>{const t=(0,v.calcHistoryContent)(D),n=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:L})," (",i,")"," "]}),n,(0,a.jsx)("hr",{}),t]})})(),children:(0,a.jsx)(f.ContextMenu,{onMouseEnter:M,onMouseOut:S,onMouseUp:F,onMouseDown:B,"data-tip":"","data-html":!0,"data-for":s+e.currentInsId,className:(0,p.default)("node-io-view-inner",{closest:N,selected:n,dark:q}),id:(0,g.getPinDomId)({fullInsIdPath:(0,c.fullInsIdPath)(e.currentInsId,e.ancestorInsIds),pinId:s,pinType:i,isMain:!0}),onClick:H,onDoubleClick:z,content:G(),children:s})})})})}))},66005:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37488),t)},83782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcNodeIoWidth=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0,t.PIECE_HORIZONTAL_PADDING=15,t.PIECE_CHAR_WIDTH=9,t.MIN_WIDTH_PER_PIN=40;t.calcNodeIoWidth=e=>Math.max(t.MIN_WIDTH_PER_PIN,e.length*t.PIECE_CHAR_WIDTH+2*t.PIECE_HORIZONTAL_PADDING)},99942:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderVisualNode=t.layoutToInstances=void 0;const i=n(63521),s=n(74762),r=n(90794),a=o(n(53865)),u=n(83782),l=n(60190),c=n(53159),d=n(41032);t.layoutToInstances=(e,t)=>(0,a.default)(t,(t=>{(0,s.entries)(e.nodes).forEach((e=>{let[n,o]=e;if(n.startsWith("ins-")){const e=n.replace("ins-",""),i=t.instances.find((t=>t.id===e));i?i.pos=o.p:console.warn("WAT")}if(n.startsWith("node-input-")){const e=n.replace("node-input-","");t.inputsPosition[e]=o.p}if(n.startsWith("node-output-")){const e=n.replace("node-output-","");t.outputsPosition[e]=o.p}}))}));t.orderVisualNode=(e,n,o,a)=>{const{instances:p,connections:f}=e,m={...p.reduce(((e,t)=>{const o=(0,l.size)((0,c.calcNodeWidth)(t,(0,d.safelyGetNodeDef)(t,n)),i.NODE_HEIGHT);return{...e,[`ins-${t.id}`]:{p:t.pos,s:o}}}),{}),...(0,s.okeys)(e.inputsPosition).reduce(((t,n)=>({...t,[`node-input-${n}`]:{p:e.inputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{}),...(0,s.okeys)(e.outputsPosition).reduce(((t,n)=>({...t,[`node-output-${n}`]:{p:e.outputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{})},v=f.map((e=>[(0,s.isExternalConnectionNode)(e.from)?`node-input-${e.from.pinId}`:`ins-${e.from.insId}`,(0,s.isExternalConnectionNode)(e.to)?`node-output-${e.to.pinId}`:`ins-${e.to.insId}`])),h=(0,r.orderLayout)({nodes:m,edges:v},o,((n,o)=>{a&&a((0,t.layoutToInstances)(n,e),o)}));return(0,t.layoutToInstances)(h,e)}},90794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderLayout=void 0;const o=n(60190),i=400,s=e=>e.reduce(((e,t)=>{const n=(0,o.vSub)(t.p,(0,o.vec)(t.s.width/2,t.s.height/2));return{...e,[t.id]:{p:n,s:t.s}}}),{});t.orderLayout=(e,t,n)=>{let{nodes:r,edges:a}=e,u=Object.entries(r).map((e=>{let[t,n]=e;return{id:t,p:(0,o.vAdd)(n.p,(0,o.vec)(n.s.width/2,n.s.height/2)),f:(0,o.vec)(0,0),v:(0,o.vec)(0,0),m:1,s:n.s}})),l=0;for(;l.01);){let e=u;for(let t=0;t{let n=e.find((e=>e.id===t[0])),i=e.find((e=>e.id===t[1]));if(!n||!i)return void console.warn("weoops",t[0],t[1]);const s=(0,o.vec)(0,-200),r=(0,o.vSub)(n.p,i.p),a=(0,o.vSub)(s,r),u=1e3*(0,o.vLen)(a),l=(0,o.vMul)((0,o.vNorm)(a),.5*u),c=(0,o.vMul)((0,o.vNorm)(a),-.5*u);n.f=(0,o.vAdd)(n.f,l),i.f=(0,o.vAdd)(i.f,c)})),e=e.map((e=>(0,o.itrPhysics)(15,e))),e=e.map((e=>{const t=(0,o.vMul)(e.v,.5),n=(0,o.vLen)(t)>100?(0,o.vMul)((0,o.vNorm)(t),100):t;return{...e,v:n}})),u=e,n&&n({nodes:s(e),edges:a},l),l++}return{nodes:s(u),edges:a,itrs:l,timeout:l>=t,total:(0,o.totalEnergy)(u)}}},2036:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PinView=t.PIN_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=n(50382),d=n(18420),p=n(74762),f=n(30994),m=n(96233),v=n(66189),h=n(30653);t.PIN_HEIGHT=23;t.PinView=u.memo((function(e){const{selected:t,type:n,connected:o,optional:i,currentInsId:s,isClosestToMouse:r,id:g,onMouseDown:I,onMouseUp:y}=e,{history:b,resetHistory:C,refreshHistory:_}=(0,v.useHistoryHelpers)(s,g,n),x=(0,h.useDarkMode)(),N="input"===n?(0,p.getInputName)(g):(0,p.getOutputName)(g),w="input"===e.type&&(0,d.isDefined)(e.constValue)?e.constValue:void 0,j=u.useCallback((e=>{0===e.button&&I(g,n,e)}),[g,n,I]),P=u.useCallback((e=>{0===e.button&&y(g,n,e)}),[g,n,y]);return(0,a.jsxs)("div",{className:(()=>{if("input"===e.type){const{isSticky:s,constValue:a}=e;return(0,l.default)("pin",{sticky:s,selected:t,closest:r,optional:i,connected:o,"const-value":(0,d.isDefined)(a),"env-value":(0,d.isDefined)(a)&&(0,p.isEnvValue)(a),minimized:e.minimized,dark:x},n)}return(0,l.default)("pin",{selected:t,connected:o,closest:r,optional:i,minimized:e.minimized,"error-pin":g===p.ERROR_PIN_ID,dark:x},n)})(),"data-pin-id":g,children:[(0,a.jsx)(c.Tooltip,{className:"pin-info-tooltip",content:(()=>{const t=(0,v.calcHistoryContent)(b,"input"===n?e.queuedValues:void 0),o=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:N})," (",n,")"," "]}),o,(0,a.jsx)("hr",{}),(0,d.isDefined)(w)?(0,a.jsxs)("div",{children:["Static value:"," ",(0,a.jsx)("strong",{children:(0,m.valuePreview)(w).substring(0,200)})]}):t]})})(),children:(0,a.jsxs)(c.ContextMenu,{onMouseEnter:_,onMouseOut:C,onMouseDown:j,onMouseUp:P,"data-tip":"","data-html":!0,"data-for":g+e.currentInsId,id:(0,f.getPinDomId)({fullInsIdPath:(0,p.fullInsIdPath)(e.currentInsId,e.ancestorsInsIds),pinId:g,pinType:n,isMain:!1}),onDoubleClick:t=>e.onDoubleClick&&e.onDoubleClick(g,t),className:(0,l.default)("pin-inner",{dark:x}),onClick:t=>{const{onShiftClick:o,onClick:i,id:s}=e;t.shiftKey&&o?o(s,t):i(s,n,t)},content:(()=>{const t=(0,a.jsx)(c.MenuItem,{onClick:()=>e.onInspect(e.currentInsId,{id:e.id,type:e.type}),text:"Inspect"});if("input"===e.type){const{onConvertConstToEnv:n}=e;return(0,d.isDefined)(w)?(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onDetachConstValue(e.id),text:"Detach value"}),(0,a.jsx)(c.MenuItem,{onClick:()=>e.onCopyConstValue(e.id),text:"Copy value"}),(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null,n?(0,a.jsx)(c.MenuItem,{onClick:()=>n(e.id),text:"Convert to Env Var"}):null]}):(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onToggleSticky(e.id),text:"Toggle sticky (square means sticky)"}),t,(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null]})}return(0,a.jsx)(c.Menu,{children:t})})(),children:[N," ",(0,d.isDefined)(w)?(0,a.jsxs)(u.Fragment,{children:[":",(0,a.jsx)("span",{className:"value",children:(0,d.toString)(w)})]}):null,"input"===e.type&&e.isSticky?(0,a.jsx)("span",{className:"suffix",children:"s"}):null,"input"===e.type&&e.queueSize?(0,a.jsxs)("span",{className:"suffix",children:[e.queueSize," in Q"]}):null]})}),(0,a.jsx)("div",{className:"wire"})]})}))},66189:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHistoryHelpers=t.calcHistoryContent=void 0;const i=n(35250),s=n(96233),r=o(n(70079)),a=n(70079),u=n(98158);t.calcHistoryContent=(e,t)=>{if(e){const{total:n,lastSamples:o}=e,a=(0,i.jsxs)("strong",{children:["Activated ",n," times this session"]}),u=o.length>0?(0,i.jsxs)("div",{children:["Last value:"," ",(0,i.jsx)("strong",{children:(0,s.valuePreview)(o[0].val).substring(0,200)}),(0,i.jsx)("br",{}),(0,i.jsx)("em",{children:"Inspect instance for the full value"})]}):"",l=t?(0,i.jsx)(r.default.Fragment,{children:(0,i.jsxs)("div",{children:["Queued values: ",(0,i.jsx)("strong",{children:t})]})}):"";return(0,i.jsxs)(r.default.Fragment,{children:[a,u,l]})}return"Loading session data.."};t.useHistoryHelpers=(e,t,n)=>{const o=(0,a.useRef)(),{onRequestHistory:i}=(0,u.useDebuggerContext)(),[s,l]=(0,a.useState)();return{history:s,refreshHistory:(0,a.useCallback)((()=>{clearInterval(o.current),i(e,t,n).then((e=>{l(e)})),o.current=setInterval((()=>{i(e,t,n).then((e=>{l(e)}))}),500)}),[e,i,t,n]),resetHistory:r.default.useCallback((()=>{clearInterval(o.current),l(void 0)}),[])}}},89440:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAddMenu=void 0;const r=n(35250),a=s(n(70079)),u=n(74762),l=n(50382),c=n(70457),d=n(9958),p=n(86125),f=c.Select.ofType(),m=e=>{switch(e.type){case"node":return`${e.node.id}`;case"value":return"Add inline value or function";case"import":return`Import ${e.importableNode.node.id} from ${e.importableNode.module}`}},v=(e,t)=>{let{handleClick:n,modifiers:o,query:i}=t;if(!o.matchesPredicate)return null;const s=m(e);return"value"===e.type?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(l.MenuDivider,{}),(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))]}):(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))},h=(e,t,n,o)=>{const i=m(t).toLocaleLowerCase(),s=e.toLowerCase();return o?i===s:i.includes(s)};t.QuickAddMenu=e=>{const{resolvedDependencies:t,targetNode:n}=e,o={left:e.pos.x,top:e.pos.y},{onRequestImportables:i}=(0,p.useDependenciesContext)(),[s,c]=a.useState();a.useEffect((()=>{i().then((e=>c(e.importables)))}),[i]);const d=(0,u.values)({...t,[n.id]:n}),m=d.map((e=>({type:"node",node:e}))),g=new Set(d.map((e=>e.id))),I=s?s.filter((e=>!g.has(e.node.id))).map((e=>({type:"import",importableNode:e}))):[],y=m.concat(I).concat({type:"value"});return(0,r.jsx)("div",{className:"quick-add-menu",style:o,children:(0,r.jsx)(f,{className:"quick-add-nodes-select",items:y,itemPredicate:h,itemRenderer:v,inputProps:{className:"quick-add-input"},noResults:(0,r.jsx)(l.MenuItem,{disabled:!0,text:"No results."}),onItemSelect:t=>e.onAdd(t),popoverProps:{isOpen:!0,onClose:()=>e.onClose()}})})}},71033:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89440),t)},73470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimePlayer=void 0;const o=n(74762),i=n(64955),s=(0,o.debugLogger)("runtime-player");t.createRuntimePlayer=()=>{let e=0,t=[];let n=!1,r=Date.now(),a=e;const u=()=>requestAnimationFrame((()=>{const l=Date.now();a=e,e+=l-r,r=l,((e,n)=>{const r=t;t=[],r.length&&s(`Playing ${r.length} events from`,e,n),r.forEach((e=>{s("Playing event",e),(0,i.playEvent)(e),e.insId===o.ROOT_INS_ID&&e.type===o.DebuggerEventType.PROCESSING_CHANGE&&!1===e.val&&(s("Main instance is done processing, clearing runtime UI",e),c())}))})(a,e),n&&u()})),l=()=>{n=!1},c=()=>{document.querySelectorAll("[data-runtime]").forEach((e=>{e.removeAttribute("data-runtime")})),document.querySelectorAll("[data-runtime-queue]").forEach((e=>{e.removeAttribute("data-runtime-queue")})),t=[]};return{stop:l,start:function(t){void 0===t&&(t=0),n=!0,e=t,r=Date.now(),u()},addEvents:e=>{t.push(...e)},destroy:()=>{l(),c()},clear:c,status:()=>({running:n,currDt:e,lastDt:a,queue:t,last:r})}}},64955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playEvent=t.cancelTimers=void 0;const o=n(74762),i=n(30994),s=5e3,r=(0,o.debugLogger)("runtime-player:play-event"),a=(e,t)=>e.type===o.DebuggerEventType.INPUT_CHANGE||e.type===o.DebuggerEventType.OUTPUT_CHANGE?`${(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds)}.${e.pinId}`:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds);t.cancelTimers=new Map;t.playEvent=e=>{switch(e.type){case o.DebuggerEventType.INPUT_CHANGE:case o.DebuggerEventType.OUTPUT_CHANGE:{const{pinId:n,insId:u,ancestorsInsIds:l}=e,c=e.type===o.DebuggerEventType.INPUT_CHANGE?"input":"output",d=[(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!0})];u!==o.ROOT_INS_ID&&d.push((0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!1})),d.forEach(((i,l)=>{const c=a(e);clearTimeout(t.cancelTimers.get(c));const d=document.getElementById(i),p=`${u}.${n}`,f=e.type===o.DebuggerEventType.OUTPUT_CHANGE?document.querySelectorAll(`[data-from-id="${p}"]`):[];if(d){clearTimeout(t.cancelTimers.get(c)),d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),setTimeout((()=>{d.setAttribute("data-runtime","active"),f.forEach((e=>{e.setAttribute("data-runtime","active")}))}),0);const n=setTimeout((()=>{d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),t.cancelTimers.delete(c)}),s);t.cancelTimers.set(a(e),n)}else console.warn(`No DOM element with Id [${i}] found to play event`),r(`No DOM element with Id [${i}] found to play event`,e)}));break}case o.DebuggerEventType.PROCESSING_CHANGE:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(l)if(!0===e.val)l.setAttribute("data-runtime","processing"),clearTimeout(t.cancelTimers.get(u));else{l.removeAttribute("data-runtime"),setTimeout((()=>{"error"!==l.getAttribute("data-runtime")&&l.setAttribute("data-runtime","done")}),0);const e=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,e)}else r(`No DOM element with Id [${n}] found to play event`,e)}));break}case o.DebuggerEventType.ERROR:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(!l)return void r(`No DOM element with Id [${n}] found to play event`,e);clearTimeout(t.cancelTimers.get(u)),l.removeAttribute("data-runtime"),setTimeout((()=>{l.setAttribute("data-runtime","error")}));const c=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,c)}));const c={...e,type:o.DebuggerEventType.OUTPUT_CHANGE,pinId:o.ERROR_PIN_ID};(0,t.playEvent)(c);break}case o.DebuggerEventType.INPUTS_STATE_CHANGE:(0,o.entries)(e.val).forEach((t=>{let[n,s]=t;const{insId:a,ancestorsInsIds:u}=e,l=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(a,u),pinId:n,pinType:"input",isMain:!1}),c=document.getElementById(l);c?s>0?c.setAttribute("data-runtime-queue",`${s}`):c.removeAttribute("data-runtime-queue"):r(`No DOM element with Id [${l}] found to play event`,e)}))}}},25804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounce=void 0;const o=n(70079);t.useDebounce=function(e,t){const[n,i]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}},7047:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.handleChangeNodeInputType=t.handleIoPinRename=t.handleInstanceDrag=t.getInstancesInRect=t.isJsxValue=t.getMiddleOfViewPort=t.fitViewPortToNode=t.centerBoardPosOnTarget=t.renderedPosToLogicalPos=t.logicalPosToRenderedPos=t.getEffectiveNodeDimensions=t.calcNodesPositions=t.calcSelectionBoxArea=t.animateViewPort=t.easeInOutNum=t.easeInOutPos=t.easeInOutQuad=t.center=t.distance=t.clamp=t.domToViewPort=t.roundNumber=t.createNewNodeInstance=t.createNewInlineNodeInstance=t.parseInputOutputTypes=t.parsePromptValue=t.getSelectionBoxRect=t.findClosestPin=t.changePinConfig=t.getInstancePinConfig=t.emptyList=t.emptyObj=void 0;const r=s(n(53865)),a=n(30721),u=n(63521),l=n(74762),c=n(18243),d=n(74762),p=n(53159),f=n(83782),m=n(60190),v=n(38259),h=n(83651),g=n(41032);t.emptyObj={},t.emptyList=[],t.getInstancePinConfig=function(e,n,o){var i;const s=e.instances.find((e=>e.id===n));if(!s)throw new Error(`Instance ${n} not found`);return null!==(i=(s.inputConfig||t.emptyObj)[o])&&void 0!==i?i:(0,l.queueInputPinConfig)()};t.changePinConfig=(e,t,n,o)=>r.produce(e,(e=>{var i;const{instances:s}=e,r=s.find((e=>e.id===t));if(!r)throw new Error("blah");const a=null!==(i=r.inputConfig)&&void 0!==i?i:{};a[n]=o,e.instances=s.map((e=>e===r?{...r,inputConfig:a}:e))}));t.findClosestPin=(e,t,n,o,i,s,r)=>{const a=(0,l.nodeInstance)(e.id,e.id),u=(0,d.okeys)(e.inputs).map((e=>({id:e,type:"input",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),p=(0,d.okeys)(e.outputs).map((e=>({id:e,type:"output",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),f=[...u,...e.instances.reduce(((n,a)=>{const u=(0,g.safelyGetNodeDef)(a,t),d=(0,h.getVisibleInputs)(a,u,e.connections),p=(0,h.getVisibleOutputs)(a,u,e.connections);return[...n,...d.map((e=>({ins:a,type:"input",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!1}),id:e}))),...p.map((e=>({ins:a,type:"output",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!1}),id:e})))]}),[]),...p];let m={dis:1e5,item:f[0]};return f.forEach((e=>{const t=e.pos.x-n.x,o=e.pos.y-n.y,i=Math.sqrt(t*t+o*o);i{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x,t.x)-n,h:Math.max(e.y,t.y)-o}};t.parsePromptValue=e=>{if(null===e)return;const t=parseInt(e,10);let n=e;return t.toString()!=e||isNaN(t)||(n=t),n};t.parseInputOutputTypes=e=>{const[,t,n]=e.match(/node\((.+)\|(.+)\)/)||[],o=(0,d.entries)(JSON.parse(t)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]})),i=(0,d.entries)(JSON.parse(n)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]}));return{inputs:(0,d.fromEntries)(o),outputs:(0,d.fromEntries)(i)}};t.createNewInlineNodeInstance=function(e,t,n){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const o=(0,l.inlineNodeInstance)(`${e.id}-${(0,d.randomInt)(999)}`,e,{},{x:0,y:0}),i=(0,p.calcNodeWidth)(o,e),{x:s,y:r}=n,a={x:s-i/2,y:r+t};return{...o,pos:a}};t.createNewNodeInstance=function(e,t,n,o){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const i="string"==typeof e?(0,g.safelyGetNodeDef)(e,o):e;if(!i)throw new Error(`${e} node not found in resolvedNodes`);const s=(0,d.entries)(i.inputs).reduce(((e,t)=>{let[n,o]=t;return o.defaultValue&&(e[n]=(0,l.staticInputPinConfig)(o.defaultValue)),e}),{}),r=(0,l.nodeInstance)((0,a.createId)(),i.id,s,{x:0,y:0}),c=(0,p.calcNodeWidth)(r,i),{x:f,y:m}=n,v={x:f-c/2,y:m+t};return{...r,pos:v}};t.roundNumber=e=>Math.round(100*e)/100;t.domToViewPort=(e,n,o)=>({x:(0,t.roundNumber)(n.pos.x+e.x/n.zoom/o.zoom),y:(0,t.roundNumber)(n.pos.y+e.y/n.zoom/o.zoom)});t.clamp=(e,t,n)=>Math.max(e,Math.min(t,n));t.distance=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)};t.center=(e,t,n)=>{let{zoom:o}=n;const i=e.x+e.w/2,s=e.y+e.h/2,{w:r,h:a}=t;return{x:i-r/o/2,y:s-a/o/2}};t.easeInOutQuad=e=>e<.5?2*e*e:(4-2*e)*e-1;t.easeInOutPos=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i),a=(0,t.easeInOutQuad)(r),u=n.x-e.x,l=n.y-e.y;return{x:e.x+u*a,y:e.y+l*a}};t.easeInOutNum=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i);return e+(n-e)*(0,t.easeInOutQuad)(r)};t.animateViewPort=(e,n,o,i)=>{const s=(0,t.distance)(e.pos,n.pos),r=Date.now(),a=o;if(0===s)return void i(e);const u=()=>{const o=Date.now(),s=(0,t.easeInOutPos)(e.pos,n.pos,r,a,o),l=(0,t.easeInOutNum)(e.zoom,n.zoom,r,a,o);o-r{const n=(0,t.getSelectionBoxRect)(e.from,e.to);return n.h*n.w};const I=(e,t,n,o)=>({left:n.x,right:n.x+e,top:n.y,bottom:n.y+t,tag:o,center:(0,l.calcCenter)({w:e,h:t,...n})});t.calcNodesPositions=(e,t)=>[...e.instances.map((e=>{const n=(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,t)),o=u.NODE_HEIGHT;return I(n,o,e.pos,e.id)})),...(0,d.okeys)(e.inputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.inputsPosition[t]||{x:0,y:0};return I(n,o,i,"input_"+t)})),...(0,d.okeys)(e.outputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.outputsPosition[t]||{x:0,y:0};return I(n,o,i,"output"+t)}))];t.getEffectiveNodeDimensions=(e,n)=>{const o=(0,t.calcNodesPositions)(e,n),i=o[0]||{left:0,right:0,top:0,bottom:0},s=o.reduce(((e,t)=>t.leftt.right>e?t.right:e),i.right),a=o.reduce(((e,t)=>t.topt.bottom>e?t.bottom:e),i.bottom)-a,d={x:s,y:a};return{size:{width:u,height:c},pos:d,center:(0,l.calcCenter)({w:u,h:c,...d})}};t.logicalPosToRenderedPos=(e,t)=>{const n=(0,m.vSub)(e,t.pos);return(0,m.vMul)(n,t.zoom)};t.renderedPosToLogicalPos=(e,t)=>{const n=(0,m.vDiv)(e,t.zoom);return(0,m.vAdd)(t.pos,n)};t.centerBoardPosOnTarget=(e,n,o,i)=>{const s=(0,t.logicalPosToRenderedPos)(e,i),r=(0,t.renderedPosToLogicalPos)(s,{...i,zoom:o}),a=Math.max(e.x,r.x)-Math.min(e.x,r.x),u=Math.max(e.y,r.y)-Math.min(e.y,r.y);return{x:o>i.zoom?i.pos.x+a:i.pos.x-a,y:o>i.zoom?i.pos.y+u:i.pos.y-u}};t.fitViewPortToNode=function(e,n,o,i){void 0===i&&(i=[20,150]);const{size:s,center:r}=(0,t.getEffectiveNodeDimensions)(e,n),a=i[0],u=i[1],l=s.width+a,c=s.height+u,d=o.width/l,p=o.height/c,f=Math.min(d,p)/1.15,m=(0,t.clamp)(.3,1.2,f);return{zoom:m,pos:{x:r.x-o.width/2/m,y:r.y-o.height/2/m+20}}};t.getMiddleOfViewPort=(e,n)=>{const o={x:n.width/2,y:n.height/2};return(0,t.renderedPosToLogicalPos)(o,e)};t.isJsxValue=e=>{const t=e=>(0,d.isDefined)(e.ref)&&(0,d.isDefined)(e.type)&&(0,d.isDefined)(e.props);try{const n=JSON.parse(e);return t(n)||Array.isArray(n)&&t(n[0])}catch(n){return!1}};t.getInstancesInRect=(e,n,o,i,s,r,a)=>{const{from:c,to:d}=e,f=(0,t.getSelectionBoxRect)(c,d);return s.filter((e=>{const{pos:t}=e,i={...t,w:(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,n))*o.zoom*a.zoom,h:u.NODE_HEIGHT*o.zoom*a.zoom};return(0,l.intersectRect)(f,i)||(0,l.intersectRect)(i,f)})).map((e=>e.id))};t.handleInstanceDrag=(e,t,n,o,i,s)=>{o.preventDefault(),o.stopPropagation();const a=(0,m.vSub)(n,t.pos);let u;const l=r.produce(e,(e=>{const r=e.instances.find((e=>e.id===t.id));if(!r)throw new Error("impossible state dragging instance that does not exist");!o.shiftKey&&s&&(u=[s]);const l=e.instances.filter((e=>i.includes(e.id)&&e!==r)),c=[r,...l],d=(0,v.getLeafInstancesOfSelection)(c,e.instances,e.connections);[...l,...d].forEach((e=>{e.pos=(0,m.vAdd)(e.pos,a)})),r.pos=n,!o.shiftKey&&s&&(u=[s])}));return{newValue:l,newSelected:u}};t.handleIoPinRename=(e,t,n,o)=>r.produce(e,(e=>{"input"===t?(e.inputs[o]=e.inputs[n],e.inputsPosition[o]=e.inputsPosition[n],delete e.inputs[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===n?{...e,from:{...e.from,pinId:o}}:e))):(e.outputs[o]=e.outputs[n],e.outputsPosition[o]=e.outputsPosition[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===n?{...e,to:{...e.to,pinId:o}}:e)),e.completionOutputs=(e.completionOutputs||[]).map((e=>e.split("+").map((e=>e===n?o:n)).join("+"))),delete e.outputs[n])}));t.handleChangeNodeInputType=(e,t,n)=>r.produce(e,(e=>{const o=e.inputs[t];if(!o)throw new Error("Wat");o.mode=n}))},42403:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorClient=void 0;const i=n(74762),s=o(n(18706)),r=n(32048),a=n(31758),u=(0,i.debugLogger)("remote-debugger:editor-client");t.createEditorClient=(e,t)=>{const n=new URL(e),o=(0,r.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/editor`,timeout:3e4});return o.emit("join-room-editor",t),{emitChange:e=>{o.emit(a.DebuggerServerEventType.CHANGE_EVENT_NAME,e)},emitBreakpointsChange:e=>{o.emit(a.DebuggerServerEventType.UPDATE_BREAKPOINTS,e)},interceptInput:e=>{o.emit(a.DebuggerServerEventType.INPUT_VALUE_OVERRIDE,e)},interceptOutput:e=>{o.emit(a.DebuggerServerEventType.OUTPUT_VALUE_OVERRIDE,e)},onRuntimeReady:e=>(o.on(a.DebuggerServerEventType.RUNTIME_READY,e),()=>o.off(a.DebuggerServerEventType.RUNTIME_READY,e)),onChangeAwk:e=>(o.on(a.DebuggerServerEventType.CHANGE_AWK,e),()=>o.off(a.DebuggerServerEventType.CHANGE_AWK,e)),onChangeError:e=>(o.on(a.DebuggerServerEventType.CHANGE_ERROR,e),()=>o.off(a.DebuggerServerEventType.CHANGE_ERROR,e)),onIsAlive:e=>(o.on(a.DebuggerServerEventType.IS_ALIVE,e),()=>o.off(a.DebuggerServerEventType.IS_ALIVE,e)),emitInputValue:(e,t)=>{u(`Emitting push input value to ${e} %o`,t),o.emit(a.DebuggerServerEventType.PUSH_INPUT_VALUE,{pinId:e,value:t})},destroy:()=>{o.disconnect(),(0,a.enumToArray)(a.DebuggerServerEventType).forEach((e=>o.off(e)))},onDisconnect:e=>(o.on("disconnect",e),()=>o.off("disconnect",e)),debugInfo:()=>`Remote debugger for ${e}`,onBatchedEvents:e=>(o.on(a.DebuggerServerEventType.EVENTS_BATCH,e),()=>o.off(a.DebuggerServerEventType.EVENTS_BATCH,e)),requestState:()=>s.default.get(`${e}/state`).then((e=>e.data.state)),getHistory:n=>s.default.get(`${e}/history`,{params:{insId:n.insId,pinId:n.pinId,limit:n.limit,executionId:t}}).then((e=>e.data)),clearHistory:()=>s.default.delete(`${e}/history`).then((()=>{})),triggerNode:(t,n)=>s.default.post(`${e}/trigger`,{nodeId:t,inputs:n}).then((e=>e.data))}}},58066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeData=void 0;const o=n(74762),i=n(36783),s=(0,o.debugLogger)("remote-debugger:normalize-data");t.normalizeData=e=>{if(e instanceof Error)return(0,i.serializeError)(e);if("object"==typeof e&&null!==e){e={...e};const t=new WeakSet,n=e=>{if("bigint"==typeof e)return e.toString();if("object"!=typeof e||Array.isArray(e))return e;if(null===e)return e;if(t.has(e))return"[Circular]";try{t.add(e)}catch(o){s("Error adding to WeakSet","data:",e,"type:",typeof e,"error:",o)}if(Array.isArray(e))return e.map(n);if("object"==typeof e){const t={};for(const o in e)t[o]=n(e[o]);return t}return e};return n(e)}return e}},39641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimeClient=t.DEFAULT_DT_SCALE=void 0;const o=n(74762),i=n(32048),s=n(31758),r=n(58066),a=(0,o.debugLogger)("remote-debugger:runtime-client");t.DEFAULT_DT_SCALE=1;t.createRuntimeClient=(e,t)=>{const n=new URL(e),u=(0,i.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/runtime`,timeout:1e3,reconnectionAttempts:3});u.emit("join-room-runtime",t),u.on("connection",(e=>{e.join(t)}));let l=new Set;u.on(s.DebuggerServerEventType.UPDATE_BREAKPOINTS,(e=>{l=new Set(e)}));const c=(0,o.cappedArrayDebounce)((e=>{a(`Emitting debounced batched events - ${e.length}`),u.emit(s.DebuggerServerEventType.EVENTS_BATCH,e)}),100,200);return{onChange:e=>(u.on(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e),()=>u.off(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e)),onInput:e=>(u.on(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e),()=>u.off(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e)),emitEvent:e=>{a(`Emitting event ${e.type} change event of ${e.insId}`),e.val=(0,r.normalizeData)(e.val),c.addItem({...e,time:Date.now()})},emitRuntimeReady:()=>{u.emit(s.DebuggerServerEventType.RUNTIME_READY,{})},emitChangeAwk:()=>{u.emit(s.DebuggerServerEventType.CHANGE_AWK,{})},emitChangeError:e=>{u.emit(s.DebuggerServerEventType.CHANGE_ERROR,{error:e})},emitIsAlive:e=>{u.emit(s.DebuggerServerEventType.IS_ALIVE,{time:e})},destroy:async()=>{c.pendingItems()&&(c.flush(),await(0,o.delay)(100)),(0,s.enumToArray)(s.DebuggerServerEventType).forEach((e=>u.off(e))),u.disconnect()},onDisconnect:e=>(u.on("disconnect",e),()=>u.off("disconnect",e)),waitForConnection:()=>new Promise(((e,t)=>{u.connected?e():(u.on("connect_error",(e=>{t(`Socket connect error: ${e}`)})),u.on("connect",(()=>{e()})))}))}}},31758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerServerEventType=t.enumToArray=t.isNumber=t.isSimpleType=t.valuePreview=t.toString=void 0;const o=n(36783);t.toString=e=>{if("object"===typeof e){if(e instanceof Error)return JSON.stringify((0,o.serializeError)(e));try{return JSON.stringify(e).substr(0,250)}catch(t){return"Object (cannot stringify)"}}return`${e}`.substr(0,250)};t.valuePreview=e=>(0,t.toString)(e).substr(0,100);t.isSimpleType=e=>["number","string","boolean"].includes(typeof e);t.isNumber=e=>!1===isNaN(Number(e)),t.enumToArray=function(e){return Object.keys(e).filter(t.isNumber).map((t=>e[t]))},function(e){e.RUNTIME_READY="runtime-ready",e.CHANGE_EVENT_NAME="change",e.PUSH_INPUT_VALUE="push-input-value",e.CHANGE_AWK="live-change-awk",e.CHANGE_ERROR="live-change-error",e.IS_ALIVE="is-alive",e.UPDATE_BREAKPOINTS="update-breakpoints",e.INPUT_VALUE_OVERRIDE="input-value-override",e.OUTPUT_VALUE_OVERRIDE="output-value-override",e.INPUT_VALUE_CHANGE="input-value-changed",e.OUTPUT_VALUE_CHANGE="output-value-changed",e.PROCESSING_CHANGE="processing-changed",e.INPUTS_STATE_CHANGE="inputs-state-changed",e.NODE_ERROR="node-error",e.EVENTS_BATCH="events-batch"}(t.DebuggerServerEventType||(t.DebuggerServerEventType={}))},96233:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31758),t),i(n(42403),t),i(n(39641),t)},43920:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Equals=t.EqualsBoolean=t.Throttle=t.ThrottleError=t.Debounce=t.Interval=t.Delay=t.Switch4=t.Switch2=t.Switch3=t.EmitOnTrigger=t.BooleanSplit=t.Subscribe=t.Publish=t.RoundRobin4=t.RoundRobin2=t.RoundRobin3=t.LimitTimes=void 0;const o=n(11253),i="Control Flow";t.LimitTimes={id:"Limit Times",namespace:i,description:"Item will be emitted until the limit is reached",inputs:{item:{mode:"required",description:"The item to emit"},times:{mode:"required",description:"The number of times to emit the item"},reset:{mode:"optional",description:"Reset the counter"}},outputs:{ok:{}},reactiveInputs:["item","reset"],completionOutputs:[],run:function(e,t,n){const{state:o}=n,{item:i,times:s,reset:r}=e,{ok:a}=t;if(void 0!==r)return void o.set("val",0);let u=o.get("val")||0;u++,o.set("val",u),u>=s?n.onError(new Error(`Limit of ${s} reached`)):a.next(i)}},t.RoundRobin3={id:"Round Robin 3",namespace:i,description:"Item will be emitted to one of the three outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r}=t,a=o.get("curr")||0,u=(a+1)%3;[i,s,r][a].next(e.item),o.set("curr",u)}},t.RoundRobin2={namespace:i,id:"Round Robin 2",description:"Item will be emitted to one of the 2 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s}=t,r=o.get("curr")||0,a=(r+1)%2;[i,s][r].next(e.item),o.set("curr",a)}},t.RoundRobin4={id:"Round Robin 4",namespace:i,description:"Item will be emitted to one of the 4 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves to "r4"\'s turn.'},r4:{description:'The fourth output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r,r4:a}=t,u=o.get("curr")||0,l=(u+1)%4;[i,s,r,a][u].next(e.item),o.set("curr",l)}},t.Publish={id:"Publish",namespace:i,description:"Publishes a value by a key to all listeners in the current flow. Use 'Subscribe' to listen to events.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},value:{mode:"required"}},outputs:{},run:function(e,t,n){const i=`${n.ancestorsInsIds}__${e.key}`;o.publish(i,e.value)}},t.Subscribe={id:"Subscribe",namespace:i,description:"Subscribes to a value published by a key. Use 'Publish' to publish values.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},initial:{mode:"required-if-connected",description:"If passed will be published has the first value"}},completionOutputs:[],outputs:{value:{description:"The value published by the key"}},run:function(e,t,n){const{value:i}=t,s=`${n.ancestorsInsIds}__${e.key}`,r=o.subscribe(s,((e,t)=>{i.next(t)}));void 0!==e.initial&&i.next(e.initial),n.onCleanup((()=>{o.unsubscribe(r)}))}},t.BooleanSplit={namespace:i,id:"Boolean Split",description:"Splits a boolean value into two outputs",inputs:{value:{mode:"required",description:"Boolean value"},trueValue:{mode:"required-if-connected",description:"Value to emit if the input is true. Defaults to true"},falseValue:{mode:"required-if-connected",description:"Value to emit if the input is false. Defaults to false"}},outputs:{true:{description:"The value is true"},false:{description:"The value is false"}},run:function(e,t){const{true:n,false:o}=t,{value:i,trueValue:s,falseValue:r}=e;i?n.next(null==s||s):o.next(null!=r&&r)}},t.EmitOnTrigger={namespace:i,id:"Emit on Trigger",description:"Emits the value when the trigger input receives any value",inputs:{value:{mode:"required",description:"The value to emit"},trigger:{mode:"required",description:"The trigger to emit the value"}},outputs:{result:{description:"The value emitted"}},run:function(e,t){const{result:n}=t,{value:o,trigger:i}=e;void 0!==i&&n.next(o)}},t.Switch3={namespace:i,id:"Switch 3",description:"Switches between 3 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,default:s,outputValue:r}=t,{value:a,firstCase:u,secondCase:l,thirdCase:c}=e;a===u?n.next(null!=r?r:a):a===l?o.next(null!=r?r:a):a===c?i.next(null!=r?r:a):s.next(null!=r?r:a)}},t.Switch2={id:"Switch 2",description:"Switches between 2 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,default:i,outputValue:s}=t,{value:r,firstCase:a,secondCase:u}=e;r===a?n.next(null!=s?s:r):r===u?o.next(null!=s?s:r):i.next(null!=s?s:r)}},t.Switch4={id:"Switch 4",description:"Switches between 4 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},fourthCase:{mode:"required",description:"The value to switch on for the fourth output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},fourth:{description:"The value emitted if the input value is equal to the fourth case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,fourth:s,default:r,outputValue:a}=t,{value:u,firstCase:l,secondCase:c,thirdCase:d,fourthCase:p}=e;u===l?n.next(null!=a?a:u):u===c?o.next(null!=a?a:u):u===d?i.next(null!=a?a:u):u===p?s.next(null!=a?a:u):r.next(null!=a?a:u)}},t.Delay={id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:i,description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:async(e,t)=>{let{value:n,delay:o}=e,{delayedValue:i}=t;await new Promise((e=>setTimeout(e,o))),i.next(n)}},t.Interval={id:"Interval",namespace:i,defaultStyle:{icon:"fa-clock"},description:"Emits a value every interval",inputs:{value:{description:"Value to emit"},interval:{description:"Interval in milliseconds"}},reactiveInputs:["value","interval"],outputs:{value:{description:"Emitted value"}},completionOutputs:[],run:(e,t,n)=>{n.state.get("timer")&&clearInterval(n.state.get("timer"));const o=setInterval((()=>{t.value.next(e.value)}),e.interval);n.state.set("timer",o),n.onCleanup((()=>{clearInterval(o)}))}},t.Debounce={id:"Debounce",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be debounced"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The debounced value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the last value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:s}=t,r=n.state.get("timer");r&&clearTimeout(r);const a=setTimeout((()=>{s.next(o)}),i);n.state.set("timer",a),n.onCleanup((()=>{clearTimeout(r)}))}};class s extends Error{constructor(e){super("Throttle: Value dropped"),this.value=e}}t.ThrottleError=s,t.Throttle={id:"Throttle",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be throttled"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The throttled value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the first value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:r}=t;if(n.state.get("timer"))n.onError(new s(o));else{r.next(o);const e=setTimeout((()=>{n.state.set("timer",null)}),i);n.state.set("timer",e)}}},t.EqualsBoolean={id:"Equals (Bool)",defaultStyle:{icon:"fa-equals"},namespace:i,description:"Emits true if two values are equal (=== equality). Otherwise emits false.",inputs:{a:{description:"First value"},b:{description:"Second value"}},outputs:{result:{description:"true if a is equal to b"}},run:(e,t)=>{let{a:n,b:o}=e,{result:i}=t;return i.next(n===o)}},t.Equals={id:"Equals",namespace:i,description:'Emits the value of "a" to output "true" if "a" is equal to "b". Otherwise emits the value of "a" to output "false".',inputs:{a:{mode:"required",description:"First value"},b:{mode:"required",description:"Second value"}},outputs:{true:{description:"Emits the value of a if a is equal to b"},false:{description:"Emits the value of a if a is not equal to b"}},run:(e,t)=>{const{a:n,b:o}=e,{true:i,false:s}=t;n===o?i.next(n):s.next(n)}}},65645:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var o=n(70079),i=n(11253),s=n(74089),r=n(74762),a=n(21766);var u=n(10831),l=n(61997),c=n(77852);const d=(0,a.S)(),p=[0,20],f=e=>{let{flow:t,output:n,inputs:o,onError:s,debugDelay:a,onCompleted:u,dependencies:l,player:c}=e;const p=((e,t)=>{const n=new Set;return{onEvent:o=>{const i={...o,time:Date.now(),executionId:"n/a"};console.info("Got debugger event",o),t.addEvents([i]),e.addEvents([i]),n.forEach((e=>e([i])))},onBatchedEvents:e=>(n.add(e),()=>n.delete(e))}})(c,d);p.debugDelay=a;const f=(0,r.keys)(t.node.outputs)[0];return{executeResult:(0,r.execute)({node:t.node,inputs:o,outputs:{[f]:n},resolvedDeps:{...l,[t.node.id]:t.node},_debugger:p,onCompleted:u,onBubbleError:e=>{s(e)},extraContext:{PubSub:i}}),localDebugger:p}},m=e=>{const{debugDelay:t,onOutput:i,flowProps:a}=e,{flow:m,inputs:v,output:h}=a,g=(0,o.useRef)((0,s.createRuntimePlayer)()),[I,y]=(0,o.useState)(e.flowProps.dependencies),[b,C]=(0,o.useState)(),[_]=(0,s.useDebounce)(I,500),x=(0,c.useDarkMode)(),N=async(e,t)=>{const{node:o}=e,i=Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).find((e=>(0,r.isBaseNode)(e)&&e.id===o.id));let a;y((e=>({...e,[i.id]:{...i,source:{path:"@flyde/stdlib/dist/all-browser",export:i.id}}})));const l=(0,u.ZP)(m,(n=>{if(t){const o=(0,s.vAdd)({x:0,y:0},t.pos);if(a=(0,s.createNewNodeInstance)(e.node,0,o,I),n.node.instances.push(a),t.connectTo){const{insId:e,outputId:o}=t.connectTo;n.node.connections.push({from:{insId:e,pinId:o},to:{insId:a.id,pinId:r.TRIGGER_PIN_ID}})}}}));await new Promise((e=>setTimeout(e,10)));const c=(0,u.ZP)(j,(e=>{e.flow=l,t?.selectAfterAdding&&a&&(e.boardData.selected=[a?.id])}));return P(c),(0,s.toastMsg)(`Node ${o.id} successfully imported from ${e.module}`),I},w=async()=>({importables:Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).filter(r.isBaseNode).map((e=>({node:{...e,source:{path:"n/a",export:"n/a"}},module:"@flyde/stdlib"}))),errors:[]}),[j,P]=(0,o.useState)({flow:m,boardData:{viewPort:{pos:{x:0,y:0},zoom:1},lastMousePos:{x:0,y:0},selected:[]}});(0,o.useEffect)((()=>{P((e=>({...e,flow:m})))}),[m]),(0,o.useEffect)((()=>{y((e=>({...e,main:j.flow.node})))}),[j.flow.node]);const O={state:j,onChangeEditorState:P,hideTemplatingTips:!0,initialPadding:p,onExtractInlineNode:r.noop,disableScrolling:!0,darkMode:x.isDarkMode};(0,o.useEffect)((()=>{g.current.start()}),[]),(0,o.useEffect)((()=>{const{executeResult:n,localDebugger:o}=f({flow:j.flow,dependencies:I,output:h,inputs:v,onError:r.noop,debugDelay:t,player:g.current,onCompleted:e.onCompleted}),s=e.flowProps.output.subscribe((e=>i(e)));return C(o),()=>{n(),s.unsubscribe()}}),[t,_]);const E=(0,o.useMemo)((()=>({resolvedDependencies:I,onImportNode:N,onRequestImportables:w})),[]),D=(0,o.useMemo)((()=>({debuggerClient:b,onRequestHistory:d.requestHistory})),[b]);return o.createElement(l.Z,null,(()=>o.createElement(s.DependenciesContextProvider,{value:E},o.createElement(s.DebuggerContextProvider,{value:D},o.createElement(s.FlowEditor,O)))))}},21766:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var o=n(74762);const i=200,s=()=>{const e=new Map,t=new Map;return{requestHistory:async(n,s,r)=>{const a="input"===r?o.DebuggerEventType.INPUT_CHANGE:o.DebuggerEventType.OUTPUT_CHANGE;if(console.log({insId:n,pinId:s,type:a}),s){const t=`${n}.${s}.${a}`,o=e.get(t)||{total:0,lastSamples:[]},r=o.lastSamples.slice(0,i);return{...o,lastSamples:r}}{const e=t.get(n)||{total:0,lastSamples:[]},o=e.lastSamples.slice(0,i);return{...e,lastSamples:o}}},addEvents:n=>{n.forEach((n=>{if(n.type===o.DebuggerEventType.ERROR){const e=n;e.type=o.DebuggerEventType.OUTPUT_CHANGE,e.pinId=o.ERROR_PIN_ID}if(n.type===o.DebuggerEventType.INPUT_CHANGE||n.type===o.DebuggerEventType.OUTPUT_CHANGE){const{insId:o,type:s,pinId:r}=n;{const t=`${o}.${r}.${s}`,a=e.get(t)||{total:0,lastSamples:[]};a.lastSamples.unshift(n),a.lastSamples.length>i&&a.lastSamples.splice(i,a.lastSamples.length-i),a.total++,e.set(t,a)}{const s=t.get(o)||{total:0,lastSamples:[]};s.lastSamples.unshift(n),s.lastSamples.length>i&&s.lastSamples.splice(i,s.lastSamples.length-i),s.total++,e.set(o,s)}}}))}}}},4144:(e,t,n)=>{"use strict";n.d(t,{V:()=>r});var o=n(10328),i=n(70079);const s=e=>i.createElement("li",{className:"log-item"},i.createElement("main",{className:"content"},e.value),i.createElement("aside",null,new Date(e.time).toLocaleTimeString())),r=e=>{const[t,n]=i.useState([]);return i.useEffect((()=>{e.output.subscribe((e=>{const t="object"==typeof e&&i.isValidElement(e)?e:`${e}`;n((e=>[...e,{value:t,time:Date.now()}]))}))}),[]),i.createElement("div",{className:"output-log"},i.createElement("header",null,"Output Log"," ",i.createElement("button",{className:"clear-btn button button--outline button--secondary button--sm",onClick:()=>n([])},"Clear")),i.createElement("main",null,i.createElement("ul",null,t.map(((e,t)=>i.createElement(s,(0,o.Z)({},e,{key:t}))))),0===t.length?i.createElement("div",{className:"empty-state"},"Nothing to show. Interact with the example to emit some outputs!"):null))}},79256:(e,t,n)=>{"use strict";n.d(t,{I:()=>p});var o=n(70079),i=n(65092),s=n(19841),r=n(49794),a=n(21766),u=n(73949),l=n(81098),c=n(65645);(0,a.S)();const d=[{title:"Hello World",key:"hello-world"},{title:"React Counter",key:"react-counter"},{title:"BMI Calculator",key:"bmi"},{title:"REST API Usage",key:"apis"},{title:"Debounce vs. Throttling",key:"debounce-throttling"},{title:"Fibonacci Seq.",key:"fibonacci"}],p=e=>{const[t,n]=(0,o.useState)(e.initWidth||500),[a,p]=(0,o.useState)(e.defaultDelay||0),[f,m]=(0,o.useState)(!1),v=(0,o.useCallback)(((e,t)=>{let{size:o}=t;n(o.width)}),[]),h=o.createElement("div",{className:"delay-container"},o.createElement("input",{type:"range",id:"volume",name:"delay",value:a,step:"100",min:"0",max:"300",onChange:e=>p(Number(e.target.value))}),o.createElement("label",{htmlFor:"volume"},"Debug Delay: ",a,"ms")),g=d.findIndex((t=>t.key===e.meta.key)),I=d[g+1],y=d[g-1];return o.createElement(i.Z,{title:`${e.meta.title} | Playground`,description:`Flyde Playground - ${e.meta.title} example`},o.createElement("header",{className:(0,s.default)("hero hero--primary",u.Z.heroBanner,"playground-hero")},o.createElement("div",{className:"container"},o.createElement("h1",{className:"hero__title"},"Welcome to Flyde's Online Playground"),o.createElement("p",{className:"hero__subtitle"},"Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!"))),o.createElement("div",{className:"mobile-warning"},"Flyde is currently not optimized for mobile devices. Please"," ",o.createElement("strong",null,"use a desktop computer for the best experience"),"."),o.createElement("ul",{className:"examples__menu"},d.map((e=>o.createElement("li",{key:e.key},o.createElement(r.Z,{to:`/playground/${e.key}`,className:"button button--primary"},e.title))))),o.createElement("div",{className:"playground-container"},o.createElement("header",null,o.createElement("h2",{className:"playground-title"},e.meta.title),o.createElement("div",{className:"playground-description"},e.meta.description),f?o.createElement(o.Fragment,null,o.createElement("hr",null),o.createElement("div",{className:"playground-extra"},e.extraInfo||e.meta.extraInfo,o.createElement("div",{className:"star-hint"},o.createElement("span",null,"\xa0 PS: Did you like this example?"),"Please consider giving a \u2b50\ufe0f to the project"," ",o.createElement("span",{className:"star-wrapper"},o.createElement("iframe",{className:"gh-stars-frame",src:"https://ghbtns.com/github-btn.html?user=flydelabs&repo=flyde&type=star&count=true&size=small",width:100,height:20,title:"GitHub Stars"}))))):null,e.prefixComponent),o.createElement("div",{className:"playground"},o.createElement("div",{className:"flow-container"},!0!==e.hideDelay?h:null,o.createElement(c.Y,{flowProps:e.flowProps,debugDelay:a,onOutput:()=>m(!0)})),o.createElement(l.Resizable,{height:0,width:t,onResize:v,handle:o.createElement("div",{className:"handle"}),axis:"x",resizeHandles:["w"]},o.createElement("div",{className:"output-container",style:{flexBasis:t}},e.children))),o.createElement("nav",{className:"pagination-nav"},o.createElement("div",{className:"pagination-nav__item"},y?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${y.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Previous Example"),o.createElement("div",{className:"pagination-nav__label"},y.title)):null),o.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},I?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${I.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Next Example"),o.createElement("div",{className:"pagination-nav__label"},I.title)):null))))}},44046:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var o=n(70079),i=n(74762),s=n(79256);const r={dependencies:{Delay:{id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:"Control Flow",description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:n(43920).Delay.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Delay"}}},flow:{imports:{"@flyde/stdlib":["Delay"]},node:{instances:[{pos:{x:-249.638056640625,y:-391.20183471679684},id:"Inline-value-Hello World-673",inputConfig:{},node:{id:"Inline-value-Hello",inputs:{},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:'const result = ("Hello"); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"Hello"',dataBuilderSource:"IkhlbGxvIg==",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},style:{size:"large",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-92.58089599609374,y:-99.73132080078125},id:"clbdutwlh000c4664hu8g9uxd",inputConfig:{},node:{id:"Inline-value-World!",inputs:{},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:'const result = ("World!"); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"World!"',dataBuilderSource:"IldvcmxkISI=",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},style:{size:"large",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-53.302717285156234,y:-233.93417114257812},id:"Delay-621",inputConfig:{delay:{mode:"static",value:3e3}},nodeId:"Delay"}],connections:[{from:{insId:"Inline-value-Hello World-673",pinId:"value"},to:{insId:"__this",pinId:"output"}},{from:{insId:"clbdutwlh000c4664hu8g9uxd",pinId:"value"},to:{insId:"__this",pinId:"output"}},{from:{insId:"Inline-value-Hello World-673",pinId:"value"},to:{insId:"Delay-621",pinId:"value"}},{from:{insId:"Delay-621",pinId:"delayedValue"},to:{insId:"clbdutwlh000c4664hu8g9uxd",pinId:"__trigger"}}],id:"Main",inputs:{},outputs:{output:{type:"any",optional:!1,delayed:!1}},inputsPosition:{},outputsPosition:{result:{x:-205.4333437325436,y:70.46791651575376},output:{x:-193.31878077738958,y:61.65730860559751}}}}};var a=n(4144);const u={title:"Hello World",description:'This is the "Hello, World!" example for Flyde. When you run this flow, it will output "Hello", wait for 3 seconds, and then output "World!". Click the "Run" button below to see it in action. This example highlights one of the key strengths of Flyde: the ability to view your program running in real-time. Note that the delay in the flow is intentional and added to make the example longer.',key:"hello-world"},l='Great job. You can change the strings double-clicking them. Double click on the green "ms: 3000" to edit the delay threshold. Go ahead, try it now!';function c(){const e=(0,o.useRef)((0,i.dynamicOutput)()),t=(0,o.useRef)({__trigger:(0,i.dynamicNodeInput)()}),[n,c]=(0,o.useState)({flow:r.flow,dependencies:r.dependencies,inputs:t.current,output:e.current}),d=o.createElement("button",{className:"button button--success",onClick:()=>t.current.__trigger.subject.next("run")},"Run!");return o.createElement(s.I,{meta:u,flowProps:n,hideDelay:!0,prefixComponent:d,initWidth:300,extraInfo:l},o.createElement(a.V,{output:e.current}))}},73949:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={"flyde-flow-editor":"flyde-flow-editor_AAD4",_hj_feedback_container:"_hj_feedback_container_Af03"}},85721:(e,t,n)=>{var o={"./af":47654,"./af.js":47654,"./ar":61325,"./ar-dz":98344,"./ar-dz.js":98344,"./ar-kw":26230,"./ar-kw.js":26230,"./ar-ly":42524,"./ar-ly.js":42524,"./ar-ma":44119,"./ar-ma.js":44119,"./ar-sa":82625,"./ar-sa.js":82625,"./ar-tn":42182,"./ar-tn.js":42182,"./ar.js":61325,"./az":37093,"./az.js":37093,"./be":32721,"./be.js":32721,"./bg":59919,"./bg.js":59919,"./bm":95594,"./bm.js":95594,"./bn":563,"./bn-bd":41757,"./bn-bd.js":41757,"./bn.js":563,"./bo":73211,"./bo.js":73211,"./br":87438,"./br.js":87438,"./bs":83662,"./bs.js":83662,"./ca":61196,"./ca.js":61196,"./cs":5841,"./cs.js":5841,"./cv":85251,"./cv.js":85251,"./cy":24512,"./cy.js":24512,"./da":37539,"./da.js":37539,"./de":5059,"./de-at":53853,"./de-at.js":53853,"./de-ch":99378,"./de-ch.js":99378,"./de.js":5059,"./dv":91454,"./dv.js":91454,"./el":39651,"./el.js":39651,"./en-au":87953,"./en-au.js":87953,"./en-ca":98193,"./en-ca.js":98193,"./en-gb":61980,"./en-gb.js":61980,"./en-ie":14050,"./en-ie.js":14050,"./en-il":6502,"./en-il.js":6502,"./en-in":555,"./en-in.js":555,"./en-nz":11372,"./en-nz.js":11372,"./en-sg":26568,"./en-sg.js":26568,"./eo":69533,"./eo.js":69533,"./es":68327,"./es-do":17620,"./es-do.js":17620,"./es-mx":96467,"./es-mx.js":96467,"./es-us":83272,"./es-us.js":83272,"./es.js":68327,"./et":68523,"./et.js":68523,"./eu":19066,"./eu.js":19066,"./fa":59087,"./fa.js":59087,"./fi":96443,"./fi.js":96443,"./fil":93979,"./fil.js":93979,"./fo":90383,"./fo.js":90383,"./fr":56327,"./fr-ca":25610,"./fr-ca.js":25610,"./fr-ch":97274,"./fr-ch.js":97274,"./fr.js":56327,"./fy":67442,"./fy.js":67442,"./ga":44291,"./ga.js":44291,"./gd":77342,"./gd.js":77342,"./gl":96248,"./gl.js":96248,"./gom-deva":21404,"./gom-deva.js":21404,"./gom-latn":20833,"./gom-latn.js":20833,"./gu":9122,"./gu.js":9122,"./he":74623,"./he.js":74623,"./hi":60364,"./hi.js":60364,"./hr":30860,"./hr.js":30860,"./hu":70441,"./hu.js":70441,"./hy-am":90425,"./hy-am.js":90425,"./id":29672,"./id.js":29672,"./is":96150,"./is.js":96150,"./it":27852,"./it-ch":55603,"./it-ch.js":55603,"./it.js":27852,"./ja":16465,"./ja.js":16465,"./jv":20120,"./jv.js":20120,"./ka":87245,"./ka.js":87245,"./kk":21479,"./kk.js":21479,"./km":65038,"./km.js":65038,"./kn":63060,"./kn.js":63060,"./ko":85020,"./ko.js":85020,"./ku":90582,"./ku.js":90582,"./ky":34950,"./ky.js":34950,"./lb":94201,"./lb.js":94201,"./lo":87894,"./lo.js":87894,"./lt":70120,"./lt.js":70120,"./lv":4265,"./lv.js":4265,"./me":14030,"./me.js":14030,"./mi":9463,"./mi.js":9463,"./mk":25898,"./mk.js":25898,"./ml":64233,"./ml.js":64233,"./mn":47156,"./mn.js":47156,"./mr":34479,"./mr.js":34479,"./ms":24691,"./ms-my":6456,"./ms-my.js":6456,"./ms.js":24691,"./mt":81789,"./mt.js":81789,"./my":37452,"./my.js":37452,"./nb":91170,"./nb.js":91170,"./ne":87529,"./ne.js":87529,"./nl":81776,"./nl-be":24455,"./nl-be.js":24455,"./nl.js":81776,"./nn":34705,"./nn.js":34705,"./oc-lnc":36139,"./oc-lnc.js":36139,"./pa-in":17960,"./pa-in.js":17960,"./pl":1899,"./pl.js":1899,"./pt":31670,"./pt-br":29159,"./pt-br.js":29159,"./pt.js":31670,"./ro":55115,"./ro.js":55115,"./ru":45149,"./ru.js":45149,"./sd":81231,"./sd.js":81231,"./se":35397,"./se.js":35397,"./si":99786,"./si.js":99786,"./sk":39383,"./sk.js":39383,"./sl":68691,"./sl.js":68691,"./sq":34826,"./sq.js":34826,"./sr":40080,"./sr-cyrl":75673,"./sr-cyrl.js":75673,"./sr.js":40080,"./ss":54309,"./ss.js":54309,"./sv":52245,"./sv.js":52245,"./sw":8967,"./sw.js":8967,"./ta":10454,"./ta.js":10454,"./te":35204,"./te.js":35204,"./tet":81571,"./tet.js":81571,"./tg":15737,"./tg.js":15737,"./th":41786,"./th.js":41786,"./tk":50511,"./tk.js":50511,"./tl-ph":14828,"./tl-ph.js":14828,"./tlh":62422,"./tlh.js":62422,"./tr":97047,"./tr.js":97047,"./tzl":90792,"./tzl.js":90792,"./tzm":67730,"./tzm-latn":59963,"./tzm-latn.js":59963,"./tzm.js":67730,"./ug-cn":42535,"./ug-cn.js":42535,"./uk":33151,"./uk.js":33151,"./ur":22750,"./ur.js":22750,"./uz":61914,"./uz-latn":60231,"./uz-latn.js":60231,"./uz.js":61914,"./vi":55517,"./vi.js":55517,"./x-pseudo":64078,"./x-pseudo.js":64078,"./yo":70046,"./yo.js":70046,"./zh-cn":81832,"./zh-cn.js":81832,"./zh-hk":90953,"./zh-hk.js":90953,"./zh-mo":38236,"./zh-mo.js":38236,"./zh-tw":71001,"./zh-tw.js":71001};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=s,e.exports=i,i.id=85721}}]); \ No newline at end of file diff --git a/assets/js/7a4a9b46.ecd791fe.js b/assets/js/7a4a9b46.9fb3b1b2.js similarity index 61% rename from assets/js/7a4a9b46.ecd791fe.js rename to assets/js/7a4a9b46.9fb3b1b2.js index 7cbc424f9..c5d91a6cd 100644 --- a/assets/js/7a4a9b46.ecd791fe.js +++ b/assets/js/7a4a9b46.9fb3b1b2.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[764],{19121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cappedArrayDebounce=void 0;t.cappedArrayDebounce=function(e,t,n,o){void 0===o&&(o=500);let i=[],s=null,r=null;return{addItem:a=>{clearTimeout(s),i.push(a),r||(r=setTimeout((()=>{e(i),clearTimeout(s),r=null}),o)),i.length>=n?(e(i),clearTimeout(r),r=null,i=[]):s=setTimeout((()=>{e(i),clearTimeout(r),r=null,i=[]}),t)},flush:()=>{i.length&&(e(i),i=[],clearTimeout(r))},pendingItems:()=>i.length}}},59792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.dataShaper=t.DataShapeType=void 0,function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.ARRAY=3]="ARRAY",e[e.OBJECT=4]="OBJECT",e[e.NULL=5]="NULL",e[e.UNSUPPORTED=6]="UNSUPPORTED"}(n=t.DataShapeType||(t.DataShapeType={}));const o={string:n.STRING,number:n.NUMBER,boolean:n.BOOLEAN,object:n.OBJECT,array:n.ARRAY,null:n.NULL,symbol:n.UNSUPPORTED,undefined:n.UNSUPPORTED,function:n.UNSUPPORTED,bigint:n.UNSUPPORTED};t.dataShaper=function(e,n,i){void 0===n&&(n=5),void 0===i&&(i=5);const s=null===(r=e)?"null":typeof r;var r,a;if("object"===s){if(Array.isArray(e))return n>1?e.filter(((e,t)=>t(0,t.dataShaper)(e,n-1,i))):o.array;if(n>1){const o={};for(const s in e)o[s]=(0,t.dataShaper)(e[s],n-1,i);return a=o,Object.keys(a).sort().reduce(((e,t)=>(e[t]=a[t],e)),{})}return o.object}return o[s]}},23046:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.debugLogger=void 0;const i=(0,o(n(55899)).default)("flyde");t.debugLogger=e=>i.extend(e)},24331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullInsIdPath=void 0,t.fullInsIdPath=function(e,t){if(!e)throw new Error("insId is not defined");return t?`${t}.${e}`:e}},34459:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hashFlow=t.hashNode=void 0;const i=o(n(68805)),s=n(30292),r=e=>(0,i.default)(e);t.hashNode=function(e,t){var n;void 0===t&&(t=!0);const{id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l}=e,c={id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l};if((0,s.isVisualNode)(e)){const{instances:n,connections:o,inputsPosition:i,outputsPosition:s}=e,a=n.map((e=>{const{pos:t,...n}=e;return n})),u=t?{}:{inputsPosition:i,outputsPosition:s},l=t?a:n;l.sort(((e,t)=>e.id.localeCompare(t.id)));const d=[...o];d.sort(((e,t)=>{const n=`${e.from.insId}.${e.from.pinId}`,o=`${t.from.insId}.${t.from.pinId}`;return n.localeCompare(o)}));const p=JSON.stringify({instancesToUse:l,conns:d,...c,maybeIoPos:u});return r(p)}if((0,s.isInlineValueNode)(e)){const{customViewCode:t}=e,o=null!==(n=e.fnCode)&&void 0!==n?n:e.runFnRawCode,i=JSON.stringify({fnCode:o,customViewCode:t,...c});return r(i)}throw new Error("Hashing code nodes unsupported")};t.hashFlow=e=>{const{node:n,imports:o}=e,i=(0,t.hashNode)(n,!1),s=Object.entries(null!=o?o:{}).sort(((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)})).map((e=>{let[t,n]=e;return[t,n.sort()]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{}),a=JSON.stringify(s);return r(i+a)}},86873:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DepGraph=void 0,i(n(3172),t),i(n(59962),t),i(n(23046),t),i(n(19121),t),i(n(59962),t),i(n(34459),t),i(n(39043),t),i(n(59792),t),i(n(24331),t),t.DepGraph=n(60359).DepGraph},3172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testDataCreator=void 0;t.testDataCreator=e=>function(t){void 0===t&&(t={});return{..."function"==typeof e?e():e,...t}}},59962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplePluralize=t.eventually=t.delay=t.noop=t.removeDupes=t.ensure=t.isOptionalType=t.callFnOrFnPromise=t.isPromise=t.isDefined=t.containsAll=t.shuffle=t.randomInts=t.repeat=t.pickRandom=t.randomPos=t.randomInt=t.pickSecond=t.pickFirst=t.fromEntries=t.entries=t.okeys=t.values=t.keys=t.filterOMap=t.mapOMap=t.middlePos=t.calcCenter=t.intersectRect=void 0;t.intersectRect=(e,t)=>{const n=e.x+e.w,o=t.x+t.w;return!(t.x>n||oe.y+e.h||t.y+t.h{let{w:t,h:n,x:o,y:i}=e;return{x:o+t/2,y:i+n/2}};t.middlePos=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});t.mapOMap=(e,n)=>(0,t.entries)(e).map((e=>{let[t,o]=e;return[t,n(t,o)]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.filterOMap=(e,n)=>(0,t.entries)(e).filter((e=>{let[t,o]=e;return n(t,o)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.keys=e=>Object.keys(e);t.values=e=>Object.values(e),t.okeys=t.keys;t.entries=e=>(0,t.okeys)(e).map((t=>[t,e[t]]));t.fromEntries=e=>e.reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.pickFirst=e=>e[0];t.pickSecond=e=>e[1];t.randomInt=function(e,t){void 0===t&&(t=0);const n=Math.random();return t+Math.floor((e-t)*n)};t.randomPos=function(e,n){void 0===e&&(e=1e3),void 0===n&&(n=0);return{x:(0,t.randomInt)(e,n),y:(0,t.randomInt)(e,n)}};t.pickRandom=e=>e[(0,t.randomInt)(e.length)];t.repeat=(e,t)=>"x".repeat(e).split("").map(((e,n)=>t(n)));t.randomInts=function(e,n,o){return void 0===n&&(n=100),void 0===o&&(o=0),(0,t.repeat)(e,(()=>(0,t.randomInt)(n,o)))};t.shuffle=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t};t.containsAll=(e,t)=>t.every((t=>e.includes(t)));t.isDefined=e=>void 0!==e;t.isPromise=e=>e&&"function"==typeof e.then;t.callFnOrFnPromise=(e,n)=>{if(!(0,t.isDefined)(e))return;const o=e=>{try{e()}catch(t){console.error(n,t)}};"function"==typeof e?o(e):Promise.resolve(e).then((e=>{"function"==typeof e&&o(e)}))};t.isOptionalType=e=>/\?$/.test(e);t.ensure=(e,t)=>{if(void 0===e)throw new Error(t||"Undefined value passed");return e};t.removeDupes=e=>Array.from(new Set(e));t.noop=()=>{};t.delay=e=>new Promise((t=>setTimeout(t,e)));t.eventually=async function(e,n,o,i){if(void 0===n&&(n=1e3),void 0===o&&(o=100),void 0===i&&(i=new Set),n<0){const e=Array.from(i).reduce(((e,t,n)=>`${e}\n\t\t${n+1}. ${t}`),"");throw new Error(`[Eventually timeout exceeded after: timeout with error]: ${e}`)}try{await e()}catch(s){const r=Date.now();await(0,t.delay)(o);const a=Date.now()-r;return i.add(null==s?void 0:s.message),(0,t.eventually)(e,n-a,o,i)}},t.simplePluralize=function(e,t){return`${e} ${t}${1!==e?"s":""}`}},39043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileObjectTemplate=t.compileStringTemplate=void 0;t.compileStringTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=new RegExp("\\$\\{"+e+"\\}","g");n=n.replace(i,o)})),n};t.compileObjectTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=JSON.stringify(o),s=new RegExp('"\\$\\$\\{'+e+'\\}"',"g"),r=new RegExp("\\$\\{"+e+"\\}","g"),a="string"==typeof o?o.replace(/"/g,((e,t,n)=>"\\"!==n[t-1]?'\\"':n[t])):o;n=n.replace(s,i).replace(r,a).replace(/\n/g,"\\n")})),JSON.parse(n)}},69150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connection=t.connectionData=t.connectionDataEquals=t.connectionNodeEquals=t.connectionNode=t.externalConnectionNode=t.isInternalConnection=t.isExternalConnection=t.isInternalConnectionNode=t.isExternalConnectionNode=t.getNodeOutputs=t.getOutputName=t.getInputName=t.getNodeInputs=t.TRIGGER_PIN_ID=t.ERROR_PIN_ID=t.THIS_INS_ID=void 0;const o=n(30292);t.THIS_INS_ID="__this",t.ERROR_PIN_ID="__error",t.TRIGGER_PIN_ID="__trigger";t.getNodeInputs=e=>({...e.inputs,[t.TRIGGER_PIN_ID]:(0,o.nodeInput)()});t.getInputName=e=>e===t.TRIGGER_PIN_ID?"Trigger Node":e;t.getOutputName=e=>e===t.ERROR_PIN_ID?"Error":e;t.getNodeOutputs=e=>({...e.outputs,[t.ERROR_PIN_ID]:(0,o.nodeOutput)()});t.isExternalConnectionNode=e=>e&&e.insId===t.THIS_INS_ID;t.isInternalConnectionNode=e=>e.insId!==t.THIS_INS_ID;t.isExternalConnection=e=>{let{from:n,to:o}=e;return(0,t.isExternalConnectionNode)(n)||(0,t.isExternalConnectionNode)(o)};t.isInternalConnection=e=>!(0,t.isExternalConnection)(e);t.externalConnectionNode=e=>({insId:t.THIS_INS_ID,pinId:e});t.connectionNode=(e,t)=>({insId:e,pinId:t});t.connectionNodeEquals=(e,t)=>e.insId===t.insId&&e.pinId===t.pinId;t.connectionDataEquals=(e,n)=>!(!e||!n)&&((0,t.connectionNodeEquals)(e.from,n.from)&&(0,t.connectionNodeEquals)(e.to,n.to)),t.connectionData=function(e,n,o){const i="string"==typeof e?e.split("."):e,s="string"==typeof n?n.split("."):n;if(i.length>2||s.length>2)throw new Error(`invalid source or target to connection data - ${e} / ${n}`);return{from:2===i.length?(0,t.connectionNode)(i[0],i[1]):(0,t.externalConnectionNode)(i[0]),to:2===s.length?(0,t.connectionNode)(s[0],s[1]):(0,t.externalConnectionNode)(s[0]),delayed:o}};t.connection=function(e,t,n){return void 0===n&&(n=!1),{from:e,to:t,delayed:n}}},6775:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;const s=n(30292),r=n(47025),a=n(86873),u=n(69150);i(n(69150),t);t.connect=function(e,t,n,o,i,l,c,d){void 0===n&&(n={}),void 0===i&&(i={}),void 0===l&&(l=a.noop),void 0===c&&(c={}),void 0===d&&(d={});const{id:p,connections:f,instances:m}=e,h=p||"connected-node"+(0,a.randomInt)(999);return{inputs:e.inputs,outputs:e.outputs,id:h,completionOutputs:e.completionOutputs,reactiveInputs:e.reactiveInputs,run:(p,v)=>{let g=[];const I=new a.DepGraph({}),y=new Map,b=new Map,C=new Map,x=new Map,_=new Map,w=new Map;let N;const j=new Set;m.forEach((e=>{const n=(0,s.getNode)(e,t),o=e.id;y.set(e,o),b.set(o,e),I.addNode(o);const i=Object.keys(n.inputs),r=Object.keys(n.outputs),a={},l={};i.forEach((t=>{const n=(e.inputConfig||{})[t]||(0,s.queueInputPinConfig)();(0,s.isStaticInputPinConfig)(n)?a[t]=(0,s.staticNodeInput)(n.value):a[t]=(0,s.dynamicNodeInput)({config:n})})),a[u.TRIGGER_PIN_ID]=(0,s.dynamicNodeInput)({config:(0,s.queueInputPinConfig)()});if(f.some((t=>(0,u.isInternalConnectionNode)(t.to)&&t.to.insId===e.id&&t.to.pinId===u.TRIGGER_PIN_ID))&&e.inputConfig&&e.inputConfig[u.TRIGGER_PIN_ID])throw"Trigger connection can not be configured";r.forEach((e=>{const t=(0,s.dynamicOutput)();l[e]=t}));f.some((t=>(0,u.isInternalConnectionNode)(t.from)&&t.from.insId===e.id&&t.from.pinId===u.ERROR_PIN_ID))&&(l[u.ERROR_PIN_ID]=(0,s.dynamicOutput)()),C.set(o,a),x.set(o,l)}));const P=new Set;return f.forEach((n=>{const{from:o,to:i}=n,{insId:r,pinId:a}=o,{insId:l,pinId:c}=i,d=x.get(r),p=C.get(l);if((0,u.isInternalConnectionNode)(i)&&P.add(`${i.insId}.${i.pinId}`),(0,u.isExternalConnection)(n)){if((0,u.isExternalConnectionNode)(o)){const e=null==p?void 0:p[i.pinId];if(!e)throw new Error(`Input ${i.pinId} of instance ${l} not found`);const t=_.get(o.pinId)||[];t.push(e),_.set(o.pinId,t)}else{let e=null==d?void 0:d[o.pinId];if(!e)throw new Error(`Output ${o.pinId} of instance ${r} not found`);const t=w.get(i.pinId)||[];t.push(e),w.set(i.pinId,t)}return}if(!d)throw new Error(`No outputs found for instance [${r}]`);if(!p)throw b.has(l)?new Error(`No inputs found for instance [${l}]`):new Error(`Instance with id [${l}] does not exist!`);const f=d[a];if(!f)throw new Error(`Output source - [${a}] not found in node [${h}]`);const m=p[c],v=b.get(r);if(!v&&r!==u.THIS_INS_ID)throw new Error(`Instance [${r}] does not exist! failed to connect [${o}] -> [${i}]`);const y=(v?(0,s.getNode)(v,t):e).outputs[a];if(y&&y.delayed||n.delayed||r!==u.THIS_INS_ID&&l!==u.THIS_INS_ID&&I.addDependency(r,l),!m)throw new Error(`Target arg - [${i}] not found in node [${h}]`);const N=f.subscribe((async e=>{if(!(0,s.isDynamicInput)(m))throw console.info(m),new Error(`Impossible state listening to non dynamic input - ${l}.${c}`);m.subject.next(e)}));g.push((()=>N.unsubscribe()))})),(0,a.okeys)(v).forEach((e=>{(w.get(e)||[]).forEach((t=>{const n=t.subscribe((async t=>{if(!v[e])throw new Error(`Impossible state - output ${e} does not exist`);v[e].next(t)}));g.push((()=>n.unsubscribe()))}))})),I.overallOrder().map((e=>b.get(e))).forEach((e=>{const a=C.get(e.id),u=x.get(e.id),p=(0,s.getNode)(e,t);if(!a)throw new Error(`Unexpected error - args not found when running ${e}`);if(!u)throw new Error(`Unexpected error - outputs not found when running ${e}`);for(const t in a){const n=e.inputConfig[t];P.has(`${e.id}.${t}`)||(0,s.isStaticInputPinConfig)(n)||delete a[t]}const f=(0,r.execute)({node:p,inputs:a,outputs:u,resolvedDeps:t,_debugger:n,insId:e.id,extraContext:d,mainState:i,ancestorsInsIds:o,onBubbleError:l,onCompleted:()=>{return t=e.id,j.delete(t),void(0===j.size&&N&&N());var t},onStarted:()=>{return t=e.id,void j.add(t);var t},env:c});g.push(f)})),Object.keys(p).forEach((async e=>{(_.get(e)||[]).forEach((t=>{const n=p[e];if(!(0,s.isDynamicInput)(t))throw new Error(`Unsure what to do with key ${e}, input: ${t} of ins ${o}`);(0,a.isDefined)(n)&&t.subject.next(n)}))})),void 0===e.completionOutputs&&j.size>0?new Promise((e=>{N=e})):()=>g.forEach((e=>{try{e()}catch(t){console.error("error unsubscribing",t)}}))}}}},26488:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MINOR_DEBUGGER_EVENT_TYPES=t.MAJOR_DEBUGGER_EVENT_TYPES=t.DebuggerEventType=void 0,function(e){e.INPUT_CHANGE="i",e.OUTPUT_CHANGE="o",e.PROCESSING_CHANGE="pc",e.ERROR="err",e.INPUTS_STATE_CHANGE="isc"}(n=t.DebuggerEventType||(t.DebuggerEventType={})),t.MAJOR_DEBUGGER_EVENT_TYPES=[n.INPUT_CHANGE,n.OUTPUT_CHANGE,n.ERROR],t.MINOR_DEBUGGER_EVENT_TYPES=[n.PROCESSING_CHANGE,n.INPUTS_STATE_CHANGE]},43686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatEvent=void 0;const o=n(26488);t.formatEvent=function(e){var t,n,i;const s=[e.insId,...null!==(n=null===(t=e.ancestorsInsIds)||void 0===t?void 0:t.split("."))&&void 0!==n?n:[]];(null===(i=e.ancestorsInsIds)||void 0===i?void 0:i.length)>0&&e.ancestorsInsIds;const r=`Node <${e.nodeId}> `,a=`(${s.join(" -> ")})`;return`${r} - ${function(e){switch(e.type){case o.DebuggerEventType.PROCESSING_CHANGE:return e.val?"started processing":"stopped processing";case o.DebuggerEventType.INPUT_CHANGE:return`Input pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.OUTPUT_CHANGE:return`Output pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.INPUTS_STATE_CHANGE:return`Inputs queue size changed to ${Object.entries(e.val).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join(", ")}`;case o.DebuggerEventType.ERROR:return`Error: ${e.val}`}}(e)} ${a}`}},99896:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26488),t),i(n(43686),t)},47025:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.GLOBAL_STATE_NS=t.ROOT_INS_ID=t.INPUTS_STATE_SUFFIX=t.INNER_STATE_SUFFIX=void 0;const s=n(62600),r=n(87794);i(n(99896),t);const a=n(30292),u=n(6775),l=n(84479),c=n(86873),d=n(23046),p=n(30292),f=n(99896),m=n(79804);t.INNER_STATE_SUFFIX="_inner",t.INPUTS_STATE_SUFFIX="_inputs";t.ROOT_INS_ID="__root",t.GLOBAL_STATE_NS="____global";t.execute=e=>{let{node:n,inputs:o,outputs:i,resolvedDeps:h,_debugger:v={},insId:g=t.ROOT_INS_ID,extraContext:I={},mainState:y={},ancestorsInsIds:b,onBubbleError:C=s.noop,env:x={},onCompleted:_=s.noop,onStarted:w=s.noop}=e;const N=[];y[t.GLOBAL_STATE_NS]||(y[t.GLOBAL_STATE_NS]=new Map);const j={...I,ENV:x},P=(0,m.customNodesToNodesCollection)(h,j),O=e=>{const t=e instanceof a.NodeInstanceError?e:new a.NodeInstanceError(e,(0,c.fullInsIdPath)(g,b),n.id);v.onEvent&&v.onEvent({type:f.DebuggerEventType.ERROR,val:t,insId:g,ancestorsInsIds:b,nodeId:n.id}),i[u.ERROR_PIN_ID]?i[u.ERROR_PIN_ID].next(t):C(t)},E=(e=>(0,a.isVisualNode)(e)?(0,u.connect)(e,P,v,(0,c.fullInsIdPath)(g,b),y,O,x,I):(0,a.isInlineValueNode)(e)?(0,m.inlineValueNodeToNode)(e,j):e)(n),S=v.onEvent||s.noop,D={},T={};(0,c.entries)(o).forEach((e=>{let[t,o]=e;if((0,a.isDynamicInput)(o)){const e=(0,a.dynamicNodeInput)({config:o.config}),i=o.subject.subscribe((async o=>{const i=S({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o,ancestorsInsIds:b,nodeId:n.id});if(i){const t=await i.valuePromise;e.subject.next(t)}else v.debugDelay&&await(0,c.delay)(v.debugDelay),e.subject.next(o)}));N.push((()=>i.unsubscribe())),T[t]=e}else{S({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o.config.value,ancestorsInsIds:b,nodeId:n.id});const e=(0,a.staticNodeInput)((0,a.getStaticValue)(o.config.value,P,g));T[t]=e}})),(0,c.entries)(i).forEach((e=>{let[t,o]=e;const i=(0,a.dynamicOutput)(),s=i.subscribe((async e=>{const i=S({type:f.DebuggerEventType.OUTPUT_CHANGE,insId:g,pinId:t,val:e,ancestorsInsIds:b,nodeId:n.id});if(i){const e=await i.valuePromise;o.next(e)}else o.next(e)}));N.push((()=>s.unsubscribe())),D[t]=i}));const M=(e=>{var n,o;const{node:i,inputs:u,outputs:m,resolvedDeps:h,_debugger:v,insId:g,ancestorsInsIds:I,mainState:y,onError:b,onStarted:C,onCompleted:x,env:_,extraContext:w}=e,{run:N,fn:j}=i,P=(0,d.debugLogger)("core"),O=[];let E;const S=(null==v?void 0:v.onEvent)||s.noop,D=(0,c.fullInsIdPath)(g,I),T=`${D}${t.INNER_STATE_SUFFIX}`,M=`${D}${t.INPUTS_STATE_SUFFIX}`,k=P.extend(D),R=y[t.GLOBAL_STATE_NS];y[T]||(y[T]=new Map),y[M]||(y[M]=new Map);let A=null!==(n=y[M])&&void 0!==n?n:new Map;const V=()=>{const e=Array.from(A.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:(0,a.isQueueInputPinConfig)(u[n].config)?null==o?void 0:o.length:1}}),{});S({type:f.DebuggerEventType.INPUTS_STATE_CHANGE,val:e,insId:g,ancestorsInsIds:I,nodeId:i.id})},$={execute:(e,n,o,i)=>(0,t.execute)({node:e,inputs:n,outputs:o,resolvedDeps:h,_debugger:v,insId:i,onCompleted:x,onStarted:C}),insId:g,state:null!==(o=y[T])&&void 0!==o?o:new Map,onCleanup:e=>{O.push(e)},onError:e=>{b(e)},context:null!=w?w:{},ancestorsInsIds:I,globalState:R};let L,z=!1;const H=(i.reactiveInputs||[]).filter((e=>{var t;return!(0,p.isStaticInputPinConfig)(null===(t=u[e])||void 0===t?void 0:t.config)})),F=()=>{var e;null===(e=y[T])||void 0===e||e.clear(),(0,c.keys)(y).filter((e=>e.startsWith(`${D}.`))).forEach((e=>{y[e]=new Map}))},G=e=>{const t=(null==e?void 0:e.key)&&H.includes(null==e?void 0:e.key);if(z&&!t);else{const o=z&&t;if((0,l.isNodeStateValid)(u,A,i)||o){let t;if(z){if(!e)throw new Error("Unexpected state, got reactive node while not processing and not valid");const n=(0,l.pullValueForExecution)(e.key,u[e.key],A,_);t={...L,[e.key]:n},V()}else t=(0,l.pullValuesForExecution)(u,A,_),L=t,V();let o=new Set,s={};if(z=!0,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:g,ancestorsInsIds:I,nodeId:i.id}),i.completionOutputs){const e=i.completionOutputs.map((e=>e.split("+"))).reduce(((e,t)=>(t.forEach((n=>{e.set(n,t)})),e)),new Map);(0,c.entries)(m).forEach((t=>{let[n,a]=t;a.pipe((0,r.first)()).subscribe((t=>{o.add(n),s[n]=t;let r=e.get(n);r&&(r.splice(r.indexOf(n),1),0===r.length&&(z=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:g,ancestorsInsIds:I,nodeId:i.id}),x&&x(s),F(),(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),E=void 0,o.clear(),s={},(0,l.hasNewSignificantValues)(u,A,_,i.id)&&G()))}))}))}else(0,c.entries)(m).forEach((e=>{let[t,n]=e;n.subscribe((e=>{s[t]=e}))}));try{k("Running node %s with values %o",i.id,t),C&&C(),E=(null!=j?j:N)(t,m,$),(0,c.isPromise)(E)?E.then((()=>{void 0===i.completionOutputs&&x&&(z=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:g,ancestorsInsIds:I,nodeId:i.id}),x(s),F(),(0,l.hasNewSignificantValues)(u,A,_,i.id)&&G())})).catch((e=>{b(e),z=!1,k("Error in node %s - value %e",i.id,e),S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:g,ancestorsInsIds:I,nodeId:i.id})})):void 0===i.completionOutputs&&x&&(z=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:g,ancestorsInsIds:I,nodeId:i.id}),x(s),F())}catch(n){b(n),z=!1,k("Error in node %s - value %e",i.id,n),S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:g,ancestorsInsIds:I,nodeId:i.id})}const d=H.find((e=>u[e]&&(0,l.peekValueForExecution)(e,u[e],A,_,i.id)));if(d){const e=(0,l.peekValueForExecution)(d,u[d],A,_,i.id);G({key:d,value:e})}else{const e=(0,c.entries)(u).find((e=>{let[t,n]=e;const o=(0,a.isQueueInputPinConfig)(n.config),s=(0,l.peekValueForExecution)(t,n,A,_,i.id);return!!o&&(0,c.isDefined)(s)}));if(e){const[t,n]=e,o=(0,l.peekValueForExecution)(t,n,A,_,i.id);G({key:t,value:o})}}}}};G();const q=(0,l.subscribeInputsToState)(u,A,((e,t)=>{P("Got input %s - value is [%o]",e,t),V();try{G({key:e,value:t})}catch(n){b(n)}}));return O.push(q),()=>{(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),O.forEach((e=>e()))}})({node:E,inputs:T,outputs:D,resolvedDeps:P,_debugger:v,insId:g,mainState:y,ancestorsInsIds:b,onError:O,onBubbleError:C,env:x,extraContext:I,onCompleted:_,onStarted:w});return()=>{N.forEach((e=>e())),M()}}},84479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeInputsToState=t.isNodeStateValid=t.hasNewSignificantValues=t.peekValuesForExecution=t.pullValuesForExecution=t.pullValueForExecution=t.peekValueForExecution=void 0;const o=n(30292),i=n(86873),s=n(6775),r=(e,t)=>{const n=(0,o.extractStaticValue)(e);if((0,o.isEnvValue)(n)){return((e,t)=>{const n=e.split(".");let o={...t};for(let s of n){if(!o||!(0,i.isDefined)(o[s])||null===o[s])throw new Error(`Cannot find key ${e} inside obj ${t}`);o=o[s]}return o})((0,o.getEnvKeyFromValue)(n),t)}return n};t.peekValueForExecution=(e,t,n,i,s)=>{const a=n.get(e);let u;if(!t)throw new Error(`Trying to peek value of inexsting input in key "${e}" in node "${s}"`);return u=(0,o.isStaticInput)(t)?r(t,i):(0,o.isQueueInputPinConfig)(t.config)?a?[...a].shift():void 0:a,u};t.pullValueForExecution=(e,t,n,i)=>{const s=n.get(e);let a;return(0,o.isStaticInput)(t)?a=r(t,i):(0,o.isQueueInputPinConfig)(t.config)?(a=(s||[]).shift(),n.set(e,s)):(a=s,(0,o.isStickyInputPinConfig)(t.config)||n.delete(e)),a};t.pullValuesForExecution=(e,n,o)=>(0,i.entries)(e).reduce(((e,i)=>{let[s,r]=i;return e[s]=(0,t.pullValueForExecution)(s,r,n,o),e}),{});t.peekValuesForExecution=(e,n,o,s)=>(0,i.entries)(e).reduce(((e,i)=>{let[r,a]=i;return e[r]=(0,t.peekValueForExecution)(r,a,n,o,s),e}),{});t.hasNewSignificantValues=(e,n,s,r)=>(0,i.entries)(e).some((e=>{let[a,u]=e;const l=(0,o.isQueueInputPinConfig)(u.config),c=(0,t.peekValueForExecution)(a,u,n,s,r);return(0,i.isDefined)(c)&&l}));t.isNodeStateValid=(e,t,n)=>{const r=(0,i.keys)(e),a=(0,i.keys)(n.inputs).filter((e=>{var t;const o=null===(t=n.inputs[e])||void 0===t?void 0:t.mode;return!o||"required"===o}));r.includes(s.TRIGGER_PIN_ID)&&a.push(s.TRIGGER_PIN_ID);return!!(0,i.containsAll)(r,a)&&(0,i.entries)(e).filter((e=>{let[t]=e;return!!n.inputs[t]||t===s.TRIGGER_PIN_ID})).every((e=>{let[s,r]=e;var a;const u=t.get(s);return"optional"===((null===(a=n.inputs[s])||void 0===a?void 0:a.mode)||"required")||(!!(0,o.isStaticInput)(r)||((0,o.isQueueInputPinConfig)(r.config)?(0,i.isDefined)(u)&&u.length>0:(0,i.isDefined)(u)))}))};t.subscribeInputsToState=(e,t,n)=>{const s=[];return(0,i.entries)(e).forEach((e=>{let[i,r]=e;if(!r)return;if((0,o.isStaticInput)(r))return;const a=r.subject.subscribe((e=>{if((0,o.isQueueInputPinConfig)(r.config)){const o=t.get(i)||[];if(!Array.isArray(o))throw new Error(`impossible state - state of key ${i} is set but not an array`);o.push(e),t.set(i,o),n(i,e)}else t.set(i,e),n(i,e)}));s.push((()=>a.unsubscribe()))})),()=>s.forEach((e=>e()))}},5474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flydeFlowSchema=void 0;const o=n(29022),i=o.z.record(o.z.string(),o.z.string().or(o.z.array(o.z.string()))),s=o.z.strictObject({x:o.z.number(),y:o.z.number()}),r=o.z.discriminatedUnion("mode",[o.z.strictObject({mode:o.z.literal("static"),value:o.z.any()}),o.z.strictObject({mode:o.z.literal("queue")}),o.z.strictObject({mode:o.z.literal("sticky")})]),a=o.z.object({size:o.z.optional(o.z.enum(["small","regular","large"])),icon:o.z.optional(o.z.any()),color:o.z.optional(o.z.string()),cssOverride:o.z.optional(o.z.record(o.z.string()))}),u=o.z.object({pos:s.default({x:0,y:0}),id:o.z.string(),inputConfig:o.z.optional(o.z.record(o.z.string(),r)).default({}),visibleInputs:o.z.optional(o.z.array(o.z.string())),visibleOutputs:o.z.optional(o.z.array(o.z.string())),nodeId:o.z.optional(o.z.string()),node:o.z.optional(o.z.any()),style:o.z.optional(a)}).refine((e=>e.node||e.nodeId),{message:"Instance must have either an inline node or refer to a nodeId"}),l=o.z.union([o.z.string(),o.z.object({mode:o.z.enum(["required","optional","required-if-connected"]),type:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),defaultValue:o.z.optional(o.z.any())})]),c=o.z.object({type:o.z.optional(o.z.string()),optional:o.z.optional(o.z.boolean()),delayed:o.z.optional(o.z.boolean()),description:o.z.optional(o.z.string())}),d=o.z.object({id:o.z.optional(o.z.string()),inputs:o.z.record(o.z.string(),l),outputs:o.z.record(o.z.string(),c),inputsPosition:o.z.optional(o.z.record(o.z.string(),s)),outputsPosition:o.z.optional(o.z.record(o.z.string(),s)),customViewCode:o.z.optional(o.z.string()),dataBuilderSource:o.z.optional(o.z.string()),templateType:o.z.optional(o.z.string()),completionOutputs:o.z.optional(o.z.array(o.z.string())),reactiveInputs:o.z.optional(o.z.array(o.z.string())),defaultStyle:o.z.optional(a),description:o.z.optional(o.z.string()),searchKeywords:o.z.optional(o.z.array(o.z.string()))}),p=o.z.object({instances:o.z.array(u),connections:o.z.array(o.z.strictObject({from:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),to:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),delayed:o.z.optional(o.z.boolean()),hidden:o.z.optional(o.z.boolean())}))}).and(d);t.flydeFlowSchema=o.z.strictObject({imports:o.z.optional(i).default({}),node:p})},74762:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticValueVisualNode=void 0,i(n(86873),t);const s=n(30292);i(n(6775),t),i(n(47025),t),i(n(10418),t),i(n(30292),t),i(n(3320),t),i(n(79804),t),i(n(5474),t);t.isStaticValueVisualNode=e=>!!e&&!!(0,s.maybeGetStaticValueNodeId)(`${e}`)},87093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fakeVm=t.VM=t.VMScript=void 0;const o=n(86873);class i{constructor(e){this.script=e}}t.VMScript=i;class s{constructor(e){this.context=e}run(e){const t=(0,o.okeys)(this.context.sandbox),n=Object.values(this.context.sandbox);Function(...t,e.script)(...n)}}t.VM=s,t.fakeVm={VMScript:i,VM:s}},28145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVM2Instance=void 0;const o=n(87093);t.getVM2Instance=()=>o.fakeVm},79804:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.customNodesToNodesCollection=t.inlineValueNodeToNode=void 0;const i=o(n(18706)),s=n(86873),r=n(30292),a=(0,n(28145).getVM2Instance)();t.inlineValueNodeToNode=function(e,t){void 0===t&&(t={});const{runFnRawCode:n,...o}=e,u=(0,s.debugLogger)(`code-node:${e.id}`),l=`\n try {\n ${n}\n } catch (e) {\n adv.onError(e);\n }\n `,c=new a.VMScript(l),d={...o,run:(n,o,l)=>{const d=new a.VM({sandbox:{inputs:n,outputs:o,setInterval:setInterval,clearInterval:clearInterval,setTimeout:setTimeout,clearTimeout:clearTimeout,encodeURIComponent:encodeURIComponent,adv:l,log:function(){for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeWithDependencies=void 0;const o=n(30292),i=n(74762),s=n(88270);t.getNodeWithDependencies=function(e,n,r){if(void 0===r&&(r=[]),(0,o.isInlineValueNode)(e))return[e];if(r.includes(e.id))return[];const a=(0,i.removeDupes)(e.instances.filter((e=>(0,s.isRefNodeInstance)(e))).map((e=>e.nodeId)).filter((e=>n[e])));return[e,...a.flatMap((e=>{var t;return null!==(t=n[e])&&void 0!==t?t:[]})).reduce(((e,o)=>[...e,...(0,t.getNodeWithDependencies)(o,n,[...r,...a])]),[])]}},30292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88270),t),i(n(43069),t),i(n(79426),t),i(n(44535),t),i(n(18063),t),i(n(20359),t)},18063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeInstanceError=void 0;class n extends Error{constructor(e,t,n){let o="Unknown error";o="string"==typeof e?e:e instanceof Error?e.message:null!==e&&"object"==typeof e?JSON.stringify(e):String(e),super(`${o} (insId: ${t}, nodeId: ${n})`),this.name=this.constructor.name,this.message=`${o} (insId: ${t}, nodeId: ${n})`,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.fullInsIdsPath=t,this.nodeId=n}}t.NodeInstanceError=n},88270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInsId=t.NodeInstance=t.isRefNodeInstance=t.isInlineNodeInstance=t.inlineNodeInstance=t.nodeInstance=void 0;const o=n(36618);t.nodeInstance=(e,t,n,o)=>({id:e,nodeId:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.inlineNodeInstance=(e,t,n,o)=>({id:e,node:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.isInlineNodeInstance=e=>!!e.node;t.isRefNodeInstance=e=>!(0,t.isInlineNodeInstance)(e);t.NodeInstance=(e,t,n,o)=>({id:e,nodeId:t.id,inputConfig:n||{},pos:o||{x:0,y:0}});t.createInsId=e=>`${e.id}-${(0,o.slug)()}`},43069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvKeyFromValue=t.toEnvValue=t.isEnvValue=t.extractStaticValue=t.isStaticInput=t.isDynamicInput=t.staticNodeInput=t.dynamicNodeInputs=t.dynamicNodeInput=t.dynamicOutput=t.nodeOutputs=t.nodeOutput=t.nodeInputs=t.isInputPinOptional=t.nodeInput=void 0;const o=n(62600),i=n(30292),s=n(86873),r=n(79426);t.nodeInput=function(e){return void 0===e&&(e="required"),{mode:e}};t.isInputPinOptional=e=>"optional"===e.mode;t.nodeInputs=(e,n)=>(0,s.repeat)(e,(e=>(0,t.nodeInput)((null==n?void 0:n[e])||"required")));t.nodeOutput=function(e){return void 0===e&&(e=!1),{delayed:e}};t.nodeOutputs=e=>(0,s.repeat)(e,(()=>(0,t.nodeOutput)()));t.dynamicOutput=()=>new o.Subject,t.dynamicNodeInput=(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})));t.dynamicNodeInputs=function(e){return void 0===e&&(e=10),(0,s.repeat)(e,(()=>(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})))()))};t.staticNodeInput=e=>({config:(0,r.staticInputPinConfig)(e)});t.isDynamicInput=e=>{const t=e;return t&&t.subject&&!!t.subject.next};t.isStaticInput=e=>(0,i.isStaticInputPinConfig)(null==e?void 0:e.config);t.extractStaticValue=e=>{if((0,t.isStaticInput)(e))return e.config.value;throw new Error("Cannot extract static value from non static arg")};t.isEnvValue=e=>"string"==typeof e&&e.startsWith("$ENV.");t.toEnvValue=e=>`$ENV.${e}`;t.getEnvKeyFromValue=e=>"string"==typeof e?e.replace(/^\$ENV\./,""):e},20359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeFromFunction=t.getNodeDef=t.getNode=t.getStaticValue=t.maybeGetStaticValueNodeId=t.fromSimplified=t.inlineValueNode=t.codeNode=t.visualNode=t.isInlineValueNode=t.isVisualNode=t.isCodeNode=t.isBaseNode=t.InlineValueNodeType=void 0;const o=n(86873),i=n(88270),s=n(43069);!function(e){e.VALUE="value",e.FUNCTION="function"}(t.InlineValueNodeType||(t.InlineValueNodeType={}));t.isBaseNode=e=>e&&e.id&&e.inputs&&e.outputs;t.isCodeNode=e=>(0,t.isBaseNode)(e)&&"function"==typeof e.run;t.isVisualNode=e=>!!e.instances;t.isInlineValueNode=e=>(0,o.isDefined)(e)&&(0,o.isDefined)(e.runFnRawCode),t.visualNode=(0,o.testDataCreator)({id:"visual-node",inputs:{},outputs:{},instances:[],connections:[],outputsPosition:{},inputsPosition:{}}),t.codeNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},run:o.noop}),t.inlineValueNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},runFnRawCode:""});t.fromSimplified=e=>{let{run:t,inputTypes:n,outputTypes:i,id:s}=e;return{id:s,inputs:(0,o.entries)(n).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),outputs:(0,o.entries)(i).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),run:t}};t.maybeGetStaticValueNodeId=e=>{const t="string"==typeof e&&e.match(/^__node\:(.*)/);if(t){return t[1]}return null};t.getStaticValue=(e,n,o)=>{const i=(0,t.maybeGetStaticValueNodeId)(e);if(i){const e=n[i];if(!e)throw new Error(`Instance ${o} referrer to a node reference ${i} that does not exist`);return e}return e};t.getNode=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw new Error(`Node with id ${n} not found`);return o};t.getNodeDef=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw console.error(`Node with id ${n} not found`),new Error(`Node with id ${n} not found`);return o};t.codeFromFunction=e=>{let{id:t,fn:n,inputNames:o,outputName:i,defaultStyle:r}=e;return{id:t,inputs:o.reduce(((e,t)=>({...e,[t]:(0,s.nodeInput)()})),{}),outputs:{[i]:(0,s.nodeOutput)()},run:(e,t)=>{const s=o.map((t=>e[t])),r=t[i],a=n(...s);return Promise.resolve(a).then((e=>null==r?void 0:r.next(e)))},completionOutputs:[i],defaultStyle:r}}},44535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nodeFromSimpleFunction=void 0,t.nodeFromSimpleFunction=function(e){var t;return{...e,id:e.id,description:e.description,namespace:e.namespace,inputs:e.inputs?e.inputs.reduce(((e,t)=>{let{name:n,description:o,mode:i,defaultValue:s}=t;return{...e,[n]:{description:o,mode:null!=i?i:"required",defaultValue:s}}}),{}):{},outputs:e.output?{[e.output.name]:{description:e.output.description}}:{},defaultStyle:{icon:e.icon,size:e.size},run:null!==(t=e.fullRunFn)&&void 0!==t?t:async function(t,n,o){var i,s;const r=(null!==(i=e.inputs)&&void 0!==i?i:[]).map((e=>{let{name:n}=e;return t[n]}));try{const t=await Promise.resolve(e.run(...r));e.output&&(null===(s=n[e.output.name])||void 0===s||s.next(t))}catch(a){console.error("Error in node",a),o.onError(a)}},customViewCode:e.customViewCode}}},79426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticInputPinConfig=t.isStickyInputPinConfig=t.isQueueInputPinConfig=t.staticInputPinConfig=t.stickyInputPinConfig=t.queueInputPinConfig=t.INPUT_MODES=void 0,t.INPUT_MODES=["queue","sticky","static"];t.queueInputPinConfig=()=>({mode:"queue"});t.stickyInputPinConfig=()=>({mode:"sticky"});t.staticInputPinConfig=e=>({mode:"static",value:e});t.isQueueInputPinConfig=e=>"queue"===e.mode;t.isStickyInputPinConfig=e=>!!e&&"sticky"===e.mode,t.isStaticInputPinConfig=function(e){return!!e&&"static"===e.mode}},10418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedExecute=void 0;const o=n(74762),i=n(47025);t.simplifiedExecute=function(e,t,n,s,r){void 0===r&&(r={});const a=(0,o.keys)(e.outputs),u=Object.keys(n).reduce(((e,t)=>{const i=n[t];return{...e,[t]:(0,o.isDynamicInput)(i)?i:(0,o.staticNodeInput)(i)}}),{}),l=a.reduce(((e,t)=>{const n=(0,o.dynamicOutput)();return s&&n.subscribe((e=>{s(t,e)})),{...e,[t]:n}}),{});return(0,i.execute)({node:e,inputs:u,outputs:l,resolvedDeps:t,onBubbleError:e=>{throw e},...r})}},25779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodePreview=void 0;const o=n(35250),i=n(74762),s=n(86553);t.NodePreview=e=>{let{node:t}=e;const n={node:t,instance:(0,i.nodeInstance)("bob",t.id,{}),connections:[],viewPort:{pos:{x:0,y:0},zoom:1},resolvedDeps:{},connectionsPerInput:{},onUngroup:i.noop,onDblClick:i.noop,onDragEnd:i.noop,onDragMove:i.noop,onDragStart:i.noop,onPinClick:i.noop,onPinDblClick:i.noop,onSelect:i.noop,onTogglePinBreakpoint:i.noop,onTogglePinLog:i.noop,onToggleSticky:i.noop,displayMode:!0,onInspectPin:i.noop,onDetachConstValue:i.noop,onCopyConstValue:i.noop,onPasteConstValue:i.noop,ancestorsInsIds:"",onChangeVisibleInputs:i.noop,onChangeVisibleOutputs:i.noop,onConvertConstToEnv:i.noop,forceShowMinimized:"both",onExtractInlineNode:i.noop,onCloseInlineEditor:i.noop,isConnectedInstanceSelected:!1,inlineEditorPortalDomNode:null,onChangeStyle:i.noop,onDeleteInstance:i.noop,onGroupSelected:i.noop,onSetDisplayName:i.noop,hadError:!1,queuedInputsData:{},onPinMouseDown:i.noop,onPinMouseUp:i.noop};return(0,o.jsx)("div",{className:"node-preview",children:(0,o.jsx)(s.InstanceView,{...n})})}},30653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDarkMode=t.DarkModeProvider=void 0;const o=n(70079),i=(0,o.createContext)(!0);t.DarkModeProvider=i.Provider;t.useDarkMode=()=>(0,o.useContext)(i)},29183:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataInspectionModal=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=n(74089),p=n(83938),f=n(17102),m=n(98158);t.DataInspectionModal=e=>{var t;const{onRequestHistory:n}=(0,m.useDebuggerContext)(),{item:o}=e,[i,s]=c.default.useState(),[r,h]=c.default.useState(0),[v,g]=c.default.useState(""),[I,y]=c.default.useState(),[b]=(0,d.useDebounce)(v,300);(0,c.useEffect)((()=>{y(null==i?void 0:i.lastSamples.filter((e=>"object"==typeof e.val?JSON.stringify(e.val).includes(b):e.val.toString().includes(b)))),h(0)}),[null==i?void 0:i.lastSamples,b]),c.default.useEffect((()=>{!async function(){var e,t;const i=await n(o.insId,null===(e=o.pin)||void 0===e?void 0:e.id,null===(t=o.pin)||void 0===t?void 0:t.type);s(i)}()}),[o,n]);const C=e=>{const t=e.val;return"object"==typeof t?(0,a.jsx)(p.BrowserOnlyReactJson,{src:t}):(0,a.jsx)(u.Code,{children:t.toString()})},x=`"${o.insId}" ${(null===(t=o.pin)||void 0===t?void 0:t.id)?`(${o.pin.id})`:""}`;return(0,a.jsx)(u.Dialog,{isOpen:!0,title:`Inspecting data for instance ${x}`,onClose:e.onClose,canEscapeKeyClose:!1,className:"data-inspection-modal",children:(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{children:[i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("em",{children:[x," called ",i.total," time(s)"]}),i.total>10&&(0,a.jsx)("span",{children:"Showing last 10 samples"})]}):null,(0,a.jsx)("input",{className:"bp5-input bp5-small bp5-fill",type:"search",placeholder:"Search for values",dir:"auto",onChange:e=>g(e.target.value),value:v}),b.length>0&&(0,a.jsxs)("span",{children:["Showing ",null==I?void 0:I.length," of ",i.lastSamples.length," ",'samples matching query "',b,'"']})]}),(0,a.jsx)("main",{className:"main-wrapper",children:(()=>{if(!i)return(0,a.jsx)(f.Loader,{});if(0===i.total)return(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",(0,a.jsx)("em",{children:o.insId})," ",o.pin?(0,a.jsxs)(c.default.Fragment,{children:["and pin ",(0,a.jsx)("em",{children:o.pin.id})]}):null,". Make sure debugger is running and your program was triggered."]});const e=null==I?void 0:I[r];return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Card,{className:"content-wrapper",children:[e?(0,a.jsxs)("div",{className:"info",children:[(0,a.jsxs)("div",{children:["Showing sample ",r," of event from"," ",(0,a.jsx)("strong",{children:(0,d.timeAgo)(e.time)})," (",new Date(e.time).toLocaleString(),")"]}),(0,a.jsxs)("div",{children:["Instance: ",(0,a.jsx)("strong",{children:e.insId}),", Pin id:"," ",(0,a.jsx)("strong",{children:e.pinId})," "]}),(0,a.jsx)("div",{children:"Value:"})]}):null,C(e)]}),(0,a.jsx)(u.Menu,{className:"samples-menu",children:I.map(((e,t)=>{const n=e.pinId,o=`${i.total-t}. from pin "${n}"`;return(0,a.jsx)(u.MenuItem,{text:o,onClick:()=>h(t)},t)}))})]}):i.lastSamples.length>0&&v.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",children:['No data found for search query "',v,'"']}):(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",o.insId," ",o.pin?`and ${o.pin.id}`:"",". Make sure a debugger is connected and your program was triggered."]})})()})]})})})}},40471:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29183),t)},98158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebuggerContext=t.DebuggerContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({onRequestHistory:()=>Promise.reject(new Error("Not implemented"))});t.DebuggerContextProvider=i.Provider;t.useDebuggerContext=()=>(0,o.useContext)(i)},86125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDependenciesContext=t.DependenciesContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({resolvedDependencies:{},onImportNode:()=>Promise.reject(new Error("Not implemented")),onRequestImportables:()=>Promise.reject(new Error("Not implemented"))});t.DependenciesContextProvider=i.Provider;t.useDependenciesContext=()=>(0,o.useContext)(i)},97106:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FlowEditor=void 0;const u=n(35250),l=s(n(70079)),c=n(74762),d=n(63521),p=a(n(53865)),f=n(68120),m=n(7047),h=n(84472),v=n(82232),g=n(49283),I=n(43490),y=n(68840),b=n(78087),C=n(20079),x=n(60190),_=n(40471),w=n(98158),N=n(86125),j=n(30653),P=n(77852);r(n(43490),t),r(n(98158),t),r(n(86125),t),y.library.add(b.fab,C.fas);const O=["select","drag-move","order-step"];t.FlowEditor=l.memo(l.forwardRef(((e,t)=>{const{state:n,onChangeEditorState:o}=e,{resolvedDependencies:i,onImportNode:s}=(0,N.useDependenciesContext)(),[r,a]=l.useState([]),[y,b]=l.useState([]),{flow:C,boardData:E}=n,S=n.flow.node,[D,T]=l.useState({}),[M,k]=l.useState(new Set),{debuggerClient:R}=(0,w.useDebuggerContext)();l.useEffect((()=>{if(R)return R.onBatchedEvents((e=>{e.forEach((e=>{e.type===c.DebuggerEventType.INPUTS_STATE_CHANGE&&(console.log("INPUTS_STATE_CHANGE",e.insId,e.val),T((t=>({...t,[e.insId]:e.val})))),e.type===c.DebuggerEventType.ERROR&&k((t=>{const n=new Set(t);return n.add(e.insId),n}))}))}))}),[R]);const{openFile:A,reportEvent:V}=(0,I.usePorts)(),$=l.useCallback(((e,t)=>{console.info("onChangeFlow",t.type),"functional"===t.type&&(a([{flow:{...n.flow,...e}},...r.slice(0,50)]),b([])),o((t=>({...t,flow:{...t.flow,...e}})))}),[o,n.flow,r]),[L,z]=l.useState({instances:[],connections:[]}),[H,F]=l.useState(!1),G=l.useCallback((()=>F(!1)),[]),q=l.useCallback((()=>F(!0)),[]),B=l.useCallback((e=>{o((t=>({...t,boardData:{...t.boardData,...e}})))}),[o]);l.useEffect((()=>{B({selected:[],viewPort:d.defaultViewPort,from:void 0,to:void 0,lastMousePos:{x:0,y:0}})}),[S.id]),(0,f.useHotkeys)("cmd+z",(e=>{b([...y,n]);const[t,...i]=r;t&&(o((e=>({...e,...t}))),a(i)),e.preventDefault()}),{text:"Undo last change",group:"Editing"},[n,r,y]);const U=l.useCallback(((e,t)=>{O.some((e=>t.message.includes(e)))||b([]),$({node:e},t)}),[$]),W=l.useCallback((e=>{A({absPath:e.source.path})}),[A]),Z=l.useCallback((function(e,t){void 0===t&&(t=-1*d.NODE_HEIGHT*1.5);const n=(0,m.createNewNodeInstance)(e,t,E.lastMousePos,i);if(n){const e=(0,p.default)(C,(e=>{const t=e.node;if(!(0,c.isVisualNode)(t))throw new Error("Impossible state, adding node to non visual node");t.instances.push(n)}));return $(e,(0,v.functionalChange)("add-node")),G(),n}}),[E.lastMousePos,C,$,G,i]),J=l.useCallback((async e=>{switch(e.type){case g.OmniBarCmdType.ADD:return V("addNode",{nodeId:e.data,source:"omnibar"}),Z(e.data);case g.OmniBarCmdType.ADD_VALUE:{const e=t.current;null==e||e.requestNewInlineValue();break}case g.OmniBarCmdType.IMPORT:{await s(e.data,{pos:E.lastMousePos});const t=(0,x.vAdd)({x:0,y:0},E.lastMousePos),n=(0,m.createNewNodeInstance)(e.data.node,0,t,i),o=(0,p.default)(C,(e=>{e.node.instances.push(n)}));$(o,(0,v.functionalChange)("add-imported-node")),V("addNode",{nodeId:e.data.node.id,source:"omnibar"});break}default:h.AppToaster.show({intent:"warning",message:"Not supported yet"})}G()}),[G,V,Z,t,s,E.lastMousePos,i,C,$]),[Y,K]=l.useState(),Q=l.useCallback((()=>K(void 0)),[]),X=l.useCallback(((e,t)=>{K({insId:e,pin:t})}),[]),{isDarkMode:ee}=(0,P.useDarkMode)();return(0,u.jsx)("div",{className:"flyde-flow-editor",children:(()=>{var n;if((0,c.isInlineValueNode)(S))throw new Error("Impossible state");return(0,u.jsx)(j.DarkModeProvider,{value:null!==(n=e.darkMode)&&void 0!==n?n:ee,children:(0,u.jsxs)(l.Fragment,{children:[Y?(0,u.jsx)(_.DataInspectionModal,{item:Y,onClose:Q}):null,(0,u.jsx)(d.VisualNodeEditor,{currentInsId:c.ROOT_INS_ID,ref:t,boardData:E,onChangeBoardData:B,node:S,onGoToNodeDef:W,onChangeNode:U,resolvedDependencies:i,clipboardData:L,onCopy:z,nodeIoEditable:!S.id.startsWith("Trigger"),onInspectPin:X,onShowOmnibar:q,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:D,initialPadding:e.initialPadding,instancesWithErrors:M,disableScrolling:e.disableScrolling},S.id),H?(0,u.jsx)(g.Omnibar,{flow:C,resolvedNodes:i,onCommand:J,visible:H,onClose:G}):null]})})})()})})))},9001:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeEditor=t.renderCreateIOOption=void 0;const i=n(35250),s=o(n(70079)),r=n(74762),a=n(50382),u=o(n(53865)),l=n(70457),c=n(25779);t.renderCreateIOOption=(e,t,n)=>(0,i.jsx)(a.MenuItem,{icon:"add",text:`Create "${e}"`,active:t,onClick:n,shouldDismissPopover:!1});const d=l.MultiSelect.ofType();t.BaseNodeEditor=e=>{var n,o;const{node:l,onChange:p}=e,f=(0,r.entries)(l.inputs),m=f.filter((e=>{let[,t]=e;return"required"===t.mode})).map((e=>{let[t]=e;return t})),h=f.filter((e=>{let[,t]=e;return"optional"===t.mode})).map((e=>{let[t]=e;return t})),v=f.filter((e=>{let[,t]=e;return"required-if-connected"===t.mode})).map((e=>{let[t]=e;return t})),[g,I]=s.default.useState(!1),y=(0,r.okeys)(l.outputs),b=s.default.useCallback((e=>{p({...l,id:e})}),[l,p]),C=s.default.useCallback((e=>{let t=e?e.split(","):void 0;"[]"===e&&(t=[]),p({...l,completionOutputs:t})}),[l,p]),x=s.default.useCallback((e=>{let t=e?e.split(","):void 0;p({...l,reactiveInputs:t})}),[l,p]),_=s.default.useCallback(((e,t)=>{const n=(0,u.default)(l,(n=>{n.inputs[e]=(0,r.nodeInput)(t)}));p(n)}),[l,p]),w=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.inputs[e]}));p(t)}),[l,p]),N=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{t.outputs[e]=(0,r.nodeOutput)()}));p(t)}),[l,p]),j=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.outputs[e]}));p(t)}),[l,p]);return(0,i.jsxs)("div",{className:"base-node-editor",children:[(0,i.jsx)("div",{className:"form-row",children:(0,i.jsx)(a.FormGroup,{label:"Node Name",labelFor:"text-input",labelInfo:"(required)",children:(0,i.jsx)(a.InputGroup,{id:"node-name",disabled:e.idDisabled,placeholder:"Node ID",value:l.id,onChange:e=>b(e.target.value)})})}),(0,i.jsx)(a.FormGroup,{label:"Required Inputs",children:(0,i.jsx)(d,{selectedItems:m,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>_(e,"required"),onRemove:w,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),!0!==e.hiddenOutputs?(0,i.jsx)(a.FormGroup,{label:"Outputs",children:(0,i.jsx)(d,{selectedItems:y,placeholder:"Enter output names here",items:[],tagRenderer:e=>e,onItemSelect:N,onRemove:j,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}):null,(0,i.jsx)(a.Checkbox,{checked:g,onChange:e=>I(e.target.checked),children:"Show advanced options"}),(0,i.jsxs)(a.Collapse,{isOpen:g,children:[(0,i.jsx)(a.FormGroup,{label:"Optional Inputs",children:(0,i.jsx)(d,{selectedItems:h,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>_(e,"optional"),onRemove:w,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Required-if-connected Inputs",children:(0,i.jsx)(d,{selectedItems:v,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>_(e,"required-if-connected"),onRemove:w,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Completion Outputs",children:(0,i.jsx)(a.InputGroup,{id:"completion-outputs",placeholder:"completion outputs",value:(null===(n=l.completionOutputs)||void 0===n?void 0:n.join(","))||"",onChange:e=>C(e.target.value)})}),(0,i.jsx)(a.FormGroup,{label:"Reactive Inputs",children:(0,i.jsx)(a.InputGroup,{id:"reactive-inputs",placeholder:"Reactive inputs",value:(null===(o=l.reactiveInputs)||void 0===o?void 0:o.join(","))||"",onChange:e=>x(e.target.value)})})]}),(0,i.jsx)(a.FormGroup,{label:"Preview",children:(0,i.jsx)("div",{className:"preview-wrapper",children:(0,i.jsx)(c.NodePreview,{node:l})})})]})}},82232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metaChange=t.functionalChange=void 0;t.functionalChange=e=>({type:"functional",message:e});t.metaChange=function(e){return void 0===e&&(e="n/a"),{type:"meta",message:e}}},41032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safelyGetNodeDef=t.loadingDef=void 0;const o=n(74762);t.loadingDef={id:"Loading",inputs:{},outputs:{}};t.safelyGetNodeDef=(e,n)=>{try{return(0,o.getNodeDef)(e,n)}catch(i){const n="string"==typeof e?e:e.nodeId;return{...t.loadingDef,id:n}}}},72125:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCodeModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(68371),f=n(74762),m=n(31745),h="`Result is ${inputs.a + inputs.b}`";t.InlineCodeModal=u.memo((function(e){const{initialValue:t,initialType:n}=e,[o,i]=u.useState((0,f.isDefined)(t)?t:h),[s,r]=u.useState(n||f.InlineValueNodeType.VALUE),v=(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:['You can add variables to by referrencing the "inputs" object.',(0,a.jsx)("br",{})," For example:",(0,a.jsx)(c.Code,{children:"`Hello {inputs.name}`"}),' will expose an input pin named "name"']}),(0,a.jsxs)("p",{children:["You can also use ternery expressions, arithmetic operators and more!",(0,a.jsx)("br",{}),"For example:",(0,a.jsx)(c.Code,{children:"inputs.a > inputs.b ? inputs.a + 42 : Math.random() * inputs.b"})]})]}),g=(0,a.jsxs)("span",{children:["Type in any valid JS value, such as ",(0,a.jsx)(c.Code,{children:"true"}),", ",(0,a.jsx)(c.Code,{children:"42"}),","," ",(0,a.jsx)(c.Code,{children:'["bob", "alice", "dave"]'}),".",(0,a.jsx)("br",{})," Dynamic inputs may also be used"]}),I=(0,a.jsxs)("span",{children:["Write any JS code and return a value.",(0,a.jsx)("br",{})," The returned value will be the output.",(0,a.jsx)("br",{})," Example:",(0,a.jsx)(c.Code,{children:"const a = inputs.a; const b = inputs.b; return Math.floor(a/b);"})]}),y=(0,p.getVariables)(o);return u.useEffect((()=>{o===h&&s===f.InlineValueNodeType.FUNCTION&&i(`return ${h}`),o===`return ${h}`&&s===f.InlineValueNodeType.VALUE&&i(h)}),[o,s]),(0,a.jsxs)(c.Dialog,{isOpen:!0,title:"Inline Value / Code",onClose:e.onCancel,className:"inline-code-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:t=>{"Enter"===t.key&&t.metaKey&&e.onSubmit(s,o)},tabIndex:0,children:[(0,a.jsxs)(c.RadioGroup,{inline:!0,onChange:e=>r(e.target.value),selectedValue:s,children:[(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Value ",(0,a.jsx)(m.InfoTooltip,{content:g})]}),value:f.InlineValueNodeType.VALUE}),(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Function ",(0,a.jsx)(m.InfoTooltip,{content:I})]}),value:f.InlineValueNodeType.FUNCTION})]}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"javascript",value:o,onChange:e=>i(e||""),onMount:e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})}}),(()=>{const e=o.includes("return");return e&&s===f.InlineValueNodeType.VALUE?(0,a.jsx)(c.Callout,{intent:c.Intent.WARNING,children:'When using the "value" type you are not expected to return anything'}):e||s!==f.InlineValueNodeType.FUNCTION?null:(0,a.jsxs)(c.Callout,{intent:c.Intent.DANGER,children:['When using the "function" type you are expected to'," ",(0,a.jsx)(c.Code,{children:"return"})," a value.",(0,a.jsx)("br",{}),"Example: ",(0,a.jsx)(c.Code,{children:"return 42 + Date.now();"})]})})(),(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Input pins detected:"," ",y.length?y.map((e=>(0,a.jsx)(c.Code,{children:e},e))):"None",(0,a.jsx)(m.InfoTooltip,{content:v})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:e.onCancel,children:"Cancel"}),(0,a.jsx)(c.Button,{onClick:()=>e.onSubmit(s,o),intent:c.Intent.PRIMARY,className:"save-btn",children:"Save"})]})})]})}))},18594:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(72125),t)},68371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInlineValueNode=t.getVariables=void 0;const o=n(74762),i=n(74762);t.getVariables=e=>(e.match(/inputs\.([a-zA-Z]\w*)/g)||[]).map((e=>e.replace(/inputs\./,"")));t.createInlineValueNode=e=>{let{code:n,customView:s,nodeId:r,type:a}=e;const u=(0,t.getVariables)(n).reduce(((e,t)=>({...e,[t]:(0,o.nodeInput)()})),{}),l={value:(0,o.nodeOutput)()},c=a===o.InlineValueNodeType.FUNCTION?`const result = (function() { ${n}}());\n Promise.resolve(result).then(val => outputs.value.next(val))`:`const result = (${n}); Promise.resolve(result).then(val => outputs.value.next(val))`,d=btoa(n);return(0,i.inlineValueNode)({id:r||`Inline Code ${(0,o.randomInt)(99999)}`,inputs:u,outputs:l,runFnRawCode:c,customViewCode:s||n,dataBuilderSource:d,templateType:a,completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline "+(a===o.InlineValueNodeType.VALUE?"value":"function")})}},49283:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Omnibar=t.OmniBarCmdType=void 0;const a=n(35250),u=s(n(70079)),l=n(70457),c=n(74762),d=n(50382),p=r(n(26372));var f;!function(e){e.ADD="add",e.ADD_VALUE="add-value",e.IMPORT="import"}(f=t.OmniBarCmdType||(t.OmniBarCmdType={}));const m=[];t.Omnibar=e=>{const{resolvedNodes:t}=e,[n,o]=u.useState(""),[i,s]=u.useState(null),[r,h]=u.useState([]);u.useEffect((()=>{const e=(0,c.keys)(t).map((e=>({title:`${t[e].id}`,cmd:{type:f.ADD,data:e},extra:"current flow"}))),n=r.map((e=>({title:`${e.node.id}`,description:e.node.description,cmd:{type:f.IMPORT,data:e},extra:`${e.module}`}))),o={title:"Add inline value or code",suggestOnEmpty:!0,cmd:{type:f.ADD_VALUE}},i=[...m,...n,o,...e];s(i)}),[t,r]),u.useEffect((()=>{e.onRequestImportables&&e.onRequestImportables(n).then((e=>{h(e)}))}),[e,n]);const v=u.useCallback(((e,t)=>{let{handleClick:n,modifiers:o,query:i,index:s}=t;if(!o.matchesPredicate)return null;const r=`${e.title}`;return(0,a.jsx)(d.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,a.jsxs)("div",{className:(0,p.default)("omnibar-item",{active:o.active}),children:[(0,a.jsxs)("div",{className:"title",children:[r," ",e.extra?(0,a.jsx)("span",{className:"extra",children:e.extra}):null]}),e.description?(0,a.jsx)("div",{className:"description",children:e.description}):null]})},s)}),[]),g=u.useCallback(((e,t)=>{const n=e.toLowerCase().split("").map((e=>{return`${t=e,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*`;var t})).join(""),o=new RegExp(n);return!!t.title.toLowerCase().match(o)}),[]),I=u.useCallback((t=>{e.onCommand(t.cmd),e.onClose()}),[e]);return i?(0,a.jsx)(l.Omnibar,{query:n,onQueryChange:o,onClose:e.onClose,noResults:(0,a.jsx)(d.MenuItem,{disabled:!0,text:"No results."}),itemPredicate:g,isOpen:e.visible,items:i,initialContent:void 0,onItemSelect:I,itemRenderer:v,inputProps:{placeholder:"Search for nodes or commands.."}}):null}},60698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43490:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31874),t)},31874:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.usePorts=t.useConfirm=t.usePrompt=t.PortsContext=t.defaultPorts=void 0;const s=n(70079),r=n(74762),a=n(84472);i(n(60698),t);const u=e=>async()=>{console.warn(`${e} Not implemented`),(0,a.toastMsg)("Feature not implemented in this context yet","warning")};t.defaultPorts={prompt:async e=>{let{text:t,defaultValue:n}=e;return prompt(`${t}`,n)},openFile:async e=>{},confirm:async e=>{let{text:t}=e;return confirm(t)},readFlow:u("readFlow"),setFlow:u("setFlow"),resolveDeps:u("resolveDeps"),getImportables:u("getImportables"),onExternalFlowChange:u("onExternalFlowChange"),onInstallRuntimeRequest:u("onInstallRuntimeRequest"),onRunFlow:u("onRunFlow"),onStopFlow:u("onStopFlow"),reportEvent:r.noop,generateNodeFromPrompt:u("generateNodeFromPrompt"),hasOpenAiToken:()=>Promise.resolve(!1)},t.PortsContext=(0,s.createContext)(t.defaultPorts);t.usePrompt=()=>{const e=(0,s.useContext)(t.PortsContext).prompt;return(t,n)=>e({text:t,defaultValue:n})};t.useConfirm=()=>{const e=(0,s.useContext)(t.PortsContext).confirm;return t=>e({text:t})};t.usePorts=()=>(0,s.useContext)(t.PortsContext)},65758:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelected=void 0;const i=n(74762),s=o(n(53865)),r=n(22513);t.groupSelected=async(e,t,n,o,a)=>{const{instances:u,connections:l}=t,c=u.filter((t=>e.includes(t.id))),d=l.filter((t=>{let{from:n,to:o}=t;return-1!==e.indexOf(n.insId)||-1!==e.indexOf(o.insId)}));if(!c.length)throw new Error("visual without selections");const{visualNode:p,renamedInputs:f,renamedOutputs:m}=await(0,r.createGroup)(c,d,n,a),h=c.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),u[0].pos),v="ref"===o?(0,i.nodeInstance)((0,i.createInsId)(p),p.id,{},h):(0,i.inlineNodeInstance)((0,i.createInsId)(p),p,{},h),g=u.filter((t=>-1===e.indexOf(t.id))),I=l.map((e=>{const t=`${e.from.insId}.${e.from.pinId}`,n=`${e.to.insId}.${e.to.pinId}`;return f[n]?{...e,to:{insId:v.id,pinId:f[n]}}:m[t]?{...e,from:{insId:v.id,pinId:m[t]}}:e})).filter((t=>-1===e.indexOf(t.from.insId)&&-1===e.indexOf(t.to.insId)));return{newNode:p,currentNode:(0,s.default)(t,(e=>{e.instances=[...g,v],e.connections=I}))}}},74089:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(97106),t),i(n(18420),t),i(n(90680),t),i(n(84472),t),i(n(17102),t),i(n(82232),t),i(n(25779),t),i(n(25804),t),i(n(9958),t),i(n(68120),t),i(n(94651),t),i(n(73470),t),i(n(94007),t),i(n(60190),t),i(n(9001),t),i(n(7047),t),i(n(23386),t)},31745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoTooltip=void 0;const o=n(35250),i=n(50382),s=n(50382),r=n(44470),a=n(50382);t.InfoTooltip=e=>{const{content:t}=e;return(0,o.jsx)(s.Tooltip,{content:t,placement:"top",className:"info-tooltip",children:(0,o.jsx)(i.Icon,{icon:(0,o.jsx)(r.InfoSign,{className:a.Classes.INTENT_PRIMARY}),intent:i.Intent.SUCCESS,className:"info-tooltip-icon"})})}},83938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserOnlyReactJson=void 0;const o=n(35250);t.BrowserOnlyReactJson=e=>{if("undefined"==typeof window)return null;const t=n(73541).Z;return(0,o.jsx)(t,{...e})}},94651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsValueRenderer=void 0;const o=n(35250),i=n(74762),s=n(83938);t.AnalyticsValueRenderer=e=>{let{val:t}=e;try{const e=JSON.parse(t),n="object"==typeof e?e:{value:e},r=e&&[e.type,e.key,e.props,e.ref].every(i.isDefined),a=r?{jsxValue:e}:n;return(0,o.jsx)(s.BrowserOnlyReactJson,{src:a,collapseStringsAfterLength:50,collapsed:r})}catch(n){return(0,o.jsx)(s.BrowserOnlyReactJson,{src:{value:t},collapseStringsAfterLength:50})}}},22513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=void 0;const o=n(74762),i=n(74762),s=n(60190),r=n(88593);t.createGroup=async(e,t,n,a)=>{if(0===e.length)throw new Error("cannot create group without instances");const u=e.map((e=>e.id)),l=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return!t&&n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.to,e.to)))===t)),c=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return t&&!n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.from,e.from)))===t));let d={},p={},f={},m={};const h=[],v={};for(const o of l){const e=`${o.to.insId}.${o.to.pinId}`,t=`${o.from.insId}.${o.from.pinId}`,n=o.to.pinId;if(f[t]){h.push({from:(0,i.externalConnectionNode)(f[t]),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)});continue}const r=v[n]?await a(`Name this input (${n} of ${o.to.insId}) is already taken:`)||`i${(0,s.rnd)()}`:n;d[e]=r,f[t]=r,h.push({from:(0,i.externalConnectionNode)(r),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)}),v[r]=(0,i.nodeInput)()}const g={};for(const r of c){const e=`${r.to.insId}.${r.to.pinId}`,t=`${r.from.insId}.${r.from.pinId}`,n=r.from.pinId;if(m[e]){h.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(m[e])});continue}const u=g[n]?await a(`Name this output (${n} of ${r.from.insId} is already taken:`)||`i${(0,s.rnd)()}`:n;p[t]=u,m[e]=u,h.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(u)}),g[u]=(0,o.nodeOutput)()}e.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),e[0].pos);const I=t.filter((e=>u.includes(e.from.insId)&&u.includes(e.to.insId)));return{visualNode:{id:n,inputs:v,outputs:g,instances:e,defaultStyle:{size:"large",color:(0,o.pickRandom)(r.nodeStylePresetColors.map((e=>e.color)))},inputsPosition:(0,o.okeys)(v).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:0}})),{}),outputsPosition:(0,o.okeys)(g).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:400}})),{}),connections:[...I,...h],completionOutputs:(0,o.okeys)(g)},renamedInputs:d,renamedOutputs:p}}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightText=void 0;const o=n(35250);function i(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}t.highlightText=(e,t)=>{let n=0;const s=t.split(/\s+/).filter((e=>e.length>0)).map(i);if(0===s.length)return[e];const r=new RegExp(s.join("|"),"gi"),a=[];for(;;){const t=r.exec(e);if(!t)break;const i=t[0].length,s=e.slice(n,r.lastIndex-i);s.length>0&&a.push(s),n=r.lastIndex,a.push((0,o.jsx)("strong",{children:t[0]},n))}const u=e.slice(n);return u.length>0&&a.push(u),a}},17102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Loader=void 0;const o=n(35250);t.Loader=()=>(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)("svg",{width:"38",height:"38",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:"#007ec6",children:(0,o.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,o.jsxs)("g",{transform:"translate(1 1)",strokeWidth:"2",children:[(0,o.jsx)("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),(0,o.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:(0,o.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})})})},23386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;const o=n(74762);t.logger=(0,o.debugLogger)("editor")},561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadMonaco=void 0;const o=n(51848),i=n(23386);let s=!1;t.preloadMonaco=()=>{s||o.loader.init().then((()=>{(0,i.logger)("monaco preloaded"),s=!0}))}},68120:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHotkeys=t.currentHotkeys=void 0;const i=o(n(45240)),s=n(70079);t.currentHotkeys=new Map,t.useHotkeys=function(e,n,o,r,a){void 0===r&&(r=[]);const u=(0,s.useCallback)((function(){a&&!a.current||n(...arguments)}),[...r,n]);(0,s.useEffect)((()=>((0,i.default)(e,{},u),t.currentHotkeys.set(e,o),()=>{t.currentHotkeys.delete(e),i.default.unbind(e,u)})),[e,u,o])}},94007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeSessionStorage=t.safeLocalStorage=void 0,t.safeLocalStorage={getItem:function(){try{return localStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return localStorage.setItem(...arguments)}catch(e){return null}}},t.safeSessionStorage={getItem:function(){try{return sessionStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return sessionStorage.setItem(...arguments)}catch(e){return null}}}},90680:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocalStorage=t.useResizePref=t.userPreferences=t.useUserPref=void 0;const r=s(n(70079)),a=n(18420),u=n(94007);t.useUserPref=(e,n)=>{const[o,i]=r.useState((()=>{const o=t.userPreferences.getItem(e);return(0,a.isDefined)(o)?o:n}));r.useEffect((()=>{const o=t.userPreferences.getItem(e),s=(0,a.isDefined)(o)?o:n;i(s)}),[e]);return[o,n=>{t.userPreferences.setItem(e,n),i(n)}]},t.userPreferences=(()=>{const e=e=>`up.${e}`;return{getItem:t=>{const n=u.safeLocalStorage.getItem(e(t))||"",o=u.safeSessionStorage.getItem(e(t))||"";try{return JSON.parse(o||n).value}catch(i){return}},setItem:function(t,n,o){void 0===o&&(o=!1);const i=o?sessionStorage:u.safeLocalStorage;try{const o=JSON.stringify({value:n});return i.setItem(e(t),o),!0}catch(s){return console.error("Error saving user preference",s),!1}}}})();t.useResizePref=(e,n)=>{const o=`resize.${e}`;return(0,t.useUserPref)(o,n)};const l=e=>{const t=u.safeLocalStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch(n){return null}};t.useLocalStorage=(e,t)=>{const[n,o]=r.useState(l(e)||t),i=r.useCallback((t=>{u.safeLocalStorage.setItem(e,JSON.stringify({value:t})),o(t)}),[e]);return r.useEffect((()=>{l(e)||u.safeLocalStorage.setItem(e,JSON.stringify({value:t}))}),[e,t,i]),[n,i]}},60190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.totalEnergy=t.itrPhysics=t.hookes=t.coulombs=t.vToStr=t.vNorm=t.vLen=t.vSub=t.vAdd=t.vDiv=t.vMul=t.vZero=t.rnd=t.vec=t.size=void 0;t.size=(e,t)=>({width:e,height:t});t.vec=(e,t)=>({x:e,y:t});t.rnd=function(e,t){return void 0===e&&(e=100),void 0===t&&(t=0),Math.floor(Math.random()*(e-t))+t},t.vZero={x:0,y:0};t.vMul=(e,t)=>{let{x:n,y:o}=e;return{x:n*t,y:o*t}};t.vDiv=(e,n)=>{let{x:o,y:i}=e;return(0,t.vMul)({x:o,y:i},1/n)};t.vAdd=(e,t)=>({x:e.x+t.x,y:e.y+t.y});t.vSub=(e,n)=>(0,t.vAdd)(e,(0,t.vMul)(n,-1));t.vLen=e=>{let{x:t,y:n}=e;return Math.sqrt(t*t+n*n)};t.vNorm=e=>(0,t.vDiv)(e,(0,t.vLen)(e)||1);t.vToStr=e=>{let{x:t,y:n}=e;return`${t.toFixed(1)},${n.toFixed(1)}`};t.coulombs=(e,n,o)=>{const i=(0,t.vLen)((0,t.vSub)(e.p,n.p));if(0===i){const i=(0,t.vec)(2*Math.random()-1,2*Math.random()-1),s=e.m*n.m/Math.pow(10,2);return(0,t.vMul)(i,s*o)}{const s=(0,t.vNorm)((0,t.vSub)(n.p,e.p)),r=e.m*n.m/Math.pow(i+.1,2);return(0,t.vMul)(s,r*o)}};t.hookes=(e,n,o,i,s)=>{const r=(0,t.vLen)((0,t.vSub)(e.p,n.p)),a=(0,t.vNorm)((0,t.vSub)(e.p,n.p));let u=0;return ri&&(u=i-r),(0,t.vMul)(a,s*u)};t.itrPhysics=(e,n)=>{const{p:o,v:i,f:s,m:r}=n,a=(0,t.vDiv)(s,r),u=e/1e3,l=(0,t.vAdd)((0,t.vMul)(a,u),i),c=(0,t.vAdd)((0,t.vMul)(l,u),o);return{...n,p:c,v:l,f:(0,t.vec)(0,0)}};t.totalEnergy=e=>e.reduce(((e,n)=>{const o=(0,t.vLen)(n.v);return e+.5*n.m*o*o}),0)},84472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateToast=t.toastMsg=t.AppToaster=void 0;const o=n(50382);t.AppToaster=(()=>{try{return o.OverlayToaster.create({className:"app-toaster",position:o.Position.BOTTOM_RIGHT})}catch(e){return{}}})();t.toastMsg=(e,n,o)=>t.AppToaster.show({message:e,intent:n,timeout:o});t.updateToast=(e,n,o)=>t.AppToaster.show({message:n,intent:o},e)},18420:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultAnd=t.isLocal=t.fullTime=t.timeAgoFromDt=t.timeAgo=t.toString=t.isDefined=t.set=t.createOmap=t.toOmap=t.values=t.keys=t.entries=void 0;const i=n(7047),s=n(74762),r=o(n(73136));t.entries=e=>Object.keys(e).map((t=>[t,e[t]]));t.keys=e=>Object.keys(e);t.values=e=>Object.keys(e).map((t=>e[t]));t.toOmap=e=>Array.from(e.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.createOmap=function(e){return void 0===e&&(e=[]),e.reduce(((e,t)=>({...e,[t[0]]:t[1]})),{})};t.set=(e,t,n)=>{e[t]=n};t.isDefined=e=>void 0!==e;t.toString=e=>{const t=typeof e;if(""===e)return"(empty string)";if((0,i.isJsxValue)(e))return"JSX Value";if((0,s.isStaticValueVisualNode)(e))return"Embedded Node";if((0,s.isEnvValue)(e))return(0,s.getEnvKeyFromValue)(e);if("object"===t)try{const t=JSON.stringify(e);return"{}"===t?"Empty object":t}catch(n){return"Object (cannot stringify)"}return`${e}`};t.timeAgo=e=>(0,r.default)(new Date(e)).fromNow();t.timeAgoFromDt=e=>(0,r.default)(Date.now()-e).fromNow();t.fullTime=e=>(0,r.default)(new Date(e)).toString();t.isLocal=()=>location.href.includes(":300");t.preventDefaultAnd=e=>t=>{t.preventDefault(),e(t)}},67181:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ActionButton=t.ActionsMenu=t.ActionType=void 0;const r=n(35250),a=n(50382),u=n(50382),l=n(74762),c=s(n(70079)),d=n(86125),p=n(43490),f=n(68120),m=n(90680),h=n(84472),v=n(9971),g=n(47749),I=n(46334),y=n(47230),b=n(41032);var C;!function(e){e.AddNode="add-node",e.RemoveNode="remove-node",e.Group="group",e.UnGroup="un-group",e.AddInlineValue="add-inline-value",e.Inspect="inspect",e.Run="run",e.AI="ai"}(C=t.ActionType||(t.ActionType={}));t.ActionsMenu=e=>{const{onAction:n,selectedInstances:o,resolvedNodes:i,node:s,from:u,to:g,hotkeysEnabled:_,showRunFlowOptions:w}=e,{onRequestImportables:N}=(0,d.useDependenciesContext)(),[j,P]=c.default.useState(!1),[O,E]=c.default.useState(!1),[S,D]=c.default.useState(!1),[T,M]=c.default.useState(null),[k,R]=(0,m.useLocalStorage)("hideHotkeyHintMap",{}),A=(0,c.useCallback)((()=>{P(!1)}),[]),{onRunFlow:V,generateNodeFromPrompt:$,reportEvent:L}=(0,p.usePorts)(),z=(0,c.useCallback)(((e,t)=>(E(!1),V(e,t))),[V]),H=[];if(H.push(C.AddNode),H.push(C.AddInlineValue),1===o.length){const e=s.instances.find((e=>e.id===o[0]));if(e)try{const t=(0,b.safelyGetNodeDef)(e,i);(0,l.isVisualNode)(t)&&H.push(C.UnGroup)}catch(U){console.error(`Could not find node with id ${o[0]} - ${U}`)}else console.error(`Could not find instance with id ${o[0]}`)}w&&H.push(C.Run),o.length>0&&H.push(C.Group),(1===o.length||u||g)&&H.push(C.Inspect),o.length>0&&H.push(C.RemoveNode),H.push(C.AI);const F=(0,c.useCallback)(((e,t)=>{R({...k,[e]:!0}),h.AppToaster.dismiss(t)}),[k,R]),G=(0,c.useCallback)(((e,t)=>{const{hotkey:o}=x[e];if("click"===t.type&&o&&!k[o]){const t=(0,h.toastMsg)((0,r.jsxs)(r.Fragment,{children:["Did you know? you can also use the hotkey"," ",(0,r.jsx)("kbd",{className:"hotkey",children:o})," to"," ",x[e].text.replace(/^[A-Z]/,(e=>e.toLowerCase())),(0,r.jsxs)(a.Button,{minimal:!0,small:!0,onClick:()=>F(o,t),children:[" ","Don't show again"," "]})]}),"none",3e3)}switch(e){case C.AddNode:P(!0);break;case C.Run:!async function(){E(!0)}();break;case C.AI:D(!0);break;default:n({type:e,data:void 0})}}),[k,n,F,s.inputs]);Object.entries(x).forEach((e=>{let[t,n]=e;n.hotkey&&(0,f.useHotkeys)(n.hotkey,(e=>{e.preventDefault(),H.includes(t)&&(G(t,e),R({...k,[n.hotkey]:!0}))}),{text:n.text,group:"Action menu hotkeys"},[H],_)}));const q=(0,c.useCallback)((e=>{n({type:C.AddNode,data:{importableNode:e}})}),[n]),B=(0,c.useCallback)((async e=>{const t=Date.now();M(t);try{L("generateNodeFromPrompt:start",{promptLength:e.length});const o=await $({prompt:e}),{inputs:i,outputs:s}=o.importableNode.node,r=Date.now()-t;L("generateNodeFromPrompt:success",{totalTime:r,inputs:Object.keys(i),outputs:Object.keys(s)}),M(null),n({type:C.AI,data:o}),D(!1)}catch(U){M(null),h.AppToaster.show({message:"Failed to generate node",intent:"danger"}),L("generateNodeFromPrompt:failure",{error:U.message})}}),[$,n,L]);return(0,r.jsxs)("div",{className:"actions-menu",children:[H.map((e=>(0,r.jsx)(t.ActionButton,{type:e,onClick:G},e))),j?(0,r.jsx)(v.AddNodeMenu,{onRequestImportables:N,onAddNode:q,onClose:A}):null,O?(0,r.jsx)(y.RunFlowModal,{onClose:()=>E(!1),onRun:z,node:s}):null,S?(0,r.jsx)(I.PromptAIMenu,{onClose:()=>{D(!1),M(null)},onSubmit:B,submitting:null!==T,submitTime:T}):null]})};const x={[C.AddNode]:{icon:g.addNodeIcon,text:'Open the "add node" menu',hotkey:"a"},[C.RemoveNode]:{icon:g.removeNodeIcon,text:"Remove selected instances",hotkey:"backspace"},[C.Group]:{icon:g.groupIcon,text:"Group selection into a new node",hotkey:"g"},[C.UnGroup]:{icon:g.ungroupIcon,text:"Ungroup selected visual node"},[C.Inspect]:{icon:g.inspectIcon,text:"Inspect data",hotkey:"i"},[C.AddInlineValue]:{icon:g.pencilIcon,text:"Add value / inline function",hotkey:"v"},[C.Run]:{icon:g.playIcon,text:"Run flow",hotkey:"r"},[C.AI]:{icon:g.starIcon,text:"Generate new code node using AI \u2728"}},_={icon:"",text:"N/A",hotkey:void 0};t.ActionButton=e=>{var t;const{onClick:n,type:o}=e,i=(0,c.useCallback)((e=>n(o,e)),[n,o]),s=null!==(t=x[o])&&void 0!==t?t:_,a=s.hotkey?(0,r.jsxs)("span",{children:[s.text," ",(0,r.jsx)("kbd",{className:"hotkey",children:s.hotkey})]}):s.text;return(0,r.jsx)("div",{className:"action-button",onClick:i,"data-type":o,children:(0,r.jsx)(u.Tooltip,{hoverOpenDelay:100,content:a,className:"icon-wrapper",popoverClassName:"action-button-tooltip",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s.icon}})})})}},40149:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenu=t.AddNodeMenuFilterTree=void 0;const a=n(35250),u=n(50382),l=n(74762),c=r(n(26372)),d=s(n(70079)),p=n(43490),f=n(31745),m=n(17102),h=n(87935),v=n(74657),g=n(44470);t.AddNodeMenuFilterTree=u.Tree.ofType();function I(e,t,n){return[...e.external.map((e=>({id:e.module,label:e.module,hasCaret:!0,nodeData:{type:"external",module:e.module},isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module,isExpanded:n.has(e.module),childNodes:e.namespaces.map((o=>({id:`${e.module}/${o}`,label:o,hasCaret:!1,isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module&&t.namespace===o,isExpanded:n.has(`${e.module}/${o}`),nodeData:{type:"external",module:e.module,namespace:o}})))}))),{id:"internal",label:"Current Project",nodeData:{type:"internal"},isExpanded:n.has("internal"),hasCaret:!0,isSelected:"internal"===t.type,childNodes:e.internal.files.map((e=>({id:e,label:e,isSelected:"internal"===t.type&&t.file===e,hasCaret:!1,isExpanded:n.has(e),nodeData:{type:"internal",file:e}})))}]}function y(e){return/\.flyde(\.[jt]s)?$/.test(e.module)}t.AddNodeMenu=e=>{const{onRequestImportables:n,onAddNode:o,onClose:i}=e,[s,r]=d.default.useState(),[b,C]=d.default.useState([]),[x,_]=d.default.useState(new Set),[w,N]=d.default.useState(""),[j,P]=d.default.useState({type:"all"}),[O,E]=d.default.useState(null),[S,D]=d.default.useState(null),[T,M]=d.default.useState(null),k=(0,d.useCallback)((e=>{x.add(e.id),_(new Set(x))}),[x]),R=(0,d.useCallback)((e=>{x.delete(e.id),_(new Set(x))}),[x]),A=(0,d.useCallback)((e=>{o(e),i()}),[o,i]),{onInstallRuntimeRequest:V,reportEvent:$}=(0,p.usePorts)();(0,d.useEffect)((()=>{$("addNodeMenuOpen",{})}),[$]),(0,d.useEffect)((()=>{D(null==s?void 0:s.flatMap((e=>{var t,n,o;if(j)if("external"===j.type){if((e.module!==j.module||j.namespace)&&e.node.namespace!==j.namespace)return[]}else if("internal"===j.type&&(!y(e)||j.file&&e.module!==j.file))return[];if(w){const i=`${null!==(n=null===(t=e.node.searchKeywords)||void 0===t?void 0:t.join(" "))&&void 0!==n?n:[]} ${e.node.id} ${null!==(o=e.node.namespace)&&void 0!==o?o:""} ${e.node.description}`.toLowerCase().indexOf(w.toLowerCase());return-1===i?[]:[{importable:e,score:i}]}return[{importable:e,score:1}]})).sort(((e,t)=>e.score-t.score)).map((e=>{let{importable:t}=e;return t})))}),[s,j,w]),(0,d.useEffect)((()=>{n().then((e=>{let{importables:t,errors:n}=e;C(n);const o=t.filter((e=>!y(e))).reduce(((e,t)=>{var n,o,i;null!==(n=e[i=t.module])&&void 0!==n||(e[i]=[]);const s=null!==(o=t.node.namespace)&&void 0!==o?o:"";return e[t.module].includes(s)||e[t.module].push(s),e}),{}),i=t.filter(y).map((e=>e.module));E({external:Object.entries(o).map((e=>{let[t,n]=e;return{module:t,namespaces:n}})),internal:{files:i}}),r(t),_(new Set(["internal",...Object.keys(o)]))}))}),[n]);const L=(0,d.useCallback)((e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),S&&!T)return void M(S["ArrowDown"===e.key?0:S.length-1]);if(S&&T){const t=S.findIndex((e=>e===T));let n="ArrowDown"===e.key?t+1:t-1;n=n<0?S.length-1:n,n=n>=S.length?0:n,M(S[n])}break;case"Enter":T&&A(T)}}),[S,T,A]),z=(0,d.useCallback)((e=>{let{nodeData:t}=e;JSON.stringify(t)===JSON.stringify(j)?"external"===t.type?t.namespace?P({type:"external",module:t.module}):P({type:"all"}):"internal"===t.type&&(t.file?P({type:"internal"}):P({type:"all"})):P(t)}),[j]),H=!s||s.some((e=>e.module.includes("@flyde/stdlib"))),F=(0,d.useCallback)((()=>{V(),i()}),[i,V]);return(0,a.jsx)(u.Dialog,{isOpen:!0,title:"Add Node Menu",onClose:e.onClose,className:"add-node-menu",isCloseButtonShown:!0,children:(0,a.jsxs)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),children:[(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"bp5-input-group",children:[(0,a.jsx)(g.Search,{}),(0,a.jsx)("input",{className:"bp5-input",type:"search",placeholder:"Search input",dir:"auto",autoFocus:!0,onChange:e=>N(e.target.value),value:w,onKeyDown:L})]}),H?null:(0,a.jsxs)(u.Callout,{intent:u.Intent.NONE,style:{marginTop:10},children:["Using built-in @flyde/stdlib. It's recommended to explicitly install it instead."," ",(0,a.jsx)(u.Button,{minimal:!0,small:!0,intent:u.Intent.PRIMARY,onClick:F,children:"Click here to install it using npm/yarn"})]})]}),(0,a.jsx)("div",{className:"content-wrapper",children:s?(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsxs)("aside",{children:[(0,a.jsxs)("div",{className:"filter-header",children:["Filter by package"," ",(0,a.jsx)(u.Tooltip,{content:(0,a.jsxs)("span",{children:["Click to learn more about how packages work in Flyde"," "]}),hoverCloseDelay:1500,children:(0,a.jsx)("a",{target:"_blank",href:"https://www.flyde.dev/docs/packages",rel:"noreferrer",children:(0,a.jsx)(u.Icon,{icon:(0,a.jsx)(g.Help,{}),intent:"primary",iconSize:12})})})]}),(0,a.jsx)("div",{className:"tree-container",children:(0,a.jsx)(t.AddNodeMenuFilterTree,{contents:I(O,j,x),onNodeCollapse:R,onNodeExpand:k,onNodeClick:z,className:u.Classes.ELEVATION_0})})]}),(0,a.jsx)("main",{children:S?0===S.length?(0,a.jsxs)("div",{className:"no-results",children:[(0,a.jsx)(v.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:P,query:w,onChangeQuery:N,resultsCount:S.length}),(0,a.jsxs)(u.Callout,{className:"callout",intent:"primary",children:["Can't find a suitable node? Create one yourself!"," ",(0,a.jsx)("a",{href:"https://www.flyde.dev/docs/code-nodes",target:"_blank",rel:"noreferrer",children:"Learn more"})]})]}):(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsx)(v.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:P,query:w,onChangeQuery:N,resultsCount:S.length}),(0,a.jsx)("div",{className:"results",children:S.map((e=>(0,a.jsx)(h.AddNodeMenuListItem,{importableNode:e,onAdd:A,selected:(null==T?void 0:T.node)===e.node,onSelect:M,onSetFilter:P},e.node.id+e.node.namespace+e.module)))})]}):(0,a.jsx)(m.Loader,{})})]}):(0,a.jsx)(m.Loader,{})}),b.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",style:{marginTop:"10px"},children:["Found ",(0,l.simplePluralize)(b.length,"corrupt flow"),(0,a.jsx)(f.InfoTooltip,{content:b.map((e=>{let{path:t,message:n}=e;return`${t}: ${n}`})).join(", ")})," "]}):null]})})}},8470:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuListItem=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079));t.AddNodeMenuListItem=e=>{const{importableNode:t,onSetFilter:n,onAdd:o,onSelect:i}=e,{node:s,module:r}=t,{id:d,description:p}=s,f=c.default.useRef(null);c.default.useEffect((()=>{e.selected&&f.current&&f.current.scrollIntoView({block:"center"})}),[e.selected]);const m=(0,c.useCallback)((()=>{o(t)}),[o,t]),h=(0,c.useCallback)((()=>{i(t)}),[i,t]);return(0,a.jsxs)("div",{className:(0,l.default)("add-node-menu-list-item",{selected:e.selected}),ref:f,onClick:h,children:[(0,a.jsxs)("div",{className:"content",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("span",{className:"id",children:d}),(0,a.jsxs)(u.Tag,{interactive:!0,onClick:()=>n({type:"external",module:r,namespace:s.namespace}),className:"source",minimal:!0,children:[r,s.namespace?` / ${s.namespace}`:null]})]}),(0,a.jsx)("div",{className:"description",children:p||(0,a.jsx)("em",{children:"No description"})})]}),(0,a.jsx)("aside",{children:(0,a.jsx)(u.Button,{onClick:m,children:"Add"})})]})}},87935:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8470),t)},88671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuResultsSummary=void 0;const o=n(35250),i=n(50382);t.AddNodeMenuResultsSummary=e=>{const{resultsCount:t,query:n,filter:s,onChangeFilter:r,onChangeQuery:a}=e;return(0,o.jsxs)("div",{className:"add-node-menu-results-summary",children:[t?`Showing ${t} result${t>1?"s":""}`:"No results found","\xa0",n?(0,o.jsxs)(o.Fragment,{children:["matching query\xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>a(""),children:['"',n,'"']})]}):null,"all"===s.type?null:"external"===s.type?(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["package ",s.module,s.namespace?` / ${s.namespace}`:null]})]}):(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["\xa0this project ",s.file?` / ${s.file}`:null]})]})]})}},74657:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88671),t)},9971:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40149),t)},83159:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PromptAIMenu=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=1e4;t.PromptAIMenu=e=>{const{onClose:t}=e,[n,o]=c.default.useState(""),[i,s]=c.default.useState(0);return(0,c.useEffect)((()=>{s(0);const t=setInterval((()=>{s((t=>{const n=(Date.now()-e.submitTime)/d;return Math.min(n+.05*Math.random()/2,.95)}))}),500);return()=>clearInterval(t)}),[e.submitTime]),(0,a.jsxs)(u.Dialog,{isOpen:!0,onClose:t,className:"prompt-ai-menu",title:"\u2728 Generate Code Node using AI",children:[(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsx)(u.TextArea,{value:n,disabled:e.submitting,onChange:e=>o(e.target.value),placeholder:"Describe your node in details",fill:!0})}),e.submitTime?(0,a.jsx)("div",{className:"progress-bar-container",children:(0,a.jsx)(u.ProgressBar,{value:i})}):null,(0,a.jsx)("div",{className:u.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:u.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(u.Button,{onClick:t,children:"Close"}),(0,a.jsx)(u.Button,{intent:u.Intent.PRIMARY,className:"run-btn",disabled:e.submitting||!n,loading:e.submitting,onClick:()=>{s(0),e.onSubmit(n)},children:"Create \u2728"})]})})]})}},46334:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(83159),t)},3152:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RunFlowModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(90680),f=n(31745);t.RunFlowModal=u.memo((function(e){const{onRun:t,onClose:n,node:o}=e,[i,s]=u.useState(0),[r,m]=(0,p.useLocalStorage)(`run-inputs-${o.id}`,Object.keys(o.inputs).reduce(((e,t)=>(e[t]=`Enter a value for input ${t}`,e)),{})),[h,v]=u.useState(JSON.stringify(r,null,2)),g=e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})},I=u.useCallback((()=>{const e=JSON.parse(h);m(e),t(e,i)}),[t,m,h,i]),y=Object.keys(o.inputs),b=y.filter((e=>"required"!==o.inputs[e].mode)),C=u.useMemo((()=>y.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:"This node receives external inputs. Enter values for each input below:"}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"json",value:h,onChange:e=>v(null!=e?e:""),onMount:g}),b.length>0?(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Note: input(s) ",(0,a.jsx)("code",{children:b.join(", ")})," are optional"]}):null]}):(0,a.jsx)("strong",{children:"This node does not receive any external inputs."})),[y.length,b,h]);return(0,a.jsxs)(c.Dialog,{isOpen:!0,onClose:e.onClose,className:"run-flow-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&I()},tabIndex:0,children:[C,(0,a.jsxs)("div",{className:"execution-delay-wrapper",children:[(0,a.jsxs)("label",{children:["Execution delay:"," ",(0,a.jsx)(f.InfoTooltip,{content:"Delay between each node execution. Useful for debugging."})]}),(0,a.jsx)(c.Slider,{value:i,onChange:s,min:0,labelStepSize:500,stepSize:100,labelRenderer:e=>`${e}ms`,max:1e3})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:n,children:"Close"}),(0,a.jsx)(c.Button,{onClick:I,intent:c.Intent.PRIMARY,className:"run-btn",children:"Run"})]})})]})}))},47230:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3152),t)},47749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starIcon=t.stopIcon=t.playIcon=t.pencilIcon=t.ungroupIcon=t.groupIcon=t.inspectIcon=t.removeNodeIcon=t.addNodeIcon=void 0,t.addNodeIcon='\n\n',t.removeNodeIcon='\n\n',t.inspectIcon='\n\n\n',t.groupIcon='\n\n\n',t.ungroupIcon='\n\n\n',t.pencilIcon='\n\n',t.playIcon='\n\n\n',t.stopIcon='\n\n\n',t.starIcon='\n\n\n\n\n'},1237:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HelpBubble=void 0;const i=n(70079),s=n(35250),r=n(50382),a=n(99489),u=n(50382),l=o(n(70079)),c=n(68120),d=n(71644),p=n(43490),f={offset:{enabled:!0,options:{offset:[0,20]}},preventOverflow:{enabled:!0,options:{padding:10}}};const m=["Viewport Controls","Editing","Selection"];t.HelpBubble=()=>{const[e,t]=l.default.useState(!1),n=Array.from(c.currentHotkeys.entries()).map((e=>{let[t,n]=e;return{combo:(o={key:t,menuData:n}).key,label:o.menuData.text,group:o.menuData.group};var o})).reduce(((e,t)=>(e[t.group]||(e[t.group]=[]),e[t.group].push(t),e)),{}),o=Object.entries(n).sort(((e,t)=>m.indexOf(t[0])-m.indexOf(e[0]))),{reportEvent:h}=(0,p.usePorts)(),v=(0,s.jsx)(r.Dialog,{isOpen:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:r.Classes.DIALOG_BODY,children:o.map((e=>{let[t,n]=e;return(0,s.jsxs)(l.default.Fragment,{children:[(0,s.jsx)(r.H4,{children:t}),n.map((e=>(0,i.createElement)(a.Hotkey,{...e,key:e.combo})))]},t)}))})}),g=(0,s.jsxs)(r.Menu,{children:[(0,s.jsx)(r.MenuItem,{text:"Hotkeys",onClick:()=>{t(!0),h("helpMenuItem",{item:"hotkeys"})}}),(0,s.jsx)(r.MenuItem,{text:"Documentation",onClick:()=>h("helpMenuItem",{item:"documentation"}),href:"https://www.flyde.dev/docs",target:"_blank"}),(0,s.jsx)(r.MenuDivider,{}),(0,s.jsx)(r.MenuItem,{text:"Discord",onClick:()=>h("helpMenuItem",{item:"discord"}),href:"https://discord.gg/x7t4tjZQP8",target:"_blank"})]});return(0,s.jsxs)("div",{className:"help-bubble","data-tip":"Help",children:[(0,s.jsx)(u.Popover,{content:g,modifiers:f,onOpened:()=>h("helpMenuOpen",{}),children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:d.helpIcon}})}),v]})}},71644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpIcon=void 0,t.helpIcon='\n\n\n'},3354:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1237),t)},7011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainInstanceEventsIndicator=void 0;const o=n(35250),i=n(30994),s=n(66189),r=n(50382);t.MainInstanceEventsIndicator=e=>{const{currentInsId:t,ancestorsInsIds:n}=e,{history:a,refreshHistory:u,resetHistory:l}=(0,s.useHistoryHelpers)(t),c=`main-indicator-${t}}`;return(0,o.jsx)("div",{className:"main-instance-events-indicator",children:(0,o.jsx)(r.Tooltip,{content:(0,s.calcHistoryContent)(a),children:(0,o.jsx)("span",{onMouseEnter:u,onMouseOut:l,id:(0,i.getMainInstanceIndicatorDomId)(t,n),className:"status-text","data-tip":"","data-html":!0,"data-for":c})})})}},22714:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7011),t)},63521:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VisualNodeEditor=t.defaultBoardData=t.defaultViewPort=t.NODE_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=n(74762),c=n(86553),d=n(65082),p=n(18420),f=n(26701),m=n(7047),h=n(53865),v=n(70079),g=n(68120),I=r(n(27942)),y=n(50382),b=n(66005),C=n(60190),x=n(71033),_=n(74762),w=n(99942),N=n(44338),j=n(561),P=n(84472),O=n(82232),E=n(18594),S=n(68371),D=r(n(61888)),T=n(65758),M=n(43490),k=r(n(26372)),R=n(25044),A=n(80510),V=n(1788),$=n(2130),L=n(88593),z=n(97106),H=n(67181),F=n(22714),G=n(3354),q=n(41032),B=n(30653),U=u.memo(y.Slider),W=()=>null;t.NODE_HEIGHT=28;t.defaultViewPort={pos:{x:0,y:0},zoom:1},t.defaultBoardData={selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}},t.VisualNodeEditor=u.memo(u.forwardRef(((e,n)=>{const{onChangeNode:o,nodeIoEditable:i,onCopy:s,onGoToNodeDef:r,onInspectPin:J,boardData:Y,onChangeBoardData:K,currentInsId:Q,ancestorsInsIds:X,node:ee,onShowOmnibar:te,resolvedDependencies:ne,queuedInputsData:oe,initialPadding:ie,disableScrolling:se}=e,{onImportNode:re}=(0,z.useDependenciesContext)(),ae=(0,B.useDarkMode)(),{reportEvent:ue}=(0,M.usePorts)(),le=e.parentViewport||t.defaultViewPort,[ce,de]=(0,v.useState)({...ne,[ee.id]:ee});(0,v.useEffect)((()=>{de({...ne,[ee.id]:ee})}),[ne,ee]);const{selected:pe,from:fe,to:me}=Y,{instances:he,connections:ve,inputsPosition:ge,outputsPosition:Ie,inputs:ye,outputs:be}=ee,[Ce,xe]=(0,v.useState)(),[_e,we]=(0,v.useState)(),Ne=void 0===X,[je,Pe]=(0,v.useState)(0),[Oe,Ee]=(0,v.useState)(),[Se,De]=(0,v.useState)(!1),[Te,Me]=(0,v.useState)(),[ke,Re]=(0,v.useState)(),[Ae,Ve]=(0,v.useState)(),[$e,Le]=(0,v.useState)(),ze=(0,v.useRef)();(0,f.useDidMount)((()=>{ze.current=Xe.current.querySelector(".inline-editor-portal-root")}));const He=(0,M.useConfirm)(),Fe=(0,M.usePrompt)(),Ge=Y.viewPort,qe=(0,v.useRef)(!0),[Be,Ue]=(0,v.useState)(null),We=u.useCallback((e=>{K({viewPort:e})}),[K]),Ze=u.useCallback(((e,t)=>J(e,t)),[J]),Je=u.useCallback(((e,t,n)=>{const i=(0,A.handleConnectionCloseEditorCommand)(ee,{from:e,to:t}),s=(0,l.isInternalConnectionNode)(t)?he.find((e=>e.id===t.insId)):null,r=(s?s.inputConfig:{})[t.pinId],a=(0,l.isStaticInputPinConfig)(r)?(0,V.handleDetachConstEditorCommand)(i,t.insId,t.pinId):i;o(a,(0,O.functionalChange)("close-connection")),K({from:void 0,to:void 0}),ue("createConnection",{source:n})}),[he,o,K,ee,ue]),Ye=u.useCallback((async()=>{const e=await Fe("New visual node name?");if(!e)return;const{currentNode:t}=await(0,T.groupSelected)(Y.selected,ee,e,"inline",Fe);o(t,(0,O.functionalChange)("group node")),(0,P.toastMsg)("Node grouped"),ue("groupSelected",{count:Y.selected.length})}),[Fe,Y.selected,o,ee,ue]);(0,v.useEffect)((()=>{if(Oe){const e=setTimeout((()=>{Ee(void 0)}),350);return()=>clearTimeout(e)}}),[Oe]);const[Ke,Qe]=(0,v.useState)();(0,v.useEffect)((()=>{(0,j.preloadMonaco)()}),[]);const Xe=(0,v.useRef)(),et=(0,I.default)(Xe),tt=u.useRef({x:400,y:400}),nt=(0,f.useBoundingclientrect)(Xe)||C.vZero,ot=()=>{const e=(0,m.fitViewPortToNode)(ee,ce,et);(0,m.animateViewPort)(Ge,e,500,(e=>{We(e)}))},it=u.useCallback(((e,t)=>{const{to:n,from:o}=Y,i="input"===t?o:n,s="input"===t?n:o,r={pinId:e,insId:l.THIS_INS_ID},a="input"===t?{from:r}:{to:r};i&&i.pinId===e?K({from:void 0,to:void 0}):s?"input"===t&&n?Je(r,n,"nodeIoClick"):o&&Je(o,r,"nodeIoClick"):K(a)}),[Y,K,Je]),st=u.useCallback(((e,t,n)=>{const i=(0,h.produce)(ee,(o=>{"input"===e?o.inputs[t].description=n:o.outputs[t].description=n}));o(i,(0,O.functionalChange)("Node io description"))}),[o,ee]),rt=u.useCallback(((e,t,n)=>{const{from:o,to:i}=Y;if(fe&&fe.insId===e.id||me&&me.insId===e.id)K({from:void 0,to:void 0});else if("input"===n){const n={insId:e.id,pinId:t};!i||i.pinId!==t||(0,l.isInternalConnectionNode)(i)&&i.insId!==e.id?fe?Je(fe,n,"pinClick"):K({to:n,selected:[]}):K({to:void 0})}else{const n={insId:e.id,pinId:t};!o||o.pinId!==t||(0,l.isInternalConnectionNode)(o)&&o.insId!==e.id?me?Je(n,me,"pinClick"):K({from:n,selected:[]}):K({from:void 0})}}),[Y,fe,K,Je,me]);(0,v.useEffect)((()=>{if(!Se&&et.width){const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);We(t);const n=setTimeout((()=>{const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);e.thumbnailMode||We(t),De(!0)}),100);return()=>clearTimeout(n)}}),[ee,ie,et,e.thumbnailMode,Se,ce,We]);const at=u.useCallback((()=>{const{selected:e}=Y,t=ee.instances.filter((t=>e.includes(t.id))).map((e=>({...e,id:e.id+"-copy"}))),n=ee.connections.filter((t=>{let{from:n,to:o}=t;return e.includes(n.insId)&&e.includes(o.insId)}));s({instances:t,connections:n})}),[Y,s,ee]),ut=u.useCallback((()=>{const{newNode:t,newInstances:n}=(0,R.pasteInstancesCommand)(ee,tt.current,e.clipboardData);o(t,(0,O.functionalChange)("paste instances")),K({selected:n.map((e=>e.id))})}),[o,K,ee,e.clipboardData]),lt=u.useCallback((()=>{const e=ee.id;Ke?"input"===Ke.type?Ke.ins.id===e?it(Ke.pin,"input"):rt(Ke.ins,Ke.pin,"input"):Ke.ins.id===e?it(Ke.pin,"output"):rt(Ke.ins,Ke.pin,"output"):console.warn("tried selecting closest with no pin nearby")}),[ee.id,Ke,it,rt]),ct=u.useCallback(((e,t)=>{const n=Math.min(Math.max(e,.1),3),o="mouse"===t?tt.current:{x:Ge.pos.x+et.width/2,y:Ge.pos.y+et.height/2},i=(0,m.centerBoardPosOnTarget)(o,et,n,Ge);We({...Ge,zoom:n,pos:i})}),[We,Ge,et]);(0,g.useHotkeys)("cmd+=",(e=>{ct(Ge.zoom+.1,"hotkey"),e.preventDefault()}),{text:"Zoom in board",group:"Viewport Controls"},[Ge,ct],qe),(0,g.useHotkeys)("cmd+-",(e=>{ct(Ge.zoom-.1,"hotkey"),e.preventDefault()}),{text:"Zoom out board",group:"Viewport Controls"},[ct,Ge.zoom],qe),(0,g.useHotkeys)("cmd+o",(e=>{e.preventDefault(),(0,P.toastMsg)("Ordering");const t=[];(0,w.orderVisualNode)(ee,ce,200,((e,n)=>{n%3==0&&t.push(e)})),(async()=>{for(;t.length;){const e=t.shift();(0,P.toastMsg)(`Step ${t.length}!`),await(0,l.delay)(200),o(e,(0,O.metaChange)("order-step")),(0,P.toastMsg)(`Step ${t.length}! done`)}})()}),{text:"Auto-layout (experimental)",group:"Misc."},[o,ee,ne],qe),(0,g.useHotkeys)("cmd+0",(e=>{ct(1),e.preventDefault()}),{text:"Reset zoom",group:"Viewport Controls"},[Ge,ct],qe);const dt=()=>{K({from:void 0,to:void 0,selected:[]})},pt=u.useCallback(((e,t)=>{xe(e.id),o({...ee},(0,O.metaChange)("drag-start"))}),[o,ee]),ft=u.useCallback(((e,t,n)=>{const{newValue:i,newSelected:s}=(0,m.handleInstanceDrag)(ee,e,n,t,pe,Ce);o(i,(0,O.metaChange)("drag-move")),s&&K({selected:s})}),[Ce,o,K,pe,ee]),mt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),xe(void 0)}),[]),ht=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),xe(l.THIS_INS_ID)}),[]),vt=u.useCallback((async(t,n,o,i)=>{o.preventDefault(),o.stopPropagation();const{x:s,y:r}=i,a=(0,h.produce)(ee,(e=>{"input"===t?e.inputsPosition[n]={x:s,y:r}:e.outputsPosition[n]={x:s,y:r}}));e.onChangeNode(a,(0,O.metaChange)("node-io-drag-move"))}),[e,ee]),gt=u.useCallback((async(e,t,n,o)=>{n.preventDefault(),n.stopPropagation(),xe(void 0)}),[]),It=u.useCallback(((e,t)=>{let{id:n}=e;const o=t.shiftKey?pe.filter((e=>e!==n)):[],i=t.shiftKey?[...pe,n]:[n],s=pe.includes(n)?o:i;K({selected:s,from:void 0,to:void 0})}),[K,pe]),yt=u.useCallback((()=>{const e=ee.instances.map((e=>e.id));K({selected:e,from:void 0,to:void 0})}),[K,ee.instances]),bt=u.useCallback((e=>{const t=ve.filter((t=>{let{from:n,to:o}=t;return-1===e.indexOf(n.insId)&&-1===e.indexOf(o.insId)})),n=(0,h.produce)(ee,(n=>{n.connections=t,n.instances=n.instances.filter((t=>!e.includes(t.id)))}));K({selected:[]}),o(n,(0,O.functionalChange)("delete-ins"))}),[ve,o,K,ee]),Ct=u.useCallback((e=>{bt([e.id])}),[bt]),xt=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{"input"===e?(delete n.inputs[t],n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===t)))):(n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===t))),n.completionOutputs=(n.completionOutputs||[]).map((e=>e.split("+").filter((e=>e!==t)).join("+"))).filter((e=>!!e)),delete n.outputs[t])}));fe&&fe.insId===l.THIS_INS_ID&&fe.pinId===t?K({from:void 0}):me&&me.insId===l.THIS_INS_ID&&me.pinId===t&&K({to:void 0}),o(n,(0,O.functionalChange)("remove io pin"))}),[ee,fe,me,o,K]),_t=u.useCallback((async()=>{const{selected:e,from:t,to:n}=Y;0===e.length?t&&(0,l.isExternalConnectionNode)(t)?await He(`Are you sure you want to remove main input ${t.pinId}?`)&&xt("input",t.pinId):n&&(0,l.isExternalConnectionNode)(n)&&await He(`Are you sure you want to remove main output ${n.pinId}?`)&&xt("output",n.pinId):bt(e)}),[He,Y,bt,xt]),wt=u.useCallback(((e,t,n)=>{const i=(0,m.getInstancePinConfig)(ee,e.id,t),s=(0,l.isStickyInputPinConfig)(i)?(0,_.queueInputPinConfig)():(0,l.stickyInputPinConfig)();o((0,m.changePinConfig)(ee,e.id,t,s),(0,O.functionalChange)("toggle-sticky")),ue("togglePinSticky",{isSticky:(0,l.isStickyInputPinConfig)(s)})}),[o,ee,ue]),Nt=u.useCallback((()=>{const{newNode:e,newInstances:t}=(0,$.handleDuplicateSelectedEditorCommand)(ee,pe);o(e,(0,O.functionalChange)("duplicated instances")),K({selected:t.map((e=>e.id))})}),[o,K,ee,pe]),jt=u.useCallback((e=>{const t=e.nativeEvent.target;if(0===e.button&&Z(e.nativeEvent,ee.id)&&t&&"board-editor-inner"===t.className){if(Date.now()-je<300)return void te(e);Pe(Date.now());const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,nt),o=(0,m.domToViewPort)(n,Ge,le);we({from:o,to:o})}}),[ee.id,Ge,je,nt,le,te]),Pt=u.useCallback((e=>{if(Ue(null),Z(e.nativeEvent,ee.id)&&_e){if((0,m.calcSelectionBoxArea)(_e)>50){const t=(0,m.getInstancesInRect)(_e,ce,Ge,Kt.current,ee.instances,nt,le),n=e.shiftKey?[...pe,...t]:t;K({selected:n})}we(void 0)}}),[ee.id,ee.instances,_e,ce,Ge,nt,le,pe,K]),Ot=u.useCallback((e=>{if(!Z(e.nativeEvent,ee.id))return void(qe.current=!1);qe.current=!0;const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,(0,C.vAdd)(nt,C.vZero)),o=(0,m.domToViewPort)(n,Ge,le);_e&&we({..._e,to:o});const i=(0,m.findClosestPin)(ee,ce,n,nt,Q,X,Ge),s=Ke;if(i){(!s||s.ins!==i.ins||s.ins===i.ins&&s.pin!==i.pin)&&Qe({ins:i.ins,type:i.type,pin:i.id})}tt.current=o,K({lastMousePos:tt.current})}),[ee,nt,Ge,le,_e,ce,Q,X,Ke,K]),Et=u.useCallback((e=>{var t;"bp5-menu"!==(null===(t=e.relatedTarget)||void 0===t?void 0:t.className)&&(Qe(void 0),qe.current=!1)}),[]),St=u.useCallback(((e,t)=>{if(t){const t=(0,l.isInlineNodeInstance)(e)?e.node:(0,q.safelyGetNodeDef)(e.nodeId,ce);if(!t)throw new Error("Impossible state inspecting inexisting node");if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Cannot inspect a non visual node","warning");Le({insId:`${Q}.${e.id}`,node:t})}else if((0,l.isRefNodeInstance)(e)){const t=(0,q.safelyGetNodeDef)(e,ce);r(t)}else{const t=e.node;if(!(0,l.isInlineValueNode)(t))return void((0,l.isVisualNode)(t)?Le({insId:e.id,node:t}):(0,P.toastMsg)("Editing this type of node is not supported"));const n=atob(t.dataBuilderSource);Ve({insId:e.id,templateType:t.templateType,value:n,type:"existing"}),(0,P.toastMsg)("Editing inline visual node not supported yet")}}),[r,ce,Q]),Dt=u.useCallback((e=>{if((0,l.isInlineNodeInstance)(e)){const t=e.node;if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Not supported","warning");const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.filter((t=>t.id!==e.id)),n.connections=n.connections.filter((t=>{let{from:n,to:o}=t;return n.insId!==e.id&&o.insId!==e.id})),n.instances.push(...t.instances),n.connections.push(...t.connections.filter((e=>(0,l.isInternalConnectionNode)(e.from)&&(0,l.isInternalConnectionNode)(e.to))))}));o(n,{type:"functional",message:"ungroup"}),K({selected:[]})}else{const t=(0,q.safelyGetNodeDef)(e.nodeId,ce);if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Not supported","warning")}}),[ee,o,K,ce]),Tt=u.useCallback((async e=>{}),[]),Mt=u.useCallback(((e,t)=>{const n=(0,V.handleDetachConstEditorCommand)(ee,e.id,t);o(n,(0,O.functionalChange)("detach-const"))}),[o,ee]),kt=u.useCallback(((e,t)=>{const n=e.inputConfig[t]||(0,_.queueInputPinConfig)();(0,l.isStaticInputPinConfig)(n)&&(Re(n.value),P.AppToaster.show({message:"Value copied"}))}),[]),Rt=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{const o=n.instances.find((t=>t.id===e.id));if(!o)throw new Error("Impossible state");o.inputConfig[t]=(0,l.staticInputPinConfig)(ke),n.connections=n.connections.filter((n=>!(0,l.isInternalConnectionNode)(n.to)||!(n.to.insId===e.id&&n.to.pinId===t)))}));o(n,(0,O.functionalChange)("paste const value"))}),[ee,o,ke]),At=u.useCallback((async e=>{const t=await Fe("New name?");if(!t)return;const n=(0,h.produce)(ee,(n=>{var o;"input"===e?(ee.inputs||(n.inputs={}),n.inputs[t]=(0,l.nodeInput)(),n.inputsPosition[t]=tt.current):(ee.outputs||(n.outputs={}),n.outputs[t]=(0,l.nodeOutput)(),n.outputsPosition[t]=tt.current,(null===(o=n.completionOutputs)||void 0===o?void 0:o.length)&&(0,P.toastMsg)("Note that this node has explicit completion outputs set. You may need to update them."))}));o(n,(0,O.functionalChange)("add new io pin")),ue("addIoPin",{type:e})}),[Fe,ee,o,ue]),Vt=u.useCallback((async()=>{var e;const t=null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","),n=await Fe("Edit completion outputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,h.produce)(ee,(e=>{e.completionOutputs=""===n?void 0:n.split(",")}));o(e,(0,O.functionalChange)("change node completions")),ue("editCompletionOutputs",{count:n?n.split(",").length:0})}}),[Fe,o,ee,ue]),$t=u.useCallback((async()=>{var e;const t=null===(e=ee.reactiveInputs)||void 0===e?void 0:e.join(","),n=await Fe("Edit reactive inputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,h.produce)(ee,(e=>{e.reactiveInputs=""===n?void 0:n.split(",")}));o(e,(0,O.functionalChange)("change reactive inputs")),ue("editReactiveInputs",{count:n?n.split(",").length:0})}}),[Fe,o,ee,ue]),Lt=u.useCallback((async()=>{const e=await Fe("Description?",ee.description),t=(0,h.produce)(ee,(t=>{t.description=e}));o(t,(0,O.functionalChange)("Edit node description"))}),[Fe,o,ee]),zt=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{t.defaultStyle=e}));o(t,(0,O.functionalChange)("change default style")),ue("changeStyle",{isDefault:!0})}),[o,ee,ue]),Ht=u.useCallback((async(e,t)=>{const n=await Fe("New name?",t)||t,i=(0,m.handleIoPinRename)(ee,e,t,n);o(i,(0,O.functionalChange)("rename io pin"))}),[ee,o,Fe]),Ft=u.useCallback(((e,t)=>{const n=(0,m.handleChangeNodeInputType)(ee,e,t);o(n,(0,O.functionalChange)("toggle io pin optional"))}),[ee,o]),Gt=u.useCallback((e=>{switch(e.type){case H.ActionType.RemoveNode:{const e=(0,h.produce)(ee,(e=>{if(!(0,l.isVisualNode)(ee))throw new Error("Impossible state, deleting instances opf non visual node");e.instances=e.instances.filter((e=>!pe.includes(e.id))),e.connections=e.connections.filter((e=>!pe.includes(e.from.insId)&&!pe.includes(e.to.insId)))}));K({selected:[]}),o(e,(0,O.functionalChange)("remove-instances")),(0,P.toastMsg)(`Removed ${pe.length} instances(s)`),ue("deleteInstances",{count:pe.length});break}case H.ActionType.Inspect:if(1===pe.length)J(pe[0]);else if(fe||me){const e=null!=fe?fe:me,t=(0,l.isExternalConnectionNode)(e)?l.ROOT_INS_ID:e.insId;J(t,{type:fe?"output":"input",id:e.pinId})}ue("openInspectMenu",{source:"actionMenu"});break;case H.ActionType.Group:(async()=>{await Ye()})();break;case H.ActionType.UnGroup:{const e=ee.instances.find((e=>e.id===pe[0]));Dt(e);const t=(0,q.safelyGetNodeDef)(e,ce);(0,P.toastMsg)(`Ungrouped inline node ${t.id}`),ue("unGroupNode",{instancesCount:t.instances.length});break}case H.ActionType.AddInlineValue:Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"actionMenu"});break;case H.ActionType.AddNode:!async function(){const t=(0,m.getMiddleOfViewPort)(Ge,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Ge.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,h.produce)(ee,(e=>{e.instances.push(r)})),u=(0,h.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,O.functionalChange)("add new instance")),K(u),(0,P.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;case H.ActionType.AI:!async function(){const t=(0,m.getMiddleOfViewPort)(Ge,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Ge.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,h.produce)(ee,(e=>{e.instances.push(r)})),u=(0,h.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,O.functionalChange)("add new instance")),K(u),(0,P.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;default:(0,P.toastMsg)(`${e.type} not supported yet`)}}),[Y,fe,o,K,Ye,re,J,Dt,ee,ce,ue,pe,me,Ge,et]),qt=()=>{const t=Y.from;return(0,p.entries)(ye).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"input",pos:ge[o]||{x:0,y:0},id:o,onDelete:i?xt:void 0,onRename:i?Ht:void 0,onDblClick:Zt,closest:!(!Ke||"input"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,inputMode:s.mode,onChangeInputMode:Ft,viewPort:Ge,onDragStart:ht,onDragEnd:gt,onDragMove:vt,onSelect:it,onSetDescription:st,selected:(null==t?void 0:t.pinId)===o,description:s.description,onMouseUp:wn,onMouseDown:_n},o)}))},Bt=()=>{const{to:t}=Y;return(0,p.entries)(be).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"output",pos:Ie[o]||{x:0,y:0},id:o,onDelete:i?xt:void 0,onRename:i?Ht:void 0,closest:!(!Ke||"output"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,viewPort:Ge,onDragStart:ht,onDragEnd:gt,onDragMove:vt,onSelect:it,onSetDescription:st,description:s.description,selected:(null==t?void 0:t.pinId)===o,onMouseUp:wn,onMouseDown:_n},o)}))},Ut=()=>{if(_e){const{from:e,to:t}=_e,n=(0,m.logicalPosToRenderedPos)(e,Ge),o=(0,m.logicalPosToRenderedPos)(t,Ge),{x:i,y:s,w:r,h:u}=(0,m.getSelectionBoxRect)(n,o);return(0,a.jsx)("div",{className:"selection-box",style:{top:s,left:i,width:r,height:u}})}return null},Wt=u.useCallback((async(e,t,n,o)=>{if("input"===n){const n=e.inputConfig[t],o=(0,l.isStaticInputPinConfig)(n)?JSON.stringify(n.value):void 0;Ve({type:"static-input",insId:e.id,pinId:t,value:null!=o?o:JSON.stringify("Some static value")}),ue("addValueModalOpen",{source:"dblClickPin"})}else{const i=(0,q.safelyGetNodeDef)(e,ce);if(!(0,l.getNodeOutputs)(i)[t])throw new Error("Dbl clicked on un-existing pin");Me({pos:{x:o.clientX,y:o.clientY},ins:e,targetNode:i,pinId:t,pinType:n})}}),[ce,ue]),Zt=u.useCallback((async(e,t)=>{if(!ee.inputs[e])throw new Error("Dbl clicked on un-existing pin");Me({pos:{x:t.clientX,y:t.clientY},pinId:e,pinType:"input",targetNode:ee})}),[ee]),Jt=u.useCallback((e=>{if(e.metaKey||e.ctrlKey){const t=-.005*e.deltaY;ct(Ge.zoom+t,"mouse"),e.preventDefault(),e.stopPropagation()}else{if(se)return;const t=e.deltaX,n=e.deltaY,o=(0,h.produce)(Ge,(e=>{e.pos.x=e.pos.x+t/e.zoom,e.pos.y=e.pos.y+n/e.zoom}));We(o),e.stopPropagation(),e.preventDefault()}}),[se,ct,We,Ge]);(0,v.useEffect)((()=>{const{current:e}=Xe;if(e)return e.addEventListener("wheel",Jt),()=>{e.removeEventListener("wheel",Jt)}}),[Jt]);const Yt={backgroundPositionX:(0,m.roundNumber)(-Ge.pos.x*Ge.zoom),backgroundPositionY:(0,m.roundNumber)(-Ge.pos.y*Ge.zoom),backgroundSize:(0,m.roundNumber)(10*Ge.zoom)+"px"},Kt=u.useRef(new Map);u.useEffect((()=>{const e=he.reduce(((e,t)=>{const n=(0,q.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeInputs)(n))),e}),new Map),t=he.reduce(((e,t)=>{const n=(0,q.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeOutputs)(n))),e}),new Map);e.set(l.THIS_INS_ID,(0,l.keys)(ee.outputs)),t.set(l.THIS_INS_ID,(0,l.keys)(ee.inputs));const n=ve.filter((n=>{const o=e.get(n.to.insId)&&e.get(n.to.insId).includes(n.to.pinId),i=t.get(n.from.insId)&&t.get(n.from.insId).includes(n.from.pinId);return!(o&&i)}));if(n.length>0){(0,P.toastMsg)(`${n.length} orphan connections removed`,"warning"),console.warn(`${n.length} orphan connections removed`,n);const e=(0,h.produce)(ee,(e=>{e.connections=ee.connections.filter((e=>!n.includes(e)))}));o(e,(0,O.functionalChange)("prune orphan connections"))}}),[he,o,ve,ee,ce]),u.useEffect((()=>{let e=[];const t=(0,h.produce)(ee,(t=>{t.instances=t.instances.map((t=>{const n=(0,q.safelyGetNodeDef)(t,ce);if(n){const o=(0,l.getNodeInputs)(n),i=(0,l.getNodeOutputs)(n);if(t.visibleInputs){const n=t.visibleInputs.filter((e=>!o[e]));n.length>0&&(t.visibleInputs=(0,l.keys)(o),e.push(...n))}if(t.visibleOutputs){const n=t.visibleOutputs.filter((e=>!i[e]));n.length>0&&(t.visibleOutputs=(0,l.keys)(i),e.push(...n))}}return t}))}));e.length>0&&((0,P.toastMsg)(`Found ${e.length} invalid visible inputs/outputs: ${e.join(", ")}. Reset them`,"warning"),o(t,(0,O.functionalChange)("reset corrupt visible inputs/outputs")))}),[he,o,ee,ce]),(0,v.useEffect)((()=>{const e=new Map(he.map((e=>[e.id,e])));Kt.current=ve.reduce(((t,n)=>{const o=t.get(n.to.insId)||{},i=o[n.to.pinId]||[],s={...o,[n.to.pinId]:[...i,e.get(n.from.insId)]};return t.set(n.to.insId,s),t}),new Map)}),[ve,he]);const Qt=u.useCallback((()=>{Me(void 0)}),[]),Xt=u.useCallback((async e=>{if(!Te)throw new Error("impossible state - quick add menu invoked but not available");const{ins:t,pinId:n}=Te;switch(e.type){case"import":case"node":{const i="import"===e.type?await re(e.importableNode):ce,s="import"===e.type?e.importableNode.node:e.node,r=(0,m.createNewNodeInstance)(s.id,100,tt.current,i);if(r){const e=(0,h.produce)(ee,(e=>{e.instances.push(r),e.connections.push({from:{insId:t?t.id:l.THIS_INS_ID,pinId:n},to:{insId:r.id,pinId:l.TRIGGER_PIN_ID}})}));o(e,(0,O.functionalChange)("add-item-quick-menu")),Qt()}ue("addNode",{nodeId:s.id,source:"quickAdd"});break}case"value":if(!t)return void(0,P.toastMsg)("Cannot add value to main input");Ve({type:"new-output",insId:t.id,pinId:n}),ue("addValueModalOpen",{source:"quickAdd"})}}),[Te,ce,ue,ee,o,Qt,re]),en=u.useCallback((async()=>{const e=JSON.stringify(ee);await navigator.clipboard.writeText(e),P.AppToaster.show({message:"Copied!"})}),[ee]),tn=u.useCallback((()=>{var e,t;const n=i?"":" (cannot edit main node, only visual)";return(0,a.jsxs)(y.Menu,{children:[(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"New Value",onClick:(0,p.preventDefaultAnd)((()=>{Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"contextMenu"})}))}),(0,a.jsx)(y.MenuItem,{text:`New input ${n}`,onMouseDown:e=>e.stopPropagation(),onClick:(0,p.preventDefaultAnd)((()=>At("input"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`New output ${n}`,onClick:(0,p.preventDefaultAnd)((()=>At("output"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Copy node to clipboard",onClick:(0,p.preventDefaultAnd)(en)}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Completion Outputs (${(null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Vt()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Reactive inputs (${(null===(t=ee.reactiveInputs)||void 0===t?void 0:t.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>$t()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Edit description",onClick:(0,p.preventDefaultAnd)((()=>Lt()))}),(0,a.jsx)(y.MenuDivider,{}),(0,a.jsx)(y.MenuItem,{text:"Default Style",children:(0,a.jsx)(L.NodeStyleMenu,{style:ee.defaultStyle,onChange:zt,promptFn:Fe})})]})}),[i,en,ee.completionOutputs,ee.reactiveInputs,ee.defaultStyle,zt,Fe,ue,At,Vt,$t,Lt]);(0,g.useHotkeys)("shift+c",ot,{text:"Center viewport",group:"Viewport Controls"},[],qe),(0,g.useHotkeys)("cmd+c",at,{text:"Copy instances",group:"Editing"},[],qe),(0,g.useHotkeys)("cmd+v",ut,{text:"Paste instances",group:"Editing"},[],qe),(0,g.useHotkeys)("esc",dt,{text:"Clear selections",group:"Selection"},[],qe),(0,g.useHotkeys)("backspace",_t,{text:"Delete instances",group:"Editing"},[],qe),(0,g.useHotkeys)("shift+d",Nt,{text:"Duplicate selected instances",group:"Editing"},[],qe),(0,g.useHotkeys)("cmd+a",yt,{text:"Select all",group:"Selection"},[],qe),(0,g.useHotkeys)("s",lt,{text:"Select pin closest to mouse",group:"Selection"},[],qe);const nn=u.useCallback(((e,t)=>{if(!$e)throw new Error("impossible state");const n=(0,h.produce)(ee,(t=>{const n=t.instances.find((e=>e.id===$e.insId));if(!n||!(0,l.isInlineNodeInstance)(n))throw new Error("impossible state");n.node=e}));o(n,(0,O.functionalChange)("Inner change: "+t.message)),Le((t=>({...t,node:e})))}),[o,$e,ee]),[on,sn]=(0,v.useState)({selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}}),rn=u.useCallback((e=>sn((t=>({...t,...e})))),[]),an=n=>$e&&$e.insId===n.id?{currentInsId:$e.insId,ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),boardData:on,onChangeBoardData:rn,resolvedDependencies:ne,onCopy:s,clipboardData:e.clipboardData,onInspectPin:e.onInspectPin,onGoToNodeDef:e.onGoToNodeDef,nodeIoEditable:e.nodeIoEditable,node:$e.node,onChangeNode:nn,onShowOmnibar:te,parentViewport:t.defaultViewPort,parentBoardPos:nt,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:e.queuedInputsData}:void 0,un=()=>{if(fe&&("input"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"output"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(e)&&!(0,l.isInternalConnectionNode)(fe))return;return{from:fe,to:e}}if(me&&("output"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"input"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(me)&&!(0,l.isInternalConnectionNode)(e))return;return{from:e,to:me}}},ln=()=>{const e=un();if(e){const{from:t,to:n}=e;return{connection:{from:t,to:n},type:ve.some((t=>(0,l.connectionDataEquals)(t,e)))?"future-remove":"future-add"}}},cn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleInputs:t}:n))}));o(n,(0,O.functionalChange)("change instance visible inputs"))}),[ee,o]),dn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,style:t}:n))}));o(n,(0,O.functionalChange)("change instance style")),ue("changeStyle",{isDefault:!1})}),[o,ee,ue]),pn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleOutputs:t}:n))}));o(n,(0,O.functionalChange)("change instance visible outputs"))}),[ee,o]),fn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,displayName:t}:n))}));o(n,(0,O.functionalChange)("change instance display name"))}),[ee,o]);u.useImperativeHandle(n,(()=>({centerInstance(e){const t=ee.instances.find((t=>t.id===e));if(t){const e=(0,C.vSub)(t.pos,(0,C.vec)(et.width/2,et.height/2));We({...Ge,pos:e})}},centerViewPort(){ot()},getViewPort:()=>Ge,clearSelection:()=>{dt()},requestNewInlineValue:()=>{Ve({type:"new-floating",pos:tt.current})}})));const[mn,hn]=u.useState([]),vn=u.useCallback(((e,t)=>{const n=t.trim().substr(0,100),i=`Inline-value-${n.substr(0,15).replace(/["'`]/g,"")}`,s=(0,S.createInlineValueNode)({code:t,customView:n,nodeId:i,type:e});switch(Ae.type){case"existing":{const[e]=ee.instances.filter((e=>e.id===Ae.insId)).filter((e=>(0,l.isInlineNodeInstance)(e))).map((e=>e.node));if(!e)throw new Error("Unable to find inline node to save to");const t=(0,l.keys)(e.inputs),n=(0,l.keys)(s.inputs),i=new Set(D.default.difference(t,n)),r=(0,h.produce)(ee,(e=>{e.instances=e.instances.map((e=>e.id===Ae.insId?(0,l.inlineNodeInstance)(e.id,s,e.inputConfig,e.pos):e)),e.connections=e.connections.filter((e=>!(e.to.insId===Ae.insId&&i.has(e.to.pinId))))}));o(r,(0,O.functionalChange)("change inline value")),Ve(void 0);break}case"static-input":{let e;try{const n=t.replace(/^['`]/,'"').replace(/['`]$/,'"');e=JSON.parse(n)}catch(r){return void(0,P.toastMsg)("Input values must not be formulas or code")}const n=(0,h.produce)(ee,(t=>{t.instances.find((e=>e.id===Ae.insId)).inputConfig[Ae.pinId]=(0,l.staticInputPinConfig)(e)}));o(n,(0,O.functionalChange)("set static input value")),Ve(void 0);break}case"new-floating":{const e=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},Ae.pos),t=(0,h.produce)(ee,(t=>{t.instances.push(e)}));o(t,(0,O.functionalChange)("new floating value")),Ve(void 0);break}case"new-output":{const{insId:e,pinId:t}=Ae,n=ee.instances.find((t=>t.id===e));if(!n)throw new Error("Impossible state");const i=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},(0,C.vAdd)(n.pos,{x:-50,y:150})),r=(0,h.produce)(ee,(n=>{n.instances.push(i),n.connections.push({from:(0,l.connectionNode)(e,t),to:(0,l.connectionNode)(i.id,l.TRIGGER_PIN_ID)})}));o(r,(0,O.functionalChange)("new value connected to output")),Ve(void 0)}}ue("addValue",{type:e,placeholdersCount:(0,l.keys)(s.inputs).length})}),[Ae,o,ee,ue]),gn=ve.filter((e=>{const t=un();return!t||!(0,l.connectionDataEquals)(t,e)})),In=u.useCallback((()=>{Le(void 0),sn(t.defaultBoardData)}),[]),yn=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{const n=t.connections.find((t=>(0,l.connectionDataEquals)(t,e)));n.hidden=!n.hidden}));o(t,(0,O.functionalChange)("toggle connection hidden"))}),[o,ee]),bn=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{t.connections=t.connections.filter((t=>!(0,l.connectionDataEquals)(t,e)))}));o(t,(0,O.functionalChange)("remove connection"))}),[o,ee]),Cn=u.useCallback(((e,t,n)=>{Ue("input"===n?{to:(0,l.connectionNode)(e.id,t),from:void 0}:{from:(0,l.connectionNode)(e.id,t),to:void 0})}),[]),xn=u.useCallback(((e,t,n)=>{Be&&(Be.from&&"input"===n?Je(Be.from,(0,l.connectionNode)(e.id,t),"pinDrag"):Be.to&&"output"===n&&Je((0,l.connectionNode)(e.id,t),Be.to,"pinDrag")),Ue(null)}),[Be,Je]),_n=u.useCallback(((e,t)=>{}),[]),wn=u.useCallback(((e,t)=>{Be&&(Be.from&&"output"===t?Je(Be.from,(0,l.externalConnectionNode)(e),"nodeIoPinDrag"):Be.to&&"input"===t&&Je((0,l.externalConnectionNode)(e),Be.to,"nodeIoPinDrag"))}),[Be,Je]);try{return(0,a.jsxs)(y.ContextMenu,{className:(0,k.default)("visual-node-editor",e.className,{dark:ae}),"data-id":ee.id,content:tn(),disabled:!qe.current,children:[(0,a.jsxs)("main",{className:"board-editor-inner",onMouseDown:jt,onMouseUp:Pt,onMouseMove:Ot,onMouseLeave:Et,ref:Xe,style:Yt,children:[(0,a.jsx)(u.Fragment,{children:(0,a.jsx)(N.LayoutDebugger,{vp:Ge,node:ee,extraDebug:m.emptyList,mousePos:tt.current})}),(0,a.jsx)(d.ConnectionView,{resolvedNodes:ce,currentInsId:Q,ancestorsInsIds:X,size:et,node:ee,boardPos:nt,instances:he,connections:gn,futureConnection:ln(),onDblClick:l.noop,viewPort:Ge,parentVp:le,selectedInstances:pe,toggleHidden:yn,removeConnection:bn,lastMousePos:tt.current,draggedSource:Be}),qt(),he.map((t=>{var n,o,i,s,r;return(0,a.jsx)(c.InstanceView,{onUngroup:Dt,onExtractInlineNode:Tt,onDetachConstValue:Mt,onCopyConstValue:kt,onPasteConstValue:Rt,copiedConstValue:ke,connectionsPerInput:Kt.current.get(t.id)||m.emptyObj,node:(0,q.safelyGetNodeDef)(t,ce),ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),onPinClick:rt,onPinDblClick:Wt,onDragStart:pt,onDragEnd:mt,resolvedDeps:ce,onDragMove:ft,onDblClick:St,onSelect:It,onToggleSticky:wt,selected:-1!==pe.indexOf(t.id),dragged:Ce===t.id,onInspectPin:Ze,selectedInput:me&&(0,l.isInternalConnectionNode)(me)&&me.insId===t.id?me.pinId:void 0,selectedOutput:fe&&(0,l.isInternalConnectionNode)(fe)&&fe.insId===t.id?fe.pinId:void 0,closestPin:Ke&&Ke.ins.id===t.id?Ke:void 0,queuedInputsData:null!==(n=oe[t.id])&&void 0!==n?n:m.emptyObj,instance:t,connections:ve,onTogglePinBreakpoint:l.noop,onTogglePinLog:l.noop,viewPort:Ge,onChangeVisibleInputs:cn,onChangeVisibleOutputs:pn,onSetDisplayName:fn,onDeleteInstance:Ct,forceShowMinimized:fe||(null===(o=null==Be?void 0:Be.to)||void 0===o?void 0:o.insId)===t.id?"input":me||(null===(i=null==Be?void 0:Be.from)||void 0===i?void 0:i.insId)===t.id?"output":void 0,isConnectedInstanceSelected:pe.some((e=>ve.some((n=>{let{from:o,to:i}=n;return o.insId===t.id&&i.insId===e||o.insId===e&&i.insId===t.id})))),inlineGroupProps:an(t),onCloseInlineEditor:In,inlineEditorPortalDomNode:ze.current,onChangeStyle:dn,onGroupSelected:Ye,onPinMouseDown:Cn,onPinMouseUp:xn,hadError:null!==(r=null===(s=e.instancesWithErrors)||void 0===s?void 0:s.has((0,l.fullInsIdPath)(t.id)))&&void 0!==r&&r},t.id)})),Ut(),Bt(),(0,a.jsx)(F.MainInstanceEventsIndicator,{currentInsId:Q,ancestorsInsIds:X,viewPort:Ge}),Te?(0,a.jsx)(x.QuickAddMenu,{targetNode:Te.targetNode,pinId:Te.pinId,pinType:Te.pinType,pos:Te.pos,resolvedDependencies:ne,node:ee,onAdd:Xt,onClose:Qt}):null,(0,a.jsxs)("div",{className:"viewport-controls-and-help",children:[(0,a.jsx)(y.Button,{small:!0,onClick:ot,minimal:!0,intent:"primary",children:"Center"}),(0,a.jsx)(U,{min:.15,max:3,stepSize:.05,labelStepSize:10,labelRenderer:W,onChange:ct,value:Ge.zoom}),Ne?(0,a.jsx)(G.HelpBubble,{}):null]}),Ae?(0,a.jsx)(E.InlineCodeModal,{env:m.emptyObj,initialValue:Ae.value,initialType:"existing"===Ae.type?Ae.templateType:void 0,onCancel:()=>Ve(void 0),onSubmit:vn}):null,(0,a.jsx)("div",{className:"inline-editor-portal-root"})]}),(0,a.jsx)(H.ActionsMenu,{showRunFlowOptions:Ne,onAction:Gt,selectedInstances:pe,node:ee,resolvedNodes:ce,to:me,from:fe,hotkeysEnabled:qe})]})}catch(Nn){return console.error(Nn),(0,a.jsxs)("div",{children:["Error rendering board - ",Nn.toString()]})}})));const Z=(e,t)=>{const n=e.target.closest(".visual-node-editor");return n&&n.getAttribute("data-id")===t}},83234:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeView=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=r(n(59349)),d=n(30653);t.BaseNodeView=function(e){const{dragged:t,viewPort:n,pos:o,onDragEnd:i,onDragMove:s,onDragStart:r,displayMode:p}=e,f=(0,d.useDarkMode)(),m=u.useCallback(((e,t)=>{r(e,t)}),[r]),h=u.useCallback(((e,t)=>{const s=o,r=(t.x-s.x)/n.zoom,a=(t.y-s.y)/n.zoom,u=s.x+r,l=s.y+a;i(e,{...t,x:u,y:l})}),[o,i,n]),v=u.useCallback(((e,t)=>{s(e,{x:t.x,y:t.y})}),[s]),g={transform:`scale(${n.zoom})`},I=(0,l.default)("base-node-view",e.className,{dragged:t,dark:f,"display-mode":p}),y=o.x*n.zoom-n.pos.x*n.zoom,b=o.y*n.zoom-n.pos.y*n.zoom,C={transform:`translate(${y-o.x}px, ${b-o.y}px)`},x=(0,l.default)("base-node-view-vp-fixer",{"display-mode":p}),_=(0,a.jsx)("span",{className:"base-node-view-wrapper",children:(0,a.jsx)("div",{className:I,style:g,id:e.domId,children:e.children})});return(0,a.jsx)("div",{className:x,style:C,children:(0,a.jsx)(c.default,{onStop:h,onStart:m,onDrag:v,position:o,cancel:".no-drag",children:_})})}},80510:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleConnectionCloseEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleConnectionCloseEditorCommand=(e,t)=>{let{from:n,to:o}=t;return(0,s.default)(e,(e=>{const t=e.connections.find((e=>{const t=(0,i.connectionNodeEquals)(n,e.from),s=(0,i.connectionNodeEquals)(o,e.to);return t&&s}));t?e.connections=e.connections.filter((e=>e!==t)):e.connections.push({from:n,to:o})}))}},1788:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDetachConstEditorCommand=void 0;const i=n(74762),s=o(n(53865)),r=n(68371);t.handleDetachConstEditorCommand=(e,t,n)=>(0,s.default)(e,(e=>{const{instances:o}=e,s=o.find((e=>e.id===t));if(!s)throw new Error("Impossible state ins id with no matching instance");const a=s.inputConfig[n];if(!a)throw new Error("impossible state detaching const from unexistent config");if(!(0,i.isStaticInputPinConfig)(a))throw new Error("impossible state detaching const with no value");const u=JSON.stringify(a.value),l=(0,r.createInlineValueNode)({code:`${u}`,type:i.InlineValueNodeType.VALUE}),c=(0,i.inlineNodeInstance)(`value-${(0,i.randomInt)(999)}`,l,{},{x:s.pos.x,y:s.pos.y-100});if(!e.instances.find((e=>e.id===s.id)))throw new Error("impossible state instance not found");s.inputConfig[n]=(0,i.queueInputPinConfig)(),e.instances.push(c),e.connections.push((0,i.connectionData)(`${c.id}.value`,`${s.id}.${n}`))}))},2130:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDuplicateSelectedEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleDuplicateSelectedEditorCommand=(e,t)=>{const n=[];return{newNode:(0,s.default)(e,(o=>{const s=o.instances;t.forEach((t=>{const o=s.find((e=>e.id===t));if(!o)throw new Error("impossible state duplicate selected no matching instance");if(o){const{pos:t}=o,r={...o,pos:{x:t.x+20,y:t.y+20},id:(0,i.createInsId)(e)};s.push(r),n.push(r.id)}}))})),newInstances:n}}},25044:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.pasteInstancesCommand=void 0;const i=n(74762),s=o(n(53865));t.pasteInstancesCommand=(e,t,n)=>{const o=n.instances.map((n=>({...n,pos:t,id:(0,i.createInsId)(e)}))),r=new Map(o.map(((e,t)=>[n.instances[t].id,e.id])));return{newNode:(0,s.default)(e,(e=>{e.instances.push(...o);const t=n.connections.map((e=>{let{from:t,to:n}=e;return{from:{...t,insId:r.get(t.insId)||t.insId},to:{...n,insId:r.get(n.insId)||n.insId}}}));e.connections.push(...t)})),newInstances:o}}},65082:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionView=t.SingleConnectionView=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=r(n(26372)),d=n(74762),p=n(18243),f=n(77852),m=n(74089),h=n(60190),v=n(50382),g=n(76064),I=n(41032);t.SingleConnectionView=e=>{const{isBrowser:t}=(0,f.useSsr)(),{connection:n,node:o,resolvedNodes:i,instances:s,type:r,viewPort:a,toggleHidden:l,parentSelected:m,removeConnection:y}=e,{from:b}=n,C=(0,d.isInternalConnectionNode)(b)&&s.find((e=>e.id===b.insId));if(!C&&(0,d.isInternalConnectionNode)(b))throw new Error(`impossible state - "from instance id - [${b.insId}] does not exist"`);const x=((0,d.isInternalConnectionNode)(b)&&C?(0,I.safelyGetNodeDef)(C,i):o).outputs[b.pinId],_=x&&x.delayed,w=t?(0,p.calcStartPos)({...e,connectionNode:b}):{x:0,y:0},N=t?(0,p.calcTargetPos)({...e,connectionNode:n.to}):{x:0,y:0},{x:j,y:P}=(0,h.vDiv)(w,e.parentVp.zoom),{x:O,y:E}=(0,h.vDiv)(N,e.parentVp.zoom),S=(0,c.default)({delayed:_,hidden:n.hidden,"parent-selected":m},r),D=(0,u.jsxs)(v.Menu,{children:[(0,u.jsx)(v.MenuItem,{text:n.hidden?"Show connection":"Hide connection",onClick:()=>l(n)}),(0,u.jsx)(v.MenuItem,{text:"Remove connection",onClick:()=>y(n)})]});return(0,u.jsx)(v.ContextMenu,{content:D,children:e=>(0,u.jsx)(g.ConnectionViewPath,{className:S,from:{x:j,y:P},to:{x:O,y:E},dashed:"regular"!==r,zoom:a.zoom,onContextMenu:e.onContextMenu})})};t.ConnectionView=e=>{var n;const{viewPort:o,futureConnection:i,toggleHidden:s,selectedInstances:r,draggedSource:c}=e,[d,f]=l.useState(0),h=l.useCallback((e=>requestAnimationFrame((()=>{f((e=>(e+1)%9)),e>0&&h(e-1)}))),[]);l.useEffect((()=>{const e=h(10);return()=>{cancelAnimationFrame(e)}}),[h]),l.useEffect((()=>{const e=()=>{h(3)};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[h,d]);const v=e.connections.map((n=>{const o=r.includes(n.from.insId)||r.includes(n.to.insId);return(0,a.createElement)(t.SingleConnectionView,{...e,connection:n,type:"regular",parentSelected:o,key:n.from.insId+n.from.pinId+n.to.insId+n.to.pinId})}));if(i&&v.push((0,a.createElement)(t.SingleConnectionView,{...e,connection:i.connection,type:i.type,toggleHidden:s,parentSelected:!1,key:"future"})),c){const t=(c.from?p.calcStartPos:p.calcTargetPos)({connectionNode:null!==(n=c.from)&&void 0!==n?n:c.to,viewPort:o,boardPos:e.boardPos,ancestorsInsIds:e.ancestorsInsIds,currentInsId:e.currentInsId});v.push((0,u.jsx)(g.ConnectionViewPath,{className:"dragged",from:t,to:(0,m.logicalPosToRenderedPos)(e.lastMousePos,o),zoom:o.zoom},"dragged"))}return(0,u.jsx)("span",{className:"connections-view",style:{opacity:o.zoom},children:(0,u.jsx)("svg",{style:{width:"100%"},children:v})})}},76064:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionViewPath=void 0;const i=n(35250),s=o(n(26372)),r=n(70079),a=n(23381);t.ConnectionViewPath=(0,r.forwardRef)(((e,t)=>{const{from:n,to:o,className:r,onContextMenu:u,zoom:l,dashed:c}=e,{x:d,y:p}=n,{x:f,y:m}=o,h=(0,a.calcBezierPath)({sourceX:d,sourceY:p,targetX:f,targetY:m,curvature:.15}),v=2.5*l,g=c?6*l:void 0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:h,ref:t,className:(0,s.default)("connection",r),style:{strokeWidth:v,strokeDasharray:g},onContextMenu:u}),e.label?(0,i.jsx)("text",{className:"label",x:(d+f)/2,y:(p+m)/2,fontSize:"12px"}):null,(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%"}),(0,i.jsx)("stop",{offset:"100%"})]})]})}))},23381:(e,t)=>{"use strict";var n;function o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i(e){let t,i,{pos:s,x1:r,y1:a,x2:u,y2:l,c:c}=e;switch(s){case n.Left:t=r-o(r-u,c),i=a;break;case n.Right:t=r+o(u-r,c),i=a;break;case n.Top:t=r,i=a-o(a-l,c);break;case n.Bottom:t=r,i=a+o(l-a,c)}return[t,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.getBezierCenter=t.calcBezierPath=t.Position=void 0,function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(n=t.Position||(t.Position={}));t.calcBezierPath=e=>{let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l});return`M${t},${o} C${c},${d} ${p},${f} ${r},${a}`},t.getBezierCenter=function(e){let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l}),m=.125*t+.375*c+.375*p+.125*r,h=.125*o+.375*d+.375*f+.125*a;return[m,h,Math.abs(m-t),Math.abs(h-o)]}},18243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcTargetPos=t.calcStartPos=t.calcPinPosition=void 0;const o=n(74762),i=n(30994),s={x:99999,y:99999};function r(e){const t=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds),pinId:e.pinId,pinType:e.pinType,isMain:e.isMain});return((e,t,n,o)=>{if(!e)return console.warn(`Cannot find element ${n} to calculate position.`),s;const{x:i,y:r,width:a,height:u}=e.getBoundingClientRect(),l=r+u/2;return{x:i+a/2-t.x,y:l-t.y}})(document.getElementById(t),e.boardPos,t,e.viewPort)}t.calcPinPosition=r;t.calcStartPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"input",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"output",boardPos:n,viewPort:s})};t.calcTargetPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"output",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"input",boardPos:n,viewPort:s})}},30994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPinDomId=t.getMainInstanceIndicatorDomId=t.getInstanceDomId=void 0;const o=n(74762);t.getInstanceDomId=(e,t)=>`ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getMainInstanceIndicatorDomId=(e,t)=>`main-ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getPinDomId=e=>{let{pinType:t,fullInsIdPath:n,pinId:o,isMain:i}=e;return`${i?"main-":""}pin:${t}:${n}:${o}`.replace(/\s+/g,"-")}},86553:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceView=t.getVisibleOutputs=t.getVisibleInputs=t.INSTANCE_INFO_TOOLTIP_DELAY=t.MAX_INSTANCE_WIDTH=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=n(66074),d=n(74762),p=r(n(26372)),f=n(2036),m=n(74762),h=n(74762),v=n(53159),g=n(83234),I=n(74762),y=n(30994),b=n(63521),C=n(74089),x=n(50382),_=r(n(99581)),w=n(88593),N=n(30653);t.PIECE_HORIZONTAL_PADDING=25,t.PIECE_CHAR_WIDTH=11,t.MIN_WIDTH_PER_PIN=40,t.MAX_INSTANCE_WIDTH=400,t.INSTANCE_INFO_TOOLTIP_DELAY=400;t.getVisibleInputs=(e,t,n)=>{const{visibleInputs:o}=e;if(o)return o;const i=(0,d.keys)((0,h.getNodeInputs)(t)).filter(((o,i)=>{var s;const r=n.some((t=>t.to.insId===e.id&&t.to.pinId===o)),a=t.inputs[o]&&"optional"===(null===(s=t.inputs[o])||void 0===s?void 0:s.mode);return r||!a&&o!==m.TRIGGER_PIN_ID}));return 0===i.length?[m.TRIGGER_PIN_ID]:i};t.getVisibleOutputs=(e,t,n)=>{const{visibleOutputs:o}=e;if(o)return o;const i=Object.keys(t.outputs);return n.some((t=>t.from.insId===e.id&&t.from.pinId===m.ERROR_PIN_ID))?[...i,m.ERROR_PIN_ID]:i};t.InstanceView=function(e){const{selected:n,selectedInput:o,selectedOutput:i,closestPin:s,dragged:r,onTogglePinLog:j,onTogglePinBreakpoint:P,onDetachConstValue:O,onCopyConstValue:E,onPasteConstValue:S,displayMode:D,connections:T,instance:M,viewPort:k,node:R,onPinClick:A,onPinDblClick:V,onDragStart:$,onDragEnd:L,onDragMove:z,onToggleSticky:H,onSelect:F,onDblClick:G,onChangeVisibleInputs:q,onChangeVisibleOutputs:B,onConvertConstToEnv:U,inlineGroupProps:W,onUngroup:Z,onExtractInlineNode:J,onGroupSelected:Y,isConnectedInstanceSelected:K,inlineEditorPortalDomNode:Q,onChangeStyle:X,onDeleteInstance:ee,onSetDisplayName:te,onPinMouseUp:ne,onPinMouseDown:oe}=e,ie=(0,N.useDarkMode)(),{id:se}=M,re=l.useMemo((()=>{const e=(0,d.randomInt)(6,1);return{icon:(0,d.pickRandom)([["fab","discord"],["fab","slack"],"bug","cube"]),color:e,size:(0,d.randomInt)(3,1),variation:(0,d.randomInt)(5,1)}}),[]),ae=l.useRef(),ue=l.useMemo((()=>M.style||R.defaultStyle||{}),[R,M]),le=ue.size||"regular",ce=l.useMemo((()=>new Map(T.filter((e=>{let{to:t}=e;return t.insId===se})).map((e=>{let{to:t,hidden:n}=e;return[t.pinId,n]})))),[T,se]),de=l.useMemo((()=>new Map(T.filter((e=>{let{from:t}=e;return t.insId===se})).map((e=>{let{from:t,hidden:n}=e;return[t.pinId,n]})))),[T,se]),pe=(0,C.usePrompt)(),fe=l.useCallback((e=>A(M,e,"input")),[M,A]),me=l.useCallback(((e,t)=>V(M,e,"input",t)),[M,V]),he=l.useCallback(((e,t)=>V(M,e,"output",t)),[M,V]),ve=l.useCallback((e=>A(M,e,"output")),[M,A]),ge=l.useCallback(((e,t)=>{$(M,e,t)}),[M,$]),Ie=l.useCallback(((e,t)=>{const n=M.pos,o=(t.x-n.x)/k.zoom,i=(t.y-n.y)/k.zoom,s=n.x+o,r=n.y+i;L(M,e,{...t,x:s,y:r})}),[M,L,k.zoom]),ye=l.useCallback(((e,t)=>{z(M,e,{x:t.x,y:t.y})}),[M,z]),be=l.useCallback((e=>H(M,e)),[M,H]),Ce=l.useCallback((e=>O(M,e)),[M,O]),xe=l.useCallback((e=>E(M,e)),[M,E]),_e=l.useCallback((e=>S(M,e)),[M,S]),we=l.useCallback((e=>F(M,e)),[M,F]),Ne=l.useCallback((e=>G(M,e.shiftKey)),[M,G]),je=(0,d.entries)(R.inputs),{visibleInputs:Pe,visibleOutputs:Oe}=M;Pe&&je.sort(((e,t)=>Pe.indexOf(e[0])-Pe.indexOf(t[0])));const Ee=(0,d.entries)(R.outputs);Oe&&Ee.sort(((e,t)=>Oe.indexOf(e[0])-Oe.indexOf(t[0])));const Se=(0,t.getVisibleInputs)(M,R,T),De=(0,t.getVisibleOutputs)(M,R,T);je.push([m.TRIGGER_PIN_ID,{...(0,d.nodeInput)(),description:"Use this pin to manually trigger the node. If not connected, the node will be triggered automatically when all required inputs have data."}]),Ee.push([m.ERROR_PIN_ID,{...(0,m.nodeOutput)(),description:"Use this pin to catch errors that happen inside this node. If not connected, errors will bubble up to the parent node."}]);const Te=je.filter((e=>{let[t]=e;return Se.includes(t)||(n||K)&&ce.has(t)})),Me=Ee.filter((t=>{let[o]=t;return De.includes(o)||(n||K)&&de.has(o)||o===m.ERROR_PIN_ID&&e.hadError})),ke=T.some((e=>e.from.insId===se&&e.from.pinId===m.ERROR_PIN_ID)),Re=(0,p.default)("ins-view",{"no-inputs":0===je.length,"no-outputs":0===Ee.length,"display-mode":D,"force-minimized-input":"input"===e.forceShowMinimized||"both"===e.forceShowMinimized,"force-minimized-output":"output"===e.forceShowMinimized||"both"===e.forceShowMinimized,"inline-node-edited":!!W,"error-caught":ke}),Ae=(0,p.default)({selected:n,dragged:r,closest:s&&s.ins.id===M.id},`size-${le}`),Ve=new Set((0,d.entries)(R.inputs).filter((e=>{let[t,n]=e;return(0,m.isInputPinOptional)(n)})).map(d.pickFirst)),$e=(0,d.entries)(M.inputConfig).reduce(((e,t)=>{let[n,o]=t;return(0,m.isStickyInputPinConfig)(o)||o.sticky?{...e,[n]:!0}:e}),{}),Le=(0,v.calcNodeContent)(M,R),ze=e=>{const t=M.inputConfig[e];if((0,I.isStaticInputPinConfig)(t))return t.value},He=l.useCallback((async()=>{const e=(0,d.okeys)(R.inputs),t=await pe("New order?",(M.visibleInputs||e).join(","));t&&q(M,t.split(","))}),[R.inputs,pe,M,q]),Fe=l.useCallback((async()=>{const e=(0,d.okeys)(R.outputs),t=await pe("New order?",(M.visibleOutputs||e).join(","));t&&B(M,t.split(","))}),[R.outputs,pe,M,B]),Ge=l.useCallback((()=>{ee(M)}),[ee,M]),qe=l.useCallback((async()=>{const e=await pe("Set custom display name",M.displayName||R.id);te(M,e)}),[pe,M,te,R.id]),Be=Object.keys((0,h.getNodeInputs)(R)),Ue=Object.keys((0,d.getNodeOutputs)(R)),We=l.useCallback((e=>{U&&U(M,e)}),[M,U]),Ze=l.useCallback(((e,t)=>{ne&&ne(M,e,t)}),[M,ne]),Je=l.useCallback(((e,t)=>{oe&&oe(M,e,t)}),[M,oe]),Ye=()=>(0,u.jsx)("div",{className:"inputs no-drag",children:Te.map((t=>{let[i,r]=t;var a;return(0,u.jsx)(f.PinView,{type:"input",currentInsId:M.id,ancestorsInsIds:e.ancestorsInsIds,id:i,optional:Ve.has(i),connected:ce.has(i),isSticky:$e[i],minimized:!n&&1===Te.length,onToggleSticky:be,onDetachConstValue:Ce,onCopyConstValue:xe,onPasteConstValue:_e,copiedConstValue:e.copiedConstValue,selected:i===o,onClick:fe,onDoubleClick:me,isClosestToMouse:!!s&&"input"===s.type&&s.pin===i,onToggleLogged:j,onToggleBreakpoint:P,onInspect:e.onInspectPin,constValue:ze(i),onConvertConstToEnv:e.onConvertConstToEnv?We:void 0,description:r.description,queuedValues:null!==(a=e.queuedInputsData[i])&&void 0!==a?a:0,onMouseUp:Ze,onMouseDown:Je},i)}))}),Ke=()=>(0,u.jsx)("div",{className:"outputs no-drag",children:Me.map((t=>{let[o,r]=t;return(0,u.jsx)(f.PinView,{currentInsId:M.id,ancestorsInsIds:e.ancestorsInsIds,connected:de.has(o),type:"output",id:o,minimized:!n&&1===Me.length,isClosestToMouse:!!s&&"output"===s.type&&s.pin===o,selected:o===i,onClick:ve,onDoubleClick:he,onToggleLogged:j,onToggleBreakpoint:P,onInspect:e.onInspectPin,description:r.description,onMouseUp:Ze,onMouseDown:Je},o)}))}),Qe=l.useCallback((e=>{X(M,e)}),[M,X]),Xe=l.useCallback((()=>{const e=[...Be.map((e=>{const t=Se.includes(e),n=ce.has(e)&&!0!==ce.get(e),o=(0,d.getInputName)(e);return{text:t?n?`Hide input "${o}" (disconnect first)`:`Hide input "${o}"`:`Show input "${o}"`,onClick:()=>q(M,t?Se.filter((t=>t!==e)):[...Se,e]),disabled:n&&t}})),...Ue.map((e=>{const t=De.includes(e),n=de.has(e),o=(0,d.getOutputName)(e);return{text:t?n?`Hide output "${o}" (disconnect first)`:`Hide output "${o}"`:`Show output "${o}"`,onClick:()=>B(M,t?De.filter((t=>t!==e)):[...De,e]),disabled:n&&t}})),...(0,d.isInlineNodeInstance)(M)&&(0,h.isVisualNode)(M.node)?[{text:"Ungroup inline node",onClick:()=>Z(M)}]:[],...(0,d.isInlineNodeInstance)(M)?[{text:"Extract inline node to file",onClick:()=>J(M)}]:[],{text:"Reorder inputs",onClick:He},{text:"Reorder outputs",onClick:Fe},{text:"Set display name",onClick:qe},{text:"Group selected instances",onClick:Y},{text:"Delete instance",intent:"danger",onClick:Ge}];return(0,u.jsxs)(x.Menu,{children:[(0,u.jsx)(x.MenuItem,{text:"Style",children:(0,u.jsx)(w.NodeStyleMenu,{style:ue,onChange:Qe,promptFn:pe})}),e.map(((e,t)=>(0,a.createElement)(x.MenuItem,{...e,key:t})))]})}),[Be,Ue,M,He,Fe,qe,Ge,ue,Qe,pe,Se,ce,q,De,de,B,Z,J,Y]),et={"--node-color":ue.color,...ue.cssOverride||{}},tt=(0,y.getInstanceDomId)(M.id,e.ancestorsInsIds);return(0,u.jsx)("div",{className:Re,children:(0,u.jsx)(g.BaseNodeView,{pos:M.pos,viewPort:k,onDragStart:ge,onDragMove:ye,onDragEnd:Ie,upperRenderer:Ye,bottomRenderer:Ke,displayMode:D,domId:tt,children:(0,u.jsxs)(l.Fragment,{children:[Ye(),W?_.default.createPortal((0,u.jsxs)("div",{className:"inline-group-editor-container no-drag",children:[(0,u.jsxs)("header",{children:[Le," ",(0,u.jsx)("button",{onClick:e.onCloseInlineEditor,children:"close"})]}),(0,u.jsx)(b.VisualNodeEditor,{...e.inlineGroupProps,className:"no-drag",ref:ae})]}),Q):(0,u.jsx)(x.ContextMenu,{className:(0,p.default)("ins-view-inner",Ae,`size-${re.size}`,{dark:ie}),onClick:we,onDoubleClick:Ne,content:Xe(),style:et,children:(0,u.jsx)(x.Tooltip,{content:R.description,children:(0,u.jsxs)(l.Fragment,{children:[ue.icon?(0,u.jsx)(c.FontAwesomeIcon,{icon:ue.icon}):null," ",Le]})})}),Ke()]})})})}},53568:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStyleMenu=t.nodeStylePresetColors=void 0;const r=n(35250),a=n(50382),u=s(n(70079)),l=n(84472);t.nodeStylePresetColors=[{name:"Amethyst",color:"#9b5de5"},{name:"Magenta",color:"#f15bb5"},{name:"Yellow",color:"#fee440"},{name:"Capri",color:"#00bbf9"},{name:"Sea Green",color:"#00f5d4"},{name:"Orange",color:"#ff7f00"}];const c={size:"regular"};t.NodeStyleMenu=e=>{var n;const{onChange:o,style:i}=e,s=i||c,d=e.promptFn,p=u.default.useCallback(((e,t)=>{o({...s,[e]:t})}),[s,o]),f=u.default.useCallback((async()=>{const e=await d("Icon name? (Font Awesome conventions)","rocket"),t=e.includes(",")?e.split(","):e;p("icon",t)}),[d,p]),m=(0,u.useCallback)((async()=>{const e=await d("Enter a custom style (valid JSON representing a React CSS object)",s.cssOverride?JSON.stringify(s.cssOverride):"");try{const t=JSON.parse(e);p("cssOverride",t)}catch(t){console.error(t),(0,l.toastMsg)("Invalid object","danger")}}),[d,p,s.cssOverride]);return(0,r.jsxs)(u.default.Fragment,{children:[(0,r.jsxs)(a.MenuItem,{text:"Color",children:[t.nodeStylePresetColors.map((e=>(0,r.jsx)(a.MenuItem,{text:e.name,onClick:()=>p("color",e.color)},e.name))),(0,r.jsx)(a.MenuDivider,{}),(0,r.jsx)(a.MenuItem,{text:"Remove Color",onClick:()=>p("color",void 0)})]}),(0,r.jsxs)(a.MenuItem,{text:`Size (${null!==(n=s.size)&&void 0!==n?n:"regular"})`,children:[(0,r.jsx)(a.MenuItem,{text:"Small",onClick:()=>p("size","small")}),(0,r.jsx)(a.MenuItem,{text:"Regular",onClick:()=>p("size","regular")}),(0,r.jsx)(a.MenuItem,{text:"Large",onClick:()=>p("size","large")})]}),(0,r.jsxs)(a.MenuItem,{text:"Icon",children:[(0,r.jsx)(a.MenuItem,{text:"Choose Icon",onClick:f}),(0,r.jsx)(a.MenuItem,{text:"Remove Icon",onClick:()=>p("icon",void 0)})]}),(0,r.jsx)(a.MenuItem,{text:"Custom Styling",onClick:m})]})}},88593:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(53568),t)},83651:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86553),t)},53159:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calcInstancePosition=t.calcNodeWidth=t.calcNodeContent=void 0;const i=n(74762),s=o(n(6576)),r=n(86553),a=n(61888),u=n(30994);t.calcNodeContent=(e,t)=>{if(e.displayName)return e.displayName;if(t.customViewCode)try{const n=Object.entries(e.inputConfig).filter((e=>{let[,t]=e;return(0,i.isStaticInputPinConfig)(t)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o.value}}),{});return s.default.compile(t.customViewCode)({inputs:n}).trim()}catch(n){return console.error("Error with custom view",n),`Error in custom view [${t.id}]`}return t.id};t.calcNodeWidth=(e,n)=>{const o=(0,i.okeys)(n.inputs).length*r.MIN_WIDTH_PER_PIN,s=(0,t.calcNodeContent)(e,n),u=r.PIECE_CHAR_WIDTH;return(0,a.clamp)(s.length*u+2*r.PIECE_HORIZONTAL_PADDING,o,r.MAX_INSTANCE_WIDTH)};t.calcInstancePosition=(e,t,n)=>{const o=(0,u.getInstanceDomId)(e,t),i=document.getElementById(o);if(i){const{x:e,y:t,width:o,height:s}=i.getBoundingClientRect(),r=t+s/2;return{x:e+o/2-n.x,y:r-n.y}}return console.warn("Cannot find element to draw connection to",o),{x:99999,y:99999}}},17841:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutDebugger=t.LayoutDebuggerItem=t.PosDebugger=void 0;const i=n(70079),s=n(35250),r=n(74762),a=o(n(70079)),u=n(7047),l=e=>{let{pos:t}=e;return(0,s.jsxs)("span",{children:[t.x.toFixed(1),", ",t.y.toFixed(1)]})};t.PosDebugger=e=>(0,s.jsx)("span",{className:"pos-debugger",children:(0,s.jsx)(l,{pos:e.pos})});t.LayoutDebuggerItem=e=>{const{pos:n,viewPort:o,size:i,color:r}=e,a=o.zoom,u=n.x*a-o.pos.x*a,l=n.y*a-o.pos.y*a,c={transform:`translate(${u-n.x}px, ${l-n.y}px)`},d={transform:`scale(${o.zoom})`},p={transform:`translate(${n.x}px, ${n.y}px)`},f={width:`${i.width}px`,height:`${i.height}px`,backgroundColor:r};return(0,s.jsx)("div",{className:"layout-debugger",style:c,children:(0,s.jsxs)("span",{className:"drag-sim",style:p,children:[(0,s.jsx)(t.PosDebugger,{pos:n}),(0,s.jsx)("div",{className:"layout-debugger-zoom-wrapper",style:d,children:(0,s.jsx)("div",{className:"layout-debugger-inner",style:f})})]})})};const c=(()=>{try{return"true"===localStorage.getItem("pos-debugger")}catch(e){return!1}})();t.LayoutDebugger=e=>{const{extraDebug:n,vp:o,node:d,mousePos:p}=e;if(!c)return null;const f=n.map(((e,n)=>(0,i.createElement)(t.LayoutDebuggerItem,{...e,key:n}))),m=[...d.instances.map((e=>e.pos)),...(0,r.values)(d.inputsPosition),...(0,r.values)(d.outputsPosition)].map((e=>(0,s.jsx)(t.LayoutDebuggerItem,{pos:e,viewPort:o,size:{width:0,height:0},color:"red"}))),h=(0,u.logicalPosToRenderedPos)(p,o),v=(0,s.jsxs)("div",{className:"viewport-data",children:[(0,s.jsxs)("div",{children:["Pos: ",(0,s.jsx)(l,{pos:o.pos})]}),(0,s.jsxs)("div",{children:["Zoom: ",o.zoom.toFixed(2)," "]}),(0,s.jsxs)("div",{children:["Mouse (logical): ",(0,s.jsx)(l,{pos:p})]}),(0,s.jsxs)("div",{children:["Rendered (rendered): ",(0,s.jsx)(l,{pos:h})]})]});return(0,s.jsxs)(a.default.Fragment,{children:[v,f,m]})}},44338:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(17841),t)},38259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateInstancesWithSingleConstPinsMap=t.getLeafInstancesOfSelection=void 0;t.getLeafInstancesOfSelection=(e,t,n)=>e.reduce(((e,o)=>[...e,...n.filter((e=>e.to.insId===o.id)).map((e=>t.find((t=>t.id===e.from.insId)))).filter((e=>!!e))]),[]).filter((t=>1===n.filter((e=>e.from.insId===t.id||e.to.insId===t.id)).length&&!e.includes(t)));t.calculateInstancesWithSingleConstPinsMap=(e,t)=>{const{connections:n}=e;return n.filter((e=>t.has(e.from.insId))).reduce(((e,n)=>{const o=t.get(n.from.insId),i=n.to.insId,s=e.get(i)||new Map;return s.set(n.to.pinId,{val:o,insId:n.from.insId}),e.set(i,s),e}),new Map)}},37488:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeIoView=void 0;const a=n(35250),u=n(70079),l=s(n(70079)),c=n(74762),d=n(83234),p=r(n(26372)),f=n(50382),m=n(43490),h=n(66189),v=n(74762),g=n(30994),I=n(30653);t.NodeIoView=l.memo((function(e){const{viewPort:t,selected:n,pos:o,type:i,id:s,onDblClick:r,onRename:y,onDelete:b,onChangeInputMode:C,inputMode:x,onSelect:_,closest:w,onSetDescription:N,description:j,onMouseUp:P,onMouseDown:O,currentInsId:E}=e,{history:S,resetHistory:D,refreshHistory:T}=(0,h.useHistoryHelpers)(E,s,i),M=(0,m.usePrompt)(),k=l.useCallback((async()=>{const e=await M("Description?",j);N(i,s,e)}),[M,j,N,i,s]),R=l.useCallback((()=>{b&&b(i,s)}),[i,s,b]),A=l.useCallback((()=>{y&&y(i,s)}),[i,s,y]),V=l.useCallback((e=>{C&&C(s,e)}),[s,C]),$=l.useCallback((()=>[{text:`Current mode - ${x}`,onClick:c.noop},{text:"Make required",onClick:()=>V("required")},{text:"Make optional",onClick:()=>V("optional")},{text:"Make required-if-connected",onClick:()=>V("required-if-connected")},{text:"Set description",onClick:k},...e.onRename?[{text:"Rename",onClick:A}]:[],...e.onDelete?[{text:"Delete",onClick:R}]:[]]),[k,x,V,R,A,e.onDelete,e.onRename]),L=l.useCallback((t=>{r&&r(e.id,t)}),[r,e.id]),z=l.useCallback((()=>{_(s,i)}),[s,i,_]),H=l.useCallback((()=>(0,a.jsx)(f.Menu,{children:$().map(((e,t)=>(0,u.createElement)(f.MenuItem,{...e,key:t})))})),[$]),F="input"===i?(0,v.getInputName)(s):(0,c.getOutputName)(s),G=l.useCallback((e=>{P(s,i,e)}),[s,P,i]),q=l.useCallback((e=>{O(s,i,e)}),[s,O,i]),B=(0,I.useDarkMode)();return(0,a.jsx)(d.BaseNodeView,{className:(0,p.default)("node-io-view",i,{dark:B}),pos:o,onDragEnd:(n,o)=>{const r=e.pos,a=(o.x-r.x)/t.zoom,u=(o.y-r.y)/t.zoom,l=r.x+a,c=r.y+u;e.onDragEnd(i,s,n,{...o,x:l,y:c})},onDragStart:(t,n)=>{e.onDragStart(s,t,n)},onDragMove:(t,n)=>{e.onDragMove(i,s,t,{x:n.x,y:n.y})},viewPort:t,children:(0,a.jsx)(l.Fragment,{children:(0,a.jsx)(f.Tooltip,{content:(()=>{const t=(0,h.calcHistoryContent)(S),n=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:F})," (",i,")"," "]}),n,(0,a.jsx)("hr",{}),t]})})(),children:(0,a.jsx)(f.ContextMenu,{onMouseEnter:T,onMouseOut:D,onMouseUp:G,onMouseDown:q,"data-tip":"","data-html":!0,"data-for":s+e.currentInsId,className:(0,p.default)("node-io-view-inner",{closest:w,selected:n,dark:B}),id:(0,g.getPinDomId)({fullInsIdPath:(0,c.fullInsIdPath)(e.currentInsId,e.ancestorInsIds),pinId:s,pinType:i,isMain:!0}),onClick:z,onDoubleClick:L,content:H(),children:s})})})})}))},66005:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37488),t)},83782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcNodeIoWidth=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0,t.PIECE_HORIZONTAL_PADDING=15,t.PIECE_CHAR_WIDTH=9,t.MIN_WIDTH_PER_PIN=40;t.calcNodeIoWidth=e=>Math.max(t.MIN_WIDTH_PER_PIN,e.length*t.PIECE_CHAR_WIDTH+2*t.PIECE_HORIZONTAL_PADDING)},99942:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderVisualNode=t.layoutToInstances=void 0;const i=n(63521),s=n(74762),r=n(90794),a=o(n(53865)),u=n(83782),l=n(60190),c=n(53159),d=n(41032);t.layoutToInstances=(e,t)=>(0,a.default)(t,(t=>{(0,s.entries)(e.nodes).forEach((e=>{let[n,o]=e;if(n.startsWith("ins-")){const e=n.replace("ins-",""),i=t.instances.find((t=>t.id===e));i?i.pos=o.p:console.warn("WAT")}if(n.startsWith("node-input-")){const e=n.replace("node-input-","");t.inputsPosition[e]=o.p}if(n.startsWith("node-output-")){const e=n.replace("node-output-","");t.outputsPosition[e]=o.p}}))}));t.orderVisualNode=(e,n,o,a)=>{const{instances:p,connections:f}=e,m={...p.reduce(((e,t)=>{const o=(0,l.size)((0,c.calcNodeWidth)(t,(0,d.safelyGetNodeDef)(t,n)),i.NODE_HEIGHT);return{...e,[`ins-${t.id}`]:{p:t.pos,s:o}}}),{}),...(0,s.okeys)(e.inputsPosition).reduce(((t,n)=>({...t,[`node-input-${n}`]:{p:e.inputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{}),...(0,s.okeys)(e.outputsPosition).reduce(((t,n)=>({...t,[`node-output-${n}`]:{p:e.outputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{})},h=f.map((e=>[(0,s.isExternalConnectionNode)(e.from)?`node-input-${e.from.pinId}`:`ins-${e.from.insId}`,(0,s.isExternalConnectionNode)(e.to)?`node-output-${e.to.pinId}`:`ins-${e.to.insId}`])),v=(0,r.orderLayout)({nodes:m,edges:h},o,((n,o)=>{a&&a((0,t.layoutToInstances)(n,e),o)}));return(0,t.layoutToInstances)(v,e)}},90794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderLayout=void 0;const o=n(60190),i=400,s=e=>e.reduce(((e,t)=>{const n=(0,o.vSub)(t.p,(0,o.vec)(t.s.width/2,t.s.height/2));return{...e,[t.id]:{p:n,s:t.s}}}),{});t.orderLayout=(e,t,n)=>{let{nodes:r,edges:a}=e,u=Object.entries(r).map((e=>{let[t,n]=e;return{id:t,p:(0,o.vAdd)(n.p,(0,o.vec)(n.s.width/2,n.s.height/2)),f:(0,o.vec)(0,0),v:(0,o.vec)(0,0),m:1,s:n.s}})),l=0;for(;l.01);){let e=u;for(let t=0;t{let n=e.find((e=>e.id===t[0])),i=e.find((e=>e.id===t[1]));if(!n||!i)return void console.warn("weoops",t[0],t[1]);const s=(0,o.vec)(0,-200),r=(0,o.vSub)(n.p,i.p),a=(0,o.vSub)(s,r),u=1e3*(0,o.vLen)(a),l=(0,o.vMul)((0,o.vNorm)(a),.5*u),c=(0,o.vMul)((0,o.vNorm)(a),-.5*u);n.f=(0,o.vAdd)(n.f,l),i.f=(0,o.vAdd)(i.f,c)})),e=e.map((e=>(0,o.itrPhysics)(15,e))),e=e.map((e=>{const t=(0,o.vMul)(e.v,.5),n=(0,o.vLen)(t)>100?(0,o.vMul)((0,o.vNorm)(t),100):t;return{...e,v:n}})),u=e,n&&n({nodes:s(e),edges:a},l),l++}return{nodes:s(u),edges:a,itrs:l,timeout:l>=t,total:(0,o.totalEnergy)(u)}}},2036:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PinView=t.PIN_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=n(50382),d=n(18420),p=n(74762),f=n(30994),m=n(96233),h=n(66189),v=n(30653);t.PIN_HEIGHT=23;t.PinView=u.memo((function(e){const{selected:t,type:n,connected:o,optional:i,currentInsId:s,isClosestToMouse:r,id:g,onMouseDown:I,onMouseUp:y}=e,{history:b,resetHistory:C,refreshHistory:x}=(0,h.useHistoryHelpers)(s,g,n),_=(0,v.useDarkMode)(),w="input"===n?(0,p.getInputName)(g):(0,p.getOutputName)(g),N="input"===e.type&&(0,d.isDefined)(e.constValue)?e.constValue:void 0,j=u.useCallback((e=>{0===e.button&&I(g,n,e)}),[g,n,I]),P=u.useCallback((e=>{0===e.button&&y(g,n,e)}),[g,n,y]);return(0,a.jsxs)("div",{className:(()=>{if("input"===e.type){const{isSticky:s,constValue:a}=e;return(0,l.default)("pin",{sticky:s,selected:t,closest:r,optional:i,connected:o,"const-value":(0,d.isDefined)(a),"env-value":(0,d.isDefined)(a)&&(0,p.isEnvValue)(a),minimized:e.minimized,dark:_},n)}return(0,l.default)("pin",{selected:t,connected:o,closest:r,optional:i,minimized:e.minimized,"error-pin":g===p.ERROR_PIN_ID,dark:_},n)})(),"data-pin-id":g,children:[(0,a.jsx)(c.Tooltip,{className:"pin-info-tooltip",content:(()=>{const t=(0,h.calcHistoryContent)(b,"input"===n?e.queuedValues:void 0),o=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:w})," (",n,")"," "]}),o,(0,a.jsx)("hr",{}),(0,d.isDefined)(N)?(0,a.jsxs)("div",{children:["Static value:"," ",(0,a.jsx)("strong",{children:(0,m.valuePreview)(N).substring(0,200)})]}):t]})})(),children:(0,a.jsxs)(c.ContextMenu,{onMouseEnter:x,onMouseOut:C,onMouseDown:j,onMouseUp:P,"data-tip":"","data-html":!0,"data-for":g+e.currentInsId,id:(0,f.getPinDomId)({fullInsIdPath:(0,p.fullInsIdPath)(e.currentInsId,e.ancestorsInsIds),pinId:g,pinType:n,isMain:!1}),onDoubleClick:t=>e.onDoubleClick&&e.onDoubleClick(g,t),className:(0,l.default)("pin-inner",{dark:_}),onClick:t=>{const{onShiftClick:o,onClick:i,id:s}=e;t.shiftKey&&o?o(s,t):i(s,n,t)},content:(()=>{const t=(0,a.jsx)(c.MenuItem,{onClick:()=>e.onInspect(e.currentInsId,{id:e.id,type:e.type}),text:"Inspect"});if("input"===e.type){const{onConvertConstToEnv:n}=e;return(0,d.isDefined)(N)?(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onDetachConstValue(e.id),text:"Detach value"}),(0,a.jsx)(c.MenuItem,{onClick:()=>e.onCopyConstValue(e.id),text:"Copy value"}),(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null,n?(0,a.jsx)(c.MenuItem,{onClick:()=>n(e.id),text:"Convert to Env Var"}):null]}):(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onToggleSticky(e.id),text:"Toggle sticky (square means sticky)"}),t,(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null]})}return(0,a.jsx)(c.Menu,{children:t})})(),children:[w," ",(0,d.isDefined)(N)?(0,a.jsxs)(u.Fragment,{children:[":",(0,a.jsx)("span",{className:"value",children:(0,d.toString)(N)})]}):null,"input"===e.type&&e.isSticky?(0,a.jsx)("span",{className:"suffix",children:"s"}):null,"input"===e.type&&e.queueSize?(0,a.jsxs)("span",{className:"suffix",children:[e.queueSize," in Q"]}):null]})}),(0,a.jsx)("div",{className:"wire"})]})}))},66189:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHistoryHelpers=t.calcHistoryContent=void 0;const i=n(35250),s=n(96233),r=o(n(70079)),a=n(70079),u=n(98158);t.calcHistoryContent=(e,t)=>{if(e){const{total:n,lastSamples:o}=e,a=(0,i.jsxs)("strong",{children:["Activated ",n," times this session"]}),u=o.length>0?(0,i.jsxs)("div",{children:["Last value:"," ",(0,i.jsx)("strong",{children:(0,s.valuePreview)(o[0].val).substring(0,200)}),(0,i.jsx)("br",{}),(0,i.jsx)("em",{children:"Inspect instance for the full value"})]}):"",l=t?(0,i.jsx)(r.default.Fragment,{children:(0,i.jsxs)("div",{children:["Queued values: ",(0,i.jsx)("strong",{children:t})]})}):"";return(0,i.jsxs)(r.default.Fragment,{children:[a,u,l]})}return"Loading session data.."};t.useHistoryHelpers=(e,t,n)=>{const o=(0,a.useRef)(),{onRequestHistory:i}=(0,u.useDebuggerContext)(),[s,l]=(0,a.useState)();return{history:s,refreshHistory:(0,a.useCallback)((()=>{clearInterval(o.current),i(e,t,n).then((e=>{l(e)})),o.current=setInterval((()=>{i(e,t,n).then((e=>{l(e)}))}),500)}),[e,i,t,n]),resetHistory:r.default.useCallback((()=>{clearInterval(o.current),l(void 0)}),[])}}},89440:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAddMenu=void 0;const r=n(35250),a=s(n(70079)),u=n(74762),l=n(50382),c=n(70457),d=n(9958),p=n(86125),f=c.Select.ofType(),m=e=>{switch(e.type){case"node":return`${e.node.id}`;case"value":return"Add inline value or function";case"import":return`Import ${e.importableNode.node.id} from ${e.importableNode.module}`}},h=(e,t)=>{let{handleClick:n,modifiers:o,query:i}=t;if(!o.matchesPredicate)return null;const s=m(e);return"value"===e.type?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(l.MenuDivider,{}),(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))]}):(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))},v=(e,t,n,o)=>{const i=m(t).toLocaleLowerCase(),s=e.toLowerCase();return o?i===s:i.includes(s)};t.QuickAddMenu=e=>{const{resolvedDependencies:t,targetNode:n}=e,o={left:e.pos.x,top:e.pos.y},{onRequestImportables:i}=(0,p.useDependenciesContext)(),[s,c]=a.useState();a.useEffect((()=>{i().then((e=>c(e.importables)))}),[i]);const d=(0,u.values)({...t,[n.id]:n}),m=d.map((e=>({type:"node",node:e}))),g=new Set(d.map((e=>e.id))),I=s?s.filter((e=>!g.has(e.node.id))).map((e=>({type:"import",importableNode:e}))):[],y=m.concat(I).concat({type:"value"});return(0,r.jsx)("div",{className:"quick-add-menu",style:o,children:(0,r.jsx)(f,{className:"quick-add-nodes-select",items:y,itemPredicate:v,itemRenderer:h,inputProps:{className:"quick-add-input"},noResults:(0,r.jsx)(l.MenuItem,{disabled:!0,text:"No results."}),onItemSelect:t=>e.onAdd(t),popoverProps:{isOpen:!0,onClose:()=>e.onClose()}})})}},71033:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89440),t)},73470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimePlayer=void 0;const o=n(74762),i=n(64955),s=(0,o.debugLogger)("runtime-player");t.createRuntimePlayer=()=>{let e=0,t=[];let n=!1,r=Date.now(),a=e;const u=()=>requestAnimationFrame((()=>{const l=Date.now();a=e,e+=l-r,r=l,((e,n)=>{const r=t;t=[],r.length&&s(`Playing ${r.length} events from`,e,n),r.forEach((e=>{s("Playing event",e),(0,i.playEvent)(e),e.insId===o.ROOT_INS_ID&&e.type===o.DebuggerEventType.PROCESSING_CHANGE&&!1===e.val&&(s("Main instance is done processing, clearing runtime UI",e),c())}))})(a,e),n&&u()})),l=()=>{n=!1},c=()=>{document.querySelectorAll("[data-runtime]").forEach((e=>{e.removeAttribute("data-runtime")})),document.querySelectorAll("[data-runtime-queue]").forEach((e=>{e.removeAttribute("data-runtime-queue")})),t=[]};return{stop:l,start:function(t){void 0===t&&(t=0),n=!0,e=t,r=Date.now(),u()},addEvents:e=>{t.push(...e)},destroy:()=>{l(),c()},clear:c,status:()=>({running:n,currDt:e,lastDt:a,queue:t,last:r})}}},64955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playEvent=t.cancelTimers=void 0;const o=n(74762),i=n(30994),s=5e3,r=(0,o.debugLogger)("runtime-player:play-event"),a=(e,t)=>e.type===o.DebuggerEventType.INPUT_CHANGE||e.type===o.DebuggerEventType.OUTPUT_CHANGE?`${(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds)}.${e.pinId}`:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds);t.cancelTimers=new Map;t.playEvent=e=>{switch(e.type){case o.DebuggerEventType.INPUT_CHANGE:case o.DebuggerEventType.OUTPUT_CHANGE:{const{pinId:n,insId:u,ancestorsInsIds:l}=e,c=e.type===o.DebuggerEventType.INPUT_CHANGE?"input":"output",d=[(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!0})];u!==o.ROOT_INS_ID&&d.push((0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!1})),d.forEach(((i,l)=>{const c=a(e);clearTimeout(t.cancelTimers.get(c));const d=document.getElementById(i),p=`${u}.${n}`,f=e.type===o.DebuggerEventType.OUTPUT_CHANGE?document.querySelectorAll(`[data-from-id="${p}"]`):[];if(d){clearTimeout(t.cancelTimers.get(c)),d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),setTimeout((()=>{d.setAttribute("data-runtime","active"),f.forEach((e=>{e.setAttribute("data-runtime","active")}))}),0);const n=setTimeout((()=>{d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),t.cancelTimers.delete(c)}),s);t.cancelTimers.set(a(e),n)}else console.warn(`No DOM element with Id [${i}] found to play event`),r(`No DOM element with Id [${i}] found to play event`,e)}));break}case o.DebuggerEventType.PROCESSING_CHANGE:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(l)if(!0===e.val)l.setAttribute("data-runtime","processing"),clearTimeout(t.cancelTimers.get(u));else{l.removeAttribute("data-runtime"),setTimeout((()=>{"error"!==l.getAttribute("data-runtime")&&l.setAttribute("data-runtime","done")}),0);const e=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,e)}else r(`No DOM element with Id [${n}] found to play event`,e)}));break}case o.DebuggerEventType.ERROR:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(!l)return void r(`No DOM element with Id [${n}] found to play event`,e);clearTimeout(t.cancelTimers.get(u)),l.removeAttribute("data-runtime"),setTimeout((()=>{l.setAttribute("data-runtime","error")}));const c=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,c)}));const c={...e,type:o.DebuggerEventType.OUTPUT_CHANGE,pinId:o.ERROR_PIN_ID};(0,t.playEvent)(c);break}case o.DebuggerEventType.INPUTS_STATE_CHANGE:(0,o.entries)(e.val).forEach((t=>{let[n,s]=t;const{insId:a,ancestorsInsIds:u}=e,l=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(a,u),pinId:n,pinType:"input",isMain:!1}),c=document.getElementById(l);c?s>0?c.setAttribute("data-runtime-queue",`${s}`):c.removeAttribute("data-runtime-queue"):r(`No DOM element with Id [${l}] found to play event`,e)}))}}},25804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounce=void 0;const o=n(70079);t.useDebounce=function(e,t){const[n,i]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}},7047:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.handleChangeNodeInputType=t.handleIoPinRename=t.handleInstanceDrag=t.getInstancesInRect=t.isJsxValue=t.getMiddleOfViewPort=t.fitViewPortToNode=t.centerBoardPosOnTarget=t.renderedPosToLogicalPos=t.logicalPosToRenderedPos=t.getEffectiveNodeDimensions=t.calcNodesPositions=t.calcSelectionBoxArea=t.animateViewPort=t.easeInOutNum=t.easeInOutPos=t.easeInOutQuad=t.center=t.distance=t.clamp=t.domToViewPort=t.roundNumber=t.createNewNodeInstance=t.createNewInlineNodeInstance=t.parseInputOutputTypes=t.parsePromptValue=t.getSelectionBoxRect=t.findClosestPin=t.changePinConfig=t.getInstancePinConfig=t.emptyList=t.emptyObj=void 0;const r=s(n(53865)),a=n(30721),u=n(63521),l=n(74762),c=n(18243),d=n(74762),p=n(53159),f=n(83782),m=n(60190),h=n(38259),v=n(83651),g=n(41032);t.emptyObj={},t.emptyList=[],t.getInstancePinConfig=function(e,n,o){var i;const s=e.instances.find((e=>e.id===n));if(!s)throw new Error(`Instance ${n} not found`);return null!==(i=(s.inputConfig||t.emptyObj)[o])&&void 0!==i?i:(0,l.queueInputPinConfig)()};t.changePinConfig=(e,t,n,o)=>r.produce(e,(e=>{var i;const{instances:s}=e,r=s.find((e=>e.id===t));if(!r)throw new Error("blah");const a=null!==(i=r.inputConfig)&&void 0!==i?i:{};a[n]=o,e.instances=s.map((e=>e===r?{...r,inputConfig:a}:e))}));t.findClosestPin=(e,t,n,o,i,s,r)=>{const a=(0,l.nodeInstance)(e.id,e.id),u=(0,d.okeys)(e.inputs).map((e=>({id:e,type:"input",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),p=(0,d.okeys)(e.outputs).map((e=>({id:e,type:"output",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),f=[...u,...e.instances.reduce(((n,a)=>{const u=(0,g.safelyGetNodeDef)(a,t),d=(0,v.getVisibleInputs)(a,u,e.connections),p=(0,v.getVisibleOutputs)(a,u,e.connections);return[...n,...d.map((e=>({ins:a,type:"input",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!1}),id:e}))),...p.map((e=>({ins:a,type:"output",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!1}),id:e})))]}),[]),...p];let m={dis:1e5,item:f[0]};return f.forEach((e=>{const t=e.pos.x-n.x,o=e.pos.y-n.y,i=Math.sqrt(t*t+o*o);i{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x,t.x)-n,h:Math.max(e.y,t.y)-o}};t.parsePromptValue=e=>{if(null===e)return;const t=parseInt(e,10);let n=e;return t.toString()!=e||isNaN(t)||(n=t),n};t.parseInputOutputTypes=e=>{const[,t,n]=e.match(/node\((.+)\|(.+)\)/)||[],o=(0,d.entries)(JSON.parse(t)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]})),i=(0,d.entries)(JSON.parse(n)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]}));return{inputs:(0,d.fromEntries)(o),outputs:(0,d.fromEntries)(i)}};t.createNewInlineNodeInstance=function(e,t,n){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const o=(0,l.inlineNodeInstance)(`${e.id}-${(0,d.randomInt)(999)}`,e,{},{x:0,y:0}),i=(0,p.calcNodeWidth)(o,e),{x:s,y:r}=n,a={x:s-i/2,y:r+t};return{...o,pos:a}};t.createNewNodeInstance=function(e,t,n,o){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const i="string"==typeof e?(0,g.safelyGetNodeDef)(e,o):e;if(!i)throw new Error(`${e} node not found in resolvedNodes`);const s=(0,d.entries)(i.inputs).reduce(((e,t)=>{let[n,o]=t;return o.defaultValue&&(e[n]=(0,l.staticInputPinConfig)(o.defaultValue)),e}),{}),r=(0,l.nodeInstance)((0,a.createId)(),i.id,s,{x:0,y:0}),c=(0,p.calcNodeWidth)(r,i),{x:f,y:m}=n,h={x:f-c/2,y:m+t};return{...r,pos:h}};t.roundNumber=e=>Math.round(100*e)/100;t.domToViewPort=(e,n,o)=>({x:(0,t.roundNumber)(n.pos.x+e.x/n.zoom/o.zoom),y:(0,t.roundNumber)(n.pos.y+e.y/n.zoom/o.zoom)});t.clamp=(e,t,n)=>Math.max(e,Math.min(t,n));t.distance=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)};t.center=(e,t,n)=>{let{zoom:o}=n;const i=e.x+e.w/2,s=e.y+e.h/2,{w:r,h:a}=t;return{x:i-r/o/2,y:s-a/o/2}};t.easeInOutQuad=e=>e<.5?2*e*e:(4-2*e)*e-1;t.easeInOutPos=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i),a=(0,t.easeInOutQuad)(r),u=n.x-e.x,l=n.y-e.y;return{x:e.x+u*a,y:e.y+l*a}};t.easeInOutNum=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i);return e+(n-e)*(0,t.easeInOutQuad)(r)};t.animateViewPort=(e,n,o,i)=>{const s=(0,t.distance)(e.pos,n.pos),r=Date.now(),a=o;if(0===s)return void i(e);const u=()=>{const o=Date.now(),s=(0,t.easeInOutPos)(e.pos,n.pos,r,a,o),l=(0,t.easeInOutNum)(e.zoom,n.zoom,r,a,o);o-r{const n=(0,t.getSelectionBoxRect)(e.from,e.to);return n.h*n.w};const I=(e,t,n,o)=>({left:n.x,right:n.x+e,top:n.y,bottom:n.y+t,tag:o,center:(0,l.calcCenter)({w:e,h:t,...n})});t.calcNodesPositions=(e,t)=>[...e.instances.map((e=>{const n=(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,t)),o=u.NODE_HEIGHT;return I(n,o,e.pos,e.id)})),...(0,d.okeys)(e.inputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.inputsPosition[t]||{x:0,y:0};return I(n,o,i,"input_"+t)})),...(0,d.okeys)(e.outputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.outputsPosition[t]||{x:0,y:0};return I(n,o,i,"output"+t)}))];t.getEffectiveNodeDimensions=(e,n)=>{const o=(0,t.calcNodesPositions)(e,n),i=o[0]||{left:0,right:0,top:0,bottom:0},s=o.reduce(((e,t)=>t.leftt.right>e?t.right:e),i.right),a=o.reduce(((e,t)=>t.topt.bottom>e?t.bottom:e),i.bottom)-a,d={x:s,y:a};return{size:{width:u,height:c},pos:d,center:(0,l.calcCenter)({w:u,h:c,...d})}};t.logicalPosToRenderedPos=(e,t)=>{const n=(0,m.vSub)(e,t.pos);return(0,m.vMul)(n,t.zoom)};t.renderedPosToLogicalPos=(e,t)=>{const n=(0,m.vDiv)(e,t.zoom);return(0,m.vAdd)(t.pos,n)};t.centerBoardPosOnTarget=(e,n,o,i)=>{const s=(0,t.logicalPosToRenderedPos)(e,i),r=(0,t.renderedPosToLogicalPos)(s,{...i,zoom:o}),a=Math.max(e.x,r.x)-Math.min(e.x,r.x),u=Math.max(e.y,r.y)-Math.min(e.y,r.y);return{x:o>i.zoom?i.pos.x+a:i.pos.x-a,y:o>i.zoom?i.pos.y+u:i.pos.y-u}};t.fitViewPortToNode=function(e,n,o,i){void 0===i&&(i=[20,150]);const{size:s,center:r}=(0,t.getEffectiveNodeDimensions)(e,n),a=i[0],u=i[1],l=s.width+a,c=s.height+u,d=o.width/l,p=o.height/c,f=Math.min(d,p)/1.15,m=(0,t.clamp)(.3,1.2,f);return{zoom:m,pos:{x:r.x-o.width/2/m,y:r.y-o.height/2/m+20}}};t.getMiddleOfViewPort=(e,n)=>{const o={x:n.width/2,y:n.height/2};return(0,t.renderedPosToLogicalPos)(o,e)};t.isJsxValue=e=>{const t=e=>(0,d.isDefined)(e.ref)&&(0,d.isDefined)(e.type)&&(0,d.isDefined)(e.props);try{const n=JSON.parse(e);return t(n)||Array.isArray(n)&&t(n[0])}catch(n){return!1}};t.getInstancesInRect=(e,n,o,i,s,r,a)=>{const{from:c,to:d}=e,f=(0,t.getSelectionBoxRect)(c,d);return s.filter((e=>{const{pos:t}=e,i={...t,w:(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,n))*o.zoom*a.zoom,h:u.NODE_HEIGHT*o.zoom*a.zoom};return(0,l.intersectRect)(f,i)||(0,l.intersectRect)(i,f)})).map((e=>e.id))};t.handleInstanceDrag=(e,t,n,o,i,s)=>{o.preventDefault(),o.stopPropagation();const a=(0,m.vSub)(n,t.pos);let u;const l=r.produce(e,(e=>{const r=e.instances.find((e=>e.id===t.id));if(!r)throw new Error("impossible state dragging instance that does not exist");!o.shiftKey&&s&&(u=[s]);const l=e.instances.filter((e=>i.includes(e.id)&&e!==r)),c=[r,...l],d=(0,h.getLeafInstancesOfSelection)(c,e.instances,e.connections);[...l,...d].forEach((e=>{e.pos=(0,m.vAdd)(e.pos,a)})),r.pos=n,!o.shiftKey&&s&&(u=[s])}));return{newValue:l,newSelected:u}};t.handleIoPinRename=(e,t,n,o)=>r.produce(e,(e=>{"input"===t?(e.inputs[o]=e.inputs[n],e.inputsPosition[o]=e.inputsPosition[n],delete e.inputs[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===n?{...e,from:{...e.from,pinId:o}}:e))):(e.outputs[o]=e.outputs[n],e.outputsPosition[o]=e.outputsPosition[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===n?{...e,to:{...e.to,pinId:o}}:e)),e.completionOutputs=(e.completionOutputs||[]).map((e=>e.split("+").map((e=>e===n?o:n)).join("+"))),delete e.outputs[n])}));t.handleChangeNodeInputType=(e,t,n)=>r.produce(e,(e=>{const o=e.inputs[t];if(!o)throw new Error("Wat");o.mode=n}))},42403:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorClient=void 0;const i=n(74762),s=o(n(18706)),r=n(32048),a=n(31758),u=(0,i.debugLogger)("remote-debugger:editor-client");t.createEditorClient=(e,t)=>{const n=new URL(e),o=(0,r.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/editor`,timeout:3e4});return o.emit("join-room-editor",t),{emitChange:e=>{o.emit(a.DebuggerServerEventType.CHANGE_EVENT_NAME,e)},emitBreakpointsChange:e=>{o.emit(a.DebuggerServerEventType.UPDATE_BREAKPOINTS,e)},interceptInput:e=>{o.emit(a.DebuggerServerEventType.INPUT_VALUE_OVERRIDE,e)},interceptOutput:e=>{o.emit(a.DebuggerServerEventType.OUTPUT_VALUE_OVERRIDE,e)},onRuntimeReady:e=>(o.on(a.DebuggerServerEventType.RUNTIME_READY,e),()=>o.off(a.DebuggerServerEventType.RUNTIME_READY,e)),onChangeAwk:e=>(o.on(a.DebuggerServerEventType.CHANGE_AWK,e),()=>o.off(a.DebuggerServerEventType.CHANGE_AWK,e)),onChangeError:e=>(o.on(a.DebuggerServerEventType.CHANGE_ERROR,e),()=>o.off(a.DebuggerServerEventType.CHANGE_ERROR,e)),onIsAlive:e=>(o.on(a.DebuggerServerEventType.IS_ALIVE,e),()=>o.off(a.DebuggerServerEventType.IS_ALIVE,e)),emitInputValue:(e,t)=>{u(`Emitting push input value to ${e} %o`,t),o.emit(a.DebuggerServerEventType.PUSH_INPUT_VALUE,{pinId:e,value:t})},destroy:()=>{o.disconnect(),(0,a.enumToArray)(a.DebuggerServerEventType).forEach((e=>o.off(e)))},onDisconnect:e=>(o.on("disconnect",e),()=>o.off("disconnect",e)),debugInfo:()=>`Remote debugger for ${e}`,onBatchedEvents:e=>(o.on(a.DebuggerServerEventType.EVENTS_BATCH,e),()=>o.off(a.DebuggerServerEventType.EVENTS_BATCH,e)),requestState:()=>s.default.get(`${e}/state`).then((e=>e.data.state)),getHistory:n=>s.default.get(`${e}/history`,{params:{insId:n.insId,pinId:n.pinId,limit:n.limit,executionId:t}}).then((e=>e.data)),clearHistory:()=>s.default.delete(`${e}/history`).then((()=>{})),triggerNode:(t,n)=>s.default.post(`${e}/trigger`,{nodeId:t,inputs:n}).then((e=>e.data))}}},58066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeData=void 0;const o=n(74762),i=n(36783),s=(0,o.debugLogger)("remote-debugger:normalize-data");t.normalizeData=e=>{if(e instanceof Error)return(0,i.serializeError)(e);if("object"==typeof e&&null!==e){e={...e};const t=new WeakSet,n=e=>{if("bigint"==typeof e)return e.toString();if("object"!=typeof e||Array.isArray(e))return e;if(null===e)return e;if(t.has(e))return"[Circular]";try{t.add(e)}catch(o){s("Error adding to WeakSet","data:",e,"type:",typeof e,"error:",o)}if(Array.isArray(e))return e.map(n);if("object"==typeof e){const t={};for(const o in e)t[o]=n(e[o]);return t}return e};return n(e)}return e}},39641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimeClient=t.DEFAULT_DT_SCALE=void 0;const o=n(74762),i=n(32048),s=n(31758),r=n(58066),a=(0,o.debugLogger)("remote-debugger:runtime-client");t.DEFAULT_DT_SCALE=1;t.createRuntimeClient=(e,t)=>{const n=new URL(e),u=(0,i.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/runtime`,timeout:1e3,reconnectionAttempts:3});u.emit("join-room-runtime",t),u.on("connection",(e=>{e.join(t)}));let l=new Set;u.on(s.DebuggerServerEventType.UPDATE_BREAKPOINTS,(e=>{l=new Set(e)}));const c=(0,o.cappedArrayDebounce)((e=>{a(`Emitting debounced batched events - ${e.length}`),u.emit(s.DebuggerServerEventType.EVENTS_BATCH,e)}),100,200);return{onChange:e=>(u.on(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e),()=>u.off(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e)),onInput:e=>(u.on(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e),()=>u.off(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e)),emitEvent:e=>{a(`Emitting event ${e.type} change event of ${e.insId}`),e.val=(0,r.normalizeData)(e.val),c.addItem({...e,time:Date.now()})},emitRuntimeReady:()=>{u.emit(s.DebuggerServerEventType.RUNTIME_READY,{})},emitChangeAwk:()=>{u.emit(s.DebuggerServerEventType.CHANGE_AWK,{})},emitChangeError:e=>{u.emit(s.DebuggerServerEventType.CHANGE_ERROR,{error:e})},emitIsAlive:e=>{u.emit(s.DebuggerServerEventType.IS_ALIVE,{time:e})},destroy:async()=>{c.pendingItems()&&(c.flush(),await(0,o.delay)(100)),(0,s.enumToArray)(s.DebuggerServerEventType).forEach((e=>u.off(e))),u.disconnect()},onDisconnect:e=>(u.on("disconnect",e),()=>u.off("disconnect",e)),waitForConnection:()=>new Promise(((e,t)=>{u.connected?e():(u.on("connect_error",(e=>{t(`Socket connect error: ${e}`)})),u.on("connect",(()=>{e()})))}))}}},31758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerServerEventType=t.enumToArray=t.isNumber=t.isSimpleType=t.valuePreview=t.toString=void 0;const o=n(36783);t.toString=e=>{if("object"===typeof e){if(e instanceof Error)return JSON.stringify((0,o.serializeError)(e));try{return JSON.stringify(e).substr(0,250)}catch(t){return"Object (cannot stringify)"}}return`${e}`.substr(0,250)};t.valuePreview=e=>(0,t.toString)(e).substr(0,100);t.isSimpleType=e=>["number","string","boolean"].includes(typeof e);t.isNumber=e=>!1===isNaN(Number(e)),t.enumToArray=function(e){return Object.keys(e).filter(t.isNumber).map((t=>e[t]))},function(e){e.RUNTIME_READY="runtime-ready",e.CHANGE_EVENT_NAME="change",e.PUSH_INPUT_VALUE="push-input-value",e.CHANGE_AWK="live-change-awk",e.CHANGE_ERROR="live-change-error",e.IS_ALIVE="is-alive",e.UPDATE_BREAKPOINTS="update-breakpoints",e.INPUT_VALUE_OVERRIDE="input-value-override",e.OUTPUT_VALUE_OVERRIDE="output-value-override",e.INPUT_VALUE_CHANGE="input-value-changed",e.OUTPUT_VALUE_CHANGE="output-value-changed",e.PROCESSING_CHANGE="processing-changed",e.INPUTS_STATE_CHANGE="inputs-state-changed",e.NODE_ERROR="node-error",e.EVENTS_BATCH="events-batch"}(t.DebuggerServerEventType||(t.DebuggerServerEventType={}))},96233:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31758),t),i(n(42403),t),i(n(39641),t)},43920:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Equals=t.EqualsBoolean=t.Throttle=t.ThrottleError=t.Debounce=t.Interval=t.Delay=t.Switch4=t.Switch2=t.Switch3=t.EmitOnTrigger=t.BooleanSplit=t.Subscribe=t.Publish=t.RoundRobin4=t.RoundRobin2=t.RoundRobin3=t.LimitTimes=void 0;const o=n(11253),i="Control Flow";t.LimitTimes={id:"Limit Times",namespace:i,description:"Item will be emitted until the limit is reached",inputs:{item:{mode:"required",description:"The item to emit"},times:{mode:"required",description:"The number of times to emit the item"},reset:{mode:"optional",description:"Reset the counter"}},outputs:{ok:{}},reactiveInputs:["item","reset"],completionOutputs:[],run:function(e,t,n){const{state:o}=n,{item:i,times:s,reset:r}=e,{ok:a}=t;if(void 0!==r)return void o.set("val",0);let u=o.get("val")||0;u++,o.set("val",u),u>=s?n.onError(new Error(`Limit of ${s} reached`)):a.next(i)}},t.RoundRobin3={id:"Round Robin 3",namespace:i,description:"Item will be emitted to one of the three outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r}=t,a=o.get("curr")||0,u=(a+1)%3;[i,s,r][a].next(e.item),o.set("curr",u)}},t.RoundRobin2={namespace:i,id:"Round Robin 2",description:"Item will be emitted to one of the 2 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s}=t,r=o.get("curr")||0,a=(r+1)%2;[i,s][r].next(e.item),o.set("curr",a)}},t.RoundRobin4={id:"Round Robin 4",namespace:i,description:"Item will be emitted to one of the 4 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves to "r4"\'s turn.'},r4:{description:'The fourth output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r,r4:a}=t,u=o.get("curr")||0,l=(u+1)%4;[i,s,r,a][u].next(e.item),o.set("curr",l)}},t.Publish={id:"Publish",namespace:i,description:"Publishes a value by a key to all listeners in the current flow. Use 'Subscribe' to listen to events.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},value:{mode:"required"}},outputs:{},run:function(e,t,n){const i=`${n.ancestorsInsIds}__${e.key}`;o.publish(i,e.value)}},t.Subscribe={id:"Subscribe",namespace:i,description:"Subscribes to a value published by a key. Use 'Publish' to publish values.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},initial:{mode:"required-if-connected",description:"If passed will be published has the first value"}},completionOutputs:[],outputs:{value:{description:"The value published by the key"}},run:function(e,t,n){const{value:i}=t,s=`${n.ancestorsInsIds}__${e.key}`,r=o.subscribe(s,((e,t)=>{i.next(t)}));void 0!==e.initial&&i.next(e.initial),n.onCleanup((()=>{o.unsubscribe(r)}))}},t.BooleanSplit={namespace:i,id:"Boolean Split",description:"Splits a boolean value into two outputs",inputs:{value:{mode:"required",description:"Boolean value"},trueValue:{mode:"required-if-connected",description:"Value to emit if the input is true. Defaults to true"},falseValue:{mode:"required-if-connected",description:"Value to emit if the input is false. Defaults to false"}},outputs:{true:{description:"The value is true"},false:{description:"The value is false"}},run:function(e,t){const{true:n,false:o}=t,{value:i,trueValue:s,falseValue:r}=e;i?n.next(null==s||s):o.next(null!=r&&r)}},t.EmitOnTrigger={namespace:i,id:"Emit on Trigger",description:"Emits the value when the trigger input receives any value",inputs:{value:{mode:"required",description:"The value to emit"},trigger:{mode:"required",description:"The trigger to emit the value"}},outputs:{result:{description:"The value emitted"}},run:function(e,t){const{result:n}=t,{value:o,trigger:i}=e;void 0!==i&&n.next(o)}},t.Switch3={namespace:i,id:"Switch 3",description:"Switches between 3 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,default:s,outputValue:r}=t,{value:a,firstCase:u,secondCase:l,thirdCase:c}=e;a===u?n.next(null!=r?r:a):a===l?o.next(null!=r?r:a):a===c?i.next(null!=r?r:a):s.next(null!=r?r:a)}},t.Switch2={id:"Switch 2",description:"Switches between 2 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,default:i,outputValue:s}=t,{value:r,firstCase:a,secondCase:u}=e;r===a?n.next(null!=s?s:r):r===u?o.next(null!=s?s:r):i.next(null!=s?s:r)}},t.Switch4={id:"Switch 4",description:"Switches between 4 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},fourthCase:{mode:"required",description:"The value to switch on for the fourth output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},fourth:{description:"The value emitted if the input value is equal to the fourth case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,fourth:s,default:r,outputValue:a}=t,{value:u,firstCase:l,secondCase:c,thirdCase:d,fourthCase:p}=e;u===l?n.next(null!=a?a:u):u===c?o.next(null!=a?a:u):u===d?i.next(null!=a?a:u):u===p?s.next(null!=a?a:u):r.next(null!=a?a:u)}},t.Delay={id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:i,description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:async(e,t)=>{let{value:n,delay:o}=e,{delayedValue:i}=t;await new Promise((e=>setTimeout(e,o))),i.next(n)}},t.Interval={id:"Interval",namespace:i,defaultStyle:{icon:"fa-clock"},description:"Emits a value every interval",inputs:{value:{description:"Value to emit"},interval:{description:"Interval in milliseconds"}},reactiveInputs:["value","interval"],outputs:{value:{description:"Emitted value"}},completionOutputs:[],run:(e,t,n)=>{n.state.get("timer")&&clearInterval(n.state.get("timer"));const o=setInterval((()=>{t.value.next(e.value)}),e.interval);n.state.set("timer",o),n.onCleanup((()=>{clearInterval(o)}))}},t.Debounce={id:"Debounce",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be debounced"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The debounced value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the last value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:s}=t,r=n.state.get("timer");r&&clearTimeout(r);const a=setTimeout((()=>{s.next(o)}),i);n.state.set("timer",a),n.onCleanup((()=>{clearTimeout(r)}))}};class s extends Error{constructor(e){super("Throttle: Value dropped"),this.value=e}}t.ThrottleError=s,t.Throttle={id:"Throttle",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be throttled"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The throttled value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the first value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:r}=t;if(n.state.get("timer"))n.onError(new s(o));else{r.next(o);const e=setTimeout((()=>{n.state.set("timer",null)}),i);n.state.set("timer",e)}}},t.EqualsBoolean={id:"Equals (Bool)",defaultStyle:{icon:"fa-equals"},namespace:i,description:"Emits true if two values are equal (=== equality). Otherwise emits false.",inputs:{a:{description:"First value"},b:{description:"Second value"}},outputs:{result:{description:"true if a is equal to b"}},run:(e,t)=>{let{a:n,b:o}=e,{result:i}=t;return i.next(n===o)}},t.Equals={id:"Equals",namespace:i,description:'Emits the value of "a" to output "true" if "a" is equal to "b". Otherwise emits the value of "a" to output "false".',inputs:{a:{mode:"required",description:"First value"},b:{mode:"required",description:"Second value"}},outputs:{true:{description:"Emits the value of a if a is equal to b"},false:{description:"Emits the value of a if a is not equal to b"}},run:(e,t)=>{const{a:n,b:o}=e,{true:i,false:s}=t;n===o?i.next(n):s.next(n)}}},67040:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Flatten=t.Slice=t.RemoveAt=t.Remove=t.Prepend=t.Append=t.AccumulateSomeValuesByCount=t.AccumulateValuesByCount=t.AccumulateValuesByTime=t.AccumulateValuesUntilTrigger=t.SplitQuadruple=t.SplitTriple=t.SplitTuple=t.HeadAndRest=t.LoopList=t.Reverse=t.ConcatLists=t.ListFrom5=t.ListFrom4=t.ListFrom3=t.ListFrom2=t.Repeat=t.GetListElement=t.ListIsEmpty=t.ListLength=void 0;const n="Lists";t.ListLength={id:"List Length",defaultStyle:{icon:"fa-list"},namespace:n,description:"Returns the length of a list",inputs:{list:{description:"List"}},outputs:{length:{description:"Length"}},run:(e,t)=>{let{list:n}=e,{length:o}=t;return o.next(n.length)}},t.ListIsEmpty={id:"List Is Empty",defaultStyle:{icon:"fa-list"},namespace:n,description:"Returns true if the list is empty",inputs:{list:{description:"List"}},outputs:{isEmpty:{description:"Is empty"}},run:(e,t)=>{let{list:n}=e,{isEmpty:o}=t;return o.next(0===n.length)}},t.GetListElement={id:"Get List Element",defaultStyle:{icon:"fa-list"},namespace:n,description:"Returns the element at the specified index",inputs:{list:{description:"List"},index:{description:"Index"}},outputs:{element:{description:"Element"}},run:(e,t)=>{let{list:n,index:o}=e,{element:i}=t;return i.next(n[o])}},t.Repeat={id:"Repeat",defaultStyle:{icon:"fa-list"},namespace:n,description:"Repeats a value a number of times",inputs:{value:{description:"Value to repeat"},times:{description:"How many times will the value be repeated"}},outputs:{list:{description:"List"}},run:(e,t)=>{let{value:n,times:o}=e,{list:i}=t;const s=[];for(let r=0;r{let{value1:n,value2:o}=e,{list:i}=t;return i.next([n,o])}},t.ListFrom3={id:"List From 3",defaultStyle:{icon:"fa-list"},namespace:n,description:"Creates a list from three values",inputs:{value1:{description:"First value"},value2:{description:"Second value"},value3:{description:"Third value"}},outputs:{list:{description:"List containing all 3 values"}},run:(e,t)=>{let{value1:n,value2:o,value3:i}=e,{list:s}=t;return s.next([n,o,i])}},t.ListFrom4={id:"List From 4",defaultStyle:{icon:"fa-list"},namespace:n,description:"Creates a list from four values",inputs:{value1:{description:"First value"},value2:{description:"Second value"},value3:{description:"Third value"},value4:{description:"Fourth value"}},outputs:{list:{description:"List containing all 4 values"}},run:(e,t)=>{let{value1:n,value2:o,value3:i,value4:s}=e,{list:r}=t;return r.next([n,o,i,s])}},t.ListFrom5={id:"List From 5",defaultStyle:{icon:"fa-list"},namespace:n,description:"Creates a list from five values",inputs:{value1:{description:"First value"},value2:{description:"Second value"},value3:{description:"Third value"},value4:{description:"Fourth value"},value5:{description:"Fifth value"}},outputs:{list:{description:"List containing all 5 values"}},run:(e,t)=>{let{value1:n,value2:o,value3:i,value4:s,value5:r}=e,{list:a}=t;return a.next([n,o,i,s,r])}},t.ConcatLists={id:"Concat Lists",defaultStyle:{icon:"fa-list"},namespace:n,description:"Concatenates two lists",inputs:{list1:{description:"First list"},list2:{description:"Second list"}},outputs:{list:{description:"Concatenated list"}},run:(e,t)=>{let{list1:n,list2:o}=e,{list:i}=t;return i.next([...n,...o])}},t.Reverse={id:"Reverse",defaultStyle:{icon:"fa-list"},namespace:n,description:"Reverses a list",inputs:{list:{description:"List"}},outputs:{reversed:{description:"Reversed list"}},run:(e,t)=>{let{list:n}=e,{reversed:o}=t;return o.next(n.reverse())}},t.LoopList={id:"Loop List",defaultStyle:{icon:"fa-list"},namespace:n,searchKeywords:["each","spread"],description:"Emits all values in a list",inputs:{list:{description:"The list to loop"}},outputs:{item:{description:"Will emit a value for each item in the list"},index:{description:"Will emit the index of the item"},length:{description:"Will emit the length of the list"}},run:(e,t)=>{const{list:n}=e,{item:o,index:i}=t;for(const s of n)o.next(s),i.next(n.indexOf(s));t.length.next(n.length)}},t.HeadAndRest={id:"Head and rest",defaultStyle:{icon:"fa-list"},namespace:n,description:"Receives a list and emits two outputs: the first item and the rest of the list",inputs:{list:{description:"The list"}},outputs:{head:{description:"The first item in the list"},rest:{description:"The rest of the list"}},run:(e,t)=>{const{list:n}=e,{head:o,rest:i}=t;o.next(n[0]),i.next(n.slice(1))}},t.SplitTuple={id:"Split Pair",defaultStyle:{icon:"fa-list"},namespace:n,description:"Receives a list with 2 items and emits two outputs: the first item and the second item",inputs:{pair:{description:"The pair to split"}},outputs:{item1:{description:"The first item in the pair"},item2:{description:"The second item in the pair"}},run:(e,t)=>{const{pair:n}=e,{item1:o,item2:i}=t;o.next(n[0]),i.next(n[1])}},t.SplitTriple={id:"Split Triple",defaultStyle:{icon:"fa-list"},namespace:n,description:"Receives a list with 3 items and emits three outputs: the first item, the second item and the third item",inputs:{triple:{description:"The triple"}},outputs:{item1:{description:"The first item in the triple"},item2:{description:"The second item in the triple"},item3:{description:"The third item in the triple"}},run:(e,t)=>{const{list:n}=e,{item1:o,item2:i,item3:s}=t;o.next(n[0]),i.next(n[1]),s.next(n[2])}},t.SplitQuadruple={id:"Split Quadruple",defaultStyle:{icon:"fa-list"},namespace:n,description:"Receives a list with 4 items and emits four outputs: the first item, the second item, the third item and the fourth item",inputs:{quadruple:{description:"The quadruple"}},outputs:{item1:{description:"The first item in the quadruple"},item2:{description:"The second item in the quadruple"},item3:{description:"The third item in the quadruple"},item4:{description:"The fourth item in the quadruple"}},run:(e,t)=>{const{list:n}=e,{item1:o,item2:i,item3:s,item4:r}=t;o.next(n[0]),i.next(n[1]),s.next(n[2]),r.next(n[3])}},t.AccumulateValuesUntilTrigger={id:"Accumulate Values by Trigger",defaultStyle:{icon:"fa-basket-shopping"},namespace:n,description:'Accumulates values sent to the "value" input, until the "reset" input is triggered. Then it emits the accumulated values and resets the accumulator.',inputs:{value:{description:"The value to accumulate"},reset:{description:"Resets the accumulator"}},reactiveInputs:["value","reset"],outputs:{accumulated:{description:"The accumulated values"}},run:(e,t,n)=>{const{item:o,until:i}=e,{r:s}=t,{state:r}=n;let a=r.get("list")||[];void 0!==o&&(a.push(o),r.set("list",a)),void 0!==i&&s.next(a)}},t.AccumulateValuesByTime={id:"Accumulate Values by Time",defaultStyle:{icon:"fa-basket-shopping"},namespace:n,description:'Accumulates values sent to the "value" input. After the specified time it emits the accumulated values and resets the accumulator.',inputs:{value:{description:"The value to accumulate"},time:{description:"Time to wait before emitting the accumulated values. Default is 200ms",defaultValue:200,mode:"required-if-connected"}},reactiveInputs:["value"],outputs:{accumulated:{description:"The accumulated values"}},run:(e,t,n)=>{const{value:o,time:i}=e,{accumulated:s}=t,{state:r}=n;let a=r.get("list")||[];const u=Date.now()%1e3;console.log("called",e.value,e.time,u),r.set("bob",2),console.log(Array.from(r.entries())),void 0!==o&&(a.push(o),r.set("list",a)),r.get("timeout")&&clearTimeout(r.get("timeout"));const l=new Promise((e=>{r.set("resolve",e)}));return r.set("timeout",setTimeout((()=>{console.log("emitting",a,u,Date.now()%1e3),s.next(a),r.set("list",[]);const e=r.get("resolve");if(!e)throw new Error("resolve is undefined");e()}),i)),l}},t.AccumulateValuesByCount={id:"Accumulate Values by Count",defaultStyle:{icon:"fa-basket-shopping"},namespace:n,description:'Accumulates values sent to the "value" input. After the specified count it emits the accumulated values and resets the accumulator.',inputs:{value:{description:"The value to accumulate"},count:{description:"Number of values to accumulate before emitting them"}},reactiveInputs:["value"],outputs:{accumulated:{description:"The accumulated values"}},completionOutputs:["accumulated"],run:(e,t,n)=>{const{value:o,count:i}=e,{accumulated:s}=t,{state:r}=n;let a=r.get("list")||[];void 0!==o&&(a.push(o),r.set("list",a)),a.length>=i&&s.next(a)}},t.AccumulateSomeValuesByCount={id:"Accumulate Some Values by Count",defaultStyle:{icon:"fa-basket-shopping"},namespace:n,description:'Accumulates values sent to the "accept" input. Emits the list after the total items passed to both "accept" and "ignore" inputs reach the specified count.',inputs:{accept:{description:"Values to accumulate"},ignore:{description:"Values to ignore"},count:{description:"Number of values to accumulate before emitting them"}},reactiveInputs:["accept","ignore"],outputs:{accumulated:{description:"The accumulated accepted values"},ignored:{description:"The accumulated ignored values"}},run:(e,t,n)=>{const{accept:o,ignore:i,count:s}=e,{accumulated:r,ignored:a}=t,{state:u}=n;let l=u.get("list")||[],c=u.get("ignored")||[];void 0!==o&&(l.push(o),u.set("list",l)),void 0!==i&&(c.push(i),u.set("ignored",a)),l.length+c.length>=s&&(r.next(l),a.next(a))}},t.Append={id:"Append",namespace:n,description:"Appends an item to a list",inputs:{list:{description:"The list"},item:{description:"The item to append"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,item:o}=e,{list:i}=t;i.next([...n,o])},defaultStyle:{icon:"fa-plus"}},t.Prepend={id:"Prepend",namespace:n,description:"Prepends an item to a list",inputs:{list:{description:"The list"},item:{description:"The item to prepend"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,item:o}=e,{list:i}=t;i.next([o,...n])},defaultStyle:{icon:"fa-arrow-up"}},t.Remove={id:"Remove",namespace:n,description:"Removes an item from a list",inputs:{list:{description:"The list"},item:{description:"The item to remove"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,item:o}=e,{list:i}=t;i.next(n.filter((e=>e!==o)))},defaultStyle:{icon:"fa-minus"}},t.RemoveAt={id:"Remove At",namespace:n,description:"Removes an item from a list at the specified index",inputs:{list:{description:"The list"},index:{description:"The index of the item to remove"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,index:o}=e,{list:i}=t;i.next(n.filter(((e,t)=>t!==o)))},defaultStyle:{icon:"fa-times"}},t.Slice={id:"Slice",namespace:n,description:"Returns a slice of a list from the specified start index to the specified end index",inputs:{list:{description:"The list"},start:{description:"The index to start slicing from"},end:{description:"The index to end slicing at"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,start:o,end:i}=e,{list:s}=t;s.next(n.slice(o,i))},defaultStyle:{icon:"fa-cut"}},t.Flatten={id:"Flatten",namespace:n,description:"Flattens a list of lists into a single list",inputs:{list:{description:"The list of lists"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n}=e,{list:o}=t;o.next(n.reduce(((e,t)=>[...e,...t]),[]))},defaultStyle:{icon:"fa-compress"}}},45888:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SumList=t.LessThanOrEqual=t.LessThan=t.GreaterThanOrEqual=t.GreaterThan=t.ToPrecision=t.ToExponential=t.ToFixed=t.ParseFloat=t.ParseInt=t.Max=t.Min=t.Cos=t.Sin=t.Truncate=t.Round=t.Ceiling=t.Floor=t.AbsoluteValue=t.SquareRoot=t.Power=t.Modulo=t.Divide=t.Multiply=t.Subtract=t.Add=void 0;const n="Numbers";t.Add={id:"Add",defaultStyle:{icon:"fa-plus"},namespace:n,description:"Emits the sum of two numbers",inputs:{n1:{description:"First number to add"},n2:{description:"Second number to add"}},outputs:{sum:{description:"The sum of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{sum:i}=t;return i.next(n+o)}},t.Subtract={id:"Subtract",defaultStyle:{icon:"fa-minus"},namespace:n,description:"Emits the difference of two numbers",inputs:{n1:{description:"First number to subtract"},n2:{description:"Second number to subtract"}},outputs:{difference:{description:"The difference of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{difference:i}=t;return i.next(n-o)}},t.Multiply={id:"Multiply",defaultStyle:{icon:"fa-times"},namespace:n,description:"Emits the product of two numbers",inputs:{n1:{description:"First number to multiply"},n2:{description:"Second number to multiply"}},outputs:{product:{description:"The product of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{product:i}=t;return i.next(n*o)}},t.Divide={id:"Divide",defaultStyle:{icon:"fa-divide"},namespace:n,description:"Emits the quotient of two numbers",inputs:{n1:{description:"First number to divide"},n2:{description:"Second number to divide"}},outputs:{quotient:{description:"The quotient of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{quotient:i}=t;return i.next(n/o)}},t.Modulo={id:"Modulo",defaultStyle:{icon:"fa-percentage"},namespace:n,description:"Emits the remainder of two numbers",inputs:{n1:{description:"First number to divide"},n2:{description:"Second number to divide"}},outputs:{remainder:{description:"The remainder of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{remainder:i}=t;return i.next(n%o)}},t.Power={id:"Power",defaultStyle:{icon:"fa-superscript"},namespace:n,description:"Emits the power of two numbers",inputs:{n1:{description:"Base number"},n2:{description:"Exponent"}},outputs:{power:{description:"The power of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{power:i}=t;return i.next(Math.pow(n,o))}},t.SquareRoot={id:"Square Root",defaultStyle:{icon:"fa-square-root-alt"},namespace:n,description:"Emits the square root of a number",inputs:{n:{description:"Number to take the square root of"}},outputs:{root:{description:"The square root of n"}},run:(e,t)=>{let{n:n}=e,{root:o}=t;return o.next(Math.sqrt(n))}},t.AbsoluteValue={id:"Absolute Value",defaultStyle:{icon:"fa-abs"},namespace:n,description:"Emits the absolute value of a number",inputs:{n:{description:"Number to take the absolute value of"}},outputs:{absolute:{description:"The absolute value of n"}},run:(e,t)=>{let{n:n}=e,{absolute:o}=t;return o.next(Math.abs(n))}},t.Floor={id:"Floor",defaultStyle:{icon:"fa-floor"},namespace:n,description:"Emits the floor of a number",inputs:{n:{description:"Number to take the floor of"}},outputs:{floor:{description:"The floor of n"}},run:(e,t)=>{let{n:n}=e,{floor:o}=t;return o.next(Math.floor(n))}},t.Ceiling={id:"Ceiling",defaultStyle:{icon:"fa-ceiling"},namespace:n,description:"Emits the ceiling of a number",inputs:{n:{description:"Number to take the ceiling of"}},outputs:{ceiling:{description:"The ceiling of n"}},run:(e,t)=>{let{n:n}=e,{ceiling:o}=t;return o.next(Math.ceil(n))}},t.Round={id:"Round",defaultStyle:{icon:"fa-round"},namespace:n,description:"Emits the rounded value of a number",inputs:{n:{description:"Number to round"}},outputs:{rounded:{description:"The rounded value of n"}},run:(e,t)=>{let{n:n}=e,{rounded:o}=t;return o.next(Math.round(n))}},t.Truncate={id:"Truncate",defaultStyle:{icon:"fa-truncate"},namespace:n,description:"Emits the truncated value of a number",inputs:{n:{description:"Number to truncate"}},outputs:{truncated:{description:"The truncated value of n"}},run:(e,t)=>{let{n:n}=e,{truncated:o}=t;return o.next(Math.trunc(n))}},t.Sin={id:"Sin",defaultStyle:{icon:"fa-sin"},namespace:n,description:"Emits the sine of an angle",inputs:{angle:{description:"Angle in radians"}},outputs:{sine:{description:"The sine of angle"}},run:(e,t)=>{let{angle:n}=e,{sine:o}=t;return o.next(Math.sin(n))}},t.Cos={id:"Cos",defaultStyle:{icon:"fa-cos"},namespace:n,description:"Emits the cosine of an angle",inputs:{angle:{description:"Angle in radians"}},outputs:{cosine:{description:"The cosine of angle"}},run:(e,t)=>{let{angle:n}=e,{cosine:o}=t;return o.next(Math.cos(n))}},t.Min={id:"Min",namespace:n,description:"Emits the minimum of two numbers",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{min:{description:"The minimum of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{min:i}=t;return i.next(Math.min(n,o))}},t.Max={id:"Max",namespace:n,description:"Emits the maximum of two numbers",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{max:{description:"The maximum of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{max:i}=t;return i.next(Math.max(n,o))}},t.ParseInt={id:"Parse Int",namespace:n,description:"Emits the integer value of a string",inputs:{str:{description:"String to parse"}},outputs:{int:{description:"The integer value of str"}},run:(e,t)=>{let{str:n}=e,{int:o}=t;return o.next(parseInt(n))}},t.ParseFloat={id:"Parse Float",namespace:n,description:"Emits the float value of a string",inputs:{str:{description:"String to parse"}},outputs:{float:{description:"The float value of str"}},run:(e,t)=>{let{str:n}=e,{float:o}=t;return o.next(parseFloat(n))}},t.ToFixed={id:"To Fixed",namespace:n,description:"Emits the specified number of decimal places of a number",inputs:{number:{description:"Number to format"},places:{description:"Number of decimal places to format to"}},outputs:{fixed:{description:"The number with the specified number of decimal places"}},run:(e,t)=>{let{number:n,places:o}=e,{fixed:i}=t;return i.next(n.toFixed(o))}},t.ToExponential={id:"To Exponential",namespace:n,description:"Emits the specified number of decimal places of a number in exponential notation",inputs:{number:{description:"Number to format"},places:{description:"Number of decimal places to format to"}},outputs:{exponential:{description:"The number with the specified number of decimal places in exponential notation"}},run:(e,t)=>{let{number:n,places:o}=e,{exponential:i}=t;return i.next(n.toExponential(o))}},t.ToPrecision={id:"To Precision",namespace:n,description:"Emits the specified number of significant figures of a number",inputs:{number:{description:"Number to format"},places:{description:"Number of significant figures to format to"}},outputs:{precision:{description:"The number with the specified number of significant figures"}},run:(e,t)=>{let{number:n,places:o}=e,{precision:i}=t;return i.next(n.toPrecision(o))}},t.GreaterThan={id:"Greater Than",namespace:n,description:"Emits true if the first number is greater than the second",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{result:{description:"true if n1 is greater than n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{result:i}=t;return i.next(n>o)}},t.GreaterThanOrEqual={id:"Greater Than Or Equal",namespace:n,description:"Emits true if the first number is greater than or equal to the second",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{result:{description:"true if n1 is greater than or equal to n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{result:i}=t;return i.next(n>=o)}},t.LessThan={id:"Less Than",namespace:n,description:"Emits true if the first number is less than the second",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{result:{description:"true if n1 is less than n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{result:i}=t;return i.next(n{let{n1:n,n2:o}=e,{result:i}=t;return i.next(n<=o)}},t.SumList={id:"Sum List",defaultStyle:{icon:"fa-plus"},namespace:n,description:"Emits the sum of a list of numbers",inputs:{list:{description:"List of numbers"}},outputs:{sum:{description:"The sum of the numbers in list"}},run:(e,t)=>{let{list:n}=e,{sum:o}=t;return o.next(n.reduce(((e,t)=>e+t),0))}}},65645:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var o=n(70079),i=n(11253),s=n(74089),r=n(74762),a=n(21766);var u=n(10831),l=n(61997),c=n(77852);const d=(0,a.S)(),p=[0,20],f=e=>{let{flow:t,output:n,inputs:o,onError:s,debugDelay:a,onCompleted:u,dependencies:l,player:c}=e;const p=((e,t)=>{const n=new Set;return{onEvent:o=>{const i={...o,time:Date.now(),executionId:"n/a"};console.info("Got debugger event",o),t.addEvents([i]),e.addEvents([i]),n.forEach((e=>e([i])))},onBatchedEvents:e=>(n.add(e),()=>n.delete(e))}})(c,d);p.debugDelay=a;const f=(0,r.keys)(t.node.outputs)[0];return{executeResult:(0,r.execute)({node:t.node,inputs:o,outputs:{[f]:n},resolvedDeps:{...l,[t.node.id]:t.node},_debugger:p,onCompleted:u,onBubbleError:e=>{s(e)},extraContext:{PubSub:i}}),localDebugger:p}},m=e=>{const{debugDelay:t,onOutput:i,flowProps:a}=e,{flow:m,inputs:h,output:v}=a,g=(0,o.useRef)((0,s.createRuntimePlayer)()),[I,y]=(0,o.useState)(e.flowProps.dependencies),[b,C]=(0,o.useState)(),[x]=(0,s.useDebounce)(I,500),_=(0,c.useDarkMode)(),w=async(e,t)=>{const{node:o}=e,i=Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).find((e=>(0,r.isBaseNode)(e)&&e.id===o.id));let a;y((e=>({...e,[i.id]:{...i,source:{path:"@flyde/stdlib/dist/all-browser",export:i.id}}})));const l=(0,u.ZP)(m,(n=>{if(t){const o=(0,s.vAdd)({x:0,y:0},t.pos);if(a=(0,s.createNewNodeInstance)(e.node,0,o,I),n.node.instances.push(a),t.connectTo){const{insId:e,outputId:o}=t.connectTo;n.node.connections.push({from:{insId:e,pinId:o},to:{insId:a.id,pinId:r.TRIGGER_PIN_ID}})}}}));await new Promise((e=>setTimeout(e,10)));const c=(0,u.ZP)(j,(e=>{e.flow=l,t?.selectAfterAdding&&a&&(e.boardData.selected=[a?.id])}));return P(c),(0,s.toastMsg)(`Node ${o.id} successfully imported from ${e.module}`),I},N=async()=>({importables:Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).filter(r.isBaseNode).map((e=>({node:{...e,source:{path:"n/a",export:"n/a"}},module:"@flyde/stdlib"}))),errors:[]}),[j,P]=(0,o.useState)({flow:m,boardData:{viewPort:{pos:{x:0,y:0},zoom:1},lastMousePos:{x:0,y:0},selected:[]}});(0,o.useEffect)((()=>{P((e=>({...e,flow:m})))}),[m]),(0,o.useEffect)((()=>{y((e=>({...e,main:j.flow.node})))}),[j.flow.node]);const O={state:j,onChangeEditorState:P,hideTemplatingTips:!0,initialPadding:p,onExtractInlineNode:r.noop,disableScrolling:!0,darkMode:_.isDarkMode};(0,o.useEffect)((()=>{g.current.start()}),[]),(0,o.useEffect)((()=>{const{executeResult:n,localDebugger:o}=f({flow:j.flow,dependencies:I,output:v,inputs:h,onError:r.noop,debugDelay:t,player:g.current,onCompleted:e.onCompleted}),s=e.flowProps.output.subscribe((e=>i(e)));return C(o),()=>{n(),s.unsubscribe()}}),[t,x]);const E=(0,o.useMemo)((()=>({resolvedDependencies:I,onImportNode:w,onRequestImportables:N})),[]),S=(0,o.useMemo)((()=>({debuggerClient:b,onRequestHistory:d.requestHistory})),[b]);return o.createElement(l.Z,null,(()=>o.createElement(s.DependenciesContextProvider,{value:E},o.createElement(s.DebuggerContextProvider,{value:S},o.createElement(s.FlowEditor,O)))))}},21766:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var o=n(74762);const i=200,s=()=>{const e=new Map,t=new Map;return{requestHistory:async(n,s,r)=>{const a="input"===r?o.DebuggerEventType.INPUT_CHANGE:o.DebuggerEventType.OUTPUT_CHANGE;if(console.log({insId:n,pinId:s,type:a}),s){const t=`${n}.${s}.${a}`,o=e.get(t)||{total:0,lastSamples:[]},r=o.lastSamples.slice(0,i);return{...o,lastSamples:r}}{const e=t.get(n)||{total:0,lastSamples:[]},o=e.lastSamples.slice(0,i);return{...e,lastSamples:o}}},addEvents:n=>{n.forEach((n=>{if(n.type===o.DebuggerEventType.ERROR){const e=n;e.type=o.DebuggerEventType.OUTPUT_CHANGE,e.pinId=o.ERROR_PIN_ID}if(n.type===o.DebuggerEventType.INPUT_CHANGE||n.type===o.DebuggerEventType.OUTPUT_CHANGE){const{insId:o,type:s,pinId:r}=n;{const t=`${o}.${r}.${s}`,a=e.get(t)||{total:0,lastSamples:[]};a.lastSamples.unshift(n),a.lastSamples.length>i&&a.lastSamples.splice(i,a.lastSamples.length-i),a.total++,e.set(t,a)}{const s=t.get(o)||{total:0,lastSamples:[]};s.lastSamples.unshift(n),s.lastSamples.length>i&&s.lastSamples.splice(i,s.lastSamples.length-i),s.total++,e.set(o,s)}}}))}}}},79256:(e,t,n)=>{"use strict";n.d(t,{I:()=>p});var o=n(70079),i=n(65092),s=n(19841),r=n(49794),a=n(21766),u=n(73949),l=n(81098),c=n(65645);(0,a.S)();const d=[{title:"Hello World",key:"hello-world"},{title:"React Counter",key:"react-counter"},{title:"BMI Calculator",key:"bmi"},{title:"REST API Usage",key:"apis"},{title:"Debounce vs. Throttling",key:"debounce-throttling"},{title:"Fibonacci Seq.",key:"fibonacci"}],p=e=>{const[t,n]=(0,o.useState)(e.initWidth||500),[a,p]=(0,o.useState)(e.defaultDelay||0),[f,m]=(0,o.useState)(!1),h=(0,o.useCallback)(((e,t)=>{let{size:o}=t;n(o.width)}),[]),v=o.createElement("div",{className:"delay-container"},o.createElement("input",{type:"range",id:"volume",name:"delay",value:a,step:"100",min:"0",max:"300",onChange:e=>p(Number(e.target.value))}),o.createElement("label",{htmlFor:"volume"},"Debug Delay: ",a,"ms")),g=d.findIndex((t=>t.key===e.meta.key)),I=d[g+1],y=d[g-1];return o.createElement(i.Z,{title:`${e.meta.title} | Playground`,description:`Flyde Playground - ${e.meta.title} example`},o.createElement("header",{className:(0,s.default)("hero hero--primary",u.Z.heroBanner,"playground-hero")},o.createElement("div",{className:"container"},o.createElement("h1",{className:"hero__title"},"Welcome to Flyde's Online Playground"),o.createElement("p",{className:"hero__subtitle"},"Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!"))),o.createElement("div",{className:"mobile-warning"},"Flyde is currently not optimized for mobile devices. Please"," ",o.createElement("strong",null,"use a desktop computer for the best experience"),"."),o.createElement("ul",{className:"examples__menu"},d.map((e=>o.createElement("li",{key:e.key},o.createElement(r.Z,{to:`/playground/${e.key}`,className:"button button--primary"},e.title))))),o.createElement("div",{className:"playground-container"},o.createElement("header",null,o.createElement("h2",{className:"playground-title"},e.meta.title),o.createElement("div",{className:"playground-description"},e.meta.description),f?o.createElement(o.Fragment,null,o.createElement("hr",null),o.createElement("div",{className:"playground-extra"},e.extraInfo||e.meta.extraInfo,o.createElement("div",{className:"star-hint"},o.createElement("span",null,"\xa0 PS: Did you like this example?"),"Please consider giving a \u2b50\ufe0f to the project"," ",o.createElement("span",{className:"star-wrapper"},o.createElement("iframe",{className:"gh-stars-frame",src:"https://ghbtns.com/github-btn.html?user=flydelabs&repo=flyde&type=star&count=true&size=small",width:100,height:20,title:"GitHub Stars"}))))):null,e.prefixComponent),o.createElement("div",{className:"playground"},o.createElement("div",{className:"flow-container"},!0!==e.hideDelay?v:null,o.createElement(c.Y,{flowProps:e.flowProps,debugDelay:a,onOutput:()=>m(!0)})),o.createElement(l.Resizable,{height:0,width:t,onResize:h,handle:o.createElement("div",{className:"handle"}),axis:"x",resizeHandles:["w"]},o.createElement("div",{className:"output-container",style:{flexBasis:t}},e.children))),o.createElement("nav",{className:"pagination-nav"},o.createElement("div",{className:"pagination-nav__item"},y?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${y.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Previous Example"),o.createElement("div",{className:"pagination-nav__label"},y.title)):null),o.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},I?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${I.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Next Example"),o.createElement("div",{className:"pagination-nav__label"},I.title)):null))))}},35865:(e,t,n)=>{const o=n(70079);e.exports={id:"Button",inputs:{children:{type:"any",mode:"required"}},outputs:{jsx:{type:"any"},click:{type:"any"}},completionOutputs:["jsx"],run:function(e,t){const n=o.createElement("button",{onClick:e=>t.click.next(e),className:"button button--outline button--primary"},e.children);t.jsx.next(n)}}},99365:(e,t,n)=>{const o=n(70079);e.exports={id:"Span",inputs:{children:{type:"any",mode:"required"}},outputs:{jsx:{type:"any"}},completionOutputs:["jsx"],run:function(e,t){const n=o.createElement("span",{},e.children);t.jsx.next(n)}}},85088:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var o=n(70079),i=n(74762),s=n(79256);const r={dependencies:{Button:{id:"Button",inputs:{children:{type:"any",mode:"required"}},outputs:{jsx:{type:"any"},click:{type:"any"}},completionOutputs:["jsx"],run:n(35865).run,source:{path:"/Users/gabrielgrinberg/projects/flyde/website/src/pages/playground/_flows/react-counter/Button.flyde.js",export:"default"}},Span:{id:"Span",inputs:{children:{type:"any",mode:"required"}},outputs:{jsx:{type:"any"}},completionOutputs:["jsx"],run:n(99365).run,source:{path:"/Users/gabrielgrinberg/projects/flyde/website/src/pages/playground/_flows/react-counter/Span.flyde.js",export:"default"}},Publish:{id:"Publish",namespace:"Control Flow",description:"Publishes a value by a key to all listeners in the current flow. Use 'Subscribe' to listen to events.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},value:{mode:"required"}},outputs:{},run:n(43920).Publish.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Publish"}},Subscribe:{id:"Subscribe",namespace:"Control Flow",description:"Subscribes to a value published by a key. Use 'Publish' to publish values.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},initial:{mode:"required-if-connected",description:"If passed will be published has the first value"}},completionOutputs:[],outputs:{value:{description:"The value published by the key"}},run:n(43920).Subscribe.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Subscribe"}},Add:{id:"Add",defaultStyle:{icon:"fa-plus"},namespace:"Numbers",description:"Emits the sum of two numbers",inputs:{n1:{description:"First number to add"},n2:{description:"Second number to add"}},outputs:{sum:{description:"The sum of n1 and n2"}},run:n(45888).Add.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Numbers.flyde.js",export:"Add"}},"List From 3":{id:"List From 3",defaultStyle:{icon:"fa-list"},namespace:"Lists",description:"Creates a list from three values",inputs:{value1:{description:"First value"},value2:{description:"Second value"},value3:{description:"Third value"}},outputs:{list:{description:"List containing all 3 values"}},run:n(67040).ListFrom3.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Lists.flyde.js",export:"ListFrom3"}}},flow:{imports:{"@flyde/stdlib":["Boolean Split","Publish","Subscribe","Add","HtmlBtn","List From 3"],"./Button.flyde.js":["Button"],"./Span.flyde.js":["Span"]},node:{instances:[{pos:{x:-115.26095214843747,y:226.5338534545898},id:"Button-410",inputConfig:{children:{mode:"static",value:"+"}},visibleInputs:["children"],nodeId:"Button",style:{size:"large",color:"#00bbf9"}},{pos:{x:-329.9831323242188,y:226.03836868286135},id:"Span-677",inputConfig:{children:{mode:"queue"}},visibleInputs:["children"],nodeId:"Span",style:{size:"large",color:"#9b5de5"}},{pos:{x:-518.7030297851562,y:216.28152648925777},id:"Button-410-d44",inputConfig:{children:{mode:"static",value:"-"}},visibleInputs:["children"],nodeId:"Button",style:{size:"large",color:"#00bbf9"}},{pos:{x:-42.589892578125,y:414.4257174682617},id:"Publish-107",inputConfig:{key:{mode:"static",value:"inc"},value:{mode:"static",value:1}},visibleInputs:["key","value","__trigger"],nodeId:"Publish",style:{color:"#00bbf9"}},{pos:{x:-201.807001953125,y:-187.86253479003906},id:"Subscribe-896",inputConfig:{key:{mode:"static",value:"inc"}},nodeId:"Subscribe",style:{color:"#00f5d4"}},{pos:{x:-272.72882080078125,y:-9.603830566406259},id:"Add-138",inputConfig:{n1:{mode:"sticky"}},nodeId:"Add"},{pos:{x:-387.2609814453125,y:-186.2929638671875},id:"Subscribe-227",inputConfig:{key:{mode:"static",value:"value"},initial:{mode:"static",value:0}},nodeId:"Subscribe",style:{color:"#00f5d4"}},{pos:{x:-676.053251953125,y:420.80437835693357},id:"Publish-441",inputConfig:{key:{mode:"static",value:"inc"},value:{mode:"static",value:-1}},visibleInputs:["key","value","__trigger"],nodeId:"Publish",style:{color:"#00bbf9"}},{pos:{x:-122.10039184570314,y:113.89903961181642},id:"Publish-817-d15",inputConfig:{key:{mode:"static",value:"value"},value:{mode:"queue"}},visibleInputs:["value"],nodeId:"Publish",style:{color:"#00bbf9"}},{pos:{x:-393.0812890625,y:110.83120086669919},id:"Inline-value-Value is ${inp-308",inputConfig:{},node:{id:"Inline-value-${inputs.count",inputs:{count:{type:"any",mode:"required"}},outputs:{r:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"outputs.r.next((`${inputs.count}`))",customViewCode:"`${inputs.count}`",dataBuilderSource:"YCR7aW5wdXRzLmNvdW50fWA=",templateType:"value",completionOutputs:["r"],defaultStyle:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"300"}}}},{pos:{x:-416.83026611328125,y:12.137357788085978},id:"Inline-value-0-783",inputConfig:{},node:{id:"Inline-value-0",inputs:{},outputs:{r:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"outputs.r.next((0))",customViewCode:"0",dataBuilderSource:"MA==",templateType:"value",completionOutputs:["r"],defaultStyle:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"300"}}}},{pos:{x:-344.7745190429688,y:415.93806869506835},id:"List From 3-388",inputConfig:{value3:{mode:"sticky"},value1:{mode:"sticky"},value2:{mode:"sticky"}},nodeId:"List From 3"}],connections:[{from:{insId:"Button-410",pinId:"click"},to:{insId:"Publish-107",pinId:"__trigger"}},{from:{insId:"Button-410-d44",pinId:"click"},to:{insId:"Publish-441",pinId:"__trigger"}},{from:{insId:"Inline-value-Value is ${inp-308",pinId:"r"},to:{insId:"Span-677",pinId:"children"}},{from:{insId:"Inline-value-0-783",pinId:"r"},to:{insId:"Inline-value-Value is ${inp-308",pinId:"count"}},{from:{insId:"Add-138",pinId:"sum"},to:{insId:"Inline-value-Value is ${inp-308",pinId:"count"}},{from:{insId:"Add-138",pinId:"sum"},to:{insId:"Publish-817-d15",pinId:"value"}},{from:{insId:"Button-410-d44",pinId:"jsx"},to:{insId:"List From 3-388",pinId:"value1"}},{from:{insId:"Span-677",pinId:"jsx"},to:{insId:"List From 3-388",pinId:"value2"}},{from:{insId:"Button-410",pinId:"jsx"},to:{insId:"List From 3-388",pinId:"value3"}},{from:{insId:"List From 3-388",pinId:"list"},to:{insId:"__this",pinId:"jsx"}},{from:{insId:"Subscribe-896",pinId:"value"},to:{insId:"Add-138",pinId:"n2"}},{from:{insId:"Subscribe-227",pinId:"value"},to:{insId:"Add-138",pinId:"n1"}}],id:"Main",inputs:{},outputs:{jsx:{type:"any"}},inputsPosition:{},outputsPosition:{jsx:{x:-283.81852447487364,y:588.5155366362267}},completionOutputs:["result"]}}},a=e=>o.createElement("div",{className:"output-jsx"},o.createElement("header",null,"Output JSX "),o.createElement("main",null,e.element)),u={title:"React Counter Example",description:'This examples how Flyde can be used to build functional reactive UIs using React! Each time the "jsx" output receives a new value, it is rendered to the output pane.',key:"react-counter",extraInfo:'Another powerful feature of Flyde is that a node can have more than 1 output. For example, "Button" outputs JSX, but also outputs "click" signals. Cool, right?'},l=e=>{const t=(0,i.dynamicOutput)();return t.subscribe(e),t};function c(){const[e,t]=(0,o.useState)(o.createElement("div",null,"Loading")),n=(0,o.useRef)(l((e=>t(e)))),i=(0,o.useRef)({}),[c,d]=(0,o.useState)({flow:r.flow,dependencies:r.dependencies,inputs:i.current,output:n.current});return o.createElement(s.I,{meta:u,flowProps:c},o.createElement(a,{element:e}))}},73949:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={"flyde-flow-editor":"flyde-flow-editor_AAD4",_hj_feedback_container:"_hj_feedback_container_Af03"}},85721:(e,t,n)=>{var o={"./af":47654,"./af.js":47654,"./ar":61325,"./ar-dz":98344,"./ar-dz.js":98344,"./ar-kw":26230,"./ar-kw.js":26230,"./ar-ly":42524,"./ar-ly.js":42524,"./ar-ma":44119,"./ar-ma.js":44119,"./ar-sa":82625,"./ar-sa.js":82625,"./ar-tn":42182,"./ar-tn.js":42182,"./ar.js":61325,"./az":37093,"./az.js":37093,"./be":32721,"./be.js":32721,"./bg":59919,"./bg.js":59919,"./bm":95594,"./bm.js":95594,"./bn":563,"./bn-bd":41757,"./bn-bd.js":41757,"./bn.js":563,"./bo":73211,"./bo.js":73211,"./br":87438,"./br.js":87438,"./bs":83662,"./bs.js":83662,"./ca":61196,"./ca.js":61196,"./cs":5841,"./cs.js":5841,"./cv":85251,"./cv.js":85251,"./cy":24512,"./cy.js":24512,"./da":37539,"./da.js":37539,"./de":5059,"./de-at":53853,"./de-at.js":53853,"./de-ch":99378,"./de-ch.js":99378,"./de.js":5059,"./dv":91454,"./dv.js":91454,"./el":39651,"./el.js":39651,"./en-au":87953,"./en-au.js":87953,"./en-ca":98193,"./en-ca.js":98193,"./en-gb":61980,"./en-gb.js":61980,"./en-ie":14050,"./en-ie.js":14050,"./en-il":6502,"./en-il.js":6502,"./en-in":555,"./en-in.js":555,"./en-nz":11372,"./en-nz.js":11372,"./en-sg":26568,"./en-sg.js":26568,"./eo":69533,"./eo.js":69533,"./es":68327,"./es-do":17620,"./es-do.js":17620,"./es-mx":96467,"./es-mx.js":96467,"./es-us":83272,"./es-us.js":83272,"./es.js":68327,"./et":68523,"./et.js":68523,"./eu":19066,"./eu.js":19066,"./fa":59087,"./fa.js":59087,"./fi":96443,"./fi.js":96443,"./fil":93979,"./fil.js":93979,"./fo":90383,"./fo.js":90383,"./fr":56327,"./fr-ca":25610,"./fr-ca.js":25610,"./fr-ch":97274,"./fr-ch.js":97274,"./fr.js":56327,"./fy":67442,"./fy.js":67442,"./ga":44291,"./ga.js":44291,"./gd":77342,"./gd.js":77342,"./gl":96248,"./gl.js":96248,"./gom-deva":21404,"./gom-deva.js":21404,"./gom-latn":20833,"./gom-latn.js":20833,"./gu":9122,"./gu.js":9122,"./he":74623,"./he.js":74623,"./hi":60364,"./hi.js":60364,"./hr":30860,"./hr.js":30860,"./hu":70441,"./hu.js":70441,"./hy-am":90425,"./hy-am.js":90425,"./id":29672,"./id.js":29672,"./is":96150,"./is.js":96150,"./it":27852,"./it-ch":55603,"./it-ch.js":55603,"./it.js":27852,"./ja":16465,"./ja.js":16465,"./jv":20120,"./jv.js":20120,"./ka":87245,"./ka.js":87245,"./kk":21479,"./kk.js":21479,"./km":65038,"./km.js":65038,"./kn":63060,"./kn.js":63060,"./ko":85020,"./ko.js":85020,"./ku":90582,"./ku.js":90582,"./ky":34950,"./ky.js":34950,"./lb":94201,"./lb.js":94201,"./lo":87894,"./lo.js":87894,"./lt":70120,"./lt.js":70120,"./lv":4265,"./lv.js":4265,"./me":14030,"./me.js":14030,"./mi":9463,"./mi.js":9463,"./mk":25898,"./mk.js":25898,"./ml":64233,"./ml.js":64233,"./mn":47156,"./mn.js":47156,"./mr":34479,"./mr.js":34479,"./ms":24691,"./ms-my":6456,"./ms-my.js":6456,"./ms.js":24691,"./mt":81789,"./mt.js":81789,"./my":37452,"./my.js":37452,"./nb":91170,"./nb.js":91170,"./ne":87529,"./ne.js":87529,"./nl":81776,"./nl-be":24455,"./nl-be.js":24455,"./nl.js":81776,"./nn":34705,"./nn.js":34705,"./oc-lnc":36139,"./oc-lnc.js":36139,"./pa-in":17960,"./pa-in.js":17960,"./pl":1899,"./pl.js":1899,"./pt":31670,"./pt-br":29159,"./pt-br.js":29159,"./pt.js":31670,"./ro":55115,"./ro.js":55115,"./ru":45149,"./ru.js":45149,"./sd":81231,"./sd.js":81231,"./se":35397,"./se.js":35397,"./si":99786,"./si.js":99786,"./sk":39383,"./sk.js":39383,"./sl":68691,"./sl.js":68691,"./sq":34826,"./sq.js":34826,"./sr":40080,"./sr-cyrl":75673,"./sr-cyrl.js":75673,"./sr.js":40080,"./ss":54309,"./ss.js":54309,"./sv":52245,"./sv.js":52245,"./sw":8967,"./sw.js":8967,"./ta":10454,"./ta.js":10454,"./te":35204,"./te.js":35204,"./tet":81571,"./tet.js":81571,"./tg":15737,"./tg.js":15737,"./th":41786,"./th.js":41786,"./tk":50511,"./tk.js":50511,"./tl-ph":14828,"./tl-ph.js":14828,"./tlh":62422,"./tlh.js":62422,"./tr":97047,"./tr.js":97047,"./tzl":90792,"./tzl.js":90792,"./tzm":67730,"./tzm-latn":59963,"./tzm-latn.js":59963,"./tzm.js":67730,"./ug-cn":42535,"./ug-cn.js":42535,"./uk":33151,"./uk.js":33151,"./ur":22750,"./ur.js":22750,"./uz":61914,"./uz-latn":60231,"./uz-latn.js":60231,"./uz.js":61914,"./vi":55517,"./vi.js":55517,"./x-pseudo":64078,"./x-pseudo.js":64078,"./yo":70046,"./yo.js":70046,"./zh-cn":81832,"./zh-cn.js":81832,"./zh-hk":90953,"./zh-hk.js":90953,"./zh-mo":38236,"./zh-mo.js":38236,"./zh-tw":71001,"./zh-tw.js":71001};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=s,e.exports=i,i.id=85721}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[764],{19121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cappedArrayDebounce=void 0;t.cappedArrayDebounce=function(e,t,n,o){void 0===o&&(o=500);let i=[],s=null,r=null;return{addItem:a=>{clearTimeout(s),i.push(a),r||(r=setTimeout((()=>{e(i),clearTimeout(s),r=null}),o)),i.length>=n?(e(i),clearTimeout(r),r=null,i=[]):s=setTimeout((()=>{e(i),clearTimeout(r),r=null,i=[]}),t)},flush:()=>{i.length&&(e(i),i=[],clearTimeout(r))},pendingItems:()=>i.length}}},59792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.dataShaper=t.DataShapeType=void 0,function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.ARRAY=3]="ARRAY",e[e.OBJECT=4]="OBJECT",e[e.NULL=5]="NULL",e[e.UNSUPPORTED=6]="UNSUPPORTED"}(n=t.DataShapeType||(t.DataShapeType={}));const o={string:n.STRING,number:n.NUMBER,boolean:n.BOOLEAN,object:n.OBJECT,array:n.ARRAY,null:n.NULL,symbol:n.UNSUPPORTED,undefined:n.UNSUPPORTED,function:n.UNSUPPORTED,bigint:n.UNSUPPORTED};t.dataShaper=function(e,n,i){void 0===n&&(n=5),void 0===i&&(i=5);const s=null===(r=e)?"null":typeof r;var r,a;if("object"===s){if(Array.isArray(e))return n>1?e.filter(((e,t)=>t(0,t.dataShaper)(e,n-1,i))):o.array;if(n>1){const o={};for(const s in e)o[s]=(0,t.dataShaper)(e[s],n-1,i);return a=o,Object.keys(a).sort().reduce(((e,t)=>(e[t]=a[t],e)),{})}return o.object}return o[s]}},23046:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.debugLogger=void 0;const i=(0,o(n(55899)).default)("flyde");t.debugLogger=e=>i.extend(e)},24331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullInsIdPath=void 0,t.fullInsIdPath=function(e,t){if(!e)throw new Error("insId is not defined");return t?`${t}.${e}`:e}},34459:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hashFlow=t.hashNode=void 0;const i=o(n(68805)),s=n(30292),r=e=>(0,i.default)(e);t.hashNode=function(e,t){var n;void 0===t&&(t=!0);const{id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l}=e,c={id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l};if((0,s.isVisualNode)(e)){const{instances:n,connections:o,inputsPosition:i,outputsPosition:s}=e,a=n.map((e=>{const{pos:t,...n}=e;return n})),u=t?{}:{inputsPosition:i,outputsPosition:s},l=t?a:n;l.sort(((e,t)=>e.id.localeCompare(t.id)));const d=[...o];d.sort(((e,t)=>{const n=`${e.from.insId}.${e.from.pinId}`,o=`${t.from.insId}.${t.from.pinId}`;return n.localeCompare(o)}));const p=JSON.stringify({instancesToUse:l,conns:d,...c,maybeIoPos:u});return r(p)}if((0,s.isInlineValueNode)(e)){const{customViewCode:t}=e,o=null!==(n=e.fnCode)&&void 0!==n?n:e.runFnRawCode,i=JSON.stringify({fnCode:o,customViewCode:t,...c});return r(i)}throw new Error("Hashing code nodes unsupported")};t.hashFlow=e=>{const{node:n,imports:o}=e,i=(0,t.hashNode)(n,!1),s=Object.entries(null!=o?o:{}).sort(((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)})).map((e=>{let[t,n]=e;return[t,n.sort()]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{}),a=JSON.stringify(s);return r(i+a)}},86873:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DepGraph=void 0,i(n(3172),t),i(n(59962),t),i(n(23046),t),i(n(19121),t),i(n(59962),t),i(n(34459),t),i(n(39043),t),i(n(59792),t),i(n(24331),t),t.DepGraph=n(60359).DepGraph},3172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testDataCreator=void 0;t.testDataCreator=e=>function(t){void 0===t&&(t={});return{..."function"==typeof e?e():e,...t}}},59962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplePluralize=t.eventually=t.delay=t.noop=t.removeDupes=t.ensure=t.isOptionalType=t.callFnOrFnPromise=t.isPromise=t.isDefined=t.containsAll=t.shuffle=t.randomInts=t.repeat=t.pickRandom=t.randomPos=t.randomInt=t.pickSecond=t.pickFirst=t.fromEntries=t.entries=t.okeys=t.values=t.keys=t.filterOMap=t.mapOMap=t.middlePos=t.calcCenter=t.intersectRect=void 0;t.intersectRect=(e,t)=>{const n=e.x+e.w,o=t.x+t.w;return!(t.x>n||oe.y+e.h||t.y+t.h{let{w:t,h:n,x:o,y:i}=e;return{x:o+t/2,y:i+n/2}};t.middlePos=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});t.mapOMap=(e,n)=>(0,t.entries)(e).map((e=>{let[t,o]=e;return[t,n(t,o)]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.filterOMap=(e,n)=>(0,t.entries)(e).filter((e=>{let[t,o]=e;return n(t,o)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.keys=e=>Object.keys(e);t.values=e=>Object.values(e),t.okeys=t.keys;t.entries=e=>(0,t.okeys)(e).map((t=>[t,e[t]]));t.fromEntries=e=>e.reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.pickFirst=e=>e[0];t.pickSecond=e=>e[1];t.randomInt=function(e,t){void 0===t&&(t=0);const n=Math.random();return t+Math.floor((e-t)*n)};t.randomPos=function(e,n){void 0===e&&(e=1e3),void 0===n&&(n=0);return{x:(0,t.randomInt)(e,n),y:(0,t.randomInt)(e,n)}};t.pickRandom=e=>e[(0,t.randomInt)(e.length)];t.repeat=(e,t)=>"x".repeat(e).split("").map(((e,n)=>t(n)));t.randomInts=function(e,n,o){return void 0===n&&(n=100),void 0===o&&(o=0),(0,t.repeat)(e,(()=>(0,t.randomInt)(n,o)))};t.shuffle=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t};t.containsAll=(e,t)=>t.every((t=>e.includes(t)));t.isDefined=e=>void 0!==e;t.isPromise=e=>e&&"function"==typeof e.then;t.callFnOrFnPromise=(e,n)=>{if(!(0,t.isDefined)(e))return;const o=e=>{try{e()}catch(t){console.error(n,t)}};"function"==typeof e?o(e):Promise.resolve(e).then((e=>{"function"==typeof e&&o(e)}))};t.isOptionalType=e=>/\?$/.test(e);t.ensure=(e,t)=>{if(void 0===e)throw new Error(t||"Undefined value passed");return e};t.removeDupes=e=>Array.from(new Set(e));t.noop=()=>{};t.delay=e=>new Promise((t=>setTimeout(t,e)));t.eventually=async function(e,n,o,i){if(void 0===n&&(n=1e3),void 0===o&&(o=100),void 0===i&&(i=new Set),n<0){const e=Array.from(i).reduce(((e,t,n)=>`${e}\n\t\t${n+1}. ${t}`),"");throw new Error(`[Eventually timeout exceeded after: timeout with error]: ${e}`)}try{await e()}catch(s){const r=Date.now();await(0,t.delay)(o);const a=Date.now()-r;return i.add(null==s?void 0:s.message),(0,t.eventually)(e,n-a,o,i)}},t.simplePluralize=function(e,t){return`${e} ${t}${1!==e?"s":""}`}},39043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileObjectTemplate=t.compileStringTemplate=void 0;t.compileStringTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=new RegExp("\\$\\{"+e+"\\}","g");n=n.replace(i,o)})),n};t.compileObjectTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=JSON.stringify(o),s=new RegExp('"\\$\\$\\{'+e+'\\}"',"g"),r=new RegExp("\\$\\{"+e+"\\}","g"),a="string"==typeof o?o.replace(/"/g,((e,t,n)=>"\\"!==n[t-1]?'\\"':n[t])):o;n=n.replace(s,i).replace(r,a).replace(/\n/g,"\\n")})),JSON.parse(n)}},69150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connection=t.connectionData=t.connectionDataEquals=t.connectionNodeEquals=t.connectionNode=t.externalConnectionNode=t.isInternalConnection=t.isExternalConnection=t.isInternalConnectionNode=t.isExternalConnectionNode=t.getNodeOutputs=t.getOutputName=t.getInputName=t.getNodeInputs=t.TRIGGER_PIN_ID=t.ERROR_PIN_ID=t.THIS_INS_ID=void 0;const o=n(30292);t.THIS_INS_ID="__this",t.ERROR_PIN_ID="__error",t.TRIGGER_PIN_ID="__trigger";t.getNodeInputs=e=>({...e.inputs,[t.TRIGGER_PIN_ID]:(0,o.nodeInput)()});t.getInputName=e=>e===t.TRIGGER_PIN_ID?"Trigger Node":e;t.getOutputName=e=>e===t.ERROR_PIN_ID?"Error":e;t.getNodeOutputs=e=>({...e.outputs,[t.ERROR_PIN_ID]:(0,o.nodeOutput)()});t.isExternalConnectionNode=e=>e&&e.insId===t.THIS_INS_ID;t.isInternalConnectionNode=e=>e.insId!==t.THIS_INS_ID;t.isExternalConnection=e=>{let{from:n,to:o}=e;return(0,t.isExternalConnectionNode)(n)||(0,t.isExternalConnectionNode)(o)};t.isInternalConnection=e=>!(0,t.isExternalConnection)(e);t.externalConnectionNode=e=>({insId:t.THIS_INS_ID,pinId:e});t.connectionNode=(e,t)=>({insId:e,pinId:t});t.connectionNodeEquals=(e,t)=>e.insId===t.insId&&e.pinId===t.pinId;t.connectionDataEquals=(e,n)=>!(!e||!n)&&((0,t.connectionNodeEquals)(e.from,n.from)&&(0,t.connectionNodeEquals)(e.to,n.to)),t.connectionData=function(e,n,o){const i="string"==typeof e?e.split("."):e,s="string"==typeof n?n.split("."):n;if(i.length>2||s.length>2)throw new Error(`invalid source or target to connection data - ${e} / ${n}`);return{from:2===i.length?(0,t.connectionNode)(i[0],i[1]):(0,t.externalConnectionNode)(i[0]),to:2===s.length?(0,t.connectionNode)(s[0],s[1]):(0,t.externalConnectionNode)(s[0]),delayed:o}};t.connection=function(e,t,n){return void 0===n&&(n=!1),{from:e,to:t,delayed:n}}},6775:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;const s=n(30292),r=n(47025),a=n(86873),u=n(69150);i(n(69150),t);t.connect=function(e,t,n,o,i,l,c,d){void 0===n&&(n={}),void 0===i&&(i={}),void 0===l&&(l=a.noop),void 0===c&&(c={}),void 0===d&&(d={});const{id:p,connections:f,instances:m}=e,h=p||"connected-node"+(0,a.randomInt)(999);return{inputs:e.inputs,outputs:e.outputs,id:h,completionOutputs:e.completionOutputs,reactiveInputs:e.reactiveInputs,run:(p,v)=>{let g=[];const I=new a.DepGraph({}),y=new Map,b=new Map,C=new Map,x=new Map,_=new Map,w=new Map;let N;const j=new Set;m.forEach((e=>{const n=(0,s.getNode)(e,t),o=e.id;y.set(e,o),b.set(o,e),I.addNode(o);const i=Object.keys(n.inputs),r=Object.keys(n.outputs),a={},l={};i.forEach((t=>{const n=(e.inputConfig||{})[t]||(0,s.queueInputPinConfig)();(0,s.isStaticInputPinConfig)(n)?a[t]=(0,s.staticNodeInput)(n.value):a[t]=(0,s.dynamicNodeInput)({config:n})})),a[u.TRIGGER_PIN_ID]=(0,s.dynamicNodeInput)({config:(0,s.queueInputPinConfig)()});if(f.some((t=>(0,u.isInternalConnectionNode)(t.to)&&t.to.insId===e.id&&t.to.pinId===u.TRIGGER_PIN_ID))&&e.inputConfig&&e.inputConfig[u.TRIGGER_PIN_ID])throw"Trigger connection can not be configured";r.forEach((e=>{const t=(0,s.dynamicOutput)();l[e]=t}));f.some((t=>(0,u.isInternalConnectionNode)(t.from)&&t.from.insId===e.id&&t.from.pinId===u.ERROR_PIN_ID))&&(l[u.ERROR_PIN_ID]=(0,s.dynamicOutput)()),C.set(o,a),x.set(o,l)}));const P=new Set;return f.forEach((n=>{const{from:o,to:i}=n,{insId:r,pinId:a}=o,{insId:l,pinId:c}=i,d=x.get(r),p=C.get(l);if((0,u.isInternalConnectionNode)(i)&&P.add(`${i.insId}.${i.pinId}`),(0,u.isExternalConnection)(n)){if((0,u.isExternalConnectionNode)(o)){const e=null==p?void 0:p[i.pinId];if(!e)throw new Error(`Input ${i.pinId} of instance ${l} not found`);const t=_.get(o.pinId)||[];t.push(e),_.set(o.pinId,t)}else{let e=null==d?void 0:d[o.pinId];if(!e)throw new Error(`Output ${o.pinId} of instance ${r} not found`);const t=w.get(i.pinId)||[];t.push(e),w.set(i.pinId,t)}return}if(!d)throw new Error(`No outputs found for instance [${r}]`);if(!p)throw b.has(l)?new Error(`No inputs found for instance [${l}]`):new Error(`Instance with id [${l}] does not exist!`);const f=d[a];if(!f)throw new Error(`Output source - [${a}] not found in node [${h}]`);const m=p[c],v=b.get(r);if(!v&&r!==u.THIS_INS_ID)throw new Error(`Instance [${r}] does not exist! failed to connect [${o}] -> [${i}]`);const y=(v?(0,s.getNode)(v,t):e).outputs[a];if(y&&y.delayed||n.delayed||r!==u.THIS_INS_ID&&l!==u.THIS_INS_ID&&I.addDependency(r,l),!m)throw new Error(`Target arg - [${i}] not found in node [${h}]`);const N=f.subscribe((async e=>{if(!(0,s.isDynamicInput)(m))throw console.info(m),new Error(`Impossible state listening to non dynamic input - ${l}.${c}`);m.subject.next(e)}));g.push((()=>N.unsubscribe()))})),(0,a.okeys)(v).forEach((e=>{(w.get(e)||[]).forEach((t=>{const n=t.subscribe((async t=>{if(!v[e])throw new Error(`Impossible state - output ${e} does not exist`);v[e].next(t)}));g.push((()=>n.unsubscribe()))}))})),I.overallOrder().map((e=>b.get(e))).forEach((e=>{const a=C.get(e.id),u=x.get(e.id),p=(0,s.getNode)(e,t);if(!a)throw new Error(`Unexpected error - args not found when running ${e}`);if(!u)throw new Error(`Unexpected error - outputs not found when running ${e}`);for(const t in a){const n=e.inputConfig[t];P.has(`${e.id}.${t}`)||(0,s.isStaticInputPinConfig)(n)||delete a[t]}const f=(0,r.execute)({node:p,inputs:a,outputs:u,resolvedDeps:t,_debugger:n,insId:e.id,extraContext:d,mainState:i,ancestorsInsIds:o,onBubbleError:l,onCompleted:()=>{return t=e.id,j.delete(t),void(0===j.size&&N&&N());var t},onStarted:()=>{return t=e.id,void j.add(t);var t},env:c});g.push(f)})),Object.keys(p).forEach((async e=>{(_.get(e)||[]).forEach((t=>{const n=p[e];if(!(0,s.isDynamicInput)(t))throw new Error(`Unsure what to do with key ${e}, input: ${t} of ins ${o}`);(0,a.isDefined)(n)&&t.subject.next(n)}))})),void 0===e.completionOutputs&&j.size>0?new Promise((e=>{N=e})):()=>g.forEach((e=>{try{e()}catch(t){console.error("error unsubscribing",t)}}))}}}},26488:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MINOR_DEBUGGER_EVENT_TYPES=t.MAJOR_DEBUGGER_EVENT_TYPES=t.DebuggerEventType=void 0,function(e){e.INPUT_CHANGE="i",e.OUTPUT_CHANGE="o",e.PROCESSING_CHANGE="pc",e.ERROR="err",e.INPUTS_STATE_CHANGE="isc"}(n=t.DebuggerEventType||(t.DebuggerEventType={})),t.MAJOR_DEBUGGER_EVENT_TYPES=[n.INPUT_CHANGE,n.OUTPUT_CHANGE,n.ERROR],t.MINOR_DEBUGGER_EVENT_TYPES=[n.PROCESSING_CHANGE,n.INPUTS_STATE_CHANGE]},43686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatEvent=void 0;const o=n(26488);t.formatEvent=function(e){var t,n,i;const s=[e.insId,...null!==(n=null===(t=e.ancestorsInsIds)||void 0===t?void 0:t.split("."))&&void 0!==n?n:[]];(null===(i=e.ancestorsInsIds)||void 0===i?void 0:i.length)>0&&e.ancestorsInsIds;const r=`Node <${e.nodeId}> `,a=`(${s.join(" -> ")})`;return`${r} - ${function(e){switch(e.type){case o.DebuggerEventType.PROCESSING_CHANGE:return e.val?"started processing":"stopped processing";case o.DebuggerEventType.INPUT_CHANGE:return`Input pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.OUTPUT_CHANGE:return`Output pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.INPUTS_STATE_CHANGE:return`Inputs queue size changed to ${Object.entries(e.val).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join(", ")}`;case o.DebuggerEventType.ERROR:return`Error: ${e.val}`}}(e)} ${a}`}},99896:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26488),t),i(n(43686),t)},47025:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.GLOBAL_STATE_NS=t.ROOT_INS_ID=t.INPUTS_STATE_SUFFIX=t.INNER_STATE_SUFFIX=void 0;const s=n(62600),r=n(87794);i(n(99896),t);const a=n(30292),u=n(6775),l=n(84479),c=n(86873),d=n(23046),p=n(30292),f=n(99896),m=n(79804);t.INNER_STATE_SUFFIX="_inner",t.INPUTS_STATE_SUFFIX="_inputs";t.ROOT_INS_ID="__root",t.GLOBAL_STATE_NS="____global";t.execute=e=>{let{node:n,inputs:o,outputs:i,resolvedDeps:h,_debugger:v={},insId:g=t.ROOT_INS_ID,extraContext:I={},mainState:y={},ancestorsInsIds:b,onBubbleError:C=s.noop,env:x={},onCompleted:_=s.noop,onStarted:w=s.noop}=e;const N=[];y[t.GLOBAL_STATE_NS]||(y[t.GLOBAL_STATE_NS]=new Map);const j={...I,ENV:x},P=(0,m.customNodesToNodesCollection)(h,j),O=e=>{const t=e instanceof a.NodeInstanceError?e:new a.NodeInstanceError(e,(0,c.fullInsIdPath)(g,b),n.id);v.onEvent&&v.onEvent({type:f.DebuggerEventType.ERROR,val:t,insId:g,ancestorsInsIds:b,nodeId:n.id}),i[u.ERROR_PIN_ID]?i[u.ERROR_PIN_ID].next(t):C(t)},E=(e=>(0,a.isVisualNode)(e)?(0,u.connect)(e,P,v,(0,c.fullInsIdPath)(g,b),y,O,x,I):(0,a.isInlineValueNode)(e)?(0,m.inlineValueNodeToNode)(e,j):e)(n),S=v.onEvent||s.noop,D={},T={};(0,c.entries)(o).forEach((e=>{let[t,o]=e;if((0,a.isDynamicInput)(o)){const e=(0,a.dynamicNodeInput)({config:o.config}),i=o.subject.subscribe((async o=>{const i=S({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o,ancestorsInsIds:b,nodeId:n.id});if(i){const t=await i.valuePromise;e.subject.next(t)}else v.debugDelay&&await(0,c.delay)(v.debugDelay),e.subject.next(o)}));N.push((()=>i.unsubscribe())),T[t]=e}else{S({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o.config.value,ancestorsInsIds:b,nodeId:n.id});const e=(0,a.staticNodeInput)((0,a.getStaticValue)(o.config.value,P,g));T[t]=e}})),(0,c.entries)(i).forEach((e=>{let[t,o]=e;const i=(0,a.dynamicOutput)(),s=i.subscribe((async e=>{const i=S({type:f.DebuggerEventType.OUTPUT_CHANGE,insId:g,pinId:t,val:e,ancestorsInsIds:b,nodeId:n.id});if(i){const e=await i.valuePromise;o.next(e)}else o.next(e)}));N.push((()=>s.unsubscribe())),D[t]=i}));const M=(e=>{var n,o;const{node:i,inputs:u,outputs:m,resolvedDeps:h,_debugger:v,insId:g,ancestorsInsIds:I,mainState:y,onError:b,onStarted:C,onCompleted:x,env:_,extraContext:w}=e,{run:N,fn:j}=i,P=(0,d.debugLogger)("core"),O=[];let E;const S=(null==v?void 0:v.onEvent)||s.noop,D=(0,c.fullInsIdPath)(g,I),T=`${D}${t.INNER_STATE_SUFFIX}`,M=`${D}${t.INPUTS_STATE_SUFFIX}`,k=P.extend(D),R=y[t.GLOBAL_STATE_NS];y[T]||(y[T]=new Map),y[M]||(y[M]=new Map);let A=null!==(n=y[M])&&void 0!==n?n:new Map;const V=()=>{const e=Array.from(A.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:(0,a.isQueueInputPinConfig)(u[n].config)?null==o?void 0:o.length:1}}),{});S({type:f.DebuggerEventType.INPUTS_STATE_CHANGE,val:e,insId:g,ancestorsInsIds:I,nodeId:i.id})},$={execute:(e,n,o,i)=>(0,t.execute)({node:e,inputs:n,outputs:o,resolvedDeps:h,_debugger:v,insId:i,onCompleted:x,onStarted:C}),insId:g,state:null!==(o=y[T])&&void 0!==o?o:new Map,onCleanup:e=>{O.push(e)},onError:e=>{b(e)},context:null!=w?w:{},ancestorsInsIds:I,globalState:R};let L,z=!1;const H=(i.reactiveInputs||[]).filter((e=>{var t;return!(0,p.isStaticInputPinConfig)(null===(t=u[e])||void 0===t?void 0:t.config)})),F=()=>{var e;null===(e=y[T])||void 0===e||e.clear(),(0,c.keys)(y).filter((e=>e.startsWith(`${D}.`))).forEach((e=>{y[e]=new Map}))},G=e=>{const t=(null==e?void 0:e.key)&&H.includes(null==e?void 0:e.key);if(z&&!t);else{const o=z&&t;if((0,l.isNodeStateValid)(u,A,i)||o){let t;if(z){if(!e)throw new Error("Unexpected state, got reactive node while not processing and not valid");const n=(0,l.pullValueForExecution)(e.key,u[e.key],A,_);t={...L,[e.key]:n},V()}else t=(0,l.pullValuesForExecution)(u,A,_),L=t,V();let o=new Set,s={};if(z=!0,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:g,ancestorsInsIds:I,nodeId:i.id}),i.completionOutputs){const e=i.completionOutputs.map((e=>e.split("+"))).reduce(((e,t)=>(t.forEach((n=>{e.set(n,t)})),e)),new Map);(0,c.entries)(m).forEach((t=>{let[n,a]=t;a.pipe((0,r.first)()).subscribe((t=>{o.add(n),s[n]=t;let r=e.get(n);r&&(r.splice(r.indexOf(n),1),0===r.length&&(z=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:g,ancestorsInsIds:I,nodeId:i.id}),x&&x(s),F(),(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),E=void 0,o.clear(),s={},(0,l.hasNewSignificantValues)(u,A,_,i.id)&&G()))}))}))}else(0,c.entries)(m).forEach((e=>{let[t,n]=e;n.subscribe((e=>{s[t]=e}))}));try{k("Running node %s with values %o",i.id,t),C&&C(),E=(null!=j?j:N)(t,m,$),(0,c.isPromise)(E)?E.then((()=>{void 0===i.completionOutputs&&x&&(z=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:g,ancestorsInsIds:I,nodeId:i.id}),x(s),F(),(0,l.hasNewSignificantValues)(u,A,_,i.id)&&G())})).catch((e=>{b(e),z=!1,k("Error in node %s - value %e",i.id,e),S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:g,ancestorsInsIds:I,nodeId:i.id})})):void 0===i.completionOutputs&&x&&(z=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:g,ancestorsInsIds:I,nodeId:i.id}),x(s),F())}catch(n){b(n),z=!1,k("Error in node %s - value %e",i.id,n),S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:z,insId:g,ancestorsInsIds:I,nodeId:i.id})}const d=H.find((e=>u[e]&&(0,l.peekValueForExecution)(e,u[e],A,_,i.id)));if(d){const e=(0,l.peekValueForExecution)(d,u[d],A,_,i.id);G({key:d,value:e})}else{const e=(0,c.entries)(u).find((e=>{let[t,n]=e;const o=(0,a.isQueueInputPinConfig)(n.config),s=(0,l.peekValueForExecution)(t,n,A,_,i.id);return!!o&&(0,c.isDefined)(s)}));if(e){const[t,n]=e,o=(0,l.peekValueForExecution)(t,n,A,_,i.id);G({key:t,value:o})}}}}};G();const q=(0,l.subscribeInputsToState)(u,A,((e,t)=>{P("Got input %s - value is [%o]",e,t),V();try{G({key:e,value:t})}catch(n){b(n)}}));return O.push(q),()=>{(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),O.forEach((e=>e()))}})({node:E,inputs:T,outputs:D,resolvedDeps:P,_debugger:v,insId:g,mainState:y,ancestorsInsIds:b,onError:O,onBubbleError:C,env:x,extraContext:I,onCompleted:_,onStarted:w});return()=>{N.forEach((e=>e())),M()}}},84479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeInputsToState=t.isNodeStateValid=t.hasNewSignificantValues=t.peekValuesForExecution=t.pullValuesForExecution=t.pullValueForExecution=t.peekValueForExecution=void 0;const o=n(30292),i=n(86873),s=n(6775),r=(e,t)=>{const n=(0,o.extractStaticValue)(e);if((0,o.isEnvValue)(n)){return((e,t)=>{const n=e.split(".");let o={...t};for(let s of n){if(!o||!(0,i.isDefined)(o[s])||null===o[s])throw new Error(`Cannot find key ${e} inside obj ${t}`);o=o[s]}return o})((0,o.getEnvKeyFromValue)(n),t)}return n};t.peekValueForExecution=(e,t,n,i,s)=>{const a=n.get(e);let u;if(!t)throw new Error(`Trying to peek value of inexsting input in key "${e}" in node "${s}"`);return u=(0,o.isStaticInput)(t)?r(t,i):(0,o.isQueueInputPinConfig)(t.config)?a?[...a].shift():void 0:a,u};t.pullValueForExecution=(e,t,n,i)=>{const s=n.get(e);let a;return(0,o.isStaticInput)(t)?a=r(t,i):(0,o.isQueueInputPinConfig)(t.config)?(a=(s||[]).shift(),n.set(e,s)):(a=s,(0,o.isStickyInputPinConfig)(t.config)||n.delete(e)),a};t.pullValuesForExecution=(e,n,o)=>(0,i.entries)(e).reduce(((e,i)=>{let[s,r]=i;return e[s]=(0,t.pullValueForExecution)(s,r,n,o),e}),{});t.peekValuesForExecution=(e,n,o,s)=>(0,i.entries)(e).reduce(((e,i)=>{let[r,a]=i;return e[r]=(0,t.peekValueForExecution)(r,a,n,o,s),e}),{});t.hasNewSignificantValues=(e,n,s,r)=>(0,i.entries)(e).some((e=>{let[a,u]=e;const l=(0,o.isQueueInputPinConfig)(u.config),c=(0,t.peekValueForExecution)(a,u,n,s,r);return(0,i.isDefined)(c)&&l}));t.isNodeStateValid=(e,t,n)=>{const r=(0,i.keys)(e),a=(0,i.keys)(n.inputs).filter((e=>{var t;const o=null===(t=n.inputs[e])||void 0===t?void 0:t.mode;return!o||"required"===o}));r.includes(s.TRIGGER_PIN_ID)&&a.push(s.TRIGGER_PIN_ID);return!!(0,i.containsAll)(r,a)&&(0,i.entries)(e).filter((e=>{let[t]=e;return!!n.inputs[t]||t===s.TRIGGER_PIN_ID})).every((e=>{let[s,r]=e;var a;const u=t.get(s);return"optional"===((null===(a=n.inputs[s])||void 0===a?void 0:a.mode)||"required")||(!!(0,o.isStaticInput)(r)||((0,o.isQueueInputPinConfig)(r.config)?(0,i.isDefined)(u)&&u.length>0:(0,i.isDefined)(u)))}))};t.subscribeInputsToState=(e,t,n)=>{const s=[];return(0,i.entries)(e).forEach((e=>{let[i,r]=e;if(!r)return;if((0,o.isStaticInput)(r))return;const a=r.subject.subscribe((e=>{if((0,o.isQueueInputPinConfig)(r.config)){const o=t.get(i)||[];if(!Array.isArray(o))throw new Error(`impossible state - state of key ${i} is set but not an array`);o.push(e),t.set(i,o),n(i,e)}else t.set(i,e),n(i,e)}));s.push((()=>a.unsubscribe()))})),()=>s.forEach((e=>e()))}},5474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flydeFlowSchema=void 0;const o=n(29022),i=o.z.record(o.z.string(),o.z.string().or(o.z.array(o.z.string()))),s=o.z.strictObject({x:o.z.number(),y:o.z.number()}),r=o.z.discriminatedUnion("mode",[o.z.strictObject({mode:o.z.literal("static"),value:o.z.any()}),o.z.strictObject({mode:o.z.literal("queue")}),o.z.strictObject({mode:o.z.literal("sticky")})]),a=o.z.object({size:o.z.optional(o.z.enum(["small","regular","large"])),icon:o.z.optional(o.z.any()),color:o.z.optional(o.z.string()),cssOverride:o.z.optional(o.z.record(o.z.string()))}),u=o.z.object({pos:s.default({x:0,y:0}),id:o.z.string(),inputConfig:o.z.optional(o.z.record(o.z.string(),r)).default({}),visibleInputs:o.z.optional(o.z.array(o.z.string())),visibleOutputs:o.z.optional(o.z.array(o.z.string())),nodeId:o.z.optional(o.z.string()),node:o.z.optional(o.z.any()),style:o.z.optional(a)}).refine((e=>e.node||e.nodeId),{message:"Instance must have either an inline node or refer to a nodeId"}),l=o.z.union([o.z.string(),o.z.object({mode:o.z.enum(["required","optional","required-if-connected"]),type:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),defaultValue:o.z.optional(o.z.any())})]),c=o.z.object({type:o.z.optional(o.z.string()),optional:o.z.optional(o.z.boolean()),delayed:o.z.optional(o.z.boolean()),description:o.z.optional(o.z.string())}),d=o.z.object({id:o.z.optional(o.z.string()),inputs:o.z.record(o.z.string(),l),outputs:o.z.record(o.z.string(),c),inputsPosition:o.z.optional(o.z.record(o.z.string(),s)),outputsPosition:o.z.optional(o.z.record(o.z.string(),s)),customViewCode:o.z.optional(o.z.string()),dataBuilderSource:o.z.optional(o.z.string()),templateType:o.z.optional(o.z.string()),completionOutputs:o.z.optional(o.z.array(o.z.string())),reactiveInputs:o.z.optional(o.z.array(o.z.string())),defaultStyle:o.z.optional(a),description:o.z.optional(o.z.string()),searchKeywords:o.z.optional(o.z.array(o.z.string()))}),p=o.z.object({instances:o.z.array(u),connections:o.z.array(o.z.strictObject({from:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),to:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),delayed:o.z.optional(o.z.boolean()),hidden:o.z.optional(o.z.boolean())}))}).and(d);t.flydeFlowSchema=o.z.strictObject({imports:o.z.optional(i).default({}),node:p})},74762:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticValueVisualNode=void 0,i(n(86873),t);const s=n(30292);i(n(6775),t),i(n(47025),t),i(n(10418),t),i(n(30292),t),i(n(3320),t),i(n(79804),t),i(n(5474),t);t.isStaticValueVisualNode=e=>!!e&&!!(0,s.maybeGetStaticValueNodeId)(`${e}`)},87093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fakeVm=t.VM=t.VMScript=void 0;const o=n(86873);class i{constructor(e){this.script=e}}t.VMScript=i;class s{constructor(e){this.context=e}run(e){const t=(0,o.okeys)(this.context.sandbox),n=Object.values(this.context.sandbox);Function(...t,e.script)(...n)}}t.VM=s,t.fakeVm={VMScript:i,VM:s}},28145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVM2Instance=void 0;const o=n(87093);t.getVM2Instance=()=>o.fakeVm},79804:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.customNodesToNodesCollection=t.inlineValueNodeToNode=void 0;const i=o(n(18706)),s=n(86873),r=n(30292),a=(0,n(28145).getVM2Instance)();t.inlineValueNodeToNode=function(e,t){void 0===t&&(t={});const{runFnRawCode:n,...o}=e,u=(0,s.debugLogger)(`code-node:${e.id}`),l=`\n try {\n ${n}\n } catch (e) {\n adv.onError(e);\n }\n `,c=new a.VMScript(l),d={...o,run:(n,o,l)=>{const d=new a.VM({sandbox:{inputs:n,outputs:o,setInterval:setInterval,clearInterval:clearInterval,setTimeout:setTimeout,clearTimeout:clearTimeout,encodeURIComponent:encodeURIComponent,adv:l,log:function(){for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeWithDependencies=void 0;const o=n(30292),i=n(74762),s=n(88270);t.getNodeWithDependencies=function(e,n,r){if(void 0===r&&(r=[]),(0,o.isInlineValueNode)(e))return[e];if(r.includes(e.id))return[];const a=(0,i.removeDupes)(e.instances.filter((e=>(0,s.isRefNodeInstance)(e))).map((e=>e.nodeId)).filter((e=>n[e])));return[e,...a.flatMap((e=>{var t;return null!==(t=n[e])&&void 0!==t?t:[]})).reduce(((e,o)=>[...e,...(0,t.getNodeWithDependencies)(o,n,[...r,...a])]),[])]}},30292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88270),t),i(n(43069),t),i(n(79426),t),i(n(44535),t),i(n(18063),t),i(n(20359),t)},18063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeInstanceError=void 0;class n extends Error{constructor(e,t,n){let o="Unknown error";o="string"==typeof e?e:e instanceof Error?e.message:null!==e&&"object"==typeof e?JSON.stringify(e):String(e),super(`${o} (insId: ${t}, nodeId: ${n})`),this.name=this.constructor.name,this.message=`${o} (insId: ${t}, nodeId: ${n})`,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.fullInsIdsPath=t,this.nodeId=n}}t.NodeInstanceError=n},88270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInsId=t.NodeInstance=t.isRefNodeInstance=t.isInlineNodeInstance=t.inlineNodeInstance=t.nodeInstance=void 0;const o=n(36618);t.nodeInstance=(e,t,n,o)=>({id:e,nodeId:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.inlineNodeInstance=(e,t,n,o)=>({id:e,node:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.isInlineNodeInstance=e=>!!e.node;t.isRefNodeInstance=e=>!(0,t.isInlineNodeInstance)(e);t.NodeInstance=(e,t,n,o)=>({id:e,nodeId:t.id,inputConfig:n||{},pos:o||{x:0,y:0}});t.createInsId=e=>`${e.id}-${(0,o.slug)()}`},43069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvKeyFromValue=t.toEnvValue=t.isEnvValue=t.extractStaticValue=t.isStaticInput=t.isDynamicInput=t.staticNodeInput=t.dynamicNodeInputs=t.dynamicNodeInput=t.dynamicOutput=t.nodeOutputs=t.nodeOutput=t.nodeInputs=t.isInputPinOptional=t.nodeInput=void 0;const o=n(62600),i=n(30292),s=n(86873),r=n(79426);t.nodeInput=function(e){return void 0===e&&(e="required"),{mode:e}};t.isInputPinOptional=e=>"optional"===e.mode;t.nodeInputs=(e,n)=>(0,s.repeat)(e,(e=>(0,t.nodeInput)((null==n?void 0:n[e])||"required")));t.nodeOutput=function(e){return void 0===e&&(e=!1),{delayed:e}};t.nodeOutputs=e=>(0,s.repeat)(e,(()=>(0,t.nodeOutput)()));t.dynamicOutput=()=>new o.Subject,t.dynamicNodeInput=(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})));t.dynamicNodeInputs=function(e){return void 0===e&&(e=10),(0,s.repeat)(e,(()=>(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})))()))};t.staticNodeInput=e=>({config:(0,r.staticInputPinConfig)(e)});t.isDynamicInput=e=>{const t=e;return t&&t.subject&&!!t.subject.next};t.isStaticInput=e=>(0,i.isStaticInputPinConfig)(null==e?void 0:e.config);t.extractStaticValue=e=>{if((0,t.isStaticInput)(e))return e.config.value;throw new Error("Cannot extract static value from non static arg")};t.isEnvValue=e=>"string"==typeof e&&e.startsWith("$ENV.");t.toEnvValue=e=>`$ENV.${e}`;t.getEnvKeyFromValue=e=>"string"==typeof e?e.replace(/^\$ENV\./,""):e},20359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeFromFunction=t.getNodeDef=t.getNode=t.getStaticValue=t.maybeGetStaticValueNodeId=t.fromSimplified=t.inlineValueNode=t.codeNode=t.visualNode=t.isInlineValueNode=t.isVisualNode=t.isCodeNode=t.isBaseNode=t.InlineValueNodeType=void 0;const o=n(86873),i=n(88270),s=n(43069);!function(e){e.VALUE="value",e.FUNCTION="function"}(t.InlineValueNodeType||(t.InlineValueNodeType={}));t.isBaseNode=e=>e&&e.id&&e.inputs&&e.outputs;t.isCodeNode=e=>(0,t.isBaseNode)(e)&&"function"==typeof e.run;t.isVisualNode=e=>!!e.instances;t.isInlineValueNode=e=>(0,o.isDefined)(e)&&(0,o.isDefined)(e.runFnRawCode),t.visualNode=(0,o.testDataCreator)({id:"visual-node",inputs:{},outputs:{},instances:[],connections:[],outputsPosition:{},inputsPosition:{}}),t.codeNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},run:o.noop}),t.inlineValueNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},runFnRawCode:""});t.fromSimplified=e=>{let{run:t,inputTypes:n,outputTypes:i,id:s}=e;return{id:s,inputs:(0,o.entries)(n).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),outputs:(0,o.entries)(i).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),run:t}};t.maybeGetStaticValueNodeId=e=>{const t="string"==typeof e&&e.match(/^__node\:(.*)/);if(t){return t[1]}return null};t.getStaticValue=(e,n,o)=>{const i=(0,t.maybeGetStaticValueNodeId)(e);if(i){const e=n[i];if(!e)throw new Error(`Instance ${o} referrer to a node reference ${i} that does not exist`);return e}return e};t.getNode=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw new Error(`Node with id ${n} not found`);return o};t.getNodeDef=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw console.error(`Node with id ${n} not found`),new Error(`Node with id ${n} not found`);return o};t.codeFromFunction=e=>{let{id:t,fn:n,inputNames:o,outputName:i,defaultStyle:r}=e;return{id:t,inputs:o.reduce(((e,t)=>({...e,[t]:(0,s.nodeInput)()})),{}),outputs:{[i]:(0,s.nodeOutput)()},run:(e,t)=>{const s=o.map((t=>e[t])),r=t[i],a=n(...s);return Promise.resolve(a).then((e=>null==r?void 0:r.next(e)))},completionOutputs:[i],defaultStyle:r}}},44535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nodeFromSimpleFunction=void 0,t.nodeFromSimpleFunction=function(e){var t;return{...e,id:e.id,description:e.description,namespace:e.namespace,inputs:e.inputs?e.inputs.reduce(((e,t)=>{let{name:n,description:o,mode:i,defaultValue:s}=t;return{...e,[n]:{description:o,mode:null!=i?i:"required",defaultValue:s}}}),{}):{},outputs:e.output?{[e.output.name]:{description:e.output.description}}:{},defaultStyle:{icon:e.icon,size:e.size},run:null!==(t=e.fullRunFn)&&void 0!==t?t:async function(t,n,o){var i,s;const r=(null!==(i=e.inputs)&&void 0!==i?i:[]).map((e=>{let{name:n}=e;return t[n]}));try{const t=await Promise.resolve(e.run(...r));e.output&&(null===(s=n[e.output.name])||void 0===s||s.next(t))}catch(a){console.error("Error in node",a),o.onError(a)}},customViewCode:e.customViewCode}}},79426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticInputPinConfig=t.isStickyInputPinConfig=t.isQueueInputPinConfig=t.staticInputPinConfig=t.stickyInputPinConfig=t.queueInputPinConfig=t.INPUT_MODES=void 0,t.INPUT_MODES=["queue","sticky","static"];t.queueInputPinConfig=()=>({mode:"queue"});t.stickyInputPinConfig=()=>({mode:"sticky"});t.staticInputPinConfig=e=>({mode:"static",value:e});t.isQueueInputPinConfig=e=>"queue"===e.mode;t.isStickyInputPinConfig=e=>!!e&&"sticky"===e.mode,t.isStaticInputPinConfig=function(e){return!!e&&"static"===e.mode}},10418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedExecute=void 0;const o=n(74762),i=n(47025);t.simplifiedExecute=function(e,t,n,s,r){void 0===r&&(r={});const a=(0,o.keys)(e.outputs),u=Object.keys(n).reduce(((e,t)=>{const i=n[t];return{...e,[t]:(0,o.isDynamicInput)(i)?i:(0,o.staticNodeInput)(i)}}),{}),l=a.reduce(((e,t)=>{const n=(0,o.dynamicOutput)();return s&&n.subscribe((e=>{s(t,e)})),{...e,[t]:n}}),{});return(0,i.execute)({node:e,inputs:u,outputs:l,resolvedDeps:t,onBubbleError:e=>{throw e},...r})}},25779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodePreview=void 0;const o=n(35250),i=n(74762),s=n(86553);t.NodePreview=e=>{let{node:t}=e;const n={node:t,instance:(0,i.nodeInstance)("bob",t.id,{}),connections:[],viewPort:{pos:{x:0,y:0},zoom:1},resolvedDeps:{},connectionsPerInput:{},onUngroup:i.noop,onDblClick:i.noop,onDragEnd:i.noop,onDragMove:i.noop,onDragStart:i.noop,onPinClick:i.noop,onPinDblClick:i.noop,onSelect:i.noop,onTogglePinBreakpoint:i.noop,onTogglePinLog:i.noop,onToggleSticky:i.noop,displayMode:!0,onInspectPin:i.noop,onDetachConstValue:i.noop,onCopyConstValue:i.noop,onPasteConstValue:i.noop,ancestorsInsIds:"",onChangeVisibleInputs:i.noop,onChangeVisibleOutputs:i.noop,onConvertConstToEnv:i.noop,forceShowMinimized:"both",onExtractInlineNode:i.noop,onCloseInlineEditor:i.noop,isConnectedInstanceSelected:!1,inlineEditorPortalDomNode:null,onChangeStyle:i.noop,onDeleteInstance:i.noop,onGroupSelected:i.noop,onSetDisplayName:i.noop,hadError:!1,queuedInputsData:{},onPinMouseDown:i.noop,onPinMouseUp:i.noop};return(0,o.jsx)("div",{className:"node-preview",children:(0,o.jsx)(s.InstanceView,{...n})})}},30653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDarkMode=t.DarkModeProvider=void 0;const o=n(70079),i=(0,o.createContext)(!0);t.DarkModeProvider=i.Provider;t.useDarkMode=()=>(0,o.useContext)(i)},29183:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataInspectionModal=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=n(74089),p=n(83938),f=n(17102),m=n(98158);t.DataInspectionModal=e=>{var t;const{onRequestHistory:n}=(0,m.useDebuggerContext)(),{item:o}=e,[i,s]=c.default.useState(),[r,h]=c.default.useState(0),[v,g]=c.default.useState(""),[I,y]=c.default.useState(),[b]=(0,d.useDebounce)(v,300);(0,c.useEffect)((()=>{y(null==i?void 0:i.lastSamples.filter((e=>"object"==typeof e.val?JSON.stringify(e.val).includes(b):e.val.toString().includes(b)))),h(0)}),[null==i?void 0:i.lastSamples,b]),c.default.useEffect((()=>{!async function(){var e,t;const i=await n(o.insId,null===(e=o.pin)||void 0===e?void 0:e.id,null===(t=o.pin)||void 0===t?void 0:t.type);s(i)}()}),[o,n]);const C=e=>{const t=e.val;return"object"==typeof t?(0,a.jsx)(p.BrowserOnlyReactJson,{src:t}):(0,a.jsx)(u.Code,{children:t.toString()})},x=`"${o.insId}" ${(null===(t=o.pin)||void 0===t?void 0:t.id)?`(${o.pin.id})`:""}`;return(0,a.jsx)(u.Dialog,{isOpen:!0,title:`Inspecting data for instance ${x}`,onClose:e.onClose,canEscapeKeyClose:!1,className:"data-inspection-modal",children:(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{children:[i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("em",{children:[x," called ",i.total," time(s)"]}),i.total>10&&(0,a.jsx)("span",{children:"Showing last 10 samples"})]}):null,(0,a.jsx)("input",{className:"bp5-input bp5-small bp5-fill",type:"search",placeholder:"Search for values",dir:"auto",onChange:e=>g(e.target.value),value:v}),b.length>0&&(0,a.jsxs)("span",{children:["Showing ",null==I?void 0:I.length," of ",i.lastSamples.length," ",'samples matching query "',b,'"']})]}),(0,a.jsx)("main",{className:"main-wrapper",children:(()=>{if(!i)return(0,a.jsx)(f.Loader,{});if(0===i.total)return(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",(0,a.jsx)("em",{children:o.insId})," ",o.pin?(0,a.jsxs)(c.default.Fragment,{children:["and pin ",(0,a.jsx)("em",{children:o.pin.id})]}):null,". Make sure debugger is running and your program was triggered."]});const e=null==I?void 0:I[r];return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Card,{className:"content-wrapper",children:[e?(0,a.jsxs)("div",{className:"info",children:[(0,a.jsxs)("div",{children:["Showing sample ",r," of event from"," ",(0,a.jsx)("strong",{children:(0,d.timeAgo)(e.time)})," (",new Date(e.time).toLocaleString(),")"]}),(0,a.jsxs)("div",{children:["Instance: ",(0,a.jsx)("strong",{children:e.insId}),", Pin id:"," ",(0,a.jsx)("strong",{children:e.pinId})," "]}),(0,a.jsx)("div",{children:"Value:"})]}):null,C(e)]}),(0,a.jsx)(u.Menu,{className:"samples-menu",children:I.map(((e,t)=>{const n=e.pinId,o=`${i.total-t}. from pin "${n}"`;return(0,a.jsx)(u.MenuItem,{text:o,onClick:()=>h(t)},t)}))})]}):i.lastSamples.length>0&&v.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",children:['No data found for search query "',v,'"']}):(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",o.insId," ",o.pin?`and ${o.pin.id}`:"",". Make sure a debugger is connected and your program was triggered."]})})()})]})})})}},40471:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29183),t)},98158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebuggerContext=t.DebuggerContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({onRequestHistory:()=>Promise.reject(new Error("Not implemented"))});t.DebuggerContextProvider=i.Provider;t.useDebuggerContext=()=>(0,o.useContext)(i)},86125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDependenciesContext=t.DependenciesContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({resolvedDependencies:{},onImportNode:()=>Promise.reject(new Error("Not implemented")),onRequestImportables:()=>Promise.reject(new Error("Not implemented"))});t.DependenciesContextProvider=i.Provider;t.useDependenciesContext=()=>(0,o.useContext)(i)},97106:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FlowEditor=void 0;const u=n(35250),l=s(n(70079)),c=n(74762),d=n(63521),p=a(n(53865)),f=n(68120),m=n(7047),h=n(84472),v=n(82232),g=n(49283),I=n(43490),y=n(68840),b=n(78087),C=n(20079),x=n(60190),_=n(40471),w=n(98158),N=n(86125),j=n(30653),P=n(77852);r(n(43490),t),r(n(98158),t),r(n(86125),t),y.library.add(b.fab,C.fas);const O=["select","drag-move","order-step"];t.FlowEditor=l.memo(l.forwardRef(((e,t)=>{const{state:n,onChangeEditorState:o}=e,{resolvedDependencies:i,onImportNode:s}=(0,N.useDependenciesContext)(),[r,a]=l.useState([]),[y,b]=l.useState([]),{flow:C,boardData:E}=n,S=n.flow.node,[D,T]=l.useState({}),[M,k]=l.useState(new Set),{debuggerClient:R}=(0,w.useDebuggerContext)();l.useEffect((()=>{if(R)return R.onBatchedEvents((e=>{e.forEach((e=>{e.type===c.DebuggerEventType.INPUTS_STATE_CHANGE&&(console.log("INPUTS_STATE_CHANGE",e.insId,e.val),T((t=>({...t,[e.insId]:e.val})))),e.type===c.DebuggerEventType.ERROR&&k((t=>{const n=new Set(t);return n.add(e.insId),n}))}))}))}),[R]);const{openFile:A,reportEvent:V}=(0,I.usePorts)(),$=l.useCallback(((e,t)=>{console.info("onChangeFlow",t.type),"functional"===t.type&&(a([{flow:{...n.flow,...e}},...r.slice(0,50)]),b([])),o((t=>({...t,flow:{...t.flow,...e}})))}),[o,n.flow,r]),[L,z]=l.useState({instances:[],connections:[]}),[H,F]=l.useState(!1),G=l.useCallback((()=>F(!1)),[]),q=l.useCallback((()=>F(!0)),[]),B=l.useCallback((e=>{o((t=>({...t,boardData:{...t.boardData,...e}})))}),[o]);l.useEffect((()=>{B({selected:[],viewPort:d.defaultViewPort,from:void 0,to:void 0,lastMousePos:{x:0,y:0}})}),[S.id]),(0,f.useHotkeys)("cmd+z",(e=>{b([...y,n]);const[t,...i]=r;t&&(o((e=>({...e,...t}))),a(i)),e.preventDefault()}),{text:"Undo last change",group:"Editing"},[n,r,y]);const U=l.useCallback(((e,t)=>{O.some((e=>t.message.includes(e)))||b([]),$({node:e},t)}),[$]),W=l.useCallback((e=>{A({absPath:e.source.path})}),[A]),Z=l.useCallback((function(e,t){void 0===t&&(t=-1*d.NODE_HEIGHT*1.5);const n=(0,m.createNewNodeInstance)(e,t,E.lastMousePos,i);if(n){const e=(0,p.default)(C,(e=>{const t=e.node;if(!(0,c.isVisualNode)(t))throw new Error("Impossible state, adding node to non visual node");t.instances.push(n)}));return $(e,(0,v.functionalChange)("add-node")),G(),n}}),[E.lastMousePos,C,$,G,i]),J=l.useCallback((async e=>{switch(e.type){case g.OmniBarCmdType.ADD:return V("addNode",{nodeId:e.data,source:"omnibar"}),Z(e.data);case g.OmniBarCmdType.ADD_VALUE:{const e=t.current;null==e||e.requestNewInlineValue();break}case g.OmniBarCmdType.IMPORT:{await s(e.data,{pos:E.lastMousePos});const t=(0,x.vAdd)({x:0,y:0},E.lastMousePos),n=(0,m.createNewNodeInstance)(e.data.node,0,t,i),o=(0,p.default)(C,(e=>{e.node.instances.push(n)}));$(o,(0,v.functionalChange)("add-imported-node")),V("addNode",{nodeId:e.data.node.id,source:"omnibar"});break}default:h.AppToaster.show({intent:"warning",message:"Not supported yet"})}G()}),[G,V,Z,t,s,E.lastMousePos,i,C,$]),[Y,K]=l.useState(),Q=l.useCallback((()=>K(void 0)),[]),X=l.useCallback(((e,t)=>{K({insId:e,pin:t})}),[]),{isDarkMode:ee}=(0,P.useDarkMode)();return(0,u.jsx)("div",{className:"flyde-flow-editor",children:(()=>{var n;if((0,c.isInlineValueNode)(S))throw new Error("Impossible state");return(0,u.jsx)(j.DarkModeProvider,{value:null!==(n=e.darkMode)&&void 0!==n?n:ee,children:(0,u.jsxs)(l.Fragment,{children:[Y?(0,u.jsx)(_.DataInspectionModal,{item:Y,onClose:Q}):null,(0,u.jsx)(d.VisualNodeEditor,{currentInsId:c.ROOT_INS_ID,ref:t,boardData:E,onChangeBoardData:B,node:S,onGoToNodeDef:W,onChangeNode:U,resolvedDependencies:i,clipboardData:L,onCopy:z,nodeIoEditable:!S.id.startsWith("Trigger"),onInspectPin:X,onShowOmnibar:q,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:D,initialPadding:e.initialPadding,instancesWithErrors:M,disableScrolling:e.disableScrolling},S.id),H?(0,u.jsx)(g.Omnibar,{flow:C,resolvedNodes:i,onCommand:J,visible:H,onClose:G}):null]})})})()})})))},9001:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeEditor=t.renderCreateIOOption=void 0;const i=n(35250),s=o(n(70079)),r=n(74762),a=n(50382),u=o(n(53865)),l=n(70457),c=n(25779);t.renderCreateIOOption=(e,t,n)=>(0,i.jsx)(a.MenuItem,{icon:"add",text:`Create "${e}"`,active:t,onClick:n,shouldDismissPopover:!1});const d=l.MultiSelect.ofType();t.BaseNodeEditor=e=>{var n,o;const{node:l,onChange:p}=e,f=(0,r.entries)(l.inputs),m=f.filter((e=>{let[,t]=e;return"required"===t.mode})).map((e=>{let[t]=e;return t})),h=f.filter((e=>{let[,t]=e;return"optional"===t.mode})).map((e=>{let[t]=e;return t})),v=f.filter((e=>{let[,t]=e;return"required-if-connected"===t.mode})).map((e=>{let[t]=e;return t})),[g,I]=s.default.useState(!1),y=(0,r.okeys)(l.outputs),b=s.default.useCallback((e=>{p({...l,id:e})}),[l,p]),C=s.default.useCallback((e=>{let t=e?e.split(","):void 0;"[]"===e&&(t=[]),p({...l,completionOutputs:t})}),[l,p]),x=s.default.useCallback((e=>{let t=e?e.split(","):void 0;p({...l,reactiveInputs:t})}),[l,p]),_=s.default.useCallback(((e,t)=>{const n=(0,u.default)(l,(n=>{n.inputs[e]=(0,r.nodeInput)(t)}));p(n)}),[l,p]),w=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.inputs[e]}));p(t)}),[l,p]),N=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{t.outputs[e]=(0,r.nodeOutput)()}));p(t)}),[l,p]),j=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.outputs[e]}));p(t)}),[l,p]);return(0,i.jsxs)("div",{className:"base-node-editor",children:[(0,i.jsx)("div",{className:"form-row",children:(0,i.jsx)(a.FormGroup,{label:"Node Name",labelFor:"text-input",labelInfo:"(required)",children:(0,i.jsx)(a.InputGroup,{id:"node-name",disabled:e.idDisabled,placeholder:"Node ID",value:l.id,onChange:e=>b(e.target.value)})})}),(0,i.jsx)(a.FormGroup,{label:"Required Inputs",children:(0,i.jsx)(d,{selectedItems:m,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>_(e,"required"),onRemove:w,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),!0!==e.hiddenOutputs?(0,i.jsx)(a.FormGroup,{label:"Outputs",children:(0,i.jsx)(d,{selectedItems:y,placeholder:"Enter output names here",items:[],tagRenderer:e=>e,onItemSelect:N,onRemove:j,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}):null,(0,i.jsx)(a.Checkbox,{checked:g,onChange:e=>I(e.target.checked),children:"Show advanced options"}),(0,i.jsxs)(a.Collapse,{isOpen:g,children:[(0,i.jsx)(a.FormGroup,{label:"Optional Inputs",children:(0,i.jsx)(d,{selectedItems:h,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>_(e,"optional"),onRemove:w,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Required-if-connected Inputs",children:(0,i.jsx)(d,{selectedItems:v,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>_(e,"required-if-connected"),onRemove:w,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Completion Outputs",children:(0,i.jsx)(a.InputGroup,{id:"completion-outputs",placeholder:"completion outputs",value:(null===(n=l.completionOutputs)||void 0===n?void 0:n.join(","))||"",onChange:e=>C(e.target.value)})}),(0,i.jsx)(a.FormGroup,{label:"Reactive Inputs",children:(0,i.jsx)(a.InputGroup,{id:"reactive-inputs",placeholder:"Reactive inputs",value:(null===(o=l.reactiveInputs)||void 0===o?void 0:o.join(","))||"",onChange:e=>x(e.target.value)})})]}),(0,i.jsx)(a.FormGroup,{label:"Preview",children:(0,i.jsx)("div",{className:"preview-wrapper",children:(0,i.jsx)(c.NodePreview,{node:l})})})]})}},82232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metaChange=t.functionalChange=void 0;t.functionalChange=e=>({type:"functional",message:e});t.metaChange=function(e){return void 0===e&&(e="n/a"),{type:"meta",message:e}}},41032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safelyGetNodeDef=t.loadingDef=void 0;const o=n(74762);t.loadingDef={id:"Loading",inputs:{},outputs:{}};t.safelyGetNodeDef=(e,n)=>{try{return(0,o.getNodeDef)(e,n)}catch(i){const n="string"==typeof e?e:e.nodeId;return{...t.loadingDef,id:n}}}},72125:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCodeModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(68371),f=n(74762),m=n(31745),h="`Result is ${inputs.a + inputs.b}`";t.InlineCodeModal=u.memo((function(e){const{initialValue:t,initialType:n}=e,[o,i]=u.useState((0,f.isDefined)(t)?t:h),[s,r]=u.useState(n||f.InlineValueNodeType.VALUE),v=(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:['You can add variables to by referrencing the "inputs" object.',(0,a.jsx)("br",{})," For example:",(0,a.jsx)(c.Code,{children:"`Hello {inputs.name}`"}),' will expose an input pin named "name"']}),(0,a.jsxs)("p",{children:["You can also use ternery expressions, arithmetic operators and more!",(0,a.jsx)("br",{}),"For example:",(0,a.jsx)(c.Code,{children:"inputs.a > inputs.b ? inputs.a + 42 : Math.random() * inputs.b"})]})]}),g=(0,a.jsxs)("span",{children:["Type in any valid JS value, such as ",(0,a.jsx)(c.Code,{children:"true"}),", ",(0,a.jsx)(c.Code,{children:"42"}),","," ",(0,a.jsx)(c.Code,{children:'["bob", "alice", "dave"]'}),".",(0,a.jsx)("br",{})," Dynamic inputs may also be used"]}),I=(0,a.jsxs)("span",{children:["Write any JS code and return a value.",(0,a.jsx)("br",{})," The returned value will be the output.",(0,a.jsx)("br",{})," Example:",(0,a.jsx)(c.Code,{children:"const a = inputs.a; const b = inputs.b; return Math.floor(a/b);"})]}),y=(0,p.getVariables)(o);return u.useEffect((()=>{o===h&&s===f.InlineValueNodeType.FUNCTION&&i(`return ${h}`),o===`return ${h}`&&s===f.InlineValueNodeType.VALUE&&i(h)}),[o,s]),(0,a.jsxs)(c.Dialog,{isOpen:!0,title:"Inline Value / Code",onClose:e.onCancel,className:"inline-code-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:t=>{"Enter"===t.key&&t.metaKey&&e.onSubmit(s,o)},tabIndex:0,children:[(0,a.jsxs)(c.RadioGroup,{inline:!0,onChange:e=>r(e.target.value),selectedValue:s,children:[(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Value ",(0,a.jsx)(m.InfoTooltip,{content:g})]}),value:f.InlineValueNodeType.VALUE}),(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Function ",(0,a.jsx)(m.InfoTooltip,{content:I})]}),value:f.InlineValueNodeType.FUNCTION})]}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"javascript",value:o,onChange:e=>i(e||""),onMount:e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})}}),(()=>{const e=o.includes("return");return e&&s===f.InlineValueNodeType.VALUE?(0,a.jsx)(c.Callout,{intent:c.Intent.WARNING,children:'When using the "value" type you are not expected to return anything'}):e||s!==f.InlineValueNodeType.FUNCTION?null:(0,a.jsxs)(c.Callout,{intent:c.Intent.DANGER,children:['When using the "function" type you are expected to'," ",(0,a.jsx)(c.Code,{children:"return"})," a value.",(0,a.jsx)("br",{}),"Example: ",(0,a.jsx)(c.Code,{children:"return 42 + Date.now();"})]})})(),(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Input pins detected:"," ",y.length?y.map((e=>(0,a.jsx)(c.Code,{children:e},e))):"None",(0,a.jsx)(m.InfoTooltip,{content:v})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:e.onCancel,children:"Cancel"}),(0,a.jsx)(c.Button,{onClick:()=>e.onSubmit(s,o),intent:c.Intent.PRIMARY,className:"save-btn",children:"Save"})]})})]})}))},18594:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(72125),t)},68371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInlineValueNode=t.getVariables=void 0;const o=n(74762),i=n(74762);t.getVariables=e=>(e.match(/inputs\.([a-zA-Z]\w*)/g)||[]).map((e=>e.replace(/inputs\./,"")));t.createInlineValueNode=e=>{let{code:n,customView:s,nodeId:r,type:a}=e;const u=(0,t.getVariables)(n).reduce(((e,t)=>({...e,[t]:(0,o.nodeInput)()})),{}),l={value:(0,o.nodeOutput)()},c=a===o.InlineValueNodeType.FUNCTION?`const result = (function() { ${n}}());\n Promise.resolve(result).then(val => outputs.value.next(val))`:`const result = (${n}); Promise.resolve(result).then(val => outputs.value.next(val))`,d=btoa(n);return(0,i.inlineValueNode)({id:r||`Inline Code ${(0,o.randomInt)(99999)}`,inputs:u,outputs:l,runFnRawCode:c,customViewCode:s||n,dataBuilderSource:d,templateType:a,completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline "+(a===o.InlineValueNodeType.VALUE?"value":"function")})}},49283:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Omnibar=t.OmniBarCmdType=void 0;const a=n(35250),u=s(n(70079)),l=n(70457),c=n(74762),d=n(50382),p=r(n(26372));var f;!function(e){e.ADD="add",e.ADD_VALUE="add-value",e.IMPORT="import"}(f=t.OmniBarCmdType||(t.OmniBarCmdType={}));const m=[];t.Omnibar=e=>{const{resolvedNodes:t}=e,[n,o]=u.useState(""),[i,s]=u.useState(null),[r,h]=u.useState([]);u.useEffect((()=>{const e=(0,c.keys)(t).map((e=>({title:`${t[e].id}`,cmd:{type:f.ADD,data:e},extra:"current flow"}))),n=r.map((e=>({title:`${e.node.id}`,description:e.node.description,cmd:{type:f.IMPORT,data:e},extra:`${e.module}`}))),o={title:"Add inline value or code",suggestOnEmpty:!0,cmd:{type:f.ADD_VALUE}},i=[...m,...n,o,...e];s(i)}),[t,r]),u.useEffect((()=>{e.onRequestImportables&&e.onRequestImportables(n).then((e=>{h(e)}))}),[e,n]);const v=u.useCallback(((e,t)=>{let{handleClick:n,modifiers:o,query:i,index:s}=t;if(!o.matchesPredicate)return null;const r=`${e.title}`;return(0,a.jsx)(d.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,a.jsxs)("div",{className:(0,p.default)("omnibar-item",{active:o.active}),children:[(0,a.jsxs)("div",{className:"title",children:[r," ",e.extra?(0,a.jsx)("span",{className:"extra",children:e.extra}):null]}),e.description?(0,a.jsx)("div",{className:"description",children:e.description}):null]})},s)}),[]),g=u.useCallback(((e,t)=>{const n=e.toLowerCase().split("").map((e=>{return`${t=e,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*`;var t})).join(""),o=new RegExp(n);return!!t.title.toLowerCase().match(o)}),[]),I=u.useCallback((t=>{e.onCommand(t.cmd),e.onClose()}),[e]);return i?(0,a.jsx)(l.Omnibar,{query:n,onQueryChange:o,onClose:e.onClose,noResults:(0,a.jsx)(d.MenuItem,{disabled:!0,text:"No results."}),itemPredicate:g,isOpen:e.visible,items:i,initialContent:void 0,onItemSelect:I,itemRenderer:v,inputProps:{placeholder:"Search for nodes or commands.."}}):null}},60698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43490:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31874),t)},31874:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.usePorts=t.useConfirm=t.usePrompt=t.PortsContext=t.defaultPorts=void 0;const s=n(70079),r=n(74762),a=n(84472);i(n(60698),t);const u=e=>async()=>{console.warn(`${e} Not implemented`),(0,a.toastMsg)("Feature not implemented in this context yet","warning")};t.defaultPorts={prompt:async e=>{let{text:t,defaultValue:n}=e;return prompt(`${t}`,n)},openFile:async e=>{},confirm:async e=>{let{text:t}=e;return confirm(t)},readFlow:u("readFlow"),setFlow:u("setFlow"),resolveDeps:u("resolveDeps"),getImportables:u("getImportables"),onExternalFlowChange:u("onExternalFlowChange"),onInstallRuntimeRequest:u("onInstallRuntimeRequest"),onRunFlow:u("onRunFlow"),onStopFlow:u("onStopFlow"),reportEvent:r.noop,generateNodeFromPrompt:u("generateNodeFromPrompt"),hasOpenAiToken:()=>Promise.resolve(!1)},t.PortsContext=(0,s.createContext)(t.defaultPorts);t.usePrompt=()=>{const e=(0,s.useContext)(t.PortsContext).prompt;return(t,n)=>e({text:t,defaultValue:n})};t.useConfirm=()=>{const e=(0,s.useContext)(t.PortsContext).confirm;return t=>e({text:t})};t.usePorts=()=>(0,s.useContext)(t.PortsContext)},65758:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelected=void 0;const i=n(74762),s=o(n(53865)),r=n(22513);t.groupSelected=async(e,t,n,o,a)=>{const{instances:u,connections:l}=t,c=u.filter((t=>e.includes(t.id))),d=l.filter((t=>{let{from:n,to:o}=t;return-1!==e.indexOf(n.insId)||-1!==e.indexOf(o.insId)}));if(!c.length)throw new Error("visual without selections");const{visualNode:p,renamedInputs:f,renamedOutputs:m}=await(0,r.createGroup)(c,d,n,a),h=c.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),u[0].pos),v="ref"===o?(0,i.nodeInstance)((0,i.createInsId)(p),p.id,{},h):(0,i.inlineNodeInstance)((0,i.createInsId)(p),p,{},h),g=u.filter((t=>-1===e.indexOf(t.id))),I=l.map((e=>{const t=`${e.from.insId}.${e.from.pinId}`,n=`${e.to.insId}.${e.to.pinId}`;return f[n]?{...e,to:{insId:v.id,pinId:f[n]}}:m[t]?{...e,from:{insId:v.id,pinId:m[t]}}:e})).filter((t=>-1===e.indexOf(t.from.insId)&&-1===e.indexOf(t.to.insId)));return{newNode:p,currentNode:(0,s.default)(t,(e=>{e.instances=[...g,v],e.connections=I}))}}},74089:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(97106),t),i(n(18420),t),i(n(90680),t),i(n(84472),t),i(n(17102),t),i(n(82232),t),i(n(25779),t),i(n(25804),t),i(n(9958),t),i(n(68120),t),i(n(94651),t),i(n(73470),t),i(n(94007),t),i(n(60190),t),i(n(9001),t),i(n(7047),t),i(n(23386),t)},31745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoTooltip=void 0;const o=n(35250),i=n(50382),s=n(50382),r=n(44470),a=n(50382);t.InfoTooltip=e=>{const{content:t}=e;return(0,o.jsx)(s.Tooltip,{content:t,placement:"top",className:"info-tooltip",children:(0,o.jsx)(i.Icon,{icon:(0,o.jsx)(r.InfoSign,{className:a.Classes.INTENT_PRIMARY}),intent:i.Intent.SUCCESS,className:"info-tooltip-icon"})})}},83938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserOnlyReactJson=void 0;const o=n(35250);t.BrowserOnlyReactJson=e=>{if("undefined"==typeof window)return null;const t=n(73541).Z;return(0,o.jsx)(t,{...e})}},94651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsValueRenderer=void 0;const o=n(35250),i=n(74762),s=n(83938);t.AnalyticsValueRenderer=e=>{let{val:t}=e;try{const e=JSON.parse(t),n="object"==typeof e?e:{value:e},r=e&&[e.type,e.key,e.props,e.ref].every(i.isDefined),a=r?{jsxValue:e}:n;return(0,o.jsx)(s.BrowserOnlyReactJson,{src:a,collapseStringsAfterLength:50,collapsed:r})}catch(n){return(0,o.jsx)(s.BrowserOnlyReactJson,{src:{value:t},collapseStringsAfterLength:50})}}},22513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=void 0;const o=n(74762),i=n(74762),s=n(60190),r=n(88593);t.createGroup=async(e,t,n,a)=>{if(0===e.length)throw new Error("cannot create group without instances");const u=e.map((e=>e.id)),l=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return!t&&n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.to,e.to)))===t)),c=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return t&&!n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.from,e.from)))===t));let d={},p={},f={},m={};const h=[],v={};for(const o of l){const e=`${o.to.insId}.${o.to.pinId}`,t=`${o.from.insId}.${o.from.pinId}`,n=o.to.pinId;if(f[t]){h.push({from:(0,i.externalConnectionNode)(f[t]),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)});continue}const r=v[n]?await a(`Name this input (${n} of ${o.to.insId}) is already taken:`)||`i${(0,s.rnd)()}`:n;d[e]=r,f[t]=r,h.push({from:(0,i.externalConnectionNode)(r),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)}),v[r]=(0,i.nodeInput)()}const g={};for(const r of c){const e=`${r.to.insId}.${r.to.pinId}`,t=`${r.from.insId}.${r.from.pinId}`,n=r.from.pinId;if(m[e]){h.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(m[e])});continue}const u=g[n]?await a(`Name this output (${n} of ${r.from.insId} is already taken:`)||`i${(0,s.rnd)()}`:n;p[t]=u,m[e]=u,h.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(u)}),g[u]=(0,o.nodeOutput)()}e.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),e[0].pos);const I=t.filter((e=>u.includes(e.from.insId)&&u.includes(e.to.insId)));return{visualNode:{id:n,inputs:v,outputs:g,instances:e,defaultStyle:{size:"large",color:(0,o.pickRandom)(r.nodeStylePresetColors.map((e=>e.color)))},inputsPosition:(0,o.okeys)(v).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:0}})),{}),outputsPosition:(0,o.okeys)(g).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:400}})),{}),connections:[...I,...h],completionOutputs:(0,o.okeys)(g)},renamedInputs:d,renamedOutputs:p}}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightText=void 0;const o=n(35250);function i(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}t.highlightText=(e,t)=>{let n=0;const s=t.split(/\s+/).filter((e=>e.length>0)).map(i);if(0===s.length)return[e];const r=new RegExp(s.join("|"),"gi"),a=[];for(;;){const t=r.exec(e);if(!t)break;const i=t[0].length,s=e.slice(n,r.lastIndex-i);s.length>0&&a.push(s),n=r.lastIndex,a.push((0,o.jsx)("strong",{children:t[0]},n))}const u=e.slice(n);return u.length>0&&a.push(u),a}},17102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Loader=void 0;const o=n(35250);t.Loader=()=>(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)("svg",{width:"38",height:"38",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:"#007ec6",children:(0,o.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,o.jsxs)("g",{transform:"translate(1 1)",strokeWidth:"2",children:[(0,o.jsx)("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),(0,o.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:(0,o.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})})})},23386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;const o=n(74762);t.logger=(0,o.debugLogger)("editor")},561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadMonaco=void 0;const o=n(51848),i=n(23386);let s=!1;t.preloadMonaco=()=>{s||o.loader.init().then((()=>{(0,i.logger)("monaco preloaded"),s=!0}))}},68120:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHotkeys=t.currentHotkeys=void 0;const i=o(n(45240)),s=n(70079);t.currentHotkeys=new Map,t.useHotkeys=function(e,n,o,r,a){void 0===r&&(r=[]);const u=(0,s.useCallback)((function(){a&&!a.current||n(...arguments)}),[...r,n]);(0,s.useEffect)((()=>((0,i.default)(e,{},u),t.currentHotkeys.set(e,o),()=>{t.currentHotkeys.delete(e),i.default.unbind(e,u)})),[e,u,o])}},94007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeSessionStorage=t.safeLocalStorage=void 0,t.safeLocalStorage={getItem:function(){try{return localStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return localStorage.setItem(...arguments)}catch(e){return null}}},t.safeSessionStorage={getItem:function(){try{return sessionStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return sessionStorage.setItem(...arguments)}catch(e){return null}}}},90680:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocalStorage=t.useResizePref=t.userPreferences=t.useUserPref=void 0;const r=s(n(70079)),a=n(18420),u=n(94007);t.useUserPref=(e,n)=>{const[o,i]=r.useState((()=>{const o=t.userPreferences.getItem(e);return(0,a.isDefined)(o)?o:n}));r.useEffect((()=>{const o=t.userPreferences.getItem(e),s=(0,a.isDefined)(o)?o:n;i(s)}),[e]);return[o,n=>{t.userPreferences.setItem(e,n),i(n)}]},t.userPreferences=(()=>{const e=e=>`up.${e}`;return{getItem:t=>{const n=u.safeLocalStorage.getItem(e(t))||"",o=u.safeSessionStorage.getItem(e(t))||"";try{return JSON.parse(o||n).value}catch(i){return}},setItem:function(t,n,o){void 0===o&&(o=!1);const i=o?sessionStorage:u.safeLocalStorage;try{const o=JSON.stringify({value:n});return i.setItem(e(t),o),!0}catch(s){return console.error("Error saving user preference",s),!1}}}})();t.useResizePref=(e,n)=>{const o=`resize.${e}`;return(0,t.useUserPref)(o,n)};const l=e=>{const t=u.safeLocalStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch(n){return null}};t.useLocalStorage=(e,t)=>{const[n,o]=r.useState(l(e)||t),i=r.useCallback((t=>{u.safeLocalStorage.setItem(e,JSON.stringify({value:t})),o(t)}),[e]);return r.useEffect((()=>{l(e)||u.safeLocalStorage.setItem(e,JSON.stringify({value:t}))}),[e,t,i]),[n,i]}},60190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.totalEnergy=t.itrPhysics=t.hookes=t.coulombs=t.vToStr=t.vNorm=t.vLen=t.vSub=t.vAdd=t.vDiv=t.vMul=t.vZero=t.rnd=t.vec=t.size=void 0;t.size=(e,t)=>({width:e,height:t});t.vec=(e,t)=>({x:e,y:t});t.rnd=function(e,t){return void 0===e&&(e=100),void 0===t&&(t=0),Math.floor(Math.random()*(e-t))+t},t.vZero={x:0,y:0};t.vMul=(e,t)=>{let{x:n,y:o}=e;return{x:n*t,y:o*t}};t.vDiv=(e,n)=>{let{x:o,y:i}=e;return(0,t.vMul)({x:o,y:i},1/n)};t.vAdd=(e,t)=>({x:e.x+t.x,y:e.y+t.y});t.vSub=(e,n)=>(0,t.vAdd)(e,(0,t.vMul)(n,-1));t.vLen=e=>{let{x:t,y:n}=e;return Math.sqrt(t*t+n*n)};t.vNorm=e=>(0,t.vDiv)(e,(0,t.vLen)(e)||1);t.vToStr=e=>{let{x:t,y:n}=e;return`${t.toFixed(1)},${n.toFixed(1)}`};t.coulombs=(e,n,o)=>{const i=(0,t.vLen)((0,t.vSub)(e.p,n.p));if(0===i){const i=(0,t.vec)(2*Math.random()-1,2*Math.random()-1),s=e.m*n.m/Math.pow(10,2);return(0,t.vMul)(i,s*o)}{const s=(0,t.vNorm)((0,t.vSub)(n.p,e.p)),r=e.m*n.m/Math.pow(i+.1,2);return(0,t.vMul)(s,r*o)}};t.hookes=(e,n,o,i,s)=>{const r=(0,t.vLen)((0,t.vSub)(e.p,n.p)),a=(0,t.vNorm)((0,t.vSub)(e.p,n.p));let u=0;return ri&&(u=i-r),(0,t.vMul)(a,s*u)};t.itrPhysics=(e,n)=>{const{p:o,v:i,f:s,m:r}=n,a=(0,t.vDiv)(s,r),u=e/1e3,l=(0,t.vAdd)((0,t.vMul)(a,u),i),c=(0,t.vAdd)((0,t.vMul)(l,u),o);return{...n,p:c,v:l,f:(0,t.vec)(0,0)}};t.totalEnergy=e=>e.reduce(((e,n)=>{const o=(0,t.vLen)(n.v);return e+.5*n.m*o*o}),0)},84472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateToast=t.toastMsg=t.AppToaster=void 0;const o=n(50382);t.AppToaster=(()=>{try{return o.OverlayToaster.create({className:"app-toaster",position:o.Position.BOTTOM_RIGHT})}catch(e){return{}}})();t.toastMsg=(e,n,o)=>t.AppToaster.show({message:e,intent:n,timeout:o});t.updateToast=(e,n,o)=>t.AppToaster.show({message:n,intent:o},e)},18420:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultAnd=t.isLocal=t.fullTime=t.timeAgoFromDt=t.timeAgo=t.toString=t.isDefined=t.set=t.createOmap=t.toOmap=t.values=t.keys=t.entries=void 0;const i=n(7047),s=n(74762),r=o(n(73136));t.entries=e=>Object.keys(e).map((t=>[t,e[t]]));t.keys=e=>Object.keys(e);t.values=e=>Object.keys(e).map((t=>e[t]));t.toOmap=e=>Array.from(e.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.createOmap=function(e){return void 0===e&&(e=[]),e.reduce(((e,t)=>({...e,[t[0]]:t[1]})),{})};t.set=(e,t,n)=>{e[t]=n};t.isDefined=e=>void 0!==e;t.toString=e=>{const t=typeof e;if(""===e)return"(empty string)";if((0,i.isJsxValue)(e))return"JSX Value";if((0,s.isStaticValueVisualNode)(e))return"Embedded Node";if((0,s.isEnvValue)(e))return(0,s.getEnvKeyFromValue)(e);if("object"===t)try{const t=JSON.stringify(e);return"{}"===t?"Empty object":t}catch(n){return"Object (cannot stringify)"}return`${e}`};t.timeAgo=e=>(0,r.default)(new Date(e)).fromNow();t.timeAgoFromDt=e=>(0,r.default)(Date.now()-e).fromNow();t.fullTime=e=>(0,r.default)(new Date(e)).toString();t.isLocal=()=>location.href.includes(":300");t.preventDefaultAnd=e=>t=>{t.preventDefault(),e(t)}},67181:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ActionButton=t.ActionsMenu=t.ActionType=void 0;const r=n(35250),a=n(50382),u=n(50382),l=n(74762),c=s(n(70079)),d=n(86125),p=n(43490),f=n(68120),m=n(90680),h=n(84472),v=n(9971),g=n(47749),I=n(46334),y=n(47230),b=n(41032);var C;!function(e){e.AddNode="add-node",e.RemoveNode="remove-node",e.Group="group",e.UnGroup="un-group",e.AddInlineValue="add-inline-value",e.Inspect="inspect",e.Run="run",e.AI="ai"}(C=t.ActionType||(t.ActionType={}));t.ActionsMenu=e=>{const{onAction:n,selectedInstances:o,resolvedNodes:i,node:s,from:u,to:g,hotkeysEnabled:_,showRunFlowOptions:w}=e,{onRequestImportables:N}=(0,d.useDependenciesContext)(),[j,P]=c.default.useState(!1),[O,E]=c.default.useState(!1),[S,D]=c.default.useState(!1),[T,M]=c.default.useState(null),[k,R]=(0,m.useLocalStorage)("hideHotkeyHintMap",{}),A=(0,c.useCallback)((()=>{P(!1)}),[]),{onRunFlow:V,generateNodeFromPrompt:$,reportEvent:L}=(0,p.usePorts)(),z=(0,c.useCallback)(((e,t)=>(E(!1),V(e,t))),[V]),H=[];if(H.push(C.AddNode),H.push(C.AddInlineValue),1===o.length){const e=s.instances.find((e=>e.id===o[0]));if(e)try{const t=(0,b.safelyGetNodeDef)(e,i);(0,l.isVisualNode)(t)&&H.push(C.UnGroup)}catch(U){console.error(`Could not find node with id ${o[0]} - ${U}`)}else console.error(`Could not find instance with id ${o[0]}`)}w&&H.push(C.Run),o.length>0&&H.push(C.Group),(1===o.length||u||g)&&H.push(C.Inspect),o.length>0&&H.push(C.RemoveNode),H.push(C.AI);const F=(0,c.useCallback)(((e,t)=>{R({...k,[e]:!0}),h.AppToaster.dismiss(t)}),[k,R]),G=(0,c.useCallback)(((e,t)=>{const{hotkey:o}=x[e];if("click"===t.type&&o&&!k[o]){const t=(0,h.toastMsg)((0,r.jsxs)(r.Fragment,{children:["Did you know? you can also use the hotkey"," ",(0,r.jsx)("kbd",{className:"hotkey",children:o})," to"," ",x[e].text.replace(/^[A-Z]/,(e=>e.toLowerCase())),(0,r.jsxs)(a.Button,{minimal:!0,small:!0,onClick:()=>F(o,t),children:[" ","Don't show again"," "]})]}),"none",3e3)}switch(e){case C.AddNode:P(!0);break;case C.Run:!async function(){E(!0)}();break;case C.AI:D(!0);break;default:n({type:e,data:void 0})}}),[k,n,F,s.inputs]);Object.entries(x).forEach((e=>{let[t,n]=e;n.hotkey&&(0,f.useHotkeys)(n.hotkey,(e=>{e.preventDefault(),H.includes(t)&&(G(t,e),R({...k,[n.hotkey]:!0}))}),{text:n.text,group:"Action menu hotkeys"},[H],_)}));const q=(0,c.useCallback)((e=>{n({type:C.AddNode,data:{importableNode:e}})}),[n]),B=(0,c.useCallback)((async e=>{const t=Date.now();M(t);try{L("generateNodeFromPrompt:start",{promptLength:e.length});const o=await $({prompt:e}),{inputs:i,outputs:s}=o.importableNode.node,r=Date.now()-t;L("generateNodeFromPrompt:success",{totalTime:r,inputs:Object.keys(i),outputs:Object.keys(s)}),M(null),n({type:C.AI,data:o}),D(!1)}catch(U){M(null),h.AppToaster.show({message:"Failed to generate node",intent:"danger"}),L("generateNodeFromPrompt:failure",{error:U.message})}}),[$,n,L]);return(0,r.jsxs)("div",{className:"actions-menu",children:[H.map((e=>(0,r.jsx)(t.ActionButton,{type:e,onClick:G},e))),j?(0,r.jsx)(v.AddNodeMenu,{onRequestImportables:N,onAddNode:q,onClose:A}):null,O?(0,r.jsx)(y.RunFlowModal,{onClose:()=>E(!1),onRun:z,node:s}):null,S?(0,r.jsx)(I.PromptAIMenu,{onClose:()=>{D(!1),M(null)},onSubmit:B,submitting:null!==T,submitTime:T}):null]})};const x={[C.AddNode]:{icon:g.addNodeIcon,text:'Open the "add node" menu',hotkey:"a"},[C.RemoveNode]:{icon:g.removeNodeIcon,text:"Remove selected instances",hotkey:"backspace"},[C.Group]:{icon:g.groupIcon,text:"Group selection into a new node",hotkey:"g"},[C.UnGroup]:{icon:g.ungroupIcon,text:"Ungroup selected visual node"},[C.Inspect]:{icon:g.inspectIcon,text:"Inspect data",hotkey:"i"},[C.AddInlineValue]:{icon:g.pencilIcon,text:"Add value / inline function",hotkey:"v"},[C.Run]:{icon:g.playIcon,text:"Run flow",hotkey:"r"},[C.AI]:{icon:g.starIcon,text:"Generate new code node using AI \u2728"}},_={icon:"",text:"N/A",hotkey:void 0};t.ActionButton=e=>{var t;const{onClick:n,type:o}=e,i=(0,c.useCallback)((e=>n(o,e)),[n,o]),s=null!==(t=x[o])&&void 0!==t?t:_,a=s.hotkey?(0,r.jsxs)("span",{children:[s.text," ",(0,r.jsx)("kbd",{className:"hotkey",children:s.hotkey})]}):s.text;return(0,r.jsx)("div",{className:"action-button",onClick:i,"data-type":o,children:(0,r.jsx)(u.Tooltip,{hoverOpenDelay:100,content:a,className:"icon-wrapper",popoverClassName:"action-button-tooltip",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s.icon}})})})}},40149:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenu=t.AddNodeMenuFilterTree=void 0;const a=n(35250),u=n(50382),l=n(74762),c=r(n(26372)),d=s(n(70079)),p=n(43490),f=n(31745),m=n(17102),h=n(87935),v=n(74657),g=n(44470);t.AddNodeMenuFilterTree=u.Tree.ofType();function I(e,t,n){return[...e.external.map((e=>({id:e.module,label:e.module,hasCaret:!0,nodeData:{type:"external",module:e.module},isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module,isExpanded:n.has(e.module),childNodes:e.namespaces.map((o=>({id:`${e.module}/${o}`,label:o,hasCaret:!1,isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module&&t.namespace===o,isExpanded:n.has(`${e.module}/${o}`),nodeData:{type:"external",module:e.module,namespace:o}})))}))),{id:"internal",label:"Current Project",nodeData:{type:"internal"},isExpanded:n.has("internal"),hasCaret:!0,isSelected:"internal"===t.type,childNodes:e.internal.files.map((e=>({id:e,label:e,isSelected:"internal"===t.type&&t.file===e,hasCaret:!1,isExpanded:n.has(e),nodeData:{type:"internal",file:e}})))}]}function y(e){return/\.flyde(\.[jt]s)?$/.test(e.module)}t.AddNodeMenu=e=>{const{onRequestImportables:n,onAddNode:o,onClose:i}=e,[s,r]=d.default.useState(),[b,C]=d.default.useState([]),[x,_]=d.default.useState(new Set),[w,N]=d.default.useState(""),[j,P]=d.default.useState({type:"all"}),[O,E]=d.default.useState(null),[S,D]=d.default.useState(null),[T,M]=d.default.useState(null),k=(0,d.useCallback)((e=>{x.add(e.id),_(new Set(x))}),[x]),R=(0,d.useCallback)((e=>{x.delete(e.id),_(new Set(x))}),[x]),A=(0,d.useCallback)((e=>{o(e),i()}),[o,i]),{onInstallRuntimeRequest:V,reportEvent:$}=(0,p.usePorts)();(0,d.useEffect)((()=>{$("addNodeMenuOpen",{})}),[$]),(0,d.useEffect)((()=>{D(null==s?void 0:s.flatMap((e=>{var t,n,o;if(j)if("external"===j.type){if((e.module!==j.module||j.namespace)&&e.node.namespace!==j.namespace)return[]}else if("internal"===j.type&&(!y(e)||j.file&&e.module!==j.file))return[];if(w){const i=`${null!==(n=null===(t=e.node.searchKeywords)||void 0===t?void 0:t.join(" "))&&void 0!==n?n:[]} ${e.node.id} ${null!==(o=e.node.namespace)&&void 0!==o?o:""} ${e.node.description}`.toLowerCase().indexOf(w.toLowerCase());return-1===i?[]:[{importable:e,score:i}]}return[{importable:e,score:1}]})).sort(((e,t)=>e.score-t.score)).map((e=>{let{importable:t}=e;return t})))}),[s,j,w]),(0,d.useEffect)((()=>{n().then((e=>{let{importables:t,errors:n}=e;C(n);const o=t.filter((e=>!y(e))).reduce(((e,t)=>{var n,o,i;null!==(n=e[i=t.module])&&void 0!==n||(e[i]=[]);const s=null!==(o=t.node.namespace)&&void 0!==o?o:"";return e[t.module].includes(s)||e[t.module].push(s),e}),{}),i=t.filter(y).map((e=>e.module));E({external:Object.entries(o).map((e=>{let[t,n]=e;return{module:t,namespaces:n}})),internal:{files:i}}),r(t),_(new Set(["internal",...Object.keys(o)]))}))}),[n]);const L=(0,d.useCallback)((e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),S&&!T)return void M(S["ArrowDown"===e.key?0:S.length-1]);if(S&&T){const t=S.findIndex((e=>e===T));let n="ArrowDown"===e.key?t+1:t-1;n=n<0?S.length-1:n,n=n>=S.length?0:n,M(S[n])}break;case"Enter":T&&A(T)}}),[S,T,A]),z=(0,d.useCallback)((e=>{let{nodeData:t}=e;JSON.stringify(t)===JSON.stringify(j)?"external"===t.type?t.namespace?P({type:"external",module:t.module}):P({type:"all"}):"internal"===t.type&&(t.file?P({type:"internal"}):P({type:"all"})):P(t)}),[j]),H=!s||s.some((e=>e.module.includes("@flyde/stdlib"))),F=(0,d.useCallback)((()=>{V(),i()}),[i,V]);return(0,a.jsx)(u.Dialog,{isOpen:!0,title:"Add Node Menu",onClose:e.onClose,className:"add-node-menu",isCloseButtonShown:!0,children:(0,a.jsxs)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),children:[(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"bp5-input-group",children:[(0,a.jsx)(g.Search,{}),(0,a.jsx)("input",{className:"bp5-input",type:"search",placeholder:"Search input",dir:"auto",autoFocus:!0,onChange:e=>N(e.target.value),value:w,onKeyDown:L})]}),H?null:(0,a.jsxs)(u.Callout,{intent:u.Intent.NONE,style:{marginTop:10},children:["Using built-in @flyde/stdlib. It's recommended to explicitly install it instead."," ",(0,a.jsx)(u.Button,{minimal:!0,small:!0,intent:u.Intent.PRIMARY,onClick:F,children:"Click here to install it using npm/yarn"})]})]}),(0,a.jsx)("div",{className:"content-wrapper",children:s?(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsxs)("aside",{children:[(0,a.jsxs)("div",{className:"filter-header",children:["Filter by package"," ",(0,a.jsx)(u.Tooltip,{content:(0,a.jsxs)("span",{children:["Click to learn more about how packages work in Flyde"," "]}),hoverCloseDelay:1500,children:(0,a.jsx)("a",{target:"_blank",href:"https://www.flyde.dev/docs/packages",rel:"noreferrer",children:(0,a.jsx)(u.Icon,{icon:(0,a.jsx)(g.Help,{}),intent:"primary",iconSize:12})})})]}),(0,a.jsx)("div",{className:"tree-container",children:(0,a.jsx)(t.AddNodeMenuFilterTree,{contents:I(O,j,x),onNodeCollapse:R,onNodeExpand:k,onNodeClick:z,className:u.Classes.ELEVATION_0})})]}),(0,a.jsx)("main",{children:S?0===S.length?(0,a.jsxs)("div",{className:"no-results",children:[(0,a.jsx)(v.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:P,query:w,onChangeQuery:N,resultsCount:S.length}),(0,a.jsxs)(u.Callout,{className:"callout",intent:"primary",children:["Can't find a suitable node? Create one yourself!"," ",(0,a.jsx)("a",{href:"https://www.flyde.dev/docs/code-nodes",target:"_blank",rel:"noreferrer",children:"Learn more"})]})]}):(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsx)(v.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:P,query:w,onChangeQuery:N,resultsCount:S.length}),(0,a.jsx)("div",{className:"results",children:S.map((e=>(0,a.jsx)(h.AddNodeMenuListItem,{importableNode:e,onAdd:A,selected:(null==T?void 0:T.node)===e.node,onSelect:M,onSetFilter:P},e.node.id+e.node.namespace+e.module)))})]}):(0,a.jsx)(m.Loader,{})})]}):(0,a.jsx)(m.Loader,{})}),b.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",style:{marginTop:"10px"},children:["Found ",(0,l.simplePluralize)(b.length,"corrupt flow"),(0,a.jsx)(f.InfoTooltip,{content:b.map((e=>{let{path:t,message:n}=e;return`${t}: ${n}`})).join(", ")})," "]}):null]})})}},8470:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuListItem=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079));t.AddNodeMenuListItem=e=>{const{importableNode:t,onSetFilter:n,onAdd:o,onSelect:i}=e,{node:s,module:r}=t,{id:d,description:p}=s,f=c.default.useRef(null);c.default.useEffect((()=>{e.selected&&f.current&&f.current.scrollIntoView({block:"center"})}),[e.selected]);const m=(0,c.useCallback)((()=>{o(t)}),[o,t]),h=(0,c.useCallback)((()=>{i(t)}),[i,t]);return(0,a.jsxs)("div",{className:(0,l.default)("add-node-menu-list-item",{selected:e.selected}),ref:f,onClick:h,children:[(0,a.jsxs)("div",{className:"content",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("span",{className:"id",children:d}),(0,a.jsxs)(u.Tag,{interactive:!0,onClick:()=>n({type:"external",module:r,namespace:s.namespace}),className:"source",minimal:!0,children:[r,s.namespace?` / ${s.namespace}`:null]})]}),(0,a.jsx)("div",{className:"description",children:p||(0,a.jsx)("em",{children:"No description"})})]}),(0,a.jsx)("aside",{children:(0,a.jsx)(u.Button,{onClick:m,children:"Add"})})]})}},87935:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8470),t)},88671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuResultsSummary=void 0;const o=n(35250),i=n(50382);t.AddNodeMenuResultsSummary=e=>{const{resultsCount:t,query:n,filter:s,onChangeFilter:r,onChangeQuery:a}=e;return(0,o.jsxs)("div",{className:"add-node-menu-results-summary",children:[t?`Showing ${t} result${t>1?"s":""}`:"No results found","\xa0",n?(0,o.jsxs)(o.Fragment,{children:["matching query\xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>a(""),children:['"',n,'"']})]}):null,"all"===s.type?null:"external"===s.type?(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["package ",s.module,s.namespace?` / ${s.namespace}`:null]})]}):(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["\xa0this project ",s.file?` / ${s.file}`:null]})]})]})}},74657:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88671),t)},9971:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40149),t)},83159:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PromptAIMenu=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=1e4;t.PromptAIMenu=e=>{const{onClose:t}=e,[n,o]=c.default.useState(""),[i,s]=c.default.useState(0);return(0,c.useEffect)((()=>{s(0);const t=setInterval((()=>{s((t=>{const n=(Date.now()-e.submitTime)/d;return Math.min(n+.05*Math.random()/2,.95)}))}),500);return()=>clearInterval(t)}),[e.submitTime]),(0,a.jsxs)(u.Dialog,{isOpen:!0,onClose:t,className:"prompt-ai-menu",title:"\u2728 Generate Code Node using AI",children:[(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsx)(u.TextArea,{value:n,disabled:e.submitting,onChange:e=>o(e.target.value),placeholder:"Describe your node in details",fill:!0})}),e.submitTime?(0,a.jsx)("div",{className:"progress-bar-container",children:(0,a.jsx)(u.ProgressBar,{value:i})}):null,(0,a.jsx)("div",{className:u.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:u.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(u.Button,{onClick:t,children:"Close"}),(0,a.jsx)(u.Button,{intent:u.Intent.PRIMARY,className:"run-btn",disabled:e.submitting||!n,loading:e.submitting,onClick:()=>{s(0),e.onSubmit(n)},children:"Create \u2728"})]})})]})}},46334:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(83159),t)},3152:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RunFlowModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(90680),f=n(31745);t.RunFlowModal=u.memo((function(e){const{onRun:t,onClose:n,node:o}=e,[i,s]=u.useState(0),[r,m]=(0,p.useLocalStorage)(`run-inputs-${o.id}`,Object.keys(o.inputs).reduce(((e,t)=>(e[t]=`Enter a value for input ${t}`,e)),{})),[h,v]=u.useState(JSON.stringify(r,null,2)),g=e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})},I=u.useCallback((()=>{const e=JSON.parse(h);m(e),t(e,i)}),[t,m,h,i]),y=Object.keys(o.inputs),b=y.filter((e=>"required"!==o.inputs[e].mode)),C=u.useMemo((()=>y.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:"This node receives external inputs. Enter values for each input below:"}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"json",value:h,onChange:e=>v(null!=e?e:""),onMount:g}),b.length>0?(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Note: input(s) ",(0,a.jsx)("code",{children:b.join(", ")})," are optional"]}):null]}):(0,a.jsx)("strong",{children:"This node does not receive any external inputs."})),[y.length,b,h]);return(0,a.jsxs)(c.Dialog,{isOpen:!0,onClose:e.onClose,className:"run-flow-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&I()},tabIndex:0,children:[C,(0,a.jsxs)("div",{className:"execution-delay-wrapper",children:[(0,a.jsxs)("label",{children:["Execution delay:"," ",(0,a.jsx)(f.InfoTooltip,{content:"Delay between each node execution. Useful for debugging."})]}),(0,a.jsx)(c.Slider,{value:i,onChange:s,min:0,labelStepSize:500,stepSize:100,labelRenderer:e=>`${e}ms`,max:1e3})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:n,children:"Close"}),(0,a.jsx)(c.Button,{onClick:I,intent:c.Intent.PRIMARY,className:"run-btn",children:"Run"})]})})]})}))},47230:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3152),t)},47749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starIcon=t.stopIcon=t.playIcon=t.pencilIcon=t.ungroupIcon=t.groupIcon=t.inspectIcon=t.removeNodeIcon=t.addNodeIcon=void 0,t.addNodeIcon='\n\n',t.removeNodeIcon='\n\n',t.inspectIcon='\n\n\n',t.groupIcon='\n\n\n',t.ungroupIcon='\n\n\n',t.pencilIcon='\n\n',t.playIcon='\n\n\n',t.stopIcon='\n\n\n',t.starIcon='\n\n\n\n\n'},1237:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HelpBubble=void 0;const i=n(70079),s=n(35250),r=n(50382),a=n(99489),u=n(50382),l=o(n(70079)),c=n(68120),d=n(71644),p=n(43490),f={offset:{enabled:!0,options:{offset:[0,20]}},preventOverflow:{enabled:!0,options:{padding:10}}};const m=["Viewport Controls","Editing","Selection"];t.HelpBubble=()=>{const[e,t]=l.default.useState(!1),n=Array.from(c.currentHotkeys.entries()).map((e=>{let[t,n]=e;return{combo:(o={key:t,menuData:n}).key,label:o.menuData.text,group:o.menuData.group};var o})).reduce(((e,t)=>(e[t.group]||(e[t.group]=[]),e[t.group].push(t),e)),{}),o=Object.entries(n).sort(((e,t)=>m.indexOf(t[0])-m.indexOf(e[0]))),{reportEvent:h}=(0,p.usePorts)(),v=(0,s.jsx)(r.Dialog,{isOpen:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:r.Classes.DIALOG_BODY,children:o.map((e=>{let[t,n]=e;return(0,s.jsxs)(l.default.Fragment,{children:[(0,s.jsx)(r.H4,{children:t}),n.map((e=>(0,i.createElement)(a.Hotkey,{...e,key:e.combo})))]},t)}))})}),g=(0,s.jsxs)(r.Menu,{children:[(0,s.jsx)(r.MenuItem,{text:"Hotkeys",onClick:()=>{t(!0),h("helpMenuItem",{item:"hotkeys"})}}),(0,s.jsx)(r.MenuItem,{text:"Documentation",onClick:()=>h("helpMenuItem",{item:"documentation"}),href:"https://www.flyde.dev/docs",target:"_blank"}),(0,s.jsx)(r.MenuDivider,{}),(0,s.jsx)(r.MenuItem,{text:"Discord",onClick:()=>h("helpMenuItem",{item:"discord"}),href:"https://discord.gg/x7t4tjZQP8",target:"_blank"})]});return(0,s.jsxs)("div",{className:"help-bubble","data-tip":"Help",children:[(0,s.jsx)(u.Popover,{content:g,modifiers:f,onOpened:()=>h("helpMenuOpen",{}),children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:d.helpIcon}})}),v]})}},71644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpIcon=void 0,t.helpIcon='\n\n\n'},3354:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1237),t)},7011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainInstanceEventsIndicator=void 0;const o=n(35250),i=n(30994),s=n(66189),r=n(50382);t.MainInstanceEventsIndicator=e=>{const{currentInsId:t,ancestorsInsIds:n}=e,{history:a,refreshHistory:u,resetHistory:l}=(0,s.useHistoryHelpers)(t),c=`main-indicator-${t}}`;return(0,o.jsx)("div",{className:"main-instance-events-indicator",children:(0,o.jsx)(r.Tooltip,{content:(0,s.calcHistoryContent)(a),children:(0,o.jsx)("span",{onMouseEnter:u,onMouseOut:l,id:(0,i.getMainInstanceIndicatorDomId)(t,n),className:"status-text","data-tip":"","data-html":!0,"data-for":c})})})}},22714:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7011),t)},63521:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VisualNodeEditor=t.defaultBoardData=t.defaultViewPort=t.NODE_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=n(74762),c=n(86553),d=n(65082),p=n(18420),f=n(26701),m=n(7047),h=n(53865),v=n(70079),g=n(68120),I=r(n(27942)),y=n(50382),b=n(66005),C=n(60190),x=n(71033),_=n(74762),w=n(99942),N=n(44338),j=n(561),P=n(84472),O=n(82232),E=n(18594),S=n(68371),D=r(n(61888)),T=n(65758),M=n(43490),k=r(n(26372)),R=n(25044),A=n(80510),V=n(1788),$=n(2130),L=n(88593),z=n(97106),H=n(67181),F=n(22714),G=n(3354),q=n(41032),B=n(30653),U=u.memo(y.Slider),W=()=>null;t.NODE_HEIGHT=28;t.defaultViewPort={pos:{x:0,y:0},zoom:1},t.defaultBoardData={selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}},t.VisualNodeEditor=u.memo(u.forwardRef(((e,n)=>{const{onChangeNode:o,nodeIoEditable:i,onCopy:s,onGoToNodeDef:r,onInspectPin:J,boardData:Y,onChangeBoardData:K,currentInsId:Q,ancestorsInsIds:X,node:ee,onShowOmnibar:te,resolvedDependencies:ne,queuedInputsData:oe,initialPadding:ie,disableScrolling:se}=e,{onImportNode:re}=(0,z.useDependenciesContext)(),ae=(0,B.useDarkMode)(),{reportEvent:ue}=(0,M.usePorts)(),le=e.parentViewport||t.defaultViewPort,[ce,de]=(0,v.useState)({...ne,[ee.id]:ee});(0,v.useEffect)((()=>{de({...ne,[ee.id]:ee})}),[ne,ee]);const{selected:pe,from:fe,to:me}=Y,{instances:he,connections:ve,inputsPosition:ge,outputsPosition:Ie,inputs:ye,outputs:be}=ee,[Ce,xe]=(0,v.useState)(),[_e,we]=(0,v.useState)(),Ne=void 0===X,[je,Pe]=(0,v.useState)(0),[Oe,Ee]=(0,v.useState)(),[Se,De]=(0,v.useState)(!1),[Te,Me]=(0,v.useState)(),[ke,Re]=(0,v.useState)(),[Ae,Ve]=(0,v.useState)(),[$e,Le]=(0,v.useState)(),ze=(0,v.useRef)();(0,f.useDidMount)((()=>{ze.current=Xe.current.querySelector(".inline-editor-portal-root")}));const He=(0,M.useConfirm)(),Fe=(0,M.usePrompt)(),Ge=Y.viewPort,qe=(0,v.useRef)(!0),[Be,Ue]=(0,v.useState)(null),We=u.useCallback((e=>{K({viewPort:e})}),[K]),Ze=u.useCallback(((e,t)=>J(e,t)),[J]),Je=u.useCallback(((e,t,n)=>{const i=(0,A.handleConnectionCloseEditorCommand)(ee,{from:e,to:t}),s=(0,l.isInternalConnectionNode)(t)?he.find((e=>e.id===t.insId)):null,r=(s?s.inputConfig:{})[t.pinId],a=(0,l.isStaticInputPinConfig)(r)?(0,V.handleDetachConstEditorCommand)(i,t.insId,t.pinId):i;o(a,(0,O.functionalChange)("close-connection")),K({from:void 0,to:void 0}),ue("createConnection",{source:n})}),[he,o,K,ee,ue]),Ye=u.useCallback((async()=>{const e=await Fe("New visual node name?");if(!e)return;const{currentNode:t}=await(0,T.groupSelected)(Y.selected,ee,e,"inline",Fe);o(t,(0,O.functionalChange)("group node")),(0,P.toastMsg)("Node grouped"),ue("groupSelected",{count:Y.selected.length})}),[Fe,Y.selected,o,ee,ue]);(0,v.useEffect)((()=>{if(Oe){const e=setTimeout((()=>{Ee(void 0)}),350);return()=>clearTimeout(e)}}),[Oe]);const[Ke,Qe]=(0,v.useState)();(0,v.useEffect)((()=>{(0,j.preloadMonaco)()}),[]);const Xe=(0,v.useRef)(),et=(0,I.default)(Xe),tt=u.useRef({x:400,y:400}),nt=(0,f.useBoundingclientrect)(Xe)||C.vZero,ot=()=>{const e=(0,m.fitViewPortToNode)(ee,ce,et);(0,m.animateViewPort)(Ge,e,500,(e=>{We(e)}))},it=u.useCallback(((e,t)=>{const{to:n,from:o}=Y,i="input"===t?o:n,s="input"===t?n:o,r={pinId:e,insId:l.THIS_INS_ID},a="input"===t?{from:r}:{to:r};i&&i.pinId===e?K({from:void 0,to:void 0}):s?"input"===t&&n?Je(r,n,"nodeIoClick"):o&&Je(o,r,"nodeIoClick"):K(a)}),[Y,K,Je]),st=u.useCallback(((e,t,n)=>{const i=(0,h.produce)(ee,(o=>{"input"===e?o.inputs[t].description=n:o.outputs[t].description=n}));o(i,(0,O.functionalChange)("Node io description"))}),[o,ee]),rt=u.useCallback(((e,t,n)=>{const{from:o,to:i}=Y;if(fe&&fe.insId===e.id||me&&me.insId===e.id)K({from:void 0,to:void 0});else if("input"===n){const n={insId:e.id,pinId:t};!i||i.pinId!==t||(0,l.isInternalConnectionNode)(i)&&i.insId!==e.id?fe?Je(fe,n,"pinClick"):K({to:n,selected:[]}):K({to:void 0})}else{const n={insId:e.id,pinId:t};!o||o.pinId!==t||(0,l.isInternalConnectionNode)(o)&&o.insId!==e.id?me?Je(n,me,"pinClick"):K({from:n,selected:[]}):K({from:void 0})}}),[Y,fe,K,Je,me]);(0,v.useEffect)((()=>{if(!Se&&et.width){const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);We(t);const n=setTimeout((()=>{const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);e.thumbnailMode||We(t),De(!0)}),100);return()=>clearTimeout(n)}}),[ee,ie,et,e.thumbnailMode,Se,ce,We]);const at=u.useCallback((()=>{const{selected:e}=Y,t=ee.instances.filter((t=>e.includes(t.id))).map((e=>({...e,id:e.id+"-copy"}))),n=ee.connections.filter((t=>{let{from:n,to:o}=t;return e.includes(n.insId)&&e.includes(o.insId)}));s({instances:t,connections:n})}),[Y,s,ee]),ut=u.useCallback((()=>{const{newNode:t,newInstances:n}=(0,R.pasteInstancesCommand)(ee,tt.current,e.clipboardData);o(t,(0,O.functionalChange)("paste instances")),K({selected:n.map((e=>e.id))})}),[o,K,ee,e.clipboardData]),lt=u.useCallback((()=>{const e=ee.id;Ke?"input"===Ke.type?Ke.ins.id===e?it(Ke.pin,"input"):rt(Ke.ins,Ke.pin,"input"):Ke.ins.id===e?it(Ke.pin,"output"):rt(Ke.ins,Ke.pin,"output"):console.warn("tried selecting closest with no pin nearby")}),[ee.id,Ke,it,rt]),ct=u.useCallback(((e,t)=>{const n=Math.min(Math.max(e,.1),3),o="mouse"===t?tt.current:{x:Ge.pos.x+et.width/2,y:Ge.pos.y+et.height/2},i=(0,m.centerBoardPosOnTarget)(o,et,n,Ge);We({...Ge,zoom:n,pos:i})}),[We,Ge,et]);(0,g.useHotkeys)("cmd+=",(e=>{ct(Ge.zoom+.1,"hotkey"),e.preventDefault()}),{text:"Zoom in board",group:"Viewport Controls"},[Ge,ct],qe),(0,g.useHotkeys)("cmd+-",(e=>{ct(Ge.zoom-.1,"hotkey"),e.preventDefault()}),{text:"Zoom out board",group:"Viewport Controls"},[ct,Ge.zoom],qe),(0,g.useHotkeys)("cmd+o",(e=>{e.preventDefault(),(0,P.toastMsg)("Ordering");const t=[];(0,w.orderVisualNode)(ee,ce,200,((e,n)=>{n%3==0&&t.push(e)})),(async()=>{for(;t.length;){const e=t.shift();(0,P.toastMsg)(`Step ${t.length}!`),await(0,l.delay)(200),o(e,(0,O.metaChange)("order-step")),(0,P.toastMsg)(`Step ${t.length}! done`)}})()}),{text:"Auto-layout (experimental)",group:"Misc."},[o,ee,ne],qe),(0,g.useHotkeys)("cmd+0",(e=>{ct(1),e.preventDefault()}),{text:"Reset zoom",group:"Viewport Controls"},[Ge,ct],qe);const dt=()=>{K({from:void 0,to:void 0,selected:[]})},pt=u.useCallback(((e,t)=>{xe(e.id),o({...ee},(0,O.metaChange)("drag-start"))}),[o,ee]),ft=u.useCallback(((e,t,n)=>{const{newValue:i,newSelected:s}=(0,m.handleInstanceDrag)(ee,e,n,t,pe,Ce);o(i,(0,O.metaChange)("drag-move")),s&&K({selected:s})}),[Ce,o,K,pe,ee]),mt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),xe(void 0)}),[]),ht=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),xe(l.THIS_INS_ID)}),[]),vt=u.useCallback((async(t,n,o,i)=>{o.preventDefault(),o.stopPropagation();const{x:s,y:r}=i,a=(0,h.produce)(ee,(e=>{"input"===t?e.inputsPosition[n]={x:s,y:r}:e.outputsPosition[n]={x:s,y:r}}));e.onChangeNode(a,(0,O.metaChange)("node-io-drag-move"))}),[e,ee]),gt=u.useCallback((async(e,t,n,o)=>{n.preventDefault(),n.stopPropagation(),xe(void 0)}),[]),It=u.useCallback(((e,t)=>{let{id:n}=e;const o=t.shiftKey?pe.filter((e=>e!==n)):[],i=t.shiftKey?[...pe,n]:[n],s=pe.includes(n)?o:i;K({selected:s,from:void 0,to:void 0})}),[K,pe]),yt=u.useCallback((()=>{const e=ee.instances.map((e=>e.id));K({selected:e,from:void 0,to:void 0})}),[K,ee.instances]),bt=u.useCallback((e=>{const t=ve.filter((t=>{let{from:n,to:o}=t;return-1===e.indexOf(n.insId)&&-1===e.indexOf(o.insId)})),n=(0,h.produce)(ee,(n=>{n.connections=t,n.instances=n.instances.filter((t=>!e.includes(t.id)))}));K({selected:[]}),o(n,(0,O.functionalChange)("delete-ins"))}),[ve,o,K,ee]),Ct=u.useCallback((e=>{bt([e.id])}),[bt]),xt=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{"input"===e?(delete n.inputs[t],n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===t)))):(n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===t))),n.completionOutputs=(n.completionOutputs||[]).map((e=>e.split("+").filter((e=>e!==t)).join("+"))).filter((e=>!!e)),delete n.outputs[t])}));fe&&fe.insId===l.THIS_INS_ID&&fe.pinId===t?K({from:void 0}):me&&me.insId===l.THIS_INS_ID&&me.pinId===t&&K({to:void 0}),o(n,(0,O.functionalChange)("remove io pin"))}),[ee,fe,me,o,K]),_t=u.useCallback((async()=>{const{selected:e,from:t,to:n}=Y;0===e.length?t&&(0,l.isExternalConnectionNode)(t)?await He(`Are you sure you want to remove main input ${t.pinId}?`)&&xt("input",t.pinId):n&&(0,l.isExternalConnectionNode)(n)&&await He(`Are you sure you want to remove main output ${n.pinId}?`)&&xt("output",n.pinId):bt(e)}),[He,Y,bt,xt]),wt=u.useCallback(((e,t,n)=>{const i=(0,m.getInstancePinConfig)(ee,e.id,t),s=(0,l.isStickyInputPinConfig)(i)?(0,_.queueInputPinConfig)():(0,l.stickyInputPinConfig)();o((0,m.changePinConfig)(ee,e.id,t,s),(0,O.functionalChange)("toggle-sticky")),ue("togglePinSticky",{isSticky:(0,l.isStickyInputPinConfig)(s)})}),[o,ee,ue]),Nt=u.useCallback((()=>{const{newNode:e,newInstances:t}=(0,$.handleDuplicateSelectedEditorCommand)(ee,pe);o(e,(0,O.functionalChange)("duplicated instances")),K({selected:t.map((e=>e.id))})}),[o,K,ee,pe]),jt=u.useCallback((e=>{const t=e.nativeEvent.target;if(0===e.button&&Z(e.nativeEvent,ee.id)&&t&&"board-editor-inner"===t.className){if(Date.now()-je<300)return void te(e);Pe(Date.now());const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,nt),o=(0,m.domToViewPort)(n,Ge,le);we({from:o,to:o})}}),[ee.id,Ge,je,nt,le,te]),Pt=u.useCallback((e=>{if(Ue(null),Z(e.nativeEvent,ee.id)&&_e){if((0,m.calcSelectionBoxArea)(_e)>50){const t=(0,m.getInstancesInRect)(_e,ce,Ge,Kt.current,ee.instances,nt,le),n=e.shiftKey?[...pe,...t]:t;K({selected:n})}we(void 0)}}),[ee.id,ee.instances,_e,ce,Ge,nt,le,pe,K]),Ot=u.useCallback((e=>{if(!Z(e.nativeEvent,ee.id))return void(qe.current=!1);qe.current=!0;const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,(0,C.vAdd)(nt,C.vZero)),o=(0,m.domToViewPort)(n,Ge,le);_e&&we({..._e,to:o});const i=(0,m.findClosestPin)(ee,ce,n,nt,Q,X,Ge),s=Ke;if(i){(!s||s.ins!==i.ins||s.ins===i.ins&&s.pin!==i.pin)&&Qe({ins:i.ins,type:i.type,pin:i.id})}tt.current=o,K({lastMousePos:tt.current})}),[ee,nt,Ge,le,_e,ce,Q,X,Ke,K]),Et=u.useCallback((e=>{var t;"bp5-menu"!==(null===(t=e.relatedTarget)||void 0===t?void 0:t.className)&&(Qe(void 0),qe.current=!1)}),[]),St=u.useCallback(((e,t)=>{if(t){const t=(0,l.isInlineNodeInstance)(e)?e.node:(0,q.safelyGetNodeDef)(e.nodeId,ce);if(!t)throw new Error("Impossible state inspecting inexisting node");if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Cannot inspect a non visual node","warning");Le({insId:`${Q}.${e.id}`,node:t})}else if((0,l.isRefNodeInstance)(e)){const t=(0,q.safelyGetNodeDef)(e,ce);r(t)}else{const t=e.node;if(!(0,l.isInlineValueNode)(t))return void((0,l.isVisualNode)(t)?Le({insId:e.id,node:t}):(0,P.toastMsg)("Editing this type of node is not supported"));const n=atob(t.dataBuilderSource);Ve({insId:e.id,templateType:t.templateType,value:n,type:"existing"}),(0,P.toastMsg)("Editing inline visual node not supported yet")}}),[r,ce,Q]),Dt=u.useCallback((e=>{if((0,l.isInlineNodeInstance)(e)){const t=e.node;if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Not supported","warning");const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.filter((t=>t.id!==e.id)),n.connections=n.connections.filter((t=>{let{from:n,to:o}=t;return n.insId!==e.id&&o.insId!==e.id})),n.instances.push(...t.instances),n.connections.push(...t.connections.filter((e=>(0,l.isInternalConnectionNode)(e.from)&&(0,l.isInternalConnectionNode)(e.to))))}));o(n,{type:"functional",message:"ungroup"}),K({selected:[]})}else{const t=(0,q.safelyGetNodeDef)(e.nodeId,ce);if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Not supported","warning")}}),[ee,o,K,ce]),Tt=u.useCallback((async e=>{}),[]),Mt=u.useCallback(((e,t)=>{const n=(0,V.handleDetachConstEditorCommand)(ee,e.id,t);o(n,(0,O.functionalChange)("detach-const"))}),[o,ee]),kt=u.useCallback(((e,t)=>{const n=e.inputConfig[t]||(0,_.queueInputPinConfig)();(0,l.isStaticInputPinConfig)(n)&&(Re(n.value),P.AppToaster.show({message:"Value copied"}))}),[]),Rt=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{const o=n.instances.find((t=>t.id===e.id));if(!o)throw new Error("Impossible state");o.inputConfig[t]=(0,l.staticInputPinConfig)(ke),n.connections=n.connections.filter((n=>!(0,l.isInternalConnectionNode)(n.to)||!(n.to.insId===e.id&&n.to.pinId===t)))}));o(n,(0,O.functionalChange)("paste const value"))}),[ee,o,ke]),At=u.useCallback((async e=>{const t=await Fe("New name?");if(!t)return;const n=(0,h.produce)(ee,(n=>{var o;"input"===e?(ee.inputs||(n.inputs={}),n.inputs[t]=(0,l.nodeInput)(),n.inputsPosition[t]=tt.current):(ee.outputs||(n.outputs={}),n.outputs[t]=(0,l.nodeOutput)(),n.outputsPosition[t]=tt.current,(null===(o=n.completionOutputs)||void 0===o?void 0:o.length)&&(0,P.toastMsg)("Note that this node has explicit completion outputs set. You may need to update them."))}));o(n,(0,O.functionalChange)("add new io pin")),ue("addIoPin",{type:e})}),[Fe,ee,o,ue]),Vt=u.useCallback((async()=>{var e;const t=null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","),n=await Fe("Edit completion outputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,h.produce)(ee,(e=>{e.completionOutputs=""===n?void 0:n.split(",")}));o(e,(0,O.functionalChange)("change node completions")),ue("editCompletionOutputs",{count:n?n.split(",").length:0})}}),[Fe,o,ee,ue]),$t=u.useCallback((async()=>{var e;const t=null===(e=ee.reactiveInputs)||void 0===e?void 0:e.join(","),n=await Fe("Edit reactive inputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,h.produce)(ee,(e=>{e.reactiveInputs=""===n?void 0:n.split(",")}));o(e,(0,O.functionalChange)("change reactive inputs")),ue("editReactiveInputs",{count:n?n.split(",").length:0})}}),[Fe,o,ee,ue]),Lt=u.useCallback((async()=>{const e=await Fe("Description?",ee.description),t=(0,h.produce)(ee,(t=>{t.description=e}));o(t,(0,O.functionalChange)("Edit node description"))}),[Fe,o,ee]),zt=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{t.defaultStyle=e}));o(t,(0,O.functionalChange)("change default style")),ue("changeStyle",{isDefault:!0})}),[o,ee,ue]),Ht=u.useCallback((async(e,t)=>{const n=await Fe("New name?",t)||t,i=(0,m.handleIoPinRename)(ee,e,t,n);o(i,(0,O.functionalChange)("rename io pin"))}),[ee,o,Fe]),Ft=u.useCallback(((e,t)=>{const n=(0,m.handleChangeNodeInputType)(ee,e,t);o(n,(0,O.functionalChange)("toggle io pin optional"))}),[ee,o]),Gt=u.useCallback((e=>{switch(e.type){case H.ActionType.RemoveNode:{const e=(0,h.produce)(ee,(e=>{if(!(0,l.isVisualNode)(ee))throw new Error("Impossible state, deleting instances opf non visual node");e.instances=e.instances.filter((e=>!pe.includes(e.id))),e.connections=e.connections.filter((e=>!pe.includes(e.from.insId)&&!pe.includes(e.to.insId)))}));K({selected:[]}),o(e,(0,O.functionalChange)("remove-instances")),(0,P.toastMsg)(`Removed ${pe.length} instances(s)`),ue("deleteInstances",{count:pe.length});break}case H.ActionType.Inspect:if(1===pe.length)J(pe[0]);else if(fe||me){const e=null!=fe?fe:me,t=(0,l.isExternalConnectionNode)(e)?l.ROOT_INS_ID:e.insId;J(t,{type:fe?"output":"input",id:e.pinId})}ue("openInspectMenu",{source:"actionMenu"});break;case H.ActionType.Group:(async()=>{await Ye()})();break;case H.ActionType.UnGroup:{const e=ee.instances.find((e=>e.id===pe[0]));Dt(e);const t=(0,q.safelyGetNodeDef)(e,ce);(0,P.toastMsg)(`Ungrouped inline node ${t.id}`),ue("unGroupNode",{instancesCount:t.instances.length});break}case H.ActionType.AddInlineValue:Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"actionMenu"});break;case H.ActionType.AddNode:!async function(){const t=(0,m.getMiddleOfViewPort)(Ge,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Ge.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,h.produce)(ee,(e=>{e.instances.push(r)})),u=(0,h.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,O.functionalChange)("add new instance")),K(u),(0,P.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;case H.ActionType.AI:!async function(){const t=(0,m.getMiddleOfViewPort)(Ge,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Ge.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,h.produce)(ee,(e=>{e.instances.push(r)})),u=(0,h.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,O.functionalChange)("add new instance")),K(u),(0,P.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;default:(0,P.toastMsg)(`${e.type} not supported yet`)}}),[Y,fe,o,K,Ye,re,J,Dt,ee,ce,ue,pe,me,Ge,et]),qt=()=>{const t=Y.from;return(0,p.entries)(ye).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"input",pos:ge[o]||{x:0,y:0},id:o,onDelete:i?xt:void 0,onRename:i?Ht:void 0,onDblClick:Zt,closest:!(!Ke||"input"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,inputMode:s.mode,onChangeInputMode:Ft,viewPort:Ge,onDragStart:ht,onDragEnd:gt,onDragMove:vt,onSelect:it,onSetDescription:st,selected:(null==t?void 0:t.pinId)===o,description:s.description,onMouseUp:wn,onMouseDown:_n},o)}))},Bt=()=>{const{to:t}=Y;return(0,p.entries)(be).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"output",pos:Ie[o]||{x:0,y:0},id:o,onDelete:i?xt:void 0,onRename:i?Ht:void 0,closest:!(!Ke||"output"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,viewPort:Ge,onDragStart:ht,onDragEnd:gt,onDragMove:vt,onSelect:it,onSetDescription:st,description:s.description,selected:(null==t?void 0:t.pinId)===o,onMouseUp:wn,onMouseDown:_n},o)}))},Ut=()=>{if(_e){const{from:e,to:t}=_e,n=(0,m.logicalPosToRenderedPos)(e,Ge),o=(0,m.logicalPosToRenderedPos)(t,Ge),{x:i,y:s,w:r,h:u}=(0,m.getSelectionBoxRect)(n,o);return(0,a.jsx)("div",{className:"selection-box",style:{top:s,left:i,width:r,height:u}})}return null},Wt=u.useCallback((async(e,t,n,o)=>{if("input"===n){const n=e.inputConfig[t],o=(0,l.isStaticInputPinConfig)(n)?JSON.stringify(n.value):void 0;Ve({type:"static-input",insId:e.id,pinId:t,value:null!=o?o:JSON.stringify("Some static value")}),ue("addValueModalOpen",{source:"dblClickPin"})}else{const i=(0,q.safelyGetNodeDef)(e,ce);if(!(0,l.getNodeOutputs)(i)[t])throw new Error("Dbl clicked on un-existing pin");Me({pos:{x:o.clientX,y:o.clientY},ins:e,targetNode:i,pinId:t,pinType:n})}}),[ce,ue]),Zt=u.useCallback((async(e,t)=>{if(!ee.inputs[e])throw new Error("Dbl clicked on un-existing pin");Me({pos:{x:t.clientX,y:t.clientY},pinId:e,pinType:"input",targetNode:ee})}),[ee]),Jt=u.useCallback((e=>{if(e.metaKey||e.ctrlKey){const t=-.005*e.deltaY;ct(Ge.zoom+t,"mouse"),e.preventDefault(),e.stopPropagation()}else{if(se)return;const t=e.deltaX,n=e.deltaY,o=(0,h.produce)(Ge,(e=>{e.pos.x=e.pos.x+t/e.zoom,e.pos.y=e.pos.y+n/e.zoom}));We(o),e.stopPropagation(),e.preventDefault()}}),[se,ct,We,Ge]);(0,v.useEffect)((()=>{const{current:e}=Xe;if(e)return e.addEventListener("wheel",Jt),()=>{e.removeEventListener("wheel",Jt)}}),[Jt]);const Yt={backgroundPositionX:(0,m.roundNumber)(-Ge.pos.x*Ge.zoom),backgroundPositionY:(0,m.roundNumber)(-Ge.pos.y*Ge.zoom),backgroundSize:(0,m.roundNumber)(10*Ge.zoom)+"px"},Kt=u.useRef(new Map);u.useEffect((()=>{const e=he.reduce(((e,t)=>{const n=(0,q.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeInputs)(n))),e}),new Map),t=he.reduce(((e,t)=>{const n=(0,q.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeOutputs)(n))),e}),new Map);e.set(l.THIS_INS_ID,(0,l.keys)(ee.outputs)),t.set(l.THIS_INS_ID,(0,l.keys)(ee.inputs));const n=ve.filter((n=>{const o=e.get(n.to.insId)&&e.get(n.to.insId).includes(n.to.pinId),i=t.get(n.from.insId)&&t.get(n.from.insId).includes(n.from.pinId);return!(o&&i)}));if(n.length>0){(0,P.toastMsg)(`${n.length} orphan connections removed`,"warning"),console.warn(`${n.length} orphan connections removed`,n);const e=(0,h.produce)(ee,(e=>{e.connections=ee.connections.filter((e=>!n.includes(e)))}));o(e,(0,O.functionalChange)("prune orphan connections"))}}),[he,o,ve,ee,ce]),u.useEffect((()=>{let e=[];const t=(0,h.produce)(ee,(t=>{t.instances=t.instances.map((t=>{const n=(0,q.safelyGetNodeDef)(t,ce);if(n){const o=(0,l.getNodeInputs)(n),i=(0,l.getNodeOutputs)(n);if(t.visibleInputs){const n=t.visibleInputs.filter((e=>!o[e]));n.length>0&&(t.visibleInputs=(0,l.keys)(o),e.push(...n))}if(t.visibleOutputs){const n=t.visibleOutputs.filter((e=>!i[e]));n.length>0&&(t.visibleOutputs=(0,l.keys)(i),e.push(...n))}}return t}))}));e.length>0&&((0,P.toastMsg)(`Found ${e.length} invalid visible inputs/outputs: ${e.join(", ")}. Reset them`,"warning"),o(t,(0,O.functionalChange)("reset corrupt visible inputs/outputs")))}),[he,o,ee,ce]),(0,v.useEffect)((()=>{const e=new Map(he.map((e=>[e.id,e])));Kt.current=ve.reduce(((t,n)=>{const o=t.get(n.to.insId)||{},i=o[n.to.pinId]||[],s={...o,[n.to.pinId]:[...i,e.get(n.from.insId)]};return t.set(n.to.insId,s),t}),new Map)}),[ve,he]);const Qt=u.useCallback((()=>{Me(void 0)}),[]),Xt=u.useCallback((async e=>{if(!Te)throw new Error("impossible state - quick add menu invoked but not available");const{ins:t,pinId:n}=Te;switch(e.type){case"import":case"node":{const i="import"===e.type?await re(e.importableNode):ce,s="import"===e.type?e.importableNode.node:e.node,r=(0,m.createNewNodeInstance)(s.id,100,tt.current,i);if(r){const e=(0,h.produce)(ee,(e=>{e.instances.push(r),e.connections.push({from:{insId:t?t.id:l.THIS_INS_ID,pinId:n},to:{insId:r.id,pinId:l.TRIGGER_PIN_ID}})}));o(e,(0,O.functionalChange)("add-item-quick-menu")),Qt()}ue("addNode",{nodeId:s.id,source:"quickAdd"});break}case"value":if(!t)return void(0,P.toastMsg)("Cannot add value to main input");Ve({type:"new-output",insId:t.id,pinId:n}),ue("addValueModalOpen",{source:"quickAdd"})}}),[Te,ce,ue,ee,o,Qt,re]),en=u.useCallback((async()=>{const e=JSON.stringify(ee);await navigator.clipboard.writeText(e),P.AppToaster.show({message:"Copied!"})}),[ee]),tn=u.useCallback((()=>{var e,t;const n=i?"":" (cannot edit main node, only visual)";return(0,a.jsxs)(y.Menu,{children:[(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"New Value",onClick:(0,p.preventDefaultAnd)((()=>{Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"contextMenu"})}))}),(0,a.jsx)(y.MenuItem,{text:`New input ${n}`,onMouseDown:e=>e.stopPropagation(),onClick:(0,p.preventDefaultAnd)((()=>At("input"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`New output ${n}`,onClick:(0,p.preventDefaultAnd)((()=>At("output"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Copy node to clipboard",onClick:(0,p.preventDefaultAnd)(en)}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Completion Outputs (${(null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Vt()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Reactive inputs (${(null===(t=ee.reactiveInputs)||void 0===t?void 0:t.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>$t()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Edit description",onClick:(0,p.preventDefaultAnd)((()=>Lt()))}),(0,a.jsx)(y.MenuDivider,{}),(0,a.jsx)(y.MenuItem,{text:"Default Style",children:(0,a.jsx)(L.NodeStyleMenu,{style:ee.defaultStyle,onChange:zt,promptFn:Fe})})]})}),[i,en,ee.completionOutputs,ee.reactiveInputs,ee.defaultStyle,zt,Fe,ue,At,Vt,$t,Lt]);(0,g.useHotkeys)("shift+c",ot,{text:"Center viewport",group:"Viewport Controls"},[],qe),(0,g.useHotkeys)("cmd+c",at,{text:"Copy instances",group:"Editing"},[],qe),(0,g.useHotkeys)("cmd+v",ut,{text:"Paste instances",group:"Editing"},[],qe),(0,g.useHotkeys)("esc",dt,{text:"Clear selections",group:"Selection"},[],qe),(0,g.useHotkeys)("backspace",_t,{text:"Delete instances",group:"Editing"},[],qe),(0,g.useHotkeys)("shift+d",Nt,{text:"Duplicate selected instances",group:"Editing"},[],qe),(0,g.useHotkeys)("cmd+a",yt,{text:"Select all",group:"Selection"},[],qe),(0,g.useHotkeys)("s",lt,{text:"Select pin closest to mouse",group:"Selection"},[],qe);const nn=u.useCallback(((e,t)=>{if(!$e)throw new Error("impossible state");const n=(0,h.produce)(ee,(t=>{const n=t.instances.find((e=>e.id===$e.insId));if(!n||!(0,l.isInlineNodeInstance)(n))throw new Error("impossible state");n.node=e}));o(n,(0,O.functionalChange)("Inner change: "+t.message)),Le((t=>({...t,node:e})))}),[o,$e,ee]),[on,sn]=(0,v.useState)({selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}}),rn=u.useCallback((e=>sn((t=>({...t,...e})))),[]),an=n=>$e&&$e.insId===n.id?{currentInsId:$e.insId,ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),boardData:on,onChangeBoardData:rn,resolvedDependencies:ne,onCopy:s,clipboardData:e.clipboardData,onInspectPin:e.onInspectPin,onGoToNodeDef:e.onGoToNodeDef,nodeIoEditable:e.nodeIoEditable,node:$e.node,onChangeNode:nn,onShowOmnibar:te,parentViewport:t.defaultViewPort,parentBoardPos:nt,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:e.queuedInputsData}:void 0,un=()=>{if(fe&&("input"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"output"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(e)&&!(0,l.isInternalConnectionNode)(fe))return;return{from:fe,to:e}}if(me&&("output"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"input"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(me)&&!(0,l.isInternalConnectionNode)(e))return;return{from:e,to:me}}},ln=()=>{const e=un();if(e){const{from:t,to:n}=e;return{connection:{from:t,to:n},type:ve.some((t=>(0,l.connectionDataEquals)(t,e)))?"future-remove":"future-add"}}},cn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleInputs:t}:n))}));o(n,(0,O.functionalChange)("change instance visible inputs"))}),[ee,o]),dn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,style:t}:n))}));o(n,(0,O.functionalChange)("change instance style")),ue("changeStyle",{isDefault:!1})}),[o,ee,ue]),pn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleOutputs:t}:n))}));o(n,(0,O.functionalChange)("change instance visible outputs"))}),[ee,o]),fn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,displayName:t}:n))}));o(n,(0,O.functionalChange)("change instance display name"))}),[ee,o]);u.useImperativeHandle(n,(()=>({centerInstance(e){const t=ee.instances.find((t=>t.id===e));if(t){const e=(0,C.vSub)(t.pos,(0,C.vec)(et.width/2,et.height/2));We({...Ge,pos:e})}},centerViewPort(){ot()},getViewPort:()=>Ge,clearSelection:()=>{dt()},requestNewInlineValue:()=>{Ve({type:"new-floating",pos:tt.current})}})));const[mn,hn]=u.useState([]),vn=u.useCallback(((e,t)=>{const n=t.trim().substr(0,100),i=`Inline-value-${n.substr(0,15).replace(/["'`]/g,"")}`,s=(0,S.createInlineValueNode)({code:t,customView:n,nodeId:i,type:e});switch(Ae.type){case"existing":{const[e]=ee.instances.filter((e=>e.id===Ae.insId)).filter((e=>(0,l.isInlineNodeInstance)(e))).map((e=>e.node));if(!e)throw new Error("Unable to find inline node to save to");const t=(0,l.keys)(e.inputs),n=(0,l.keys)(s.inputs),i=new Set(D.default.difference(t,n)),r=(0,h.produce)(ee,(e=>{e.instances=e.instances.map((e=>e.id===Ae.insId?(0,l.inlineNodeInstance)(e.id,s,e.inputConfig,e.pos):e)),e.connections=e.connections.filter((e=>!(e.to.insId===Ae.insId&&i.has(e.to.pinId))))}));o(r,(0,O.functionalChange)("change inline value")),Ve(void 0);break}case"static-input":{let e;try{const n=t.replace(/^['`]/,'"').replace(/['`]$/,'"');e=JSON.parse(n)}catch(r){return void(0,P.toastMsg)("Input values must not be formulas or code")}const n=(0,h.produce)(ee,(t=>{t.instances.find((e=>e.id===Ae.insId)).inputConfig[Ae.pinId]=(0,l.staticInputPinConfig)(e)}));o(n,(0,O.functionalChange)("set static input value")),Ve(void 0);break}case"new-floating":{const e=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},Ae.pos),t=(0,h.produce)(ee,(t=>{t.instances.push(e)}));o(t,(0,O.functionalChange)("new floating value")),Ve(void 0);break}case"new-output":{const{insId:e,pinId:t}=Ae,n=ee.instances.find((t=>t.id===e));if(!n)throw new Error("Impossible state");const i=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},(0,C.vAdd)(n.pos,{x:-50,y:150})),r=(0,h.produce)(ee,(n=>{n.instances.push(i),n.connections.push({from:(0,l.connectionNode)(e,t),to:(0,l.connectionNode)(i.id,l.TRIGGER_PIN_ID)})}));o(r,(0,O.functionalChange)("new value connected to output")),Ve(void 0)}}ue("addValue",{type:e,placeholdersCount:(0,l.keys)(s.inputs).length})}),[Ae,o,ee,ue]),gn=ve.filter((e=>{const t=un();return!t||!(0,l.connectionDataEquals)(t,e)})),In=u.useCallback((()=>{Le(void 0),sn(t.defaultBoardData)}),[]),yn=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{const n=t.connections.find((t=>(0,l.connectionDataEquals)(t,e)));n.hidden=!n.hidden}));o(t,(0,O.functionalChange)("toggle connection hidden"))}),[o,ee]),bn=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{t.connections=t.connections.filter((t=>!(0,l.connectionDataEquals)(t,e)))}));o(t,(0,O.functionalChange)("remove connection"))}),[o,ee]),Cn=u.useCallback(((e,t,n)=>{Ue("input"===n?{to:(0,l.connectionNode)(e.id,t),from:void 0}:{from:(0,l.connectionNode)(e.id,t),to:void 0})}),[]),xn=u.useCallback(((e,t,n)=>{Be&&(Be.from&&"input"===n?Je(Be.from,(0,l.connectionNode)(e.id,t),"pinDrag"):Be.to&&"output"===n&&Je((0,l.connectionNode)(e.id,t),Be.to,"pinDrag")),Ue(null)}),[Be,Je]),_n=u.useCallback(((e,t)=>{}),[]),wn=u.useCallback(((e,t)=>{Be&&(Be.from&&"output"===t?Je(Be.from,(0,l.externalConnectionNode)(e),"nodeIoPinDrag"):Be.to&&"input"===t&&Je((0,l.externalConnectionNode)(e),Be.to,"nodeIoPinDrag"))}),[Be,Je]);try{return(0,a.jsxs)(y.ContextMenu,{className:(0,k.default)("visual-node-editor",e.className,{dark:ae}),"data-id":ee.id,content:tn(),disabled:!qe.current,children:[(0,a.jsxs)("main",{className:"board-editor-inner",onMouseDown:jt,onMouseUp:Pt,onMouseMove:Ot,onMouseLeave:Et,ref:Xe,style:Yt,children:[(0,a.jsx)(u.Fragment,{children:(0,a.jsx)(N.LayoutDebugger,{vp:Ge,node:ee,extraDebug:m.emptyList,mousePos:tt.current})}),(0,a.jsx)(d.ConnectionView,{resolvedNodes:ce,currentInsId:Q,ancestorsInsIds:X,size:et,node:ee,boardPos:nt,instances:he,connections:gn,futureConnection:ln(),onDblClick:l.noop,viewPort:Ge,parentVp:le,selectedInstances:pe,toggleHidden:yn,removeConnection:bn,lastMousePos:tt.current,draggedSource:Be}),qt(),he.map((t=>{var n,o,i,s,r;return(0,a.jsx)(c.InstanceView,{onUngroup:Dt,onExtractInlineNode:Tt,onDetachConstValue:Mt,onCopyConstValue:kt,onPasteConstValue:Rt,copiedConstValue:ke,connectionsPerInput:Kt.current.get(t.id)||m.emptyObj,node:(0,q.safelyGetNodeDef)(t,ce),ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),onPinClick:rt,onPinDblClick:Wt,onDragStart:pt,onDragEnd:mt,resolvedDeps:ce,onDragMove:ft,onDblClick:St,onSelect:It,onToggleSticky:wt,selected:-1!==pe.indexOf(t.id),dragged:Ce===t.id,onInspectPin:Ze,selectedInput:me&&(0,l.isInternalConnectionNode)(me)&&me.insId===t.id?me.pinId:void 0,selectedOutput:fe&&(0,l.isInternalConnectionNode)(fe)&&fe.insId===t.id?fe.pinId:void 0,closestPin:Ke&&Ke.ins.id===t.id?Ke:void 0,queuedInputsData:null!==(n=oe[t.id])&&void 0!==n?n:m.emptyObj,instance:t,connections:ve,onTogglePinBreakpoint:l.noop,onTogglePinLog:l.noop,viewPort:Ge,onChangeVisibleInputs:cn,onChangeVisibleOutputs:pn,onSetDisplayName:fn,onDeleteInstance:Ct,forceShowMinimized:fe||(null===(o=null==Be?void 0:Be.to)||void 0===o?void 0:o.insId)===t.id?"input":me||(null===(i=null==Be?void 0:Be.from)||void 0===i?void 0:i.insId)===t.id?"output":void 0,isConnectedInstanceSelected:pe.some((e=>ve.some((n=>{let{from:o,to:i}=n;return o.insId===t.id&&i.insId===e||o.insId===e&&i.insId===t.id})))),inlineGroupProps:an(t),onCloseInlineEditor:In,inlineEditorPortalDomNode:ze.current,onChangeStyle:dn,onGroupSelected:Ye,onPinMouseDown:Cn,onPinMouseUp:xn,hadError:null!==(r=null===(s=e.instancesWithErrors)||void 0===s?void 0:s.has((0,l.fullInsIdPath)(t.id)))&&void 0!==r&&r},t.id)})),Ut(),Bt(),(0,a.jsx)(F.MainInstanceEventsIndicator,{currentInsId:Q,ancestorsInsIds:X,viewPort:Ge}),Te?(0,a.jsx)(x.QuickAddMenu,{targetNode:Te.targetNode,pinId:Te.pinId,pinType:Te.pinType,pos:Te.pos,resolvedDependencies:ne,node:ee,onAdd:Xt,onClose:Qt}):null,(0,a.jsxs)("div",{className:"viewport-controls-and-help",children:[(0,a.jsx)(y.Button,{small:!0,onClick:ot,minimal:!0,intent:"primary",children:"Center"}),(0,a.jsx)(U,{min:.15,max:3,stepSize:.05,labelStepSize:10,labelRenderer:W,onChange:ct,value:Ge.zoom}),Ne?(0,a.jsx)(G.HelpBubble,{}):null]}),Ae?(0,a.jsx)(E.InlineCodeModal,{env:m.emptyObj,initialValue:Ae.value,initialType:"existing"===Ae.type?Ae.templateType:void 0,onCancel:()=>Ve(void 0),onSubmit:vn}):null,(0,a.jsx)("div",{className:"inline-editor-portal-root"})]}),(0,a.jsx)(H.ActionsMenu,{showRunFlowOptions:Ne,onAction:Gt,selectedInstances:pe,node:ee,resolvedNodes:ce,to:me,from:fe,hotkeysEnabled:qe})]})}catch(Nn){return console.error(Nn),(0,a.jsxs)("div",{children:["Error rendering board - ",Nn.toString()]})}})));const Z=(e,t)=>{const n=e.target.closest(".visual-node-editor");return n&&n.getAttribute("data-id")===t}},83234:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeView=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=r(n(59349)),d=n(30653);t.BaseNodeView=function(e){const{dragged:t,viewPort:n,pos:o,onDragEnd:i,onDragMove:s,onDragStart:r,displayMode:p}=e,f=(0,d.useDarkMode)(),m=u.useCallback(((e,t)=>{r(e,t)}),[r]),h=u.useCallback(((e,t)=>{const s=o,r=(t.x-s.x)/n.zoom,a=(t.y-s.y)/n.zoom,u=s.x+r,l=s.y+a;i(e,{...t,x:u,y:l})}),[o,i,n]),v=u.useCallback(((e,t)=>{s(e,{x:t.x,y:t.y})}),[s]),g={transform:`scale(${n.zoom})`},I=(0,l.default)("base-node-view",e.className,{dragged:t,dark:f,"display-mode":p}),y=o.x*n.zoom-n.pos.x*n.zoom,b=o.y*n.zoom-n.pos.y*n.zoom,C={transform:`translate(${y-o.x}px, ${b-o.y}px)`},x=(0,l.default)("base-node-view-vp-fixer",{"display-mode":p}),_=(0,a.jsx)("span",{className:"base-node-view-wrapper",children:(0,a.jsx)("div",{className:I,style:g,id:e.domId,children:e.children})});return(0,a.jsx)("div",{className:x,style:C,children:(0,a.jsx)(c.default,{onStop:h,onStart:m,onDrag:v,position:o,cancel:".no-drag",children:_})})}},80510:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleConnectionCloseEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleConnectionCloseEditorCommand=(e,t)=>{let{from:n,to:o}=t;return(0,s.default)(e,(e=>{const t=e.connections.find((e=>{const t=(0,i.connectionNodeEquals)(n,e.from),s=(0,i.connectionNodeEquals)(o,e.to);return t&&s}));t?e.connections=e.connections.filter((e=>e!==t)):e.connections.push({from:n,to:o})}))}},1788:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDetachConstEditorCommand=void 0;const i=n(74762),s=o(n(53865)),r=n(68371);t.handleDetachConstEditorCommand=(e,t,n)=>(0,s.default)(e,(e=>{const{instances:o}=e,s=o.find((e=>e.id===t));if(!s)throw new Error("Impossible state ins id with no matching instance");const a=s.inputConfig[n];if(!a)throw new Error("impossible state detaching const from unexistent config");if(!(0,i.isStaticInputPinConfig)(a))throw new Error("impossible state detaching const with no value");const u=JSON.stringify(a.value),l=(0,r.createInlineValueNode)({code:`${u}`,type:i.InlineValueNodeType.VALUE}),c=(0,i.inlineNodeInstance)(`value-${(0,i.randomInt)(999)}`,l,{},{x:s.pos.x,y:s.pos.y-100});if(!e.instances.find((e=>e.id===s.id)))throw new Error("impossible state instance not found");s.inputConfig[n]=(0,i.queueInputPinConfig)(),e.instances.push(c),e.connections.push((0,i.connectionData)(`${c.id}.value`,`${s.id}.${n}`))}))},2130:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDuplicateSelectedEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleDuplicateSelectedEditorCommand=(e,t)=>{const n=[];return{newNode:(0,s.default)(e,(o=>{const s=o.instances;t.forEach((t=>{const o=s.find((e=>e.id===t));if(!o)throw new Error("impossible state duplicate selected no matching instance");if(o){const{pos:t}=o,r={...o,pos:{x:t.x+20,y:t.y+20},id:(0,i.createInsId)(e)};s.push(r),n.push(r.id)}}))})),newInstances:n}}},25044:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.pasteInstancesCommand=void 0;const i=n(74762),s=o(n(53865));t.pasteInstancesCommand=(e,t,n)=>{const o=n.instances.map((n=>({...n,pos:t,id:(0,i.createInsId)(e)}))),r=new Map(o.map(((e,t)=>[n.instances[t].id,e.id])));return{newNode:(0,s.default)(e,(e=>{e.instances.push(...o);const t=n.connections.map((e=>{let{from:t,to:n}=e;return{from:{...t,insId:r.get(t.insId)||t.insId},to:{...n,insId:r.get(n.insId)||n.insId}}}));e.connections.push(...t)})),newInstances:o}}},65082:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionView=t.SingleConnectionView=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=r(n(26372)),d=n(74762),p=n(18243),f=n(77852),m=n(74089),h=n(60190),v=n(50382),g=n(76064),I=n(41032);t.SingleConnectionView=e=>{const{isBrowser:t}=(0,f.useSsr)(),{connection:n,node:o,resolvedNodes:i,instances:s,type:r,viewPort:a,toggleHidden:l,parentSelected:m,removeConnection:y}=e,{from:b}=n,C=(0,d.isInternalConnectionNode)(b)&&s.find((e=>e.id===b.insId));if(!C&&(0,d.isInternalConnectionNode)(b))throw new Error(`impossible state - "from instance id - [${b.insId}] does not exist"`);const x=((0,d.isInternalConnectionNode)(b)&&C?(0,I.safelyGetNodeDef)(C,i):o).outputs[b.pinId],_=x&&x.delayed,w=t?(0,p.calcStartPos)({...e,connectionNode:b}):{x:0,y:0},N=t?(0,p.calcTargetPos)({...e,connectionNode:n.to}):{x:0,y:0},{x:j,y:P}=(0,h.vDiv)(w,e.parentVp.zoom),{x:O,y:E}=(0,h.vDiv)(N,e.parentVp.zoom),S=(0,c.default)({delayed:_,hidden:n.hidden,"parent-selected":m},r),D=(0,u.jsxs)(v.Menu,{children:[(0,u.jsx)(v.MenuItem,{text:n.hidden?"Show connection":"Hide connection",onClick:()=>l(n)}),(0,u.jsx)(v.MenuItem,{text:"Remove connection",onClick:()=>y(n)})]});return(0,u.jsx)(v.ContextMenu,{content:D,children:e=>(0,u.jsx)(g.ConnectionViewPath,{className:S,from:{x:j,y:P},to:{x:O,y:E},dashed:"regular"!==r,zoom:a.zoom,onContextMenu:e.onContextMenu})})};t.ConnectionView=e=>{var n;const{viewPort:o,futureConnection:i,toggleHidden:s,selectedInstances:r,draggedSource:c}=e,[d,f]=l.useState(0),h=l.useCallback((e=>requestAnimationFrame((()=>{f((e=>(e+1)%9)),e>0&&h(e-1)}))),[]);l.useEffect((()=>{const e=h(10);return()=>{cancelAnimationFrame(e)}}),[h]),l.useEffect((()=>{const e=()=>{h(3)};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[h,d]);const v=e.connections.map((n=>{const o=r.includes(n.from.insId)||r.includes(n.to.insId);return(0,a.createElement)(t.SingleConnectionView,{...e,connection:n,type:"regular",parentSelected:o,key:n.from.insId+n.from.pinId+n.to.insId+n.to.pinId})}));if(i&&v.push((0,a.createElement)(t.SingleConnectionView,{...e,connection:i.connection,type:i.type,toggleHidden:s,parentSelected:!1,key:"future"})),c){const t=(c.from?p.calcStartPos:p.calcTargetPos)({connectionNode:null!==(n=c.from)&&void 0!==n?n:c.to,viewPort:o,boardPos:e.boardPos,ancestorsInsIds:e.ancestorsInsIds,currentInsId:e.currentInsId});v.push((0,u.jsx)(g.ConnectionViewPath,{className:"dragged",from:t,to:(0,m.logicalPosToRenderedPos)(e.lastMousePos,o),zoom:o.zoom},"dragged"))}return(0,u.jsx)("svg",{className:"connections-view",children:v})}},76064:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionViewPath=void 0;const i=n(35250),s=o(n(26372)),r=n(70079),a=n(23381);t.ConnectionViewPath=(0,r.forwardRef)(((e,t)=>{const{from:n,to:o,className:r,onContextMenu:u,zoom:l,dashed:c}=e,{x:d,y:p}=n,{x:f,y:m}=o,h=(0,a.calcBezierPath)({sourceX:d,sourceY:p,targetX:f,targetY:m,curvature:.15}),v=2.5*l,g=c?6*l:void 0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:h,ref:t,className:(0,s.default)("connection",r),style:{strokeWidth:v,strokeDasharray:g},onContextMenu:u}),e.label?(0,i.jsx)("text",{className:"label",x:(d+f)/2,y:(p+m)/2,fontSize:"12px"}):null,(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%"}),(0,i.jsx)("stop",{offset:"100%"})]})]})}))},23381:(e,t)=>{"use strict";var n;function o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i(e){let t,i,{pos:s,x1:r,y1:a,x2:u,y2:l,c:c}=e;switch(s){case n.Left:t=r-o(r-u,c),i=a;break;case n.Right:t=r+o(u-r,c),i=a;break;case n.Top:t=r,i=a-o(a-l,c);break;case n.Bottom:t=r,i=a+o(l-a,c)}return[t,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.getBezierCenter=t.calcBezierPath=t.Position=void 0,function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(n=t.Position||(t.Position={}));t.calcBezierPath=e=>{let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l});return`M${t},${o} C${c},${d} ${p},${f} ${r},${a}`},t.getBezierCenter=function(e){let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l}),m=.125*t+.375*c+.375*p+.125*r,h=.125*o+.375*d+.375*f+.125*a;return[m,h,Math.abs(m-t),Math.abs(h-o)]}},18243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcTargetPos=t.calcStartPos=t.calcPinPosition=void 0;const o=n(74762),i=n(30994),s={x:99999,y:99999};function r(e){const t=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds),pinId:e.pinId,pinType:e.pinType,isMain:e.isMain});return((e,t,n,o)=>{if(!e)return console.warn(`Cannot find element ${n} to calculate position.`),s;const{x:i,y:r,width:a,height:u}=e.getBoundingClientRect(),l=r+u/2;return{x:i+a/2-t.x,y:l-t.y}})(document.getElementById(t),e.boardPos,t,e.viewPort)}t.calcPinPosition=r;t.calcStartPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"input",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"output",boardPos:n,viewPort:s})};t.calcTargetPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"output",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"input",boardPos:n,viewPort:s})}},30994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPinDomId=t.getMainInstanceIndicatorDomId=t.getInstanceDomId=void 0;const o=n(74762);t.getInstanceDomId=(e,t)=>`ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getMainInstanceIndicatorDomId=(e,t)=>`main-ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getPinDomId=e=>{let{pinType:t,fullInsIdPath:n,pinId:o,isMain:i}=e;return`${i?"main-":""}pin:${t}:${n}:${o}`.replace(/\s+/g,"-")}},86553:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceView=t.getVisibleOutputs=t.getVisibleInputs=t.INSTANCE_INFO_TOOLTIP_DELAY=t.MAX_INSTANCE_WIDTH=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=n(66074),d=n(74762),p=r(n(26372)),f=n(2036),m=n(74762),h=n(74762),v=n(53159),g=n(83234),I=n(74762),y=n(30994),b=n(63521),C=n(74089),x=n(50382),_=r(n(99581)),w=n(88593),N=n(30653);t.PIECE_HORIZONTAL_PADDING=25,t.PIECE_CHAR_WIDTH=11,t.MIN_WIDTH_PER_PIN=40,t.MAX_INSTANCE_WIDTH=400,t.INSTANCE_INFO_TOOLTIP_DELAY=400;t.getVisibleInputs=(e,t,n)=>{const{visibleInputs:o}=e;if(o)return o;const i=(0,d.keys)((0,h.getNodeInputs)(t)).filter(((o,i)=>{var s;const r=n.some((t=>t.to.insId===e.id&&t.to.pinId===o)),a=t.inputs[o]&&"optional"===(null===(s=t.inputs[o])||void 0===s?void 0:s.mode);return r||!a&&o!==m.TRIGGER_PIN_ID}));return 0===i.length?[m.TRIGGER_PIN_ID]:i};t.getVisibleOutputs=(e,t,n)=>{const{visibleOutputs:o}=e;if(o)return o;const i=Object.keys(t.outputs);return n.some((t=>t.from.insId===e.id&&t.from.pinId===m.ERROR_PIN_ID))?[...i,m.ERROR_PIN_ID]:i};t.InstanceView=function(e){const{selected:n,selectedInput:o,selectedOutput:i,closestPin:s,dragged:r,onTogglePinLog:j,onTogglePinBreakpoint:P,onDetachConstValue:O,onCopyConstValue:E,onPasteConstValue:S,displayMode:D,connections:T,instance:M,viewPort:k,node:R,onPinClick:A,onPinDblClick:V,onDragStart:$,onDragEnd:L,onDragMove:z,onToggleSticky:H,onSelect:F,onDblClick:G,onChangeVisibleInputs:q,onChangeVisibleOutputs:B,onConvertConstToEnv:U,inlineGroupProps:W,onUngroup:Z,onExtractInlineNode:J,onGroupSelected:Y,isConnectedInstanceSelected:K,inlineEditorPortalDomNode:Q,onChangeStyle:X,onDeleteInstance:ee,onSetDisplayName:te,onPinMouseUp:ne,onPinMouseDown:oe}=e,ie=(0,N.useDarkMode)(),{id:se}=M,re=l.useMemo((()=>{const e=(0,d.randomInt)(6,1);return{icon:(0,d.pickRandom)([["fab","discord"],["fab","slack"],"bug","cube"]),color:e,size:(0,d.randomInt)(3,1),variation:(0,d.randomInt)(5,1)}}),[]),ae=l.useRef(),ue=l.useMemo((()=>M.style||R.defaultStyle||{}),[R,M]),le=ue.size||"regular",ce=l.useMemo((()=>new Map(T.filter((e=>{let{to:t}=e;return t.insId===se})).map((e=>{let{to:t,hidden:n}=e;return[t.pinId,n]})))),[T,se]),de=l.useMemo((()=>new Map(T.filter((e=>{let{from:t}=e;return t.insId===se})).map((e=>{let{from:t,hidden:n}=e;return[t.pinId,n]})))),[T,se]),pe=(0,C.usePrompt)(),fe=l.useCallback((e=>A(M,e,"input")),[M,A]),me=l.useCallback(((e,t)=>V(M,e,"input",t)),[M,V]),he=l.useCallback(((e,t)=>V(M,e,"output",t)),[M,V]),ve=l.useCallback((e=>A(M,e,"output")),[M,A]),ge=l.useCallback(((e,t)=>{$(M,e,t)}),[M,$]),Ie=l.useCallback(((e,t)=>{const n=M.pos,o=(t.x-n.x)/k.zoom,i=(t.y-n.y)/k.zoom,s=n.x+o,r=n.y+i;L(M,e,{...t,x:s,y:r})}),[M,L,k.zoom]),ye=l.useCallback(((e,t)=>{z(M,e,{x:t.x,y:t.y})}),[M,z]),be=l.useCallback((e=>H(M,e)),[M,H]),Ce=l.useCallback((e=>O(M,e)),[M,O]),xe=l.useCallback((e=>E(M,e)),[M,E]),_e=l.useCallback((e=>S(M,e)),[M,S]),we=l.useCallback((e=>F(M,e)),[M,F]),Ne=l.useCallback((e=>G(M,e.shiftKey)),[M,G]),je=(0,d.entries)(R.inputs),{visibleInputs:Pe,visibleOutputs:Oe}=M;Pe&&je.sort(((e,t)=>Pe.indexOf(e[0])-Pe.indexOf(t[0])));const Ee=(0,d.entries)(R.outputs);Oe&&Ee.sort(((e,t)=>Oe.indexOf(e[0])-Oe.indexOf(t[0])));const Se=(0,t.getVisibleInputs)(M,R,T),De=(0,t.getVisibleOutputs)(M,R,T);je.push([m.TRIGGER_PIN_ID,{...(0,d.nodeInput)(),description:"Use this pin to manually trigger the node. If not connected, the node will be triggered automatically when all required inputs have data."}]),Ee.push([m.ERROR_PIN_ID,{...(0,m.nodeOutput)(),description:"Use this pin to catch errors that happen inside this node. If not connected, errors will bubble up to the parent node."}]);const Te=je.filter((e=>{let[t]=e;return Se.includes(t)||(n||K)&&ce.has(t)})),Me=Ee.filter((t=>{let[o]=t;return De.includes(o)||(n||K)&&de.has(o)||o===m.ERROR_PIN_ID&&e.hadError})),ke=T.some((e=>e.from.insId===se&&e.from.pinId===m.ERROR_PIN_ID)),Re=(0,p.default)("ins-view",{"no-inputs":0===je.length,"no-outputs":0===Ee.length,"display-mode":D,"force-minimized-input":"input"===e.forceShowMinimized||"both"===e.forceShowMinimized,"force-minimized-output":"output"===e.forceShowMinimized||"both"===e.forceShowMinimized,"inline-node-edited":!!W,"error-caught":ke}),Ae=(0,p.default)({selected:n,dragged:r,closest:s&&s.ins.id===M.id},`size-${le}`),Ve=new Set((0,d.entries)(R.inputs).filter((e=>{let[t,n]=e;return(0,m.isInputPinOptional)(n)})).map(d.pickFirst)),$e=(0,d.entries)(M.inputConfig).reduce(((e,t)=>{let[n,o]=t;return(0,m.isStickyInputPinConfig)(o)||o.sticky?{...e,[n]:!0}:e}),{}),Le=(0,v.calcNodeContent)(M,R),ze=e=>{const t=M.inputConfig[e];if((0,I.isStaticInputPinConfig)(t))return t.value},He=l.useCallback((async()=>{const e=(0,d.okeys)(R.inputs),t=await pe("New order?",(M.visibleInputs||e).join(","));t&&q(M,t.split(","))}),[R.inputs,pe,M,q]),Fe=l.useCallback((async()=>{const e=(0,d.okeys)(R.outputs),t=await pe("New order?",(M.visibleOutputs||e).join(","));t&&B(M,t.split(","))}),[R.outputs,pe,M,B]),Ge=l.useCallback((()=>{ee(M)}),[ee,M]),qe=l.useCallback((async()=>{const e=await pe("Set custom display name",M.displayName||R.id);te(M,e)}),[pe,M,te,R.id]),Be=Object.keys((0,h.getNodeInputs)(R)),Ue=Object.keys((0,d.getNodeOutputs)(R)),We=l.useCallback((e=>{U&&U(M,e)}),[M,U]),Ze=l.useCallback(((e,t)=>{ne&&ne(M,e,t)}),[M,ne]),Je=l.useCallback(((e,t)=>{oe&&oe(M,e,t)}),[M,oe]),Ye=()=>(0,u.jsx)("div",{className:"inputs no-drag",children:Te.map((t=>{let[i,r]=t;var a;return(0,u.jsx)(f.PinView,{type:"input",currentInsId:M.id,ancestorsInsIds:e.ancestorsInsIds,id:i,optional:Ve.has(i),connected:ce.has(i),isSticky:$e[i],minimized:!n&&1===Te.length,onToggleSticky:be,onDetachConstValue:Ce,onCopyConstValue:xe,onPasteConstValue:_e,copiedConstValue:e.copiedConstValue,selected:i===o,onClick:fe,onDoubleClick:me,isClosestToMouse:!!s&&"input"===s.type&&s.pin===i,onToggleLogged:j,onToggleBreakpoint:P,onInspect:e.onInspectPin,constValue:ze(i),onConvertConstToEnv:e.onConvertConstToEnv?We:void 0,description:r.description,queuedValues:null!==(a=e.queuedInputsData[i])&&void 0!==a?a:0,onMouseUp:Ze,onMouseDown:Je},i)}))}),Ke=()=>(0,u.jsx)("div",{className:"outputs no-drag",children:Me.map((t=>{let[o,r]=t;return(0,u.jsx)(f.PinView,{currentInsId:M.id,ancestorsInsIds:e.ancestorsInsIds,connected:de.has(o),type:"output",id:o,minimized:!n&&1===Me.length,isClosestToMouse:!!s&&"output"===s.type&&s.pin===o,selected:o===i,onClick:ve,onDoubleClick:he,onToggleLogged:j,onToggleBreakpoint:P,onInspect:e.onInspectPin,description:r.description,onMouseUp:Ze,onMouseDown:Je},o)}))}),Qe=l.useCallback((e=>{X(M,e)}),[M,X]),Xe=l.useCallback((()=>{const e=[...Be.map((e=>{const t=Se.includes(e),n=ce.has(e)&&!0!==ce.get(e),o=(0,d.getInputName)(e);return{text:t?n?`Hide input "${o}" (disconnect first)`:`Hide input "${o}"`:`Show input "${o}"`,onClick:()=>q(M,t?Se.filter((t=>t!==e)):[...Se,e]),disabled:n&&t}})),...Ue.map((e=>{const t=De.includes(e),n=de.has(e),o=(0,d.getOutputName)(e);return{text:t?n?`Hide output "${o}" (disconnect first)`:`Hide output "${o}"`:`Show output "${o}"`,onClick:()=>B(M,t?De.filter((t=>t!==e)):[...De,e]),disabled:n&&t}})),...(0,d.isInlineNodeInstance)(M)&&(0,h.isVisualNode)(M.node)?[{text:"Ungroup inline node",onClick:()=>Z(M)}]:[],...(0,d.isInlineNodeInstance)(M)?[{text:"Extract inline node to file",onClick:()=>J(M)}]:[],{text:"Reorder inputs",onClick:He},{text:"Reorder outputs",onClick:Fe},{text:"Set display name",onClick:qe},{text:"Group selected instances",onClick:Y},{text:"Delete instance",intent:"danger",onClick:Ge}];return(0,u.jsxs)(x.Menu,{children:[(0,u.jsx)(x.MenuItem,{text:"Style",children:(0,u.jsx)(w.NodeStyleMenu,{style:ue,onChange:Qe,promptFn:pe})}),e.map(((e,t)=>(0,a.createElement)(x.MenuItem,{...e,key:t})))]})}),[Be,Ue,M,He,Fe,qe,Ge,ue,Qe,pe,Se,ce,q,De,de,B,Z,J,Y]),et={"--node-color":ue.color,...ue.cssOverride||{}},tt=(0,y.getInstanceDomId)(M.id,e.ancestorsInsIds);return(0,u.jsx)("div",{className:Re,children:(0,u.jsx)(g.BaseNodeView,{pos:M.pos,viewPort:k,onDragStart:ge,onDragMove:ye,onDragEnd:Ie,upperRenderer:Ye,bottomRenderer:Ke,displayMode:D,domId:tt,children:(0,u.jsxs)(l.Fragment,{children:[Ye(),W?_.default.createPortal((0,u.jsxs)("div",{className:"inline-group-editor-container no-drag",children:[(0,u.jsxs)("header",{children:[Le," ",(0,u.jsx)("button",{onClick:e.onCloseInlineEditor,children:"close"})]}),(0,u.jsx)(b.VisualNodeEditor,{...e.inlineGroupProps,className:"no-drag",ref:ae})]}),Q):(0,u.jsx)(x.ContextMenu,{className:(0,p.default)("ins-view-inner",Ae,`size-${re.size}`,{dark:ie}),onClick:we,onDoubleClick:Ne,content:Xe(),style:et,children:(0,u.jsx)(x.Tooltip,{content:R.description,children:(0,u.jsxs)(l.Fragment,{children:[ue.icon?(0,u.jsx)(c.FontAwesomeIcon,{icon:ue.icon}):null," ",Le]})})}),Ke()]})})})}},53568:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStyleMenu=t.nodeStylePresetColors=void 0;const r=n(35250),a=n(50382),u=s(n(70079)),l=n(84472);t.nodeStylePresetColors=[{name:"Amethyst",color:"#9b5de5"},{name:"Magenta",color:"#f15bb5"},{name:"Yellow",color:"#fee440"},{name:"Capri",color:"#00bbf9"},{name:"Sea Green",color:"#00f5d4"},{name:"Orange",color:"#ff7f00"}];const c={size:"regular"};t.NodeStyleMenu=e=>{var n;const{onChange:o,style:i}=e,s=i||c,d=e.promptFn,p=u.default.useCallback(((e,t)=>{o({...s,[e]:t})}),[s,o]),f=u.default.useCallback((async()=>{const e=await d("Icon name? (Font Awesome conventions)","rocket"),t=e.includes(",")?e.split(","):e;p("icon",t)}),[d,p]),m=(0,u.useCallback)((async()=>{const e=await d("Enter a custom style (valid JSON representing a React CSS object)",s.cssOverride?JSON.stringify(s.cssOverride):"");try{const t=JSON.parse(e);p("cssOverride",t)}catch(t){console.error(t),(0,l.toastMsg)("Invalid object","danger")}}),[d,p,s.cssOverride]);return(0,r.jsxs)(u.default.Fragment,{children:[(0,r.jsxs)(a.MenuItem,{text:"Color",children:[t.nodeStylePresetColors.map((e=>(0,r.jsx)(a.MenuItem,{text:e.name,onClick:()=>p("color",e.color)},e.name))),(0,r.jsx)(a.MenuDivider,{}),(0,r.jsx)(a.MenuItem,{text:"Remove Color",onClick:()=>p("color",void 0)})]}),(0,r.jsxs)(a.MenuItem,{text:`Size (${null!==(n=s.size)&&void 0!==n?n:"regular"})`,children:[(0,r.jsx)(a.MenuItem,{text:"Small",onClick:()=>p("size","small")}),(0,r.jsx)(a.MenuItem,{text:"Regular",onClick:()=>p("size","regular")}),(0,r.jsx)(a.MenuItem,{text:"Large",onClick:()=>p("size","large")})]}),(0,r.jsxs)(a.MenuItem,{text:"Icon",children:[(0,r.jsx)(a.MenuItem,{text:"Choose Icon",onClick:f}),(0,r.jsx)(a.MenuItem,{text:"Remove Icon",onClick:()=>p("icon",void 0)})]}),(0,r.jsx)(a.MenuItem,{text:"Custom Styling",onClick:m})]})}},88593:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(53568),t)},83651:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86553),t)},53159:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calcInstancePosition=t.calcNodeWidth=t.calcNodeContent=void 0;const i=n(74762),s=o(n(6576)),r=n(86553),a=n(61888),u=n(30994);t.calcNodeContent=(e,t)=>{if(e.displayName)return e.displayName;if(t.customViewCode)try{const n=Object.entries(e.inputConfig).filter((e=>{let[,t]=e;return(0,i.isStaticInputPinConfig)(t)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o.value}}),{});return s.default.compile(t.customViewCode)({inputs:n}).trim()}catch(n){return console.error("Error with custom view",n),`Error in custom view [${t.id}]`}return t.id};t.calcNodeWidth=(e,n)=>{const o=(0,i.okeys)(n.inputs).length*r.MIN_WIDTH_PER_PIN,s=(0,t.calcNodeContent)(e,n),u=r.PIECE_CHAR_WIDTH;return(0,a.clamp)(s.length*u+2*r.PIECE_HORIZONTAL_PADDING,o,r.MAX_INSTANCE_WIDTH)};t.calcInstancePosition=(e,t,n)=>{const o=(0,u.getInstanceDomId)(e,t),i=document.getElementById(o);if(i){const{x:e,y:t,width:o,height:s}=i.getBoundingClientRect(),r=t+s/2;return{x:e+o/2-n.x,y:r-n.y}}return console.warn("Cannot find element to draw connection to",o),{x:99999,y:99999}}},17841:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutDebugger=t.LayoutDebuggerItem=t.PosDebugger=void 0;const i=n(70079),s=n(35250),r=n(74762),a=o(n(70079)),u=n(7047),l=e=>{let{pos:t}=e;return(0,s.jsxs)("span",{children:[t.x.toFixed(1),", ",t.y.toFixed(1)]})};t.PosDebugger=e=>(0,s.jsx)("span",{className:"pos-debugger",children:(0,s.jsx)(l,{pos:e.pos})});t.LayoutDebuggerItem=e=>{const{pos:n,viewPort:o,size:i,color:r}=e,a=o.zoom,u=n.x*a-o.pos.x*a,l=n.y*a-o.pos.y*a,c={transform:`translate(${u-n.x}px, ${l-n.y}px)`},d={transform:`scale(${o.zoom})`},p={transform:`translate(${n.x}px, ${n.y}px)`},f={width:`${i.width}px`,height:`${i.height}px`,backgroundColor:r};return(0,s.jsx)("div",{className:"layout-debugger",style:c,children:(0,s.jsxs)("span",{className:"drag-sim",style:p,children:[(0,s.jsx)(t.PosDebugger,{pos:n}),(0,s.jsx)("div",{className:"layout-debugger-zoom-wrapper",style:d,children:(0,s.jsx)("div",{className:"layout-debugger-inner",style:f})})]})})};const c=(()=>{try{return"true"===localStorage.getItem("pos-debugger")}catch(e){return!1}})();t.LayoutDebugger=e=>{const{extraDebug:n,vp:o,node:d,mousePos:p}=e;if(!c)return null;const f=n.map(((e,n)=>(0,i.createElement)(t.LayoutDebuggerItem,{...e,key:n}))),m=[...d.instances.map((e=>e.pos)),...(0,r.values)(d.inputsPosition),...(0,r.values)(d.outputsPosition)].map((e=>(0,s.jsx)(t.LayoutDebuggerItem,{pos:e,viewPort:o,size:{width:0,height:0},color:"red"}))),h=(0,u.logicalPosToRenderedPos)(p,o),v=(0,s.jsxs)("div",{className:"viewport-data",children:[(0,s.jsxs)("div",{children:["Pos: ",(0,s.jsx)(l,{pos:o.pos})]}),(0,s.jsxs)("div",{children:["Zoom: ",o.zoom.toFixed(2)," "]}),(0,s.jsxs)("div",{children:["Mouse (logical): ",(0,s.jsx)(l,{pos:p})]}),(0,s.jsxs)("div",{children:["Rendered (rendered): ",(0,s.jsx)(l,{pos:h})]})]});return(0,s.jsxs)(a.default.Fragment,{children:[v,f,m]})}},44338:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(17841),t)},38259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateInstancesWithSingleConstPinsMap=t.getLeafInstancesOfSelection=void 0;t.getLeafInstancesOfSelection=(e,t,n)=>e.reduce(((e,o)=>[...e,...n.filter((e=>e.to.insId===o.id)).map((e=>t.find((t=>t.id===e.from.insId)))).filter((e=>!!e))]),[]).filter((t=>1===n.filter((e=>e.from.insId===t.id||e.to.insId===t.id)).length&&!e.includes(t)));t.calculateInstancesWithSingleConstPinsMap=(e,t)=>{const{connections:n}=e;return n.filter((e=>t.has(e.from.insId))).reduce(((e,n)=>{const o=t.get(n.from.insId),i=n.to.insId,s=e.get(i)||new Map;return s.set(n.to.pinId,{val:o,insId:n.from.insId}),e.set(i,s),e}),new Map)}},37488:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeIoView=void 0;const a=n(35250),u=n(70079),l=s(n(70079)),c=n(74762),d=n(83234),p=r(n(26372)),f=n(50382),m=n(43490),h=n(66189),v=n(74762),g=n(30994),I=n(30653);t.NodeIoView=l.memo((function(e){const{viewPort:t,selected:n,pos:o,type:i,id:s,onDblClick:r,onRename:y,onDelete:b,onChangeInputMode:C,inputMode:x,onSelect:_,closest:w,onSetDescription:N,description:j,onMouseUp:P,onMouseDown:O,currentInsId:E}=e,{history:S,resetHistory:D,refreshHistory:T}=(0,h.useHistoryHelpers)(E,s,i),M=(0,m.usePrompt)(),k=l.useCallback((async()=>{const e=await M("Description?",j);N(i,s,e)}),[M,j,N,i,s]),R=l.useCallback((()=>{b&&b(i,s)}),[i,s,b]),A=l.useCallback((()=>{y&&y(i,s)}),[i,s,y]),V=l.useCallback((e=>{C&&C(s,e)}),[s,C]),$=l.useCallback((()=>[{text:`Current mode - ${x}`,onClick:c.noop},{text:"Make required",onClick:()=>V("required")},{text:"Make optional",onClick:()=>V("optional")},{text:"Make required-if-connected",onClick:()=>V("required-if-connected")},{text:"Set description",onClick:k},...e.onRename?[{text:"Rename",onClick:A}]:[],...e.onDelete?[{text:"Delete",onClick:R}]:[]]),[k,x,V,R,A,e.onDelete,e.onRename]),L=l.useCallback((t=>{r&&r(e.id,t)}),[r,e.id]),z=l.useCallback((()=>{_(s,i)}),[s,i,_]),H=l.useCallback((()=>(0,a.jsx)(f.Menu,{children:$().map(((e,t)=>(0,u.createElement)(f.MenuItem,{...e,key:t})))})),[$]),F="input"===i?(0,v.getInputName)(s):(0,c.getOutputName)(s),G=l.useCallback((e=>{P(s,i,e)}),[s,P,i]),q=l.useCallback((e=>{O(s,i,e)}),[s,O,i]),B=(0,I.useDarkMode)();return(0,a.jsx)(d.BaseNodeView,{className:(0,p.default)("node-io-view",i,{dark:B}),pos:o,onDragEnd:(n,o)=>{const r=e.pos,a=(o.x-r.x)/t.zoom,u=(o.y-r.y)/t.zoom,l=r.x+a,c=r.y+u;e.onDragEnd(i,s,n,{...o,x:l,y:c})},onDragStart:(t,n)=>{e.onDragStart(s,t,n)},onDragMove:(t,n)=>{e.onDragMove(i,s,t,{x:n.x,y:n.y})},viewPort:t,children:(0,a.jsx)(l.Fragment,{children:(0,a.jsx)(f.Tooltip,{content:(()=>{const t=(0,h.calcHistoryContent)(S),n=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:F})," (",i,")"," "]}),n,(0,a.jsx)("hr",{}),t]})})(),children:(0,a.jsx)(f.ContextMenu,{onMouseEnter:T,onMouseOut:D,onMouseUp:G,onMouseDown:q,"data-tip":"","data-html":!0,"data-for":s+e.currentInsId,className:(0,p.default)("node-io-view-inner",{closest:w,selected:n,dark:B}),id:(0,g.getPinDomId)({fullInsIdPath:(0,c.fullInsIdPath)(e.currentInsId,e.ancestorInsIds),pinId:s,pinType:i,isMain:!0}),onClick:z,onDoubleClick:L,content:H(),children:s})})})})}))},66005:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37488),t)},83782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcNodeIoWidth=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0,t.PIECE_HORIZONTAL_PADDING=15,t.PIECE_CHAR_WIDTH=9,t.MIN_WIDTH_PER_PIN=40;t.calcNodeIoWidth=e=>Math.max(t.MIN_WIDTH_PER_PIN,e.length*t.PIECE_CHAR_WIDTH+2*t.PIECE_HORIZONTAL_PADDING)},99942:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderVisualNode=t.layoutToInstances=void 0;const i=n(63521),s=n(74762),r=n(90794),a=o(n(53865)),u=n(83782),l=n(60190),c=n(53159),d=n(41032);t.layoutToInstances=(e,t)=>(0,a.default)(t,(t=>{(0,s.entries)(e.nodes).forEach((e=>{let[n,o]=e;if(n.startsWith("ins-")){const e=n.replace("ins-",""),i=t.instances.find((t=>t.id===e));i?i.pos=o.p:console.warn("WAT")}if(n.startsWith("node-input-")){const e=n.replace("node-input-","");t.inputsPosition[e]=o.p}if(n.startsWith("node-output-")){const e=n.replace("node-output-","");t.outputsPosition[e]=o.p}}))}));t.orderVisualNode=(e,n,o,a)=>{const{instances:p,connections:f}=e,m={...p.reduce(((e,t)=>{const o=(0,l.size)((0,c.calcNodeWidth)(t,(0,d.safelyGetNodeDef)(t,n)),i.NODE_HEIGHT);return{...e,[`ins-${t.id}`]:{p:t.pos,s:o}}}),{}),...(0,s.okeys)(e.inputsPosition).reduce(((t,n)=>({...t,[`node-input-${n}`]:{p:e.inputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{}),...(0,s.okeys)(e.outputsPosition).reduce(((t,n)=>({...t,[`node-output-${n}`]:{p:e.outputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{})},h=f.map((e=>[(0,s.isExternalConnectionNode)(e.from)?`node-input-${e.from.pinId}`:`ins-${e.from.insId}`,(0,s.isExternalConnectionNode)(e.to)?`node-output-${e.to.pinId}`:`ins-${e.to.insId}`])),v=(0,r.orderLayout)({nodes:m,edges:h},o,((n,o)=>{a&&a((0,t.layoutToInstances)(n,e),o)}));return(0,t.layoutToInstances)(v,e)}},90794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderLayout=void 0;const o=n(60190),i=400,s=e=>e.reduce(((e,t)=>{const n=(0,o.vSub)(t.p,(0,o.vec)(t.s.width/2,t.s.height/2));return{...e,[t.id]:{p:n,s:t.s}}}),{});t.orderLayout=(e,t,n)=>{let{nodes:r,edges:a}=e,u=Object.entries(r).map((e=>{let[t,n]=e;return{id:t,p:(0,o.vAdd)(n.p,(0,o.vec)(n.s.width/2,n.s.height/2)),f:(0,o.vec)(0,0),v:(0,o.vec)(0,0),m:1,s:n.s}})),l=0;for(;l.01);){let e=u;for(let t=0;t{let n=e.find((e=>e.id===t[0])),i=e.find((e=>e.id===t[1]));if(!n||!i)return void console.warn("weoops",t[0],t[1]);const s=(0,o.vec)(0,-200),r=(0,o.vSub)(n.p,i.p),a=(0,o.vSub)(s,r),u=1e3*(0,o.vLen)(a),l=(0,o.vMul)((0,o.vNorm)(a),.5*u),c=(0,o.vMul)((0,o.vNorm)(a),-.5*u);n.f=(0,o.vAdd)(n.f,l),i.f=(0,o.vAdd)(i.f,c)})),e=e.map((e=>(0,o.itrPhysics)(15,e))),e=e.map((e=>{const t=(0,o.vMul)(e.v,.5),n=(0,o.vLen)(t)>100?(0,o.vMul)((0,o.vNorm)(t),100):t;return{...e,v:n}})),u=e,n&&n({nodes:s(e),edges:a},l),l++}return{nodes:s(u),edges:a,itrs:l,timeout:l>=t,total:(0,o.totalEnergy)(u)}}},2036:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PinView=t.PIN_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=n(50382),d=n(18420),p=n(74762),f=n(30994),m=n(96233),h=n(66189),v=n(30653);t.PIN_HEIGHT=23;t.PinView=u.memo((function(e){const{selected:t,type:n,connected:o,optional:i,currentInsId:s,isClosestToMouse:r,id:g,onMouseDown:I,onMouseUp:y}=e,{history:b,resetHistory:C,refreshHistory:x}=(0,h.useHistoryHelpers)(s,g,n),_=(0,v.useDarkMode)(),w="input"===n?(0,p.getInputName)(g):(0,p.getOutputName)(g),N="input"===e.type&&(0,d.isDefined)(e.constValue)?e.constValue:void 0,j=u.useCallback((e=>{0===e.button&&I(g,n,e)}),[g,n,I]),P=u.useCallback((e=>{0===e.button&&y(g,n,e)}),[g,n,y]);return(0,a.jsxs)("div",{className:(()=>{if("input"===e.type){const{isSticky:s,constValue:a}=e;return(0,l.default)("pin",{sticky:s,selected:t,closest:r,optional:i,connected:o,"const-value":(0,d.isDefined)(a),"env-value":(0,d.isDefined)(a)&&(0,p.isEnvValue)(a),minimized:e.minimized,dark:_},n)}return(0,l.default)("pin",{selected:t,connected:o,closest:r,optional:i,minimized:e.minimized,"error-pin":g===p.ERROR_PIN_ID,dark:_},n)})(),"data-pin-id":g,children:[(0,a.jsx)(c.Tooltip,{className:"pin-info-tooltip",content:(()=>{const t=(0,h.calcHistoryContent)(b,"input"===n?e.queuedValues:void 0),o=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:w})," (",n,")"," "]}),o,(0,a.jsx)("hr",{}),(0,d.isDefined)(N)?(0,a.jsxs)("div",{children:["Static value:"," ",(0,a.jsx)("strong",{children:(0,m.valuePreview)(N).substring(0,200)})]}):t]})})(),children:(0,a.jsxs)(c.ContextMenu,{onMouseEnter:x,onMouseOut:C,onMouseDown:j,onMouseUp:P,"data-tip":"","data-html":!0,"data-for":g+e.currentInsId,id:(0,f.getPinDomId)({fullInsIdPath:(0,p.fullInsIdPath)(e.currentInsId,e.ancestorsInsIds),pinId:g,pinType:n,isMain:!1}),onDoubleClick:t=>e.onDoubleClick&&e.onDoubleClick(g,t),className:(0,l.default)("pin-inner",{dark:_}),onClick:t=>{const{onShiftClick:o,onClick:i,id:s}=e;t.shiftKey&&o?o(s,t):i(s,n,t)},content:(()=>{const t=(0,a.jsx)(c.MenuItem,{onClick:()=>e.onInspect(e.currentInsId,{id:e.id,type:e.type}),text:"Inspect"});if("input"===e.type){const{onConvertConstToEnv:n}=e;return(0,d.isDefined)(N)?(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onDetachConstValue(e.id),text:"Detach value"}),(0,a.jsx)(c.MenuItem,{onClick:()=>e.onCopyConstValue(e.id),text:"Copy value"}),(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null,n?(0,a.jsx)(c.MenuItem,{onClick:()=>n(e.id),text:"Convert to Env Var"}):null]}):(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onToggleSticky(e.id),text:"Toggle sticky (square means sticky)"}),t,(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null]})}return(0,a.jsx)(c.Menu,{children:t})})(),children:[w," ",(0,d.isDefined)(N)?(0,a.jsxs)(u.Fragment,{children:[":",(0,a.jsx)("span",{className:"value",children:(0,d.toString)(N)})]}):null,"input"===e.type&&e.isSticky?(0,a.jsx)("span",{className:"suffix",children:"s"}):null,"input"===e.type&&e.queueSize?(0,a.jsxs)("span",{className:"suffix",children:[e.queueSize," in Q"]}):null]})}),(0,a.jsx)("div",{className:"wire"})]})}))},66189:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHistoryHelpers=t.calcHistoryContent=void 0;const i=n(35250),s=n(96233),r=o(n(70079)),a=n(70079),u=n(98158);t.calcHistoryContent=(e,t)=>{if(e){const{total:n,lastSamples:o}=e,a=(0,i.jsxs)("strong",{children:["Activated ",n," times this session"]}),u=o.length>0?(0,i.jsxs)("div",{children:["Last value:"," ",(0,i.jsx)("strong",{children:(0,s.valuePreview)(o[0].val).substring(0,200)}),(0,i.jsx)("br",{}),(0,i.jsx)("em",{children:"Inspect instance for the full value"})]}):"",l=t?(0,i.jsx)(r.default.Fragment,{children:(0,i.jsxs)("div",{children:["Queued values: ",(0,i.jsx)("strong",{children:t})]})}):"";return(0,i.jsxs)(r.default.Fragment,{children:[a,u,l]})}return"Loading session data.."};t.useHistoryHelpers=(e,t,n)=>{const o=(0,a.useRef)(),{onRequestHistory:i}=(0,u.useDebuggerContext)(),[s,l]=(0,a.useState)();return{history:s,refreshHistory:(0,a.useCallback)((()=>{clearInterval(o.current),i(e,t,n).then((e=>{l(e)})),o.current=setInterval((()=>{i(e,t,n).then((e=>{l(e)}))}),500)}),[e,i,t,n]),resetHistory:r.default.useCallback((()=>{clearInterval(o.current),l(void 0)}),[])}}},89440:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAddMenu=void 0;const r=n(35250),a=s(n(70079)),u=n(74762),l=n(50382),c=n(70457),d=n(9958),p=n(86125),f=c.Select.ofType(),m=e=>{switch(e.type){case"node":return`${e.node.id}`;case"value":return"Add inline value or function";case"import":return`Import ${e.importableNode.node.id} from ${e.importableNode.module}`}},h=(e,t)=>{let{handleClick:n,modifiers:o,query:i}=t;if(!o.matchesPredicate)return null;const s=m(e);return"value"===e.type?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(l.MenuDivider,{}),(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))]}):(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))},v=(e,t,n,o)=>{const i=m(t).toLocaleLowerCase(),s=e.toLowerCase();return o?i===s:i.includes(s)};t.QuickAddMenu=e=>{const{resolvedDependencies:t,targetNode:n}=e,o={left:e.pos.x,top:e.pos.y},{onRequestImportables:i}=(0,p.useDependenciesContext)(),[s,c]=a.useState();a.useEffect((()=>{i().then((e=>c(e.importables)))}),[i]);const d=(0,u.values)({...t,[n.id]:n}),m=d.map((e=>({type:"node",node:e}))),g=new Set(d.map((e=>e.id))),I=s?s.filter((e=>!g.has(e.node.id))).map((e=>({type:"import",importableNode:e}))):[],y=m.concat(I).concat({type:"value"});return(0,r.jsx)("div",{className:"quick-add-menu",style:o,children:(0,r.jsx)(f,{className:"quick-add-nodes-select",items:y,itemPredicate:v,itemRenderer:h,inputProps:{className:"quick-add-input"},noResults:(0,r.jsx)(l.MenuItem,{disabled:!0,text:"No results."}),onItemSelect:t=>e.onAdd(t),popoverProps:{isOpen:!0,onClose:()=>e.onClose()}})})}},71033:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89440),t)},73470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimePlayer=void 0;const o=n(74762),i=n(64955),s=(0,o.debugLogger)("runtime-player");t.createRuntimePlayer=()=>{let e=0,t=[];let n=!1,r=Date.now(),a=e;const u=()=>requestAnimationFrame((()=>{const l=Date.now();a=e,e+=l-r,r=l,((e,n)=>{const r=t;t=[],r.length&&s(`Playing ${r.length} events from`,e,n),r.forEach((e=>{s("Playing event",e),(0,i.playEvent)(e),e.insId===o.ROOT_INS_ID&&e.type===o.DebuggerEventType.PROCESSING_CHANGE&&!1===e.val&&(s("Main instance is done processing, clearing runtime UI",e),c())}))})(a,e),n&&u()})),l=()=>{n=!1},c=()=>{document.querySelectorAll("[data-runtime]").forEach((e=>{e.removeAttribute("data-runtime")})),document.querySelectorAll("[data-runtime-queue]").forEach((e=>{e.removeAttribute("data-runtime-queue")})),t=[]};return{stop:l,start:function(t){void 0===t&&(t=0),n=!0,e=t,r=Date.now(),u()},addEvents:e=>{t.push(...e)},destroy:()=>{l(),c()},clear:c,status:()=>({running:n,currDt:e,lastDt:a,queue:t,last:r})}}},64955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playEvent=t.cancelTimers=void 0;const o=n(74762),i=n(30994),s=5e3,r=(0,o.debugLogger)("runtime-player:play-event"),a=(e,t)=>e.type===o.DebuggerEventType.INPUT_CHANGE||e.type===o.DebuggerEventType.OUTPUT_CHANGE?`${(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds)}.${e.pinId}`:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds);t.cancelTimers=new Map;t.playEvent=e=>{switch(e.type){case o.DebuggerEventType.INPUT_CHANGE:case o.DebuggerEventType.OUTPUT_CHANGE:{const{pinId:n,insId:u,ancestorsInsIds:l}=e,c=e.type===o.DebuggerEventType.INPUT_CHANGE?"input":"output",d=[(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!0})];u!==o.ROOT_INS_ID&&d.push((0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!1})),d.forEach(((i,l)=>{const c=a(e);clearTimeout(t.cancelTimers.get(c));const d=document.getElementById(i),p=`${u}.${n}`,f=e.type===o.DebuggerEventType.OUTPUT_CHANGE?document.querySelectorAll(`[data-from-id="${p}"]`):[];if(d){clearTimeout(t.cancelTimers.get(c)),d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),setTimeout((()=>{d.setAttribute("data-runtime","active"),f.forEach((e=>{e.setAttribute("data-runtime","active")}))}),0);const n=setTimeout((()=>{d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),t.cancelTimers.delete(c)}),s);t.cancelTimers.set(a(e),n)}else console.warn(`No DOM element with Id [${i}] found to play event`),r(`No DOM element with Id [${i}] found to play event`,e)}));break}case o.DebuggerEventType.PROCESSING_CHANGE:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(l)if(!0===e.val)l.setAttribute("data-runtime","processing"),clearTimeout(t.cancelTimers.get(u));else{l.removeAttribute("data-runtime"),setTimeout((()=>{"error"!==l.getAttribute("data-runtime")&&l.setAttribute("data-runtime","done")}),0);const e=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,e)}else r(`No DOM element with Id [${n}] found to play event`,e)}));break}case o.DebuggerEventType.ERROR:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(!l)return void r(`No DOM element with Id [${n}] found to play event`,e);clearTimeout(t.cancelTimers.get(u)),l.removeAttribute("data-runtime"),setTimeout((()=>{l.setAttribute("data-runtime","error")}));const c=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,c)}));const c={...e,type:o.DebuggerEventType.OUTPUT_CHANGE,pinId:o.ERROR_PIN_ID};(0,t.playEvent)(c);break}case o.DebuggerEventType.INPUTS_STATE_CHANGE:(0,o.entries)(e.val).forEach((t=>{let[n,s]=t;const{insId:a,ancestorsInsIds:u}=e,l=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(a,u),pinId:n,pinType:"input",isMain:!1}),c=document.getElementById(l);c?s>0?c.setAttribute("data-runtime-queue",`${s}`):c.removeAttribute("data-runtime-queue"):r(`No DOM element with Id [${l}] found to play event`,e)}))}}},25804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounce=void 0;const o=n(70079);t.useDebounce=function(e,t){const[n,i]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}},7047:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.handleChangeNodeInputType=t.handleIoPinRename=t.handleInstanceDrag=t.getInstancesInRect=t.isJsxValue=t.getMiddleOfViewPort=t.fitViewPortToNode=t.centerBoardPosOnTarget=t.renderedPosToLogicalPos=t.logicalPosToRenderedPos=t.getEffectiveNodeDimensions=t.calcNodesPositions=t.calcSelectionBoxArea=t.animateViewPort=t.easeInOutNum=t.easeInOutPos=t.easeInOutQuad=t.center=t.distance=t.clamp=t.domToViewPort=t.roundNumber=t.createNewNodeInstance=t.createNewInlineNodeInstance=t.parseInputOutputTypes=t.parsePromptValue=t.getSelectionBoxRect=t.findClosestPin=t.changePinConfig=t.getInstancePinConfig=t.emptyList=t.emptyObj=void 0;const r=s(n(53865)),a=n(30721),u=n(63521),l=n(74762),c=n(18243),d=n(74762),p=n(53159),f=n(83782),m=n(60190),h=n(38259),v=n(83651),g=n(41032);t.emptyObj={},t.emptyList=[],t.getInstancePinConfig=function(e,n,o){var i;const s=e.instances.find((e=>e.id===n));if(!s)throw new Error(`Instance ${n} not found`);return null!==(i=(s.inputConfig||t.emptyObj)[o])&&void 0!==i?i:(0,l.queueInputPinConfig)()};t.changePinConfig=(e,t,n,o)=>r.produce(e,(e=>{var i;const{instances:s}=e,r=s.find((e=>e.id===t));if(!r)throw new Error("blah");const a=null!==(i=r.inputConfig)&&void 0!==i?i:{};a[n]=o,e.instances=s.map((e=>e===r?{...r,inputConfig:a}:e))}));t.findClosestPin=(e,t,n,o,i,s,r)=>{const a=(0,l.nodeInstance)(e.id,e.id),u=(0,d.okeys)(e.inputs).map((e=>({id:e,type:"input",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),p=(0,d.okeys)(e.outputs).map((e=>({id:e,type:"output",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),f=[...u,...e.instances.reduce(((n,a)=>{const u=(0,g.safelyGetNodeDef)(a,t),d=(0,v.getVisibleInputs)(a,u,e.connections),p=(0,v.getVisibleOutputs)(a,u,e.connections);return[...n,...d.map((e=>({ins:a,type:"input",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!1}),id:e}))),...p.map((e=>({ins:a,type:"output",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!1}),id:e})))]}),[]),...p];let m={dis:1e5,item:f[0]};return f.forEach((e=>{const t=e.pos.x-n.x,o=e.pos.y-n.y,i=Math.sqrt(t*t+o*o);i{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x,t.x)-n,h:Math.max(e.y,t.y)-o}};t.parsePromptValue=e=>{if(null===e)return;const t=parseInt(e,10);let n=e;return t.toString()!=e||isNaN(t)||(n=t),n};t.parseInputOutputTypes=e=>{const[,t,n]=e.match(/node\((.+)\|(.+)\)/)||[],o=(0,d.entries)(JSON.parse(t)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]})),i=(0,d.entries)(JSON.parse(n)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]}));return{inputs:(0,d.fromEntries)(o),outputs:(0,d.fromEntries)(i)}};t.createNewInlineNodeInstance=function(e,t,n){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const o=(0,l.inlineNodeInstance)(`${e.id}-${(0,d.randomInt)(999)}`,e,{},{x:0,y:0}),i=(0,p.calcNodeWidth)(o,e),{x:s,y:r}=n,a={x:s-i/2,y:r+t};return{...o,pos:a}};t.createNewNodeInstance=function(e,t,n,o){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const i="string"==typeof e?(0,g.safelyGetNodeDef)(e,o):e;if(!i)throw new Error(`${e} node not found in resolvedNodes`);const s=(0,d.entries)(i.inputs).reduce(((e,t)=>{let[n,o]=t;return o.defaultValue&&(e[n]=(0,l.staticInputPinConfig)(o.defaultValue)),e}),{}),r=(0,l.nodeInstance)((0,a.createId)(),i.id,s,{x:0,y:0}),c=(0,p.calcNodeWidth)(r,i),{x:f,y:m}=n,h={x:f-c/2,y:m+t};return{...r,pos:h}};t.roundNumber=e=>Math.round(100*e)/100;t.domToViewPort=(e,n,o)=>({x:(0,t.roundNumber)(n.pos.x+e.x/n.zoom/o.zoom),y:(0,t.roundNumber)(n.pos.y+e.y/n.zoom/o.zoom)});t.clamp=(e,t,n)=>Math.max(e,Math.min(t,n));t.distance=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)};t.center=(e,t,n)=>{let{zoom:o}=n;const i=e.x+e.w/2,s=e.y+e.h/2,{w:r,h:a}=t;return{x:i-r/o/2,y:s-a/o/2}};t.easeInOutQuad=e=>e<.5?2*e*e:(4-2*e)*e-1;t.easeInOutPos=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i),a=(0,t.easeInOutQuad)(r),u=n.x-e.x,l=n.y-e.y;return{x:e.x+u*a,y:e.y+l*a}};t.easeInOutNum=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i);return e+(n-e)*(0,t.easeInOutQuad)(r)};t.animateViewPort=(e,n,o,i)=>{const s=(0,t.distance)(e.pos,n.pos),r=Date.now(),a=o;if(0===s)return void i(e);const u=()=>{const o=Date.now(),s=(0,t.easeInOutPos)(e.pos,n.pos,r,a,o),l=(0,t.easeInOutNum)(e.zoom,n.zoom,r,a,o);o-r{const n=(0,t.getSelectionBoxRect)(e.from,e.to);return n.h*n.w};const I=(e,t,n,o)=>({left:n.x,right:n.x+e,top:n.y,bottom:n.y+t,tag:o,center:(0,l.calcCenter)({w:e,h:t,...n})});t.calcNodesPositions=(e,t)=>[...e.instances.map((e=>{const n=(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,t)),o=u.NODE_HEIGHT;return I(n,o,e.pos,e.id)})),...(0,d.okeys)(e.inputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.inputsPosition[t]||{x:0,y:0};return I(n,o,i,"input_"+t)})),...(0,d.okeys)(e.outputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.outputsPosition[t]||{x:0,y:0};return I(n,o,i,"output"+t)}))];t.getEffectiveNodeDimensions=(e,n)=>{const o=(0,t.calcNodesPositions)(e,n),i=o[0]||{left:0,right:0,top:0,bottom:0},s=o.reduce(((e,t)=>t.leftt.right>e?t.right:e),i.right),a=o.reduce(((e,t)=>t.topt.bottom>e?t.bottom:e),i.bottom)-a,d={x:s,y:a};return{size:{width:u,height:c},pos:d,center:(0,l.calcCenter)({w:u,h:c,...d})}};t.logicalPosToRenderedPos=(e,t)=>{const n=(0,m.vSub)(e,t.pos);return(0,m.vMul)(n,t.zoom)};t.renderedPosToLogicalPos=(e,t)=>{const n=(0,m.vDiv)(e,t.zoom);return(0,m.vAdd)(t.pos,n)};t.centerBoardPosOnTarget=(e,n,o,i)=>{const s=(0,t.logicalPosToRenderedPos)(e,i),r=(0,t.renderedPosToLogicalPos)(s,{...i,zoom:o}),a=Math.max(e.x,r.x)-Math.min(e.x,r.x),u=Math.max(e.y,r.y)-Math.min(e.y,r.y);return{x:o>i.zoom?i.pos.x+a:i.pos.x-a,y:o>i.zoom?i.pos.y+u:i.pos.y-u}};t.fitViewPortToNode=function(e,n,o,i){void 0===i&&(i=[20,150]);const{size:s,center:r}=(0,t.getEffectiveNodeDimensions)(e,n),a=i[0],u=i[1],l=s.width+a,c=s.height+u,d=o.width/l,p=o.height/c,f=Math.min(d,p)/1.15,m=(0,t.clamp)(.3,1.2,f);return{zoom:m,pos:{x:r.x-o.width/2/m,y:r.y-o.height/2/m+20}}};t.getMiddleOfViewPort=(e,n)=>{const o={x:n.width/2,y:n.height/2};return(0,t.renderedPosToLogicalPos)(o,e)};t.isJsxValue=e=>{const t=e=>(0,d.isDefined)(e.ref)&&(0,d.isDefined)(e.type)&&(0,d.isDefined)(e.props);try{const n=JSON.parse(e);return t(n)||Array.isArray(n)&&t(n[0])}catch(n){return!1}};t.getInstancesInRect=(e,n,o,i,s,r,a)=>{const{from:c,to:d}=e,f=(0,t.getSelectionBoxRect)(c,d);return s.filter((e=>{const{pos:t}=e,i={...t,w:(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,n))*o.zoom*a.zoom,h:u.NODE_HEIGHT*o.zoom*a.zoom};return(0,l.intersectRect)(f,i)||(0,l.intersectRect)(i,f)})).map((e=>e.id))};t.handleInstanceDrag=(e,t,n,o,i,s)=>{o.preventDefault(),o.stopPropagation();const a=(0,m.vSub)(n,t.pos);let u;const l=r.produce(e,(e=>{const r=e.instances.find((e=>e.id===t.id));if(!r)throw new Error("impossible state dragging instance that does not exist");!o.shiftKey&&s&&(u=[s]);const l=e.instances.filter((e=>i.includes(e.id)&&e!==r)),c=[r,...l],d=(0,h.getLeafInstancesOfSelection)(c,e.instances,e.connections);[...l,...d].forEach((e=>{e.pos=(0,m.vAdd)(e.pos,a)})),r.pos=n,!o.shiftKey&&s&&(u=[s])}));return{newValue:l,newSelected:u}};t.handleIoPinRename=(e,t,n,o)=>r.produce(e,(e=>{"input"===t?(e.inputs[o]=e.inputs[n],e.inputsPosition[o]=e.inputsPosition[n],delete e.inputs[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===n?{...e,from:{...e.from,pinId:o}}:e))):(e.outputs[o]=e.outputs[n],e.outputsPosition[o]=e.outputsPosition[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===n?{...e,to:{...e.to,pinId:o}}:e)),e.completionOutputs=(e.completionOutputs||[]).map((e=>e.split("+").map((e=>e===n?o:n)).join("+"))),delete e.outputs[n])}));t.handleChangeNodeInputType=(e,t,n)=>r.produce(e,(e=>{const o=e.inputs[t];if(!o)throw new Error("Wat");o.mode=n}))},42403:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorClient=void 0;const i=n(74762),s=o(n(18706)),r=n(32048),a=n(31758),u=(0,i.debugLogger)("remote-debugger:editor-client");t.createEditorClient=(e,t)=>{const n=new URL(e),o=(0,r.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/editor`,timeout:3e4});return o.emit("join-room-editor",t),{emitChange:e=>{o.emit(a.DebuggerServerEventType.CHANGE_EVENT_NAME,e)},emitBreakpointsChange:e=>{o.emit(a.DebuggerServerEventType.UPDATE_BREAKPOINTS,e)},interceptInput:e=>{o.emit(a.DebuggerServerEventType.INPUT_VALUE_OVERRIDE,e)},interceptOutput:e=>{o.emit(a.DebuggerServerEventType.OUTPUT_VALUE_OVERRIDE,e)},onRuntimeReady:e=>(o.on(a.DebuggerServerEventType.RUNTIME_READY,e),()=>o.off(a.DebuggerServerEventType.RUNTIME_READY,e)),onChangeAwk:e=>(o.on(a.DebuggerServerEventType.CHANGE_AWK,e),()=>o.off(a.DebuggerServerEventType.CHANGE_AWK,e)),onChangeError:e=>(o.on(a.DebuggerServerEventType.CHANGE_ERROR,e),()=>o.off(a.DebuggerServerEventType.CHANGE_ERROR,e)),onIsAlive:e=>(o.on(a.DebuggerServerEventType.IS_ALIVE,e),()=>o.off(a.DebuggerServerEventType.IS_ALIVE,e)),emitInputValue:(e,t)=>{u(`Emitting push input value to ${e} %o`,t),o.emit(a.DebuggerServerEventType.PUSH_INPUT_VALUE,{pinId:e,value:t})},destroy:()=>{o.disconnect(),(0,a.enumToArray)(a.DebuggerServerEventType).forEach((e=>o.off(e)))},onDisconnect:e=>(o.on("disconnect",e),()=>o.off("disconnect",e)),debugInfo:()=>`Remote debugger for ${e}`,onBatchedEvents:e=>(o.on(a.DebuggerServerEventType.EVENTS_BATCH,e),()=>o.off(a.DebuggerServerEventType.EVENTS_BATCH,e)),requestState:()=>s.default.get(`${e}/state`).then((e=>e.data.state)),getHistory:n=>s.default.get(`${e}/history`,{params:{insId:n.insId,pinId:n.pinId,limit:n.limit,executionId:t}}).then((e=>e.data)),clearHistory:()=>s.default.delete(`${e}/history`).then((()=>{})),triggerNode:(t,n)=>s.default.post(`${e}/trigger`,{nodeId:t,inputs:n}).then((e=>e.data))}}},58066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeData=void 0;const o=n(74762),i=n(36783),s=(0,o.debugLogger)("remote-debugger:normalize-data");t.normalizeData=e=>{if(e instanceof Error)return(0,i.serializeError)(e);if("object"==typeof e&&null!==e){e={...e};const t=new WeakSet,n=e=>{if("bigint"==typeof e)return e.toString();if("object"!=typeof e||Array.isArray(e))return e;if(null===e)return e;if(t.has(e))return"[Circular]";try{t.add(e)}catch(o){s("Error adding to WeakSet","data:",e,"type:",typeof e,"error:",o)}if(Array.isArray(e))return e.map(n);if("object"==typeof e){const t={};for(const o in e)t[o]=n(e[o]);return t}return e};return n(e)}return e}},39641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimeClient=t.DEFAULT_DT_SCALE=void 0;const o=n(74762),i=n(32048),s=n(31758),r=n(58066),a=(0,o.debugLogger)("remote-debugger:runtime-client");t.DEFAULT_DT_SCALE=1;t.createRuntimeClient=(e,t)=>{const n=new URL(e),u=(0,i.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/runtime`,timeout:1e3,reconnectionAttempts:3});u.emit("join-room-runtime",t),u.on("connection",(e=>{e.join(t)}));let l=new Set;u.on(s.DebuggerServerEventType.UPDATE_BREAKPOINTS,(e=>{l=new Set(e)}));const c=(0,o.cappedArrayDebounce)((e=>{a(`Emitting debounced batched events - ${e.length}`),u.emit(s.DebuggerServerEventType.EVENTS_BATCH,e)}),100,200);return{onChange:e=>(u.on(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e),()=>u.off(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e)),onInput:e=>(u.on(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e),()=>u.off(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e)),emitEvent:e=>{a(`Emitting event ${e.type} change event of ${e.insId}`),e.val=(0,r.normalizeData)(e.val),c.addItem({...e,time:Date.now()})},emitRuntimeReady:()=>{u.emit(s.DebuggerServerEventType.RUNTIME_READY,{})},emitChangeAwk:()=>{u.emit(s.DebuggerServerEventType.CHANGE_AWK,{})},emitChangeError:e=>{u.emit(s.DebuggerServerEventType.CHANGE_ERROR,{error:e})},emitIsAlive:e=>{u.emit(s.DebuggerServerEventType.IS_ALIVE,{time:e})},destroy:async()=>{c.pendingItems()&&(c.flush(),await(0,o.delay)(100)),(0,s.enumToArray)(s.DebuggerServerEventType).forEach((e=>u.off(e))),u.disconnect()},onDisconnect:e=>(u.on("disconnect",e),()=>u.off("disconnect",e)),waitForConnection:()=>new Promise(((e,t)=>{u.connected?e():(u.on("connect_error",(e=>{t(`Socket connect error: ${e}`)})),u.on("connect",(()=>{e()})))}))}}},31758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerServerEventType=t.enumToArray=t.isNumber=t.isSimpleType=t.valuePreview=t.toString=void 0;const o=n(36783);t.toString=e=>{if("object"===typeof e){if(e instanceof Error)return JSON.stringify((0,o.serializeError)(e));try{return JSON.stringify(e).substr(0,250)}catch(t){return"Object (cannot stringify)"}}return`${e}`.substr(0,250)};t.valuePreview=e=>(0,t.toString)(e).substr(0,100);t.isSimpleType=e=>["number","string","boolean"].includes(typeof e);t.isNumber=e=>!1===isNaN(Number(e)),t.enumToArray=function(e){return Object.keys(e).filter(t.isNumber).map((t=>e[t]))},function(e){e.RUNTIME_READY="runtime-ready",e.CHANGE_EVENT_NAME="change",e.PUSH_INPUT_VALUE="push-input-value",e.CHANGE_AWK="live-change-awk",e.CHANGE_ERROR="live-change-error",e.IS_ALIVE="is-alive",e.UPDATE_BREAKPOINTS="update-breakpoints",e.INPUT_VALUE_OVERRIDE="input-value-override",e.OUTPUT_VALUE_OVERRIDE="output-value-override",e.INPUT_VALUE_CHANGE="input-value-changed",e.OUTPUT_VALUE_CHANGE="output-value-changed",e.PROCESSING_CHANGE="processing-changed",e.INPUTS_STATE_CHANGE="inputs-state-changed",e.NODE_ERROR="node-error",e.EVENTS_BATCH="events-batch"}(t.DebuggerServerEventType||(t.DebuggerServerEventType={}))},96233:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31758),t),i(n(42403),t),i(n(39641),t)},43920:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Equals=t.EqualsBoolean=t.Throttle=t.ThrottleError=t.Debounce=t.Interval=t.Delay=t.Switch4=t.Switch2=t.Switch3=t.EmitOnTrigger=t.BooleanSplit=t.Subscribe=t.Publish=t.RoundRobin4=t.RoundRobin2=t.RoundRobin3=t.LimitTimes=void 0;const o=n(11253),i="Control Flow";t.LimitTimes={id:"Limit Times",namespace:i,description:"Item will be emitted until the limit is reached",inputs:{item:{mode:"required",description:"The item to emit"},times:{mode:"required",description:"The number of times to emit the item"},reset:{mode:"optional",description:"Reset the counter"}},outputs:{ok:{}},reactiveInputs:["item","reset"],completionOutputs:[],run:function(e,t,n){const{state:o}=n,{item:i,times:s,reset:r}=e,{ok:a}=t;if(void 0!==r)return void o.set("val",0);let u=o.get("val")||0;u++,o.set("val",u),u>=s?n.onError(new Error(`Limit of ${s} reached`)):a.next(i)}},t.RoundRobin3={id:"Round Robin 3",namespace:i,description:"Item will be emitted to one of the three outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r}=t,a=o.get("curr")||0,u=(a+1)%3;[i,s,r][a].next(e.item),o.set("curr",u)}},t.RoundRobin2={namespace:i,id:"Round Robin 2",description:"Item will be emitted to one of the 2 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s}=t,r=o.get("curr")||0,a=(r+1)%2;[i,s][r].next(e.item),o.set("curr",a)}},t.RoundRobin4={id:"Round Robin 4",namespace:i,description:"Item will be emitted to one of the 4 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves to "r4"\'s turn.'},r4:{description:'The fourth output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r,r4:a}=t,u=o.get("curr")||0,l=(u+1)%4;[i,s,r,a][u].next(e.item),o.set("curr",l)}},t.Publish={id:"Publish",namespace:i,description:"Publishes a value by a key to all listeners in the current flow. Use 'Subscribe' to listen to events.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},value:{mode:"required"}},outputs:{},run:function(e,t,n){const i=`${n.ancestorsInsIds}__${e.key}`;o.publish(i,e.value)}},t.Subscribe={id:"Subscribe",namespace:i,description:"Subscribes to a value published by a key. Use 'Publish' to publish values.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},initial:{mode:"required-if-connected",description:"If passed will be published has the first value"}},completionOutputs:[],outputs:{value:{description:"The value published by the key"}},run:function(e,t,n){const{value:i}=t,s=`${n.ancestorsInsIds}__${e.key}`,r=o.subscribe(s,((e,t)=>{i.next(t)}));void 0!==e.initial&&i.next(e.initial),n.onCleanup((()=>{o.unsubscribe(r)}))}},t.BooleanSplit={namespace:i,id:"Boolean Split",description:"Splits a boolean value into two outputs",inputs:{value:{mode:"required",description:"Boolean value"},trueValue:{mode:"required-if-connected",description:"Value to emit if the input is true. Defaults to true"},falseValue:{mode:"required-if-connected",description:"Value to emit if the input is false. Defaults to false"}},outputs:{true:{description:"The value is true"},false:{description:"The value is false"}},run:function(e,t){const{true:n,false:o}=t,{value:i,trueValue:s,falseValue:r}=e;i?n.next(null==s||s):o.next(null!=r&&r)}},t.EmitOnTrigger={namespace:i,id:"Emit on Trigger",description:"Emits the value when the trigger input receives any value",inputs:{value:{mode:"required",description:"The value to emit"},trigger:{mode:"required",description:"The trigger to emit the value"}},outputs:{result:{description:"The value emitted"}},run:function(e,t){const{result:n}=t,{value:o,trigger:i}=e;void 0!==i&&n.next(o)}},t.Switch3={namespace:i,id:"Switch 3",description:"Switches between 3 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,default:s,outputValue:r}=t,{value:a,firstCase:u,secondCase:l,thirdCase:c}=e;a===u?n.next(null!=r?r:a):a===l?o.next(null!=r?r:a):a===c?i.next(null!=r?r:a):s.next(null!=r?r:a)}},t.Switch2={id:"Switch 2",description:"Switches between 2 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,default:i,outputValue:s}=t,{value:r,firstCase:a,secondCase:u}=e;r===a?n.next(null!=s?s:r):r===u?o.next(null!=s?s:r):i.next(null!=s?s:r)}},t.Switch4={id:"Switch 4",description:"Switches between 4 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},fourthCase:{mode:"required",description:"The value to switch on for the fourth output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},fourth:{description:"The value emitted if the input value is equal to the fourth case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,fourth:s,default:r,outputValue:a}=t,{value:u,firstCase:l,secondCase:c,thirdCase:d,fourthCase:p}=e;u===l?n.next(null!=a?a:u):u===c?o.next(null!=a?a:u):u===d?i.next(null!=a?a:u):u===p?s.next(null!=a?a:u):r.next(null!=a?a:u)}},t.Delay={id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:i,description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:async(e,t)=>{let{value:n,delay:o}=e,{delayedValue:i}=t;await new Promise((e=>setTimeout(e,o))),i.next(n)}},t.Interval={id:"Interval",namespace:i,defaultStyle:{icon:"fa-clock"},description:"Emits a value every interval",inputs:{value:{description:"Value to emit"},interval:{description:"Interval in milliseconds"}},reactiveInputs:["value","interval"],outputs:{value:{description:"Emitted value"}},completionOutputs:[],run:(e,t,n)=>{n.state.get("timer")&&clearInterval(n.state.get("timer"));const o=setInterval((()=>{t.value.next(e.value)}),e.interval);n.state.set("timer",o),n.onCleanup((()=>{clearInterval(o)}))}},t.Debounce={id:"Debounce",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be debounced"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The debounced value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the last value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:s}=t,r=n.state.get("timer");r&&clearTimeout(r);const a=setTimeout((()=>{s.next(o)}),i);n.state.set("timer",a),n.onCleanup((()=>{clearTimeout(r)}))}};class s extends Error{constructor(e){super("Throttle: Value dropped"),this.value=e}}t.ThrottleError=s,t.Throttle={id:"Throttle",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be throttled"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The throttled value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the first value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:r}=t;if(n.state.get("timer"))n.onError(new s(o));else{r.next(o);const e=setTimeout((()=>{n.state.set("timer",null)}),i);n.state.set("timer",e)}}},t.EqualsBoolean={id:"Equals (Bool)",defaultStyle:{icon:"fa-equals"},namespace:i,description:"Emits true if two values are equal (=== equality). Otherwise emits false.",inputs:{a:{description:"First value"},b:{description:"Second value"}},outputs:{result:{description:"true if a is equal to b"}},run:(e,t)=>{let{a:n,b:o}=e,{result:i}=t;return i.next(n===o)}},t.Equals={id:"Equals",namespace:i,description:'Emits the value of "a" to output "true" if "a" is equal to "b". Otherwise emits the value of "a" to output "false".',inputs:{a:{mode:"required",description:"First value"},b:{mode:"required",description:"Second value"}},outputs:{true:{description:"Emits the value of a if a is equal to b"},false:{description:"Emits the value of a if a is not equal to b"}},run:(e,t)=>{const{a:n,b:o}=e,{true:i,false:s}=t;n===o?i.next(n):s.next(n)}}},67040:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Flatten=t.Slice=t.RemoveAt=t.Remove=t.Prepend=t.Append=t.AccumulateSomeValuesByCount=t.AccumulateValuesByCount=t.AccumulateValuesByTime=t.AccumulateValuesUntilTrigger=t.SplitQuadruple=t.SplitTriple=t.SplitTuple=t.HeadAndRest=t.LoopList=t.Reverse=t.ConcatLists=t.ListFrom5=t.ListFrom4=t.ListFrom3=t.ListFrom2=t.Repeat=t.GetListElement=t.ListIsEmpty=t.ListLength=void 0;const n="Lists";t.ListLength={id:"List Length",defaultStyle:{icon:"fa-list"},namespace:n,description:"Returns the length of a list",inputs:{list:{description:"List"}},outputs:{length:{description:"Length"}},run:(e,t)=>{let{list:n}=e,{length:o}=t;return o.next(n.length)}},t.ListIsEmpty={id:"List Is Empty",defaultStyle:{icon:"fa-list"},namespace:n,description:"Returns true if the list is empty",inputs:{list:{description:"List"}},outputs:{isEmpty:{description:"Is empty"}},run:(e,t)=>{let{list:n}=e,{isEmpty:o}=t;return o.next(0===n.length)}},t.GetListElement={id:"Get List Element",defaultStyle:{icon:"fa-list"},namespace:n,description:"Returns the element at the specified index",inputs:{list:{description:"List"},index:{description:"Index"}},outputs:{element:{description:"Element"}},run:(e,t)=>{let{list:n,index:o}=e,{element:i}=t;return i.next(n[o])}},t.Repeat={id:"Repeat",defaultStyle:{icon:"fa-list"},namespace:n,description:"Repeats a value a number of times",inputs:{value:{description:"Value to repeat"},times:{description:"How many times will the value be repeated"}},outputs:{list:{description:"List"}},run:(e,t)=>{let{value:n,times:o}=e,{list:i}=t;const s=[];for(let r=0;r{let{value1:n,value2:o}=e,{list:i}=t;return i.next([n,o])}},t.ListFrom3={id:"List From 3",defaultStyle:{icon:"fa-list"},namespace:n,description:"Creates a list from three values",inputs:{value1:{description:"First value"},value2:{description:"Second value"},value3:{description:"Third value"}},outputs:{list:{description:"List containing all 3 values"}},run:(e,t)=>{let{value1:n,value2:o,value3:i}=e,{list:s}=t;return s.next([n,o,i])}},t.ListFrom4={id:"List From 4",defaultStyle:{icon:"fa-list"},namespace:n,description:"Creates a list from four values",inputs:{value1:{description:"First value"},value2:{description:"Second value"},value3:{description:"Third value"},value4:{description:"Fourth value"}},outputs:{list:{description:"List containing all 4 values"}},run:(e,t)=>{let{value1:n,value2:o,value3:i,value4:s}=e,{list:r}=t;return r.next([n,o,i,s])}},t.ListFrom5={id:"List From 5",defaultStyle:{icon:"fa-list"},namespace:n,description:"Creates a list from five values",inputs:{value1:{description:"First value"},value2:{description:"Second value"},value3:{description:"Third value"},value4:{description:"Fourth value"},value5:{description:"Fifth value"}},outputs:{list:{description:"List containing all 5 values"}},run:(e,t)=>{let{value1:n,value2:o,value3:i,value4:s,value5:r}=e,{list:a}=t;return a.next([n,o,i,s,r])}},t.ConcatLists={id:"Concat Lists",defaultStyle:{icon:"fa-list"},namespace:n,description:"Concatenates two lists",inputs:{list1:{description:"First list"},list2:{description:"Second list"}},outputs:{list:{description:"Concatenated list"}},run:(e,t)=>{let{list1:n,list2:o}=e,{list:i}=t;return i.next([...n,...o])}},t.Reverse={id:"Reverse",defaultStyle:{icon:"fa-list"},namespace:n,description:"Reverses a list",inputs:{list:{description:"List"}},outputs:{reversed:{description:"Reversed list"}},run:(e,t)=>{let{list:n}=e,{reversed:o}=t;return o.next(n.reverse())}},t.LoopList={id:"Loop List",defaultStyle:{icon:"fa-list"},namespace:n,searchKeywords:["each","spread"],description:"Emits all values in a list",inputs:{list:{description:"The list to loop"}},outputs:{item:{description:"Will emit a value for each item in the list"},index:{description:"Will emit the index of the item"},length:{description:"Will emit the length of the list"}},run:(e,t)=>{const{list:n}=e,{item:o,index:i}=t;for(const s of n)o.next(s),i.next(n.indexOf(s));t.length.next(n.length)}},t.HeadAndRest={id:"Head and rest",defaultStyle:{icon:"fa-list"},namespace:n,description:"Receives a list and emits two outputs: the first item and the rest of the list",inputs:{list:{description:"The list"}},outputs:{head:{description:"The first item in the list"},rest:{description:"The rest of the list"}},run:(e,t)=>{const{list:n}=e,{head:o,rest:i}=t;o.next(n[0]),i.next(n.slice(1))}},t.SplitTuple={id:"Split Pair",defaultStyle:{icon:"fa-list"},namespace:n,description:"Receives a list with 2 items and emits two outputs: the first item and the second item",inputs:{pair:{description:"The pair to split"}},outputs:{item1:{description:"The first item in the pair"},item2:{description:"The second item in the pair"}},run:(e,t)=>{const{pair:n}=e,{item1:o,item2:i}=t;o.next(n[0]),i.next(n[1])}},t.SplitTriple={id:"Split Triple",defaultStyle:{icon:"fa-list"},namespace:n,description:"Receives a list with 3 items and emits three outputs: the first item, the second item and the third item",inputs:{triple:{description:"The triple"}},outputs:{item1:{description:"The first item in the triple"},item2:{description:"The second item in the triple"},item3:{description:"The third item in the triple"}},run:(e,t)=>{const{list:n}=e,{item1:o,item2:i,item3:s}=t;o.next(n[0]),i.next(n[1]),s.next(n[2])}},t.SplitQuadruple={id:"Split Quadruple",defaultStyle:{icon:"fa-list"},namespace:n,description:"Receives a list with 4 items and emits four outputs: the first item, the second item, the third item and the fourth item",inputs:{quadruple:{description:"The quadruple"}},outputs:{item1:{description:"The first item in the quadruple"},item2:{description:"The second item in the quadruple"},item3:{description:"The third item in the quadruple"},item4:{description:"The fourth item in the quadruple"}},run:(e,t)=>{const{list:n}=e,{item1:o,item2:i,item3:s,item4:r}=t;o.next(n[0]),i.next(n[1]),s.next(n[2]),r.next(n[3])}},t.AccumulateValuesUntilTrigger={id:"Accumulate Values by Trigger",defaultStyle:{icon:"fa-basket-shopping"},namespace:n,description:'Accumulates values sent to the "value" input, until the "reset" input is triggered. Then it emits the accumulated values and resets the accumulator.',inputs:{value:{description:"The value to accumulate"},reset:{description:"Resets the accumulator"}},reactiveInputs:["value","reset"],outputs:{accumulated:{description:"The accumulated values"}},run:(e,t,n)=>{const{item:o,until:i}=e,{r:s}=t,{state:r}=n;let a=r.get("list")||[];void 0!==o&&(a.push(o),r.set("list",a)),void 0!==i&&s.next(a)}},t.AccumulateValuesByTime={id:"Accumulate Values by Time",defaultStyle:{icon:"fa-basket-shopping"},namespace:n,description:'Accumulates values sent to the "value" input. After the specified time it emits the accumulated values and resets the accumulator.',inputs:{value:{description:"The value to accumulate"},time:{description:"Time to wait before emitting the accumulated values. Default is 200ms",defaultValue:200,mode:"required-if-connected"}},reactiveInputs:["value"],outputs:{accumulated:{description:"The accumulated values"}},run:(e,t,n)=>{const{value:o,time:i}=e,{accumulated:s}=t,{state:r}=n;let a=r.get("list")||[];const u=Date.now()%1e3;console.log("called",e.value,e.time,u),r.set("bob",2),console.log(Array.from(r.entries())),void 0!==o&&(a.push(o),r.set("list",a)),r.get("timeout")&&clearTimeout(r.get("timeout"));const l=new Promise((e=>{r.set("resolve",e)}));return r.set("timeout",setTimeout((()=>{console.log("emitting",a,u,Date.now()%1e3),s.next(a),r.set("list",[]);const e=r.get("resolve");if(!e)throw new Error("resolve is undefined");e()}),i)),l}},t.AccumulateValuesByCount={id:"Accumulate Values by Count",defaultStyle:{icon:"fa-basket-shopping"},namespace:n,description:'Accumulates values sent to the "value" input. After the specified count it emits the accumulated values and resets the accumulator.',inputs:{value:{description:"The value to accumulate"},count:{description:"Number of values to accumulate before emitting them"}},reactiveInputs:["value"],outputs:{accumulated:{description:"The accumulated values"}},completionOutputs:["accumulated"],run:(e,t,n)=>{const{value:o,count:i}=e,{accumulated:s}=t,{state:r}=n;let a=r.get("list")||[];void 0!==o&&(a.push(o),r.set("list",a)),a.length>=i&&s.next(a)}},t.AccumulateSomeValuesByCount={id:"Accumulate Some Values by Count",defaultStyle:{icon:"fa-basket-shopping"},namespace:n,description:'Accumulates values sent to the "accept" input. Emits the list after the total items passed to both "accept" and "ignore" inputs reach the specified count.',inputs:{accept:{description:"Values to accumulate"},ignore:{description:"Values to ignore"},count:{description:"Number of values to accumulate before emitting them"}},reactiveInputs:["accept","ignore"],outputs:{accumulated:{description:"The accumulated accepted values"},ignored:{description:"The accumulated ignored values"}},run:(e,t,n)=>{const{accept:o,ignore:i,count:s}=e,{accumulated:r,ignored:a}=t,{state:u}=n;let l=u.get("list")||[],c=u.get("ignored")||[];void 0!==o&&(l.push(o),u.set("list",l)),void 0!==i&&(c.push(i),u.set("ignored",a)),l.length+c.length>=s&&(r.next(l),a.next(a))}},t.Append={id:"Append",namespace:n,description:"Appends an item to a list",inputs:{list:{description:"The list"},item:{description:"The item to append"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,item:o}=e,{list:i}=t;i.next([...n,o])},defaultStyle:{icon:"fa-plus"}},t.Prepend={id:"Prepend",namespace:n,description:"Prepends an item to a list",inputs:{list:{description:"The list"},item:{description:"The item to prepend"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,item:o}=e,{list:i}=t;i.next([o,...n])},defaultStyle:{icon:"fa-arrow-up"}},t.Remove={id:"Remove",namespace:n,description:"Removes an item from a list",inputs:{list:{description:"The list"},item:{description:"The item to remove"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,item:o}=e,{list:i}=t;i.next(n.filter((e=>e!==o)))},defaultStyle:{icon:"fa-minus"}},t.RemoveAt={id:"Remove At",namespace:n,description:"Removes an item from a list at the specified index",inputs:{list:{description:"The list"},index:{description:"The index of the item to remove"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,index:o}=e,{list:i}=t;i.next(n.filter(((e,t)=>t!==o)))},defaultStyle:{icon:"fa-times"}},t.Slice={id:"Slice",namespace:n,description:"Returns a slice of a list from the specified start index to the specified end index",inputs:{list:{description:"The list"},start:{description:"The index to start slicing from"},end:{description:"The index to end slicing at"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n,start:o,end:i}=e,{list:s}=t;s.next(n.slice(o,i))},defaultStyle:{icon:"fa-cut"}},t.Flatten={id:"Flatten",namespace:n,description:"Flattens a list of lists into a single list",inputs:{list:{description:"The list of lists"}},outputs:{list:{description:"The resulting list"}},run:(e,t)=>{let{list:n}=e,{list:o}=t;o.next(n.reduce(((e,t)=>[...e,...t]),[]))},defaultStyle:{icon:"fa-compress"}}},45888:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SumList=t.LessThanOrEqual=t.LessThan=t.GreaterThanOrEqual=t.GreaterThan=t.ToPrecision=t.ToExponential=t.ToFixed=t.ParseFloat=t.ParseInt=t.Max=t.Min=t.Cos=t.Sin=t.Truncate=t.Round=t.Ceiling=t.Floor=t.AbsoluteValue=t.SquareRoot=t.Power=t.Modulo=t.Divide=t.Multiply=t.Subtract=t.Add=void 0;const n="Numbers";t.Add={id:"Add",defaultStyle:{icon:"fa-plus"},namespace:n,description:"Emits the sum of two numbers",inputs:{n1:{description:"First number to add"},n2:{description:"Second number to add"}},outputs:{sum:{description:"The sum of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{sum:i}=t;return i.next(n+o)}},t.Subtract={id:"Subtract",defaultStyle:{icon:"fa-minus"},namespace:n,description:"Emits the difference of two numbers",inputs:{n1:{description:"First number to subtract"},n2:{description:"Second number to subtract"}},outputs:{difference:{description:"The difference of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{difference:i}=t;return i.next(n-o)}},t.Multiply={id:"Multiply",defaultStyle:{icon:"fa-times"},namespace:n,description:"Emits the product of two numbers",inputs:{n1:{description:"First number to multiply"},n2:{description:"Second number to multiply"}},outputs:{product:{description:"The product of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{product:i}=t;return i.next(n*o)}},t.Divide={id:"Divide",defaultStyle:{icon:"fa-divide"},namespace:n,description:"Emits the quotient of two numbers",inputs:{n1:{description:"First number to divide"},n2:{description:"Second number to divide"}},outputs:{quotient:{description:"The quotient of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{quotient:i}=t;return i.next(n/o)}},t.Modulo={id:"Modulo",defaultStyle:{icon:"fa-percentage"},namespace:n,description:"Emits the remainder of two numbers",inputs:{n1:{description:"First number to divide"},n2:{description:"Second number to divide"}},outputs:{remainder:{description:"The remainder of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{remainder:i}=t;return i.next(n%o)}},t.Power={id:"Power",defaultStyle:{icon:"fa-superscript"},namespace:n,description:"Emits the power of two numbers",inputs:{n1:{description:"Base number"},n2:{description:"Exponent"}},outputs:{power:{description:"The power of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{power:i}=t;return i.next(Math.pow(n,o))}},t.SquareRoot={id:"Square Root",defaultStyle:{icon:"fa-square-root-alt"},namespace:n,description:"Emits the square root of a number",inputs:{n:{description:"Number to take the square root of"}},outputs:{root:{description:"The square root of n"}},run:(e,t)=>{let{n:n}=e,{root:o}=t;return o.next(Math.sqrt(n))}},t.AbsoluteValue={id:"Absolute Value",defaultStyle:{icon:"fa-abs"},namespace:n,description:"Emits the absolute value of a number",inputs:{n:{description:"Number to take the absolute value of"}},outputs:{absolute:{description:"The absolute value of n"}},run:(e,t)=>{let{n:n}=e,{absolute:o}=t;return o.next(Math.abs(n))}},t.Floor={id:"Floor",defaultStyle:{icon:"fa-floor"},namespace:n,description:"Emits the floor of a number",inputs:{n:{description:"Number to take the floor of"}},outputs:{floor:{description:"The floor of n"}},run:(e,t)=>{let{n:n}=e,{floor:o}=t;return o.next(Math.floor(n))}},t.Ceiling={id:"Ceiling",defaultStyle:{icon:"fa-ceiling"},namespace:n,description:"Emits the ceiling of a number",inputs:{n:{description:"Number to take the ceiling of"}},outputs:{ceiling:{description:"The ceiling of n"}},run:(e,t)=>{let{n:n}=e,{ceiling:o}=t;return o.next(Math.ceil(n))}},t.Round={id:"Round",defaultStyle:{icon:"fa-round"},namespace:n,description:"Emits the rounded value of a number",inputs:{n:{description:"Number to round"}},outputs:{rounded:{description:"The rounded value of n"}},run:(e,t)=>{let{n:n}=e,{rounded:o}=t;return o.next(Math.round(n))}},t.Truncate={id:"Truncate",defaultStyle:{icon:"fa-truncate"},namespace:n,description:"Emits the truncated value of a number",inputs:{n:{description:"Number to truncate"}},outputs:{truncated:{description:"The truncated value of n"}},run:(e,t)=>{let{n:n}=e,{truncated:o}=t;return o.next(Math.trunc(n))}},t.Sin={id:"Sin",defaultStyle:{icon:"fa-sin"},namespace:n,description:"Emits the sine of an angle",inputs:{angle:{description:"Angle in radians"}},outputs:{sine:{description:"The sine of angle"}},run:(e,t)=>{let{angle:n}=e,{sine:o}=t;return o.next(Math.sin(n))}},t.Cos={id:"Cos",defaultStyle:{icon:"fa-cos"},namespace:n,description:"Emits the cosine of an angle",inputs:{angle:{description:"Angle in radians"}},outputs:{cosine:{description:"The cosine of angle"}},run:(e,t)=>{let{angle:n}=e,{cosine:o}=t;return o.next(Math.cos(n))}},t.Min={id:"Min",namespace:n,description:"Emits the minimum of two numbers",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{min:{description:"The minimum of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{min:i}=t;return i.next(Math.min(n,o))}},t.Max={id:"Max",namespace:n,description:"Emits the maximum of two numbers",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{max:{description:"The maximum of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{max:i}=t;return i.next(Math.max(n,o))}},t.ParseInt={id:"Parse Int",namespace:n,description:"Emits the integer value of a string",inputs:{str:{description:"String to parse"}},outputs:{int:{description:"The integer value of str"}},run:(e,t)=>{let{str:n}=e,{int:o}=t;return o.next(parseInt(n))}},t.ParseFloat={id:"Parse Float",namespace:n,description:"Emits the float value of a string",inputs:{str:{description:"String to parse"}},outputs:{float:{description:"The float value of str"}},run:(e,t)=>{let{str:n}=e,{float:o}=t;return o.next(parseFloat(n))}},t.ToFixed={id:"To Fixed",namespace:n,description:"Emits the specified number of decimal places of a number",inputs:{number:{description:"Number to format"},places:{description:"Number of decimal places to format to"}},outputs:{fixed:{description:"The number with the specified number of decimal places"}},run:(e,t)=>{let{number:n,places:o}=e,{fixed:i}=t;return i.next(n.toFixed(o))}},t.ToExponential={id:"To Exponential",namespace:n,description:"Emits the specified number of decimal places of a number in exponential notation",inputs:{number:{description:"Number to format"},places:{description:"Number of decimal places to format to"}},outputs:{exponential:{description:"The number with the specified number of decimal places in exponential notation"}},run:(e,t)=>{let{number:n,places:o}=e,{exponential:i}=t;return i.next(n.toExponential(o))}},t.ToPrecision={id:"To Precision",namespace:n,description:"Emits the specified number of significant figures of a number",inputs:{number:{description:"Number to format"},places:{description:"Number of significant figures to format to"}},outputs:{precision:{description:"The number with the specified number of significant figures"}},run:(e,t)=>{let{number:n,places:o}=e,{precision:i}=t;return i.next(n.toPrecision(o))}},t.GreaterThan={id:"Greater Than",namespace:n,description:"Emits true if the first number is greater than the second",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{result:{description:"true if n1 is greater than n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{result:i}=t;return i.next(n>o)}},t.GreaterThanOrEqual={id:"Greater Than Or Equal",namespace:n,description:"Emits true if the first number is greater than or equal to the second",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{result:{description:"true if n1 is greater than or equal to n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{result:i}=t;return i.next(n>=o)}},t.LessThan={id:"Less Than",namespace:n,description:"Emits true if the first number is less than the second",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{result:{description:"true if n1 is less than n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{result:i}=t;return i.next(n{let{n1:n,n2:o}=e,{result:i}=t;return i.next(n<=o)}},t.SumList={id:"Sum List",defaultStyle:{icon:"fa-plus"},namespace:n,description:"Emits the sum of a list of numbers",inputs:{list:{description:"List of numbers"}},outputs:{sum:{description:"The sum of the numbers in list"}},run:(e,t)=>{let{list:n}=e,{sum:o}=t;return o.next(n.reduce(((e,t)=>e+t),0))}}},65645:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var o=n(70079),i=n(11253),s=n(74089),r=n(74762),a=n(21766);var u=n(10831),l=n(61997),c=n(77852);const d=(0,a.S)(),p=[0,20],f=e=>{let{flow:t,output:n,inputs:o,onError:s,debugDelay:a,onCompleted:u,dependencies:l,player:c}=e;const p=((e,t)=>{const n=new Set;return{onEvent:o=>{const i={...o,time:Date.now(),executionId:"n/a"};console.info("Got debugger event",o),t.addEvents([i]),e.addEvents([i]),n.forEach((e=>e([i])))},onBatchedEvents:e=>(n.add(e),()=>n.delete(e))}})(c,d);p.debugDelay=a;const f=(0,r.keys)(t.node.outputs)[0];return{executeResult:(0,r.execute)({node:t.node,inputs:o,outputs:{[f]:n},resolvedDeps:{...l,[t.node.id]:t.node},_debugger:p,onCompleted:u,onBubbleError:e=>{s(e)},extraContext:{PubSub:i}}),localDebugger:p}},m=e=>{const{debugDelay:t,onOutput:i,flowProps:a}=e,{flow:m,inputs:h,output:v}=a,g=(0,o.useRef)((0,s.createRuntimePlayer)()),[I,y]=(0,o.useState)(e.flowProps.dependencies),[b,C]=(0,o.useState)(),[x]=(0,s.useDebounce)(I,500),_=(0,c.useDarkMode)(),w=async(e,t)=>{const{node:o}=e,i=Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).find((e=>(0,r.isBaseNode)(e)&&e.id===o.id));let a;y((e=>({...e,[i.id]:{...i,source:{path:"@flyde/stdlib/dist/all-browser",export:i.id}}})));const l=(0,u.ZP)(m,(n=>{if(t){const o=(0,s.vAdd)({x:0,y:0},t.pos);if(a=(0,s.createNewNodeInstance)(e.node,0,o,I),n.node.instances.push(a),t.connectTo){const{insId:e,outputId:o}=t.connectTo;n.node.connections.push({from:{insId:e,pinId:o},to:{insId:a.id,pinId:r.TRIGGER_PIN_ID}})}}}));await new Promise((e=>setTimeout(e,10)));const c=(0,u.ZP)(j,(e=>{e.flow=l,t?.selectAfterAdding&&a&&(e.boardData.selected=[a?.id])}));return P(c),(0,s.toastMsg)(`Node ${o.id} successfully imported from ${e.module}`),I},N=async()=>({importables:Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).filter(r.isBaseNode).map((e=>({node:{...e,source:{path:"n/a",export:"n/a"}},module:"@flyde/stdlib"}))),errors:[]}),[j,P]=(0,o.useState)({flow:m,boardData:{viewPort:{pos:{x:0,y:0},zoom:1},lastMousePos:{x:0,y:0},selected:[]}});(0,o.useEffect)((()=>{P((e=>({...e,flow:m})))}),[m]),(0,o.useEffect)((()=>{y((e=>({...e,main:j.flow.node})))}),[j.flow.node]);const O={state:j,onChangeEditorState:P,hideTemplatingTips:!0,initialPadding:p,onExtractInlineNode:r.noop,disableScrolling:!0,darkMode:_.isDarkMode};(0,o.useEffect)((()=>{g.current.start()}),[]),(0,o.useEffect)((()=>{const{executeResult:n,localDebugger:o}=f({flow:j.flow,dependencies:I,output:v,inputs:h,onError:r.noop,debugDelay:t,player:g.current,onCompleted:e.onCompleted}),s=e.flowProps.output.subscribe((e=>i(e)));return C(o),()=>{n(),s.unsubscribe()}}),[t,x]);const E=(0,o.useMemo)((()=>({resolvedDependencies:I,onImportNode:w,onRequestImportables:N})),[]),S=(0,o.useMemo)((()=>({debuggerClient:b,onRequestHistory:d.requestHistory})),[b]);return o.createElement(l.Z,null,(()=>o.createElement(s.DependenciesContextProvider,{value:E},o.createElement(s.DebuggerContextProvider,{value:S},o.createElement(s.FlowEditor,O)))))}},21766:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var o=n(74762);const i=200,s=()=>{const e=new Map,t=new Map;return{requestHistory:async(n,s,r)=>{const a="input"===r?o.DebuggerEventType.INPUT_CHANGE:o.DebuggerEventType.OUTPUT_CHANGE;if(console.log({insId:n,pinId:s,type:a}),s){const t=`${n}.${s}.${a}`,o=e.get(t)||{total:0,lastSamples:[]},r=o.lastSamples.slice(0,i);return{...o,lastSamples:r}}{const e=t.get(n)||{total:0,lastSamples:[]},o=e.lastSamples.slice(0,i);return{...e,lastSamples:o}}},addEvents:n=>{n.forEach((n=>{if(n.type===o.DebuggerEventType.ERROR){const e=n;e.type=o.DebuggerEventType.OUTPUT_CHANGE,e.pinId=o.ERROR_PIN_ID}if(n.type===o.DebuggerEventType.INPUT_CHANGE||n.type===o.DebuggerEventType.OUTPUT_CHANGE){const{insId:o,type:s,pinId:r}=n;{const t=`${o}.${r}.${s}`,a=e.get(t)||{total:0,lastSamples:[]};a.lastSamples.unshift(n),a.lastSamples.length>i&&a.lastSamples.splice(i,a.lastSamples.length-i),a.total++,e.set(t,a)}{const s=t.get(o)||{total:0,lastSamples:[]};s.lastSamples.unshift(n),s.lastSamples.length>i&&s.lastSamples.splice(i,s.lastSamples.length-i),s.total++,e.set(o,s)}}}))}}}},79256:(e,t,n)=>{"use strict";n.d(t,{I:()=>p});var o=n(70079),i=n(65092),s=n(19841),r=n(49794),a=n(21766),u=n(73949),l=n(81098),c=n(65645);(0,a.S)();const d=[{title:"Hello World",key:"hello-world"},{title:"React Counter",key:"react-counter"},{title:"BMI Calculator",key:"bmi"},{title:"REST API Usage",key:"apis"},{title:"Debounce vs. Throttling",key:"debounce-throttling"},{title:"Fibonacci Seq.",key:"fibonacci"}],p=e=>{const[t,n]=(0,o.useState)(e.initWidth||500),[a,p]=(0,o.useState)(e.defaultDelay||0),[f,m]=(0,o.useState)(!1),h=(0,o.useCallback)(((e,t)=>{let{size:o}=t;n(o.width)}),[]),v=o.createElement("div",{className:"delay-container"},o.createElement("input",{type:"range",id:"volume",name:"delay",value:a,step:"100",min:"0",max:"300",onChange:e=>p(Number(e.target.value))}),o.createElement("label",{htmlFor:"volume"},"Debug Delay: ",a,"ms")),g=d.findIndex((t=>t.key===e.meta.key)),I=d[g+1],y=d[g-1];return o.createElement(i.Z,{title:`${e.meta.title} | Playground`,description:`Flyde Playground - ${e.meta.title} example`},o.createElement("header",{className:(0,s.default)("hero hero--primary",u.Z.heroBanner,"playground-hero")},o.createElement("div",{className:"container"},o.createElement("h1",{className:"hero__title"},"Welcome to Flyde's Online Playground"),o.createElement("p",{className:"hero__subtitle"},"Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!"))),o.createElement("div",{className:"mobile-warning"},"Flyde is currently not optimized for mobile devices. Please"," ",o.createElement("strong",null,"use a desktop computer for the best experience"),"."),o.createElement("ul",{className:"examples__menu"},d.map((e=>o.createElement("li",{key:e.key},o.createElement(r.Z,{to:`/playground/${e.key}`,className:"button button--primary"},e.title))))),o.createElement("div",{className:"playground-container"},o.createElement("header",null,o.createElement("h2",{className:"playground-title"},e.meta.title),o.createElement("div",{className:"playground-description"},e.meta.description),f?o.createElement(o.Fragment,null,o.createElement("hr",null),o.createElement("div",{className:"playground-extra"},e.extraInfo||e.meta.extraInfo,o.createElement("div",{className:"star-hint"},o.createElement("span",null,"\xa0 PS: Did you like this example?"),"Please consider giving a \u2b50\ufe0f to the project"," ",o.createElement("span",{className:"star-wrapper"},o.createElement("iframe",{className:"gh-stars-frame",src:"https://ghbtns.com/github-btn.html?user=flydelabs&repo=flyde&type=star&count=true&size=small",width:100,height:20,title:"GitHub Stars"}))))):null,e.prefixComponent),o.createElement("div",{className:"playground"},o.createElement("div",{className:"flow-container"},!0!==e.hideDelay?v:null,o.createElement(c.Y,{flowProps:e.flowProps,debugDelay:a,onOutput:()=>m(!0)})),o.createElement(l.Resizable,{height:0,width:t,onResize:h,handle:o.createElement("div",{className:"handle"}),axis:"x",resizeHandles:["w"]},o.createElement("div",{className:"output-container",style:{flexBasis:t}},e.children))),o.createElement("nav",{className:"pagination-nav"},o.createElement("div",{className:"pagination-nav__item"},y?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${y.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Previous Example"),o.createElement("div",{className:"pagination-nav__label"},y.title)):null),o.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},I?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${I.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Next Example"),o.createElement("div",{className:"pagination-nav__label"},I.title)):null))))}},35865:(e,t,n)=>{const o=n(70079);e.exports={id:"Button",inputs:{children:{type:"any",mode:"required"}},outputs:{jsx:{type:"any"},click:{type:"any"}},completionOutputs:["jsx"],run:function(e,t){const n=o.createElement("button",{onClick:e=>t.click.next(e),className:"button button--outline button--primary"},e.children);t.jsx.next(n)}}},99365:(e,t,n)=>{const o=n(70079);e.exports={id:"Span",inputs:{children:{type:"any",mode:"required"}},outputs:{jsx:{type:"any"}},completionOutputs:["jsx"],run:function(e,t){const n=o.createElement("span",{},e.children);t.jsx.next(n)}}},85088:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var o=n(70079),i=n(74762),s=n(79256);const r={dependencies:{Button:{id:"Button",inputs:{children:{type:"any",mode:"required"}},outputs:{jsx:{type:"any"},click:{type:"any"}},completionOutputs:["jsx"],run:n(35865).run,source:{path:"/Users/gabrielgrinberg/projects/flyde/website/src/pages/playground/_flows/react-counter/Button.flyde.js",export:"default"}},Span:{id:"Span",inputs:{children:{type:"any",mode:"required"}},outputs:{jsx:{type:"any"}},completionOutputs:["jsx"],run:n(99365).run,source:{path:"/Users/gabrielgrinberg/projects/flyde/website/src/pages/playground/_flows/react-counter/Span.flyde.js",export:"default"}},Publish:{id:"Publish",namespace:"Control Flow",description:"Publishes a value by a key to all listeners in the current flow. Use 'Subscribe' to listen to events.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},value:{mode:"required"}},outputs:{},run:n(43920).Publish.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Publish"}},Subscribe:{id:"Subscribe",namespace:"Control Flow",description:"Subscribes to a value published by a key. Use 'Publish' to publish values.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},initial:{mode:"required-if-connected",description:"If passed will be published has the first value"}},completionOutputs:[],outputs:{value:{description:"The value published by the key"}},run:n(43920).Subscribe.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Subscribe"}},Add:{id:"Add",defaultStyle:{icon:"fa-plus"},namespace:"Numbers",description:"Emits the sum of two numbers",inputs:{n1:{description:"First number to add"},n2:{description:"Second number to add"}},outputs:{sum:{description:"The sum of n1 and n2"}},run:n(45888).Add.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Numbers.flyde.js",export:"Add"}},"List From 3":{id:"List From 3",defaultStyle:{icon:"fa-list"},namespace:"Lists",description:"Creates a list from three values",inputs:{value1:{description:"First value"},value2:{description:"Second value"},value3:{description:"Third value"}},outputs:{list:{description:"List containing all 3 values"}},run:n(67040).ListFrom3.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Lists.flyde.js",export:"ListFrom3"}}},flow:{imports:{"@flyde/stdlib":["Boolean Split","Publish","Subscribe","Add","HtmlBtn","List From 3"],"./Button.flyde.js":["Button"],"./Span.flyde.js":["Span"]},node:{instances:[{pos:{x:-115.26095214843747,y:226.5338534545898},id:"Button-410",inputConfig:{children:{mode:"static",value:"+"}},visibleInputs:["children"],nodeId:"Button",style:{size:"large",color:"#00bbf9"}},{pos:{x:-329.9831323242188,y:226.03836868286135},id:"Span-677",inputConfig:{children:{mode:"queue"}},visibleInputs:["children"],nodeId:"Span",style:{size:"large",color:"#9b5de5"}},{pos:{x:-518.7030297851562,y:216.28152648925777},id:"Button-410-d44",inputConfig:{children:{mode:"static",value:"-"}},visibleInputs:["children"],nodeId:"Button",style:{size:"large",color:"#00bbf9"}},{pos:{x:-42.589892578125,y:414.4257174682617},id:"Publish-107",inputConfig:{key:{mode:"static",value:"inc"},value:{mode:"static",value:1}},visibleInputs:["key","value","__trigger"],nodeId:"Publish",style:{color:"#00bbf9"}},{pos:{x:-201.807001953125,y:-187.86253479003906},id:"Subscribe-896",inputConfig:{key:{mode:"static",value:"inc"}},nodeId:"Subscribe",style:{color:"#00f5d4"}},{pos:{x:-272.72882080078125,y:-9.603830566406259},id:"Add-138",inputConfig:{n1:{mode:"sticky"}},nodeId:"Add"},{pos:{x:-387.2609814453125,y:-186.2929638671875},id:"Subscribe-227",inputConfig:{key:{mode:"static",value:"value"},initial:{mode:"static",value:0}},nodeId:"Subscribe",style:{color:"#00f5d4"}},{pos:{x:-676.053251953125,y:420.80437835693357},id:"Publish-441",inputConfig:{key:{mode:"static",value:"inc"},value:{mode:"static",value:-1}},visibleInputs:["key","value","__trigger"],nodeId:"Publish",style:{color:"#00bbf9"}},{pos:{x:-122.10039184570314,y:113.89903961181642},id:"Publish-817-d15",inputConfig:{key:{mode:"static",value:"value"},value:{mode:"queue"}},visibleInputs:["value"],nodeId:"Publish",style:{color:"#00bbf9"}},{pos:{x:-393.0812890625,y:110.83120086669919},id:"Inline-value-Value is ${inp-308",inputConfig:{},node:{id:"Inline-value-${inputs.count",inputs:{count:{type:"any",mode:"required"}},outputs:{r:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"outputs.r.next((`${inputs.count}`))",customViewCode:"`${inputs.count}`",dataBuilderSource:"YCR7aW5wdXRzLmNvdW50fWA=",templateType:"value",completionOutputs:["r"],defaultStyle:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"300"}}}},{pos:{x:-416.83026611328125,y:12.137357788085978},id:"Inline-value-0-783",inputConfig:{},node:{id:"Inline-value-0",inputs:{},outputs:{r:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"outputs.r.next((0))",customViewCode:"0",dataBuilderSource:"MA==",templateType:"value",completionOutputs:["r"],defaultStyle:{size:"small",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"300"}}}},{pos:{x:-344.7745190429688,y:415.93806869506835},id:"List From 3-388",inputConfig:{value3:{mode:"sticky"},value1:{mode:"sticky"},value2:{mode:"sticky"}},nodeId:"List From 3"}],connections:[{from:{insId:"Button-410",pinId:"click"},to:{insId:"Publish-107",pinId:"__trigger"}},{from:{insId:"Button-410-d44",pinId:"click"},to:{insId:"Publish-441",pinId:"__trigger"}},{from:{insId:"Inline-value-Value is ${inp-308",pinId:"r"},to:{insId:"Span-677",pinId:"children"}},{from:{insId:"Inline-value-0-783",pinId:"r"},to:{insId:"Inline-value-Value is ${inp-308",pinId:"count"}},{from:{insId:"Add-138",pinId:"sum"},to:{insId:"Inline-value-Value is ${inp-308",pinId:"count"}},{from:{insId:"Add-138",pinId:"sum"},to:{insId:"Publish-817-d15",pinId:"value"}},{from:{insId:"Button-410-d44",pinId:"jsx"},to:{insId:"List From 3-388",pinId:"value1"}},{from:{insId:"Span-677",pinId:"jsx"},to:{insId:"List From 3-388",pinId:"value2"}},{from:{insId:"Button-410",pinId:"jsx"},to:{insId:"List From 3-388",pinId:"value3"}},{from:{insId:"List From 3-388",pinId:"list"},to:{insId:"__this",pinId:"jsx"}},{from:{insId:"Subscribe-896",pinId:"value"},to:{insId:"Add-138",pinId:"n2"}},{from:{insId:"Subscribe-227",pinId:"value"},to:{insId:"Add-138",pinId:"n1"}}],id:"Main",inputs:{},outputs:{jsx:{type:"any"}},inputsPosition:{},outputsPosition:{jsx:{x:-283.81852447487364,y:588.5155366362267}},completionOutputs:["result"]}}},a=e=>o.createElement("div",{className:"output-jsx"},o.createElement("header",null,"Output JSX "),o.createElement("main",null,e.element)),u={title:"React Counter Example",description:'This examples how Flyde can be used to build functional reactive UIs using React! Each time the "jsx" output receives a new value, it is rendered to the output pane.',key:"react-counter",extraInfo:'Another powerful feature of Flyde is that a node can have more than 1 output. For example, "Button" outputs JSX, but also outputs "click" signals. Cool, right?'},l=e=>{const t=(0,i.dynamicOutput)();return t.subscribe(e),t};function c(){const[e,t]=(0,o.useState)(o.createElement("div",null,"Loading")),n=(0,o.useRef)(l((e=>t(e)))),i=(0,o.useRef)({}),[c,d]=(0,o.useState)({flow:r.flow,dependencies:r.dependencies,inputs:i.current,output:n.current});return o.createElement(s.I,{meta:u,flowProps:c},o.createElement(a,{element:e}))}},73949:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={"flyde-flow-editor":"flyde-flow-editor_AAD4",_hj_feedback_container:"_hj_feedback_container_Af03"}},85721:(e,t,n)=>{var o={"./af":47654,"./af.js":47654,"./ar":61325,"./ar-dz":98344,"./ar-dz.js":98344,"./ar-kw":26230,"./ar-kw.js":26230,"./ar-ly":42524,"./ar-ly.js":42524,"./ar-ma":44119,"./ar-ma.js":44119,"./ar-sa":82625,"./ar-sa.js":82625,"./ar-tn":42182,"./ar-tn.js":42182,"./ar.js":61325,"./az":37093,"./az.js":37093,"./be":32721,"./be.js":32721,"./bg":59919,"./bg.js":59919,"./bm":95594,"./bm.js":95594,"./bn":563,"./bn-bd":41757,"./bn-bd.js":41757,"./bn.js":563,"./bo":73211,"./bo.js":73211,"./br":87438,"./br.js":87438,"./bs":83662,"./bs.js":83662,"./ca":61196,"./ca.js":61196,"./cs":5841,"./cs.js":5841,"./cv":85251,"./cv.js":85251,"./cy":24512,"./cy.js":24512,"./da":37539,"./da.js":37539,"./de":5059,"./de-at":53853,"./de-at.js":53853,"./de-ch":99378,"./de-ch.js":99378,"./de.js":5059,"./dv":91454,"./dv.js":91454,"./el":39651,"./el.js":39651,"./en-au":87953,"./en-au.js":87953,"./en-ca":98193,"./en-ca.js":98193,"./en-gb":61980,"./en-gb.js":61980,"./en-ie":14050,"./en-ie.js":14050,"./en-il":6502,"./en-il.js":6502,"./en-in":555,"./en-in.js":555,"./en-nz":11372,"./en-nz.js":11372,"./en-sg":26568,"./en-sg.js":26568,"./eo":69533,"./eo.js":69533,"./es":68327,"./es-do":17620,"./es-do.js":17620,"./es-mx":96467,"./es-mx.js":96467,"./es-us":83272,"./es-us.js":83272,"./es.js":68327,"./et":68523,"./et.js":68523,"./eu":19066,"./eu.js":19066,"./fa":59087,"./fa.js":59087,"./fi":96443,"./fi.js":96443,"./fil":93979,"./fil.js":93979,"./fo":90383,"./fo.js":90383,"./fr":56327,"./fr-ca":25610,"./fr-ca.js":25610,"./fr-ch":97274,"./fr-ch.js":97274,"./fr.js":56327,"./fy":67442,"./fy.js":67442,"./ga":44291,"./ga.js":44291,"./gd":77342,"./gd.js":77342,"./gl":96248,"./gl.js":96248,"./gom-deva":21404,"./gom-deva.js":21404,"./gom-latn":20833,"./gom-latn.js":20833,"./gu":9122,"./gu.js":9122,"./he":74623,"./he.js":74623,"./hi":60364,"./hi.js":60364,"./hr":30860,"./hr.js":30860,"./hu":70441,"./hu.js":70441,"./hy-am":90425,"./hy-am.js":90425,"./id":29672,"./id.js":29672,"./is":96150,"./is.js":96150,"./it":27852,"./it-ch":55603,"./it-ch.js":55603,"./it.js":27852,"./ja":16465,"./ja.js":16465,"./jv":20120,"./jv.js":20120,"./ka":87245,"./ka.js":87245,"./kk":21479,"./kk.js":21479,"./km":65038,"./km.js":65038,"./kn":63060,"./kn.js":63060,"./ko":85020,"./ko.js":85020,"./ku":90582,"./ku.js":90582,"./ky":34950,"./ky.js":34950,"./lb":94201,"./lb.js":94201,"./lo":87894,"./lo.js":87894,"./lt":70120,"./lt.js":70120,"./lv":4265,"./lv.js":4265,"./me":14030,"./me.js":14030,"./mi":9463,"./mi.js":9463,"./mk":25898,"./mk.js":25898,"./ml":64233,"./ml.js":64233,"./mn":47156,"./mn.js":47156,"./mr":34479,"./mr.js":34479,"./ms":24691,"./ms-my":6456,"./ms-my.js":6456,"./ms.js":24691,"./mt":81789,"./mt.js":81789,"./my":37452,"./my.js":37452,"./nb":91170,"./nb.js":91170,"./ne":87529,"./ne.js":87529,"./nl":81776,"./nl-be":24455,"./nl-be.js":24455,"./nl.js":81776,"./nn":34705,"./nn.js":34705,"./oc-lnc":36139,"./oc-lnc.js":36139,"./pa-in":17960,"./pa-in.js":17960,"./pl":1899,"./pl.js":1899,"./pt":31670,"./pt-br":29159,"./pt-br.js":29159,"./pt.js":31670,"./ro":55115,"./ro.js":55115,"./ru":45149,"./ru.js":45149,"./sd":81231,"./sd.js":81231,"./se":35397,"./se.js":35397,"./si":99786,"./si.js":99786,"./sk":39383,"./sk.js":39383,"./sl":68691,"./sl.js":68691,"./sq":34826,"./sq.js":34826,"./sr":40080,"./sr-cyrl":75673,"./sr-cyrl.js":75673,"./sr.js":40080,"./ss":54309,"./ss.js":54309,"./sv":52245,"./sv.js":52245,"./sw":8967,"./sw.js":8967,"./ta":10454,"./ta.js":10454,"./te":35204,"./te.js":35204,"./tet":81571,"./tet.js":81571,"./tg":15737,"./tg.js":15737,"./th":41786,"./th.js":41786,"./tk":50511,"./tk.js":50511,"./tl-ph":14828,"./tl-ph.js":14828,"./tlh":62422,"./tlh.js":62422,"./tr":97047,"./tr.js":97047,"./tzl":90792,"./tzl.js":90792,"./tzm":67730,"./tzm-latn":59963,"./tzm-latn.js":59963,"./tzm.js":67730,"./ug-cn":42535,"./ug-cn.js":42535,"./uk":33151,"./uk.js":33151,"./ur":22750,"./ur.js":22750,"./uz":61914,"./uz-latn":60231,"./uz-latn.js":60231,"./uz.js":61914,"./vi":55517,"./vi.js":55517,"./x-pseudo":64078,"./x-pseudo.js":64078,"./yo":70046,"./yo.js":70046,"./zh-cn":81832,"./zh-cn.js":81832,"./zh-hk":90953,"./zh-hk.js":90953,"./zh-mo":38236,"./zh-mo.js":38236,"./zh-tw":71001,"./zh-tw.js":71001};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=s,e.exports=i,i.id=85721}}]); \ No newline at end of file diff --git a/assets/js/8926b418.2c64d072.js b/assets/js/8926b418.e60006ca.js similarity index 66% rename from assets/js/8926b418.2c64d072.js rename to assets/js/8926b418.e60006ca.js index 98499dd83..878ceebfb 100644 --- a/assets/js/8926b418.2c64d072.js +++ b/assets/js/8926b418.e60006ca.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7998,5976],{19121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cappedArrayDebounce=void 0;t.cappedArrayDebounce=function(e,t,n,o){void 0===o&&(o=500);let i=[],s=null,r=null;return{addItem:a=>{clearTimeout(s),i.push(a),r||(r=setTimeout((()=>{e(i),clearTimeout(s),r=null}),o)),i.length>=n?(e(i),clearTimeout(r),r=null,i=[]):s=setTimeout((()=>{e(i),clearTimeout(r),r=null,i=[]}),t)},flush:()=>{i.length&&(e(i),i=[],clearTimeout(r))},pendingItems:()=>i.length}}},59792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.dataShaper=t.DataShapeType=void 0,function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.ARRAY=3]="ARRAY",e[e.OBJECT=4]="OBJECT",e[e.NULL=5]="NULL",e[e.UNSUPPORTED=6]="UNSUPPORTED"}(n=t.DataShapeType||(t.DataShapeType={}));const o={string:n.STRING,number:n.NUMBER,boolean:n.BOOLEAN,object:n.OBJECT,array:n.ARRAY,null:n.NULL,symbol:n.UNSUPPORTED,undefined:n.UNSUPPORTED,function:n.UNSUPPORTED,bigint:n.UNSUPPORTED};t.dataShaper=function(e,n,i){void 0===n&&(n=5),void 0===i&&(i=5);const s=null===(r=e)?"null":typeof r;var r,a;if("object"===s){if(Array.isArray(e))return n>1?e.filter(((e,t)=>t(0,t.dataShaper)(e,n-1,i))):o.array;if(n>1){const o={};for(const s in e)o[s]=(0,t.dataShaper)(e[s],n-1,i);return a=o,Object.keys(a).sort().reduce(((e,t)=>(e[t]=a[t],e)),{})}return o.object}return o[s]}},23046:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.debugLogger=void 0;const i=(0,o(n(55899)).default)("flyde");t.debugLogger=e=>i.extend(e)},24331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullInsIdPath=void 0,t.fullInsIdPath=function(e,t){if(!e)throw new Error("insId is not defined");return t?`${t}.${e}`:e}},34459:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hashFlow=t.hashNode=void 0;const i=o(n(68805)),s=n(30292),r=e=>(0,i.default)(e);t.hashNode=function(e,t){var n;void 0===t&&(t=!0);const{id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l}=e,c={id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l};if((0,s.isVisualNode)(e)){const{instances:n,connections:o,inputsPosition:i,outputsPosition:s}=e,a=n.map((e=>{const{pos:t,...n}=e;return n})),u=t?{}:{inputsPosition:i,outputsPosition:s},l=t?a:n;l.sort(((e,t)=>e.id.localeCompare(t.id)));const d=[...o];d.sort(((e,t)=>{const n=`${e.from.insId}.${e.from.pinId}`,o=`${t.from.insId}.${t.from.pinId}`;return n.localeCompare(o)}));const p=JSON.stringify({instancesToUse:l,conns:d,...c,maybeIoPos:u});return r(p)}if((0,s.isInlineValueNode)(e)){const{customViewCode:t}=e,o=null!==(n=e.fnCode)&&void 0!==n?n:e.runFnRawCode,i=JSON.stringify({fnCode:o,customViewCode:t,...c});return r(i)}throw new Error("Hashing code nodes unsupported")};t.hashFlow=e=>{const{node:n,imports:o}=e,i=(0,t.hashNode)(n,!1),s=Object.entries(null!=o?o:{}).sort(((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)})).map((e=>{let[t,n]=e;return[t,n.sort()]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{}),a=JSON.stringify(s);return r(i+a)}},86873:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DepGraph=void 0,i(n(3172),t),i(n(59962),t),i(n(23046),t),i(n(19121),t),i(n(59962),t),i(n(34459),t),i(n(39043),t),i(n(59792),t),i(n(24331),t),t.DepGraph=n(60359).DepGraph},3172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testDataCreator=void 0;t.testDataCreator=e=>function(t){void 0===t&&(t={});return{..."function"==typeof e?e():e,...t}}},59962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplePluralize=t.eventually=t.delay=t.noop=t.removeDupes=t.ensure=t.isOptionalType=t.callFnOrFnPromise=t.isPromise=t.isDefined=t.containsAll=t.shuffle=t.randomInts=t.repeat=t.pickRandom=t.randomPos=t.randomInt=t.pickSecond=t.pickFirst=t.fromEntries=t.entries=t.okeys=t.values=t.keys=t.filterOMap=t.mapOMap=t.middlePos=t.calcCenter=t.intersectRect=void 0;t.intersectRect=(e,t)=>{const n=e.x+e.w,o=t.x+t.w;return!(t.x>n||oe.y+e.h||t.y+t.h{let{w:t,h:n,x:o,y:i}=e;return{x:o+t/2,y:i+n/2}};t.middlePos=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});t.mapOMap=(e,n)=>(0,t.entries)(e).map((e=>{let[t,o]=e;return[t,n(t,o)]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.filterOMap=(e,n)=>(0,t.entries)(e).filter((e=>{let[t,o]=e;return n(t,o)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.keys=e=>Object.keys(e);t.values=e=>Object.values(e),t.okeys=t.keys;t.entries=e=>(0,t.okeys)(e).map((t=>[t,e[t]]));t.fromEntries=e=>e.reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.pickFirst=e=>e[0];t.pickSecond=e=>e[1];t.randomInt=function(e,t){void 0===t&&(t=0);const n=Math.random();return t+Math.floor((e-t)*n)};t.randomPos=function(e,n){void 0===e&&(e=1e3),void 0===n&&(n=0);return{x:(0,t.randomInt)(e,n),y:(0,t.randomInt)(e,n)}};t.pickRandom=e=>e[(0,t.randomInt)(e.length)];t.repeat=(e,t)=>"x".repeat(e).split("").map(((e,n)=>t(n)));t.randomInts=function(e,n,o){return void 0===n&&(n=100),void 0===o&&(o=0),(0,t.repeat)(e,(()=>(0,t.randomInt)(n,o)))};t.shuffle=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t};t.containsAll=(e,t)=>t.every((t=>e.includes(t)));t.isDefined=e=>void 0!==e;t.isPromise=e=>e&&"function"==typeof e.then;t.callFnOrFnPromise=(e,n)=>{if(!(0,t.isDefined)(e))return;const o=e=>{try{e()}catch(t){console.error(n,t)}};"function"==typeof e?o(e):Promise.resolve(e).then((e=>{"function"==typeof e&&o(e)}))};t.isOptionalType=e=>/\?$/.test(e);t.ensure=(e,t)=>{if(void 0===e)throw new Error(t||"Undefined value passed");return e};t.removeDupes=e=>Array.from(new Set(e));t.noop=()=>{};t.delay=e=>new Promise((t=>setTimeout(t,e)));t.eventually=async function(e,n,o,i){if(void 0===n&&(n=1e3),void 0===o&&(o=100),void 0===i&&(i=new Set),n<0){const e=Array.from(i).reduce(((e,t,n)=>`${e}\n\t\t${n+1}. ${t}`),"");throw new Error(`[Eventually timeout exceeded after: timeout with error]: ${e}`)}try{await e()}catch(s){const r=Date.now();await(0,t.delay)(o);const a=Date.now()-r;return i.add(null==s?void 0:s.message),(0,t.eventually)(e,n-a,o,i)}},t.simplePluralize=function(e,t){return`${e} ${t}${1!==e?"s":""}`}},39043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileObjectTemplate=t.compileStringTemplate=void 0;t.compileStringTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=new RegExp("\\$\\{"+e+"\\}","g");n=n.replace(i,o)})),n};t.compileObjectTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=JSON.stringify(o),s=new RegExp('"\\$\\$\\{'+e+'\\}"',"g"),r=new RegExp("\\$\\{"+e+"\\}","g"),a="string"==typeof o?o.replace(/"/g,((e,t,n)=>"\\"!==n[t-1]?'\\"':n[t])):o;n=n.replace(s,i).replace(r,a).replace(/\n/g,"\\n")})),JSON.parse(n)}},69150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connection=t.connectionData=t.connectionDataEquals=t.connectionNodeEquals=t.connectionNode=t.externalConnectionNode=t.isInternalConnection=t.isExternalConnection=t.isInternalConnectionNode=t.isExternalConnectionNode=t.getNodeOutputs=t.getOutputName=t.getInputName=t.getNodeInputs=t.TRIGGER_PIN_ID=t.ERROR_PIN_ID=t.THIS_INS_ID=void 0;const o=n(30292);t.THIS_INS_ID="__this",t.ERROR_PIN_ID="__error",t.TRIGGER_PIN_ID="__trigger";t.getNodeInputs=e=>({...e.inputs,[t.TRIGGER_PIN_ID]:(0,o.nodeInput)()});t.getInputName=e=>e===t.TRIGGER_PIN_ID?"Trigger Node":e;t.getOutputName=e=>e===t.ERROR_PIN_ID?"Error":e;t.getNodeOutputs=e=>({...e.outputs,[t.ERROR_PIN_ID]:(0,o.nodeOutput)()});t.isExternalConnectionNode=e=>e&&e.insId===t.THIS_INS_ID;t.isInternalConnectionNode=e=>e.insId!==t.THIS_INS_ID;t.isExternalConnection=e=>{let{from:n,to:o}=e;return(0,t.isExternalConnectionNode)(n)||(0,t.isExternalConnectionNode)(o)};t.isInternalConnection=e=>!(0,t.isExternalConnection)(e);t.externalConnectionNode=e=>({insId:t.THIS_INS_ID,pinId:e});t.connectionNode=(e,t)=>({insId:e,pinId:t});t.connectionNodeEquals=(e,t)=>e.insId===t.insId&&e.pinId===t.pinId;t.connectionDataEquals=(e,n)=>!(!e||!n)&&((0,t.connectionNodeEquals)(e.from,n.from)&&(0,t.connectionNodeEquals)(e.to,n.to)),t.connectionData=function(e,n,o){const i="string"==typeof e?e.split("."):e,s="string"==typeof n?n.split("."):n;if(i.length>2||s.length>2)throw new Error(`invalid source or target to connection data - ${e} / ${n}`);return{from:2===i.length?(0,t.connectionNode)(i[0],i[1]):(0,t.externalConnectionNode)(i[0]),to:2===s.length?(0,t.connectionNode)(s[0],s[1]):(0,t.externalConnectionNode)(s[0]),delayed:o}};t.connection=function(e,t,n){return void 0===n&&(n=!1),{from:e,to:t,delayed:n}}},6775:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;const s=n(30292),r=n(47025),a=n(86873),u=n(69150);i(n(69150),t);t.connect=function(e,t,n,o,i,l,c,d){void 0===n&&(n={}),void 0===i&&(i={}),void 0===l&&(l=a.noop),void 0===c&&(c={}),void 0===d&&(d={});const{id:p,connections:f,instances:m}=e,v=p||"connected-node"+(0,a.randomInt)(999);return{inputs:e.inputs,outputs:e.outputs,id:v,completionOutputs:e.completionOutputs,reactiveInputs:e.reactiveInputs,run:(p,h)=>{let g=[];const I=new a.DepGraph({}),y=new Map,b=new Map,C=new Map,_=new Map,x=new Map,N=new Map;let w;const j=new Set;m.forEach((e=>{const n=(0,s.getNode)(e,t),o=e.id;y.set(e,o),b.set(o,e),I.addNode(o);const i=Object.keys(n.inputs),r=Object.keys(n.outputs),a={},l={};i.forEach((t=>{const n=(e.inputConfig||{})[t]||(0,s.queueInputPinConfig)();(0,s.isStaticInputPinConfig)(n)?a[t]=(0,s.staticNodeInput)(n.value):a[t]=(0,s.dynamicNodeInput)({config:n})})),a[u.TRIGGER_PIN_ID]=(0,s.dynamicNodeInput)({config:(0,s.queueInputPinConfig)()});if(f.some((t=>(0,u.isInternalConnectionNode)(t.to)&&t.to.insId===e.id&&t.to.pinId===u.TRIGGER_PIN_ID))&&e.inputConfig&&e.inputConfig[u.TRIGGER_PIN_ID])throw"Trigger connection can not be configured";r.forEach((e=>{const t=(0,s.dynamicOutput)();l[e]=t}));f.some((t=>(0,u.isInternalConnectionNode)(t.from)&&t.from.insId===e.id&&t.from.pinId===u.ERROR_PIN_ID))&&(l[u.ERROR_PIN_ID]=(0,s.dynamicOutput)()),C.set(o,a),_.set(o,l)}));const P=new Set;return f.forEach((n=>{const{from:o,to:i}=n,{insId:r,pinId:a}=o,{insId:l,pinId:c}=i,d=_.get(r),p=C.get(l);if((0,u.isInternalConnectionNode)(i)&&P.add(`${i.insId}.${i.pinId}`),(0,u.isExternalConnection)(n)){if((0,u.isExternalConnectionNode)(o)){const e=null==p?void 0:p[i.pinId];if(!e)throw new Error(`Input ${i.pinId} of instance ${l} not found`);const t=x.get(o.pinId)||[];t.push(e),x.set(o.pinId,t)}else{let e=null==d?void 0:d[o.pinId];if(!e)throw new Error(`Output ${o.pinId} of instance ${r} not found`);const t=N.get(i.pinId)||[];t.push(e),N.set(i.pinId,t)}return}if(!d)throw new Error(`No outputs found for instance [${r}]`);if(!p)throw b.has(l)?new Error(`No inputs found for instance [${l}]`):new Error(`Instance with id [${l}] does not exist!`);const f=d[a];if(!f)throw new Error(`Output source - [${a}] not found in node [${v}]`);const m=p[c],h=b.get(r);if(!h&&r!==u.THIS_INS_ID)throw new Error(`Instance [${r}] does not exist! failed to connect [${o}] -> [${i}]`);const y=(h?(0,s.getNode)(h,t):e).outputs[a];if(y&&y.delayed||n.delayed||r!==u.THIS_INS_ID&&l!==u.THIS_INS_ID&&I.addDependency(r,l),!m)throw new Error(`Target arg - [${i}] not found in node [${v}]`);const w=f.subscribe((async e=>{if(!(0,s.isDynamicInput)(m))throw console.info(m),new Error(`Impossible state listening to non dynamic input - ${l}.${c}`);m.subject.next(e)}));g.push((()=>w.unsubscribe()))})),(0,a.okeys)(h).forEach((e=>{(N.get(e)||[]).forEach((t=>{const n=t.subscribe((async t=>{if(!h[e])throw new Error(`Impossible state - output ${e} does not exist`);h[e].next(t)}));g.push((()=>n.unsubscribe()))}))})),I.overallOrder().map((e=>b.get(e))).forEach((e=>{const a=C.get(e.id),u=_.get(e.id),p=(0,s.getNode)(e,t);if(!a)throw new Error(`Unexpected error - args not found when running ${e}`);if(!u)throw new Error(`Unexpected error - outputs not found when running ${e}`);for(const t in a){const n=e.inputConfig[t];P.has(`${e.id}.${t}`)||(0,s.isStaticInputPinConfig)(n)||delete a[t]}const f=(0,r.execute)({node:p,inputs:a,outputs:u,resolvedDeps:t,_debugger:n,insId:e.id,extraContext:d,mainState:i,ancestorsInsIds:o,onBubbleError:l,onCompleted:()=>{return t=e.id,j.delete(t),void(0===j.size&&w&&w());var t},onStarted:()=>{return t=e.id,void j.add(t);var t},env:c});g.push(f)})),Object.keys(p).forEach((async e=>{(x.get(e)||[]).forEach((t=>{const n=p[e];if(!(0,s.isDynamicInput)(t))throw new Error(`Unsure what to do with key ${e}, input: ${t} of ins ${o}`);(0,a.isDefined)(n)&&t.subject.next(n)}))})),void 0===e.completionOutputs&&j.size>0?new Promise((e=>{w=e})):()=>g.forEach((e=>{try{e()}catch(t){console.error("error unsubscribing",t)}}))}}}},26488:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MINOR_DEBUGGER_EVENT_TYPES=t.MAJOR_DEBUGGER_EVENT_TYPES=t.DebuggerEventType=void 0,function(e){e.INPUT_CHANGE="i",e.OUTPUT_CHANGE="o",e.PROCESSING_CHANGE="pc",e.ERROR="err",e.INPUTS_STATE_CHANGE="isc"}(n=t.DebuggerEventType||(t.DebuggerEventType={})),t.MAJOR_DEBUGGER_EVENT_TYPES=[n.INPUT_CHANGE,n.OUTPUT_CHANGE,n.ERROR],t.MINOR_DEBUGGER_EVENT_TYPES=[n.PROCESSING_CHANGE,n.INPUTS_STATE_CHANGE]},43686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatEvent=void 0;const o=n(26488);t.formatEvent=function(e){var t,n,i;const s=[e.insId,...null!==(n=null===(t=e.ancestorsInsIds)||void 0===t?void 0:t.split("."))&&void 0!==n?n:[]];(null===(i=e.ancestorsInsIds)||void 0===i?void 0:i.length)>0&&e.ancestorsInsIds;const r=`Node <${e.nodeId}> `,a=`(${s.join(" -> ")})`;return`${r} - ${function(e){switch(e.type){case o.DebuggerEventType.PROCESSING_CHANGE:return e.val?"started processing":"stopped processing";case o.DebuggerEventType.INPUT_CHANGE:return`Input pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.OUTPUT_CHANGE:return`Output pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.INPUTS_STATE_CHANGE:return`Inputs queue size changed to ${Object.entries(e.val).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join(", ")}`;case o.DebuggerEventType.ERROR:return`Error: ${e.val}`}}(e)} ${a}`}},99896:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26488),t),i(n(43686),t)},47025:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.GLOBAL_STATE_NS=t.ROOT_INS_ID=t.INPUTS_STATE_SUFFIX=t.INNER_STATE_SUFFIX=void 0;const s=n(62600),r=n(87794);i(n(99896),t);const a=n(30292),u=n(6775),l=n(84479),c=n(86873),d=n(23046),p=n(30292),f=n(99896),m=n(79804);t.INNER_STATE_SUFFIX="_inner",t.INPUTS_STATE_SUFFIX="_inputs";t.ROOT_INS_ID="__root",t.GLOBAL_STATE_NS="____global";t.execute=e=>{let{node:n,inputs:o,outputs:i,resolvedDeps:v,_debugger:h={},insId:g=t.ROOT_INS_ID,extraContext:I={},mainState:y={},ancestorsInsIds:b,onBubbleError:C=s.noop,env:_={},onCompleted:x=s.noop,onStarted:N=s.noop}=e;const w=[];y[t.GLOBAL_STATE_NS]||(y[t.GLOBAL_STATE_NS]=new Map);const j={...I,ENV:_},P=(0,m.customNodesToNodesCollection)(v,j),O=e=>{const t=e instanceof a.NodeInstanceError?e:new a.NodeInstanceError(e,(0,c.fullInsIdPath)(g,b),n.id);h.onEvent&&h.onEvent({type:f.DebuggerEventType.ERROR,val:t,insId:g,ancestorsInsIds:b,nodeId:n.id}),i[u.ERROR_PIN_ID]?i[u.ERROR_PIN_ID].next(t):C(t)},E=(e=>(0,a.isVisualNode)(e)?(0,u.connect)(e,P,h,(0,c.fullInsIdPath)(g,b),y,O,_,I):(0,a.isInlineValueNode)(e)?(0,m.inlineValueNodeToNode)(e,j):e)(n),D=h.onEvent||s.noop,S={},M={};(0,c.entries)(o).forEach((e=>{let[t,o]=e;if((0,a.isDynamicInput)(o)){const e=(0,a.dynamicNodeInput)({config:o.config}),i=o.subject.subscribe((async o=>{const i=D({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o,ancestorsInsIds:b,nodeId:n.id});if(i){const t=await i.valuePromise;e.subject.next(t)}else h.debugDelay&&await(0,c.delay)(h.debugDelay),e.subject.next(o)}));w.push((()=>i.unsubscribe())),M[t]=e}else{D({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o.config.value,ancestorsInsIds:b,nodeId:n.id});const e=(0,a.staticNodeInput)((0,a.getStaticValue)(o.config.value,P,g));M[t]=e}})),(0,c.entries)(i).forEach((e=>{let[t,o]=e;const i=(0,a.dynamicOutput)(),s=i.subscribe((async e=>{const i=D({type:f.DebuggerEventType.OUTPUT_CHANGE,insId:g,pinId:t,val:e,ancestorsInsIds:b,nodeId:n.id});if(i){const e=await i.valuePromise;o.next(e)}else o.next(e)}));w.push((()=>s.unsubscribe())),S[t]=i}));const T=(e=>{var n,o;const{node:i,inputs:u,outputs:m,resolvedDeps:v,_debugger:h,insId:g,ancestorsInsIds:I,mainState:y,onError:b,onStarted:C,onCompleted:_,env:x,extraContext:N}=e,{run:w,fn:j}=i,P=(0,d.debugLogger)("core"),O=[];let E;const D=(null==h?void 0:h.onEvent)||s.noop,S=(0,c.fullInsIdPath)(g,I),M=`${S}${t.INNER_STATE_SUFFIX}`,T=`${S}${t.INPUTS_STATE_SUFFIX}`,k=P.extend(S),R=y[t.GLOBAL_STATE_NS];y[M]||(y[M]=new Map),y[T]||(y[T]=new Map);let A=null!==(n=y[T])&&void 0!==n?n:new Map;const V=()=>{const e=Array.from(A.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:(0,a.isQueueInputPinConfig)(u[n].config)?null==o?void 0:o.length:1}}),{});D({type:f.DebuggerEventType.INPUTS_STATE_CHANGE,val:e,insId:g,ancestorsInsIds:I,nodeId:i.id})},$={execute:(e,n,o,i)=>(0,t.execute)({node:e,inputs:n,outputs:o,resolvedDeps:v,_debugger:h,insId:i,onCompleted:_,onStarted:C}),insId:g,state:null!==(o=y[M])&&void 0!==o?o:new Map,onCleanup:e=>{O.push(e)},onError:e=>{b(e)},context:null!=N?N:{},ancestorsInsIds:I,globalState:R};let z,H=!1;const G=(i.reactiveInputs||[]).filter((e=>{var t;return!(0,p.isStaticInputPinConfig)(null===(t=u[e])||void 0===t?void 0:t.config)})),L=()=>{var e;null===(e=y[M])||void 0===e||e.clear(),(0,c.keys)(y).filter((e=>e.startsWith(`${S}.`))).forEach((e=>{y[e]=new Map}))},F=e=>{const t=(null==e?void 0:e.key)&&G.includes(null==e?void 0:e.key);if(H&&!t);else{const o=H&&t;if((0,l.isNodeStateValid)(u,A,i)||o){let t;if(H){if(!e)throw new Error("Unexpected state, got reactive node while not processing and not valid");const n=(0,l.pullValueForExecution)(e.key,u[e.key],A,x);t={...z,[e.key]:n},V()}else t=(0,l.pullValuesForExecution)(u,A,x),z=t,V();let o=new Set,s={};if(H=!0,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),i.completionOutputs){const e=i.completionOutputs.map((e=>e.split("+"))).reduce(((e,t)=>(t.forEach((n=>{e.set(n,t)})),e)),new Map);(0,c.entries)(m).forEach((t=>{let[n,a]=t;a.pipe((0,r.first)()).subscribe((t=>{o.add(n),s[n]=t;let r=e.get(n);r&&(r.splice(r.indexOf(n),1),0===r.length&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_&&_(s),L(),(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),E=void 0,o.clear(),s={},(0,l.hasNewSignificantValues)(u,A,x,i.id)&&F()))}))}))}else(0,c.entries)(m).forEach((e=>{let[t,n]=e;n.subscribe((e=>{s[t]=e}))}));try{k("Running node %s with values %o",i.id,t),C&&C(),E=(null!=j?j:w)(t,m,$),(0,c.isPromise)(E)?E.then((()=>{void 0===i.completionOutputs&&_&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_(s),L(),(0,l.hasNewSignificantValues)(u,A,x,i.id)&&F())})).catch((e=>{b(e),H=!1,k("Error in node %s - value %e",i.id,e),D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id})})):void 0===i.completionOutputs&&_&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_(s),L())}catch(n){b(n),H=!1,k("Error in node %s - value %e",i.id,n),D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id})}const d=G.find((e=>u[e]&&(0,l.peekValueForExecution)(e,u[e],A,x,i.id)));if(d){const e=(0,l.peekValueForExecution)(d,u[d],A,x,i.id);F({key:d,value:e})}else{const e=(0,c.entries)(u).find((e=>{let[t,n]=e;const o=(0,a.isQueueInputPinConfig)(n.config),s=(0,l.peekValueForExecution)(t,n,A,x,i.id);return!!o&&(0,c.isDefined)(s)}));if(e){const[t,n]=e,o=(0,l.peekValueForExecution)(t,n,A,x,i.id);F({key:t,value:o})}}}}};F();const B=(0,l.subscribeInputsToState)(u,A,((e,t)=>{P("Got input %s - value is [%o]",e,t),V();try{F({key:e,value:t})}catch(n){b(n)}}));return O.push(B),()=>{(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),O.forEach((e=>e()))}})({node:E,inputs:M,outputs:S,resolvedDeps:P,_debugger:h,insId:g,mainState:y,ancestorsInsIds:b,onError:O,onBubbleError:C,env:_,extraContext:I,onCompleted:x,onStarted:N});return()=>{w.forEach((e=>e())),T()}}},84479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeInputsToState=t.isNodeStateValid=t.hasNewSignificantValues=t.peekValuesForExecution=t.pullValuesForExecution=t.pullValueForExecution=t.peekValueForExecution=void 0;const o=n(30292),i=n(86873),s=n(6775),r=(e,t)=>{const n=(0,o.extractStaticValue)(e);if((0,o.isEnvValue)(n)){return((e,t)=>{const n=e.split(".");let o={...t};for(let s of n){if(!o||!(0,i.isDefined)(o[s])||null===o[s])throw new Error(`Cannot find key ${e} inside obj ${t}`);o=o[s]}return o})((0,o.getEnvKeyFromValue)(n),t)}return n};t.peekValueForExecution=(e,t,n,i,s)=>{const a=n.get(e);let u;if(!t)throw new Error(`Trying to peek value of inexsting input in key "${e}" in node "${s}"`);return u=(0,o.isStaticInput)(t)?r(t,i):(0,o.isQueueInputPinConfig)(t.config)?a?[...a].shift():void 0:a,u};t.pullValueForExecution=(e,t,n,i)=>{const s=n.get(e);let a;return(0,o.isStaticInput)(t)?a=r(t,i):(0,o.isQueueInputPinConfig)(t.config)?(a=(s||[]).shift(),n.set(e,s)):(a=s,(0,o.isStickyInputPinConfig)(t.config)||n.delete(e)),a};t.pullValuesForExecution=(e,n,o)=>(0,i.entries)(e).reduce(((e,i)=>{let[s,r]=i;return e[s]=(0,t.pullValueForExecution)(s,r,n,o),e}),{});t.peekValuesForExecution=(e,n,o,s)=>(0,i.entries)(e).reduce(((e,i)=>{let[r,a]=i;return e[r]=(0,t.peekValueForExecution)(r,a,n,o,s),e}),{});t.hasNewSignificantValues=(e,n,s,r)=>(0,i.entries)(e).some((e=>{let[a,u]=e;const l=(0,o.isQueueInputPinConfig)(u.config),c=(0,t.peekValueForExecution)(a,u,n,s,r);return(0,i.isDefined)(c)&&l}));t.isNodeStateValid=(e,t,n)=>{const r=(0,i.keys)(e),a=(0,i.keys)(n.inputs).filter((e=>{var t;const o=null===(t=n.inputs[e])||void 0===t?void 0:t.mode;return!o||"required"===o}));r.includes(s.TRIGGER_PIN_ID)&&a.push(s.TRIGGER_PIN_ID);return!!(0,i.containsAll)(r,a)&&(0,i.entries)(e).filter((e=>{let[t]=e;return!!n.inputs[t]||t===s.TRIGGER_PIN_ID})).every((e=>{let[s,r]=e;var a;const u=t.get(s);return"optional"===((null===(a=n.inputs[s])||void 0===a?void 0:a.mode)||"required")||(!!(0,o.isStaticInput)(r)||((0,o.isQueueInputPinConfig)(r.config)?(0,i.isDefined)(u)&&u.length>0:(0,i.isDefined)(u)))}))};t.subscribeInputsToState=(e,t,n)=>{const s=[];return(0,i.entries)(e).forEach((e=>{let[i,r]=e;if(!r)return;if((0,o.isStaticInput)(r))return;const a=r.subject.subscribe((e=>{if((0,o.isQueueInputPinConfig)(r.config)){const o=t.get(i)||[];if(!Array.isArray(o))throw new Error(`impossible state - state of key ${i} is set but not an array`);o.push(e),t.set(i,o),n(i,e)}else t.set(i,e),n(i,e)}));s.push((()=>a.unsubscribe()))})),()=>s.forEach((e=>e()))}},5474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flydeFlowSchema=void 0;const o=n(29022),i=o.z.record(o.z.string(),o.z.string().or(o.z.array(o.z.string()))),s=o.z.strictObject({x:o.z.number(),y:o.z.number()}),r=o.z.discriminatedUnion("mode",[o.z.strictObject({mode:o.z.literal("static"),value:o.z.any()}),o.z.strictObject({mode:o.z.literal("queue")}),o.z.strictObject({mode:o.z.literal("sticky")})]),a=o.z.object({size:o.z.optional(o.z.enum(["small","regular","large"])),icon:o.z.optional(o.z.any()),color:o.z.optional(o.z.string()),cssOverride:o.z.optional(o.z.record(o.z.string()))}),u=o.z.object({pos:s.default({x:0,y:0}),id:o.z.string(),inputConfig:o.z.optional(o.z.record(o.z.string(),r)).default({}),visibleInputs:o.z.optional(o.z.array(o.z.string())),visibleOutputs:o.z.optional(o.z.array(o.z.string())),nodeId:o.z.optional(o.z.string()),node:o.z.optional(o.z.any()),style:o.z.optional(a)}).refine((e=>e.node||e.nodeId),{message:"Instance must have either an inline node or refer to a nodeId"}),l=o.z.union([o.z.string(),o.z.object({mode:o.z.enum(["required","optional","required-if-connected"]),type:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),defaultValue:o.z.optional(o.z.any())})]),c=o.z.object({type:o.z.optional(o.z.string()),optional:o.z.optional(o.z.boolean()),delayed:o.z.optional(o.z.boolean()),description:o.z.optional(o.z.string())}),d=o.z.object({id:o.z.optional(o.z.string()),inputs:o.z.record(o.z.string(),l),outputs:o.z.record(o.z.string(),c),inputsPosition:o.z.optional(o.z.record(o.z.string(),s)),outputsPosition:o.z.optional(o.z.record(o.z.string(),s)),customViewCode:o.z.optional(o.z.string()),dataBuilderSource:o.z.optional(o.z.string()),templateType:o.z.optional(o.z.string()),completionOutputs:o.z.optional(o.z.array(o.z.string())),reactiveInputs:o.z.optional(o.z.array(o.z.string())),defaultStyle:o.z.optional(a),description:o.z.optional(o.z.string()),searchKeywords:o.z.optional(o.z.array(o.z.string()))}),p=o.z.object({instances:o.z.array(u),connections:o.z.array(o.z.strictObject({from:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),to:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),delayed:o.z.optional(o.z.boolean()),hidden:o.z.optional(o.z.boolean())}))}).and(d);t.flydeFlowSchema=o.z.strictObject({imports:o.z.optional(i).default({}),node:p})},74762:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticValueVisualNode=void 0,i(n(86873),t);const s=n(30292);i(n(6775),t),i(n(47025),t),i(n(10418),t),i(n(30292),t),i(n(3320),t),i(n(79804),t),i(n(5474),t);t.isStaticValueVisualNode=e=>!!e&&!!(0,s.maybeGetStaticValueNodeId)(`${e}`)},87093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fakeVm=t.VM=t.VMScript=void 0;const o=n(86873);class i{constructor(e){this.script=e}}t.VMScript=i;class s{constructor(e){this.context=e}run(e){const t=(0,o.okeys)(this.context.sandbox),n=Object.values(this.context.sandbox);Function(...t,e.script)(...n)}}t.VM=s,t.fakeVm={VMScript:i,VM:s}},28145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVM2Instance=void 0;const o=n(87093);t.getVM2Instance=()=>o.fakeVm},79804:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.customNodesToNodesCollection=t.inlineValueNodeToNode=void 0;const i=o(n(18706)),s=n(86873),r=n(30292),a=(0,n(28145).getVM2Instance)();t.inlineValueNodeToNode=function(e,t){void 0===t&&(t={});const{runFnRawCode:n,...o}=e,u=(0,s.debugLogger)(`code-node:${e.id}`),l=`\n try {\n ${n}\n } catch (e) {\n adv.onError(e);\n }\n `,c=new a.VMScript(l),d={...o,run:(n,o,l)=>{const d=new a.VM({sandbox:{inputs:n,outputs:o,setInterval:setInterval,clearInterval:clearInterval,setTimeout:setTimeout,clearTimeout:clearTimeout,encodeURIComponent:encodeURIComponent,adv:l,log:function(){for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeWithDependencies=void 0;const o=n(30292),i=n(74762),s=n(88270);t.getNodeWithDependencies=function(e,n,r){if(void 0===r&&(r=[]),(0,o.isInlineValueNode)(e))return[e];if(r.includes(e.id))return[];const a=(0,i.removeDupes)(e.instances.filter((e=>(0,s.isRefNodeInstance)(e))).map((e=>e.nodeId)).filter((e=>n[e])));return[e,...a.flatMap((e=>{var t;return null!==(t=n[e])&&void 0!==t?t:[]})).reduce(((e,o)=>[...e,...(0,t.getNodeWithDependencies)(o,n,[...r,...a])]),[])]}},30292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88270),t),i(n(43069),t),i(n(79426),t),i(n(44535),t),i(n(18063),t),i(n(20359),t)},18063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeInstanceError=void 0;class n extends Error{constructor(e,t,n){let o="Unknown error";o="string"==typeof e?e:e instanceof Error?e.message:null!==e&&"object"==typeof e?JSON.stringify(e):String(e),super(`${o} (insId: ${t}, nodeId: ${n})`),this.name=this.constructor.name,this.message=`${o} (insId: ${t}, nodeId: ${n})`,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.fullInsIdsPath=t,this.nodeId=n}}t.NodeInstanceError=n},88270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInsId=t.NodeInstance=t.isRefNodeInstance=t.isInlineNodeInstance=t.inlineNodeInstance=t.nodeInstance=void 0;const o=n(36618);t.nodeInstance=(e,t,n,o)=>({id:e,nodeId:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.inlineNodeInstance=(e,t,n,o)=>({id:e,node:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.isInlineNodeInstance=e=>!!e.node;t.isRefNodeInstance=e=>!(0,t.isInlineNodeInstance)(e);t.NodeInstance=(e,t,n,o)=>({id:e,nodeId:t.id,inputConfig:n||{},pos:o||{x:0,y:0}});t.createInsId=e=>`${e.id}-${(0,o.slug)()}`},43069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvKeyFromValue=t.toEnvValue=t.isEnvValue=t.extractStaticValue=t.isStaticInput=t.isDynamicInput=t.staticNodeInput=t.dynamicNodeInputs=t.dynamicNodeInput=t.dynamicOutput=t.nodeOutputs=t.nodeOutput=t.nodeInputs=t.isInputPinOptional=t.nodeInput=void 0;const o=n(62600),i=n(30292),s=n(86873),r=n(79426);t.nodeInput=function(e){return void 0===e&&(e="required"),{mode:e}};t.isInputPinOptional=e=>"optional"===e.mode;t.nodeInputs=(e,n)=>(0,s.repeat)(e,(e=>(0,t.nodeInput)((null==n?void 0:n[e])||"required")));t.nodeOutput=function(e){return void 0===e&&(e=!1),{delayed:e}};t.nodeOutputs=e=>(0,s.repeat)(e,(()=>(0,t.nodeOutput)()));t.dynamicOutput=()=>new o.Subject,t.dynamicNodeInput=(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})));t.dynamicNodeInputs=function(e){return void 0===e&&(e=10),(0,s.repeat)(e,(()=>(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})))()))};t.staticNodeInput=e=>({config:(0,r.staticInputPinConfig)(e)});t.isDynamicInput=e=>{const t=e;return t&&t.subject&&!!t.subject.next};t.isStaticInput=e=>(0,i.isStaticInputPinConfig)(null==e?void 0:e.config);t.extractStaticValue=e=>{if((0,t.isStaticInput)(e))return e.config.value;throw new Error("Cannot extract static value from non static arg")};t.isEnvValue=e=>"string"==typeof e&&e.startsWith("$ENV.");t.toEnvValue=e=>`$ENV.${e}`;t.getEnvKeyFromValue=e=>"string"==typeof e?e.replace(/^\$ENV\./,""):e},20359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeFromFunction=t.getNodeDef=t.getNode=t.getStaticValue=t.maybeGetStaticValueNodeId=t.fromSimplified=t.inlineValueNode=t.codeNode=t.visualNode=t.isInlineValueNode=t.isVisualNode=t.isCodeNode=t.isBaseNode=t.InlineValueNodeType=void 0;const o=n(86873),i=n(88270),s=n(43069);!function(e){e.VALUE="value",e.FUNCTION="function"}(t.InlineValueNodeType||(t.InlineValueNodeType={}));t.isBaseNode=e=>e&&e.id&&e.inputs&&e.outputs;t.isCodeNode=e=>(0,t.isBaseNode)(e)&&"function"==typeof e.run;t.isVisualNode=e=>!!e.instances;t.isInlineValueNode=e=>(0,o.isDefined)(e)&&(0,o.isDefined)(e.runFnRawCode),t.visualNode=(0,o.testDataCreator)({id:"visual-node",inputs:{},outputs:{},instances:[],connections:[],outputsPosition:{},inputsPosition:{}}),t.codeNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},run:o.noop}),t.inlineValueNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},runFnRawCode:""});t.fromSimplified=e=>{let{run:t,inputTypes:n,outputTypes:i,id:s}=e;return{id:s,inputs:(0,o.entries)(n).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),outputs:(0,o.entries)(i).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),run:t}};t.maybeGetStaticValueNodeId=e=>{const t="string"==typeof e&&e.match(/^__node\:(.*)/);if(t){return t[1]}return null};t.getStaticValue=(e,n,o)=>{const i=(0,t.maybeGetStaticValueNodeId)(e);if(i){const e=n[i];if(!e)throw new Error(`Instance ${o} referrer to a node reference ${i} that does not exist`);return e}return e};t.getNode=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw new Error(`Node with id ${n} not found`);return o};t.getNodeDef=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw console.error(`Node with id ${n} not found`),new Error(`Node with id ${n} not found`);return o};t.codeFromFunction=e=>{let{id:t,fn:n,inputNames:o,outputName:i,defaultStyle:r}=e;return{id:t,inputs:o.reduce(((e,t)=>({...e,[t]:(0,s.nodeInput)()})),{}),outputs:{[i]:(0,s.nodeOutput)()},run:(e,t)=>{const s=o.map((t=>e[t])),r=t[i],a=n(...s);return Promise.resolve(a).then((e=>null==r?void 0:r.next(e)))},completionOutputs:[i],defaultStyle:r}}},44535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nodeFromSimpleFunction=void 0,t.nodeFromSimpleFunction=function(e){var t;return{...e,id:e.id,description:e.description,namespace:e.namespace,inputs:e.inputs?e.inputs.reduce(((e,t)=>{let{name:n,description:o,mode:i,defaultValue:s}=t;return{...e,[n]:{description:o,mode:null!=i?i:"required",defaultValue:s}}}),{}):{},outputs:e.output?{[e.output.name]:{description:e.output.description}}:{},defaultStyle:{icon:e.icon,size:e.size},run:null!==(t=e.fullRunFn)&&void 0!==t?t:async function(t,n,o){var i,s;const r=(null!==(i=e.inputs)&&void 0!==i?i:[]).map((e=>{let{name:n}=e;return t[n]}));try{const t=await Promise.resolve(e.run(...r));e.output&&(null===(s=n[e.output.name])||void 0===s||s.next(t))}catch(a){console.error("Error in node",a),o.onError(a)}},customViewCode:e.customViewCode}}},79426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticInputPinConfig=t.isStickyInputPinConfig=t.isQueueInputPinConfig=t.staticInputPinConfig=t.stickyInputPinConfig=t.queueInputPinConfig=t.INPUT_MODES=void 0,t.INPUT_MODES=["queue","sticky","static"];t.queueInputPinConfig=()=>({mode:"queue"});t.stickyInputPinConfig=()=>({mode:"sticky"});t.staticInputPinConfig=e=>({mode:"static",value:e});t.isQueueInputPinConfig=e=>"queue"===e.mode;t.isStickyInputPinConfig=e=>!!e&&"sticky"===e.mode,t.isStaticInputPinConfig=function(e){return!!e&&"static"===e.mode}},10418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedExecute=void 0;const o=n(74762),i=n(47025);t.simplifiedExecute=function(e,t,n,s,r){void 0===r&&(r={});const a=(0,o.keys)(e.outputs),u=Object.keys(n).reduce(((e,t)=>{const i=n[t];return{...e,[t]:(0,o.isDynamicInput)(i)?i:(0,o.staticNodeInput)(i)}}),{}),l=a.reduce(((e,t)=>{const n=(0,o.dynamicOutput)();return s&&n.subscribe((e=>{s(t,e)})),{...e,[t]:n}}),{});return(0,i.execute)({node:e,inputs:u,outputs:l,resolvedDeps:t,onBubbleError:e=>{throw e},...r})}},25779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodePreview=void 0;const o=n(35250),i=n(74762),s=n(86553);t.NodePreview=e=>{let{node:t}=e;const n={node:t,instance:(0,i.nodeInstance)("bob",t.id,{}),connections:[],viewPort:{pos:{x:0,y:0},zoom:1},resolvedDeps:{},connectionsPerInput:{},onUngroup:i.noop,onDblClick:i.noop,onDragEnd:i.noop,onDragMove:i.noop,onDragStart:i.noop,onPinClick:i.noop,onPinDblClick:i.noop,onSelect:i.noop,onTogglePinBreakpoint:i.noop,onTogglePinLog:i.noop,onToggleSticky:i.noop,displayMode:!0,onInspectPin:i.noop,onDetachConstValue:i.noop,onCopyConstValue:i.noop,onPasteConstValue:i.noop,ancestorsInsIds:"",onChangeVisibleInputs:i.noop,onChangeVisibleOutputs:i.noop,onConvertConstToEnv:i.noop,forceShowMinimized:"both",onExtractInlineNode:i.noop,onCloseInlineEditor:i.noop,isConnectedInstanceSelected:!1,inlineEditorPortalDomNode:null,onChangeStyle:i.noop,onDeleteInstance:i.noop,onGroupSelected:i.noop,onSetDisplayName:i.noop,hadError:!1,queuedInputsData:{},onPinMouseDown:i.noop,onPinMouseUp:i.noop};return(0,o.jsx)("div",{className:"node-preview",children:(0,o.jsx)(s.InstanceView,{...n})})}},30653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDarkMode=t.DarkModeProvider=void 0;const o=n(70079),i=(0,o.createContext)(!0);t.DarkModeProvider=i.Provider;t.useDarkMode=()=>(0,o.useContext)(i)},29183:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataInspectionModal=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=n(74089),p=n(83938),f=n(17102),m=n(98158);t.DataInspectionModal=e=>{var t;const{onRequestHistory:n}=(0,m.useDebuggerContext)(),{item:o}=e,[i,s]=c.default.useState(),[r,v]=c.default.useState(0),[h,g]=c.default.useState(""),[I,y]=c.default.useState(),[b]=(0,d.useDebounce)(h,300);(0,c.useEffect)((()=>{y(null==i?void 0:i.lastSamples.filter((e=>"object"==typeof e.val?JSON.stringify(e.val).includes(b):e.val.toString().includes(b)))),v(0)}),[null==i?void 0:i.lastSamples,b]),c.default.useEffect((()=>{!async function(){var e,t;const i=await n(o.insId,null===(e=o.pin)||void 0===e?void 0:e.id,null===(t=o.pin)||void 0===t?void 0:t.type);s(i)}()}),[o,n]);const C=e=>{const t=e.val;return"object"==typeof t?(0,a.jsx)(p.BrowserOnlyReactJson,{src:t}):(0,a.jsx)(u.Code,{children:t.toString()})},_=`"${o.insId}" ${(null===(t=o.pin)||void 0===t?void 0:t.id)?`(${o.pin.id})`:""}`;return(0,a.jsx)(u.Dialog,{isOpen:!0,title:`Inspecting data for instance ${_}`,onClose:e.onClose,canEscapeKeyClose:!1,className:"data-inspection-modal",children:(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{children:[i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("em",{children:[_," called ",i.total," time(s)"]}),i.total>10&&(0,a.jsx)("span",{children:"Showing last 10 samples"})]}):null,(0,a.jsx)("input",{className:"bp5-input bp5-small bp5-fill",type:"search",placeholder:"Search for values",dir:"auto",onChange:e=>g(e.target.value),value:h}),b.length>0&&(0,a.jsxs)("span",{children:["Showing ",null==I?void 0:I.length," of ",i.lastSamples.length," ",'samples matching query "',b,'"']})]}),(0,a.jsx)("main",{className:"main-wrapper",children:(()=>{if(!i)return(0,a.jsx)(f.Loader,{});if(0===i.total)return(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",(0,a.jsx)("em",{children:o.insId})," ",o.pin?(0,a.jsxs)(c.default.Fragment,{children:["and pin ",(0,a.jsx)("em",{children:o.pin.id})]}):null,". Make sure debugger is running and your program was triggered."]});const e=null==I?void 0:I[r];return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Card,{className:"content-wrapper",children:[e?(0,a.jsxs)("div",{className:"info",children:[(0,a.jsxs)("div",{children:["Showing sample ",r," of event from"," ",(0,a.jsx)("strong",{children:(0,d.timeAgo)(e.time)})," (",new Date(e.time).toLocaleString(),")"]}),(0,a.jsxs)("div",{children:["Instance: ",(0,a.jsx)("strong",{children:e.insId}),", Pin id:"," ",(0,a.jsx)("strong",{children:e.pinId})," "]}),(0,a.jsx)("div",{children:"Value:"})]}):null,C(e)]}),(0,a.jsx)(u.Menu,{className:"samples-menu",children:I.map(((e,t)=>{const n=e.pinId,o=`${i.total-t}. from pin "${n}"`;return(0,a.jsx)(u.MenuItem,{text:o,onClick:()=>v(t)},t)}))})]}):i.lastSamples.length>0&&h.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",children:['No data found for search query "',h,'"']}):(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",o.insId," ",o.pin?`and ${o.pin.id}`:"",". Make sure a debugger is connected and your program was triggered."]})})()})]})})})}},40471:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29183),t)},98158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebuggerContext=t.DebuggerContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({onRequestHistory:()=>Promise.reject(new Error("Not implemented"))});t.DebuggerContextProvider=i.Provider;t.useDebuggerContext=()=>(0,o.useContext)(i)},86125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDependenciesContext=t.DependenciesContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({resolvedDependencies:{},onImportNode:()=>Promise.reject(new Error("Not implemented")),onRequestImportables:()=>Promise.reject(new Error("Not implemented"))});t.DependenciesContextProvider=i.Provider;t.useDependenciesContext=()=>(0,o.useContext)(i)},97106:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FlowEditor=void 0;const u=n(35250),l=s(n(70079)),c=n(74762),d=n(63521),p=a(n(53865)),f=n(68120),m=n(7047),v=n(84472),h=n(82232),g=n(49283),I=n(43490),y=n(68840),b=n(78087),C=n(20079),_=n(60190),x=n(40471),N=n(98158),w=n(86125),j=n(30653),P=n(77852);r(n(43490),t),r(n(98158),t),r(n(86125),t),y.library.add(b.fab,C.fas);const O=["select","drag-move","order-step"];t.FlowEditor=l.memo(l.forwardRef(((e,t)=>{const{state:n,onChangeEditorState:o}=e,{resolvedDependencies:i,onImportNode:s}=(0,w.useDependenciesContext)(),[r,a]=l.useState([]),[y,b]=l.useState([]),{flow:C,boardData:E}=n,D=n.flow.node,[S,M]=l.useState({}),[T,k]=l.useState(new Set),{debuggerClient:R}=(0,N.useDebuggerContext)();l.useEffect((()=>{if(R)return R.onBatchedEvents((e=>{e.forEach((e=>{e.type===c.DebuggerEventType.INPUTS_STATE_CHANGE&&(console.log("INPUTS_STATE_CHANGE",e.insId,e.val),M((t=>({...t,[e.insId]:e.val})))),e.type===c.DebuggerEventType.ERROR&&k((t=>{const n=new Set(t);return n.add(e.insId),n}))}))}))}),[R]);const{openFile:A,reportEvent:V}=(0,I.usePorts)(),$=l.useCallback(((e,t)=>{console.info("onChangeFlow",t.type),"functional"===t.type&&(a([{flow:{...n.flow,...e}},...r.slice(0,50)]),b([])),o((t=>({...t,flow:{...t.flow,...e}})))}),[o,n.flow,r]),[z,H]=l.useState({instances:[],connections:[]}),[G,L]=l.useState(!1),F=l.useCallback((()=>L(!1)),[]),B=l.useCallback((()=>L(!0)),[]),q=l.useCallback((e=>{o((t=>({...t,boardData:{...t.boardData,...e}})))}),[o]);l.useEffect((()=>{q({selected:[],viewPort:d.defaultViewPort,from:void 0,to:void 0,lastMousePos:{x:0,y:0}})}),[D.id]),(0,f.useHotkeys)("cmd+z",(e=>{b([...y,n]);const[t,...i]=r;t&&(o((e=>({...e,...t}))),a(i)),e.preventDefault()}),{text:"Undo last change",group:"Editing"},[n,r,y]);const U=l.useCallback(((e,t)=>{O.some((e=>t.message.includes(e)))||b([]),$({node:e},t)}),[$]),W=l.useCallback((e=>{A({absPath:e.source.path})}),[A]),Z=l.useCallback((function(e,t){void 0===t&&(t=-1*d.NODE_HEIGHT*1.5);const n=(0,m.createNewNodeInstance)(e,t,E.lastMousePos,i);if(n){const e=(0,p.default)(C,(e=>{const t=e.node;if(!(0,c.isVisualNode)(t))throw new Error("Impossible state, adding node to non visual node");t.instances.push(n)}));return $(e,(0,h.functionalChange)("add-node")),F(),n}}),[E.lastMousePos,C,$,F,i]),J=l.useCallback((async e=>{switch(e.type){case g.OmniBarCmdType.ADD:return V("addNode",{nodeId:e.data,source:"omnibar"}),Z(e.data);case g.OmniBarCmdType.ADD_VALUE:{const e=t.current;null==e||e.requestNewInlineValue();break}case g.OmniBarCmdType.IMPORT:{await s(e.data,{pos:E.lastMousePos});const t=(0,_.vAdd)({x:0,y:0},E.lastMousePos),n=(0,m.createNewNodeInstance)(e.data.node,0,t,i),o=(0,p.default)(C,(e=>{e.node.instances.push(n)}));$(o,(0,h.functionalChange)("add-imported-node")),V("addNode",{nodeId:e.data.node.id,source:"omnibar"});break}default:v.AppToaster.show({intent:"warning",message:"Not supported yet"})}F()}),[F,V,Z,t,s,E.lastMousePos,i,C,$]),[Y,K]=l.useState(),Q=l.useCallback((()=>K(void 0)),[]),X=l.useCallback(((e,t)=>{K({insId:e,pin:t})}),[]),{isDarkMode:ee}=(0,P.useDarkMode)();return(0,u.jsx)("div",{className:"flyde-flow-editor",children:(()=>{var n;if((0,c.isInlineValueNode)(D))throw new Error("Impossible state");return(0,u.jsx)(j.DarkModeProvider,{value:null!==(n=e.darkMode)&&void 0!==n?n:ee,children:(0,u.jsxs)(l.Fragment,{children:[Y?(0,u.jsx)(x.DataInspectionModal,{item:Y,onClose:Q}):null,(0,u.jsx)(d.VisualNodeEditor,{currentInsId:c.ROOT_INS_ID,ref:t,boardData:E,onChangeBoardData:q,node:D,onGoToNodeDef:W,onChangeNode:U,resolvedDependencies:i,clipboardData:z,onCopy:H,nodeIoEditable:!D.id.startsWith("Trigger"),onInspectPin:X,onShowOmnibar:B,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:S,initialPadding:e.initialPadding,instancesWithErrors:T,disableScrolling:e.disableScrolling},D.id),G?(0,u.jsx)(g.Omnibar,{flow:C,resolvedNodes:i,onCommand:J,visible:G,onClose:F}):null]})})})()})})))},9001:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeEditor=t.renderCreateIOOption=void 0;const i=n(35250),s=o(n(70079)),r=n(74762),a=n(50382),u=o(n(53865)),l=n(70457),c=n(25779);t.renderCreateIOOption=(e,t,n)=>(0,i.jsx)(a.MenuItem,{icon:"add",text:`Create "${e}"`,active:t,onClick:n,shouldDismissPopover:!1});const d=l.MultiSelect.ofType();t.BaseNodeEditor=e=>{var n,o;const{node:l,onChange:p}=e,f=(0,r.entries)(l.inputs),m=f.filter((e=>{let[,t]=e;return"required"===t.mode})).map((e=>{let[t]=e;return t})),v=f.filter((e=>{let[,t]=e;return"optional"===t.mode})).map((e=>{let[t]=e;return t})),h=f.filter((e=>{let[,t]=e;return"required-if-connected"===t.mode})).map((e=>{let[t]=e;return t})),[g,I]=s.default.useState(!1),y=(0,r.okeys)(l.outputs),b=s.default.useCallback((e=>{p({...l,id:e})}),[l,p]),C=s.default.useCallback((e=>{let t=e?e.split(","):void 0;"[]"===e&&(t=[]),p({...l,completionOutputs:t})}),[l,p]),_=s.default.useCallback((e=>{let t=e?e.split(","):void 0;p({...l,reactiveInputs:t})}),[l,p]),x=s.default.useCallback(((e,t)=>{const n=(0,u.default)(l,(n=>{n.inputs[e]=(0,r.nodeInput)(t)}));p(n)}),[l,p]),N=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.inputs[e]}));p(t)}),[l,p]),w=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{t.outputs[e]=(0,r.nodeOutput)()}));p(t)}),[l,p]),j=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.outputs[e]}));p(t)}),[l,p]);return(0,i.jsxs)("div",{className:"base-node-editor",children:[(0,i.jsx)("div",{className:"form-row",children:(0,i.jsx)(a.FormGroup,{label:"Node Name",labelFor:"text-input",labelInfo:"(required)",children:(0,i.jsx)(a.InputGroup,{id:"node-name",disabled:e.idDisabled,placeholder:"Node ID",value:l.id,onChange:e=>b(e.target.value)})})}),(0,i.jsx)(a.FormGroup,{label:"Required Inputs",children:(0,i.jsx)(d,{selectedItems:m,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),!0!==e.hiddenOutputs?(0,i.jsx)(a.FormGroup,{label:"Outputs",children:(0,i.jsx)(d,{selectedItems:y,placeholder:"Enter output names here",items:[],tagRenderer:e=>e,onItemSelect:w,onRemove:j,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}):null,(0,i.jsx)(a.Checkbox,{checked:g,onChange:e=>I(e.target.checked),children:"Show advanced options"}),(0,i.jsxs)(a.Collapse,{isOpen:g,children:[(0,i.jsx)(a.FormGroup,{label:"Optional Inputs",children:(0,i.jsx)(d,{selectedItems:v,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"optional"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Required-if-connected Inputs",children:(0,i.jsx)(d,{selectedItems:h,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required-if-connected"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Completion Outputs",children:(0,i.jsx)(a.InputGroup,{id:"completion-outputs",placeholder:"completion outputs",value:(null===(n=l.completionOutputs)||void 0===n?void 0:n.join(","))||"",onChange:e=>C(e.target.value)})}),(0,i.jsx)(a.FormGroup,{label:"Reactive Inputs",children:(0,i.jsx)(a.InputGroup,{id:"reactive-inputs",placeholder:"Reactive inputs",value:(null===(o=l.reactiveInputs)||void 0===o?void 0:o.join(","))||"",onChange:e=>_(e.target.value)})})]}),(0,i.jsx)(a.FormGroup,{label:"Preview",children:(0,i.jsx)("div",{className:"preview-wrapper",children:(0,i.jsx)(c.NodePreview,{node:l})})})]})}},82232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metaChange=t.functionalChange=void 0;t.functionalChange=e=>({type:"functional",message:e});t.metaChange=function(e){return void 0===e&&(e="n/a"),{type:"meta",message:e}}},41032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safelyGetNodeDef=t.loadingDef=void 0;const o=n(74762);t.loadingDef={id:"Loading",inputs:{},outputs:{}};t.safelyGetNodeDef=(e,n)=>{try{return(0,o.getNodeDef)(e,n)}catch(i){const n="string"==typeof e?e:e.nodeId;return{...t.loadingDef,id:n}}}},72125:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCodeModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(68371),f=n(74762),m=n(31745),v="`Result is ${inputs.a + inputs.b}`";t.InlineCodeModal=u.memo((function(e){const{initialValue:t,initialType:n}=e,[o,i]=u.useState((0,f.isDefined)(t)?t:v),[s,r]=u.useState(n||f.InlineValueNodeType.VALUE),h=(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:['You can add variables to by referrencing the "inputs" object.',(0,a.jsx)("br",{})," For example:",(0,a.jsx)(c.Code,{children:"`Hello {inputs.name}`"}),' will expose an input pin named "name"']}),(0,a.jsxs)("p",{children:["You can also use ternery expressions, arithmetic operators and more!",(0,a.jsx)("br",{}),"For example:",(0,a.jsx)(c.Code,{children:"inputs.a > inputs.b ? inputs.a + 42 : Math.random() * inputs.b"})]})]}),g=(0,a.jsxs)("span",{children:["Type in any valid JS value, such as ",(0,a.jsx)(c.Code,{children:"true"}),", ",(0,a.jsx)(c.Code,{children:"42"}),","," ",(0,a.jsx)(c.Code,{children:'["bob", "alice", "dave"]'}),".",(0,a.jsx)("br",{})," Dynamic inputs may also be used"]}),I=(0,a.jsxs)("span",{children:["Write any JS code and return a value.",(0,a.jsx)("br",{})," The returned value will be the output.",(0,a.jsx)("br",{})," Example:",(0,a.jsx)(c.Code,{children:"const a = inputs.a; const b = inputs.b; return Math.floor(a/b);"})]}),y=(0,p.getVariables)(o);return u.useEffect((()=>{o===v&&s===f.InlineValueNodeType.FUNCTION&&i(`return ${v}`),o===`return ${v}`&&s===f.InlineValueNodeType.VALUE&&i(v)}),[o,s]),(0,a.jsxs)(c.Dialog,{isOpen:!0,title:"Inline Value / Code",onClose:e.onCancel,className:"inline-code-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:t=>{"Enter"===t.key&&t.metaKey&&e.onSubmit(s,o)},tabIndex:0,children:[(0,a.jsxs)(c.RadioGroup,{inline:!0,onChange:e=>r(e.target.value),selectedValue:s,children:[(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Value ",(0,a.jsx)(m.InfoTooltip,{content:g})]}),value:f.InlineValueNodeType.VALUE}),(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Function ",(0,a.jsx)(m.InfoTooltip,{content:I})]}),value:f.InlineValueNodeType.FUNCTION})]}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"javascript",value:o,onChange:e=>i(e||""),onMount:e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})}}),(()=>{const e=o.includes("return");return e&&s===f.InlineValueNodeType.VALUE?(0,a.jsx)(c.Callout,{intent:c.Intent.WARNING,children:'When using the "value" type you are not expected to return anything'}):e||s!==f.InlineValueNodeType.FUNCTION?null:(0,a.jsxs)(c.Callout,{intent:c.Intent.DANGER,children:['When using the "function" type you are expected to'," ",(0,a.jsx)(c.Code,{children:"return"})," a value.",(0,a.jsx)("br",{}),"Example: ",(0,a.jsx)(c.Code,{children:"return 42 + Date.now();"})]})})(),(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Input pins detected:"," ",y.length?y.map((e=>(0,a.jsx)(c.Code,{children:e},e))):"None",(0,a.jsx)(m.InfoTooltip,{content:h})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:e.onCancel,children:"Cancel"}),(0,a.jsx)(c.Button,{onClick:()=>e.onSubmit(s,o),intent:c.Intent.PRIMARY,className:"save-btn",children:"Save"})]})})]})}))},18594:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(72125),t)},68371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInlineValueNode=t.getVariables=void 0;const o=n(74762),i=n(74762);t.getVariables=e=>(e.match(/inputs\.([a-zA-Z]\w*)/g)||[]).map((e=>e.replace(/inputs\./,"")));t.createInlineValueNode=e=>{let{code:n,customView:s,nodeId:r,type:a}=e;const u=(0,t.getVariables)(n).reduce(((e,t)=>({...e,[t]:(0,o.nodeInput)()})),{}),l={value:(0,o.nodeOutput)()},c=a===o.InlineValueNodeType.FUNCTION?`const result = (function() { ${n}}());\n Promise.resolve(result).then(val => outputs.value.next(val))`:`const result = (${n}); Promise.resolve(result).then(val => outputs.value.next(val))`,d=btoa(n);return(0,i.inlineValueNode)({id:r||`Inline Code ${(0,o.randomInt)(99999)}`,inputs:u,outputs:l,runFnRawCode:c,customViewCode:s||n,dataBuilderSource:d,templateType:a,completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline "+(a===o.InlineValueNodeType.VALUE?"value":"function")})}},49283:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Omnibar=t.OmniBarCmdType=void 0;const a=n(35250),u=s(n(70079)),l=n(70457),c=n(74762),d=n(50382),p=r(n(26372));var f;!function(e){e.ADD="add",e.ADD_VALUE="add-value",e.IMPORT="import"}(f=t.OmniBarCmdType||(t.OmniBarCmdType={}));const m=[];t.Omnibar=e=>{const{resolvedNodes:t}=e,[n,o]=u.useState(""),[i,s]=u.useState(null),[r,v]=u.useState([]);u.useEffect((()=>{const e=(0,c.keys)(t).map((e=>({title:`${t[e].id}`,cmd:{type:f.ADD,data:e},extra:"current flow"}))),n=r.map((e=>({title:`${e.node.id}`,description:e.node.description,cmd:{type:f.IMPORT,data:e},extra:`${e.module}`}))),o={title:"Add inline value or code",suggestOnEmpty:!0,cmd:{type:f.ADD_VALUE}},i=[...m,...n,o,...e];s(i)}),[t,r]),u.useEffect((()=>{e.onRequestImportables&&e.onRequestImportables(n).then((e=>{v(e)}))}),[e,n]);const h=u.useCallback(((e,t)=>{let{handleClick:n,modifiers:o,query:i,index:s}=t;if(!o.matchesPredicate)return null;const r=`${e.title}`;return(0,a.jsx)(d.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,a.jsxs)("div",{className:(0,p.default)("omnibar-item",{active:o.active}),children:[(0,a.jsxs)("div",{className:"title",children:[r," ",e.extra?(0,a.jsx)("span",{className:"extra",children:e.extra}):null]}),e.description?(0,a.jsx)("div",{className:"description",children:e.description}):null]})},s)}),[]),g=u.useCallback(((e,t)=>{const n=e.toLowerCase().split("").map((e=>{return`${t=e,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*`;var t})).join(""),o=new RegExp(n);return!!t.title.toLowerCase().match(o)}),[]),I=u.useCallback((t=>{e.onCommand(t.cmd),e.onClose()}),[e]);return i?(0,a.jsx)(l.Omnibar,{query:n,onQueryChange:o,onClose:e.onClose,noResults:(0,a.jsx)(d.MenuItem,{disabled:!0,text:"No results."}),itemPredicate:g,isOpen:e.visible,items:i,initialContent:void 0,onItemSelect:I,itemRenderer:h,inputProps:{placeholder:"Search for nodes or commands.."}}):null}},60698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43490:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31874),t)},31874:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.usePorts=t.useConfirm=t.usePrompt=t.PortsContext=t.defaultPorts=void 0;const s=n(70079),r=n(74762),a=n(84472);i(n(60698),t);const u=e=>async()=>{console.warn(`${e} Not implemented`),(0,a.toastMsg)("Feature not implemented in this context yet","warning")};t.defaultPorts={prompt:async e=>{let{text:t,defaultValue:n}=e;return prompt(`${t}`,n)},openFile:async e=>{},confirm:async e=>{let{text:t}=e;return confirm(t)},readFlow:u("readFlow"),setFlow:u("setFlow"),resolveDeps:u("resolveDeps"),getImportables:u("getImportables"),onExternalFlowChange:u("onExternalFlowChange"),onInstallRuntimeRequest:u("onInstallRuntimeRequest"),onRunFlow:u("onRunFlow"),onStopFlow:u("onStopFlow"),reportEvent:r.noop,generateNodeFromPrompt:u("generateNodeFromPrompt"),hasOpenAiToken:()=>Promise.resolve(!1)},t.PortsContext=(0,s.createContext)(t.defaultPorts);t.usePrompt=()=>{const e=(0,s.useContext)(t.PortsContext).prompt;return(t,n)=>e({text:t,defaultValue:n})};t.useConfirm=()=>{const e=(0,s.useContext)(t.PortsContext).confirm;return t=>e({text:t})};t.usePorts=()=>(0,s.useContext)(t.PortsContext)},65758:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelected=void 0;const i=n(74762),s=o(n(53865)),r=n(22513);t.groupSelected=async(e,t,n,o,a)=>{const{instances:u,connections:l}=t,c=u.filter((t=>e.includes(t.id))),d=l.filter((t=>{let{from:n,to:o}=t;return-1!==e.indexOf(n.insId)||-1!==e.indexOf(o.insId)}));if(!c.length)throw new Error("visual without selections");const{visualNode:p,renamedInputs:f,renamedOutputs:m}=await(0,r.createGroup)(c,d,n,a),v=c.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),u[0].pos),h="ref"===o?(0,i.nodeInstance)((0,i.createInsId)(p),p.id,{},v):(0,i.inlineNodeInstance)((0,i.createInsId)(p),p,{},v),g=u.filter((t=>-1===e.indexOf(t.id))),I=l.map((e=>{const t=`${e.from.insId}.${e.from.pinId}`,n=`${e.to.insId}.${e.to.pinId}`;return f[n]?{...e,to:{insId:h.id,pinId:f[n]}}:m[t]?{...e,from:{insId:h.id,pinId:m[t]}}:e})).filter((t=>-1===e.indexOf(t.from.insId)&&-1===e.indexOf(t.to.insId)));return{newNode:p,currentNode:(0,s.default)(t,(e=>{e.instances=[...g,h],e.connections=I}))}}},74089:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(97106),t),i(n(18420),t),i(n(90680),t),i(n(84472),t),i(n(17102),t),i(n(82232),t),i(n(25779),t),i(n(25804),t),i(n(9958),t),i(n(68120),t),i(n(94651),t),i(n(73470),t),i(n(94007),t),i(n(60190),t),i(n(9001),t),i(n(7047),t),i(n(23386),t)},31745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoTooltip=void 0;const o=n(35250),i=n(50382),s=n(50382),r=n(44470),a=n(50382);t.InfoTooltip=e=>{const{content:t}=e;return(0,o.jsx)(s.Tooltip,{content:t,placement:"top",className:"info-tooltip",children:(0,o.jsx)(i.Icon,{icon:(0,o.jsx)(r.InfoSign,{className:a.Classes.INTENT_PRIMARY}),intent:i.Intent.SUCCESS,className:"info-tooltip-icon"})})}},83938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserOnlyReactJson=void 0;const o=n(35250);t.BrowserOnlyReactJson=e=>{if("undefined"==typeof window)return null;const t=n(73541).Z;return(0,o.jsx)(t,{...e})}},94651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsValueRenderer=void 0;const o=n(35250),i=n(74762),s=n(83938);t.AnalyticsValueRenderer=e=>{let{val:t}=e;try{const e=JSON.parse(t),n="object"==typeof e?e:{value:e},r=e&&[e.type,e.key,e.props,e.ref].every(i.isDefined),a=r?{jsxValue:e}:n;return(0,o.jsx)(s.BrowserOnlyReactJson,{src:a,collapseStringsAfterLength:50,collapsed:r})}catch(n){return(0,o.jsx)(s.BrowserOnlyReactJson,{src:{value:t},collapseStringsAfterLength:50})}}},22513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=void 0;const o=n(74762),i=n(74762),s=n(60190),r=n(88593);t.createGroup=async(e,t,n,a)=>{if(0===e.length)throw new Error("cannot create group without instances");const u=e.map((e=>e.id)),l=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return!t&&n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.to,e.to)))===t)),c=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return t&&!n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.from,e.from)))===t));let d={},p={},f={},m={};const v=[],h={};for(const o of l){const e=`${o.to.insId}.${o.to.pinId}`,t=`${o.from.insId}.${o.from.pinId}`,n=o.to.pinId;if(f[t]){v.push({from:(0,i.externalConnectionNode)(f[t]),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)});continue}const r=h[n]?await a(`Name this input (${n} of ${o.to.insId}) is already taken:`)||`i${(0,s.rnd)()}`:n;d[e]=r,f[t]=r,v.push({from:(0,i.externalConnectionNode)(r),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)}),h[r]=(0,i.nodeInput)()}const g={};for(const r of c){const e=`${r.to.insId}.${r.to.pinId}`,t=`${r.from.insId}.${r.from.pinId}`,n=r.from.pinId;if(m[e]){v.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(m[e])});continue}const u=g[n]?await a(`Name this output (${n} of ${r.from.insId} is already taken:`)||`i${(0,s.rnd)()}`:n;p[t]=u,m[e]=u,v.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(u)}),g[u]=(0,o.nodeOutput)()}e.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),e[0].pos);const I=t.filter((e=>u.includes(e.from.insId)&&u.includes(e.to.insId)));return{visualNode:{id:n,inputs:h,outputs:g,instances:e,defaultStyle:{size:"large",color:(0,o.pickRandom)(r.nodeStylePresetColors.map((e=>e.color)))},inputsPosition:(0,o.okeys)(h).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:0}})),{}),outputsPosition:(0,o.okeys)(g).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:400}})),{}),connections:[...I,...v],completionOutputs:(0,o.okeys)(g)},renamedInputs:d,renamedOutputs:p}}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightText=void 0;const o=n(35250);function i(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}t.highlightText=(e,t)=>{let n=0;const s=t.split(/\s+/).filter((e=>e.length>0)).map(i);if(0===s.length)return[e];const r=new RegExp(s.join("|"),"gi"),a=[];for(;;){const t=r.exec(e);if(!t)break;const i=t[0].length,s=e.slice(n,r.lastIndex-i);s.length>0&&a.push(s),n=r.lastIndex,a.push((0,o.jsx)("strong",{children:t[0]},n))}const u=e.slice(n);return u.length>0&&a.push(u),a}},17102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Loader=void 0;const o=n(35250);t.Loader=()=>(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)("svg",{width:"38",height:"38",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:"#007ec6",children:(0,o.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,o.jsxs)("g",{transform:"translate(1 1)",strokeWidth:"2",children:[(0,o.jsx)("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),(0,o.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:(0,o.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})})})},23386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;const o=n(74762);t.logger=(0,o.debugLogger)("editor")},561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadMonaco=void 0;const o=n(51848),i=n(23386);let s=!1;t.preloadMonaco=()=>{s||o.loader.init().then((()=>{(0,i.logger)("monaco preloaded"),s=!0}))}},68120:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHotkeys=t.currentHotkeys=void 0;const i=o(n(45240)),s=n(70079);t.currentHotkeys=new Map,t.useHotkeys=function(e,n,o,r,a){void 0===r&&(r=[]);const u=(0,s.useCallback)((function(){a&&!a.current||n(...arguments)}),[...r,n]);(0,s.useEffect)((()=>((0,i.default)(e,{},u),t.currentHotkeys.set(e,o),()=>{t.currentHotkeys.delete(e),i.default.unbind(e,u)})),[e,u,o])}},94007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeSessionStorage=t.safeLocalStorage=void 0,t.safeLocalStorage={getItem:function(){try{return localStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return localStorage.setItem(...arguments)}catch(e){return null}}},t.safeSessionStorage={getItem:function(){try{return sessionStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return sessionStorage.setItem(...arguments)}catch(e){return null}}}},90680:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocalStorage=t.useResizePref=t.userPreferences=t.useUserPref=void 0;const r=s(n(70079)),a=n(18420),u=n(94007);t.useUserPref=(e,n)=>{const[o,i]=r.useState((()=>{const o=t.userPreferences.getItem(e);return(0,a.isDefined)(o)?o:n}));r.useEffect((()=>{const o=t.userPreferences.getItem(e),s=(0,a.isDefined)(o)?o:n;i(s)}),[e]);return[o,n=>{t.userPreferences.setItem(e,n),i(n)}]},t.userPreferences=(()=>{const e=e=>`up.${e}`;return{getItem:t=>{const n=u.safeLocalStorage.getItem(e(t))||"",o=u.safeSessionStorage.getItem(e(t))||"";try{return JSON.parse(o||n).value}catch(i){return}},setItem:function(t,n,o){void 0===o&&(o=!1);const i=o?sessionStorage:u.safeLocalStorage;try{const o=JSON.stringify({value:n});return i.setItem(e(t),o),!0}catch(s){return console.error("Error saving user preference",s),!1}}}})();t.useResizePref=(e,n)=>{const o=`resize.${e}`;return(0,t.useUserPref)(o,n)};const l=e=>{const t=u.safeLocalStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch(n){return null}};t.useLocalStorage=(e,t)=>{const[n,o]=r.useState(l(e)||t),i=r.useCallback((t=>{u.safeLocalStorage.setItem(e,JSON.stringify({value:t})),o(t)}),[e]);return r.useEffect((()=>{l(e)||u.safeLocalStorage.setItem(e,JSON.stringify({value:t}))}),[e,t,i]),[n,i]}},60190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.totalEnergy=t.itrPhysics=t.hookes=t.coulombs=t.vToStr=t.vNorm=t.vLen=t.vSub=t.vAdd=t.vDiv=t.vMul=t.vZero=t.rnd=t.vec=t.size=void 0;t.size=(e,t)=>({width:e,height:t});t.vec=(e,t)=>({x:e,y:t});t.rnd=function(e,t){return void 0===e&&(e=100),void 0===t&&(t=0),Math.floor(Math.random()*(e-t))+t},t.vZero={x:0,y:0};t.vMul=(e,t)=>{let{x:n,y:o}=e;return{x:n*t,y:o*t}};t.vDiv=(e,n)=>{let{x:o,y:i}=e;return(0,t.vMul)({x:o,y:i},1/n)};t.vAdd=(e,t)=>({x:e.x+t.x,y:e.y+t.y});t.vSub=(e,n)=>(0,t.vAdd)(e,(0,t.vMul)(n,-1));t.vLen=e=>{let{x:t,y:n}=e;return Math.sqrt(t*t+n*n)};t.vNorm=e=>(0,t.vDiv)(e,(0,t.vLen)(e)||1);t.vToStr=e=>{let{x:t,y:n}=e;return`${t.toFixed(1)},${n.toFixed(1)}`};t.coulombs=(e,n,o)=>{const i=(0,t.vLen)((0,t.vSub)(e.p,n.p));if(0===i){const i=(0,t.vec)(2*Math.random()-1,2*Math.random()-1),s=e.m*n.m/Math.pow(10,2);return(0,t.vMul)(i,s*o)}{const s=(0,t.vNorm)((0,t.vSub)(n.p,e.p)),r=e.m*n.m/Math.pow(i+.1,2);return(0,t.vMul)(s,r*o)}};t.hookes=(e,n,o,i,s)=>{const r=(0,t.vLen)((0,t.vSub)(e.p,n.p)),a=(0,t.vNorm)((0,t.vSub)(e.p,n.p));let u=0;return ri&&(u=i-r),(0,t.vMul)(a,s*u)};t.itrPhysics=(e,n)=>{const{p:o,v:i,f:s,m:r}=n,a=(0,t.vDiv)(s,r),u=e/1e3,l=(0,t.vAdd)((0,t.vMul)(a,u),i),c=(0,t.vAdd)((0,t.vMul)(l,u),o);return{...n,p:c,v:l,f:(0,t.vec)(0,0)}};t.totalEnergy=e=>e.reduce(((e,n)=>{const o=(0,t.vLen)(n.v);return e+.5*n.m*o*o}),0)},84472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateToast=t.toastMsg=t.AppToaster=void 0;const o=n(50382);t.AppToaster=(()=>{try{return o.OverlayToaster.create({className:"app-toaster",position:o.Position.BOTTOM_RIGHT})}catch(e){return{}}})();t.toastMsg=(e,n,o)=>t.AppToaster.show({message:e,intent:n,timeout:o});t.updateToast=(e,n,o)=>t.AppToaster.show({message:n,intent:o},e)},18420:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultAnd=t.isLocal=t.fullTime=t.timeAgoFromDt=t.timeAgo=t.toString=t.isDefined=t.set=t.createOmap=t.toOmap=t.values=t.keys=t.entries=void 0;const i=n(7047),s=n(74762),r=o(n(73136));t.entries=e=>Object.keys(e).map((t=>[t,e[t]]));t.keys=e=>Object.keys(e);t.values=e=>Object.keys(e).map((t=>e[t]));t.toOmap=e=>Array.from(e.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.createOmap=function(e){return void 0===e&&(e=[]),e.reduce(((e,t)=>({...e,[t[0]]:t[1]})),{})};t.set=(e,t,n)=>{e[t]=n};t.isDefined=e=>void 0!==e;t.toString=e=>{const t=typeof e;if(""===e)return"(empty string)";if((0,i.isJsxValue)(e))return"JSX Value";if((0,s.isStaticValueVisualNode)(e))return"Embedded Node";if((0,s.isEnvValue)(e))return(0,s.getEnvKeyFromValue)(e);if("object"===t)try{const t=JSON.stringify(e);return"{}"===t?"Empty object":t}catch(n){return"Object (cannot stringify)"}return`${e}`};t.timeAgo=e=>(0,r.default)(new Date(e)).fromNow();t.timeAgoFromDt=e=>(0,r.default)(Date.now()-e).fromNow();t.fullTime=e=>(0,r.default)(new Date(e)).toString();t.isLocal=()=>location.href.includes(":300");t.preventDefaultAnd=e=>t=>{t.preventDefault(),e(t)}},67181:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ActionButton=t.ActionsMenu=t.ActionType=void 0;const r=n(35250),a=n(50382),u=n(50382),l=n(74762),c=s(n(70079)),d=n(86125),p=n(43490),f=n(68120),m=n(90680),v=n(84472),h=n(9971),g=n(47749),I=n(46334),y=n(47230),b=n(41032);var C;!function(e){e.AddNode="add-node",e.RemoveNode="remove-node",e.Group="group",e.UnGroup="un-group",e.AddInlineValue="add-inline-value",e.Inspect="inspect",e.Run="run",e.AI="ai"}(C=t.ActionType||(t.ActionType={}));t.ActionsMenu=e=>{const{onAction:n,selectedInstances:o,resolvedNodes:i,node:s,from:u,to:g,hotkeysEnabled:x,showRunFlowOptions:N}=e,{onRequestImportables:w}=(0,d.useDependenciesContext)(),[j,P]=c.default.useState(!1),[O,E]=c.default.useState(!1),[D,S]=c.default.useState(!1),[M,T]=c.default.useState(null),[k,R]=(0,m.useLocalStorage)("hideHotkeyHintMap",{}),A=(0,c.useCallback)((()=>{P(!1)}),[]),{onRunFlow:V,generateNodeFromPrompt:$,reportEvent:z}=(0,p.usePorts)(),H=(0,c.useCallback)(((e,t)=>(E(!1),V(e,t))),[V]),G=[];if(G.push(C.AddNode),G.push(C.AddInlineValue),1===o.length){const e=s.instances.find((e=>e.id===o[0]));if(e)try{const t=(0,b.safelyGetNodeDef)(e,i);(0,l.isVisualNode)(t)&&G.push(C.UnGroup)}catch(U){console.error(`Could not find node with id ${o[0]} - ${U}`)}else console.error(`Could not find instance with id ${o[0]}`)}N&&G.push(C.Run),o.length>0&&G.push(C.Group),(1===o.length||u||g)&&G.push(C.Inspect),o.length>0&&G.push(C.RemoveNode),G.push(C.AI);const L=(0,c.useCallback)(((e,t)=>{R({...k,[e]:!0}),v.AppToaster.dismiss(t)}),[k,R]),F=(0,c.useCallback)(((e,t)=>{const{hotkey:o}=_[e];if("click"===t.type&&o&&!k[o]){const t=(0,v.toastMsg)((0,r.jsxs)(r.Fragment,{children:["Did you know? you can also use the hotkey"," ",(0,r.jsx)("kbd",{className:"hotkey",children:o})," to"," ",_[e].text.replace(/^[A-Z]/,(e=>e.toLowerCase())),(0,r.jsxs)(a.Button,{minimal:!0,small:!0,onClick:()=>L(o,t),children:[" ","Don't show again"," "]})]}),"none",3e3)}switch(e){case C.AddNode:P(!0);break;case C.Run:!async function(){E(!0)}();break;case C.AI:S(!0);break;default:n({type:e,data:void 0})}}),[k,n,L,s.inputs]);Object.entries(_).forEach((e=>{let[t,n]=e;n.hotkey&&(0,f.useHotkeys)(n.hotkey,(e=>{e.preventDefault(),G.includes(t)&&(F(t,e),R({...k,[n.hotkey]:!0}))}),{text:n.text,group:"Action menu hotkeys"},[G],x)}));const B=(0,c.useCallback)((e=>{n({type:C.AddNode,data:{importableNode:e}})}),[n]),q=(0,c.useCallback)((async e=>{const t=Date.now();T(t);try{z("generateNodeFromPrompt:start",{promptLength:e.length});const o=await $({prompt:e}),{inputs:i,outputs:s}=o.importableNode.node,r=Date.now()-t;z("generateNodeFromPrompt:success",{totalTime:r,inputs:Object.keys(i),outputs:Object.keys(s)}),T(null),n({type:C.AI,data:o}),S(!1)}catch(U){T(null),v.AppToaster.show({message:"Failed to generate node",intent:"danger"}),z("generateNodeFromPrompt:failure",{error:U.message})}}),[$,n,z]);return(0,r.jsxs)("div",{className:"actions-menu",children:[G.map((e=>(0,r.jsx)(t.ActionButton,{type:e,onClick:F},e))),j?(0,r.jsx)(h.AddNodeMenu,{onRequestImportables:w,onAddNode:B,onClose:A}):null,O?(0,r.jsx)(y.RunFlowModal,{onClose:()=>E(!1),onRun:H,node:s}):null,D?(0,r.jsx)(I.PromptAIMenu,{onClose:()=>{S(!1),T(null)},onSubmit:q,submitting:null!==M,submitTime:M}):null]})};const _={[C.AddNode]:{icon:g.addNodeIcon,text:'Open the "add node" menu',hotkey:"a"},[C.RemoveNode]:{icon:g.removeNodeIcon,text:"Remove selected instances",hotkey:"backspace"},[C.Group]:{icon:g.groupIcon,text:"Group selection into a new node",hotkey:"g"},[C.UnGroup]:{icon:g.ungroupIcon,text:"Ungroup selected visual node"},[C.Inspect]:{icon:g.inspectIcon,text:"Inspect data",hotkey:"i"},[C.AddInlineValue]:{icon:g.pencilIcon,text:"Add value / inline function",hotkey:"v"},[C.Run]:{icon:g.playIcon,text:"Run flow",hotkey:"r"},[C.AI]:{icon:g.starIcon,text:"Generate new code node using AI \u2728"}},x={icon:"",text:"N/A",hotkey:void 0};t.ActionButton=e=>{var t;const{onClick:n,type:o}=e,i=(0,c.useCallback)((e=>n(o,e)),[n,o]),s=null!==(t=_[o])&&void 0!==t?t:x,a=s.hotkey?(0,r.jsxs)("span",{children:[s.text," ",(0,r.jsx)("kbd",{className:"hotkey",children:s.hotkey})]}):s.text;return(0,r.jsx)("div",{className:"action-button",onClick:i,"data-type":o,children:(0,r.jsx)(u.Tooltip,{hoverOpenDelay:100,content:a,className:"icon-wrapper",popoverClassName:"action-button-tooltip",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s.icon}})})})}},40149:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenu=t.AddNodeMenuFilterTree=void 0;const a=n(35250),u=n(50382),l=n(74762),c=r(n(26372)),d=s(n(70079)),p=n(43490),f=n(31745),m=n(17102),v=n(87935),h=n(74657),g=n(44470);t.AddNodeMenuFilterTree=u.Tree.ofType();function I(e,t,n){return[...e.external.map((e=>({id:e.module,label:e.module,hasCaret:!0,nodeData:{type:"external",module:e.module},isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module,isExpanded:n.has(e.module),childNodes:e.namespaces.map((o=>({id:`${e.module}/${o}`,label:o,hasCaret:!1,isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module&&t.namespace===o,isExpanded:n.has(`${e.module}/${o}`),nodeData:{type:"external",module:e.module,namespace:o}})))}))),{id:"internal",label:"Current Project",nodeData:{type:"internal"},isExpanded:n.has("internal"),hasCaret:!0,isSelected:"internal"===t.type,childNodes:e.internal.files.map((e=>({id:e,label:e,isSelected:"internal"===t.type&&t.file===e,hasCaret:!1,isExpanded:n.has(e),nodeData:{type:"internal",file:e}})))}]}function y(e){return/\.flyde(\.[jt]s)?$/.test(e.module)}t.AddNodeMenu=e=>{const{onRequestImportables:n,onAddNode:o,onClose:i}=e,[s,r]=d.default.useState(),[b,C]=d.default.useState([]),[_,x]=d.default.useState(new Set),[N,w]=d.default.useState(""),[j,P]=d.default.useState({type:"all"}),[O,E]=d.default.useState(null),[D,S]=d.default.useState(null),[M,T]=d.default.useState(null),k=(0,d.useCallback)((e=>{_.add(e.id),x(new Set(_))}),[_]),R=(0,d.useCallback)((e=>{_.delete(e.id),x(new Set(_))}),[_]),A=(0,d.useCallback)((e=>{o(e),i()}),[o,i]),{onInstallRuntimeRequest:V,reportEvent:$}=(0,p.usePorts)();(0,d.useEffect)((()=>{$("addNodeMenuOpen",{})}),[$]),(0,d.useEffect)((()=>{S(null==s?void 0:s.flatMap((e=>{var t,n,o;if(j)if("external"===j.type){if((e.module!==j.module||j.namespace)&&e.node.namespace!==j.namespace)return[]}else if("internal"===j.type&&(!y(e)||j.file&&e.module!==j.file))return[];if(N){const i=`${null!==(n=null===(t=e.node.searchKeywords)||void 0===t?void 0:t.join(" "))&&void 0!==n?n:[]} ${e.node.id} ${null!==(o=e.node.namespace)&&void 0!==o?o:""} ${e.node.description}`.toLowerCase().indexOf(N.toLowerCase());return-1===i?[]:[{importable:e,score:i}]}return[{importable:e,score:1}]})).sort(((e,t)=>e.score-t.score)).map((e=>{let{importable:t}=e;return t})))}),[s,j,N]),(0,d.useEffect)((()=>{n().then((e=>{let{importables:t,errors:n}=e;C(n);const o=t.filter((e=>!y(e))).reduce(((e,t)=>{var n,o,i;null!==(n=e[i=t.module])&&void 0!==n||(e[i]=[]);const s=null!==(o=t.node.namespace)&&void 0!==o?o:"";return e[t.module].includes(s)||e[t.module].push(s),e}),{}),i=t.filter(y).map((e=>e.module));E({external:Object.entries(o).map((e=>{let[t,n]=e;return{module:t,namespaces:n}})),internal:{files:i}}),r(t),x(new Set(["internal",...Object.keys(o)]))}))}),[n]);const z=(0,d.useCallback)((e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),D&&!M)return void T(D["ArrowDown"===e.key?0:D.length-1]);if(D&&M){const t=D.findIndex((e=>e===M));let n="ArrowDown"===e.key?t+1:t-1;n=n<0?D.length-1:n,n=n>=D.length?0:n,T(D[n])}break;case"Enter":M&&A(M)}}),[D,M,A]),H=(0,d.useCallback)((e=>{let{nodeData:t}=e;JSON.stringify(t)===JSON.stringify(j)?"external"===t.type?t.namespace?P({type:"external",module:t.module}):P({type:"all"}):"internal"===t.type&&(t.file?P({type:"internal"}):P({type:"all"})):P(t)}),[j]),G=!s||s.some((e=>e.module.includes("@flyde/stdlib"))),L=(0,d.useCallback)((()=>{V(),i()}),[i,V]);return(0,a.jsx)(u.Dialog,{isOpen:!0,title:"Add Node Menu",onClose:e.onClose,className:"add-node-menu",isCloseButtonShown:!0,children:(0,a.jsxs)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),children:[(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"bp5-input-group",children:[(0,a.jsx)(g.Search,{}),(0,a.jsx)("input",{className:"bp5-input",type:"search",placeholder:"Search input",dir:"auto",autoFocus:!0,onChange:e=>w(e.target.value),value:N,onKeyDown:z})]}),G?null:(0,a.jsxs)(u.Callout,{intent:u.Intent.NONE,style:{marginTop:10},children:["Using built-in @flyde/stdlib. It's recommended to explicitly install it instead."," ",(0,a.jsx)(u.Button,{minimal:!0,small:!0,intent:u.Intent.PRIMARY,onClick:L,children:"Click here to install it using npm/yarn"})]})]}),(0,a.jsx)("div",{className:"content-wrapper",children:s?(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsxs)("aside",{children:[(0,a.jsxs)("div",{className:"filter-header",children:["Filter by package"," ",(0,a.jsx)(u.Tooltip,{content:(0,a.jsxs)("span",{children:["Click to learn more about how packages work in Flyde"," "]}),hoverCloseDelay:1500,children:(0,a.jsx)("a",{target:"_blank",href:"https://www.flyde.dev/docs/packages",rel:"noreferrer",children:(0,a.jsx)(u.Icon,{icon:(0,a.jsx)(g.Help,{}),intent:"primary",iconSize:12})})})]}),(0,a.jsx)("div",{className:"tree-container",children:(0,a.jsx)(t.AddNodeMenuFilterTree,{contents:I(O,j,_),onNodeCollapse:R,onNodeExpand:k,onNodeClick:H,className:u.Classes.ELEVATION_0})})]}),(0,a.jsx)("main",{children:D?0===D.length?(0,a.jsxs)("div",{className:"no-results",children:[(0,a.jsx)(h.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:P,query:N,onChangeQuery:w,resultsCount:D.length}),(0,a.jsxs)(u.Callout,{className:"callout",intent:"primary",children:["Can't find a suitable node? Create one yourself!"," ",(0,a.jsx)("a",{href:"https://www.flyde.dev/docs/code-nodes",target:"_blank",rel:"noreferrer",children:"Learn more"})]})]}):(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsx)(h.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:P,query:N,onChangeQuery:w,resultsCount:D.length}),(0,a.jsx)("div",{className:"results",children:D.map((e=>(0,a.jsx)(v.AddNodeMenuListItem,{importableNode:e,onAdd:A,selected:(null==M?void 0:M.node)===e.node,onSelect:T,onSetFilter:P},e.node.id+e.node.namespace+e.module)))})]}):(0,a.jsx)(m.Loader,{})})]}):(0,a.jsx)(m.Loader,{})}),b.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",style:{marginTop:"10px"},children:["Found ",(0,l.simplePluralize)(b.length,"corrupt flow"),(0,a.jsx)(f.InfoTooltip,{content:b.map((e=>{let{path:t,message:n}=e;return`${t}: ${n}`})).join(", ")})," "]}):null]})})}},8470:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuListItem=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079));t.AddNodeMenuListItem=e=>{const{importableNode:t,onSetFilter:n,onAdd:o,onSelect:i}=e,{node:s,module:r}=t,{id:d,description:p}=s,f=c.default.useRef(null);c.default.useEffect((()=>{e.selected&&f.current&&f.current.scrollIntoView({block:"center"})}),[e.selected]);const m=(0,c.useCallback)((()=>{o(t)}),[o,t]),v=(0,c.useCallback)((()=>{i(t)}),[i,t]);return(0,a.jsxs)("div",{className:(0,l.default)("add-node-menu-list-item",{selected:e.selected}),ref:f,onClick:v,children:[(0,a.jsxs)("div",{className:"content",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("span",{className:"id",children:d}),(0,a.jsxs)(u.Tag,{interactive:!0,onClick:()=>n({type:"external",module:r,namespace:s.namespace}),className:"source",minimal:!0,children:[r,s.namespace?` / ${s.namespace}`:null]})]}),(0,a.jsx)("div",{className:"description",children:p||(0,a.jsx)("em",{children:"No description"})})]}),(0,a.jsx)("aside",{children:(0,a.jsx)(u.Button,{onClick:m,children:"Add"})})]})}},87935:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8470),t)},88671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuResultsSummary=void 0;const o=n(35250),i=n(50382);t.AddNodeMenuResultsSummary=e=>{const{resultsCount:t,query:n,filter:s,onChangeFilter:r,onChangeQuery:a}=e;return(0,o.jsxs)("div",{className:"add-node-menu-results-summary",children:[t?`Showing ${t} result${t>1?"s":""}`:"No results found","\xa0",n?(0,o.jsxs)(o.Fragment,{children:["matching query\xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>a(""),children:['"',n,'"']})]}):null,"all"===s.type?null:"external"===s.type?(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["package ",s.module,s.namespace?` / ${s.namespace}`:null]})]}):(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["\xa0this project ",s.file?` / ${s.file}`:null]})]})]})}},74657:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88671),t)},9971:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40149),t)},83159:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PromptAIMenu=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=1e4;t.PromptAIMenu=e=>{const{onClose:t}=e,[n,o]=c.default.useState(""),[i,s]=c.default.useState(0);return(0,c.useEffect)((()=>{s(0);const t=setInterval((()=>{s((t=>{const n=(Date.now()-e.submitTime)/d;return Math.min(n+.05*Math.random()/2,.95)}))}),500);return()=>clearInterval(t)}),[e.submitTime]),(0,a.jsxs)(u.Dialog,{isOpen:!0,onClose:t,className:"prompt-ai-menu",title:"\u2728 Generate Code Node using AI",children:[(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsx)(u.TextArea,{value:n,disabled:e.submitting,onChange:e=>o(e.target.value),placeholder:"Describe your node in details",fill:!0})}),e.submitTime?(0,a.jsx)("div",{className:"progress-bar-container",children:(0,a.jsx)(u.ProgressBar,{value:i})}):null,(0,a.jsx)("div",{className:u.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:u.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(u.Button,{onClick:t,children:"Close"}),(0,a.jsx)(u.Button,{intent:u.Intent.PRIMARY,className:"run-btn",disabled:e.submitting||!n,loading:e.submitting,onClick:()=>{s(0),e.onSubmit(n)},children:"Create \u2728"})]})})]})}},46334:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(83159),t)},3152:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RunFlowModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(90680),f=n(31745);t.RunFlowModal=u.memo((function(e){const{onRun:t,onClose:n,node:o}=e,[i,s]=u.useState(0),[r,m]=(0,p.useLocalStorage)(`run-inputs-${o.id}`,Object.keys(o.inputs).reduce(((e,t)=>(e[t]=`Enter a value for input ${t}`,e)),{})),[v,h]=u.useState(JSON.stringify(r,null,2)),g=e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})},I=u.useCallback((()=>{const e=JSON.parse(v);m(e),t(e,i)}),[t,m,v,i]),y=Object.keys(o.inputs),b=y.filter((e=>"required"!==o.inputs[e].mode)),C=u.useMemo((()=>y.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:"This node receives external inputs. Enter values for each input below:"}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"json",value:v,onChange:e=>h(null!=e?e:""),onMount:g}),b.length>0?(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Note: input(s) ",(0,a.jsx)("code",{children:b.join(", ")})," are optional"]}):null]}):(0,a.jsx)("strong",{children:"This node does not receive any external inputs."})),[y.length,b,v]);return(0,a.jsxs)(c.Dialog,{isOpen:!0,onClose:e.onClose,className:"run-flow-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&I()},tabIndex:0,children:[C,(0,a.jsxs)("div",{className:"execution-delay-wrapper",children:[(0,a.jsxs)("label",{children:["Execution delay:"," ",(0,a.jsx)(f.InfoTooltip,{content:"Delay between each node execution. Useful for debugging."})]}),(0,a.jsx)(c.Slider,{value:i,onChange:s,min:0,labelStepSize:500,stepSize:100,labelRenderer:e=>`${e}ms`,max:1e3})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:n,children:"Close"}),(0,a.jsx)(c.Button,{onClick:I,intent:c.Intent.PRIMARY,className:"run-btn",children:"Run"})]})})]})}))},47230:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3152),t)},47749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starIcon=t.stopIcon=t.playIcon=t.pencilIcon=t.ungroupIcon=t.groupIcon=t.inspectIcon=t.removeNodeIcon=t.addNodeIcon=void 0,t.addNodeIcon='\n\n',t.removeNodeIcon='\n\n',t.inspectIcon='\n\n\n',t.groupIcon='\n\n\n',t.ungroupIcon='\n\n\n',t.pencilIcon='\n\n',t.playIcon='\n\n\n',t.stopIcon='\n\n\n',t.starIcon='\n\n\n\n\n'},1237:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HelpBubble=void 0;const i=n(70079),s=n(35250),r=n(50382),a=n(99489),u=n(50382),l=o(n(70079)),c=n(68120),d=n(71644),p=n(43490),f={offset:{enabled:!0,options:{offset:[0,20]}},preventOverflow:{enabled:!0,options:{padding:10}}};const m=["Viewport Controls","Editing","Selection"];t.HelpBubble=()=>{const[e,t]=l.default.useState(!1),n=Array.from(c.currentHotkeys.entries()).map((e=>{let[t,n]=e;return{combo:(o={key:t,menuData:n}).key,label:o.menuData.text,group:o.menuData.group};var o})).reduce(((e,t)=>(e[t.group]||(e[t.group]=[]),e[t.group].push(t),e)),{}),o=Object.entries(n).sort(((e,t)=>m.indexOf(t[0])-m.indexOf(e[0]))),{reportEvent:v}=(0,p.usePorts)(),h=(0,s.jsx)(r.Dialog,{isOpen:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:r.Classes.DIALOG_BODY,children:o.map((e=>{let[t,n]=e;return(0,s.jsxs)(l.default.Fragment,{children:[(0,s.jsx)(r.H4,{children:t}),n.map((e=>(0,i.createElement)(a.Hotkey,{...e,key:e.combo})))]},t)}))})}),g=(0,s.jsxs)(r.Menu,{children:[(0,s.jsx)(r.MenuItem,{text:"Hotkeys",onClick:()=>{t(!0),v("helpMenuItem",{item:"hotkeys"})}}),(0,s.jsx)(r.MenuItem,{text:"Documentation",onClick:()=>v("helpMenuItem",{item:"documentation"}),href:"https://www.flyde.dev/docs",target:"_blank"}),(0,s.jsx)(r.MenuDivider,{}),(0,s.jsx)(r.MenuItem,{text:"Discord",onClick:()=>v("helpMenuItem",{item:"discord"}),href:"https://discord.gg/x7t4tjZQP8",target:"_blank"})]});return(0,s.jsxs)("div",{className:"help-bubble","data-tip":"Help",children:[(0,s.jsx)(u.Popover,{content:g,modifiers:f,onOpened:()=>v("helpMenuOpen",{}),children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:d.helpIcon}})}),h]})}},71644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpIcon=void 0,t.helpIcon='\n\n\n'},3354:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1237),t)},7011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainInstanceEventsIndicator=void 0;const o=n(35250),i=n(30994),s=n(66189),r=n(50382);t.MainInstanceEventsIndicator=e=>{const{currentInsId:t,ancestorsInsIds:n}=e,{history:a,refreshHistory:u,resetHistory:l}=(0,s.useHistoryHelpers)(t),c=`main-indicator-${t}}`;return(0,o.jsx)("div",{className:"main-instance-events-indicator",children:(0,o.jsx)(r.Tooltip,{content:(0,s.calcHistoryContent)(a),children:(0,o.jsx)("span",{onMouseEnter:u,onMouseOut:l,id:(0,i.getMainInstanceIndicatorDomId)(t,n),className:"status-text","data-tip":"","data-html":!0,"data-for":c})})})}},22714:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7011),t)},63521:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VisualNodeEditor=t.defaultBoardData=t.defaultViewPort=t.NODE_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=n(74762),c=n(86553),d=n(65082),p=n(18420),f=n(26701),m=n(7047),v=n(53865),h=n(70079),g=n(68120),I=r(n(27942)),y=n(50382),b=n(66005),C=n(60190),_=n(71033),x=n(74762),N=n(99942),w=n(44338),j=n(561),P=n(84472),O=n(82232),E=n(18594),D=n(68371),S=r(n(61888)),M=n(65758),T=n(43490),k=r(n(26372)),R=n(25044),A=n(80510),V=n(1788),$=n(2130),z=n(88593),H=n(97106),G=n(67181),L=n(22714),F=n(3354),B=n(41032),q=n(30653),U=u.memo(y.Slider),W=()=>null;t.NODE_HEIGHT=28;t.defaultViewPort={pos:{x:0,y:0},zoom:1},t.defaultBoardData={selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}},t.VisualNodeEditor=u.memo(u.forwardRef(((e,n)=>{const{onChangeNode:o,nodeIoEditable:i,onCopy:s,onGoToNodeDef:r,onInspectPin:J,boardData:Y,onChangeBoardData:K,currentInsId:Q,ancestorsInsIds:X,node:ee,onShowOmnibar:te,resolvedDependencies:ne,queuedInputsData:oe,initialPadding:ie,disableScrolling:se}=e,{onImportNode:re}=(0,H.useDependenciesContext)(),ae=(0,q.useDarkMode)(),{reportEvent:ue}=(0,T.usePorts)(),le=e.parentViewport||t.defaultViewPort,[ce,de]=(0,h.useState)({...ne,[ee.id]:ee});(0,h.useEffect)((()=>{de({...ne,[ee.id]:ee})}),[ne,ee]);const{selected:pe,from:fe,to:me}=Y,{instances:ve,connections:he,inputsPosition:ge,outputsPosition:Ie,inputs:ye,outputs:be}=ee,[Ce,_e]=(0,h.useState)(),[xe,Ne]=(0,h.useState)(),we=void 0===X,[je,Pe]=(0,h.useState)(0),[Oe,Ee]=(0,h.useState)(),[De,Se]=(0,h.useState)(!1),[Me,Te]=(0,h.useState)(),[ke,Re]=(0,h.useState)(),[Ae,Ve]=(0,h.useState)(),[$e,ze]=(0,h.useState)(),He=(0,h.useRef)();(0,f.useDidMount)((()=>{He.current=Xe.current.querySelector(".inline-editor-portal-root")}));const Ge=(0,T.useConfirm)(),Le=(0,T.usePrompt)(),Fe=Y.viewPort,Be=(0,h.useRef)(!0),[qe,Ue]=(0,h.useState)(null),We=u.useCallback((e=>{K({viewPort:e})}),[K]),Ze=u.useCallback(((e,t)=>J(e,t)),[J]),Je=u.useCallback(((e,t,n)=>{const i=(0,A.handleConnectionCloseEditorCommand)(ee,{from:e,to:t}),s=(0,l.isInternalConnectionNode)(t)?ve.find((e=>e.id===t.insId)):null,r=(s?s.inputConfig:{})[t.pinId],a=(0,l.isStaticInputPinConfig)(r)?(0,V.handleDetachConstEditorCommand)(i,t.insId,t.pinId):i;o(a,(0,O.functionalChange)("close-connection")),K({from:void 0,to:void 0}),ue("createConnection",{source:n})}),[ve,o,K,ee,ue]),Ye=u.useCallback((async()=>{const e=await Le("New visual node name?");if(!e)return;const{currentNode:t}=await(0,M.groupSelected)(Y.selected,ee,e,"inline",Le);o(t,(0,O.functionalChange)("group node")),(0,P.toastMsg)("Node grouped"),ue("groupSelected",{count:Y.selected.length})}),[Le,Y.selected,o,ee,ue]);(0,h.useEffect)((()=>{if(Oe){const e=setTimeout((()=>{Ee(void 0)}),350);return()=>clearTimeout(e)}}),[Oe]);const[Ke,Qe]=(0,h.useState)();(0,h.useEffect)((()=>{(0,j.preloadMonaco)()}),[]);const Xe=(0,h.useRef)(),et=(0,I.default)(Xe),tt=u.useRef({x:400,y:400}),nt=(0,f.useBoundingclientrect)(Xe)||C.vZero,ot=()=>{const e=(0,m.fitViewPortToNode)(ee,ce,et);(0,m.animateViewPort)(Fe,e,500,(e=>{We(e)}))},it=u.useCallback(((e,t)=>{const{to:n,from:o}=Y,i="input"===t?o:n,s="input"===t?n:o,r={pinId:e,insId:l.THIS_INS_ID},a="input"===t?{from:r}:{to:r};i&&i.pinId===e?K({from:void 0,to:void 0}):s?"input"===t&&n?Je(r,n,"nodeIoClick"):o&&Je(o,r,"nodeIoClick"):K(a)}),[Y,K,Je]),st=u.useCallback(((e,t,n)=>{const i=(0,v.produce)(ee,(o=>{"input"===e?o.inputs[t].description=n:o.outputs[t].description=n}));o(i,(0,O.functionalChange)("Node io description"))}),[o,ee]),rt=u.useCallback(((e,t,n)=>{const{from:o,to:i}=Y;if(fe&&fe.insId===e.id||me&&me.insId===e.id)K({from:void 0,to:void 0});else if("input"===n){const n={insId:e.id,pinId:t};!i||i.pinId!==t||(0,l.isInternalConnectionNode)(i)&&i.insId!==e.id?fe?Je(fe,n,"pinClick"):K({to:n,selected:[]}):K({to:void 0})}else{const n={insId:e.id,pinId:t};!o||o.pinId!==t||(0,l.isInternalConnectionNode)(o)&&o.insId!==e.id?me?Je(n,me,"pinClick"):K({from:n,selected:[]}):K({from:void 0})}}),[Y,fe,K,Je,me]);(0,h.useEffect)((()=>{if(!De&&et.width){const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);We(t);const n=setTimeout((()=>{const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);e.thumbnailMode||We(t),Se(!0)}),100);return()=>clearTimeout(n)}}),[ee,ie,et,e.thumbnailMode,De,ce,We]);const at=u.useCallback((()=>{const{selected:e}=Y,t=ee.instances.filter((t=>e.includes(t.id))).map((e=>({...e,id:e.id+"-copy"}))),n=ee.connections.filter((t=>{let{from:n,to:o}=t;return e.includes(n.insId)&&e.includes(o.insId)}));s({instances:t,connections:n})}),[Y,s,ee]),ut=u.useCallback((()=>{const{newNode:t,newInstances:n}=(0,R.pasteInstancesCommand)(ee,tt.current,e.clipboardData);o(t,(0,O.functionalChange)("paste instances")),K({selected:n.map((e=>e.id))})}),[o,K,ee,e.clipboardData]),lt=u.useCallback((()=>{const e=ee.id;Ke?"input"===Ke.type?Ke.ins.id===e?it(Ke.pin,"input"):rt(Ke.ins,Ke.pin,"input"):Ke.ins.id===e?it(Ke.pin,"output"):rt(Ke.ins,Ke.pin,"output"):console.warn("tried selecting closest with no pin nearby")}),[ee.id,Ke,it,rt]),ct=u.useCallback(((e,t)=>{const n=Math.min(Math.max(e,.1),3),o="mouse"===t?tt.current:{x:Fe.pos.x+et.width/2,y:Fe.pos.y+et.height/2},i=(0,m.centerBoardPosOnTarget)(o,et,n,Fe);We({...Fe,zoom:n,pos:i})}),[We,Fe,et]);(0,g.useHotkeys)("cmd+=",(e=>{ct(Fe.zoom+.1,"hotkey"),e.preventDefault()}),{text:"Zoom in board",group:"Viewport Controls"},[Fe,ct],Be),(0,g.useHotkeys)("cmd+-",(e=>{ct(Fe.zoom-.1,"hotkey"),e.preventDefault()}),{text:"Zoom out board",group:"Viewport Controls"},[ct,Fe.zoom],Be),(0,g.useHotkeys)("cmd+o",(e=>{e.preventDefault(),(0,P.toastMsg)("Ordering");const t=[];(0,N.orderVisualNode)(ee,ce,200,((e,n)=>{n%3==0&&t.push(e)})),(async()=>{for(;t.length;){const e=t.shift();(0,P.toastMsg)(`Step ${t.length}!`),await(0,l.delay)(200),o(e,(0,O.metaChange)("order-step")),(0,P.toastMsg)(`Step ${t.length}! done`)}})()}),{text:"Auto-layout (experimental)",group:"Misc."},[o,ee,ne],Be),(0,g.useHotkeys)("cmd+0",(e=>{ct(1),e.preventDefault()}),{text:"Reset zoom",group:"Viewport Controls"},[Fe,ct],Be);const dt=()=>{K({from:void 0,to:void 0,selected:[]})},pt=u.useCallback(((e,t)=>{_e(e.id),o({...ee},(0,O.metaChange)("drag-start"))}),[o,ee]),ft=u.useCallback(((e,t,n)=>{const{newValue:i,newSelected:s}=(0,m.handleInstanceDrag)(ee,e,n,t,pe,Ce);o(i,(0,O.metaChange)("drag-move")),s&&K({selected:s})}),[Ce,o,K,pe,ee]),mt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(void 0)}),[]),vt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(l.THIS_INS_ID)}),[]),ht=u.useCallback((async(t,n,o,i)=>{o.preventDefault(),o.stopPropagation();const{x:s,y:r}=i,a=(0,v.produce)(ee,(e=>{"input"===t?e.inputsPosition[n]={x:s,y:r}:e.outputsPosition[n]={x:s,y:r}}));e.onChangeNode(a,(0,O.metaChange)("node-io-drag-move"))}),[e,ee]),gt=u.useCallback((async(e,t,n,o)=>{n.preventDefault(),n.stopPropagation(),_e(void 0)}),[]),It=u.useCallback(((e,t)=>{let{id:n}=e;const o=t.shiftKey?pe.filter((e=>e!==n)):[],i=t.shiftKey?[...pe,n]:[n],s=pe.includes(n)?o:i;K({selected:s,from:void 0,to:void 0})}),[K,pe]),yt=u.useCallback((()=>{const e=ee.instances.map((e=>e.id));K({selected:e,from:void 0,to:void 0})}),[K,ee.instances]),bt=u.useCallback((e=>{const t=he.filter((t=>{let{from:n,to:o}=t;return-1===e.indexOf(n.insId)&&-1===e.indexOf(o.insId)})),n=(0,v.produce)(ee,(n=>{n.connections=t,n.instances=n.instances.filter((t=>!e.includes(t.id)))}));K({selected:[]}),o(n,(0,O.functionalChange)("delete-ins"))}),[he,o,K,ee]),Ct=u.useCallback((e=>{bt([e.id])}),[bt]),_t=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{"input"===e?(delete n.inputs[t],n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===t)))):(n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===t))),n.completionOutputs=(n.completionOutputs||[]).map((e=>e.split("+").filter((e=>e!==t)).join("+"))).filter((e=>!!e)),delete n.outputs[t])}));fe&&fe.insId===l.THIS_INS_ID&&fe.pinId===t?K({from:void 0}):me&&me.insId===l.THIS_INS_ID&&me.pinId===t&&K({to:void 0}),o(n,(0,O.functionalChange)("remove io pin"))}),[ee,fe,me,o,K]),xt=u.useCallback((async()=>{const{selected:e,from:t,to:n}=Y;0===e.length?t&&(0,l.isExternalConnectionNode)(t)?await Ge(`Are you sure you want to remove main input ${t.pinId}?`)&&_t("input",t.pinId):n&&(0,l.isExternalConnectionNode)(n)&&await Ge(`Are you sure you want to remove main output ${n.pinId}?`)&&_t("output",n.pinId):bt(e)}),[Ge,Y,bt,_t]),Nt=u.useCallback(((e,t,n)=>{const i=(0,m.getInstancePinConfig)(ee,e.id,t),s=(0,l.isStickyInputPinConfig)(i)?(0,x.queueInputPinConfig)():(0,l.stickyInputPinConfig)();o((0,m.changePinConfig)(ee,e.id,t,s),(0,O.functionalChange)("toggle-sticky")),ue("togglePinSticky",{isSticky:(0,l.isStickyInputPinConfig)(s)})}),[o,ee,ue]),wt=u.useCallback((()=>{const{newNode:e,newInstances:t}=(0,$.handleDuplicateSelectedEditorCommand)(ee,pe);o(e,(0,O.functionalChange)("duplicated instances")),K({selected:t.map((e=>e.id))})}),[o,K,ee,pe]),jt=u.useCallback((e=>{const t=e.nativeEvent.target;if(0===e.button&&Z(e.nativeEvent,ee.id)&&t&&"board-editor-inner"===t.className){if(Date.now()-je<300)return void te(e);Pe(Date.now());const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,nt),o=(0,m.domToViewPort)(n,Fe,le);Ne({from:o,to:o})}}),[ee.id,Fe,je,nt,le,te]),Pt=u.useCallback((e=>{if(Ue(null),Z(e.nativeEvent,ee.id)&&xe){if((0,m.calcSelectionBoxArea)(xe)>50){const t=(0,m.getInstancesInRect)(xe,ce,Fe,Kt.current,ee.instances,nt,le),n=e.shiftKey?[...pe,...t]:t;K({selected:n})}Ne(void 0)}}),[ee.id,ee.instances,xe,ce,Fe,nt,le,pe,K]),Ot=u.useCallback((e=>{if(!Z(e.nativeEvent,ee.id))return void(Be.current=!1);Be.current=!0;const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,(0,C.vAdd)(nt,C.vZero)),o=(0,m.domToViewPort)(n,Fe,le);xe&&Ne({...xe,to:o});const i=(0,m.findClosestPin)(ee,ce,n,nt,Q,X,Fe),s=Ke;if(i){(!s||s.ins!==i.ins||s.ins===i.ins&&s.pin!==i.pin)&&Qe({ins:i.ins,type:i.type,pin:i.id})}tt.current=o,K({lastMousePos:tt.current})}),[ee,nt,Fe,le,xe,ce,Q,X,Ke,K]),Et=u.useCallback((e=>{var t;"bp5-menu"!==(null===(t=e.relatedTarget)||void 0===t?void 0:t.className)&&(Qe(void 0),Be.current=!1)}),[]),Dt=u.useCallback(((e,t)=>{if(t){const t=(0,l.isInlineNodeInstance)(e)?e.node:(0,B.safelyGetNodeDef)(e.nodeId,ce);if(!t)throw new Error("Impossible state inspecting inexisting node");if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Cannot inspect a non visual node","warning");ze({insId:`${Q}.${e.id}`,node:t})}else if((0,l.isRefNodeInstance)(e)){const t=(0,B.safelyGetNodeDef)(e,ce);r(t)}else{const t=e.node;if(!(0,l.isInlineValueNode)(t))return void((0,l.isVisualNode)(t)?ze({insId:e.id,node:t}):(0,P.toastMsg)("Editing this type of node is not supported"));const n=atob(t.dataBuilderSource);Ve({insId:e.id,templateType:t.templateType,value:n,type:"existing"}),(0,P.toastMsg)("Editing inline visual node not supported yet")}}),[r,ce,Q]),St=u.useCallback((e=>{if((0,l.isInlineNodeInstance)(e)){const t=e.node;if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Not supported","warning");const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.filter((t=>t.id!==e.id)),n.connections=n.connections.filter((t=>{let{from:n,to:o}=t;return n.insId!==e.id&&o.insId!==e.id})),n.instances.push(...t.instances),n.connections.push(...t.connections.filter((e=>(0,l.isInternalConnectionNode)(e.from)&&(0,l.isInternalConnectionNode)(e.to))))}));o(n,{type:"functional",message:"ungroup"}),K({selected:[]})}else{const t=(0,B.safelyGetNodeDef)(e.nodeId,ce);if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Not supported","warning")}}),[ee,o,K,ce]),Mt=u.useCallback((async e=>{}),[]),Tt=u.useCallback(((e,t)=>{const n=(0,V.handleDetachConstEditorCommand)(ee,e.id,t);o(n,(0,O.functionalChange)("detach-const"))}),[o,ee]),kt=u.useCallback(((e,t)=>{const n=e.inputConfig[t]||(0,x.queueInputPinConfig)();(0,l.isStaticInputPinConfig)(n)&&(Re(n.value),P.AppToaster.show({message:"Value copied"}))}),[]),Rt=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{const o=n.instances.find((t=>t.id===e.id));if(!o)throw new Error("Impossible state");o.inputConfig[t]=(0,l.staticInputPinConfig)(ke),n.connections=n.connections.filter((n=>!(0,l.isInternalConnectionNode)(n.to)||!(n.to.insId===e.id&&n.to.pinId===t)))}));o(n,(0,O.functionalChange)("paste const value"))}),[ee,o,ke]),At=u.useCallback((async e=>{const t=await Le("New name?");if(!t)return;const n=(0,v.produce)(ee,(n=>{var o;"input"===e?(ee.inputs||(n.inputs={}),n.inputs[t]=(0,l.nodeInput)(),n.inputsPosition[t]=tt.current):(ee.outputs||(n.outputs={}),n.outputs[t]=(0,l.nodeOutput)(),n.outputsPosition[t]=tt.current,(null===(o=n.completionOutputs)||void 0===o?void 0:o.length)&&(0,P.toastMsg)("Note that this node has explicit completion outputs set. You may need to update them."))}));o(n,(0,O.functionalChange)("add new io pin")),ue("addIoPin",{type:e})}),[Le,ee,o,ue]),Vt=u.useCallback((async()=>{var e;const t=null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","),n=await Le("Edit completion outputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,v.produce)(ee,(e=>{e.completionOutputs=""===n?void 0:n.split(",")}));o(e,(0,O.functionalChange)("change node completions")),ue("editCompletionOutputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),$t=u.useCallback((async()=>{var e;const t=null===(e=ee.reactiveInputs)||void 0===e?void 0:e.join(","),n=await Le("Edit reactive inputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,v.produce)(ee,(e=>{e.reactiveInputs=""===n?void 0:n.split(",")}));o(e,(0,O.functionalChange)("change reactive inputs")),ue("editReactiveInputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),zt=u.useCallback((async()=>{const e=await Le("Description?",ee.description),t=(0,v.produce)(ee,(t=>{t.description=e}));o(t,(0,O.functionalChange)("Edit node description"))}),[Le,o,ee]),Ht=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{t.defaultStyle=e}));o(t,(0,O.functionalChange)("change default style")),ue("changeStyle",{isDefault:!0})}),[o,ee,ue]),Gt=u.useCallback((async(e,t)=>{const n=await Le("New name?",t)||t,i=(0,m.handleIoPinRename)(ee,e,t,n);o(i,(0,O.functionalChange)("rename io pin"))}),[ee,o,Le]),Lt=u.useCallback(((e,t)=>{const n=(0,m.handleChangeNodeInputType)(ee,e,t);o(n,(0,O.functionalChange)("toggle io pin optional"))}),[ee,o]),Ft=u.useCallback((e=>{switch(e.type){case G.ActionType.RemoveNode:{const e=(0,v.produce)(ee,(e=>{if(!(0,l.isVisualNode)(ee))throw new Error("Impossible state, deleting instances opf non visual node");e.instances=e.instances.filter((e=>!pe.includes(e.id))),e.connections=e.connections.filter((e=>!pe.includes(e.from.insId)&&!pe.includes(e.to.insId)))}));K({selected:[]}),o(e,(0,O.functionalChange)("remove-instances")),(0,P.toastMsg)(`Removed ${pe.length} instances(s)`),ue("deleteInstances",{count:pe.length});break}case G.ActionType.Inspect:if(1===pe.length)J(pe[0]);else if(fe||me){const e=null!=fe?fe:me,t=(0,l.isExternalConnectionNode)(e)?l.ROOT_INS_ID:e.insId;J(t,{type:fe?"output":"input",id:e.pinId})}ue("openInspectMenu",{source:"actionMenu"});break;case G.ActionType.Group:(async()=>{await Ye()})();break;case G.ActionType.UnGroup:{const e=ee.instances.find((e=>e.id===pe[0]));St(e);const t=(0,B.safelyGetNodeDef)(e,ce);(0,P.toastMsg)(`Ungrouped inline node ${t.id}`),ue("unGroupNode",{instancesCount:t.instances.length});break}case G.ActionType.AddInlineValue:Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"actionMenu"});break;case G.ActionType.AddNode:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,v.produce)(ee,(e=>{e.instances.push(r)})),u=(0,v.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,O.functionalChange)("add new instance")),K(u),(0,P.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;case G.ActionType.AI:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,v.produce)(ee,(e=>{e.instances.push(r)})),u=(0,v.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,O.functionalChange)("add new instance")),K(u),(0,P.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;default:(0,P.toastMsg)(`${e.type} not supported yet`)}}),[Y,fe,o,K,Ye,re,J,St,ee,ce,ue,pe,me,Fe,et]),Bt=()=>{const t=Y.from;return(0,p.entries)(ye).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"input",pos:ge[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,onDblClick:Zt,closest:!(!Ke||"input"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,inputMode:s.mode,onChangeInputMode:Lt,viewPort:Fe,onDragStart:vt,onDragEnd:gt,onDragMove:ht,onSelect:it,onSetDescription:st,selected:(null==t?void 0:t.pinId)===o,description:s.description,onMouseUp:Nn,onMouseDown:xn},o)}))},qt=()=>{const{to:t}=Y;return(0,p.entries)(be).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"output",pos:Ie[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,closest:!(!Ke||"output"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,viewPort:Fe,onDragStart:vt,onDragEnd:gt,onDragMove:ht,onSelect:it,onSetDescription:st,description:s.description,selected:(null==t?void 0:t.pinId)===o,onMouseUp:Nn,onMouseDown:xn},o)}))},Ut=()=>{if(xe){const{from:e,to:t}=xe,n=(0,m.logicalPosToRenderedPos)(e,Fe),o=(0,m.logicalPosToRenderedPos)(t,Fe),{x:i,y:s,w:r,h:u}=(0,m.getSelectionBoxRect)(n,o);return(0,a.jsx)("div",{className:"selection-box",style:{top:s,left:i,width:r,height:u}})}return null},Wt=u.useCallback((async(e,t,n,o)=>{if("input"===n){const n=e.inputConfig[t],o=(0,l.isStaticInputPinConfig)(n)?JSON.stringify(n.value):void 0;Ve({type:"static-input",insId:e.id,pinId:t,value:null!=o?o:JSON.stringify("Some static value")}),ue("addValueModalOpen",{source:"dblClickPin"})}else{const i=(0,B.safelyGetNodeDef)(e,ce);if(!(0,l.getNodeOutputs)(i)[t])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:o.clientX,y:o.clientY},ins:e,targetNode:i,pinId:t,pinType:n})}}),[ce,ue]),Zt=u.useCallback((async(e,t)=>{if(!ee.inputs[e])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:t.clientX,y:t.clientY},pinId:e,pinType:"input",targetNode:ee})}),[ee]),Jt=u.useCallback((e=>{if(e.metaKey||e.ctrlKey){const t=-.005*e.deltaY;ct(Fe.zoom+t,"mouse"),e.preventDefault(),e.stopPropagation()}else{if(se)return;const t=e.deltaX,n=e.deltaY,o=(0,v.produce)(Fe,(e=>{e.pos.x=e.pos.x+t/e.zoom,e.pos.y=e.pos.y+n/e.zoom}));We(o),e.stopPropagation(),e.preventDefault()}}),[se,ct,We,Fe]);(0,h.useEffect)((()=>{const{current:e}=Xe;if(e)return e.addEventListener("wheel",Jt),()=>{e.removeEventListener("wheel",Jt)}}),[Jt]);const Yt={backgroundPositionX:(0,m.roundNumber)(-Fe.pos.x*Fe.zoom),backgroundPositionY:(0,m.roundNumber)(-Fe.pos.y*Fe.zoom),backgroundSize:(0,m.roundNumber)(10*Fe.zoom)+"px"},Kt=u.useRef(new Map);u.useEffect((()=>{const e=ve.reduce(((e,t)=>{const n=(0,B.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeInputs)(n))),e}),new Map),t=ve.reduce(((e,t)=>{const n=(0,B.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeOutputs)(n))),e}),new Map);e.set(l.THIS_INS_ID,(0,l.keys)(ee.outputs)),t.set(l.THIS_INS_ID,(0,l.keys)(ee.inputs));const n=he.filter((n=>{const o=e.get(n.to.insId)&&e.get(n.to.insId).includes(n.to.pinId),i=t.get(n.from.insId)&&t.get(n.from.insId).includes(n.from.pinId);return!(o&&i)}));if(n.length>0){(0,P.toastMsg)(`${n.length} orphan connections removed`,"warning"),console.warn(`${n.length} orphan connections removed`,n);const e=(0,v.produce)(ee,(e=>{e.connections=ee.connections.filter((e=>!n.includes(e)))}));o(e,(0,O.functionalChange)("prune orphan connections"))}}),[ve,o,he,ee,ce]),u.useEffect((()=>{let e=[];const t=(0,v.produce)(ee,(t=>{t.instances=t.instances.map((t=>{const n=(0,B.safelyGetNodeDef)(t,ce);if(n){const o=(0,l.getNodeInputs)(n),i=(0,l.getNodeOutputs)(n);if(t.visibleInputs){const n=t.visibleInputs.filter((e=>!o[e]));n.length>0&&(t.visibleInputs=(0,l.keys)(o),e.push(...n))}if(t.visibleOutputs){const n=t.visibleOutputs.filter((e=>!i[e]));n.length>0&&(t.visibleOutputs=(0,l.keys)(i),e.push(...n))}}return t}))}));e.length>0&&((0,P.toastMsg)(`Found ${e.length} invalid visible inputs/outputs: ${e.join(", ")}. Reset them`,"warning"),o(t,(0,O.functionalChange)("reset corrupt visible inputs/outputs")))}),[ve,o,ee,ce]),(0,h.useEffect)((()=>{const e=new Map(ve.map((e=>[e.id,e])));Kt.current=he.reduce(((t,n)=>{const o=t.get(n.to.insId)||{},i=o[n.to.pinId]||[],s={...o,[n.to.pinId]:[...i,e.get(n.from.insId)]};return t.set(n.to.insId,s),t}),new Map)}),[he,ve]);const Qt=u.useCallback((()=>{Te(void 0)}),[]),Xt=u.useCallback((async e=>{if(!Me)throw new Error("impossible state - quick add menu invoked but not available");const{ins:t,pinId:n}=Me;switch(e.type){case"import":case"node":{const i="import"===e.type?await re(e.importableNode):ce,s="import"===e.type?e.importableNode.node:e.node,r=(0,m.createNewNodeInstance)(s.id,100,tt.current,i);if(r){const e=(0,v.produce)(ee,(e=>{e.instances.push(r),e.connections.push({from:{insId:t?t.id:l.THIS_INS_ID,pinId:n},to:{insId:r.id,pinId:l.TRIGGER_PIN_ID}})}));o(e,(0,O.functionalChange)("add-item-quick-menu")),Qt()}ue("addNode",{nodeId:s.id,source:"quickAdd"});break}case"value":if(!t)return void(0,P.toastMsg)("Cannot add value to main input");Ve({type:"new-output",insId:t.id,pinId:n}),ue("addValueModalOpen",{source:"quickAdd"})}}),[Me,ce,ue,ee,o,Qt,re]),en=u.useCallback((async()=>{const e=JSON.stringify(ee);await navigator.clipboard.writeText(e),P.AppToaster.show({message:"Copied!"})}),[ee]),tn=u.useCallback((()=>{var e,t;const n=i?"":" (cannot edit main node, only visual)";return(0,a.jsxs)(y.Menu,{children:[(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"New Value",onClick:(0,p.preventDefaultAnd)((()=>{Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"contextMenu"})}))}),(0,a.jsx)(y.MenuItem,{text:`New input ${n}`,onMouseDown:e=>e.stopPropagation(),onClick:(0,p.preventDefaultAnd)((()=>At("input"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`New output ${n}`,onClick:(0,p.preventDefaultAnd)((()=>At("output"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Copy node to clipboard",onClick:(0,p.preventDefaultAnd)(en)}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Completion Outputs (${(null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Vt()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Reactive inputs (${(null===(t=ee.reactiveInputs)||void 0===t?void 0:t.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>$t()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Edit description",onClick:(0,p.preventDefaultAnd)((()=>zt()))}),(0,a.jsx)(y.MenuDivider,{}),(0,a.jsx)(y.MenuItem,{text:"Default Style",children:(0,a.jsx)(z.NodeStyleMenu,{style:ee.defaultStyle,onChange:Ht,promptFn:Le})})]})}),[i,en,ee.completionOutputs,ee.reactiveInputs,ee.defaultStyle,Ht,Le,ue,At,Vt,$t,zt]);(0,g.useHotkeys)("shift+c",ot,{text:"Center viewport",group:"Viewport Controls"},[],Be),(0,g.useHotkeys)("cmd+c",at,{text:"Copy instances",group:"Editing"},[],Be),(0,g.useHotkeys)("cmd+v",ut,{text:"Paste instances",group:"Editing"},[],Be),(0,g.useHotkeys)("esc",dt,{text:"Clear selections",group:"Selection"},[],Be),(0,g.useHotkeys)("backspace",xt,{text:"Delete instances",group:"Editing"},[],Be),(0,g.useHotkeys)("shift+d",wt,{text:"Duplicate selected instances",group:"Editing"},[],Be),(0,g.useHotkeys)("cmd+a",yt,{text:"Select all",group:"Selection"},[],Be),(0,g.useHotkeys)("s",lt,{text:"Select pin closest to mouse",group:"Selection"},[],Be);const nn=u.useCallback(((e,t)=>{if(!$e)throw new Error("impossible state");const n=(0,v.produce)(ee,(t=>{const n=t.instances.find((e=>e.id===$e.insId));if(!n||!(0,l.isInlineNodeInstance)(n))throw new Error("impossible state");n.node=e}));o(n,(0,O.functionalChange)("Inner change: "+t.message)),ze((t=>({...t,node:e})))}),[o,$e,ee]),[on,sn]=(0,h.useState)({selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}}),rn=u.useCallback((e=>sn((t=>({...t,...e})))),[]),an=n=>$e&&$e.insId===n.id?{currentInsId:$e.insId,ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),boardData:on,onChangeBoardData:rn,resolvedDependencies:ne,onCopy:s,clipboardData:e.clipboardData,onInspectPin:e.onInspectPin,onGoToNodeDef:e.onGoToNodeDef,nodeIoEditable:e.nodeIoEditable,node:$e.node,onChangeNode:nn,onShowOmnibar:te,parentViewport:t.defaultViewPort,parentBoardPos:nt,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:e.queuedInputsData}:void 0,un=()=>{if(fe&&("input"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"output"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(e)&&!(0,l.isInternalConnectionNode)(fe))return;return{from:fe,to:e}}if(me&&("output"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"input"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(me)&&!(0,l.isInternalConnectionNode)(e))return;return{from:e,to:me}}},ln=()=>{const e=un();if(e){const{from:t,to:n}=e;return{connection:{from:t,to:n},type:he.some((t=>(0,l.connectionDataEquals)(t,e)))?"future-remove":"future-add"}}},cn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleInputs:t}:n))}));o(n,(0,O.functionalChange)("change instance visible inputs"))}),[ee,o]),dn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,style:t}:n))}));o(n,(0,O.functionalChange)("change instance style")),ue("changeStyle",{isDefault:!1})}),[o,ee,ue]),pn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleOutputs:t}:n))}));o(n,(0,O.functionalChange)("change instance visible outputs"))}),[ee,o]),fn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,displayName:t}:n))}));o(n,(0,O.functionalChange)("change instance display name"))}),[ee,o]);u.useImperativeHandle(n,(()=>({centerInstance(e){const t=ee.instances.find((t=>t.id===e));if(t){const e=(0,C.vSub)(t.pos,(0,C.vec)(et.width/2,et.height/2));We({...Fe,pos:e})}},centerViewPort(){ot()},getViewPort:()=>Fe,clearSelection:()=>{dt()},requestNewInlineValue:()=>{Ve({type:"new-floating",pos:tt.current})}})));const[mn,vn]=u.useState([]),hn=u.useCallback(((e,t)=>{const n=t.trim().substr(0,100),i=`Inline-value-${n.substr(0,15).replace(/["'`]/g,"")}`,s=(0,D.createInlineValueNode)({code:t,customView:n,nodeId:i,type:e});switch(Ae.type){case"existing":{const[e]=ee.instances.filter((e=>e.id===Ae.insId)).filter((e=>(0,l.isInlineNodeInstance)(e))).map((e=>e.node));if(!e)throw new Error("Unable to find inline node to save to");const t=(0,l.keys)(e.inputs),n=(0,l.keys)(s.inputs),i=new Set(S.default.difference(t,n)),r=(0,v.produce)(ee,(e=>{e.instances=e.instances.map((e=>e.id===Ae.insId?(0,l.inlineNodeInstance)(e.id,s,e.inputConfig,e.pos):e)),e.connections=e.connections.filter((e=>!(e.to.insId===Ae.insId&&i.has(e.to.pinId))))}));o(r,(0,O.functionalChange)("change inline value")),Ve(void 0);break}case"static-input":{let e;try{const n=t.replace(/^['`]/,'"').replace(/['`]$/,'"');e=JSON.parse(n)}catch(r){return void(0,P.toastMsg)("Input values must not be formulas or code")}const n=(0,v.produce)(ee,(t=>{t.instances.find((e=>e.id===Ae.insId)).inputConfig[Ae.pinId]=(0,l.staticInputPinConfig)(e)}));o(n,(0,O.functionalChange)("set static input value")),Ve(void 0);break}case"new-floating":{const e=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},Ae.pos),t=(0,v.produce)(ee,(t=>{t.instances.push(e)}));o(t,(0,O.functionalChange)("new floating value")),Ve(void 0);break}case"new-output":{const{insId:e,pinId:t}=Ae,n=ee.instances.find((t=>t.id===e));if(!n)throw new Error("Impossible state");const i=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},(0,C.vAdd)(n.pos,{x:-50,y:150})),r=(0,v.produce)(ee,(n=>{n.instances.push(i),n.connections.push({from:(0,l.connectionNode)(e,t),to:(0,l.connectionNode)(i.id,l.TRIGGER_PIN_ID)})}));o(r,(0,O.functionalChange)("new value connected to output")),Ve(void 0)}}ue("addValue",{type:e,placeholdersCount:(0,l.keys)(s.inputs).length})}),[Ae,o,ee,ue]),gn=he.filter((e=>{const t=un();return!t||!(0,l.connectionDataEquals)(t,e)})),In=u.useCallback((()=>{ze(void 0),sn(t.defaultBoardData)}),[]),yn=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{const n=t.connections.find((t=>(0,l.connectionDataEquals)(t,e)));n.hidden=!n.hidden}));o(t,(0,O.functionalChange)("toggle connection hidden"))}),[o,ee]),bn=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{t.connections=t.connections.filter((t=>!(0,l.connectionDataEquals)(t,e)))}));o(t,(0,O.functionalChange)("remove connection"))}),[o,ee]),Cn=u.useCallback(((e,t,n)=>{Ue("input"===n?{to:(0,l.connectionNode)(e.id,t),from:void 0}:{from:(0,l.connectionNode)(e.id,t),to:void 0})}),[]),_n=u.useCallback(((e,t,n)=>{qe&&(qe.from&&"input"===n?Je(qe.from,(0,l.connectionNode)(e.id,t),"pinDrag"):qe.to&&"output"===n&&Je((0,l.connectionNode)(e.id,t),qe.to,"pinDrag")),Ue(null)}),[qe,Je]),xn=u.useCallback(((e,t)=>{}),[]),Nn=u.useCallback(((e,t)=>{qe&&(qe.from&&"output"===t?Je(qe.from,(0,l.externalConnectionNode)(e),"nodeIoPinDrag"):qe.to&&"input"===t&&Je((0,l.externalConnectionNode)(e),qe.to,"nodeIoPinDrag"))}),[qe,Je]);try{return(0,a.jsxs)(y.ContextMenu,{className:(0,k.default)("visual-node-editor",e.className,{dark:ae}),"data-id":ee.id,content:tn(),disabled:!Be.current,children:[(0,a.jsxs)("main",{className:"board-editor-inner",onMouseDown:jt,onMouseUp:Pt,onMouseMove:Ot,onMouseLeave:Et,ref:Xe,style:Yt,children:[(0,a.jsx)(u.Fragment,{children:(0,a.jsx)(w.LayoutDebugger,{vp:Fe,node:ee,extraDebug:m.emptyList,mousePos:tt.current})}),(0,a.jsx)(d.ConnectionView,{resolvedNodes:ce,currentInsId:Q,ancestorsInsIds:X,size:et,node:ee,boardPos:nt,instances:ve,connections:gn,futureConnection:ln(),onDblClick:l.noop,viewPort:Fe,parentVp:le,selectedInstances:pe,toggleHidden:yn,removeConnection:bn,lastMousePos:tt.current,draggedSource:qe}),Bt(),ve.map((t=>{var n,o,i,s,r;return(0,a.jsx)(c.InstanceView,{onUngroup:St,onExtractInlineNode:Mt,onDetachConstValue:Tt,onCopyConstValue:kt,onPasteConstValue:Rt,copiedConstValue:ke,connectionsPerInput:Kt.current.get(t.id)||m.emptyObj,node:(0,B.safelyGetNodeDef)(t,ce),ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),onPinClick:rt,onPinDblClick:Wt,onDragStart:pt,onDragEnd:mt,resolvedDeps:ce,onDragMove:ft,onDblClick:Dt,onSelect:It,onToggleSticky:Nt,selected:-1!==pe.indexOf(t.id),dragged:Ce===t.id,onInspectPin:Ze,selectedInput:me&&(0,l.isInternalConnectionNode)(me)&&me.insId===t.id?me.pinId:void 0,selectedOutput:fe&&(0,l.isInternalConnectionNode)(fe)&&fe.insId===t.id?fe.pinId:void 0,closestPin:Ke&&Ke.ins.id===t.id?Ke:void 0,queuedInputsData:null!==(n=oe[t.id])&&void 0!==n?n:m.emptyObj,instance:t,connections:he,onTogglePinBreakpoint:l.noop,onTogglePinLog:l.noop,viewPort:Fe,onChangeVisibleInputs:cn,onChangeVisibleOutputs:pn,onSetDisplayName:fn,onDeleteInstance:Ct,forceShowMinimized:fe||(null===(o=null==qe?void 0:qe.to)||void 0===o?void 0:o.insId)===t.id?"input":me||(null===(i=null==qe?void 0:qe.from)||void 0===i?void 0:i.insId)===t.id?"output":void 0,isConnectedInstanceSelected:pe.some((e=>he.some((n=>{let{from:o,to:i}=n;return o.insId===t.id&&i.insId===e||o.insId===e&&i.insId===t.id})))),inlineGroupProps:an(t),onCloseInlineEditor:In,inlineEditorPortalDomNode:He.current,onChangeStyle:dn,onGroupSelected:Ye,onPinMouseDown:Cn,onPinMouseUp:_n,hadError:null!==(r=null===(s=e.instancesWithErrors)||void 0===s?void 0:s.has((0,l.fullInsIdPath)(t.id)))&&void 0!==r&&r},t.id)})),Ut(),qt(),(0,a.jsx)(L.MainInstanceEventsIndicator,{currentInsId:Q,ancestorsInsIds:X,viewPort:Fe}),Me?(0,a.jsx)(_.QuickAddMenu,{targetNode:Me.targetNode,pinId:Me.pinId,pinType:Me.pinType,pos:Me.pos,resolvedDependencies:ne,node:ee,onAdd:Xt,onClose:Qt}):null,(0,a.jsxs)("div",{className:"viewport-controls-and-help",children:[(0,a.jsx)(y.Button,{small:!0,onClick:ot,minimal:!0,intent:"primary",children:"Center"}),(0,a.jsx)(U,{min:.15,max:3,stepSize:.05,labelStepSize:10,labelRenderer:W,onChange:ct,value:Fe.zoom}),we?(0,a.jsx)(F.HelpBubble,{}):null]}),Ae?(0,a.jsx)(E.InlineCodeModal,{env:m.emptyObj,initialValue:Ae.value,initialType:"existing"===Ae.type?Ae.templateType:void 0,onCancel:()=>Ve(void 0),onSubmit:hn}):null,(0,a.jsx)("div",{className:"inline-editor-portal-root"})]}),(0,a.jsx)(G.ActionsMenu,{showRunFlowOptions:we,onAction:Ft,selectedInstances:pe,node:ee,resolvedNodes:ce,to:me,from:fe,hotkeysEnabled:Be})]})}catch(wn){return console.error(wn),(0,a.jsxs)("div",{children:["Error rendering board - ",wn.toString()]})}})));const Z=(e,t)=>{const n=e.target.closest(".visual-node-editor");return n&&n.getAttribute("data-id")===t}},83234:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeView=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=r(n(59349)),d=n(30653);t.BaseNodeView=function(e){const{dragged:t,viewPort:n,pos:o,onDragEnd:i,onDragMove:s,onDragStart:r,displayMode:p}=e,f=(0,d.useDarkMode)(),m=u.useCallback(((e,t)=>{r(e,t)}),[r]),v=u.useCallback(((e,t)=>{const s=o,r=(t.x-s.x)/n.zoom,a=(t.y-s.y)/n.zoom,u=s.x+r,l=s.y+a;i(e,{...t,x:u,y:l})}),[o,i,n]),h=u.useCallback(((e,t)=>{s(e,{x:t.x,y:t.y})}),[s]),g={transform:`scale(${n.zoom})`},I=(0,l.default)("base-node-view",e.className,{dragged:t,dark:f,"display-mode":p}),y=o.x*n.zoom-n.pos.x*n.zoom,b=o.y*n.zoom-n.pos.y*n.zoom,C={transform:`translate(${y-o.x}px, ${b-o.y}px)`},_=(0,l.default)("base-node-view-vp-fixer",{"display-mode":p}),x=(0,a.jsx)("span",{className:"base-node-view-wrapper",children:(0,a.jsx)("div",{className:I,style:g,id:e.domId,children:e.children})});return(0,a.jsx)("div",{className:_,style:C,children:(0,a.jsx)(c.default,{onStop:v,onStart:m,onDrag:h,position:o,cancel:".no-drag",children:x})})}},80510:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleConnectionCloseEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleConnectionCloseEditorCommand=(e,t)=>{let{from:n,to:o}=t;return(0,s.default)(e,(e=>{const t=e.connections.find((e=>{const t=(0,i.connectionNodeEquals)(n,e.from),s=(0,i.connectionNodeEquals)(o,e.to);return t&&s}));t?e.connections=e.connections.filter((e=>e!==t)):e.connections.push({from:n,to:o})}))}},1788:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDetachConstEditorCommand=void 0;const i=n(74762),s=o(n(53865)),r=n(68371);t.handleDetachConstEditorCommand=(e,t,n)=>(0,s.default)(e,(e=>{const{instances:o}=e,s=o.find((e=>e.id===t));if(!s)throw new Error("Impossible state ins id with no matching instance");const a=s.inputConfig[n];if(!a)throw new Error("impossible state detaching const from unexistent config");if(!(0,i.isStaticInputPinConfig)(a))throw new Error("impossible state detaching const with no value");const u=JSON.stringify(a.value),l=(0,r.createInlineValueNode)({code:`${u}`,type:i.InlineValueNodeType.VALUE}),c=(0,i.inlineNodeInstance)(`value-${(0,i.randomInt)(999)}`,l,{},{x:s.pos.x,y:s.pos.y-100});if(!e.instances.find((e=>e.id===s.id)))throw new Error("impossible state instance not found");s.inputConfig[n]=(0,i.queueInputPinConfig)(),e.instances.push(c),e.connections.push((0,i.connectionData)(`${c.id}.value`,`${s.id}.${n}`))}))},2130:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDuplicateSelectedEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleDuplicateSelectedEditorCommand=(e,t)=>{const n=[];return{newNode:(0,s.default)(e,(o=>{const s=o.instances;t.forEach((t=>{const o=s.find((e=>e.id===t));if(!o)throw new Error("impossible state duplicate selected no matching instance");if(o){const{pos:t}=o,r={...o,pos:{x:t.x+20,y:t.y+20},id:(0,i.createInsId)(e)};s.push(r),n.push(r.id)}}))})),newInstances:n}}},25044:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.pasteInstancesCommand=void 0;const i=n(74762),s=o(n(53865));t.pasteInstancesCommand=(e,t,n)=>{const o=n.instances.map((n=>({...n,pos:t,id:(0,i.createInsId)(e)}))),r=new Map(o.map(((e,t)=>[n.instances[t].id,e.id])));return{newNode:(0,s.default)(e,(e=>{e.instances.push(...o);const t=n.connections.map((e=>{let{from:t,to:n}=e;return{from:{...t,insId:r.get(t.insId)||t.insId},to:{...n,insId:r.get(n.insId)||n.insId}}}));e.connections.push(...t)})),newInstances:o}}},65082:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionView=t.SingleConnectionView=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=r(n(26372)),d=n(74762),p=n(18243),f=n(77852),m=n(74089),v=n(60190),h=n(50382),g=n(76064),I=n(41032);t.SingleConnectionView=e=>{const{isBrowser:t}=(0,f.useSsr)(),{connection:n,node:o,resolvedNodes:i,instances:s,type:r,viewPort:a,toggleHidden:l,parentSelected:m,removeConnection:y}=e,{from:b}=n,C=(0,d.isInternalConnectionNode)(b)&&s.find((e=>e.id===b.insId));if(!C&&(0,d.isInternalConnectionNode)(b))throw new Error(`impossible state - "from instance id - [${b.insId}] does not exist"`);const _=((0,d.isInternalConnectionNode)(b)&&C?(0,I.safelyGetNodeDef)(C,i):o).outputs[b.pinId],x=_&&_.delayed,N=t?(0,p.calcStartPos)({...e,connectionNode:b}):{x:0,y:0},w=t?(0,p.calcTargetPos)({...e,connectionNode:n.to}):{x:0,y:0},{x:j,y:P}=(0,v.vDiv)(N,e.parentVp.zoom),{x:O,y:E}=(0,v.vDiv)(w,e.parentVp.zoom),D=(0,c.default)({delayed:x,hidden:n.hidden,"parent-selected":m},r),S=(0,u.jsxs)(h.Menu,{children:[(0,u.jsx)(h.MenuItem,{text:n.hidden?"Show connection":"Hide connection",onClick:()=>l(n)}),(0,u.jsx)(h.MenuItem,{text:"Remove connection",onClick:()=>y(n)})]});return(0,u.jsx)(h.ContextMenu,{content:S,children:e=>(0,u.jsx)(g.ConnectionViewPath,{className:D,from:{x:j,y:P},to:{x:O,y:E},dashed:"regular"!==r,zoom:a.zoom,onContextMenu:e.onContextMenu})})};t.ConnectionView=e=>{var n;const{viewPort:o,futureConnection:i,toggleHidden:s,selectedInstances:r,draggedSource:c}=e,[d,f]=l.useState(0),v=l.useCallback((e=>requestAnimationFrame((()=>{f((e=>(e+1)%9)),e>0&&v(e-1)}))),[]);l.useEffect((()=>{const e=v(10);return()=>{cancelAnimationFrame(e)}}),[v]),l.useEffect((()=>{const e=()=>{v(3)};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[v,d]);const h=e.connections.map((n=>{const o=r.includes(n.from.insId)||r.includes(n.to.insId);return(0,a.createElement)(t.SingleConnectionView,{...e,connection:n,type:"regular",parentSelected:o,key:n.from.insId+n.from.pinId+n.to.insId+n.to.pinId})}));if(i&&h.push((0,a.createElement)(t.SingleConnectionView,{...e,connection:i.connection,type:i.type,toggleHidden:s,parentSelected:!1,key:"future"})),c){const t=(c.from?p.calcStartPos:p.calcTargetPos)({connectionNode:null!==(n=c.from)&&void 0!==n?n:c.to,viewPort:o,boardPos:e.boardPos,ancestorsInsIds:e.ancestorsInsIds,currentInsId:e.currentInsId});h.push((0,u.jsx)(g.ConnectionViewPath,{className:"dragged",from:t,to:(0,m.logicalPosToRenderedPos)(e.lastMousePos,o),zoom:o.zoom},"dragged"))}return(0,u.jsx)("span",{className:"connections-view",style:{opacity:o.zoom},children:(0,u.jsx)("svg",{style:{width:"100%"},children:h})})}},76064:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionViewPath=void 0;const i=n(35250),s=o(n(26372)),r=n(70079),a=n(23381);t.ConnectionViewPath=(0,r.forwardRef)(((e,t)=>{const{from:n,to:o,className:r,onContextMenu:u,zoom:l,dashed:c}=e,{x:d,y:p}=n,{x:f,y:m}=o,v=(0,a.calcBezierPath)({sourceX:d,sourceY:p,targetX:f,targetY:m,curvature:.15}),h=2.5*l,g=c?6*l:void 0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:v,ref:t,className:(0,s.default)("connection",r),style:{strokeWidth:h,strokeDasharray:g},onContextMenu:u}),e.label?(0,i.jsx)("text",{className:"label",x:(d+f)/2,y:(p+m)/2,fontSize:"12px"}):null,(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%"}),(0,i.jsx)("stop",{offset:"100%"})]})]})}))},23381:(e,t)=>{"use strict";var n;function o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i(e){let t,i,{pos:s,x1:r,y1:a,x2:u,y2:l,c:c}=e;switch(s){case n.Left:t=r-o(r-u,c),i=a;break;case n.Right:t=r+o(u-r,c),i=a;break;case n.Top:t=r,i=a-o(a-l,c);break;case n.Bottom:t=r,i=a+o(l-a,c)}return[t,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.getBezierCenter=t.calcBezierPath=t.Position=void 0,function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(n=t.Position||(t.Position={}));t.calcBezierPath=e=>{let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l});return`M${t},${o} C${c},${d} ${p},${f} ${r},${a}`},t.getBezierCenter=function(e){let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l}),m=.125*t+.375*c+.375*p+.125*r,v=.125*o+.375*d+.375*f+.125*a;return[m,v,Math.abs(m-t),Math.abs(v-o)]}},18243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcTargetPos=t.calcStartPos=t.calcPinPosition=void 0;const o=n(74762),i=n(30994),s={x:99999,y:99999};function r(e){const t=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds),pinId:e.pinId,pinType:e.pinType,isMain:e.isMain});return((e,t,n,o)=>{if(!e)return console.warn(`Cannot find element ${n} to calculate position.`),s;const{x:i,y:r,width:a,height:u}=e.getBoundingClientRect(),l=r+u/2;return{x:i+a/2-t.x,y:l-t.y}})(document.getElementById(t),e.boardPos,t,e.viewPort)}t.calcPinPosition=r;t.calcStartPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"input",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"output",boardPos:n,viewPort:s})};t.calcTargetPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"output",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"input",boardPos:n,viewPort:s})}},30994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPinDomId=t.getMainInstanceIndicatorDomId=t.getInstanceDomId=void 0;const o=n(74762);t.getInstanceDomId=(e,t)=>`ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getMainInstanceIndicatorDomId=(e,t)=>`main-ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getPinDomId=e=>{let{pinType:t,fullInsIdPath:n,pinId:o,isMain:i}=e;return`${i?"main-":""}pin:${t}:${n}:${o}`.replace(/\s+/g,"-")}},86553:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceView=t.getVisibleOutputs=t.getVisibleInputs=t.INSTANCE_INFO_TOOLTIP_DELAY=t.MAX_INSTANCE_WIDTH=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=n(66074),d=n(74762),p=r(n(26372)),f=n(2036),m=n(74762),v=n(74762),h=n(53159),g=n(83234),I=n(74762),y=n(30994),b=n(63521),C=n(74089),_=n(50382),x=r(n(99581)),N=n(88593),w=n(30653);t.PIECE_HORIZONTAL_PADDING=25,t.PIECE_CHAR_WIDTH=11,t.MIN_WIDTH_PER_PIN=40,t.MAX_INSTANCE_WIDTH=400,t.INSTANCE_INFO_TOOLTIP_DELAY=400;t.getVisibleInputs=(e,t,n)=>{const{visibleInputs:o}=e;if(o)return o;const i=(0,d.keys)((0,v.getNodeInputs)(t)).filter(((o,i)=>{var s;const r=n.some((t=>t.to.insId===e.id&&t.to.pinId===o)),a=t.inputs[o]&&"optional"===(null===(s=t.inputs[o])||void 0===s?void 0:s.mode);return r||!a&&o!==m.TRIGGER_PIN_ID}));return 0===i.length?[m.TRIGGER_PIN_ID]:i};t.getVisibleOutputs=(e,t,n)=>{const{visibleOutputs:o}=e;if(o)return o;const i=Object.keys(t.outputs);return n.some((t=>t.from.insId===e.id&&t.from.pinId===m.ERROR_PIN_ID))?[...i,m.ERROR_PIN_ID]:i};t.InstanceView=function(e){const{selected:n,selectedInput:o,selectedOutput:i,closestPin:s,dragged:r,onTogglePinLog:j,onTogglePinBreakpoint:P,onDetachConstValue:O,onCopyConstValue:E,onPasteConstValue:D,displayMode:S,connections:M,instance:T,viewPort:k,node:R,onPinClick:A,onPinDblClick:V,onDragStart:$,onDragEnd:z,onDragMove:H,onToggleSticky:G,onSelect:L,onDblClick:F,onChangeVisibleInputs:B,onChangeVisibleOutputs:q,onConvertConstToEnv:U,inlineGroupProps:W,onUngroup:Z,onExtractInlineNode:J,onGroupSelected:Y,isConnectedInstanceSelected:K,inlineEditorPortalDomNode:Q,onChangeStyle:X,onDeleteInstance:ee,onSetDisplayName:te,onPinMouseUp:ne,onPinMouseDown:oe}=e,ie=(0,w.useDarkMode)(),{id:se}=T,re=l.useMemo((()=>{const e=(0,d.randomInt)(6,1);return{icon:(0,d.pickRandom)([["fab","discord"],["fab","slack"],"bug","cube"]),color:e,size:(0,d.randomInt)(3,1),variation:(0,d.randomInt)(5,1)}}),[]),ae=l.useRef(),ue=l.useMemo((()=>T.style||R.defaultStyle||{}),[R,T]),le=ue.size||"regular",ce=l.useMemo((()=>new Map(M.filter((e=>{let{to:t}=e;return t.insId===se})).map((e=>{let{to:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),de=l.useMemo((()=>new Map(M.filter((e=>{let{from:t}=e;return t.insId===se})).map((e=>{let{from:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),pe=(0,C.usePrompt)(),fe=l.useCallback((e=>A(T,e,"input")),[T,A]),me=l.useCallback(((e,t)=>V(T,e,"input",t)),[T,V]),ve=l.useCallback(((e,t)=>V(T,e,"output",t)),[T,V]),he=l.useCallback((e=>A(T,e,"output")),[T,A]),ge=l.useCallback(((e,t)=>{$(T,e,t)}),[T,$]),Ie=l.useCallback(((e,t)=>{const n=T.pos,o=(t.x-n.x)/k.zoom,i=(t.y-n.y)/k.zoom,s=n.x+o,r=n.y+i;z(T,e,{...t,x:s,y:r})}),[T,z,k.zoom]),ye=l.useCallback(((e,t)=>{H(T,e,{x:t.x,y:t.y})}),[T,H]),be=l.useCallback((e=>G(T,e)),[T,G]),Ce=l.useCallback((e=>O(T,e)),[T,O]),_e=l.useCallback((e=>E(T,e)),[T,E]),xe=l.useCallback((e=>D(T,e)),[T,D]),Ne=l.useCallback((e=>L(T,e)),[T,L]),we=l.useCallback((e=>F(T,e.shiftKey)),[T,F]),je=(0,d.entries)(R.inputs),{visibleInputs:Pe,visibleOutputs:Oe}=T;Pe&&je.sort(((e,t)=>Pe.indexOf(e[0])-Pe.indexOf(t[0])));const Ee=(0,d.entries)(R.outputs);Oe&&Ee.sort(((e,t)=>Oe.indexOf(e[0])-Oe.indexOf(t[0])));const De=(0,t.getVisibleInputs)(T,R,M),Se=(0,t.getVisibleOutputs)(T,R,M);je.push([m.TRIGGER_PIN_ID,{...(0,d.nodeInput)(),description:"Use this pin to manually trigger the node. If not connected, the node will be triggered automatically when all required inputs have data."}]),Ee.push([m.ERROR_PIN_ID,{...(0,m.nodeOutput)(),description:"Use this pin to catch errors that happen inside this node. If not connected, errors will bubble up to the parent node."}]);const Me=je.filter((e=>{let[t]=e;return De.includes(t)||(n||K)&&ce.has(t)})),Te=Ee.filter((t=>{let[o]=t;return Se.includes(o)||(n||K)&&de.has(o)||o===m.ERROR_PIN_ID&&e.hadError})),ke=M.some((e=>e.from.insId===se&&e.from.pinId===m.ERROR_PIN_ID)),Re=(0,p.default)("ins-view",{"no-inputs":0===je.length,"no-outputs":0===Ee.length,"display-mode":S,"force-minimized-input":"input"===e.forceShowMinimized||"both"===e.forceShowMinimized,"force-minimized-output":"output"===e.forceShowMinimized||"both"===e.forceShowMinimized,"inline-node-edited":!!W,"error-caught":ke}),Ae=(0,p.default)({selected:n,dragged:r,closest:s&&s.ins.id===T.id},`size-${le}`),Ve=new Set((0,d.entries)(R.inputs).filter((e=>{let[t,n]=e;return(0,m.isInputPinOptional)(n)})).map(d.pickFirst)),$e=(0,d.entries)(T.inputConfig).reduce(((e,t)=>{let[n,o]=t;return(0,m.isStickyInputPinConfig)(o)||o.sticky?{...e,[n]:!0}:e}),{}),ze=(0,h.calcNodeContent)(T,R),He=e=>{const t=T.inputConfig[e];if((0,I.isStaticInputPinConfig)(t))return t.value},Ge=l.useCallback((async()=>{const e=(0,d.okeys)(R.inputs),t=await pe("New order?",(T.visibleInputs||e).join(","));t&&B(T,t.split(","))}),[R.inputs,pe,T,B]),Le=l.useCallback((async()=>{const e=(0,d.okeys)(R.outputs),t=await pe("New order?",(T.visibleOutputs||e).join(","));t&&q(T,t.split(","))}),[R.outputs,pe,T,q]),Fe=l.useCallback((()=>{ee(T)}),[ee,T]),Be=l.useCallback((async()=>{const e=await pe("Set custom display name",T.displayName||R.id);te(T,e)}),[pe,T,te,R.id]),qe=Object.keys((0,v.getNodeInputs)(R)),Ue=Object.keys((0,d.getNodeOutputs)(R)),We=l.useCallback((e=>{U&&U(T,e)}),[T,U]),Ze=l.useCallback(((e,t)=>{ne&&ne(T,e,t)}),[T,ne]),Je=l.useCallback(((e,t)=>{oe&&oe(T,e,t)}),[T,oe]),Ye=()=>(0,u.jsx)("div",{className:"inputs no-drag",children:Me.map((t=>{let[i,r]=t;var a;return(0,u.jsx)(f.PinView,{type:"input",currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,id:i,optional:Ve.has(i),connected:ce.has(i),isSticky:$e[i],minimized:!n&&1===Me.length,onToggleSticky:be,onDetachConstValue:Ce,onCopyConstValue:_e,onPasteConstValue:xe,copiedConstValue:e.copiedConstValue,selected:i===o,onClick:fe,onDoubleClick:me,isClosestToMouse:!!s&&"input"===s.type&&s.pin===i,onToggleLogged:j,onToggleBreakpoint:P,onInspect:e.onInspectPin,constValue:He(i),onConvertConstToEnv:e.onConvertConstToEnv?We:void 0,description:r.description,queuedValues:null!==(a=e.queuedInputsData[i])&&void 0!==a?a:0,onMouseUp:Ze,onMouseDown:Je},i)}))}),Ke=()=>(0,u.jsx)("div",{className:"outputs no-drag",children:Te.map((t=>{let[o,r]=t;return(0,u.jsx)(f.PinView,{currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,connected:de.has(o),type:"output",id:o,minimized:!n&&1===Te.length,isClosestToMouse:!!s&&"output"===s.type&&s.pin===o,selected:o===i,onClick:he,onDoubleClick:ve,onToggleLogged:j,onToggleBreakpoint:P,onInspect:e.onInspectPin,description:r.description,onMouseUp:Ze,onMouseDown:Je},o)}))}),Qe=l.useCallback((e=>{X(T,e)}),[T,X]),Xe=l.useCallback((()=>{const e=[...qe.map((e=>{const t=De.includes(e),n=ce.has(e)&&!0!==ce.get(e),o=(0,d.getInputName)(e);return{text:t?n?`Hide input "${o}" (disconnect first)`:`Hide input "${o}"`:`Show input "${o}"`,onClick:()=>B(T,t?De.filter((t=>t!==e)):[...De,e]),disabled:n&&t}})),...Ue.map((e=>{const t=Se.includes(e),n=de.has(e),o=(0,d.getOutputName)(e);return{text:t?n?`Hide output "${o}" (disconnect first)`:`Hide output "${o}"`:`Show output "${o}"`,onClick:()=>q(T,t?Se.filter((t=>t!==e)):[...Se,e]),disabled:n&&t}})),...(0,d.isInlineNodeInstance)(T)&&(0,v.isVisualNode)(T.node)?[{text:"Ungroup inline node",onClick:()=>Z(T)}]:[],...(0,d.isInlineNodeInstance)(T)?[{text:"Extract inline node to file",onClick:()=>J(T)}]:[],{text:"Reorder inputs",onClick:Ge},{text:"Reorder outputs",onClick:Le},{text:"Set display name",onClick:Be},{text:"Group selected instances",onClick:Y},{text:"Delete instance",intent:"danger",onClick:Fe}];return(0,u.jsxs)(_.Menu,{children:[(0,u.jsx)(_.MenuItem,{text:"Style",children:(0,u.jsx)(N.NodeStyleMenu,{style:ue,onChange:Qe,promptFn:pe})}),e.map(((e,t)=>(0,a.createElement)(_.MenuItem,{...e,key:t})))]})}),[qe,Ue,T,Ge,Le,Be,Fe,ue,Qe,pe,De,ce,B,Se,de,q,Z,J,Y]),et={"--node-color":ue.color,...ue.cssOverride||{}},tt=(0,y.getInstanceDomId)(T.id,e.ancestorsInsIds);return(0,u.jsx)("div",{className:Re,children:(0,u.jsx)(g.BaseNodeView,{pos:T.pos,viewPort:k,onDragStart:ge,onDragMove:ye,onDragEnd:Ie,upperRenderer:Ye,bottomRenderer:Ke,displayMode:S,domId:tt,children:(0,u.jsxs)(l.Fragment,{children:[Ye(),W?x.default.createPortal((0,u.jsxs)("div",{className:"inline-group-editor-container no-drag",children:[(0,u.jsxs)("header",{children:[ze," ",(0,u.jsx)("button",{onClick:e.onCloseInlineEditor,children:"close"})]}),(0,u.jsx)(b.VisualNodeEditor,{...e.inlineGroupProps,className:"no-drag",ref:ae})]}),Q):(0,u.jsx)(_.ContextMenu,{className:(0,p.default)("ins-view-inner",Ae,`size-${re.size}`,{dark:ie}),onClick:Ne,onDoubleClick:we,content:Xe(),style:et,children:(0,u.jsx)(_.Tooltip,{content:R.description,children:(0,u.jsxs)(l.Fragment,{children:[ue.icon?(0,u.jsx)(c.FontAwesomeIcon,{icon:ue.icon}):null," ",ze]})})}),Ke()]})})})}},53568:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStyleMenu=t.nodeStylePresetColors=void 0;const r=n(35250),a=n(50382),u=s(n(70079)),l=n(84472);t.nodeStylePresetColors=[{name:"Amethyst",color:"#9b5de5"},{name:"Magenta",color:"#f15bb5"},{name:"Yellow",color:"#fee440"},{name:"Capri",color:"#00bbf9"},{name:"Sea Green",color:"#00f5d4"},{name:"Orange",color:"#ff7f00"}];const c={size:"regular"};t.NodeStyleMenu=e=>{var n;const{onChange:o,style:i}=e,s=i||c,d=e.promptFn,p=u.default.useCallback(((e,t)=>{o({...s,[e]:t})}),[s,o]),f=u.default.useCallback((async()=>{const e=await d("Icon name? (Font Awesome conventions)","rocket"),t=e.includes(",")?e.split(","):e;p("icon",t)}),[d,p]),m=(0,u.useCallback)((async()=>{const e=await d("Enter a custom style (valid JSON representing a React CSS object)",s.cssOverride?JSON.stringify(s.cssOverride):"");try{const t=JSON.parse(e);p("cssOverride",t)}catch(t){console.error(t),(0,l.toastMsg)("Invalid object","danger")}}),[d,p,s.cssOverride]);return(0,r.jsxs)(u.default.Fragment,{children:[(0,r.jsxs)(a.MenuItem,{text:"Color",children:[t.nodeStylePresetColors.map((e=>(0,r.jsx)(a.MenuItem,{text:e.name,onClick:()=>p("color",e.color)},e.name))),(0,r.jsx)(a.MenuDivider,{}),(0,r.jsx)(a.MenuItem,{text:"Remove Color",onClick:()=>p("color",void 0)})]}),(0,r.jsxs)(a.MenuItem,{text:`Size (${null!==(n=s.size)&&void 0!==n?n:"regular"})`,children:[(0,r.jsx)(a.MenuItem,{text:"Small",onClick:()=>p("size","small")}),(0,r.jsx)(a.MenuItem,{text:"Regular",onClick:()=>p("size","regular")}),(0,r.jsx)(a.MenuItem,{text:"Large",onClick:()=>p("size","large")})]}),(0,r.jsxs)(a.MenuItem,{text:"Icon",children:[(0,r.jsx)(a.MenuItem,{text:"Choose Icon",onClick:f}),(0,r.jsx)(a.MenuItem,{text:"Remove Icon",onClick:()=>p("icon",void 0)})]}),(0,r.jsx)(a.MenuItem,{text:"Custom Styling",onClick:m})]})}},88593:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(53568),t)},83651:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86553),t)},53159:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calcInstancePosition=t.calcNodeWidth=t.calcNodeContent=void 0;const i=n(74762),s=o(n(6576)),r=n(86553),a=n(61888),u=n(30994);t.calcNodeContent=(e,t)=>{if(e.displayName)return e.displayName;if(t.customViewCode)try{const n=Object.entries(e.inputConfig).filter((e=>{let[,t]=e;return(0,i.isStaticInputPinConfig)(t)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o.value}}),{});return s.default.compile(t.customViewCode)({inputs:n}).trim()}catch(n){return console.error("Error with custom view",n),`Error in custom view [${t.id}]`}return t.id};t.calcNodeWidth=(e,n)=>{const o=(0,i.okeys)(n.inputs).length*r.MIN_WIDTH_PER_PIN,s=(0,t.calcNodeContent)(e,n),u=r.PIECE_CHAR_WIDTH;return(0,a.clamp)(s.length*u+2*r.PIECE_HORIZONTAL_PADDING,o,r.MAX_INSTANCE_WIDTH)};t.calcInstancePosition=(e,t,n)=>{const o=(0,u.getInstanceDomId)(e,t),i=document.getElementById(o);if(i){const{x:e,y:t,width:o,height:s}=i.getBoundingClientRect(),r=t+s/2;return{x:e+o/2-n.x,y:r-n.y}}return console.warn("Cannot find element to draw connection to",o),{x:99999,y:99999}}},17841:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutDebugger=t.LayoutDebuggerItem=t.PosDebugger=void 0;const i=n(70079),s=n(35250),r=n(74762),a=o(n(70079)),u=n(7047),l=e=>{let{pos:t}=e;return(0,s.jsxs)("span",{children:[t.x.toFixed(1),", ",t.y.toFixed(1)]})};t.PosDebugger=e=>(0,s.jsx)("span",{className:"pos-debugger",children:(0,s.jsx)(l,{pos:e.pos})});t.LayoutDebuggerItem=e=>{const{pos:n,viewPort:o,size:i,color:r}=e,a=o.zoom,u=n.x*a-o.pos.x*a,l=n.y*a-o.pos.y*a,c={transform:`translate(${u-n.x}px, ${l-n.y}px)`},d={transform:`scale(${o.zoom})`},p={transform:`translate(${n.x}px, ${n.y}px)`},f={width:`${i.width}px`,height:`${i.height}px`,backgroundColor:r};return(0,s.jsx)("div",{className:"layout-debugger",style:c,children:(0,s.jsxs)("span",{className:"drag-sim",style:p,children:[(0,s.jsx)(t.PosDebugger,{pos:n}),(0,s.jsx)("div",{className:"layout-debugger-zoom-wrapper",style:d,children:(0,s.jsx)("div",{className:"layout-debugger-inner",style:f})})]})})};const c=(()=>{try{return"true"===localStorage.getItem("pos-debugger")}catch(e){return!1}})();t.LayoutDebugger=e=>{const{extraDebug:n,vp:o,node:d,mousePos:p}=e;if(!c)return null;const f=n.map(((e,n)=>(0,i.createElement)(t.LayoutDebuggerItem,{...e,key:n}))),m=[...d.instances.map((e=>e.pos)),...(0,r.values)(d.inputsPosition),...(0,r.values)(d.outputsPosition)].map((e=>(0,s.jsx)(t.LayoutDebuggerItem,{pos:e,viewPort:o,size:{width:0,height:0},color:"red"}))),v=(0,u.logicalPosToRenderedPos)(p,o),h=(0,s.jsxs)("div",{className:"viewport-data",children:[(0,s.jsxs)("div",{children:["Pos: ",(0,s.jsx)(l,{pos:o.pos})]}),(0,s.jsxs)("div",{children:["Zoom: ",o.zoom.toFixed(2)," "]}),(0,s.jsxs)("div",{children:["Mouse (logical): ",(0,s.jsx)(l,{pos:p})]}),(0,s.jsxs)("div",{children:["Rendered (rendered): ",(0,s.jsx)(l,{pos:v})]})]});return(0,s.jsxs)(a.default.Fragment,{children:[h,f,m]})}},44338:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(17841),t)},38259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateInstancesWithSingleConstPinsMap=t.getLeafInstancesOfSelection=void 0;t.getLeafInstancesOfSelection=(e,t,n)=>e.reduce(((e,o)=>[...e,...n.filter((e=>e.to.insId===o.id)).map((e=>t.find((t=>t.id===e.from.insId)))).filter((e=>!!e))]),[]).filter((t=>1===n.filter((e=>e.from.insId===t.id||e.to.insId===t.id)).length&&!e.includes(t)));t.calculateInstancesWithSingleConstPinsMap=(e,t)=>{const{connections:n}=e;return n.filter((e=>t.has(e.from.insId))).reduce(((e,n)=>{const o=t.get(n.from.insId),i=n.to.insId,s=e.get(i)||new Map;return s.set(n.to.pinId,{val:o,insId:n.from.insId}),e.set(i,s),e}),new Map)}},37488:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeIoView=void 0;const a=n(35250),u=n(70079),l=s(n(70079)),c=n(74762),d=n(83234),p=r(n(26372)),f=n(50382),m=n(43490),v=n(66189),h=n(74762),g=n(30994),I=n(30653);t.NodeIoView=l.memo((function(e){const{viewPort:t,selected:n,pos:o,type:i,id:s,onDblClick:r,onRename:y,onDelete:b,onChangeInputMode:C,inputMode:_,onSelect:x,closest:N,onSetDescription:w,description:j,onMouseUp:P,onMouseDown:O,currentInsId:E}=e,{history:D,resetHistory:S,refreshHistory:M}=(0,v.useHistoryHelpers)(E,s,i),T=(0,m.usePrompt)(),k=l.useCallback((async()=>{const e=await T("Description?",j);w(i,s,e)}),[T,j,w,i,s]),R=l.useCallback((()=>{b&&b(i,s)}),[i,s,b]),A=l.useCallback((()=>{y&&y(i,s)}),[i,s,y]),V=l.useCallback((e=>{C&&C(s,e)}),[s,C]),$=l.useCallback((()=>[{text:`Current mode - ${_}`,onClick:c.noop},{text:"Make required",onClick:()=>V("required")},{text:"Make optional",onClick:()=>V("optional")},{text:"Make required-if-connected",onClick:()=>V("required-if-connected")},{text:"Set description",onClick:k},...e.onRename?[{text:"Rename",onClick:A}]:[],...e.onDelete?[{text:"Delete",onClick:R}]:[]]),[k,_,V,R,A,e.onDelete,e.onRename]),z=l.useCallback((t=>{r&&r(e.id,t)}),[r,e.id]),H=l.useCallback((()=>{x(s,i)}),[s,i,x]),G=l.useCallback((()=>(0,a.jsx)(f.Menu,{children:$().map(((e,t)=>(0,u.createElement)(f.MenuItem,{...e,key:t})))})),[$]),L="input"===i?(0,h.getInputName)(s):(0,c.getOutputName)(s),F=l.useCallback((e=>{P(s,i,e)}),[s,P,i]),B=l.useCallback((e=>{O(s,i,e)}),[s,O,i]),q=(0,I.useDarkMode)();return(0,a.jsx)(d.BaseNodeView,{className:(0,p.default)("node-io-view",i,{dark:q}),pos:o,onDragEnd:(n,o)=>{const r=e.pos,a=(o.x-r.x)/t.zoom,u=(o.y-r.y)/t.zoom,l=r.x+a,c=r.y+u;e.onDragEnd(i,s,n,{...o,x:l,y:c})},onDragStart:(t,n)=>{e.onDragStart(s,t,n)},onDragMove:(t,n)=>{e.onDragMove(i,s,t,{x:n.x,y:n.y})},viewPort:t,children:(0,a.jsx)(l.Fragment,{children:(0,a.jsx)(f.Tooltip,{content:(()=>{const t=(0,v.calcHistoryContent)(D),n=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:L})," (",i,")"," "]}),n,(0,a.jsx)("hr",{}),t]})})(),children:(0,a.jsx)(f.ContextMenu,{onMouseEnter:M,onMouseOut:S,onMouseUp:F,onMouseDown:B,"data-tip":"","data-html":!0,"data-for":s+e.currentInsId,className:(0,p.default)("node-io-view-inner",{closest:N,selected:n,dark:q}),id:(0,g.getPinDomId)({fullInsIdPath:(0,c.fullInsIdPath)(e.currentInsId,e.ancestorInsIds),pinId:s,pinType:i,isMain:!0}),onClick:H,onDoubleClick:z,content:G(),children:s})})})})}))},66005:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37488),t)},83782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcNodeIoWidth=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0,t.PIECE_HORIZONTAL_PADDING=15,t.PIECE_CHAR_WIDTH=9,t.MIN_WIDTH_PER_PIN=40;t.calcNodeIoWidth=e=>Math.max(t.MIN_WIDTH_PER_PIN,e.length*t.PIECE_CHAR_WIDTH+2*t.PIECE_HORIZONTAL_PADDING)},99942:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderVisualNode=t.layoutToInstances=void 0;const i=n(63521),s=n(74762),r=n(90794),a=o(n(53865)),u=n(83782),l=n(60190),c=n(53159),d=n(41032);t.layoutToInstances=(e,t)=>(0,a.default)(t,(t=>{(0,s.entries)(e.nodes).forEach((e=>{let[n,o]=e;if(n.startsWith("ins-")){const e=n.replace("ins-",""),i=t.instances.find((t=>t.id===e));i?i.pos=o.p:console.warn("WAT")}if(n.startsWith("node-input-")){const e=n.replace("node-input-","");t.inputsPosition[e]=o.p}if(n.startsWith("node-output-")){const e=n.replace("node-output-","");t.outputsPosition[e]=o.p}}))}));t.orderVisualNode=(e,n,o,a)=>{const{instances:p,connections:f}=e,m={...p.reduce(((e,t)=>{const o=(0,l.size)((0,c.calcNodeWidth)(t,(0,d.safelyGetNodeDef)(t,n)),i.NODE_HEIGHT);return{...e,[`ins-${t.id}`]:{p:t.pos,s:o}}}),{}),...(0,s.okeys)(e.inputsPosition).reduce(((t,n)=>({...t,[`node-input-${n}`]:{p:e.inputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{}),...(0,s.okeys)(e.outputsPosition).reduce(((t,n)=>({...t,[`node-output-${n}`]:{p:e.outputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{})},v=f.map((e=>[(0,s.isExternalConnectionNode)(e.from)?`node-input-${e.from.pinId}`:`ins-${e.from.insId}`,(0,s.isExternalConnectionNode)(e.to)?`node-output-${e.to.pinId}`:`ins-${e.to.insId}`])),h=(0,r.orderLayout)({nodes:m,edges:v},o,((n,o)=>{a&&a((0,t.layoutToInstances)(n,e),o)}));return(0,t.layoutToInstances)(h,e)}},90794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderLayout=void 0;const o=n(60190),i=400,s=e=>e.reduce(((e,t)=>{const n=(0,o.vSub)(t.p,(0,o.vec)(t.s.width/2,t.s.height/2));return{...e,[t.id]:{p:n,s:t.s}}}),{});t.orderLayout=(e,t,n)=>{let{nodes:r,edges:a}=e,u=Object.entries(r).map((e=>{let[t,n]=e;return{id:t,p:(0,o.vAdd)(n.p,(0,o.vec)(n.s.width/2,n.s.height/2)),f:(0,o.vec)(0,0),v:(0,o.vec)(0,0),m:1,s:n.s}})),l=0;for(;l.01);){let e=u;for(let t=0;t{let n=e.find((e=>e.id===t[0])),i=e.find((e=>e.id===t[1]));if(!n||!i)return void console.warn("weoops",t[0],t[1]);const s=(0,o.vec)(0,-200),r=(0,o.vSub)(n.p,i.p),a=(0,o.vSub)(s,r),u=1e3*(0,o.vLen)(a),l=(0,o.vMul)((0,o.vNorm)(a),.5*u),c=(0,o.vMul)((0,o.vNorm)(a),-.5*u);n.f=(0,o.vAdd)(n.f,l),i.f=(0,o.vAdd)(i.f,c)})),e=e.map((e=>(0,o.itrPhysics)(15,e))),e=e.map((e=>{const t=(0,o.vMul)(e.v,.5),n=(0,o.vLen)(t)>100?(0,o.vMul)((0,o.vNorm)(t),100):t;return{...e,v:n}})),u=e,n&&n({nodes:s(e),edges:a},l),l++}return{nodes:s(u),edges:a,itrs:l,timeout:l>=t,total:(0,o.totalEnergy)(u)}}},2036:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PinView=t.PIN_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=n(50382),d=n(18420),p=n(74762),f=n(30994),m=n(96233),v=n(66189),h=n(30653);t.PIN_HEIGHT=23;t.PinView=u.memo((function(e){const{selected:t,type:n,connected:o,optional:i,currentInsId:s,isClosestToMouse:r,id:g,onMouseDown:I,onMouseUp:y}=e,{history:b,resetHistory:C,refreshHistory:_}=(0,v.useHistoryHelpers)(s,g,n),x=(0,h.useDarkMode)(),N="input"===n?(0,p.getInputName)(g):(0,p.getOutputName)(g),w="input"===e.type&&(0,d.isDefined)(e.constValue)?e.constValue:void 0,j=u.useCallback((e=>{0===e.button&&I(g,n,e)}),[g,n,I]),P=u.useCallback((e=>{0===e.button&&y(g,n,e)}),[g,n,y]);return(0,a.jsxs)("div",{className:(()=>{if("input"===e.type){const{isSticky:s,constValue:a}=e;return(0,l.default)("pin",{sticky:s,selected:t,closest:r,optional:i,connected:o,"const-value":(0,d.isDefined)(a),"env-value":(0,d.isDefined)(a)&&(0,p.isEnvValue)(a),minimized:e.minimized,dark:x},n)}return(0,l.default)("pin",{selected:t,connected:o,closest:r,optional:i,minimized:e.minimized,"error-pin":g===p.ERROR_PIN_ID,dark:x},n)})(),"data-pin-id":g,children:[(0,a.jsx)(c.Tooltip,{className:"pin-info-tooltip",content:(()=>{const t=(0,v.calcHistoryContent)(b,"input"===n?e.queuedValues:void 0),o=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:N})," (",n,")"," "]}),o,(0,a.jsx)("hr",{}),(0,d.isDefined)(w)?(0,a.jsxs)("div",{children:["Static value:"," ",(0,a.jsx)("strong",{children:(0,m.valuePreview)(w).substring(0,200)})]}):t]})})(),children:(0,a.jsxs)(c.ContextMenu,{onMouseEnter:_,onMouseOut:C,onMouseDown:j,onMouseUp:P,"data-tip":"","data-html":!0,"data-for":g+e.currentInsId,id:(0,f.getPinDomId)({fullInsIdPath:(0,p.fullInsIdPath)(e.currentInsId,e.ancestorsInsIds),pinId:g,pinType:n,isMain:!1}),onDoubleClick:t=>e.onDoubleClick&&e.onDoubleClick(g,t),className:(0,l.default)("pin-inner",{dark:x}),onClick:t=>{const{onShiftClick:o,onClick:i,id:s}=e;t.shiftKey&&o?o(s,t):i(s,n,t)},content:(()=>{const t=(0,a.jsx)(c.MenuItem,{onClick:()=>e.onInspect(e.currentInsId,{id:e.id,type:e.type}),text:"Inspect"});if("input"===e.type){const{onConvertConstToEnv:n}=e;return(0,d.isDefined)(w)?(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onDetachConstValue(e.id),text:"Detach value"}),(0,a.jsx)(c.MenuItem,{onClick:()=>e.onCopyConstValue(e.id),text:"Copy value"}),(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null,n?(0,a.jsx)(c.MenuItem,{onClick:()=>n(e.id),text:"Convert to Env Var"}):null]}):(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onToggleSticky(e.id),text:"Toggle sticky (square means sticky)"}),t,(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null]})}return(0,a.jsx)(c.Menu,{children:t})})(),children:[N," ",(0,d.isDefined)(w)?(0,a.jsxs)(u.Fragment,{children:[":",(0,a.jsx)("span",{className:"value",children:(0,d.toString)(w)})]}):null,"input"===e.type&&e.isSticky?(0,a.jsx)("span",{className:"suffix",children:"s"}):null,"input"===e.type&&e.queueSize?(0,a.jsxs)("span",{className:"suffix",children:[e.queueSize," in Q"]}):null]})}),(0,a.jsx)("div",{className:"wire"})]})}))},66189:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHistoryHelpers=t.calcHistoryContent=void 0;const i=n(35250),s=n(96233),r=o(n(70079)),a=n(70079),u=n(98158);t.calcHistoryContent=(e,t)=>{if(e){const{total:n,lastSamples:o}=e,a=(0,i.jsxs)("strong",{children:["Activated ",n," times this session"]}),u=o.length>0?(0,i.jsxs)("div",{children:["Last value:"," ",(0,i.jsx)("strong",{children:(0,s.valuePreview)(o[0].val).substring(0,200)}),(0,i.jsx)("br",{}),(0,i.jsx)("em",{children:"Inspect instance for the full value"})]}):"",l=t?(0,i.jsx)(r.default.Fragment,{children:(0,i.jsxs)("div",{children:["Queued values: ",(0,i.jsx)("strong",{children:t})]})}):"";return(0,i.jsxs)(r.default.Fragment,{children:[a,u,l]})}return"Loading session data.."};t.useHistoryHelpers=(e,t,n)=>{const o=(0,a.useRef)(),{onRequestHistory:i}=(0,u.useDebuggerContext)(),[s,l]=(0,a.useState)();return{history:s,refreshHistory:(0,a.useCallback)((()=>{clearInterval(o.current),i(e,t,n).then((e=>{l(e)})),o.current=setInterval((()=>{i(e,t,n).then((e=>{l(e)}))}),500)}),[e,i,t,n]),resetHistory:r.default.useCallback((()=>{clearInterval(o.current),l(void 0)}),[])}}},89440:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAddMenu=void 0;const r=n(35250),a=s(n(70079)),u=n(74762),l=n(50382),c=n(70457),d=n(9958),p=n(86125),f=c.Select.ofType(),m=e=>{switch(e.type){case"node":return`${e.node.id}`;case"value":return"Add inline value or function";case"import":return`Import ${e.importableNode.node.id} from ${e.importableNode.module}`}},v=(e,t)=>{let{handleClick:n,modifiers:o,query:i}=t;if(!o.matchesPredicate)return null;const s=m(e);return"value"===e.type?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(l.MenuDivider,{}),(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))]}):(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))},h=(e,t,n,o)=>{const i=m(t).toLocaleLowerCase(),s=e.toLowerCase();return o?i===s:i.includes(s)};t.QuickAddMenu=e=>{const{resolvedDependencies:t,targetNode:n}=e,o={left:e.pos.x,top:e.pos.y},{onRequestImportables:i}=(0,p.useDependenciesContext)(),[s,c]=a.useState();a.useEffect((()=>{i().then((e=>c(e.importables)))}),[i]);const d=(0,u.values)({...t,[n.id]:n}),m=d.map((e=>({type:"node",node:e}))),g=new Set(d.map((e=>e.id))),I=s?s.filter((e=>!g.has(e.node.id))).map((e=>({type:"import",importableNode:e}))):[],y=m.concat(I).concat({type:"value"});return(0,r.jsx)("div",{className:"quick-add-menu",style:o,children:(0,r.jsx)(f,{className:"quick-add-nodes-select",items:y,itemPredicate:h,itemRenderer:v,inputProps:{className:"quick-add-input"},noResults:(0,r.jsx)(l.MenuItem,{disabled:!0,text:"No results."}),onItemSelect:t=>e.onAdd(t),popoverProps:{isOpen:!0,onClose:()=>e.onClose()}})})}},71033:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89440),t)},73470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimePlayer=void 0;const o=n(74762),i=n(64955),s=(0,o.debugLogger)("runtime-player");t.createRuntimePlayer=()=>{let e=0,t=[];let n=!1,r=Date.now(),a=e;const u=()=>requestAnimationFrame((()=>{const l=Date.now();a=e,e+=l-r,r=l,((e,n)=>{const r=t;t=[],r.length&&s(`Playing ${r.length} events from`,e,n),r.forEach((e=>{s("Playing event",e),(0,i.playEvent)(e),e.insId===o.ROOT_INS_ID&&e.type===o.DebuggerEventType.PROCESSING_CHANGE&&!1===e.val&&(s("Main instance is done processing, clearing runtime UI",e),c())}))})(a,e),n&&u()})),l=()=>{n=!1},c=()=>{document.querySelectorAll("[data-runtime]").forEach((e=>{e.removeAttribute("data-runtime")})),document.querySelectorAll("[data-runtime-queue]").forEach((e=>{e.removeAttribute("data-runtime-queue")})),t=[]};return{stop:l,start:function(t){void 0===t&&(t=0),n=!0,e=t,r=Date.now(),u()},addEvents:e=>{t.push(...e)},destroy:()=>{l(),c()},clear:c,status:()=>({running:n,currDt:e,lastDt:a,queue:t,last:r})}}},64955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playEvent=t.cancelTimers=void 0;const o=n(74762),i=n(30994),s=5e3,r=(0,o.debugLogger)("runtime-player:play-event"),a=(e,t)=>e.type===o.DebuggerEventType.INPUT_CHANGE||e.type===o.DebuggerEventType.OUTPUT_CHANGE?`${(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds)}.${e.pinId}`:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds);t.cancelTimers=new Map;t.playEvent=e=>{switch(e.type){case o.DebuggerEventType.INPUT_CHANGE:case o.DebuggerEventType.OUTPUT_CHANGE:{const{pinId:n,insId:u,ancestorsInsIds:l}=e,c=e.type===o.DebuggerEventType.INPUT_CHANGE?"input":"output",d=[(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!0})];u!==o.ROOT_INS_ID&&d.push((0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!1})),d.forEach(((i,l)=>{const c=a(e);clearTimeout(t.cancelTimers.get(c));const d=document.getElementById(i),p=`${u}.${n}`,f=e.type===o.DebuggerEventType.OUTPUT_CHANGE?document.querySelectorAll(`[data-from-id="${p}"]`):[];if(d){clearTimeout(t.cancelTimers.get(c)),d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),setTimeout((()=>{d.setAttribute("data-runtime","active"),f.forEach((e=>{e.setAttribute("data-runtime","active")}))}),0);const n=setTimeout((()=>{d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),t.cancelTimers.delete(c)}),s);t.cancelTimers.set(a(e),n)}else console.warn(`No DOM element with Id [${i}] found to play event`),r(`No DOM element with Id [${i}] found to play event`,e)}));break}case o.DebuggerEventType.PROCESSING_CHANGE:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(l)if(!0===e.val)l.setAttribute("data-runtime","processing"),clearTimeout(t.cancelTimers.get(u));else{l.removeAttribute("data-runtime"),setTimeout((()=>{"error"!==l.getAttribute("data-runtime")&&l.setAttribute("data-runtime","done")}),0);const e=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,e)}else r(`No DOM element with Id [${n}] found to play event`,e)}));break}case o.DebuggerEventType.ERROR:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(!l)return void r(`No DOM element with Id [${n}] found to play event`,e);clearTimeout(t.cancelTimers.get(u)),l.removeAttribute("data-runtime"),setTimeout((()=>{l.setAttribute("data-runtime","error")}));const c=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,c)}));const c={...e,type:o.DebuggerEventType.OUTPUT_CHANGE,pinId:o.ERROR_PIN_ID};(0,t.playEvent)(c);break}case o.DebuggerEventType.INPUTS_STATE_CHANGE:(0,o.entries)(e.val).forEach((t=>{let[n,s]=t;const{insId:a,ancestorsInsIds:u}=e,l=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(a,u),pinId:n,pinType:"input",isMain:!1}),c=document.getElementById(l);c?s>0?c.setAttribute("data-runtime-queue",`${s}`):c.removeAttribute("data-runtime-queue"):r(`No DOM element with Id [${l}] found to play event`,e)}))}}},25804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounce=void 0;const o=n(70079);t.useDebounce=function(e,t){const[n,i]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}},7047:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.handleChangeNodeInputType=t.handleIoPinRename=t.handleInstanceDrag=t.getInstancesInRect=t.isJsxValue=t.getMiddleOfViewPort=t.fitViewPortToNode=t.centerBoardPosOnTarget=t.renderedPosToLogicalPos=t.logicalPosToRenderedPos=t.getEffectiveNodeDimensions=t.calcNodesPositions=t.calcSelectionBoxArea=t.animateViewPort=t.easeInOutNum=t.easeInOutPos=t.easeInOutQuad=t.center=t.distance=t.clamp=t.domToViewPort=t.roundNumber=t.createNewNodeInstance=t.createNewInlineNodeInstance=t.parseInputOutputTypes=t.parsePromptValue=t.getSelectionBoxRect=t.findClosestPin=t.changePinConfig=t.getInstancePinConfig=t.emptyList=t.emptyObj=void 0;const r=s(n(53865)),a=n(30721),u=n(63521),l=n(74762),c=n(18243),d=n(74762),p=n(53159),f=n(83782),m=n(60190),v=n(38259),h=n(83651),g=n(41032);t.emptyObj={},t.emptyList=[],t.getInstancePinConfig=function(e,n,o){var i;const s=e.instances.find((e=>e.id===n));if(!s)throw new Error(`Instance ${n} not found`);return null!==(i=(s.inputConfig||t.emptyObj)[o])&&void 0!==i?i:(0,l.queueInputPinConfig)()};t.changePinConfig=(e,t,n,o)=>r.produce(e,(e=>{var i;const{instances:s}=e,r=s.find((e=>e.id===t));if(!r)throw new Error("blah");const a=null!==(i=r.inputConfig)&&void 0!==i?i:{};a[n]=o,e.instances=s.map((e=>e===r?{...r,inputConfig:a}:e))}));t.findClosestPin=(e,t,n,o,i,s,r)=>{const a=(0,l.nodeInstance)(e.id,e.id),u=(0,d.okeys)(e.inputs).map((e=>({id:e,type:"input",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),p=(0,d.okeys)(e.outputs).map((e=>({id:e,type:"output",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),f=[...u,...e.instances.reduce(((n,a)=>{const u=(0,g.safelyGetNodeDef)(a,t),d=(0,h.getVisibleInputs)(a,u,e.connections),p=(0,h.getVisibleOutputs)(a,u,e.connections);return[...n,...d.map((e=>({ins:a,type:"input",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!1}),id:e}))),...p.map((e=>({ins:a,type:"output",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!1}),id:e})))]}),[]),...p];let m={dis:1e5,item:f[0]};return f.forEach((e=>{const t=e.pos.x-n.x,o=e.pos.y-n.y,i=Math.sqrt(t*t+o*o);i{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x,t.x)-n,h:Math.max(e.y,t.y)-o}};t.parsePromptValue=e=>{if(null===e)return;const t=parseInt(e,10);let n=e;return t.toString()!=e||isNaN(t)||(n=t),n};t.parseInputOutputTypes=e=>{const[,t,n]=e.match(/node\((.+)\|(.+)\)/)||[],o=(0,d.entries)(JSON.parse(t)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]})),i=(0,d.entries)(JSON.parse(n)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]}));return{inputs:(0,d.fromEntries)(o),outputs:(0,d.fromEntries)(i)}};t.createNewInlineNodeInstance=function(e,t,n){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const o=(0,l.inlineNodeInstance)(`${e.id}-${(0,d.randomInt)(999)}`,e,{},{x:0,y:0}),i=(0,p.calcNodeWidth)(o,e),{x:s,y:r}=n,a={x:s-i/2,y:r+t};return{...o,pos:a}};t.createNewNodeInstance=function(e,t,n,o){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const i="string"==typeof e?(0,g.safelyGetNodeDef)(e,o):e;if(!i)throw new Error(`${e} node not found in resolvedNodes`);const s=(0,d.entries)(i.inputs).reduce(((e,t)=>{let[n,o]=t;return o.defaultValue&&(e[n]=(0,l.staticInputPinConfig)(o.defaultValue)),e}),{}),r=(0,l.nodeInstance)((0,a.createId)(),i.id,s,{x:0,y:0}),c=(0,p.calcNodeWidth)(r,i),{x:f,y:m}=n,v={x:f-c/2,y:m+t};return{...r,pos:v}};t.roundNumber=e=>Math.round(100*e)/100;t.domToViewPort=(e,n,o)=>({x:(0,t.roundNumber)(n.pos.x+e.x/n.zoom/o.zoom),y:(0,t.roundNumber)(n.pos.y+e.y/n.zoom/o.zoom)});t.clamp=(e,t,n)=>Math.max(e,Math.min(t,n));t.distance=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)};t.center=(e,t,n)=>{let{zoom:o}=n;const i=e.x+e.w/2,s=e.y+e.h/2,{w:r,h:a}=t;return{x:i-r/o/2,y:s-a/o/2}};t.easeInOutQuad=e=>e<.5?2*e*e:(4-2*e)*e-1;t.easeInOutPos=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i),a=(0,t.easeInOutQuad)(r),u=n.x-e.x,l=n.y-e.y;return{x:e.x+u*a,y:e.y+l*a}};t.easeInOutNum=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i);return e+(n-e)*(0,t.easeInOutQuad)(r)};t.animateViewPort=(e,n,o,i)=>{const s=(0,t.distance)(e.pos,n.pos),r=Date.now(),a=o;if(0===s)return void i(e);const u=()=>{const o=Date.now(),s=(0,t.easeInOutPos)(e.pos,n.pos,r,a,o),l=(0,t.easeInOutNum)(e.zoom,n.zoom,r,a,o);o-r{const n=(0,t.getSelectionBoxRect)(e.from,e.to);return n.h*n.w};const I=(e,t,n,o)=>({left:n.x,right:n.x+e,top:n.y,bottom:n.y+t,tag:o,center:(0,l.calcCenter)({w:e,h:t,...n})});t.calcNodesPositions=(e,t)=>[...e.instances.map((e=>{const n=(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,t)),o=u.NODE_HEIGHT;return I(n,o,e.pos,e.id)})),...(0,d.okeys)(e.inputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.inputsPosition[t]||{x:0,y:0};return I(n,o,i,"input_"+t)})),...(0,d.okeys)(e.outputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.outputsPosition[t]||{x:0,y:0};return I(n,o,i,"output"+t)}))];t.getEffectiveNodeDimensions=(e,n)=>{const o=(0,t.calcNodesPositions)(e,n),i=o[0]||{left:0,right:0,top:0,bottom:0},s=o.reduce(((e,t)=>t.leftt.right>e?t.right:e),i.right),a=o.reduce(((e,t)=>t.topt.bottom>e?t.bottom:e),i.bottom)-a,d={x:s,y:a};return{size:{width:u,height:c},pos:d,center:(0,l.calcCenter)({w:u,h:c,...d})}};t.logicalPosToRenderedPos=(e,t)=>{const n=(0,m.vSub)(e,t.pos);return(0,m.vMul)(n,t.zoom)};t.renderedPosToLogicalPos=(e,t)=>{const n=(0,m.vDiv)(e,t.zoom);return(0,m.vAdd)(t.pos,n)};t.centerBoardPosOnTarget=(e,n,o,i)=>{const s=(0,t.logicalPosToRenderedPos)(e,i),r=(0,t.renderedPosToLogicalPos)(s,{...i,zoom:o}),a=Math.max(e.x,r.x)-Math.min(e.x,r.x),u=Math.max(e.y,r.y)-Math.min(e.y,r.y);return{x:o>i.zoom?i.pos.x+a:i.pos.x-a,y:o>i.zoom?i.pos.y+u:i.pos.y-u}};t.fitViewPortToNode=function(e,n,o,i){void 0===i&&(i=[20,150]);const{size:s,center:r}=(0,t.getEffectiveNodeDimensions)(e,n),a=i[0],u=i[1],l=s.width+a,c=s.height+u,d=o.width/l,p=o.height/c,f=Math.min(d,p)/1.15,m=(0,t.clamp)(.3,1.2,f);return{zoom:m,pos:{x:r.x-o.width/2/m,y:r.y-o.height/2/m+20}}};t.getMiddleOfViewPort=(e,n)=>{const o={x:n.width/2,y:n.height/2};return(0,t.renderedPosToLogicalPos)(o,e)};t.isJsxValue=e=>{const t=e=>(0,d.isDefined)(e.ref)&&(0,d.isDefined)(e.type)&&(0,d.isDefined)(e.props);try{const n=JSON.parse(e);return t(n)||Array.isArray(n)&&t(n[0])}catch(n){return!1}};t.getInstancesInRect=(e,n,o,i,s,r,a)=>{const{from:c,to:d}=e,f=(0,t.getSelectionBoxRect)(c,d);return s.filter((e=>{const{pos:t}=e,i={...t,w:(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,n))*o.zoom*a.zoom,h:u.NODE_HEIGHT*o.zoom*a.zoom};return(0,l.intersectRect)(f,i)||(0,l.intersectRect)(i,f)})).map((e=>e.id))};t.handleInstanceDrag=(e,t,n,o,i,s)=>{o.preventDefault(),o.stopPropagation();const a=(0,m.vSub)(n,t.pos);let u;const l=r.produce(e,(e=>{const r=e.instances.find((e=>e.id===t.id));if(!r)throw new Error("impossible state dragging instance that does not exist");!o.shiftKey&&s&&(u=[s]);const l=e.instances.filter((e=>i.includes(e.id)&&e!==r)),c=[r,...l],d=(0,v.getLeafInstancesOfSelection)(c,e.instances,e.connections);[...l,...d].forEach((e=>{e.pos=(0,m.vAdd)(e.pos,a)})),r.pos=n,!o.shiftKey&&s&&(u=[s])}));return{newValue:l,newSelected:u}};t.handleIoPinRename=(e,t,n,o)=>r.produce(e,(e=>{"input"===t?(e.inputs[o]=e.inputs[n],e.inputsPosition[o]=e.inputsPosition[n],delete e.inputs[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===n?{...e,from:{...e.from,pinId:o}}:e))):(e.outputs[o]=e.outputs[n],e.outputsPosition[o]=e.outputsPosition[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===n?{...e,to:{...e.to,pinId:o}}:e)),e.completionOutputs=(e.completionOutputs||[]).map((e=>e.split("+").map((e=>e===n?o:n)).join("+"))),delete e.outputs[n])}));t.handleChangeNodeInputType=(e,t,n)=>r.produce(e,(e=>{const o=e.inputs[t];if(!o)throw new Error("Wat");o.mode=n}))},42403:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorClient=void 0;const i=n(74762),s=o(n(18706)),r=n(32048),a=n(31758),u=(0,i.debugLogger)("remote-debugger:editor-client");t.createEditorClient=(e,t)=>{const n=new URL(e),o=(0,r.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/editor`,timeout:3e4});return o.emit("join-room-editor",t),{emitChange:e=>{o.emit(a.DebuggerServerEventType.CHANGE_EVENT_NAME,e)},emitBreakpointsChange:e=>{o.emit(a.DebuggerServerEventType.UPDATE_BREAKPOINTS,e)},interceptInput:e=>{o.emit(a.DebuggerServerEventType.INPUT_VALUE_OVERRIDE,e)},interceptOutput:e=>{o.emit(a.DebuggerServerEventType.OUTPUT_VALUE_OVERRIDE,e)},onRuntimeReady:e=>(o.on(a.DebuggerServerEventType.RUNTIME_READY,e),()=>o.off(a.DebuggerServerEventType.RUNTIME_READY,e)),onChangeAwk:e=>(o.on(a.DebuggerServerEventType.CHANGE_AWK,e),()=>o.off(a.DebuggerServerEventType.CHANGE_AWK,e)),onChangeError:e=>(o.on(a.DebuggerServerEventType.CHANGE_ERROR,e),()=>o.off(a.DebuggerServerEventType.CHANGE_ERROR,e)),onIsAlive:e=>(o.on(a.DebuggerServerEventType.IS_ALIVE,e),()=>o.off(a.DebuggerServerEventType.IS_ALIVE,e)),emitInputValue:(e,t)=>{u(`Emitting push input value to ${e} %o`,t),o.emit(a.DebuggerServerEventType.PUSH_INPUT_VALUE,{pinId:e,value:t})},destroy:()=>{o.disconnect(),(0,a.enumToArray)(a.DebuggerServerEventType).forEach((e=>o.off(e)))},onDisconnect:e=>(o.on("disconnect",e),()=>o.off("disconnect",e)),debugInfo:()=>`Remote debugger for ${e}`,onBatchedEvents:e=>(o.on(a.DebuggerServerEventType.EVENTS_BATCH,e),()=>o.off(a.DebuggerServerEventType.EVENTS_BATCH,e)),requestState:()=>s.default.get(`${e}/state`).then((e=>e.data.state)),getHistory:n=>s.default.get(`${e}/history`,{params:{insId:n.insId,pinId:n.pinId,limit:n.limit,executionId:t}}).then((e=>e.data)),clearHistory:()=>s.default.delete(`${e}/history`).then((()=>{})),triggerNode:(t,n)=>s.default.post(`${e}/trigger`,{nodeId:t,inputs:n}).then((e=>e.data))}}},58066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeData=void 0;const o=n(74762),i=n(36783),s=(0,o.debugLogger)("remote-debugger:normalize-data");t.normalizeData=e=>{if(e instanceof Error)return(0,i.serializeError)(e);if("object"==typeof e&&null!==e){e={...e};const t=new WeakSet,n=e=>{if("bigint"==typeof e)return e.toString();if("object"!=typeof e||Array.isArray(e))return e;if(null===e)return e;if(t.has(e))return"[Circular]";try{t.add(e)}catch(o){s("Error adding to WeakSet","data:",e,"type:",typeof e,"error:",o)}if(Array.isArray(e))return e.map(n);if("object"==typeof e){const t={};for(const o in e)t[o]=n(e[o]);return t}return e};return n(e)}return e}},39641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimeClient=t.DEFAULT_DT_SCALE=void 0;const o=n(74762),i=n(32048),s=n(31758),r=n(58066),a=(0,o.debugLogger)("remote-debugger:runtime-client");t.DEFAULT_DT_SCALE=1;t.createRuntimeClient=(e,t)=>{const n=new URL(e),u=(0,i.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/runtime`,timeout:1e3,reconnectionAttempts:3});u.emit("join-room-runtime",t),u.on("connection",(e=>{e.join(t)}));let l=new Set;u.on(s.DebuggerServerEventType.UPDATE_BREAKPOINTS,(e=>{l=new Set(e)}));const c=(0,o.cappedArrayDebounce)((e=>{a(`Emitting debounced batched events - ${e.length}`),u.emit(s.DebuggerServerEventType.EVENTS_BATCH,e)}),100,200);return{onChange:e=>(u.on(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e),()=>u.off(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e)),onInput:e=>(u.on(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e),()=>u.off(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e)),emitEvent:e=>{a(`Emitting event ${e.type} change event of ${e.insId}`),e.val=(0,r.normalizeData)(e.val),c.addItem({...e,time:Date.now()})},emitRuntimeReady:()=>{u.emit(s.DebuggerServerEventType.RUNTIME_READY,{})},emitChangeAwk:()=>{u.emit(s.DebuggerServerEventType.CHANGE_AWK,{})},emitChangeError:e=>{u.emit(s.DebuggerServerEventType.CHANGE_ERROR,{error:e})},emitIsAlive:e=>{u.emit(s.DebuggerServerEventType.IS_ALIVE,{time:e})},destroy:async()=>{c.pendingItems()&&(c.flush(),await(0,o.delay)(100)),(0,s.enumToArray)(s.DebuggerServerEventType).forEach((e=>u.off(e))),u.disconnect()},onDisconnect:e=>(u.on("disconnect",e),()=>u.off("disconnect",e)),waitForConnection:()=>new Promise(((e,t)=>{u.connected?e():(u.on("connect_error",(e=>{t(`Socket connect error: ${e}`)})),u.on("connect",(()=>{e()})))}))}}},31758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerServerEventType=t.enumToArray=t.isNumber=t.isSimpleType=t.valuePreview=t.toString=void 0;const o=n(36783);t.toString=e=>{if("object"===typeof e){if(e instanceof Error)return JSON.stringify((0,o.serializeError)(e));try{return JSON.stringify(e).substr(0,250)}catch(t){return"Object (cannot stringify)"}}return`${e}`.substr(0,250)};t.valuePreview=e=>(0,t.toString)(e).substr(0,100);t.isSimpleType=e=>["number","string","boolean"].includes(typeof e);t.isNumber=e=>!1===isNaN(Number(e)),t.enumToArray=function(e){return Object.keys(e).filter(t.isNumber).map((t=>e[t]))},function(e){e.RUNTIME_READY="runtime-ready",e.CHANGE_EVENT_NAME="change",e.PUSH_INPUT_VALUE="push-input-value",e.CHANGE_AWK="live-change-awk",e.CHANGE_ERROR="live-change-error",e.IS_ALIVE="is-alive",e.UPDATE_BREAKPOINTS="update-breakpoints",e.INPUT_VALUE_OVERRIDE="input-value-override",e.OUTPUT_VALUE_OVERRIDE="output-value-override",e.INPUT_VALUE_CHANGE="input-value-changed",e.OUTPUT_VALUE_CHANGE="output-value-changed",e.PROCESSING_CHANGE="processing-changed",e.INPUTS_STATE_CHANGE="inputs-state-changed",e.NODE_ERROR="node-error",e.EVENTS_BATCH="events-batch"}(t.DebuggerServerEventType||(t.DebuggerServerEventType={}))},96233:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31758),t),i(n(42403),t),i(n(39641),t)},43920:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Equals=t.EqualsBoolean=t.Throttle=t.ThrottleError=t.Debounce=t.Interval=t.Delay=t.Switch4=t.Switch2=t.Switch3=t.EmitOnTrigger=t.BooleanSplit=t.Subscribe=t.Publish=t.RoundRobin4=t.RoundRobin2=t.RoundRobin3=t.LimitTimes=void 0;const o=n(11253),i="Control Flow";t.LimitTimes={id:"Limit Times",namespace:i,description:"Item will be emitted until the limit is reached",inputs:{item:{mode:"required",description:"The item to emit"},times:{mode:"required",description:"The number of times to emit the item"},reset:{mode:"optional",description:"Reset the counter"}},outputs:{ok:{}},reactiveInputs:["item","reset"],completionOutputs:[],run:function(e,t,n){const{state:o}=n,{item:i,times:s,reset:r}=e,{ok:a}=t;if(void 0!==r)return void o.set("val",0);let u=o.get("val")||0;u++,o.set("val",u),u>=s?n.onError(new Error(`Limit of ${s} reached`)):a.next(i)}},t.RoundRobin3={id:"Round Robin 3",namespace:i,description:"Item will be emitted to one of the three outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r}=t,a=o.get("curr")||0,u=(a+1)%3;[i,s,r][a].next(e.item),o.set("curr",u)}},t.RoundRobin2={namespace:i,id:"Round Robin 2",description:"Item will be emitted to one of the 2 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s}=t,r=o.get("curr")||0,a=(r+1)%2;[i,s][r].next(e.item),o.set("curr",a)}},t.RoundRobin4={id:"Round Robin 4",namespace:i,description:"Item will be emitted to one of the 4 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves to "r4"\'s turn.'},r4:{description:'The fourth output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r,r4:a}=t,u=o.get("curr")||0,l=(u+1)%4;[i,s,r,a][u].next(e.item),o.set("curr",l)}},t.Publish={id:"Publish",namespace:i,description:"Publishes a value by a key to all listeners in the current flow. Use 'Subscribe' to listen to events.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},value:{mode:"required"}},outputs:{},run:function(e,t,n){const i=`${n.ancestorsInsIds}__${e.key}`;o.publish(i,e.value)}},t.Subscribe={id:"Subscribe",namespace:i,description:"Subscribes to a value published by a key. Use 'Publish' to publish values.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},initial:{mode:"required-if-connected",description:"If passed will be published has the first value"}},completionOutputs:[],outputs:{value:{description:"The value published by the key"}},run:function(e,t,n){const{value:i}=t,s=`${n.ancestorsInsIds}__${e.key}`,r=o.subscribe(s,((e,t)=>{i.next(t)}));void 0!==e.initial&&i.next(e.initial),n.onCleanup((()=>{o.unsubscribe(r)}))}},t.BooleanSplit={namespace:i,id:"Boolean Split",description:"Splits a boolean value into two outputs",inputs:{value:{mode:"required",description:"Boolean value"},trueValue:{mode:"required-if-connected",description:"Value to emit if the input is true. Defaults to true"},falseValue:{mode:"required-if-connected",description:"Value to emit if the input is false. Defaults to false"}},outputs:{true:{description:"The value is true"},false:{description:"The value is false"}},run:function(e,t){const{true:n,false:o}=t,{value:i,trueValue:s,falseValue:r}=e;i?n.next(null==s||s):o.next(null!=r&&r)}},t.EmitOnTrigger={namespace:i,id:"Emit on Trigger",description:"Emits the value when the trigger input receives any value",inputs:{value:{mode:"required",description:"The value to emit"},trigger:{mode:"required",description:"The trigger to emit the value"}},outputs:{result:{description:"The value emitted"}},run:function(e,t){const{result:n}=t,{value:o,trigger:i}=e;void 0!==i&&n.next(o)}},t.Switch3={namespace:i,id:"Switch 3",description:"Switches between 3 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,default:s,outputValue:r}=t,{value:a,firstCase:u,secondCase:l,thirdCase:c}=e;a===u?n.next(null!=r?r:a):a===l?o.next(null!=r?r:a):a===c?i.next(null!=r?r:a):s.next(null!=r?r:a)}},t.Switch2={id:"Switch 2",description:"Switches between 2 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,default:i,outputValue:s}=t,{value:r,firstCase:a,secondCase:u}=e;r===a?n.next(null!=s?s:r):r===u?o.next(null!=s?s:r):i.next(null!=s?s:r)}},t.Switch4={id:"Switch 4",description:"Switches between 4 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},fourthCase:{mode:"required",description:"The value to switch on for the fourth output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},fourth:{description:"The value emitted if the input value is equal to the fourth case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,fourth:s,default:r,outputValue:a}=t,{value:u,firstCase:l,secondCase:c,thirdCase:d,fourthCase:p}=e;u===l?n.next(null!=a?a:u):u===c?o.next(null!=a?a:u):u===d?i.next(null!=a?a:u):u===p?s.next(null!=a?a:u):r.next(null!=a?a:u)}},t.Delay={id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:i,description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:async(e,t)=>{let{value:n,delay:o}=e,{delayedValue:i}=t;await new Promise((e=>setTimeout(e,o))),i.next(n)}},t.Interval={id:"Interval",namespace:i,defaultStyle:{icon:"fa-clock"},description:"Emits a value every interval",inputs:{value:{description:"Value to emit"},interval:{description:"Interval in milliseconds"}},reactiveInputs:["value","interval"],outputs:{value:{description:"Emitted value"}},completionOutputs:[],run:(e,t,n)=>{n.state.get("timer")&&clearInterval(n.state.get("timer"));const o=setInterval((()=>{t.value.next(e.value)}),e.interval);n.state.set("timer",o),n.onCleanup((()=>{clearInterval(o)}))}},t.Debounce={id:"Debounce",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be debounced"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The debounced value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the last value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:s}=t,r=n.state.get("timer");r&&clearTimeout(r);const a=setTimeout((()=>{s.next(o)}),i);n.state.set("timer",a),n.onCleanup((()=>{clearTimeout(r)}))}};class s extends Error{constructor(e){super("Throttle: Value dropped"),this.value=e}}t.ThrottleError=s,t.Throttle={id:"Throttle",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be throttled"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The throttled value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the first value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:r}=t;if(n.state.get("timer"))n.onError(new s(o));else{r.next(o);const e=setTimeout((()=>{n.state.set("timer",null)}),i);n.state.set("timer",e)}}},t.EqualsBoolean={id:"Equals (Bool)",defaultStyle:{icon:"fa-equals"},namespace:i,description:"Emits true if two values are equal (=== equality). Otherwise emits false.",inputs:{a:{description:"First value"},b:{description:"Second value"}},outputs:{result:{description:"true if a is equal to b"}},run:(e,t)=>{let{a:n,b:o}=e,{result:i}=t;return i.next(n===o)}},t.Equals={id:"Equals",namespace:i,description:'Emits the value of "a" to output "true" if "a" is equal to "b". Otherwise emits the value of "a" to output "false".',inputs:{a:{mode:"required",description:"First value"},b:{mode:"required",description:"Second value"}},outputs:{true:{description:"Emits the value of a if a is equal to b"},false:{description:"Emits the value of a if a is not equal to b"}},run:(e,t)=>{const{a:n,b:o}=e,{true:i,false:s}=t;n===o?i.next(n):s.next(n)}}},65645:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var o=n(70079),i=n(11253),s=n(74089),r=n(74762),a=n(21766);var u=n(10831),l=n(61997),c=n(77852);const d=(0,a.S)(),p=[0,20],f=e=>{let{flow:t,output:n,inputs:o,onError:s,debugDelay:a,onCompleted:u,dependencies:l,player:c}=e;const p=((e,t)=>{const n=new Set;return{onEvent:o=>{const i={...o,time:Date.now(),executionId:"n/a"};console.info("Got debugger event",o),t.addEvents([i]),e.addEvents([i]),n.forEach((e=>e([i])))},onBatchedEvents:e=>(n.add(e),()=>n.delete(e))}})(c,d);p.debugDelay=a;const f=(0,r.keys)(t.node.outputs)[0];return{executeResult:(0,r.execute)({node:t.node,inputs:o,outputs:{[f]:n},resolvedDeps:{...l,[t.node.id]:t.node},_debugger:p,onCompleted:u,onBubbleError:e=>{s(e)},extraContext:{PubSub:i}}),localDebugger:p}},m=e=>{const{debugDelay:t,onOutput:i,flowProps:a}=e,{flow:m,inputs:v,output:h}=a,g=(0,o.useRef)((0,s.createRuntimePlayer)()),[I,y]=(0,o.useState)(e.flowProps.dependencies),[b,C]=(0,o.useState)(),[_]=(0,s.useDebounce)(I,500),x=(0,c.useDarkMode)(),N=async(e,t)=>{const{node:o}=e,i=Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).find((e=>(0,r.isBaseNode)(e)&&e.id===o.id));let a;y((e=>({...e,[i.id]:{...i,source:{path:"@flyde/stdlib/dist/all-browser",export:i.id}}})));const l=(0,u.ZP)(m,(n=>{if(t){const o=(0,s.vAdd)({x:0,y:0},t.pos);if(a=(0,s.createNewNodeInstance)(e.node,0,o,I),n.node.instances.push(a),t.connectTo){const{insId:e,outputId:o}=t.connectTo;n.node.connections.push({from:{insId:e,pinId:o},to:{insId:a.id,pinId:r.TRIGGER_PIN_ID}})}}}));await new Promise((e=>setTimeout(e,10)));const c=(0,u.ZP)(j,(e=>{e.flow=l,t?.selectAfterAdding&&a&&(e.boardData.selected=[a?.id])}));return P(c),(0,s.toastMsg)(`Node ${o.id} successfully imported from ${e.module}`),I},w=async()=>({importables:Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).filter(r.isBaseNode).map((e=>({node:{...e,source:{path:"n/a",export:"n/a"}},module:"@flyde/stdlib"}))),errors:[]}),[j,P]=(0,o.useState)({flow:m,boardData:{viewPort:{pos:{x:0,y:0},zoom:1},lastMousePos:{x:0,y:0},selected:[]}});(0,o.useEffect)((()=>{P((e=>({...e,flow:m})))}),[m]),(0,o.useEffect)((()=>{y((e=>({...e,main:j.flow.node})))}),[j.flow.node]);const O={state:j,onChangeEditorState:P,hideTemplatingTips:!0,initialPadding:p,onExtractInlineNode:r.noop,disableScrolling:!0,darkMode:x.isDarkMode};(0,o.useEffect)((()=>{g.current.start()}),[]),(0,o.useEffect)((()=>{const{executeResult:n,localDebugger:o}=f({flow:j.flow,dependencies:I,output:h,inputs:v,onError:r.noop,debugDelay:t,player:g.current,onCompleted:e.onCompleted}),s=e.flowProps.output.subscribe((e=>i(e)));return C(o),()=>{n(),s.unsubscribe()}}),[t,_]);const E=(0,o.useMemo)((()=>({resolvedDependencies:I,onImportNode:N,onRequestImportables:w})),[]),D=(0,o.useMemo)((()=>({debuggerClient:b,onRequestHistory:d.requestHistory})),[b]);return o.createElement(l.Z,null,(()=>o.createElement(s.DependenciesContextProvider,{value:E},o.createElement(s.DebuggerContextProvider,{value:D},o.createElement(s.FlowEditor,O)))))}},21766:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var o=n(74762);const i=200,s=()=>{const e=new Map,t=new Map;return{requestHistory:async(n,s,r)=>{const a="input"===r?o.DebuggerEventType.INPUT_CHANGE:o.DebuggerEventType.OUTPUT_CHANGE;if(console.log({insId:n,pinId:s,type:a}),s){const t=`${n}.${s}.${a}`,o=e.get(t)||{total:0,lastSamples:[]},r=o.lastSamples.slice(0,i);return{...o,lastSamples:r}}{const e=t.get(n)||{total:0,lastSamples:[]},o=e.lastSamples.slice(0,i);return{...e,lastSamples:o}}},addEvents:n=>{n.forEach((n=>{if(n.type===o.DebuggerEventType.ERROR){const e=n;e.type=o.DebuggerEventType.OUTPUT_CHANGE,e.pinId=o.ERROR_PIN_ID}if(n.type===o.DebuggerEventType.INPUT_CHANGE||n.type===o.DebuggerEventType.OUTPUT_CHANGE){const{insId:o,type:s,pinId:r}=n;{const t=`${o}.${r}.${s}`,a=e.get(t)||{total:0,lastSamples:[]};a.lastSamples.unshift(n),a.lastSamples.length>i&&a.lastSamples.splice(i,a.lastSamples.length-i),a.total++,e.set(t,a)}{const s=t.get(o)||{total:0,lastSamples:[]};s.lastSamples.unshift(n),s.lastSamples.length>i&&s.lastSamples.splice(i,s.lastSamples.length-i),s.total++,e.set(o,s)}}}))}}}},4144:(e,t,n)=>{"use strict";n.d(t,{V:()=>r});var o=n(10328),i=n(70079);const s=e=>i.createElement("li",{className:"log-item"},i.createElement("main",{className:"content"},e.value),i.createElement("aside",null,new Date(e.time).toLocaleTimeString())),r=e=>{const[t,n]=i.useState([]);return i.useEffect((()=>{e.output.subscribe((e=>{const t="object"==typeof e&&i.isValidElement(e)?e:`${e}`;n((e=>[...e,{value:t,time:Date.now()}]))}))}),[]),i.createElement("div",{className:"output-log"},i.createElement("header",null,"Output Log"," ",i.createElement("button",{className:"clear-btn button button--outline button--secondary button--sm",onClick:()=>n([])},"Clear")),i.createElement("main",null,i.createElement("ul",null,t.map(((e,t)=>i.createElement(s,(0,o.Z)({},e,{key:t}))))),0===t.length?i.createElement("div",{className:"empty-state"},"Nothing to show. Interact with the example to emit some outputs!"):null))}},79256:(e,t,n)=>{"use strict";n.d(t,{I:()=>p});var o=n(70079),i=n(65092),s=n(19841),r=n(49794),a=n(21766),u=n(73949),l=n(81098),c=n(65645);(0,a.S)();const d=[{title:"Hello World",key:"hello-world"},{title:"React Counter",key:"react-counter"},{title:"BMI Calculator",key:"bmi"},{title:"REST API Usage",key:"apis"},{title:"Debounce vs. Throttling",key:"debounce-throttling"},{title:"Fibonacci Seq.",key:"fibonacci"}],p=e=>{const[t,n]=(0,o.useState)(e.initWidth||500),[a,p]=(0,o.useState)(e.defaultDelay||0),[f,m]=(0,o.useState)(!1),v=(0,o.useCallback)(((e,t)=>{let{size:o}=t;n(o.width)}),[]),h=o.createElement("div",{className:"delay-container"},o.createElement("input",{type:"range",id:"volume",name:"delay",value:a,step:"100",min:"0",max:"300",onChange:e=>p(Number(e.target.value))}),o.createElement("label",{htmlFor:"volume"},"Debug Delay: ",a,"ms")),g=d.findIndex((t=>t.key===e.meta.key)),I=d[g+1],y=d[g-1];return o.createElement(i.Z,{title:`${e.meta.title} | Playground`,description:`Flyde Playground - ${e.meta.title} example`},o.createElement("header",{className:(0,s.default)("hero hero--primary",u.Z.heroBanner,"playground-hero")},o.createElement("div",{className:"container"},o.createElement("h1",{className:"hero__title"},"Welcome to Flyde's Online Playground"),o.createElement("p",{className:"hero__subtitle"},"Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!"))),o.createElement("div",{className:"mobile-warning"},"Flyde is currently not optimized for mobile devices. Please"," ",o.createElement("strong",null,"use a desktop computer for the best experience"),"."),o.createElement("ul",{className:"examples__menu"},d.map((e=>o.createElement("li",{key:e.key},o.createElement(r.Z,{to:`/playground/${e.key}`,className:"button button--primary"},e.title))))),o.createElement("div",{className:"playground-container"},o.createElement("header",null,o.createElement("h2",{className:"playground-title"},e.meta.title),o.createElement("div",{className:"playground-description"},e.meta.description),f?o.createElement(o.Fragment,null,o.createElement("hr",null),o.createElement("div",{className:"playground-extra"},e.extraInfo||e.meta.extraInfo,o.createElement("div",{className:"star-hint"},o.createElement("span",null,"\xa0 PS: Did you like this example?"),"Please consider giving a \u2b50\ufe0f to the project"," ",o.createElement("span",{className:"star-wrapper"},o.createElement("iframe",{className:"gh-stars-frame",src:"https://ghbtns.com/github-btn.html?user=flydelabs&repo=flyde&type=star&count=true&size=small",width:100,height:20,title:"GitHub Stars"}))))):null,e.prefixComponent),o.createElement("div",{className:"playground"},o.createElement("div",{className:"flow-container"},!0!==e.hideDelay?h:null,o.createElement(c.Y,{flowProps:e.flowProps,debugDelay:a,onOutput:()=>m(!0)})),o.createElement(l.Resizable,{height:0,width:t,onResize:v,handle:o.createElement("div",{className:"handle"}),axis:"x",resizeHandles:["w"]},o.createElement("div",{className:"output-container",style:{flexBasis:t}},e.children))),o.createElement("nav",{className:"pagination-nav"},o.createElement("div",{className:"pagination-nav__item"},y?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${y.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Previous Example"),o.createElement("div",{className:"pagination-nav__label"},y.title)):null),o.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},I?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${I.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Next Example"),o.createElement("div",{className:"pagination-nav__label"},I.title)):null))))}},44046:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var o=n(70079),i=n(74762),s=n(79256);const r={dependencies:{Delay:{id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:"Control Flow",description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:n(43920).Delay.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Delay"}}},flow:{imports:{"@flyde/stdlib":["Delay"]},node:{instances:[{pos:{x:-249.638056640625,y:-391.20183471679684},id:"Inline-value-Hello World-673",inputConfig:{},node:{id:"Inline-value-Hello",inputs:{},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:'const result = ("Hello"); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"Hello"',dataBuilderSource:"IkhlbGxvIg==",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},style:{size:"large",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-92.58089599609374,y:-99.73132080078125},id:"clbdutwlh000c4664hu8g9uxd",inputConfig:{},node:{id:"Inline-value-World!",inputs:{},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:'const result = ("World!"); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"World!"',dataBuilderSource:"IldvcmxkISI=",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},style:{size:"large",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-53.302717285156234,y:-233.93417114257812},id:"Delay-621",inputConfig:{delay:{mode:"static",value:3e3}},nodeId:"Delay"}],connections:[{from:{insId:"Inline-value-Hello World-673",pinId:"value"},to:{insId:"__this",pinId:"output"}},{from:{insId:"clbdutwlh000c4664hu8g9uxd",pinId:"value"},to:{insId:"__this",pinId:"output"}},{from:{insId:"Inline-value-Hello World-673",pinId:"value"},to:{insId:"Delay-621",pinId:"value"}},{from:{insId:"Delay-621",pinId:"delayedValue"},to:{insId:"clbdutwlh000c4664hu8g9uxd",pinId:"__trigger"}}],id:"Main",inputs:{},outputs:{output:{type:"any",optional:!1,delayed:!1}},inputsPosition:{},outputsPosition:{result:{x:-205.4333437325436,y:70.46791651575376},output:{x:-193.31878077738958,y:61.65730860559751}}}}};var a=n(4144);const u={title:"Hello World",description:'This is the "Hello, World!" example for Flyde. When you run this flow, it will output "Hello", wait for 3 seconds, and then output "World!". Click the "Run" button below to see it in action. This example highlights one of the key strengths of Flyde: the ability to view your program running in real-time. Note that the delay in the flow is intentional and added to make the example longer.',key:"hello-world"},l='Great job. You can change the strings double-clicking them. Double click on the green "ms: 3000" to edit the delay threshold. Go ahead, try it now!';function c(){const e=(0,o.useRef)((0,i.dynamicOutput)()),t=(0,o.useRef)({__trigger:(0,i.dynamicNodeInput)()}),[n,c]=(0,o.useState)({flow:r.flow,dependencies:r.dependencies,inputs:t.current,output:e.current}),d=o.createElement("button",{className:"button button--success",onClick:()=>t.current.__trigger.subject.next("run")},"Run!");return o.createElement(s.I,{meta:u,flowProps:n,hideDelay:!0,prefixComponent:d,initWidth:300,extraInfo:l},o.createElement(a.V,{output:e.current}))}},71216:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var o=n(70079),i=n(44046);function s(){return(0,o.useEffect)((()=>{history.pushState("/playground/hello-world","Hello World","/playground/hello-world")}),[]),(0,i.default)()}},73949:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={"flyde-flow-editor":"flyde-flow-editor_AAD4",_hj_feedback_container:"_hj_feedback_container_Af03"}},85721:(e,t,n)=>{var o={"./af":47654,"./af.js":47654,"./ar":61325,"./ar-dz":98344,"./ar-dz.js":98344,"./ar-kw":26230,"./ar-kw.js":26230,"./ar-ly":42524,"./ar-ly.js":42524,"./ar-ma":44119,"./ar-ma.js":44119,"./ar-sa":82625,"./ar-sa.js":82625,"./ar-tn":42182,"./ar-tn.js":42182,"./ar.js":61325,"./az":37093,"./az.js":37093,"./be":32721,"./be.js":32721,"./bg":59919,"./bg.js":59919,"./bm":95594,"./bm.js":95594,"./bn":563,"./bn-bd":41757,"./bn-bd.js":41757,"./bn.js":563,"./bo":73211,"./bo.js":73211,"./br":87438,"./br.js":87438,"./bs":83662,"./bs.js":83662,"./ca":61196,"./ca.js":61196,"./cs":5841,"./cs.js":5841,"./cv":85251,"./cv.js":85251,"./cy":24512,"./cy.js":24512,"./da":37539,"./da.js":37539,"./de":5059,"./de-at":53853,"./de-at.js":53853,"./de-ch":99378,"./de-ch.js":99378,"./de.js":5059,"./dv":91454,"./dv.js":91454,"./el":39651,"./el.js":39651,"./en-au":87953,"./en-au.js":87953,"./en-ca":98193,"./en-ca.js":98193,"./en-gb":61980,"./en-gb.js":61980,"./en-ie":14050,"./en-ie.js":14050,"./en-il":6502,"./en-il.js":6502,"./en-in":555,"./en-in.js":555,"./en-nz":11372,"./en-nz.js":11372,"./en-sg":26568,"./en-sg.js":26568,"./eo":69533,"./eo.js":69533,"./es":68327,"./es-do":17620,"./es-do.js":17620,"./es-mx":96467,"./es-mx.js":96467,"./es-us":83272,"./es-us.js":83272,"./es.js":68327,"./et":68523,"./et.js":68523,"./eu":19066,"./eu.js":19066,"./fa":59087,"./fa.js":59087,"./fi":96443,"./fi.js":96443,"./fil":93979,"./fil.js":93979,"./fo":90383,"./fo.js":90383,"./fr":56327,"./fr-ca":25610,"./fr-ca.js":25610,"./fr-ch":97274,"./fr-ch.js":97274,"./fr.js":56327,"./fy":67442,"./fy.js":67442,"./ga":44291,"./ga.js":44291,"./gd":77342,"./gd.js":77342,"./gl":96248,"./gl.js":96248,"./gom-deva":21404,"./gom-deva.js":21404,"./gom-latn":20833,"./gom-latn.js":20833,"./gu":9122,"./gu.js":9122,"./he":74623,"./he.js":74623,"./hi":60364,"./hi.js":60364,"./hr":30860,"./hr.js":30860,"./hu":70441,"./hu.js":70441,"./hy-am":90425,"./hy-am.js":90425,"./id":29672,"./id.js":29672,"./is":96150,"./is.js":96150,"./it":27852,"./it-ch":55603,"./it-ch.js":55603,"./it.js":27852,"./ja":16465,"./ja.js":16465,"./jv":20120,"./jv.js":20120,"./ka":87245,"./ka.js":87245,"./kk":21479,"./kk.js":21479,"./km":65038,"./km.js":65038,"./kn":63060,"./kn.js":63060,"./ko":85020,"./ko.js":85020,"./ku":90582,"./ku.js":90582,"./ky":34950,"./ky.js":34950,"./lb":94201,"./lb.js":94201,"./lo":87894,"./lo.js":87894,"./lt":70120,"./lt.js":70120,"./lv":4265,"./lv.js":4265,"./me":14030,"./me.js":14030,"./mi":9463,"./mi.js":9463,"./mk":25898,"./mk.js":25898,"./ml":64233,"./ml.js":64233,"./mn":47156,"./mn.js":47156,"./mr":34479,"./mr.js":34479,"./ms":24691,"./ms-my":6456,"./ms-my.js":6456,"./ms.js":24691,"./mt":81789,"./mt.js":81789,"./my":37452,"./my.js":37452,"./nb":91170,"./nb.js":91170,"./ne":87529,"./ne.js":87529,"./nl":81776,"./nl-be":24455,"./nl-be.js":24455,"./nl.js":81776,"./nn":34705,"./nn.js":34705,"./oc-lnc":36139,"./oc-lnc.js":36139,"./pa-in":17960,"./pa-in.js":17960,"./pl":1899,"./pl.js":1899,"./pt":31670,"./pt-br":29159,"./pt-br.js":29159,"./pt.js":31670,"./ro":55115,"./ro.js":55115,"./ru":45149,"./ru.js":45149,"./sd":81231,"./sd.js":81231,"./se":35397,"./se.js":35397,"./si":99786,"./si.js":99786,"./sk":39383,"./sk.js":39383,"./sl":68691,"./sl.js":68691,"./sq":34826,"./sq.js":34826,"./sr":40080,"./sr-cyrl":75673,"./sr-cyrl.js":75673,"./sr.js":40080,"./ss":54309,"./ss.js":54309,"./sv":52245,"./sv.js":52245,"./sw":8967,"./sw.js":8967,"./ta":10454,"./ta.js":10454,"./te":35204,"./te.js":35204,"./tet":81571,"./tet.js":81571,"./tg":15737,"./tg.js":15737,"./th":41786,"./th.js":41786,"./tk":50511,"./tk.js":50511,"./tl-ph":14828,"./tl-ph.js":14828,"./tlh":62422,"./tlh.js":62422,"./tr":97047,"./tr.js":97047,"./tzl":90792,"./tzl.js":90792,"./tzm":67730,"./tzm-latn":59963,"./tzm-latn.js":59963,"./tzm.js":67730,"./ug-cn":42535,"./ug-cn.js":42535,"./uk":33151,"./uk.js":33151,"./ur":22750,"./ur.js":22750,"./uz":61914,"./uz-latn":60231,"./uz-latn.js":60231,"./uz.js":61914,"./vi":55517,"./vi.js":55517,"./x-pseudo":64078,"./x-pseudo.js":64078,"./yo":70046,"./yo.js":70046,"./zh-cn":81832,"./zh-cn.js":81832,"./zh-hk":90953,"./zh-hk.js":90953,"./zh-mo":38236,"./zh-mo.js":38236,"./zh-tw":71001,"./zh-tw.js":71001};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=s,e.exports=i,i.id=85721}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7998,5976],{19121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cappedArrayDebounce=void 0;t.cappedArrayDebounce=function(e,t,n,o){void 0===o&&(o=500);let i=[],s=null,r=null;return{addItem:a=>{clearTimeout(s),i.push(a),r||(r=setTimeout((()=>{e(i),clearTimeout(s),r=null}),o)),i.length>=n?(e(i),clearTimeout(r),r=null,i=[]):s=setTimeout((()=>{e(i),clearTimeout(r),r=null,i=[]}),t)},flush:()=>{i.length&&(e(i),i=[],clearTimeout(r))},pendingItems:()=>i.length}}},59792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.dataShaper=t.DataShapeType=void 0,function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.ARRAY=3]="ARRAY",e[e.OBJECT=4]="OBJECT",e[e.NULL=5]="NULL",e[e.UNSUPPORTED=6]="UNSUPPORTED"}(n=t.DataShapeType||(t.DataShapeType={}));const o={string:n.STRING,number:n.NUMBER,boolean:n.BOOLEAN,object:n.OBJECT,array:n.ARRAY,null:n.NULL,symbol:n.UNSUPPORTED,undefined:n.UNSUPPORTED,function:n.UNSUPPORTED,bigint:n.UNSUPPORTED};t.dataShaper=function(e,n,i){void 0===n&&(n=5),void 0===i&&(i=5);const s=null===(r=e)?"null":typeof r;var r,a;if("object"===s){if(Array.isArray(e))return n>1?e.filter(((e,t)=>t(0,t.dataShaper)(e,n-1,i))):o.array;if(n>1){const o={};for(const s in e)o[s]=(0,t.dataShaper)(e[s],n-1,i);return a=o,Object.keys(a).sort().reduce(((e,t)=>(e[t]=a[t],e)),{})}return o.object}return o[s]}},23046:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.debugLogger=void 0;const i=(0,o(n(55899)).default)("flyde");t.debugLogger=e=>i.extend(e)},24331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullInsIdPath=void 0,t.fullInsIdPath=function(e,t){if(!e)throw new Error("insId is not defined");return t?`${t}.${e}`:e}},34459:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hashFlow=t.hashNode=void 0;const i=o(n(68805)),s=n(30292),r=e=>(0,i.default)(e);t.hashNode=function(e,t){var n;void 0===t&&(t=!0);const{id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l}=e,c={id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l};if((0,s.isVisualNode)(e)){const{instances:n,connections:o,inputsPosition:i,outputsPosition:s}=e,a=n.map((e=>{const{pos:t,...n}=e;return n})),u=t?{}:{inputsPosition:i,outputsPosition:s},l=t?a:n;l.sort(((e,t)=>e.id.localeCompare(t.id)));const d=[...o];d.sort(((e,t)=>{const n=`${e.from.insId}.${e.from.pinId}`,o=`${t.from.insId}.${t.from.pinId}`;return n.localeCompare(o)}));const p=JSON.stringify({instancesToUse:l,conns:d,...c,maybeIoPos:u});return r(p)}if((0,s.isInlineValueNode)(e)){const{customViewCode:t}=e,o=null!==(n=e.fnCode)&&void 0!==n?n:e.runFnRawCode,i=JSON.stringify({fnCode:o,customViewCode:t,...c});return r(i)}throw new Error("Hashing code nodes unsupported")};t.hashFlow=e=>{const{node:n,imports:o}=e,i=(0,t.hashNode)(n,!1),s=Object.entries(null!=o?o:{}).sort(((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)})).map((e=>{let[t,n]=e;return[t,n.sort()]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{}),a=JSON.stringify(s);return r(i+a)}},86873:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DepGraph=void 0,i(n(3172),t),i(n(59962),t),i(n(23046),t),i(n(19121),t),i(n(59962),t),i(n(34459),t),i(n(39043),t),i(n(59792),t),i(n(24331),t),t.DepGraph=n(60359).DepGraph},3172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testDataCreator=void 0;t.testDataCreator=e=>function(t){void 0===t&&(t={});return{..."function"==typeof e?e():e,...t}}},59962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplePluralize=t.eventually=t.delay=t.noop=t.removeDupes=t.ensure=t.isOptionalType=t.callFnOrFnPromise=t.isPromise=t.isDefined=t.containsAll=t.shuffle=t.randomInts=t.repeat=t.pickRandom=t.randomPos=t.randomInt=t.pickSecond=t.pickFirst=t.fromEntries=t.entries=t.okeys=t.values=t.keys=t.filterOMap=t.mapOMap=t.middlePos=t.calcCenter=t.intersectRect=void 0;t.intersectRect=(e,t)=>{const n=e.x+e.w,o=t.x+t.w;return!(t.x>n||oe.y+e.h||t.y+t.h{let{w:t,h:n,x:o,y:i}=e;return{x:o+t/2,y:i+n/2}};t.middlePos=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});t.mapOMap=(e,n)=>(0,t.entries)(e).map((e=>{let[t,o]=e;return[t,n(t,o)]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.filterOMap=(e,n)=>(0,t.entries)(e).filter((e=>{let[t,o]=e;return n(t,o)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.keys=e=>Object.keys(e);t.values=e=>Object.values(e),t.okeys=t.keys;t.entries=e=>(0,t.okeys)(e).map((t=>[t,e[t]]));t.fromEntries=e=>e.reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.pickFirst=e=>e[0];t.pickSecond=e=>e[1];t.randomInt=function(e,t){void 0===t&&(t=0);const n=Math.random();return t+Math.floor((e-t)*n)};t.randomPos=function(e,n){void 0===e&&(e=1e3),void 0===n&&(n=0);return{x:(0,t.randomInt)(e,n),y:(0,t.randomInt)(e,n)}};t.pickRandom=e=>e[(0,t.randomInt)(e.length)];t.repeat=(e,t)=>"x".repeat(e).split("").map(((e,n)=>t(n)));t.randomInts=function(e,n,o){return void 0===n&&(n=100),void 0===o&&(o=0),(0,t.repeat)(e,(()=>(0,t.randomInt)(n,o)))};t.shuffle=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t};t.containsAll=(e,t)=>t.every((t=>e.includes(t)));t.isDefined=e=>void 0!==e;t.isPromise=e=>e&&"function"==typeof e.then;t.callFnOrFnPromise=(e,n)=>{if(!(0,t.isDefined)(e))return;const o=e=>{try{e()}catch(t){console.error(n,t)}};"function"==typeof e?o(e):Promise.resolve(e).then((e=>{"function"==typeof e&&o(e)}))};t.isOptionalType=e=>/\?$/.test(e);t.ensure=(e,t)=>{if(void 0===e)throw new Error(t||"Undefined value passed");return e};t.removeDupes=e=>Array.from(new Set(e));t.noop=()=>{};t.delay=e=>new Promise((t=>setTimeout(t,e)));t.eventually=async function(e,n,o,i){if(void 0===n&&(n=1e3),void 0===o&&(o=100),void 0===i&&(i=new Set),n<0){const e=Array.from(i).reduce(((e,t,n)=>`${e}\n\t\t${n+1}. ${t}`),"");throw new Error(`[Eventually timeout exceeded after: timeout with error]: ${e}`)}try{await e()}catch(s){const r=Date.now();await(0,t.delay)(o);const a=Date.now()-r;return i.add(null==s?void 0:s.message),(0,t.eventually)(e,n-a,o,i)}},t.simplePluralize=function(e,t){return`${e} ${t}${1!==e?"s":""}`}},39043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileObjectTemplate=t.compileStringTemplate=void 0;t.compileStringTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=new RegExp("\\$\\{"+e+"\\}","g");n=n.replace(i,o)})),n};t.compileObjectTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=JSON.stringify(o),s=new RegExp('"\\$\\$\\{'+e+'\\}"',"g"),r=new RegExp("\\$\\{"+e+"\\}","g"),a="string"==typeof o?o.replace(/"/g,((e,t,n)=>"\\"!==n[t-1]?'\\"':n[t])):o;n=n.replace(s,i).replace(r,a).replace(/\n/g,"\\n")})),JSON.parse(n)}},69150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connection=t.connectionData=t.connectionDataEquals=t.connectionNodeEquals=t.connectionNode=t.externalConnectionNode=t.isInternalConnection=t.isExternalConnection=t.isInternalConnectionNode=t.isExternalConnectionNode=t.getNodeOutputs=t.getOutputName=t.getInputName=t.getNodeInputs=t.TRIGGER_PIN_ID=t.ERROR_PIN_ID=t.THIS_INS_ID=void 0;const o=n(30292);t.THIS_INS_ID="__this",t.ERROR_PIN_ID="__error",t.TRIGGER_PIN_ID="__trigger";t.getNodeInputs=e=>({...e.inputs,[t.TRIGGER_PIN_ID]:(0,o.nodeInput)()});t.getInputName=e=>e===t.TRIGGER_PIN_ID?"Trigger Node":e;t.getOutputName=e=>e===t.ERROR_PIN_ID?"Error":e;t.getNodeOutputs=e=>({...e.outputs,[t.ERROR_PIN_ID]:(0,o.nodeOutput)()});t.isExternalConnectionNode=e=>e&&e.insId===t.THIS_INS_ID;t.isInternalConnectionNode=e=>e.insId!==t.THIS_INS_ID;t.isExternalConnection=e=>{let{from:n,to:o}=e;return(0,t.isExternalConnectionNode)(n)||(0,t.isExternalConnectionNode)(o)};t.isInternalConnection=e=>!(0,t.isExternalConnection)(e);t.externalConnectionNode=e=>({insId:t.THIS_INS_ID,pinId:e});t.connectionNode=(e,t)=>({insId:e,pinId:t});t.connectionNodeEquals=(e,t)=>e.insId===t.insId&&e.pinId===t.pinId;t.connectionDataEquals=(e,n)=>!(!e||!n)&&((0,t.connectionNodeEquals)(e.from,n.from)&&(0,t.connectionNodeEquals)(e.to,n.to)),t.connectionData=function(e,n,o){const i="string"==typeof e?e.split("."):e,s="string"==typeof n?n.split("."):n;if(i.length>2||s.length>2)throw new Error(`invalid source or target to connection data - ${e} / ${n}`);return{from:2===i.length?(0,t.connectionNode)(i[0],i[1]):(0,t.externalConnectionNode)(i[0]),to:2===s.length?(0,t.connectionNode)(s[0],s[1]):(0,t.externalConnectionNode)(s[0]),delayed:o}};t.connection=function(e,t,n){return void 0===n&&(n=!1),{from:e,to:t,delayed:n}}},6775:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;const s=n(30292),r=n(47025),a=n(86873),u=n(69150);i(n(69150),t);t.connect=function(e,t,n,o,i,l,c,d){void 0===n&&(n={}),void 0===i&&(i={}),void 0===l&&(l=a.noop),void 0===c&&(c={}),void 0===d&&(d={});const{id:p,connections:f,instances:m}=e,v=p||"connected-node"+(0,a.randomInt)(999);return{inputs:e.inputs,outputs:e.outputs,id:v,completionOutputs:e.completionOutputs,reactiveInputs:e.reactiveInputs,run:(p,h)=>{let g=[];const I=new a.DepGraph({}),y=new Map,b=new Map,C=new Map,_=new Map,x=new Map,N=new Map;let w;const j=new Set;m.forEach((e=>{const n=(0,s.getNode)(e,t),o=e.id;y.set(e,o),b.set(o,e),I.addNode(o);const i=Object.keys(n.inputs),r=Object.keys(n.outputs),a={},l={};i.forEach((t=>{const n=(e.inputConfig||{})[t]||(0,s.queueInputPinConfig)();(0,s.isStaticInputPinConfig)(n)?a[t]=(0,s.staticNodeInput)(n.value):a[t]=(0,s.dynamicNodeInput)({config:n})})),a[u.TRIGGER_PIN_ID]=(0,s.dynamicNodeInput)({config:(0,s.queueInputPinConfig)()});if(f.some((t=>(0,u.isInternalConnectionNode)(t.to)&&t.to.insId===e.id&&t.to.pinId===u.TRIGGER_PIN_ID))&&e.inputConfig&&e.inputConfig[u.TRIGGER_PIN_ID])throw"Trigger connection can not be configured";r.forEach((e=>{const t=(0,s.dynamicOutput)();l[e]=t}));f.some((t=>(0,u.isInternalConnectionNode)(t.from)&&t.from.insId===e.id&&t.from.pinId===u.ERROR_PIN_ID))&&(l[u.ERROR_PIN_ID]=(0,s.dynamicOutput)()),C.set(o,a),_.set(o,l)}));const P=new Set;return f.forEach((n=>{const{from:o,to:i}=n,{insId:r,pinId:a}=o,{insId:l,pinId:c}=i,d=_.get(r),p=C.get(l);if((0,u.isInternalConnectionNode)(i)&&P.add(`${i.insId}.${i.pinId}`),(0,u.isExternalConnection)(n)){if((0,u.isExternalConnectionNode)(o)){const e=null==p?void 0:p[i.pinId];if(!e)throw new Error(`Input ${i.pinId} of instance ${l} not found`);const t=x.get(o.pinId)||[];t.push(e),x.set(o.pinId,t)}else{let e=null==d?void 0:d[o.pinId];if(!e)throw new Error(`Output ${o.pinId} of instance ${r} not found`);const t=N.get(i.pinId)||[];t.push(e),N.set(i.pinId,t)}return}if(!d)throw new Error(`No outputs found for instance [${r}]`);if(!p)throw b.has(l)?new Error(`No inputs found for instance [${l}]`):new Error(`Instance with id [${l}] does not exist!`);const f=d[a];if(!f)throw new Error(`Output source - [${a}] not found in node [${v}]`);const m=p[c],h=b.get(r);if(!h&&r!==u.THIS_INS_ID)throw new Error(`Instance [${r}] does not exist! failed to connect [${o}] -> [${i}]`);const y=(h?(0,s.getNode)(h,t):e).outputs[a];if(y&&y.delayed||n.delayed||r!==u.THIS_INS_ID&&l!==u.THIS_INS_ID&&I.addDependency(r,l),!m)throw new Error(`Target arg - [${i}] not found in node [${v}]`);const w=f.subscribe((async e=>{if(!(0,s.isDynamicInput)(m))throw console.info(m),new Error(`Impossible state listening to non dynamic input - ${l}.${c}`);m.subject.next(e)}));g.push((()=>w.unsubscribe()))})),(0,a.okeys)(h).forEach((e=>{(N.get(e)||[]).forEach((t=>{const n=t.subscribe((async t=>{if(!h[e])throw new Error(`Impossible state - output ${e} does not exist`);h[e].next(t)}));g.push((()=>n.unsubscribe()))}))})),I.overallOrder().map((e=>b.get(e))).forEach((e=>{const a=C.get(e.id),u=_.get(e.id),p=(0,s.getNode)(e,t);if(!a)throw new Error(`Unexpected error - args not found when running ${e}`);if(!u)throw new Error(`Unexpected error - outputs not found when running ${e}`);for(const t in a){const n=e.inputConfig[t];P.has(`${e.id}.${t}`)||(0,s.isStaticInputPinConfig)(n)||delete a[t]}const f=(0,r.execute)({node:p,inputs:a,outputs:u,resolvedDeps:t,_debugger:n,insId:e.id,extraContext:d,mainState:i,ancestorsInsIds:o,onBubbleError:l,onCompleted:()=>{return t=e.id,j.delete(t),void(0===j.size&&w&&w());var t},onStarted:()=>{return t=e.id,void j.add(t);var t},env:c});g.push(f)})),Object.keys(p).forEach((async e=>{(x.get(e)||[]).forEach((t=>{const n=p[e];if(!(0,s.isDynamicInput)(t))throw new Error(`Unsure what to do with key ${e}, input: ${t} of ins ${o}`);(0,a.isDefined)(n)&&t.subject.next(n)}))})),void 0===e.completionOutputs&&j.size>0?new Promise((e=>{w=e})):()=>g.forEach((e=>{try{e()}catch(t){console.error("error unsubscribing",t)}}))}}}},26488:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MINOR_DEBUGGER_EVENT_TYPES=t.MAJOR_DEBUGGER_EVENT_TYPES=t.DebuggerEventType=void 0,function(e){e.INPUT_CHANGE="i",e.OUTPUT_CHANGE="o",e.PROCESSING_CHANGE="pc",e.ERROR="err",e.INPUTS_STATE_CHANGE="isc"}(n=t.DebuggerEventType||(t.DebuggerEventType={})),t.MAJOR_DEBUGGER_EVENT_TYPES=[n.INPUT_CHANGE,n.OUTPUT_CHANGE,n.ERROR],t.MINOR_DEBUGGER_EVENT_TYPES=[n.PROCESSING_CHANGE,n.INPUTS_STATE_CHANGE]},43686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatEvent=void 0;const o=n(26488);t.formatEvent=function(e){var t,n,i;const s=[e.insId,...null!==(n=null===(t=e.ancestorsInsIds)||void 0===t?void 0:t.split("."))&&void 0!==n?n:[]];(null===(i=e.ancestorsInsIds)||void 0===i?void 0:i.length)>0&&e.ancestorsInsIds;const r=`Node <${e.nodeId}> `,a=`(${s.join(" -> ")})`;return`${r} - ${function(e){switch(e.type){case o.DebuggerEventType.PROCESSING_CHANGE:return e.val?"started processing":"stopped processing";case o.DebuggerEventType.INPUT_CHANGE:return`Input pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.OUTPUT_CHANGE:return`Output pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.INPUTS_STATE_CHANGE:return`Inputs queue size changed to ${Object.entries(e.val).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join(", ")}`;case o.DebuggerEventType.ERROR:return`Error: ${e.val}`}}(e)} ${a}`}},99896:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26488),t),i(n(43686),t)},47025:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.GLOBAL_STATE_NS=t.ROOT_INS_ID=t.INPUTS_STATE_SUFFIX=t.INNER_STATE_SUFFIX=void 0;const s=n(62600),r=n(87794);i(n(99896),t);const a=n(30292),u=n(6775),l=n(84479),c=n(86873),d=n(23046),p=n(30292),f=n(99896),m=n(79804);t.INNER_STATE_SUFFIX="_inner",t.INPUTS_STATE_SUFFIX="_inputs";t.ROOT_INS_ID="__root",t.GLOBAL_STATE_NS="____global";t.execute=e=>{let{node:n,inputs:o,outputs:i,resolvedDeps:v,_debugger:h={},insId:g=t.ROOT_INS_ID,extraContext:I={},mainState:y={},ancestorsInsIds:b,onBubbleError:C=s.noop,env:_={},onCompleted:x=s.noop,onStarted:N=s.noop}=e;const w=[];y[t.GLOBAL_STATE_NS]||(y[t.GLOBAL_STATE_NS]=new Map);const j={...I,ENV:_},P=(0,m.customNodesToNodesCollection)(v,j),O=e=>{const t=e instanceof a.NodeInstanceError?e:new a.NodeInstanceError(e,(0,c.fullInsIdPath)(g,b),n.id);h.onEvent&&h.onEvent({type:f.DebuggerEventType.ERROR,val:t,insId:g,ancestorsInsIds:b,nodeId:n.id}),i[u.ERROR_PIN_ID]?i[u.ERROR_PIN_ID].next(t):C(t)},E=(e=>(0,a.isVisualNode)(e)?(0,u.connect)(e,P,h,(0,c.fullInsIdPath)(g,b),y,O,_,I):(0,a.isInlineValueNode)(e)?(0,m.inlineValueNodeToNode)(e,j):e)(n),D=h.onEvent||s.noop,S={},M={};(0,c.entries)(o).forEach((e=>{let[t,o]=e;if((0,a.isDynamicInput)(o)){const e=(0,a.dynamicNodeInput)({config:o.config}),i=o.subject.subscribe((async o=>{const i=D({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o,ancestorsInsIds:b,nodeId:n.id});if(i){const t=await i.valuePromise;e.subject.next(t)}else h.debugDelay&&await(0,c.delay)(h.debugDelay),e.subject.next(o)}));w.push((()=>i.unsubscribe())),M[t]=e}else{D({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o.config.value,ancestorsInsIds:b,nodeId:n.id});const e=(0,a.staticNodeInput)((0,a.getStaticValue)(o.config.value,P,g));M[t]=e}})),(0,c.entries)(i).forEach((e=>{let[t,o]=e;const i=(0,a.dynamicOutput)(),s=i.subscribe((async e=>{const i=D({type:f.DebuggerEventType.OUTPUT_CHANGE,insId:g,pinId:t,val:e,ancestorsInsIds:b,nodeId:n.id});if(i){const e=await i.valuePromise;o.next(e)}else o.next(e)}));w.push((()=>s.unsubscribe())),S[t]=i}));const T=(e=>{var n,o;const{node:i,inputs:u,outputs:m,resolvedDeps:v,_debugger:h,insId:g,ancestorsInsIds:I,mainState:y,onError:b,onStarted:C,onCompleted:_,env:x,extraContext:N}=e,{run:w,fn:j}=i,P=(0,d.debugLogger)("core"),O=[];let E;const D=(null==h?void 0:h.onEvent)||s.noop,S=(0,c.fullInsIdPath)(g,I),M=`${S}${t.INNER_STATE_SUFFIX}`,T=`${S}${t.INPUTS_STATE_SUFFIX}`,k=P.extend(S),R=y[t.GLOBAL_STATE_NS];y[M]||(y[M]=new Map),y[T]||(y[T]=new Map);let A=null!==(n=y[T])&&void 0!==n?n:new Map;const V=()=>{const e=Array.from(A.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:(0,a.isQueueInputPinConfig)(u[n].config)?null==o?void 0:o.length:1}}),{});D({type:f.DebuggerEventType.INPUTS_STATE_CHANGE,val:e,insId:g,ancestorsInsIds:I,nodeId:i.id})},$={execute:(e,n,o,i)=>(0,t.execute)({node:e,inputs:n,outputs:o,resolvedDeps:v,_debugger:h,insId:i,onCompleted:_,onStarted:C}),insId:g,state:null!==(o=y[M])&&void 0!==o?o:new Map,onCleanup:e=>{O.push(e)},onError:e=>{b(e)},context:null!=N?N:{},ancestorsInsIds:I,globalState:R};let z,H=!1;const G=(i.reactiveInputs||[]).filter((e=>{var t;return!(0,p.isStaticInputPinConfig)(null===(t=u[e])||void 0===t?void 0:t.config)})),L=()=>{var e;null===(e=y[M])||void 0===e||e.clear(),(0,c.keys)(y).filter((e=>e.startsWith(`${S}.`))).forEach((e=>{y[e]=new Map}))},F=e=>{const t=(null==e?void 0:e.key)&&G.includes(null==e?void 0:e.key);if(H&&!t);else{const o=H&&t;if((0,l.isNodeStateValid)(u,A,i)||o){let t;if(H){if(!e)throw new Error("Unexpected state, got reactive node while not processing and not valid");const n=(0,l.pullValueForExecution)(e.key,u[e.key],A,x);t={...z,[e.key]:n},V()}else t=(0,l.pullValuesForExecution)(u,A,x),z=t,V();let o=new Set,s={};if(H=!0,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),i.completionOutputs){const e=i.completionOutputs.map((e=>e.split("+"))).reduce(((e,t)=>(t.forEach((n=>{e.set(n,t)})),e)),new Map);(0,c.entries)(m).forEach((t=>{let[n,a]=t;a.pipe((0,r.first)()).subscribe((t=>{o.add(n),s[n]=t;let r=e.get(n);r&&(r.splice(r.indexOf(n),1),0===r.length&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_&&_(s),L(),(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),E=void 0,o.clear(),s={},(0,l.hasNewSignificantValues)(u,A,x,i.id)&&F()))}))}))}else(0,c.entries)(m).forEach((e=>{let[t,n]=e;n.subscribe((e=>{s[t]=e}))}));try{k("Running node %s with values %o",i.id,t),C&&C(),E=(null!=j?j:w)(t,m,$),(0,c.isPromise)(E)?E.then((()=>{void 0===i.completionOutputs&&_&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_(s),L(),(0,l.hasNewSignificantValues)(u,A,x,i.id)&&F())})).catch((e=>{b(e),H=!1,k("Error in node %s - value %e",i.id,e),D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id})})):void 0===i.completionOutputs&&_&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_(s),L())}catch(n){b(n),H=!1,k("Error in node %s - value %e",i.id,n),D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id})}const d=G.find((e=>u[e]&&(0,l.peekValueForExecution)(e,u[e],A,x,i.id)));if(d){const e=(0,l.peekValueForExecution)(d,u[d],A,x,i.id);F({key:d,value:e})}else{const e=(0,c.entries)(u).find((e=>{let[t,n]=e;const o=(0,a.isQueueInputPinConfig)(n.config),s=(0,l.peekValueForExecution)(t,n,A,x,i.id);return!!o&&(0,c.isDefined)(s)}));if(e){const[t,n]=e,o=(0,l.peekValueForExecution)(t,n,A,x,i.id);F({key:t,value:o})}}}}};F();const B=(0,l.subscribeInputsToState)(u,A,((e,t)=>{P("Got input %s - value is [%o]",e,t),V();try{F({key:e,value:t})}catch(n){b(n)}}));return O.push(B),()=>{(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),O.forEach((e=>e()))}})({node:E,inputs:M,outputs:S,resolvedDeps:P,_debugger:h,insId:g,mainState:y,ancestorsInsIds:b,onError:O,onBubbleError:C,env:_,extraContext:I,onCompleted:x,onStarted:N});return()=>{w.forEach((e=>e())),T()}}},84479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeInputsToState=t.isNodeStateValid=t.hasNewSignificantValues=t.peekValuesForExecution=t.pullValuesForExecution=t.pullValueForExecution=t.peekValueForExecution=void 0;const o=n(30292),i=n(86873),s=n(6775),r=(e,t)=>{const n=(0,o.extractStaticValue)(e);if((0,o.isEnvValue)(n)){return((e,t)=>{const n=e.split(".");let o={...t};for(let s of n){if(!o||!(0,i.isDefined)(o[s])||null===o[s])throw new Error(`Cannot find key ${e} inside obj ${t}`);o=o[s]}return o})((0,o.getEnvKeyFromValue)(n),t)}return n};t.peekValueForExecution=(e,t,n,i,s)=>{const a=n.get(e);let u;if(!t)throw new Error(`Trying to peek value of inexsting input in key "${e}" in node "${s}"`);return u=(0,o.isStaticInput)(t)?r(t,i):(0,o.isQueueInputPinConfig)(t.config)?a?[...a].shift():void 0:a,u};t.pullValueForExecution=(e,t,n,i)=>{const s=n.get(e);let a;return(0,o.isStaticInput)(t)?a=r(t,i):(0,o.isQueueInputPinConfig)(t.config)?(a=(s||[]).shift(),n.set(e,s)):(a=s,(0,o.isStickyInputPinConfig)(t.config)||n.delete(e)),a};t.pullValuesForExecution=(e,n,o)=>(0,i.entries)(e).reduce(((e,i)=>{let[s,r]=i;return e[s]=(0,t.pullValueForExecution)(s,r,n,o),e}),{});t.peekValuesForExecution=(e,n,o,s)=>(0,i.entries)(e).reduce(((e,i)=>{let[r,a]=i;return e[r]=(0,t.peekValueForExecution)(r,a,n,o,s),e}),{});t.hasNewSignificantValues=(e,n,s,r)=>(0,i.entries)(e).some((e=>{let[a,u]=e;const l=(0,o.isQueueInputPinConfig)(u.config),c=(0,t.peekValueForExecution)(a,u,n,s,r);return(0,i.isDefined)(c)&&l}));t.isNodeStateValid=(e,t,n)=>{const r=(0,i.keys)(e),a=(0,i.keys)(n.inputs).filter((e=>{var t;const o=null===(t=n.inputs[e])||void 0===t?void 0:t.mode;return!o||"required"===o}));r.includes(s.TRIGGER_PIN_ID)&&a.push(s.TRIGGER_PIN_ID);return!!(0,i.containsAll)(r,a)&&(0,i.entries)(e).filter((e=>{let[t]=e;return!!n.inputs[t]||t===s.TRIGGER_PIN_ID})).every((e=>{let[s,r]=e;var a;const u=t.get(s);return"optional"===((null===(a=n.inputs[s])||void 0===a?void 0:a.mode)||"required")||(!!(0,o.isStaticInput)(r)||((0,o.isQueueInputPinConfig)(r.config)?(0,i.isDefined)(u)&&u.length>0:(0,i.isDefined)(u)))}))};t.subscribeInputsToState=(e,t,n)=>{const s=[];return(0,i.entries)(e).forEach((e=>{let[i,r]=e;if(!r)return;if((0,o.isStaticInput)(r))return;const a=r.subject.subscribe((e=>{if((0,o.isQueueInputPinConfig)(r.config)){const o=t.get(i)||[];if(!Array.isArray(o))throw new Error(`impossible state - state of key ${i} is set but not an array`);o.push(e),t.set(i,o),n(i,e)}else t.set(i,e),n(i,e)}));s.push((()=>a.unsubscribe()))})),()=>s.forEach((e=>e()))}},5474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flydeFlowSchema=void 0;const o=n(29022),i=o.z.record(o.z.string(),o.z.string().or(o.z.array(o.z.string()))),s=o.z.strictObject({x:o.z.number(),y:o.z.number()}),r=o.z.discriminatedUnion("mode",[o.z.strictObject({mode:o.z.literal("static"),value:o.z.any()}),o.z.strictObject({mode:o.z.literal("queue")}),o.z.strictObject({mode:o.z.literal("sticky")})]),a=o.z.object({size:o.z.optional(o.z.enum(["small","regular","large"])),icon:o.z.optional(o.z.any()),color:o.z.optional(o.z.string()),cssOverride:o.z.optional(o.z.record(o.z.string()))}),u=o.z.object({pos:s.default({x:0,y:0}),id:o.z.string(),inputConfig:o.z.optional(o.z.record(o.z.string(),r)).default({}),visibleInputs:o.z.optional(o.z.array(o.z.string())),visibleOutputs:o.z.optional(o.z.array(o.z.string())),nodeId:o.z.optional(o.z.string()),node:o.z.optional(o.z.any()),style:o.z.optional(a)}).refine((e=>e.node||e.nodeId),{message:"Instance must have either an inline node or refer to a nodeId"}),l=o.z.union([o.z.string(),o.z.object({mode:o.z.enum(["required","optional","required-if-connected"]),type:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),defaultValue:o.z.optional(o.z.any())})]),c=o.z.object({type:o.z.optional(o.z.string()),optional:o.z.optional(o.z.boolean()),delayed:o.z.optional(o.z.boolean()),description:o.z.optional(o.z.string())}),d=o.z.object({id:o.z.optional(o.z.string()),inputs:o.z.record(o.z.string(),l),outputs:o.z.record(o.z.string(),c),inputsPosition:o.z.optional(o.z.record(o.z.string(),s)),outputsPosition:o.z.optional(o.z.record(o.z.string(),s)),customViewCode:o.z.optional(o.z.string()),dataBuilderSource:o.z.optional(o.z.string()),templateType:o.z.optional(o.z.string()),completionOutputs:o.z.optional(o.z.array(o.z.string())),reactiveInputs:o.z.optional(o.z.array(o.z.string())),defaultStyle:o.z.optional(a),description:o.z.optional(o.z.string()),searchKeywords:o.z.optional(o.z.array(o.z.string()))}),p=o.z.object({instances:o.z.array(u),connections:o.z.array(o.z.strictObject({from:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),to:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),delayed:o.z.optional(o.z.boolean()),hidden:o.z.optional(o.z.boolean())}))}).and(d);t.flydeFlowSchema=o.z.strictObject({imports:o.z.optional(i).default({}),node:p})},74762:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticValueVisualNode=void 0,i(n(86873),t);const s=n(30292);i(n(6775),t),i(n(47025),t),i(n(10418),t),i(n(30292),t),i(n(3320),t),i(n(79804),t),i(n(5474),t);t.isStaticValueVisualNode=e=>!!e&&!!(0,s.maybeGetStaticValueNodeId)(`${e}`)},87093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fakeVm=t.VM=t.VMScript=void 0;const o=n(86873);class i{constructor(e){this.script=e}}t.VMScript=i;class s{constructor(e){this.context=e}run(e){const t=(0,o.okeys)(this.context.sandbox),n=Object.values(this.context.sandbox);Function(...t,e.script)(...n)}}t.VM=s,t.fakeVm={VMScript:i,VM:s}},28145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVM2Instance=void 0;const o=n(87093);t.getVM2Instance=()=>o.fakeVm},79804:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.customNodesToNodesCollection=t.inlineValueNodeToNode=void 0;const i=o(n(18706)),s=n(86873),r=n(30292),a=(0,n(28145).getVM2Instance)();t.inlineValueNodeToNode=function(e,t){void 0===t&&(t={});const{runFnRawCode:n,...o}=e,u=(0,s.debugLogger)(`code-node:${e.id}`),l=`\n try {\n ${n}\n } catch (e) {\n adv.onError(e);\n }\n `,c=new a.VMScript(l),d={...o,run:(n,o,l)=>{const d=new a.VM({sandbox:{inputs:n,outputs:o,setInterval:setInterval,clearInterval:clearInterval,setTimeout:setTimeout,clearTimeout:clearTimeout,encodeURIComponent:encodeURIComponent,adv:l,log:function(){for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeWithDependencies=void 0;const o=n(30292),i=n(74762),s=n(88270);t.getNodeWithDependencies=function(e,n,r){if(void 0===r&&(r=[]),(0,o.isInlineValueNode)(e))return[e];if(r.includes(e.id))return[];const a=(0,i.removeDupes)(e.instances.filter((e=>(0,s.isRefNodeInstance)(e))).map((e=>e.nodeId)).filter((e=>n[e])));return[e,...a.flatMap((e=>{var t;return null!==(t=n[e])&&void 0!==t?t:[]})).reduce(((e,o)=>[...e,...(0,t.getNodeWithDependencies)(o,n,[...r,...a])]),[])]}},30292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88270),t),i(n(43069),t),i(n(79426),t),i(n(44535),t),i(n(18063),t),i(n(20359),t)},18063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeInstanceError=void 0;class n extends Error{constructor(e,t,n){let o="Unknown error";o="string"==typeof e?e:e instanceof Error?e.message:null!==e&&"object"==typeof e?JSON.stringify(e):String(e),super(`${o} (insId: ${t}, nodeId: ${n})`),this.name=this.constructor.name,this.message=`${o} (insId: ${t}, nodeId: ${n})`,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.fullInsIdsPath=t,this.nodeId=n}}t.NodeInstanceError=n},88270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInsId=t.NodeInstance=t.isRefNodeInstance=t.isInlineNodeInstance=t.inlineNodeInstance=t.nodeInstance=void 0;const o=n(36618);t.nodeInstance=(e,t,n,o)=>({id:e,nodeId:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.inlineNodeInstance=(e,t,n,o)=>({id:e,node:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.isInlineNodeInstance=e=>!!e.node;t.isRefNodeInstance=e=>!(0,t.isInlineNodeInstance)(e);t.NodeInstance=(e,t,n,o)=>({id:e,nodeId:t.id,inputConfig:n||{},pos:o||{x:0,y:0}});t.createInsId=e=>`${e.id}-${(0,o.slug)()}`},43069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvKeyFromValue=t.toEnvValue=t.isEnvValue=t.extractStaticValue=t.isStaticInput=t.isDynamicInput=t.staticNodeInput=t.dynamicNodeInputs=t.dynamicNodeInput=t.dynamicOutput=t.nodeOutputs=t.nodeOutput=t.nodeInputs=t.isInputPinOptional=t.nodeInput=void 0;const o=n(62600),i=n(30292),s=n(86873),r=n(79426);t.nodeInput=function(e){return void 0===e&&(e="required"),{mode:e}};t.isInputPinOptional=e=>"optional"===e.mode;t.nodeInputs=(e,n)=>(0,s.repeat)(e,(e=>(0,t.nodeInput)((null==n?void 0:n[e])||"required")));t.nodeOutput=function(e){return void 0===e&&(e=!1),{delayed:e}};t.nodeOutputs=e=>(0,s.repeat)(e,(()=>(0,t.nodeOutput)()));t.dynamicOutput=()=>new o.Subject,t.dynamicNodeInput=(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})));t.dynamicNodeInputs=function(e){return void 0===e&&(e=10),(0,s.repeat)(e,(()=>(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})))()))};t.staticNodeInput=e=>({config:(0,r.staticInputPinConfig)(e)});t.isDynamicInput=e=>{const t=e;return t&&t.subject&&!!t.subject.next};t.isStaticInput=e=>(0,i.isStaticInputPinConfig)(null==e?void 0:e.config);t.extractStaticValue=e=>{if((0,t.isStaticInput)(e))return e.config.value;throw new Error("Cannot extract static value from non static arg")};t.isEnvValue=e=>"string"==typeof e&&e.startsWith("$ENV.");t.toEnvValue=e=>`$ENV.${e}`;t.getEnvKeyFromValue=e=>"string"==typeof e?e.replace(/^\$ENV\./,""):e},20359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeFromFunction=t.getNodeDef=t.getNode=t.getStaticValue=t.maybeGetStaticValueNodeId=t.fromSimplified=t.inlineValueNode=t.codeNode=t.visualNode=t.isInlineValueNode=t.isVisualNode=t.isCodeNode=t.isBaseNode=t.InlineValueNodeType=void 0;const o=n(86873),i=n(88270),s=n(43069);!function(e){e.VALUE="value",e.FUNCTION="function"}(t.InlineValueNodeType||(t.InlineValueNodeType={}));t.isBaseNode=e=>e&&e.id&&e.inputs&&e.outputs;t.isCodeNode=e=>(0,t.isBaseNode)(e)&&"function"==typeof e.run;t.isVisualNode=e=>!!e.instances;t.isInlineValueNode=e=>(0,o.isDefined)(e)&&(0,o.isDefined)(e.runFnRawCode),t.visualNode=(0,o.testDataCreator)({id:"visual-node",inputs:{},outputs:{},instances:[],connections:[],outputsPosition:{},inputsPosition:{}}),t.codeNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},run:o.noop}),t.inlineValueNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},runFnRawCode:""});t.fromSimplified=e=>{let{run:t,inputTypes:n,outputTypes:i,id:s}=e;return{id:s,inputs:(0,o.entries)(n).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),outputs:(0,o.entries)(i).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),run:t}};t.maybeGetStaticValueNodeId=e=>{const t="string"==typeof e&&e.match(/^__node\:(.*)/);if(t){return t[1]}return null};t.getStaticValue=(e,n,o)=>{const i=(0,t.maybeGetStaticValueNodeId)(e);if(i){const e=n[i];if(!e)throw new Error(`Instance ${o} referrer to a node reference ${i} that does not exist`);return e}return e};t.getNode=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw new Error(`Node with id ${n} not found`);return o};t.getNodeDef=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw console.error(`Node with id ${n} not found`),new Error(`Node with id ${n} not found`);return o};t.codeFromFunction=e=>{let{id:t,fn:n,inputNames:o,outputName:i,defaultStyle:r}=e;return{id:t,inputs:o.reduce(((e,t)=>({...e,[t]:(0,s.nodeInput)()})),{}),outputs:{[i]:(0,s.nodeOutput)()},run:(e,t)=>{const s=o.map((t=>e[t])),r=t[i],a=n(...s);return Promise.resolve(a).then((e=>null==r?void 0:r.next(e)))},completionOutputs:[i],defaultStyle:r}}},44535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nodeFromSimpleFunction=void 0,t.nodeFromSimpleFunction=function(e){var t;return{...e,id:e.id,description:e.description,namespace:e.namespace,inputs:e.inputs?e.inputs.reduce(((e,t)=>{let{name:n,description:o,mode:i,defaultValue:s}=t;return{...e,[n]:{description:o,mode:null!=i?i:"required",defaultValue:s}}}),{}):{},outputs:e.output?{[e.output.name]:{description:e.output.description}}:{},defaultStyle:{icon:e.icon,size:e.size},run:null!==(t=e.fullRunFn)&&void 0!==t?t:async function(t,n,o){var i,s;const r=(null!==(i=e.inputs)&&void 0!==i?i:[]).map((e=>{let{name:n}=e;return t[n]}));try{const t=await Promise.resolve(e.run(...r));e.output&&(null===(s=n[e.output.name])||void 0===s||s.next(t))}catch(a){console.error("Error in node",a),o.onError(a)}},customViewCode:e.customViewCode}}},79426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticInputPinConfig=t.isStickyInputPinConfig=t.isQueueInputPinConfig=t.staticInputPinConfig=t.stickyInputPinConfig=t.queueInputPinConfig=t.INPUT_MODES=void 0,t.INPUT_MODES=["queue","sticky","static"];t.queueInputPinConfig=()=>({mode:"queue"});t.stickyInputPinConfig=()=>({mode:"sticky"});t.staticInputPinConfig=e=>({mode:"static",value:e});t.isQueueInputPinConfig=e=>"queue"===e.mode;t.isStickyInputPinConfig=e=>!!e&&"sticky"===e.mode,t.isStaticInputPinConfig=function(e){return!!e&&"static"===e.mode}},10418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedExecute=void 0;const o=n(74762),i=n(47025);t.simplifiedExecute=function(e,t,n,s,r){void 0===r&&(r={});const a=(0,o.keys)(e.outputs),u=Object.keys(n).reduce(((e,t)=>{const i=n[t];return{...e,[t]:(0,o.isDynamicInput)(i)?i:(0,o.staticNodeInput)(i)}}),{}),l=a.reduce(((e,t)=>{const n=(0,o.dynamicOutput)();return s&&n.subscribe((e=>{s(t,e)})),{...e,[t]:n}}),{});return(0,i.execute)({node:e,inputs:u,outputs:l,resolvedDeps:t,onBubbleError:e=>{throw e},...r})}},25779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodePreview=void 0;const o=n(35250),i=n(74762),s=n(86553);t.NodePreview=e=>{let{node:t}=e;const n={node:t,instance:(0,i.nodeInstance)("bob",t.id,{}),connections:[],viewPort:{pos:{x:0,y:0},zoom:1},resolvedDeps:{},connectionsPerInput:{},onUngroup:i.noop,onDblClick:i.noop,onDragEnd:i.noop,onDragMove:i.noop,onDragStart:i.noop,onPinClick:i.noop,onPinDblClick:i.noop,onSelect:i.noop,onTogglePinBreakpoint:i.noop,onTogglePinLog:i.noop,onToggleSticky:i.noop,displayMode:!0,onInspectPin:i.noop,onDetachConstValue:i.noop,onCopyConstValue:i.noop,onPasteConstValue:i.noop,ancestorsInsIds:"",onChangeVisibleInputs:i.noop,onChangeVisibleOutputs:i.noop,onConvertConstToEnv:i.noop,forceShowMinimized:"both",onExtractInlineNode:i.noop,onCloseInlineEditor:i.noop,isConnectedInstanceSelected:!1,inlineEditorPortalDomNode:null,onChangeStyle:i.noop,onDeleteInstance:i.noop,onGroupSelected:i.noop,onSetDisplayName:i.noop,hadError:!1,queuedInputsData:{},onPinMouseDown:i.noop,onPinMouseUp:i.noop};return(0,o.jsx)("div",{className:"node-preview",children:(0,o.jsx)(s.InstanceView,{...n})})}},30653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDarkMode=t.DarkModeProvider=void 0;const o=n(70079),i=(0,o.createContext)(!0);t.DarkModeProvider=i.Provider;t.useDarkMode=()=>(0,o.useContext)(i)},29183:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataInspectionModal=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=n(74089),p=n(83938),f=n(17102),m=n(98158);t.DataInspectionModal=e=>{var t;const{onRequestHistory:n}=(0,m.useDebuggerContext)(),{item:o}=e,[i,s]=c.default.useState(),[r,v]=c.default.useState(0),[h,g]=c.default.useState(""),[I,y]=c.default.useState(),[b]=(0,d.useDebounce)(h,300);(0,c.useEffect)((()=>{y(null==i?void 0:i.lastSamples.filter((e=>"object"==typeof e.val?JSON.stringify(e.val).includes(b):e.val.toString().includes(b)))),v(0)}),[null==i?void 0:i.lastSamples,b]),c.default.useEffect((()=>{!async function(){var e,t;const i=await n(o.insId,null===(e=o.pin)||void 0===e?void 0:e.id,null===(t=o.pin)||void 0===t?void 0:t.type);s(i)}()}),[o,n]);const C=e=>{const t=e.val;return"object"==typeof t?(0,a.jsx)(p.BrowserOnlyReactJson,{src:t}):(0,a.jsx)(u.Code,{children:t.toString()})},_=`"${o.insId}" ${(null===(t=o.pin)||void 0===t?void 0:t.id)?`(${o.pin.id})`:""}`;return(0,a.jsx)(u.Dialog,{isOpen:!0,title:`Inspecting data for instance ${_}`,onClose:e.onClose,canEscapeKeyClose:!1,className:"data-inspection-modal",children:(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{children:[i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("em",{children:[_," called ",i.total," time(s)"]}),i.total>10&&(0,a.jsx)("span",{children:"Showing last 10 samples"})]}):null,(0,a.jsx)("input",{className:"bp5-input bp5-small bp5-fill",type:"search",placeholder:"Search for values",dir:"auto",onChange:e=>g(e.target.value),value:h}),b.length>0&&(0,a.jsxs)("span",{children:["Showing ",null==I?void 0:I.length," of ",i.lastSamples.length," ",'samples matching query "',b,'"']})]}),(0,a.jsx)("main",{className:"main-wrapper",children:(()=>{if(!i)return(0,a.jsx)(f.Loader,{});if(0===i.total)return(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",(0,a.jsx)("em",{children:o.insId})," ",o.pin?(0,a.jsxs)(c.default.Fragment,{children:["and pin ",(0,a.jsx)("em",{children:o.pin.id})]}):null,". Make sure debugger is running and your program was triggered."]});const e=null==I?void 0:I[r];return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Card,{className:"content-wrapper",children:[e?(0,a.jsxs)("div",{className:"info",children:[(0,a.jsxs)("div",{children:["Showing sample ",r," of event from"," ",(0,a.jsx)("strong",{children:(0,d.timeAgo)(e.time)})," (",new Date(e.time).toLocaleString(),")"]}),(0,a.jsxs)("div",{children:["Instance: ",(0,a.jsx)("strong",{children:e.insId}),", Pin id:"," ",(0,a.jsx)("strong",{children:e.pinId})," "]}),(0,a.jsx)("div",{children:"Value:"})]}):null,C(e)]}),(0,a.jsx)(u.Menu,{className:"samples-menu",children:I.map(((e,t)=>{const n=e.pinId,o=`${i.total-t}. from pin "${n}"`;return(0,a.jsx)(u.MenuItem,{text:o,onClick:()=>v(t)},t)}))})]}):i.lastSamples.length>0&&h.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",children:['No data found for search query "',h,'"']}):(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",o.insId," ",o.pin?`and ${o.pin.id}`:"",". Make sure a debugger is connected and your program was triggered."]})})()})]})})})}},40471:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29183),t)},98158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebuggerContext=t.DebuggerContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({onRequestHistory:()=>Promise.reject(new Error("Not implemented"))});t.DebuggerContextProvider=i.Provider;t.useDebuggerContext=()=>(0,o.useContext)(i)},86125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDependenciesContext=t.DependenciesContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({resolvedDependencies:{},onImportNode:()=>Promise.reject(new Error("Not implemented")),onRequestImportables:()=>Promise.reject(new Error("Not implemented"))});t.DependenciesContextProvider=i.Provider;t.useDependenciesContext=()=>(0,o.useContext)(i)},97106:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FlowEditor=void 0;const u=n(35250),l=s(n(70079)),c=n(74762),d=n(63521),p=a(n(53865)),f=n(68120),m=n(7047),v=n(84472),h=n(82232),g=n(49283),I=n(43490),y=n(68840),b=n(78087),C=n(20079),_=n(60190),x=n(40471),N=n(98158),w=n(86125),j=n(30653),P=n(77852);r(n(43490),t),r(n(98158),t),r(n(86125),t),y.library.add(b.fab,C.fas);const O=["select","drag-move","order-step"];t.FlowEditor=l.memo(l.forwardRef(((e,t)=>{const{state:n,onChangeEditorState:o}=e,{resolvedDependencies:i,onImportNode:s}=(0,w.useDependenciesContext)(),[r,a]=l.useState([]),[y,b]=l.useState([]),{flow:C,boardData:E}=n,D=n.flow.node,[S,M]=l.useState({}),[T,k]=l.useState(new Set),{debuggerClient:R}=(0,N.useDebuggerContext)();l.useEffect((()=>{if(R)return R.onBatchedEvents((e=>{e.forEach((e=>{e.type===c.DebuggerEventType.INPUTS_STATE_CHANGE&&(console.log("INPUTS_STATE_CHANGE",e.insId,e.val),M((t=>({...t,[e.insId]:e.val})))),e.type===c.DebuggerEventType.ERROR&&k((t=>{const n=new Set(t);return n.add(e.insId),n}))}))}))}),[R]);const{openFile:A,reportEvent:V}=(0,I.usePorts)(),$=l.useCallback(((e,t)=>{console.info("onChangeFlow",t.type),"functional"===t.type&&(a([{flow:{...n.flow,...e}},...r.slice(0,50)]),b([])),o((t=>({...t,flow:{...t.flow,...e}})))}),[o,n.flow,r]),[z,H]=l.useState({instances:[],connections:[]}),[G,L]=l.useState(!1),F=l.useCallback((()=>L(!1)),[]),B=l.useCallback((()=>L(!0)),[]),q=l.useCallback((e=>{o((t=>({...t,boardData:{...t.boardData,...e}})))}),[o]);l.useEffect((()=>{q({selected:[],viewPort:d.defaultViewPort,from:void 0,to:void 0,lastMousePos:{x:0,y:0}})}),[D.id]),(0,f.useHotkeys)("cmd+z",(e=>{b([...y,n]);const[t,...i]=r;t&&(o((e=>({...e,...t}))),a(i)),e.preventDefault()}),{text:"Undo last change",group:"Editing"},[n,r,y]);const U=l.useCallback(((e,t)=>{O.some((e=>t.message.includes(e)))||b([]),$({node:e},t)}),[$]),W=l.useCallback((e=>{A({absPath:e.source.path})}),[A]),Z=l.useCallback((function(e,t){void 0===t&&(t=-1*d.NODE_HEIGHT*1.5);const n=(0,m.createNewNodeInstance)(e,t,E.lastMousePos,i);if(n){const e=(0,p.default)(C,(e=>{const t=e.node;if(!(0,c.isVisualNode)(t))throw new Error("Impossible state, adding node to non visual node");t.instances.push(n)}));return $(e,(0,h.functionalChange)("add-node")),F(),n}}),[E.lastMousePos,C,$,F,i]),J=l.useCallback((async e=>{switch(e.type){case g.OmniBarCmdType.ADD:return V("addNode",{nodeId:e.data,source:"omnibar"}),Z(e.data);case g.OmniBarCmdType.ADD_VALUE:{const e=t.current;null==e||e.requestNewInlineValue();break}case g.OmniBarCmdType.IMPORT:{await s(e.data,{pos:E.lastMousePos});const t=(0,_.vAdd)({x:0,y:0},E.lastMousePos),n=(0,m.createNewNodeInstance)(e.data.node,0,t,i),o=(0,p.default)(C,(e=>{e.node.instances.push(n)}));$(o,(0,h.functionalChange)("add-imported-node")),V("addNode",{nodeId:e.data.node.id,source:"omnibar"});break}default:v.AppToaster.show({intent:"warning",message:"Not supported yet"})}F()}),[F,V,Z,t,s,E.lastMousePos,i,C,$]),[Y,K]=l.useState(),Q=l.useCallback((()=>K(void 0)),[]),X=l.useCallback(((e,t)=>{K({insId:e,pin:t})}),[]),{isDarkMode:ee}=(0,P.useDarkMode)();return(0,u.jsx)("div",{className:"flyde-flow-editor",children:(()=>{var n;if((0,c.isInlineValueNode)(D))throw new Error("Impossible state");return(0,u.jsx)(j.DarkModeProvider,{value:null!==(n=e.darkMode)&&void 0!==n?n:ee,children:(0,u.jsxs)(l.Fragment,{children:[Y?(0,u.jsx)(x.DataInspectionModal,{item:Y,onClose:Q}):null,(0,u.jsx)(d.VisualNodeEditor,{currentInsId:c.ROOT_INS_ID,ref:t,boardData:E,onChangeBoardData:q,node:D,onGoToNodeDef:W,onChangeNode:U,resolvedDependencies:i,clipboardData:z,onCopy:H,nodeIoEditable:!D.id.startsWith("Trigger"),onInspectPin:X,onShowOmnibar:B,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:S,initialPadding:e.initialPadding,instancesWithErrors:T,disableScrolling:e.disableScrolling},D.id),G?(0,u.jsx)(g.Omnibar,{flow:C,resolvedNodes:i,onCommand:J,visible:G,onClose:F}):null]})})})()})})))},9001:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeEditor=t.renderCreateIOOption=void 0;const i=n(35250),s=o(n(70079)),r=n(74762),a=n(50382),u=o(n(53865)),l=n(70457),c=n(25779);t.renderCreateIOOption=(e,t,n)=>(0,i.jsx)(a.MenuItem,{icon:"add",text:`Create "${e}"`,active:t,onClick:n,shouldDismissPopover:!1});const d=l.MultiSelect.ofType();t.BaseNodeEditor=e=>{var n,o;const{node:l,onChange:p}=e,f=(0,r.entries)(l.inputs),m=f.filter((e=>{let[,t]=e;return"required"===t.mode})).map((e=>{let[t]=e;return t})),v=f.filter((e=>{let[,t]=e;return"optional"===t.mode})).map((e=>{let[t]=e;return t})),h=f.filter((e=>{let[,t]=e;return"required-if-connected"===t.mode})).map((e=>{let[t]=e;return t})),[g,I]=s.default.useState(!1),y=(0,r.okeys)(l.outputs),b=s.default.useCallback((e=>{p({...l,id:e})}),[l,p]),C=s.default.useCallback((e=>{let t=e?e.split(","):void 0;"[]"===e&&(t=[]),p({...l,completionOutputs:t})}),[l,p]),_=s.default.useCallback((e=>{let t=e?e.split(","):void 0;p({...l,reactiveInputs:t})}),[l,p]),x=s.default.useCallback(((e,t)=>{const n=(0,u.default)(l,(n=>{n.inputs[e]=(0,r.nodeInput)(t)}));p(n)}),[l,p]),N=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.inputs[e]}));p(t)}),[l,p]),w=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{t.outputs[e]=(0,r.nodeOutput)()}));p(t)}),[l,p]),j=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.outputs[e]}));p(t)}),[l,p]);return(0,i.jsxs)("div",{className:"base-node-editor",children:[(0,i.jsx)("div",{className:"form-row",children:(0,i.jsx)(a.FormGroup,{label:"Node Name",labelFor:"text-input",labelInfo:"(required)",children:(0,i.jsx)(a.InputGroup,{id:"node-name",disabled:e.idDisabled,placeholder:"Node ID",value:l.id,onChange:e=>b(e.target.value)})})}),(0,i.jsx)(a.FormGroup,{label:"Required Inputs",children:(0,i.jsx)(d,{selectedItems:m,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),!0!==e.hiddenOutputs?(0,i.jsx)(a.FormGroup,{label:"Outputs",children:(0,i.jsx)(d,{selectedItems:y,placeholder:"Enter output names here",items:[],tagRenderer:e=>e,onItemSelect:w,onRemove:j,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}):null,(0,i.jsx)(a.Checkbox,{checked:g,onChange:e=>I(e.target.checked),children:"Show advanced options"}),(0,i.jsxs)(a.Collapse,{isOpen:g,children:[(0,i.jsx)(a.FormGroup,{label:"Optional Inputs",children:(0,i.jsx)(d,{selectedItems:v,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"optional"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Required-if-connected Inputs",children:(0,i.jsx)(d,{selectedItems:h,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required-if-connected"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Completion Outputs",children:(0,i.jsx)(a.InputGroup,{id:"completion-outputs",placeholder:"completion outputs",value:(null===(n=l.completionOutputs)||void 0===n?void 0:n.join(","))||"",onChange:e=>C(e.target.value)})}),(0,i.jsx)(a.FormGroup,{label:"Reactive Inputs",children:(0,i.jsx)(a.InputGroup,{id:"reactive-inputs",placeholder:"Reactive inputs",value:(null===(o=l.reactiveInputs)||void 0===o?void 0:o.join(","))||"",onChange:e=>_(e.target.value)})})]}),(0,i.jsx)(a.FormGroup,{label:"Preview",children:(0,i.jsx)("div",{className:"preview-wrapper",children:(0,i.jsx)(c.NodePreview,{node:l})})})]})}},82232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metaChange=t.functionalChange=void 0;t.functionalChange=e=>({type:"functional",message:e});t.metaChange=function(e){return void 0===e&&(e="n/a"),{type:"meta",message:e}}},41032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safelyGetNodeDef=t.loadingDef=void 0;const o=n(74762);t.loadingDef={id:"Loading",inputs:{},outputs:{}};t.safelyGetNodeDef=(e,n)=>{try{return(0,o.getNodeDef)(e,n)}catch(i){const n="string"==typeof e?e:e.nodeId;return{...t.loadingDef,id:n}}}},72125:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCodeModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(68371),f=n(74762),m=n(31745),v="`Result is ${inputs.a + inputs.b}`";t.InlineCodeModal=u.memo((function(e){const{initialValue:t,initialType:n}=e,[o,i]=u.useState((0,f.isDefined)(t)?t:v),[s,r]=u.useState(n||f.InlineValueNodeType.VALUE),h=(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:['You can add variables to by referrencing the "inputs" object.',(0,a.jsx)("br",{})," For example:",(0,a.jsx)(c.Code,{children:"`Hello {inputs.name}`"}),' will expose an input pin named "name"']}),(0,a.jsxs)("p",{children:["You can also use ternery expressions, arithmetic operators and more!",(0,a.jsx)("br",{}),"For example:",(0,a.jsx)(c.Code,{children:"inputs.a > inputs.b ? inputs.a + 42 : Math.random() * inputs.b"})]})]}),g=(0,a.jsxs)("span",{children:["Type in any valid JS value, such as ",(0,a.jsx)(c.Code,{children:"true"}),", ",(0,a.jsx)(c.Code,{children:"42"}),","," ",(0,a.jsx)(c.Code,{children:'["bob", "alice", "dave"]'}),".",(0,a.jsx)("br",{})," Dynamic inputs may also be used"]}),I=(0,a.jsxs)("span",{children:["Write any JS code and return a value.",(0,a.jsx)("br",{})," The returned value will be the output.",(0,a.jsx)("br",{})," Example:",(0,a.jsx)(c.Code,{children:"const a = inputs.a; const b = inputs.b; return Math.floor(a/b);"})]}),y=(0,p.getVariables)(o);return u.useEffect((()=>{o===v&&s===f.InlineValueNodeType.FUNCTION&&i(`return ${v}`),o===`return ${v}`&&s===f.InlineValueNodeType.VALUE&&i(v)}),[o,s]),(0,a.jsxs)(c.Dialog,{isOpen:!0,title:"Inline Value / Code",onClose:e.onCancel,className:"inline-code-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:t=>{"Enter"===t.key&&t.metaKey&&e.onSubmit(s,o)},tabIndex:0,children:[(0,a.jsxs)(c.RadioGroup,{inline:!0,onChange:e=>r(e.target.value),selectedValue:s,children:[(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Value ",(0,a.jsx)(m.InfoTooltip,{content:g})]}),value:f.InlineValueNodeType.VALUE}),(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Function ",(0,a.jsx)(m.InfoTooltip,{content:I})]}),value:f.InlineValueNodeType.FUNCTION})]}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"javascript",value:o,onChange:e=>i(e||""),onMount:e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})}}),(()=>{const e=o.includes("return");return e&&s===f.InlineValueNodeType.VALUE?(0,a.jsx)(c.Callout,{intent:c.Intent.WARNING,children:'When using the "value" type you are not expected to return anything'}):e||s!==f.InlineValueNodeType.FUNCTION?null:(0,a.jsxs)(c.Callout,{intent:c.Intent.DANGER,children:['When using the "function" type you are expected to'," ",(0,a.jsx)(c.Code,{children:"return"})," a value.",(0,a.jsx)("br",{}),"Example: ",(0,a.jsx)(c.Code,{children:"return 42 + Date.now();"})]})})(),(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Input pins detected:"," ",y.length?y.map((e=>(0,a.jsx)(c.Code,{children:e},e))):"None",(0,a.jsx)(m.InfoTooltip,{content:h})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:e.onCancel,children:"Cancel"}),(0,a.jsx)(c.Button,{onClick:()=>e.onSubmit(s,o),intent:c.Intent.PRIMARY,className:"save-btn",children:"Save"})]})})]})}))},18594:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(72125),t)},68371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInlineValueNode=t.getVariables=void 0;const o=n(74762),i=n(74762);t.getVariables=e=>(e.match(/inputs\.([a-zA-Z]\w*)/g)||[]).map((e=>e.replace(/inputs\./,"")));t.createInlineValueNode=e=>{let{code:n,customView:s,nodeId:r,type:a}=e;const u=(0,t.getVariables)(n).reduce(((e,t)=>({...e,[t]:(0,o.nodeInput)()})),{}),l={value:(0,o.nodeOutput)()},c=a===o.InlineValueNodeType.FUNCTION?`const result = (function() { ${n}}());\n Promise.resolve(result).then(val => outputs.value.next(val))`:`const result = (${n}); Promise.resolve(result).then(val => outputs.value.next(val))`,d=btoa(n);return(0,i.inlineValueNode)({id:r||`Inline Code ${(0,o.randomInt)(99999)}`,inputs:u,outputs:l,runFnRawCode:c,customViewCode:s||n,dataBuilderSource:d,templateType:a,completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline "+(a===o.InlineValueNodeType.VALUE?"value":"function")})}},49283:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Omnibar=t.OmniBarCmdType=void 0;const a=n(35250),u=s(n(70079)),l=n(70457),c=n(74762),d=n(50382),p=r(n(26372));var f;!function(e){e.ADD="add",e.ADD_VALUE="add-value",e.IMPORT="import"}(f=t.OmniBarCmdType||(t.OmniBarCmdType={}));const m=[];t.Omnibar=e=>{const{resolvedNodes:t}=e,[n,o]=u.useState(""),[i,s]=u.useState(null),[r,v]=u.useState([]);u.useEffect((()=>{const e=(0,c.keys)(t).map((e=>({title:`${t[e].id}`,cmd:{type:f.ADD,data:e},extra:"current flow"}))),n=r.map((e=>({title:`${e.node.id}`,description:e.node.description,cmd:{type:f.IMPORT,data:e},extra:`${e.module}`}))),o={title:"Add inline value or code",suggestOnEmpty:!0,cmd:{type:f.ADD_VALUE}},i=[...m,...n,o,...e];s(i)}),[t,r]),u.useEffect((()=>{e.onRequestImportables&&e.onRequestImportables(n).then((e=>{v(e)}))}),[e,n]);const h=u.useCallback(((e,t)=>{let{handleClick:n,modifiers:o,query:i,index:s}=t;if(!o.matchesPredicate)return null;const r=`${e.title}`;return(0,a.jsx)(d.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,a.jsxs)("div",{className:(0,p.default)("omnibar-item",{active:o.active}),children:[(0,a.jsxs)("div",{className:"title",children:[r," ",e.extra?(0,a.jsx)("span",{className:"extra",children:e.extra}):null]}),e.description?(0,a.jsx)("div",{className:"description",children:e.description}):null]})},s)}),[]),g=u.useCallback(((e,t)=>{const n=e.toLowerCase().split("").map((e=>{return`${t=e,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*`;var t})).join(""),o=new RegExp(n);return!!t.title.toLowerCase().match(o)}),[]),I=u.useCallback((t=>{e.onCommand(t.cmd),e.onClose()}),[e]);return i?(0,a.jsx)(l.Omnibar,{query:n,onQueryChange:o,onClose:e.onClose,noResults:(0,a.jsx)(d.MenuItem,{disabled:!0,text:"No results."}),itemPredicate:g,isOpen:e.visible,items:i,initialContent:void 0,onItemSelect:I,itemRenderer:h,inputProps:{placeholder:"Search for nodes or commands.."}}):null}},60698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43490:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31874),t)},31874:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.usePorts=t.useConfirm=t.usePrompt=t.PortsContext=t.defaultPorts=void 0;const s=n(70079),r=n(74762),a=n(84472);i(n(60698),t);const u=e=>async()=>{console.warn(`${e} Not implemented`),(0,a.toastMsg)("Feature not implemented in this context yet","warning")};t.defaultPorts={prompt:async e=>{let{text:t,defaultValue:n}=e;return prompt(`${t}`,n)},openFile:async e=>{},confirm:async e=>{let{text:t}=e;return confirm(t)},readFlow:u("readFlow"),setFlow:u("setFlow"),resolveDeps:u("resolveDeps"),getImportables:u("getImportables"),onExternalFlowChange:u("onExternalFlowChange"),onInstallRuntimeRequest:u("onInstallRuntimeRequest"),onRunFlow:u("onRunFlow"),onStopFlow:u("onStopFlow"),reportEvent:r.noop,generateNodeFromPrompt:u("generateNodeFromPrompt"),hasOpenAiToken:()=>Promise.resolve(!1)},t.PortsContext=(0,s.createContext)(t.defaultPorts);t.usePrompt=()=>{const e=(0,s.useContext)(t.PortsContext).prompt;return(t,n)=>e({text:t,defaultValue:n})};t.useConfirm=()=>{const e=(0,s.useContext)(t.PortsContext).confirm;return t=>e({text:t})};t.usePorts=()=>(0,s.useContext)(t.PortsContext)},65758:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelected=void 0;const i=n(74762),s=o(n(53865)),r=n(22513);t.groupSelected=async(e,t,n,o,a)=>{const{instances:u,connections:l}=t,c=u.filter((t=>e.includes(t.id))),d=l.filter((t=>{let{from:n,to:o}=t;return-1!==e.indexOf(n.insId)||-1!==e.indexOf(o.insId)}));if(!c.length)throw new Error("visual without selections");const{visualNode:p,renamedInputs:f,renamedOutputs:m}=await(0,r.createGroup)(c,d,n,a),v=c.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),u[0].pos),h="ref"===o?(0,i.nodeInstance)((0,i.createInsId)(p),p.id,{},v):(0,i.inlineNodeInstance)((0,i.createInsId)(p),p,{},v),g=u.filter((t=>-1===e.indexOf(t.id))),I=l.map((e=>{const t=`${e.from.insId}.${e.from.pinId}`,n=`${e.to.insId}.${e.to.pinId}`;return f[n]?{...e,to:{insId:h.id,pinId:f[n]}}:m[t]?{...e,from:{insId:h.id,pinId:m[t]}}:e})).filter((t=>-1===e.indexOf(t.from.insId)&&-1===e.indexOf(t.to.insId)));return{newNode:p,currentNode:(0,s.default)(t,(e=>{e.instances=[...g,h],e.connections=I}))}}},74089:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(97106),t),i(n(18420),t),i(n(90680),t),i(n(84472),t),i(n(17102),t),i(n(82232),t),i(n(25779),t),i(n(25804),t),i(n(9958),t),i(n(68120),t),i(n(94651),t),i(n(73470),t),i(n(94007),t),i(n(60190),t),i(n(9001),t),i(n(7047),t),i(n(23386),t)},31745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoTooltip=void 0;const o=n(35250),i=n(50382),s=n(50382),r=n(44470),a=n(50382);t.InfoTooltip=e=>{const{content:t}=e;return(0,o.jsx)(s.Tooltip,{content:t,placement:"top",className:"info-tooltip",children:(0,o.jsx)(i.Icon,{icon:(0,o.jsx)(r.InfoSign,{className:a.Classes.INTENT_PRIMARY}),intent:i.Intent.SUCCESS,className:"info-tooltip-icon"})})}},83938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserOnlyReactJson=void 0;const o=n(35250);t.BrowserOnlyReactJson=e=>{if("undefined"==typeof window)return null;const t=n(73541).Z;return(0,o.jsx)(t,{...e})}},94651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsValueRenderer=void 0;const o=n(35250),i=n(74762),s=n(83938);t.AnalyticsValueRenderer=e=>{let{val:t}=e;try{const e=JSON.parse(t),n="object"==typeof e?e:{value:e},r=e&&[e.type,e.key,e.props,e.ref].every(i.isDefined),a=r?{jsxValue:e}:n;return(0,o.jsx)(s.BrowserOnlyReactJson,{src:a,collapseStringsAfterLength:50,collapsed:r})}catch(n){return(0,o.jsx)(s.BrowserOnlyReactJson,{src:{value:t},collapseStringsAfterLength:50})}}},22513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=void 0;const o=n(74762),i=n(74762),s=n(60190),r=n(88593);t.createGroup=async(e,t,n,a)=>{if(0===e.length)throw new Error("cannot create group without instances");const u=e.map((e=>e.id)),l=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return!t&&n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.to,e.to)))===t)),c=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return t&&!n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.from,e.from)))===t));let d={},p={},f={},m={};const v=[],h={};for(const o of l){const e=`${o.to.insId}.${o.to.pinId}`,t=`${o.from.insId}.${o.from.pinId}`,n=o.to.pinId;if(f[t]){v.push({from:(0,i.externalConnectionNode)(f[t]),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)});continue}const r=h[n]?await a(`Name this input (${n} of ${o.to.insId}) is already taken:`)||`i${(0,s.rnd)()}`:n;d[e]=r,f[t]=r,v.push({from:(0,i.externalConnectionNode)(r),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)}),h[r]=(0,i.nodeInput)()}const g={};for(const r of c){const e=`${r.to.insId}.${r.to.pinId}`,t=`${r.from.insId}.${r.from.pinId}`,n=r.from.pinId;if(m[e]){v.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(m[e])});continue}const u=g[n]?await a(`Name this output (${n} of ${r.from.insId} is already taken:`)||`i${(0,s.rnd)()}`:n;p[t]=u,m[e]=u,v.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(u)}),g[u]=(0,o.nodeOutput)()}e.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),e[0].pos);const I=t.filter((e=>u.includes(e.from.insId)&&u.includes(e.to.insId)));return{visualNode:{id:n,inputs:h,outputs:g,instances:e,defaultStyle:{size:"large",color:(0,o.pickRandom)(r.nodeStylePresetColors.map((e=>e.color)))},inputsPosition:(0,o.okeys)(h).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:0}})),{}),outputsPosition:(0,o.okeys)(g).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:400}})),{}),connections:[...I,...v],completionOutputs:(0,o.okeys)(g)},renamedInputs:d,renamedOutputs:p}}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightText=void 0;const o=n(35250);function i(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}t.highlightText=(e,t)=>{let n=0;const s=t.split(/\s+/).filter((e=>e.length>0)).map(i);if(0===s.length)return[e];const r=new RegExp(s.join("|"),"gi"),a=[];for(;;){const t=r.exec(e);if(!t)break;const i=t[0].length,s=e.slice(n,r.lastIndex-i);s.length>0&&a.push(s),n=r.lastIndex,a.push((0,o.jsx)("strong",{children:t[0]},n))}const u=e.slice(n);return u.length>0&&a.push(u),a}},17102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Loader=void 0;const o=n(35250);t.Loader=()=>(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)("svg",{width:"38",height:"38",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:"#007ec6",children:(0,o.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,o.jsxs)("g",{transform:"translate(1 1)",strokeWidth:"2",children:[(0,o.jsx)("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),(0,o.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:(0,o.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})})})},23386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;const o=n(74762);t.logger=(0,o.debugLogger)("editor")},561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadMonaco=void 0;const o=n(51848),i=n(23386);let s=!1;t.preloadMonaco=()=>{s||o.loader.init().then((()=>{(0,i.logger)("monaco preloaded"),s=!0}))}},68120:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHotkeys=t.currentHotkeys=void 0;const i=o(n(45240)),s=n(70079);t.currentHotkeys=new Map,t.useHotkeys=function(e,n,o,r,a){void 0===r&&(r=[]);const u=(0,s.useCallback)((function(){a&&!a.current||n(...arguments)}),[...r,n]);(0,s.useEffect)((()=>((0,i.default)(e,{},u),t.currentHotkeys.set(e,o),()=>{t.currentHotkeys.delete(e),i.default.unbind(e,u)})),[e,u,o])}},94007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeSessionStorage=t.safeLocalStorage=void 0,t.safeLocalStorage={getItem:function(){try{return localStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return localStorage.setItem(...arguments)}catch(e){return null}}},t.safeSessionStorage={getItem:function(){try{return sessionStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return sessionStorage.setItem(...arguments)}catch(e){return null}}}},90680:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocalStorage=t.useResizePref=t.userPreferences=t.useUserPref=void 0;const r=s(n(70079)),a=n(18420),u=n(94007);t.useUserPref=(e,n)=>{const[o,i]=r.useState((()=>{const o=t.userPreferences.getItem(e);return(0,a.isDefined)(o)?o:n}));r.useEffect((()=>{const o=t.userPreferences.getItem(e),s=(0,a.isDefined)(o)?o:n;i(s)}),[e]);return[o,n=>{t.userPreferences.setItem(e,n),i(n)}]},t.userPreferences=(()=>{const e=e=>`up.${e}`;return{getItem:t=>{const n=u.safeLocalStorage.getItem(e(t))||"",o=u.safeSessionStorage.getItem(e(t))||"";try{return JSON.parse(o||n).value}catch(i){return}},setItem:function(t,n,o){void 0===o&&(o=!1);const i=o?sessionStorage:u.safeLocalStorage;try{const o=JSON.stringify({value:n});return i.setItem(e(t),o),!0}catch(s){return console.error("Error saving user preference",s),!1}}}})();t.useResizePref=(e,n)=>{const o=`resize.${e}`;return(0,t.useUserPref)(o,n)};const l=e=>{const t=u.safeLocalStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch(n){return null}};t.useLocalStorage=(e,t)=>{const[n,o]=r.useState(l(e)||t),i=r.useCallback((t=>{u.safeLocalStorage.setItem(e,JSON.stringify({value:t})),o(t)}),[e]);return r.useEffect((()=>{l(e)||u.safeLocalStorage.setItem(e,JSON.stringify({value:t}))}),[e,t,i]),[n,i]}},60190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.totalEnergy=t.itrPhysics=t.hookes=t.coulombs=t.vToStr=t.vNorm=t.vLen=t.vSub=t.vAdd=t.vDiv=t.vMul=t.vZero=t.rnd=t.vec=t.size=void 0;t.size=(e,t)=>({width:e,height:t});t.vec=(e,t)=>({x:e,y:t});t.rnd=function(e,t){return void 0===e&&(e=100),void 0===t&&(t=0),Math.floor(Math.random()*(e-t))+t},t.vZero={x:0,y:0};t.vMul=(e,t)=>{let{x:n,y:o}=e;return{x:n*t,y:o*t}};t.vDiv=(e,n)=>{let{x:o,y:i}=e;return(0,t.vMul)({x:o,y:i},1/n)};t.vAdd=(e,t)=>({x:e.x+t.x,y:e.y+t.y});t.vSub=(e,n)=>(0,t.vAdd)(e,(0,t.vMul)(n,-1));t.vLen=e=>{let{x:t,y:n}=e;return Math.sqrt(t*t+n*n)};t.vNorm=e=>(0,t.vDiv)(e,(0,t.vLen)(e)||1);t.vToStr=e=>{let{x:t,y:n}=e;return`${t.toFixed(1)},${n.toFixed(1)}`};t.coulombs=(e,n,o)=>{const i=(0,t.vLen)((0,t.vSub)(e.p,n.p));if(0===i){const i=(0,t.vec)(2*Math.random()-1,2*Math.random()-1),s=e.m*n.m/Math.pow(10,2);return(0,t.vMul)(i,s*o)}{const s=(0,t.vNorm)((0,t.vSub)(n.p,e.p)),r=e.m*n.m/Math.pow(i+.1,2);return(0,t.vMul)(s,r*o)}};t.hookes=(e,n,o,i,s)=>{const r=(0,t.vLen)((0,t.vSub)(e.p,n.p)),a=(0,t.vNorm)((0,t.vSub)(e.p,n.p));let u=0;return ri&&(u=i-r),(0,t.vMul)(a,s*u)};t.itrPhysics=(e,n)=>{const{p:o,v:i,f:s,m:r}=n,a=(0,t.vDiv)(s,r),u=e/1e3,l=(0,t.vAdd)((0,t.vMul)(a,u),i),c=(0,t.vAdd)((0,t.vMul)(l,u),o);return{...n,p:c,v:l,f:(0,t.vec)(0,0)}};t.totalEnergy=e=>e.reduce(((e,n)=>{const o=(0,t.vLen)(n.v);return e+.5*n.m*o*o}),0)},84472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateToast=t.toastMsg=t.AppToaster=void 0;const o=n(50382);t.AppToaster=(()=>{try{return o.OverlayToaster.create({className:"app-toaster",position:o.Position.BOTTOM_RIGHT})}catch(e){return{}}})();t.toastMsg=(e,n,o)=>t.AppToaster.show({message:e,intent:n,timeout:o});t.updateToast=(e,n,o)=>t.AppToaster.show({message:n,intent:o},e)},18420:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultAnd=t.isLocal=t.fullTime=t.timeAgoFromDt=t.timeAgo=t.toString=t.isDefined=t.set=t.createOmap=t.toOmap=t.values=t.keys=t.entries=void 0;const i=n(7047),s=n(74762),r=o(n(73136));t.entries=e=>Object.keys(e).map((t=>[t,e[t]]));t.keys=e=>Object.keys(e);t.values=e=>Object.keys(e).map((t=>e[t]));t.toOmap=e=>Array.from(e.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.createOmap=function(e){return void 0===e&&(e=[]),e.reduce(((e,t)=>({...e,[t[0]]:t[1]})),{})};t.set=(e,t,n)=>{e[t]=n};t.isDefined=e=>void 0!==e;t.toString=e=>{const t=typeof e;if(""===e)return"(empty string)";if((0,i.isJsxValue)(e))return"JSX Value";if((0,s.isStaticValueVisualNode)(e))return"Embedded Node";if((0,s.isEnvValue)(e))return(0,s.getEnvKeyFromValue)(e);if("object"===t)try{const t=JSON.stringify(e);return"{}"===t?"Empty object":t}catch(n){return"Object (cannot stringify)"}return`${e}`};t.timeAgo=e=>(0,r.default)(new Date(e)).fromNow();t.timeAgoFromDt=e=>(0,r.default)(Date.now()-e).fromNow();t.fullTime=e=>(0,r.default)(new Date(e)).toString();t.isLocal=()=>location.href.includes(":300");t.preventDefaultAnd=e=>t=>{t.preventDefault(),e(t)}},67181:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ActionButton=t.ActionsMenu=t.ActionType=void 0;const r=n(35250),a=n(50382),u=n(50382),l=n(74762),c=s(n(70079)),d=n(86125),p=n(43490),f=n(68120),m=n(90680),v=n(84472),h=n(9971),g=n(47749),I=n(46334),y=n(47230),b=n(41032);var C;!function(e){e.AddNode="add-node",e.RemoveNode="remove-node",e.Group="group",e.UnGroup="un-group",e.AddInlineValue="add-inline-value",e.Inspect="inspect",e.Run="run",e.AI="ai"}(C=t.ActionType||(t.ActionType={}));t.ActionsMenu=e=>{const{onAction:n,selectedInstances:o,resolvedNodes:i,node:s,from:u,to:g,hotkeysEnabled:x,showRunFlowOptions:N}=e,{onRequestImportables:w}=(0,d.useDependenciesContext)(),[j,P]=c.default.useState(!1),[O,E]=c.default.useState(!1),[D,S]=c.default.useState(!1),[M,T]=c.default.useState(null),[k,R]=(0,m.useLocalStorage)("hideHotkeyHintMap",{}),A=(0,c.useCallback)((()=>{P(!1)}),[]),{onRunFlow:V,generateNodeFromPrompt:$,reportEvent:z}=(0,p.usePorts)(),H=(0,c.useCallback)(((e,t)=>(E(!1),V(e,t))),[V]),G=[];if(G.push(C.AddNode),G.push(C.AddInlineValue),1===o.length){const e=s.instances.find((e=>e.id===o[0]));if(e)try{const t=(0,b.safelyGetNodeDef)(e,i);(0,l.isVisualNode)(t)&&G.push(C.UnGroup)}catch(U){console.error(`Could not find node with id ${o[0]} - ${U}`)}else console.error(`Could not find instance with id ${o[0]}`)}N&&G.push(C.Run),o.length>0&&G.push(C.Group),(1===o.length||u||g)&&G.push(C.Inspect),o.length>0&&G.push(C.RemoveNode),G.push(C.AI);const L=(0,c.useCallback)(((e,t)=>{R({...k,[e]:!0}),v.AppToaster.dismiss(t)}),[k,R]),F=(0,c.useCallback)(((e,t)=>{const{hotkey:o}=_[e];if("click"===t.type&&o&&!k[o]){const t=(0,v.toastMsg)((0,r.jsxs)(r.Fragment,{children:["Did you know? you can also use the hotkey"," ",(0,r.jsx)("kbd",{className:"hotkey",children:o})," to"," ",_[e].text.replace(/^[A-Z]/,(e=>e.toLowerCase())),(0,r.jsxs)(a.Button,{minimal:!0,small:!0,onClick:()=>L(o,t),children:[" ","Don't show again"," "]})]}),"none",3e3)}switch(e){case C.AddNode:P(!0);break;case C.Run:!async function(){E(!0)}();break;case C.AI:S(!0);break;default:n({type:e,data:void 0})}}),[k,n,L,s.inputs]);Object.entries(_).forEach((e=>{let[t,n]=e;n.hotkey&&(0,f.useHotkeys)(n.hotkey,(e=>{e.preventDefault(),G.includes(t)&&(F(t,e),R({...k,[n.hotkey]:!0}))}),{text:n.text,group:"Action menu hotkeys"},[G],x)}));const B=(0,c.useCallback)((e=>{n({type:C.AddNode,data:{importableNode:e}})}),[n]),q=(0,c.useCallback)((async e=>{const t=Date.now();T(t);try{z("generateNodeFromPrompt:start",{promptLength:e.length});const o=await $({prompt:e}),{inputs:i,outputs:s}=o.importableNode.node,r=Date.now()-t;z("generateNodeFromPrompt:success",{totalTime:r,inputs:Object.keys(i),outputs:Object.keys(s)}),T(null),n({type:C.AI,data:o}),S(!1)}catch(U){T(null),v.AppToaster.show({message:"Failed to generate node",intent:"danger"}),z("generateNodeFromPrompt:failure",{error:U.message})}}),[$,n,z]);return(0,r.jsxs)("div",{className:"actions-menu",children:[G.map((e=>(0,r.jsx)(t.ActionButton,{type:e,onClick:F},e))),j?(0,r.jsx)(h.AddNodeMenu,{onRequestImportables:w,onAddNode:B,onClose:A}):null,O?(0,r.jsx)(y.RunFlowModal,{onClose:()=>E(!1),onRun:H,node:s}):null,D?(0,r.jsx)(I.PromptAIMenu,{onClose:()=>{S(!1),T(null)},onSubmit:q,submitting:null!==M,submitTime:M}):null]})};const _={[C.AddNode]:{icon:g.addNodeIcon,text:'Open the "add node" menu',hotkey:"a"},[C.RemoveNode]:{icon:g.removeNodeIcon,text:"Remove selected instances",hotkey:"backspace"},[C.Group]:{icon:g.groupIcon,text:"Group selection into a new node",hotkey:"g"},[C.UnGroup]:{icon:g.ungroupIcon,text:"Ungroup selected visual node"},[C.Inspect]:{icon:g.inspectIcon,text:"Inspect data",hotkey:"i"},[C.AddInlineValue]:{icon:g.pencilIcon,text:"Add value / inline function",hotkey:"v"},[C.Run]:{icon:g.playIcon,text:"Run flow",hotkey:"r"},[C.AI]:{icon:g.starIcon,text:"Generate new code node using AI \u2728"}},x={icon:"",text:"N/A",hotkey:void 0};t.ActionButton=e=>{var t;const{onClick:n,type:o}=e,i=(0,c.useCallback)((e=>n(o,e)),[n,o]),s=null!==(t=_[o])&&void 0!==t?t:x,a=s.hotkey?(0,r.jsxs)("span",{children:[s.text," ",(0,r.jsx)("kbd",{className:"hotkey",children:s.hotkey})]}):s.text;return(0,r.jsx)("div",{className:"action-button",onClick:i,"data-type":o,children:(0,r.jsx)(u.Tooltip,{hoverOpenDelay:100,content:a,className:"icon-wrapper",popoverClassName:"action-button-tooltip",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s.icon}})})})}},40149:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenu=t.AddNodeMenuFilterTree=void 0;const a=n(35250),u=n(50382),l=n(74762),c=r(n(26372)),d=s(n(70079)),p=n(43490),f=n(31745),m=n(17102),v=n(87935),h=n(74657),g=n(44470);t.AddNodeMenuFilterTree=u.Tree.ofType();function I(e,t,n){return[...e.external.map((e=>({id:e.module,label:e.module,hasCaret:!0,nodeData:{type:"external",module:e.module},isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module,isExpanded:n.has(e.module),childNodes:e.namespaces.map((o=>({id:`${e.module}/${o}`,label:o,hasCaret:!1,isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module&&t.namespace===o,isExpanded:n.has(`${e.module}/${o}`),nodeData:{type:"external",module:e.module,namespace:o}})))}))),{id:"internal",label:"Current Project",nodeData:{type:"internal"},isExpanded:n.has("internal"),hasCaret:!0,isSelected:"internal"===t.type,childNodes:e.internal.files.map((e=>({id:e,label:e,isSelected:"internal"===t.type&&t.file===e,hasCaret:!1,isExpanded:n.has(e),nodeData:{type:"internal",file:e}})))}]}function y(e){return/\.flyde(\.[jt]s)?$/.test(e.module)}t.AddNodeMenu=e=>{const{onRequestImportables:n,onAddNode:o,onClose:i}=e,[s,r]=d.default.useState(),[b,C]=d.default.useState([]),[_,x]=d.default.useState(new Set),[N,w]=d.default.useState(""),[j,P]=d.default.useState({type:"all"}),[O,E]=d.default.useState(null),[D,S]=d.default.useState(null),[M,T]=d.default.useState(null),k=(0,d.useCallback)((e=>{_.add(e.id),x(new Set(_))}),[_]),R=(0,d.useCallback)((e=>{_.delete(e.id),x(new Set(_))}),[_]),A=(0,d.useCallback)((e=>{o(e),i()}),[o,i]),{onInstallRuntimeRequest:V,reportEvent:$}=(0,p.usePorts)();(0,d.useEffect)((()=>{$("addNodeMenuOpen",{})}),[$]),(0,d.useEffect)((()=>{S(null==s?void 0:s.flatMap((e=>{var t,n,o;if(j)if("external"===j.type){if((e.module!==j.module||j.namespace)&&e.node.namespace!==j.namespace)return[]}else if("internal"===j.type&&(!y(e)||j.file&&e.module!==j.file))return[];if(N){const i=`${null!==(n=null===(t=e.node.searchKeywords)||void 0===t?void 0:t.join(" "))&&void 0!==n?n:[]} ${e.node.id} ${null!==(o=e.node.namespace)&&void 0!==o?o:""} ${e.node.description}`.toLowerCase().indexOf(N.toLowerCase());return-1===i?[]:[{importable:e,score:i}]}return[{importable:e,score:1}]})).sort(((e,t)=>e.score-t.score)).map((e=>{let{importable:t}=e;return t})))}),[s,j,N]),(0,d.useEffect)((()=>{n().then((e=>{let{importables:t,errors:n}=e;C(n);const o=t.filter((e=>!y(e))).reduce(((e,t)=>{var n,o,i;null!==(n=e[i=t.module])&&void 0!==n||(e[i]=[]);const s=null!==(o=t.node.namespace)&&void 0!==o?o:"";return e[t.module].includes(s)||e[t.module].push(s),e}),{}),i=t.filter(y).map((e=>e.module));E({external:Object.entries(o).map((e=>{let[t,n]=e;return{module:t,namespaces:n}})),internal:{files:i}}),r(t),x(new Set(["internal",...Object.keys(o)]))}))}),[n]);const z=(0,d.useCallback)((e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),D&&!M)return void T(D["ArrowDown"===e.key?0:D.length-1]);if(D&&M){const t=D.findIndex((e=>e===M));let n="ArrowDown"===e.key?t+1:t-1;n=n<0?D.length-1:n,n=n>=D.length?0:n,T(D[n])}break;case"Enter":M&&A(M)}}),[D,M,A]),H=(0,d.useCallback)((e=>{let{nodeData:t}=e;JSON.stringify(t)===JSON.stringify(j)?"external"===t.type?t.namespace?P({type:"external",module:t.module}):P({type:"all"}):"internal"===t.type&&(t.file?P({type:"internal"}):P({type:"all"})):P(t)}),[j]),G=!s||s.some((e=>e.module.includes("@flyde/stdlib"))),L=(0,d.useCallback)((()=>{V(),i()}),[i,V]);return(0,a.jsx)(u.Dialog,{isOpen:!0,title:"Add Node Menu",onClose:e.onClose,className:"add-node-menu",isCloseButtonShown:!0,children:(0,a.jsxs)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),children:[(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"bp5-input-group",children:[(0,a.jsx)(g.Search,{}),(0,a.jsx)("input",{className:"bp5-input",type:"search",placeholder:"Search input",dir:"auto",autoFocus:!0,onChange:e=>w(e.target.value),value:N,onKeyDown:z})]}),G?null:(0,a.jsxs)(u.Callout,{intent:u.Intent.NONE,style:{marginTop:10},children:["Using built-in @flyde/stdlib. It's recommended to explicitly install it instead."," ",(0,a.jsx)(u.Button,{minimal:!0,small:!0,intent:u.Intent.PRIMARY,onClick:L,children:"Click here to install it using npm/yarn"})]})]}),(0,a.jsx)("div",{className:"content-wrapper",children:s?(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsxs)("aside",{children:[(0,a.jsxs)("div",{className:"filter-header",children:["Filter by package"," ",(0,a.jsx)(u.Tooltip,{content:(0,a.jsxs)("span",{children:["Click to learn more about how packages work in Flyde"," "]}),hoverCloseDelay:1500,children:(0,a.jsx)("a",{target:"_blank",href:"https://www.flyde.dev/docs/packages",rel:"noreferrer",children:(0,a.jsx)(u.Icon,{icon:(0,a.jsx)(g.Help,{}),intent:"primary",iconSize:12})})})]}),(0,a.jsx)("div",{className:"tree-container",children:(0,a.jsx)(t.AddNodeMenuFilterTree,{contents:I(O,j,_),onNodeCollapse:R,onNodeExpand:k,onNodeClick:H,className:u.Classes.ELEVATION_0})})]}),(0,a.jsx)("main",{children:D?0===D.length?(0,a.jsxs)("div",{className:"no-results",children:[(0,a.jsx)(h.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:P,query:N,onChangeQuery:w,resultsCount:D.length}),(0,a.jsxs)(u.Callout,{className:"callout",intent:"primary",children:["Can't find a suitable node? Create one yourself!"," ",(0,a.jsx)("a",{href:"https://www.flyde.dev/docs/code-nodes",target:"_blank",rel:"noreferrer",children:"Learn more"})]})]}):(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsx)(h.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:P,query:N,onChangeQuery:w,resultsCount:D.length}),(0,a.jsx)("div",{className:"results",children:D.map((e=>(0,a.jsx)(v.AddNodeMenuListItem,{importableNode:e,onAdd:A,selected:(null==M?void 0:M.node)===e.node,onSelect:T,onSetFilter:P},e.node.id+e.node.namespace+e.module)))})]}):(0,a.jsx)(m.Loader,{})})]}):(0,a.jsx)(m.Loader,{})}),b.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",style:{marginTop:"10px"},children:["Found ",(0,l.simplePluralize)(b.length,"corrupt flow"),(0,a.jsx)(f.InfoTooltip,{content:b.map((e=>{let{path:t,message:n}=e;return`${t}: ${n}`})).join(", ")})," "]}):null]})})}},8470:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuListItem=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079));t.AddNodeMenuListItem=e=>{const{importableNode:t,onSetFilter:n,onAdd:o,onSelect:i}=e,{node:s,module:r}=t,{id:d,description:p}=s,f=c.default.useRef(null);c.default.useEffect((()=>{e.selected&&f.current&&f.current.scrollIntoView({block:"center"})}),[e.selected]);const m=(0,c.useCallback)((()=>{o(t)}),[o,t]),v=(0,c.useCallback)((()=>{i(t)}),[i,t]);return(0,a.jsxs)("div",{className:(0,l.default)("add-node-menu-list-item",{selected:e.selected}),ref:f,onClick:v,children:[(0,a.jsxs)("div",{className:"content",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("span",{className:"id",children:d}),(0,a.jsxs)(u.Tag,{interactive:!0,onClick:()=>n({type:"external",module:r,namespace:s.namespace}),className:"source",minimal:!0,children:[r,s.namespace?` / ${s.namespace}`:null]})]}),(0,a.jsx)("div",{className:"description",children:p||(0,a.jsx)("em",{children:"No description"})})]}),(0,a.jsx)("aside",{children:(0,a.jsx)(u.Button,{onClick:m,children:"Add"})})]})}},87935:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8470),t)},88671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuResultsSummary=void 0;const o=n(35250),i=n(50382);t.AddNodeMenuResultsSummary=e=>{const{resultsCount:t,query:n,filter:s,onChangeFilter:r,onChangeQuery:a}=e;return(0,o.jsxs)("div",{className:"add-node-menu-results-summary",children:[t?`Showing ${t} result${t>1?"s":""}`:"No results found","\xa0",n?(0,o.jsxs)(o.Fragment,{children:["matching query\xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>a(""),children:['"',n,'"']})]}):null,"all"===s.type?null:"external"===s.type?(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["package ",s.module,s.namespace?` / ${s.namespace}`:null]})]}):(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["\xa0this project ",s.file?` / ${s.file}`:null]})]})]})}},74657:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88671),t)},9971:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40149),t)},83159:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PromptAIMenu=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=1e4;t.PromptAIMenu=e=>{const{onClose:t}=e,[n,o]=c.default.useState(""),[i,s]=c.default.useState(0);return(0,c.useEffect)((()=>{s(0);const t=setInterval((()=>{s((t=>{const n=(Date.now()-e.submitTime)/d;return Math.min(n+.05*Math.random()/2,.95)}))}),500);return()=>clearInterval(t)}),[e.submitTime]),(0,a.jsxs)(u.Dialog,{isOpen:!0,onClose:t,className:"prompt-ai-menu",title:"\u2728 Generate Code Node using AI",children:[(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsx)(u.TextArea,{value:n,disabled:e.submitting,onChange:e=>o(e.target.value),placeholder:"Describe your node in details",fill:!0})}),e.submitTime?(0,a.jsx)("div",{className:"progress-bar-container",children:(0,a.jsx)(u.ProgressBar,{value:i})}):null,(0,a.jsx)("div",{className:u.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:u.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(u.Button,{onClick:t,children:"Close"}),(0,a.jsx)(u.Button,{intent:u.Intent.PRIMARY,className:"run-btn",disabled:e.submitting||!n,loading:e.submitting,onClick:()=>{s(0),e.onSubmit(n)},children:"Create \u2728"})]})})]})}},46334:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(83159),t)},3152:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RunFlowModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(90680),f=n(31745);t.RunFlowModal=u.memo((function(e){const{onRun:t,onClose:n,node:o}=e,[i,s]=u.useState(0),[r,m]=(0,p.useLocalStorage)(`run-inputs-${o.id}`,Object.keys(o.inputs).reduce(((e,t)=>(e[t]=`Enter a value for input ${t}`,e)),{})),[v,h]=u.useState(JSON.stringify(r,null,2)),g=e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})},I=u.useCallback((()=>{const e=JSON.parse(v);m(e),t(e,i)}),[t,m,v,i]),y=Object.keys(o.inputs),b=y.filter((e=>"required"!==o.inputs[e].mode)),C=u.useMemo((()=>y.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:"This node receives external inputs. Enter values for each input below:"}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"json",value:v,onChange:e=>h(null!=e?e:""),onMount:g}),b.length>0?(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Note: input(s) ",(0,a.jsx)("code",{children:b.join(", ")})," are optional"]}):null]}):(0,a.jsx)("strong",{children:"This node does not receive any external inputs."})),[y.length,b,v]);return(0,a.jsxs)(c.Dialog,{isOpen:!0,onClose:e.onClose,className:"run-flow-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&I()},tabIndex:0,children:[C,(0,a.jsxs)("div",{className:"execution-delay-wrapper",children:[(0,a.jsxs)("label",{children:["Execution delay:"," ",(0,a.jsx)(f.InfoTooltip,{content:"Delay between each node execution. Useful for debugging."})]}),(0,a.jsx)(c.Slider,{value:i,onChange:s,min:0,labelStepSize:500,stepSize:100,labelRenderer:e=>`${e}ms`,max:1e3})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:n,children:"Close"}),(0,a.jsx)(c.Button,{onClick:I,intent:c.Intent.PRIMARY,className:"run-btn",children:"Run"})]})})]})}))},47230:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3152),t)},47749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starIcon=t.stopIcon=t.playIcon=t.pencilIcon=t.ungroupIcon=t.groupIcon=t.inspectIcon=t.removeNodeIcon=t.addNodeIcon=void 0,t.addNodeIcon='\n\n',t.removeNodeIcon='\n\n',t.inspectIcon='\n\n\n',t.groupIcon='\n\n\n',t.ungroupIcon='\n\n\n',t.pencilIcon='\n\n',t.playIcon='\n\n\n',t.stopIcon='\n\n\n',t.starIcon='\n\n\n\n\n'},1237:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HelpBubble=void 0;const i=n(70079),s=n(35250),r=n(50382),a=n(99489),u=n(50382),l=o(n(70079)),c=n(68120),d=n(71644),p=n(43490),f={offset:{enabled:!0,options:{offset:[0,20]}},preventOverflow:{enabled:!0,options:{padding:10}}};const m=["Viewport Controls","Editing","Selection"];t.HelpBubble=()=>{const[e,t]=l.default.useState(!1),n=Array.from(c.currentHotkeys.entries()).map((e=>{let[t,n]=e;return{combo:(o={key:t,menuData:n}).key,label:o.menuData.text,group:o.menuData.group};var o})).reduce(((e,t)=>(e[t.group]||(e[t.group]=[]),e[t.group].push(t),e)),{}),o=Object.entries(n).sort(((e,t)=>m.indexOf(t[0])-m.indexOf(e[0]))),{reportEvent:v}=(0,p.usePorts)(),h=(0,s.jsx)(r.Dialog,{isOpen:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:r.Classes.DIALOG_BODY,children:o.map((e=>{let[t,n]=e;return(0,s.jsxs)(l.default.Fragment,{children:[(0,s.jsx)(r.H4,{children:t}),n.map((e=>(0,i.createElement)(a.Hotkey,{...e,key:e.combo})))]},t)}))})}),g=(0,s.jsxs)(r.Menu,{children:[(0,s.jsx)(r.MenuItem,{text:"Hotkeys",onClick:()=>{t(!0),v("helpMenuItem",{item:"hotkeys"})}}),(0,s.jsx)(r.MenuItem,{text:"Documentation",onClick:()=>v("helpMenuItem",{item:"documentation"}),href:"https://www.flyde.dev/docs",target:"_blank"}),(0,s.jsx)(r.MenuDivider,{}),(0,s.jsx)(r.MenuItem,{text:"Discord",onClick:()=>v("helpMenuItem",{item:"discord"}),href:"https://discord.gg/x7t4tjZQP8",target:"_blank"})]});return(0,s.jsxs)("div",{className:"help-bubble","data-tip":"Help",children:[(0,s.jsx)(u.Popover,{content:g,modifiers:f,onOpened:()=>v("helpMenuOpen",{}),children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:d.helpIcon}})}),h]})}},71644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpIcon=void 0,t.helpIcon='\n\n\n'},3354:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1237),t)},7011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainInstanceEventsIndicator=void 0;const o=n(35250),i=n(30994),s=n(66189),r=n(50382);t.MainInstanceEventsIndicator=e=>{const{currentInsId:t,ancestorsInsIds:n}=e,{history:a,refreshHistory:u,resetHistory:l}=(0,s.useHistoryHelpers)(t),c=`main-indicator-${t}}`;return(0,o.jsx)("div",{className:"main-instance-events-indicator",children:(0,o.jsx)(r.Tooltip,{content:(0,s.calcHistoryContent)(a),children:(0,o.jsx)("span",{onMouseEnter:u,onMouseOut:l,id:(0,i.getMainInstanceIndicatorDomId)(t,n),className:"status-text","data-tip":"","data-html":!0,"data-for":c})})})}},22714:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7011),t)},63521:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VisualNodeEditor=t.defaultBoardData=t.defaultViewPort=t.NODE_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=n(74762),c=n(86553),d=n(65082),p=n(18420),f=n(26701),m=n(7047),v=n(53865),h=n(70079),g=n(68120),I=r(n(27942)),y=n(50382),b=n(66005),C=n(60190),_=n(71033),x=n(74762),N=n(99942),w=n(44338),j=n(561),P=n(84472),O=n(82232),E=n(18594),D=n(68371),S=r(n(61888)),M=n(65758),T=n(43490),k=r(n(26372)),R=n(25044),A=n(80510),V=n(1788),$=n(2130),z=n(88593),H=n(97106),G=n(67181),L=n(22714),F=n(3354),B=n(41032),q=n(30653),U=u.memo(y.Slider),W=()=>null;t.NODE_HEIGHT=28;t.defaultViewPort={pos:{x:0,y:0},zoom:1},t.defaultBoardData={selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}},t.VisualNodeEditor=u.memo(u.forwardRef(((e,n)=>{const{onChangeNode:o,nodeIoEditable:i,onCopy:s,onGoToNodeDef:r,onInspectPin:J,boardData:Y,onChangeBoardData:K,currentInsId:Q,ancestorsInsIds:X,node:ee,onShowOmnibar:te,resolvedDependencies:ne,queuedInputsData:oe,initialPadding:ie,disableScrolling:se}=e,{onImportNode:re}=(0,H.useDependenciesContext)(),ae=(0,q.useDarkMode)(),{reportEvent:ue}=(0,T.usePorts)(),le=e.parentViewport||t.defaultViewPort,[ce,de]=(0,h.useState)({...ne,[ee.id]:ee});(0,h.useEffect)((()=>{de({...ne,[ee.id]:ee})}),[ne,ee]);const{selected:pe,from:fe,to:me}=Y,{instances:ve,connections:he,inputsPosition:ge,outputsPosition:Ie,inputs:ye,outputs:be}=ee,[Ce,_e]=(0,h.useState)(),[xe,Ne]=(0,h.useState)(),we=void 0===X,[je,Pe]=(0,h.useState)(0),[Oe,Ee]=(0,h.useState)(),[De,Se]=(0,h.useState)(!1),[Me,Te]=(0,h.useState)(),[ke,Re]=(0,h.useState)(),[Ae,Ve]=(0,h.useState)(),[$e,ze]=(0,h.useState)(),He=(0,h.useRef)();(0,f.useDidMount)((()=>{He.current=Xe.current.querySelector(".inline-editor-portal-root")}));const Ge=(0,T.useConfirm)(),Le=(0,T.usePrompt)(),Fe=Y.viewPort,Be=(0,h.useRef)(!0),[qe,Ue]=(0,h.useState)(null),We=u.useCallback((e=>{K({viewPort:e})}),[K]),Ze=u.useCallback(((e,t)=>J(e,t)),[J]),Je=u.useCallback(((e,t,n)=>{const i=(0,A.handleConnectionCloseEditorCommand)(ee,{from:e,to:t}),s=(0,l.isInternalConnectionNode)(t)?ve.find((e=>e.id===t.insId)):null,r=(s?s.inputConfig:{})[t.pinId],a=(0,l.isStaticInputPinConfig)(r)?(0,V.handleDetachConstEditorCommand)(i,t.insId,t.pinId):i;o(a,(0,O.functionalChange)("close-connection")),K({from:void 0,to:void 0}),ue("createConnection",{source:n})}),[ve,o,K,ee,ue]),Ye=u.useCallback((async()=>{const e=await Le("New visual node name?");if(!e)return;const{currentNode:t}=await(0,M.groupSelected)(Y.selected,ee,e,"inline",Le);o(t,(0,O.functionalChange)("group node")),(0,P.toastMsg)("Node grouped"),ue("groupSelected",{count:Y.selected.length})}),[Le,Y.selected,o,ee,ue]);(0,h.useEffect)((()=>{if(Oe){const e=setTimeout((()=>{Ee(void 0)}),350);return()=>clearTimeout(e)}}),[Oe]);const[Ke,Qe]=(0,h.useState)();(0,h.useEffect)((()=>{(0,j.preloadMonaco)()}),[]);const Xe=(0,h.useRef)(),et=(0,I.default)(Xe),tt=u.useRef({x:400,y:400}),nt=(0,f.useBoundingclientrect)(Xe)||C.vZero,ot=()=>{const e=(0,m.fitViewPortToNode)(ee,ce,et);(0,m.animateViewPort)(Fe,e,500,(e=>{We(e)}))},it=u.useCallback(((e,t)=>{const{to:n,from:o}=Y,i="input"===t?o:n,s="input"===t?n:o,r={pinId:e,insId:l.THIS_INS_ID},a="input"===t?{from:r}:{to:r};i&&i.pinId===e?K({from:void 0,to:void 0}):s?"input"===t&&n?Je(r,n,"nodeIoClick"):o&&Je(o,r,"nodeIoClick"):K(a)}),[Y,K,Je]),st=u.useCallback(((e,t,n)=>{const i=(0,v.produce)(ee,(o=>{"input"===e?o.inputs[t].description=n:o.outputs[t].description=n}));o(i,(0,O.functionalChange)("Node io description"))}),[o,ee]),rt=u.useCallback(((e,t,n)=>{const{from:o,to:i}=Y;if(fe&&fe.insId===e.id||me&&me.insId===e.id)K({from:void 0,to:void 0});else if("input"===n){const n={insId:e.id,pinId:t};!i||i.pinId!==t||(0,l.isInternalConnectionNode)(i)&&i.insId!==e.id?fe?Je(fe,n,"pinClick"):K({to:n,selected:[]}):K({to:void 0})}else{const n={insId:e.id,pinId:t};!o||o.pinId!==t||(0,l.isInternalConnectionNode)(o)&&o.insId!==e.id?me?Je(n,me,"pinClick"):K({from:n,selected:[]}):K({from:void 0})}}),[Y,fe,K,Je,me]);(0,h.useEffect)((()=>{if(!De&&et.width){const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);We(t);const n=setTimeout((()=>{const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);e.thumbnailMode||We(t),Se(!0)}),100);return()=>clearTimeout(n)}}),[ee,ie,et,e.thumbnailMode,De,ce,We]);const at=u.useCallback((()=>{const{selected:e}=Y,t=ee.instances.filter((t=>e.includes(t.id))).map((e=>({...e,id:e.id+"-copy"}))),n=ee.connections.filter((t=>{let{from:n,to:o}=t;return e.includes(n.insId)&&e.includes(o.insId)}));s({instances:t,connections:n})}),[Y,s,ee]),ut=u.useCallback((()=>{const{newNode:t,newInstances:n}=(0,R.pasteInstancesCommand)(ee,tt.current,e.clipboardData);o(t,(0,O.functionalChange)("paste instances")),K({selected:n.map((e=>e.id))})}),[o,K,ee,e.clipboardData]),lt=u.useCallback((()=>{const e=ee.id;Ke?"input"===Ke.type?Ke.ins.id===e?it(Ke.pin,"input"):rt(Ke.ins,Ke.pin,"input"):Ke.ins.id===e?it(Ke.pin,"output"):rt(Ke.ins,Ke.pin,"output"):console.warn("tried selecting closest with no pin nearby")}),[ee.id,Ke,it,rt]),ct=u.useCallback(((e,t)=>{const n=Math.min(Math.max(e,.1),3),o="mouse"===t?tt.current:{x:Fe.pos.x+et.width/2,y:Fe.pos.y+et.height/2},i=(0,m.centerBoardPosOnTarget)(o,et,n,Fe);We({...Fe,zoom:n,pos:i})}),[We,Fe,et]);(0,g.useHotkeys)("cmd+=",(e=>{ct(Fe.zoom+.1,"hotkey"),e.preventDefault()}),{text:"Zoom in board",group:"Viewport Controls"},[Fe,ct],Be),(0,g.useHotkeys)("cmd+-",(e=>{ct(Fe.zoom-.1,"hotkey"),e.preventDefault()}),{text:"Zoom out board",group:"Viewport Controls"},[ct,Fe.zoom],Be),(0,g.useHotkeys)("cmd+o",(e=>{e.preventDefault(),(0,P.toastMsg)("Ordering");const t=[];(0,N.orderVisualNode)(ee,ce,200,((e,n)=>{n%3==0&&t.push(e)})),(async()=>{for(;t.length;){const e=t.shift();(0,P.toastMsg)(`Step ${t.length}!`),await(0,l.delay)(200),o(e,(0,O.metaChange)("order-step")),(0,P.toastMsg)(`Step ${t.length}! done`)}})()}),{text:"Auto-layout (experimental)",group:"Misc."},[o,ee,ne],Be),(0,g.useHotkeys)("cmd+0",(e=>{ct(1),e.preventDefault()}),{text:"Reset zoom",group:"Viewport Controls"},[Fe,ct],Be);const dt=()=>{K({from:void 0,to:void 0,selected:[]})},pt=u.useCallback(((e,t)=>{_e(e.id),o({...ee},(0,O.metaChange)("drag-start"))}),[o,ee]),ft=u.useCallback(((e,t,n)=>{const{newValue:i,newSelected:s}=(0,m.handleInstanceDrag)(ee,e,n,t,pe,Ce);o(i,(0,O.metaChange)("drag-move")),s&&K({selected:s})}),[Ce,o,K,pe,ee]),mt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(void 0)}),[]),vt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(l.THIS_INS_ID)}),[]),ht=u.useCallback((async(t,n,o,i)=>{o.preventDefault(),o.stopPropagation();const{x:s,y:r}=i,a=(0,v.produce)(ee,(e=>{"input"===t?e.inputsPosition[n]={x:s,y:r}:e.outputsPosition[n]={x:s,y:r}}));e.onChangeNode(a,(0,O.metaChange)("node-io-drag-move"))}),[e,ee]),gt=u.useCallback((async(e,t,n,o)=>{n.preventDefault(),n.stopPropagation(),_e(void 0)}),[]),It=u.useCallback(((e,t)=>{let{id:n}=e;const o=t.shiftKey?pe.filter((e=>e!==n)):[],i=t.shiftKey?[...pe,n]:[n],s=pe.includes(n)?o:i;K({selected:s,from:void 0,to:void 0})}),[K,pe]),yt=u.useCallback((()=>{const e=ee.instances.map((e=>e.id));K({selected:e,from:void 0,to:void 0})}),[K,ee.instances]),bt=u.useCallback((e=>{const t=he.filter((t=>{let{from:n,to:o}=t;return-1===e.indexOf(n.insId)&&-1===e.indexOf(o.insId)})),n=(0,v.produce)(ee,(n=>{n.connections=t,n.instances=n.instances.filter((t=>!e.includes(t.id)))}));K({selected:[]}),o(n,(0,O.functionalChange)("delete-ins"))}),[he,o,K,ee]),Ct=u.useCallback((e=>{bt([e.id])}),[bt]),_t=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{"input"===e?(delete n.inputs[t],n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===t)))):(n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===t))),n.completionOutputs=(n.completionOutputs||[]).map((e=>e.split("+").filter((e=>e!==t)).join("+"))).filter((e=>!!e)),delete n.outputs[t])}));fe&&fe.insId===l.THIS_INS_ID&&fe.pinId===t?K({from:void 0}):me&&me.insId===l.THIS_INS_ID&&me.pinId===t&&K({to:void 0}),o(n,(0,O.functionalChange)("remove io pin"))}),[ee,fe,me,o,K]),xt=u.useCallback((async()=>{const{selected:e,from:t,to:n}=Y;0===e.length?t&&(0,l.isExternalConnectionNode)(t)?await Ge(`Are you sure you want to remove main input ${t.pinId}?`)&&_t("input",t.pinId):n&&(0,l.isExternalConnectionNode)(n)&&await Ge(`Are you sure you want to remove main output ${n.pinId}?`)&&_t("output",n.pinId):bt(e)}),[Ge,Y,bt,_t]),Nt=u.useCallback(((e,t,n)=>{const i=(0,m.getInstancePinConfig)(ee,e.id,t),s=(0,l.isStickyInputPinConfig)(i)?(0,x.queueInputPinConfig)():(0,l.stickyInputPinConfig)();o((0,m.changePinConfig)(ee,e.id,t,s),(0,O.functionalChange)("toggle-sticky")),ue("togglePinSticky",{isSticky:(0,l.isStickyInputPinConfig)(s)})}),[o,ee,ue]),wt=u.useCallback((()=>{const{newNode:e,newInstances:t}=(0,$.handleDuplicateSelectedEditorCommand)(ee,pe);o(e,(0,O.functionalChange)("duplicated instances")),K({selected:t.map((e=>e.id))})}),[o,K,ee,pe]),jt=u.useCallback((e=>{const t=e.nativeEvent.target;if(0===e.button&&Z(e.nativeEvent,ee.id)&&t&&"board-editor-inner"===t.className){if(Date.now()-je<300)return void te(e);Pe(Date.now());const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,nt),o=(0,m.domToViewPort)(n,Fe,le);Ne({from:o,to:o})}}),[ee.id,Fe,je,nt,le,te]),Pt=u.useCallback((e=>{if(Ue(null),Z(e.nativeEvent,ee.id)&&xe){if((0,m.calcSelectionBoxArea)(xe)>50){const t=(0,m.getInstancesInRect)(xe,ce,Fe,Kt.current,ee.instances,nt,le),n=e.shiftKey?[...pe,...t]:t;K({selected:n})}Ne(void 0)}}),[ee.id,ee.instances,xe,ce,Fe,nt,le,pe,K]),Ot=u.useCallback((e=>{if(!Z(e.nativeEvent,ee.id))return void(Be.current=!1);Be.current=!0;const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,(0,C.vAdd)(nt,C.vZero)),o=(0,m.domToViewPort)(n,Fe,le);xe&&Ne({...xe,to:o});const i=(0,m.findClosestPin)(ee,ce,n,nt,Q,X,Fe),s=Ke;if(i){(!s||s.ins!==i.ins||s.ins===i.ins&&s.pin!==i.pin)&&Qe({ins:i.ins,type:i.type,pin:i.id})}tt.current=o,K({lastMousePos:tt.current})}),[ee,nt,Fe,le,xe,ce,Q,X,Ke,K]),Et=u.useCallback((e=>{var t;"bp5-menu"!==(null===(t=e.relatedTarget)||void 0===t?void 0:t.className)&&(Qe(void 0),Be.current=!1)}),[]),Dt=u.useCallback(((e,t)=>{if(t){const t=(0,l.isInlineNodeInstance)(e)?e.node:(0,B.safelyGetNodeDef)(e.nodeId,ce);if(!t)throw new Error("Impossible state inspecting inexisting node");if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Cannot inspect a non visual node","warning");ze({insId:`${Q}.${e.id}`,node:t})}else if((0,l.isRefNodeInstance)(e)){const t=(0,B.safelyGetNodeDef)(e,ce);r(t)}else{const t=e.node;if(!(0,l.isInlineValueNode)(t))return void((0,l.isVisualNode)(t)?ze({insId:e.id,node:t}):(0,P.toastMsg)("Editing this type of node is not supported"));const n=atob(t.dataBuilderSource);Ve({insId:e.id,templateType:t.templateType,value:n,type:"existing"}),(0,P.toastMsg)("Editing inline visual node not supported yet")}}),[r,ce,Q]),St=u.useCallback((e=>{if((0,l.isInlineNodeInstance)(e)){const t=e.node;if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Not supported","warning");const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.filter((t=>t.id!==e.id)),n.connections=n.connections.filter((t=>{let{from:n,to:o}=t;return n.insId!==e.id&&o.insId!==e.id})),n.instances.push(...t.instances),n.connections.push(...t.connections.filter((e=>(0,l.isInternalConnectionNode)(e.from)&&(0,l.isInternalConnectionNode)(e.to))))}));o(n,{type:"functional",message:"ungroup"}),K({selected:[]})}else{const t=(0,B.safelyGetNodeDef)(e.nodeId,ce);if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Not supported","warning")}}),[ee,o,K,ce]),Mt=u.useCallback((async e=>{}),[]),Tt=u.useCallback(((e,t)=>{const n=(0,V.handleDetachConstEditorCommand)(ee,e.id,t);o(n,(0,O.functionalChange)("detach-const"))}),[o,ee]),kt=u.useCallback(((e,t)=>{const n=e.inputConfig[t]||(0,x.queueInputPinConfig)();(0,l.isStaticInputPinConfig)(n)&&(Re(n.value),P.AppToaster.show({message:"Value copied"}))}),[]),Rt=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{const o=n.instances.find((t=>t.id===e.id));if(!o)throw new Error("Impossible state");o.inputConfig[t]=(0,l.staticInputPinConfig)(ke),n.connections=n.connections.filter((n=>!(0,l.isInternalConnectionNode)(n.to)||!(n.to.insId===e.id&&n.to.pinId===t)))}));o(n,(0,O.functionalChange)("paste const value"))}),[ee,o,ke]),At=u.useCallback((async e=>{const t=await Le("New name?");if(!t)return;const n=(0,v.produce)(ee,(n=>{var o;"input"===e?(ee.inputs||(n.inputs={}),n.inputs[t]=(0,l.nodeInput)(),n.inputsPosition[t]=tt.current):(ee.outputs||(n.outputs={}),n.outputs[t]=(0,l.nodeOutput)(),n.outputsPosition[t]=tt.current,(null===(o=n.completionOutputs)||void 0===o?void 0:o.length)&&(0,P.toastMsg)("Note that this node has explicit completion outputs set. You may need to update them."))}));o(n,(0,O.functionalChange)("add new io pin")),ue("addIoPin",{type:e})}),[Le,ee,o,ue]),Vt=u.useCallback((async()=>{var e;const t=null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","),n=await Le("Edit completion outputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,v.produce)(ee,(e=>{e.completionOutputs=""===n?void 0:n.split(",")}));o(e,(0,O.functionalChange)("change node completions")),ue("editCompletionOutputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),$t=u.useCallback((async()=>{var e;const t=null===(e=ee.reactiveInputs)||void 0===e?void 0:e.join(","),n=await Le("Edit reactive inputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,v.produce)(ee,(e=>{e.reactiveInputs=""===n?void 0:n.split(",")}));o(e,(0,O.functionalChange)("change reactive inputs")),ue("editReactiveInputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),zt=u.useCallback((async()=>{const e=await Le("Description?",ee.description),t=(0,v.produce)(ee,(t=>{t.description=e}));o(t,(0,O.functionalChange)("Edit node description"))}),[Le,o,ee]),Ht=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{t.defaultStyle=e}));o(t,(0,O.functionalChange)("change default style")),ue("changeStyle",{isDefault:!0})}),[o,ee,ue]),Gt=u.useCallback((async(e,t)=>{const n=await Le("New name?",t)||t,i=(0,m.handleIoPinRename)(ee,e,t,n);o(i,(0,O.functionalChange)("rename io pin"))}),[ee,o,Le]),Lt=u.useCallback(((e,t)=>{const n=(0,m.handleChangeNodeInputType)(ee,e,t);o(n,(0,O.functionalChange)("toggle io pin optional"))}),[ee,o]),Ft=u.useCallback((e=>{switch(e.type){case G.ActionType.RemoveNode:{const e=(0,v.produce)(ee,(e=>{if(!(0,l.isVisualNode)(ee))throw new Error("Impossible state, deleting instances opf non visual node");e.instances=e.instances.filter((e=>!pe.includes(e.id))),e.connections=e.connections.filter((e=>!pe.includes(e.from.insId)&&!pe.includes(e.to.insId)))}));K({selected:[]}),o(e,(0,O.functionalChange)("remove-instances")),(0,P.toastMsg)(`Removed ${pe.length} instances(s)`),ue("deleteInstances",{count:pe.length});break}case G.ActionType.Inspect:if(1===pe.length)J(pe[0]);else if(fe||me){const e=null!=fe?fe:me,t=(0,l.isExternalConnectionNode)(e)?l.ROOT_INS_ID:e.insId;J(t,{type:fe?"output":"input",id:e.pinId})}ue("openInspectMenu",{source:"actionMenu"});break;case G.ActionType.Group:(async()=>{await Ye()})();break;case G.ActionType.UnGroup:{const e=ee.instances.find((e=>e.id===pe[0]));St(e);const t=(0,B.safelyGetNodeDef)(e,ce);(0,P.toastMsg)(`Ungrouped inline node ${t.id}`),ue("unGroupNode",{instancesCount:t.instances.length});break}case G.ActionType.AddInlineValue:Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"actionMenu"});break;case G.ActionType.AddNode:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,v.produce)(ee,(e=>{e.instances.push(r)})),u=(0,v.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,O.functionalChange)("add new instance")),K(u),(0,P.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;case G.ActionType.AI:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,v.produce)(ee,(e=>{e.instances.push(r)})),u=(0,v.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,O.functionalChange)("add new instance")),K(u),(0,P.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;default:(0,P.toastMsg)(`${e.type} not supported yet`)}}),[Y,fe,o,K,Ye,re,J,St,ee,ce,ue,pe,me,Fe,et]),Bt=()=>{const t=Y.from;return(0,p.entries)(ye).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"input",pos:ge[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,onDblClick:Zt,closest:!(!Ke||"input"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,inputMode:s.mode,onChangeInputMode:Lt,viewPort:Fe,onDragStart:vt,onDragEnd:gt,onDragMove:ht,onSelect:it,onSetDescription:st,selected:(null==t?void 0:t.pinId)===o,description:s.description,onMouseUp:Nn,onMouseDown:xn},o)}))},qt=()=>{const{to:t}=Y;return(0,p.entries)(be).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"output",pos:Ie[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,closest:!(!Ke||"output"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,viewPort:Fe,onDragStart:vt,onDragEnd:gt,onDragMove:ht,onSelect:it,onSetDescription:st,description:s.description,selected:(null==t?void 0:t.pinId)===o,onMouseUp:Nn,onMouseDown:xn},o)}))},Ut=()=>{if(xe){const{from:e,to:t}=xe,n=(0,m.logicalPosToRenderedPos)(e,Fe),o=(0,m.logicalPosToRenderedPos)(t,Fe),{x:i,y:s,w:r,h:u}=(0,m.getSelectionBoxRect)(n,o);return(0,a.jsx)("div",{className:"selection-box",style:{top:s,left:i,width:r,height:u}})}return null},Wt=u.useCallback((async(e,t,n,o)=>{if("input"===n){const n=e.inputConfig[t],o=(0,l.isStaticInputPinConfig)(n)?JSON.stringify(n.value):void 0;Ve({type:"static-input",insId:e.id,pinId:t,value:null!=o?o:JSON.stringify("Some static value")}),ue("addValueModalOpen",{source:"dblClickPin"})}else{const i=(0,B.safelyGetNodeDef)(e,ce);if(!(0,l.getNodeOutputs)(i)[t])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:o.clientX,y:o.clientY},ins:e,targetNode:i,pinId:t,pinType:n})}}),[ce,ue]),Zt=u.useCallback((async(e,t)=>{if(!ee.inputs[e])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:t.clientX,y:t.clientY},pinId:e,pinType:"input",targetNode:ee})}),[ee]),Jt=u.useCallback((e=>{if(e.metaKey||e.ctrlKey){const t=-.005*e.deltaY;ct(Fe.zoom+t,"mouse"),e.preventDefault(),e.stopPropagation()}else{if(se)return;const t=e.deltaX,n=e.deltaY,o=(0,v.produce)(Fe,(e=>{e.pos.x=e.pos.x+t/e.zoom,e.pos.y=e.pos.y+n/e.zoom}));We(o),e.stopPropagation(),e.preventDefault()}}),[se,ct,We,Fe]);(0,h.useEffect)((()=>{const{current:e}=Xe;if(e)return e.addEventListener("wheel",Jt),()=>{e.removeEventListener("wheel",Jt)}}),[Jt]);const Yt={backgroundPositionX:(0,m.roundNumber)(-Fe.pos.x*Fe.zoom),backgroundPositionY:(0,m.roundNumber)(-Fe.pos.y*Fe.zoom),backgroundSize:(0,m.roundNumber)(10*Fe.zoom)+"px"},Kt=u.useRef(new Map);u.useEffect((()=>{const e=ve.reduce(((e,t)=>{const n=(0,B.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeInputs)(n))),e}),new Map),t=ve.reduce(((e,t)=>{const n=(0,B.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeOutputs)(n))),e}),new Map);e.set(l.THIS_INS_ID,(0,l.keys)(ee.outputs)),t.set(l.THIS_INS_ID,(0,l.keys)(ee.inputs));const n=he.filter((n=>{const o=e.get(n.to.insId)&&e.get(n.to.insId).includes(n.to.pinId),i=t.get(n.from.insId)&&t.get(n.from.insId).includes(n.from.pinId);return!(o&&i)}));if(n.length>0){(0,P.toastMsg)(`${n.length} orphan connections removed`,"warning"),console.warn(`${n.length} orphan connections removed`,n);const e=(0,v.produce)(ee,(e=>{e.connections=ee.connections.filter((e=>!n.includes(e)))}));o(e,(0,O.functionalChange)("prune orphan connections"))}}),[ve,o,he,ee,ce]),u.useEffect((()=>{let e=[];const t=(0,v.produce)(ee,(t=>{t.instances=t.instances.map((t=>{const n=(0,B.safelyGetNodeDef)(t,ce);if(n){const o=(0,l.getNodeInputs)(n),i=(0,l.getNodeOutputs)(n);if(t.visibleInputs){const n=t.visibleInputs.filter((e=>!o[e]));n.length>0&&(t.visibleInputs=(0,l.keys)(o),e.push(...n))}if(t.visibleOutputs){const n=t.visibleOutputs.filter((e=>!i[e]));n.length>0&&(t.visibleOutputs=(0,l.keys)(i),e.push(...n))}}return t}))}));e.length>0&&((0,P.toastMsg)(`Found ${e.length} invalid visible inputs/outputs: ${e.join(", ")}. Reset them`,"warning"),o(t,(0,O.functionalChange)("reset corrupt visible inputs/outputs")))}),[ve,o,ee,ce]),(0,h.useEffect)((()=>{const e=new Map(ve.map((e=>[e.id,e])));Kt.current=he.reduce(((t,n)=>{const o=t.get(n.to.insId)||{},i=o[n.to.pinId]||[],s={...o,[n.to.pinId]:[...i,e.get(n.from.insId)]};return t.set(n.to.insId,s),t}),new Map)}),[he,ve]);const Qt=u.useCallback((()=>{Te(void 0)}),[]),Xt=u.useCallback((async e=>{if(!Me)throw new Error("impossible state - quick add menu invoked but not available");const{ins:t,pinId:n}=Me;switch(e.type){case"import":case"node":{const i="import"===e.type?await re(e.importableNode):ce,s="import"===e.type?e.importableNode.node:e.node,r=(0,m.createNewNodeInstance)(s.id,100,tt.current,i);if(r){const e=(0,v.produce)(ee,(e=>{e.instances.push(r),e.connections.push({from:{insId:t?t.id:l.THIS_INS_ID,pinId:n},to:{insId:r.id,pinId:l.TRIGGER_PIN_ID}})}));o(e,(0,O.functionalChange)("add-item-quick-menu")),Qt()}ue("addNode",{nodeId:s.id,source:"quickAdd"});break}case"value":if(!t)return void(0,P.toastMsg)("Cannot add value to main input");Ve({type:"new-output",insId:t.id,pinId:n}),ue("addValueModalOpen",{source:"quickAdd"})}}),[Me,ce,ue,ee,o,Qt,re]),en=u.useCallback((async()=>{const e=JSON.stringify(ee);await navigator.clipboard.writeText(e),P.AppToaster.show({message:"Copied!"})}),[ee]),tn=u.useCallback((()=>{var e,t;const n=i?"":" (cannot edit main node, only visual)";return(0,a.jsxs)(y.Menu,{children:[(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"New Value",onClick:(0,p.preventDefaultAnd)((()=>{Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"contextMenu"})}))}),(0,a.jsx)(y.MenuItem,{text:`New input ${n}`,onMouseDown:e=>e.stopPropagation(),onClick:(0,p.preventDefaultAnd)((()=>At("input"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`New output ${n}`,onClick:(0,p.preventDefaultAnd)((()=>At("output"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Copy node to clipboard",onClick:(0,p.preventDefaultAnd)(en)}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Completion Outputs (${(null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Vt()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Reactive inputs (${(null===(t=ee.reactiveInputs)||void 0===t?void 0:t.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>$t()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Edit description",onClick:(0,p.preventDefaultAnd)((()=>zt()))}),(0,a.jsx)(y.MenuDivider,{}),(0,a.jsx)(y.MenuItem,{text:"Default Style",children:(0,a.jsx)(z.NodeStyleMenu,{style:ee.defaultStyle,onChange:Ht,promptFn:Le})})]})}),[i,en,ee.completionOutputs,ee.reactiveInputs,ee.defaultStyle,Ht,Le,ue,At,Vt,$t,zt]);(0,g.useHotkeys)("shift+c",ot,{text:"Center viewport",group:"Viewport Controls"},[],Be),(0,g.useHotkeys)("cmd+c",at,{text:"Copy instances",group:"Editing"},[],Be),(0,g.useHotkeys)("cmd+v",ut,{text:"Paste instances",group:"Editing"},[],Be),(0,g.useHotkeys)("esc",dt,{text:"Clear selections",group:"Selection"},[],Be),(0,g.useHotkeys)("backspace",xt,{text:"Delete instances",group:"Editing"},[],Be),(0,g.useHotkeys)("shift+d",wt,{text:"Duplicate selected instances",group:"Editing"},[],Be),(0,g.useHotkeys)("cmd+a",yt,{text:"Select all",group:"Selection"},[],Be),(0,g.useHotkeys)("s",lt,{text:"Select pin closest to mouse",group:"Selection"},[],Be);const nn=u.useCallback(((e,t)=>{if(!$e)throw new Error("impossible state");const n=(0,v.produce)(ee,(t=>{const n=t.instances.find((e=>e.id===$e.insId));if(!n||!(0,l.isInlineNodeInstance)(n))throw new Error("impossible state");n.node=e}));o(n,(0,O.functionalChange)("Inner change: "+t.message)),ze((t=>({...t,node:e})))}),[o,$e,ee]),[on,sn]=(0,h.useState)({selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}}),rn=u.useCallback((e=>sn((t=>({...t,...e})))),[]),an=n=>$e&&$e.insId===n.id?{currentInsId:$e.insId,ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),boardData:on,onChangeBoardData:rn,resolvedDependencies:ne,onCopy:s,clipboardData:e.clipboardData,onInspectPin:e.onInspectPin,onGoToNodeDef:e.onGoToNodeDef,nodeIoEditable:e.nodeIoEditable,node:$e.node,onChangeNode:nn,onShowOmnibar:te,parentViewport:t.defaultViewPort,parentBoardPos:nt,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:e.queuedInputsData}:void 0,un=()=>{if(fe&&("input"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"output"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(e)&&!(0,l.isInternalConnectionNode)(fe))return;return{from:fe,to:e}}if(me&&("output"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"input"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(me)&&!(0,l.isInternalConnectionNode)(e))return;return{from:e,to:me}}},ln=()=>{const e=un();if(e){const{from:t,to:n}=e;return{connection:{from:t,to:n},type:he.some((t=>(0,l.connectionDataEquals)(t,e)))?"future-remove":"future-add"}}},cn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleInputs:t}:n))}));o(n,(0,O.functionalChange)("change instance visible inputs"))}),[ee,o]),dn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,style:t}:n))}));o(n,(0,O.functionalChange)("change instance style")),ue("changeStyle",{isDefault:!1})}),[o,ee,ue]),pn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleOutputs:t}:n))}));o(n,(0,O.functionalChange)("change instance visible outputs"))}),[ee,o]),fn=u.useCallback(((e,t)=>{const n=(0,v.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,displayName:t}:n))}));o(n,(0,O.functionalChange)("change instance display name"))}),[ee,o]);u.useImperativeHandle(n,(()=>({centerInstance(e){const t=ee.instances.find((t=>t.id===e));if(t){const e=(0,C.vSub)(t.pos,(0,C.vec)(et.width/2,et.height/2));We({...Fe,pos:e})}},centerViewPort(){ot()},getViewPort:()=>Fe,clearSelection:()=>{dt()},requestNewInlineValue:()=>{Ve({type:"new-floating",pos:tt.current})}})));const[mn,vn]=u.useState([]),hn=u.useCallback(((e,t)=>{const n=t.trim().substr(0,100),i=`Inline-value-${n.substr(0,15).replace(/["'`]/g,"")}`,s=(0,D.createInlineValueNode)({code:t,customView:n,nodeId:i,type:e});switch(Ae.type){case"existing":{const[e]=ee.instances.filter((e=>e.id===Ae.insId)).filter((e=>(0,l.isInlineNodeInstance)(e))).map((e=>e.node));if(!e)throw new Error("Unable to find inline node to save to");const t=(0,l.keys)(e.inputs),n=(0,l.keys)(s.inputs),i=new Set(S.default.difference(t,n)),r=(0,v.produce)(ee,(e=>{e.instances=e.instances.map((e=>e.id===Ae.insId?(0,l.inlineNodeInstance)(e.id,s,e.inputConfig,e.pos):e)),e.connections=e.connections.filter((e=>!(e.to.insId===Ae.insId&&i.has(e.to.pinId))))}));o(r,(0,O.functionalChange)("change inline value")),Ve(void 0);break}case"static-input":{let e;try{const n=t.replace(/^['`]/,'"').replace(/['`]$/,'"');e=JSON.parse(n)}catch(r){return void(0,P.toastMsg)("Input values must not be formulas or code")}const n=(0,v.produce)(ee,(t=>{t.instances.find((e=>e.id===Ae.insId)).inputConfig[Ae.pinId]=(0,l.staticInputPinConfig)(e)}));o(n,(0,O.functionalChange)("set static input value")),Ve(void 0);break}case"new-floating":{const e=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},Ae.pos),t=(0,v.produce)(ee,(t=>{t.instances.push(e)}));o(t,(0,O.functionalChange)("new floating value")),Ve(void 0);break}case"new-output":{const{insId:e,pinId:t}=Ae,n=ee.instances.find((t=>t.id===e));if(!n)throw new Error("Impossible state");const i=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},(0,C.vAdd)(n.pos,{x:-50,y:150})),r=(0,v.produce)(ee,(n=>{n.instances.push(i),n.connections.push({from:(0,l.connectionNode)(e,t),to:(0,l.connectionNode)(i.id,l.TRIGGER_PIN_ID)})}));o(r,(0,O.functionalChange)("new value connected to output")),Ve(void 0)}}ue("addValue",{type:e,placeholdersCount:(0,l.keys)(s.inputs).length})}),[Ae,o,ee,ue]),gn=he.filter((e=>{const t=un();return!t||!(0,l.connectionDataEquals)(t,e)})),In=u.useCallback((()=>{ze(void 0),sn(t.defaultBoardData)}),[]),yn=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{const n=t.connections.find((t=>(0,l.connectionDataEquals)(t,e)));n.hidden=!n.hidden}));o(t,(0,O.functionalChange)("toggle connection hidden"))}),[o,ee]),bn=u.useCallback((e=>{const t=(0,v.produce)(ee,(t=>{t.connections=t.connections.filter((t=>!(0,l.connectionDataEquals)(t,e)))}));o(t,(0,O.functionalChange)("remove connection"))}),[o,ee]),Cn=u.useCallback(((e,t,n)=>{Ue("input"===n?{to:(0,l.connectionNode)(e.id,t),from:void 0}:{from:(0,l.connectionNode)(e.id,t),to:void 0})}),[]),_n=u.useCallback(((e,t,n)=>{qe&&(qe.from&&"input"===n?Je(qe.from,(0,l.connectionNode)(e.id,t),"pinDrag"):qe.to&&"output"===n&&Je((0,l.connectionNode)(e.id,t),qe.to,"pinDrag")),Ue(null)}),[qe,Je]),xn=u.useCallback(((e,t)=>{}),[]),Nn=u.useCallback(((e,t)=>{qe&&(qe.from&&"output"===t?Je(qe.from,(0,l.externalConnectionNode)(e),"nodeIoPinDrag"):qe.to&&"input"===t&&Je((0,l.externalConnectionNode)(e),qe.to,"nodeIoPinDrag"))}),[qe,Je]);try{return(0,a.jsxs)(y.ContextMenu,{className:(0,k.default)("visual-node-editor",e.className,{dark:ae}),"data-id":ee.id,content:tn(),disabled:!Be.current,children:[(0,a.jsxs)("main",{className:"board-editor-inner",onMouseDown:jt,onMouseUp:Pt,onMouseMove:Ot,onMouseLeave:Et,ref:Xe,style:Yt,children:[(0,a.jsx)(u.Fragment,{children:(0,a.jsx)(w.LayoutDebugger,{vp:Fe,node:ee,extraDebug:m.emptyList,mousePos:tt.current})}),(0,a.jsx)(d.ConnectionView,{resolvedNodes:ce,currentInsId:Q,ancestorsInsIds:X,size:et,node:ee,boardPos:nt,instances:ve,connections:gn,futureConnection:ln(),onDblClick:l.noop,viewPort:Fe,parentVp:le,selectedInstances:pe,toggleHidden:yn,removeConnection:bn,lastMousePos:tt.current,draggedSource:qe}),Bt(),ve.map((t=>{var n,o,i,s,r;return(0,a.jsx)(c.InstanceView,{onUngroup:St,onExtractInlineNode:Mt,onDetachConstValue:Tt,onCopyConstValue:kt,onPasteConstValue:Rt,copiedConstValue:ke,connectionsPerInput:Kt.current.get(t.id)||m.emptyObj,node:(0,B.safelyGetNodeDef)(t,ce),ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),onPinClick:rt,onPinDblClick:Wt,onDragStart:pt,onDragEnd:mt,resolvedDeps:ce,onDragMove:ft,onDblClick:Dt,onSelect:It,onToggleSticky:Nt,selected:-1!==pe.indexOf(t.id),dragged:Ce===t.id,onInspectPin:Ze,selectedInput:me&&(0,l.isInternalConnectionNode)(me)&&me.insId===t.id?me.pinId:void 0,selectedOutput:fe&&(0,l.isInternalConnectionNode)(fe)&&fe.insId===t.id?fe.pinId:void 0,closestPin:Ke&&Ke.ins.id===t.id?Ke:void 0,queuedInputsData:null!==(n=oe[t.id])&&void 0!==n?n:m.emptyObj,instance:t,connections:he,onTogglePinBreakpoint:l.noop,onTogglePinLog:l.noop,viewPort:Fe,onChangeVisibleInputs:cn,onChangeVisibleOutputs:pn,onSetDisplayName:fn,onDeleteInstance:Ct,forceShowMinimized:fe||(null===(o=null==qe?void 0:qe.to)||void 0===o?void 0:o.insId)===t.id?"input":me||(null===(i=null==qe?void 0:qe.from)||void 0===i?void 0:i.insId)===t.id?"output":void 0,isConnectedInstanceSelected:pe.some((e=>he.some((n=>{let{from:o,to:i}=n;return o.insId===t.id&&i.insId===e||o.insId===e&&i.insId===t.id})))),inlineGroupProps:an(t),onCloseInlineEditor:In,inlineEditorPortalDomNode:He.current,onChangeStyle:dn,onGroupSelected:Ye,onPinMouseDown:Cn,onPinMouseUp:_n,hadError:null!==(r=null===(s=e.instancesWithErrors)||void 0===s?void 0:s.has((0,l.fullInsIdPath)(t.id)))&&void 0!==r&&r},t.id)})),Ut(),qt(),(0,a.jsx)(L.MainInstanceEventsIndicator,{currentInsId:Q,ancestorsInsIds:X,viewPort:Fe}),Me?(0,a.jsx)(_.QuickAddMenu,{targetNode:Me.targetNode,pinId:Me.pinId,pinType:Me.pinType,pos:Me.pos,resolvedDependencies:ne,node:ee,onAdd:Xt,onClose:Qt}):null,(0,a.jsxs)("div",{className:"viewport-controls-and-help",children:[(0,a.jsx)(y.Button,{small:!0,onClick:ot,minimal:!0,intent:"primary",children:"Center"}),(0,a.jsx)(U,{min:.15,max:3,stepSize:.05,labelStepSize:10,labelRenderer:W,onChange:ct,value:Fe.zoom}),we?(0,a.jsx)(F.HelpBubble,{}):null]}),Ae?(0,a.jsx)(E.InlineCodeModal,{env:m.emptyObj,initialValue:Ae.value,initialType:"existing"===Ae.type?Ae.templateType:void 0,onCancel:()=>Ve(void 0),onSubmit:hn}):null,(0,a.jsx)("div",{className:"inline-editor-portal-root"})]}),(0,a.jsx)(G.ActionsMenu,{showRunFlowOptions:we,onAction:Ft,selectedInstances:pe,node:ee,resolvedNodes:ce,to:me,from:fe,hotkeysEnabled:Be})]})}catch(wn){return console.error(wn),(0,a.jsxs)("div",{children:["Error rendering board - ",wn.toString()]})}})));const Z=(e,t)=>{const n=e.target.closest(".visual-node-editor");return n&&n.getAttribute("data-id")===t}},83234:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeView=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=r(n(59349)),d=n(30653);t.BaseNodeView=function(e){const{dragged:t,viewPort:n,pos:o,onDragEnd:i,onDragMove:s,onDragStart:r,displayMode:p}=e,f=(0,d.useDarkMode)(),m=u.useCallback(((e,t)=>{r(e,t)}),[r]),v=u.useCallback(((e,t)=>{const s=o,r=(t.x-s.x)/n.zoom,a=(t.y-s.y)/n.zoom,u=s.x+r,l=s.y+a;i(e,{...t,x:u,y:l})}),[o,i,n]),h=u.useCallback(((e,t)=>{s(e,{x:t.x,y:t.y})}),[s]),g={transform:`scale(${n.zoom})`},I=(0,l.default)("base-node-view",e.className,{dragged:t,dark:f,"display-mode":p}),y=o.x*n.zoom-n.pos.x*n.zoom,b=o.y*n.zoom-n.pos.y*n.zoom,C={transform:`translate(${y-o.x}px, ${b-o.y}px)`},_=(0,l.default)("base-node-view-vp-fixer",{"display-mode":p}),x=(0,a.jsx)("span",{className:"base-node-view-wrapper",children:(0,a.jsx)("div",{className:I,style:g,id:e.domId,children:e.children})});return(0,a.jsx)("div",{className:_,style:C,children:(0,a.jsx)(c.default,{onStop:v,onStart:m,onDrag:h,position:o,cancel:".no-drag",children:x})})}},80510:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleConnectionCloseEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleConnectionCloseEditorCommand=(e,t)=>{let{from:n,to:o}=t;return(0,s.default)(e,(e=>{const t=e.connections.find((e=>{const t=(0,i.connectionNodeEquals)(n,e.from),s=(0,i.connectionNodeEquals)(o,e.to);return t&&s}));t?e.connections=e.connections.filter((e=>e!==t)):e.connections.push({from:n,to:o})}))}},1788:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDetachConstEditorCommand=void 0;const i=n(74762),s=o(n(53865)),r=n(68371);t.handleDetachConstEditorCommand=(e,t,n)=>(0,s.default)(e,(e=>{const{instances:o}=e,s=o.find((e=>e.id===t));if(!s)throw new Error("Impossible state ins id with no matching instance");const a=s.inputConfig[n];if(!a)throw new Error("impossible state detaching const from unexistent config");if(!(0,i.isStaticInputPinConfig)(a))throw new Error("impossible state detaching const with no value");const u=JSON.stringify(a.value),l=(0,r.createInlineValueNode)({code:`${u}`,type:i.InlineValueNodeType.VALUE}),c=(0,i.inlineNodeInstance)(`value-${(0,i.randomInt)(999)}`,l,{},{x:s.pos.x,y:s.pos.y-100});if(!e.instances.find((e=>e.id===s.id)))throw new Error("impossible state instance not found");s.inputConfig[n]=(0,i.queueInputPinConfig)(),e.instances.push(c),e.connections.push((0,i.connectionData)(`${c.id}.value`,`${s.id}.${n}`))}))},2130:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDuplicateSelectedEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleDuplicateSelectedEditorCommand=(e,t)=>{const n=[];return{newNode:(0,s.default)(e,(o=>{const s=o.instances;t.forEach((t=>{const o=s.find((e=>e.id===t));if(!o)throw new Error("impossible state duplicate selected no matching instance");if(o){const{pos:t}=o,r={...o,pos:{x:t.x+20,y:t.y+20},id:(0,i.createInsId)(e)};s.push(r),n.push(r.id)}}))})),newInstances:n}}},25044:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.pasteInstancesCommand=void 0;const i=n(74762),s=o(n(53865));t.pasteInstancesCommand=(e,t,n)=>{const o=n.instances.map((n=>({...n,pos:t,id:(0,i.createInsId)(e)}))),r=new Map(o.map(((e,t)=>[n.instances[t].id,e.id])));return{newNode:(0,s.default)(e,(e=>{e.instances.push(...o);const t=n.connections.map((e=>{let{from:t,to:n}=e;return{from:{...t,insId:r.get(t.insId)||t.insId},to:{...n,insId:r.get(n.insId)||n.insId}}}));e.connections.push(...t)})),newInstances:o}}},65082:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionView=t.SingleConnectionView=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=r(n(26372)),d=n(74762),p=n(18243),f=n(77852),m=n(74089),v=n(60190),h=n(50382),g=n(76064),I=n(41032);t.SingleConnectionView=e=>{const{isBrowser:t}=(0,f.useSsr)(),{connection:n,node:o,resolvedNodes:i,instances:s,type:r,viewPort:a,toggleHidden:l,parentSelected:m,removeConnection:y}=e,{from:b}=n,C=(0,d.isInternalConnectionNode)(b)&&s.find((e=>e.id===b.insId));if(!C&&(0,d.isInternalConnectionNode)(b))throw new Error(`impossible state - "from instance id - [${b.insId}] does not exist"`);const _=((0,d.isInternalConnectionNode)(b)&&C?(0,I.safelyGetNodeDef)(C,i):o).outputs[b.pinId],x=_&&_.delayed,N=t?(0,p.calcStartPos)({...e,connectionNode:b}):{x:0,y:0},w=t?(0,p.calcTargetPos)({...e,connectionNode:n.to}):{x:0,y:0},{x:j,y:P}=(0,v.vDiv)(N,e.parentVp.zoom),{x:O,y:E}=(0,v.vDiv)(w,e.parentVp.zoom),D=(0,c.default)({delayed:x,hidden:n.hidden,"parent-selected":m},r),S=(0,u.jsxs)(h.Menu,{children:[(0,u.jsx)(h.MenuItem,{text:n.hidden?"Show connection":"Hide connection",onClick:()=>l(n)}),(0,u.jsx)(h.MenuItem,{text:"Remove connection",onClick:()=>y(n)})]});return(0,u.jsx)(h.ContextMenu,{content:S,children:e=>(0,u.jsx)(g.ConnectionViewPath,{className:D,from:{x:j,y:P},to:{x:O,y:E},dashed:"regular"!==r,zoom:a.zoom,onContextMenu:e.onContextMenu})})};t.ConnectionView=e=>{var n;const{viewPort:o,futureConnection:i,toggleHidden:s,selectedInstances:r,draggedSource:c}=e,[d,f]=l.useState(0),v=l.useCallback((e=>requestAnimationFrame((()=>{f((e=>(e+1)%9)),e>0&&v(e-1)}))),[]);l.useEffect((()=>{const e=v(10);return()=>{cancelAnimationFrame(e)}}),[v]),l.useEffect((()=>{const e=()=>{v(3)};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[v,d]);const h=e.connections.map((n=>{const o=r.includes(n.from.insId)||r.includes(n.to.insId);return(0,a.createElement)(t.SingleConnectionView,{...e,connection:n,type:"regular",parentSelected:o,key:n.from.insId+n.from.pinId+n.to.insId+n.to.pinId})}));if(i&&h.push((0,a.createElement)(t.SingleConnectionView,{...e,connection:i.connection,type:i.type,toggleHidden:s,parentSelected:!1,key:"future"})),c){const t=(c.from?p.calcStartPos:p.calcTargetPos)({connectionNode:null!==(n=c.from)&&void 0!==n?n:c.to,viewPort:o,boardPos:e.boardPos,ancestorsInsIds:e.ancestorsInsIds,currentInsId:e.currentInsId});h.push((0,u.jsx)(g.ConnectionViewPath,{className:"dragged",from:t,to:(0,m.logicalPosToRenderedPos)(e.lastMousePos,o),zoom:o.zoom},"dragged"))}return(0,u.jsx)("svg",{className:"connections-view",children:h})}},76064:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionViewPath=void 0;const i=n(35250),s=o(n(26372)),r=n(70079),a=n(23381);t.ConnectionViewPath=(0,r.forwardRef)(((e,t)=>{const{from:n,to:o,className:r,onContextMenu:u,zoom:l,dashed:c}=e,{x:d,y:p}=n,{x:f,y:m}=o,v=(0,a.calcBezierPath)({sourceX:d,sourceY:p,targetX:f,targetY:m,curvature:.15}),h=2.5*l,g=c?6*l:void 0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:v,ref:t,className:(0,s.default)("connection",r),style:{strokeWidth:h,strokeDasharray:g},onContextMenu:u}),e.label?(0,i.jsx)("text",{className:"label",x:(d+f)/2,y:(p+m)/2,fontSize:"12px"}):null,(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%"}),(0,i.jsx)("stop",{offset:"100%"})]})]})}))},23381:(e,t)=>{"use strict";var n;function o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i(e){let t,i,{pos:s,x1:r,y1:a,x2:u,y2:l,c:c}=e;switch(s){case n.Left:t=r-o(r-u,c),i=a;break;case n.Right:t=r+o(u-r,c),i=a;break;case n.Top:t=r,i=a-o(a-l,c);break;case n.Bottom:t=r,i=a+o(l-a,c)}return[t,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.getBezierCenter=t.calcBezierPath=t.Position=void 0,function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(n=t.Position||(t.Position={}));t.calcBezierPath=e=>{let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l});return`M${t},${o} C${c},${d} ${p},${f} ${r},${a}`},t.getBezierCenter=function(e){let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l}),m=.125*t+.375*c+.375*p+.125*r,v=.125*o+.375*d+.375*f+.125*a;return[m,v,Math.abs(m-t),Math.abs(v-o)]}},18243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcTargetPos=t.calcStartPos=t.calcPinPosition=void 0;const o=n(74762),i=n(30994),s={x:99999,y:99999};function r(e){const t=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds),pinId:e.pinId,pinType:e.pinType,isMain:e.isMain});return((e,t,n,o)=>{if(!e)return console.warn(`Cannot find element ${n} to calculate position.`),s;const{x:i,y:r,width:a,height:u}=e.getBoundingClientRect(),l=r+u/2;return{x:i+a/2-t.x,y:l-t.y}})(document.getElementById(t),e.boardPos,t,e.viewPort)}t.calcPinPosition=r;t.calcStartPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"input",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"output",boardPos:n,viewPort:s})};t.calcTargetPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"output",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"input",boardPos:n,viewPort:s})}},30994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPinDomId=t.getMainInstanceIndicatorDomId=t.getInstanceDomId=void 0;const o=n(74762);t.getInstanceDomId=(e,t)=>`ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getMainInstanceIndicatorDomId=(e,t)=>`main-ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getPinDomId=e=>{let{pinType:t,fullInsIdPath:n,pinId:o,isMain:i}=e;return`${i?"main-":""}pin:${t}:${n}:${o}`.replace(/\s+/g,"-")}},86553:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceView=t.getVisibleOutputs=t.getVisibleInputs=t.INSTANCE_INFO_TOOLTIP_DELAY=t.MAX_INSTANCE_WIDTH=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=n(66074),d=n(74762),p=r(n(26372)),f=n(2036),m=n(74762),v=n(74762),h=n(53159),g=n(83234),I=n(74762),y=n(30994),b=n(63521),C=n(74089),_=n(50382),x=r(n(99581)),N=n(88593),w=n(30653);t.PIECE_HORIZONTAL_PADDING=25,t.PIECE_CHAR_WIDTH=11,t.MIN_WIDTH_PER_PIN=40,t.MAX_INSTANCE_WIDTH=400,t.INSTANCE_INFO_TOOLTIP_DELAY=400;t.getVisibleInputs=(e,t,n)=>{const{visibleInputs:o}=e;if(o)return o;const i=(0,d.keys)((0,v.getNodeInputs)(t)).filter(((o,i)=>{var s;const r=n.some((t=>t.to.insId===e.id&&t.to.pinId===o)),a=t.inputs[o]&&"optional"===(null===(s=t.inputs[o])||void 0===s?void 0:s.mode);return r||!a&&o!==m.TRIGGER_PIN_ID}));return 0===i.length?[m.TRIGGER_PIN_ID]:i};t.getVisibleOutputs=(e,t,n)=>{const{visibleOutputs:o}=e;if(o)return o;const i=Object.keys(t.outputs);return n.some((t=>t.from.insId===e.id&&t.from.pinId===m.ERROR_PIN_ID))?[...i,m.ERROR_PIN_ID]:i};t.InstanceView=function(e){const{selected:n,selectedInput:o,selectedOutput:i,closestPin:s,dragged:r,onTogglePinLog:j,onTogglePinBreakpoint:P,onDetachConstValue:O,onCopyConstValue:E,onPasteConstValue:D,displayMode:S,connections:M,instance:T,viewPort:k,node:R,onPinClick:A,onPinDblClick:V,onDragStart:$,onDragEnd:z,onDragMove:H,onToggleSticky:G,onSelect:L,onDblClick:F,onChangeVisibleInputs:B,onChangeVisibleOutputs:q,onConvertConstToEnv:U,inlineGroupProps:W,onUngroup:Z,onExtractInlineNode:J,onGroupSelected:Y,isConnectedInstanceSelected:K,inlineEditorPortalDomNode:Q,onChangeStyle:X,onDeleteInstance:ee,onSetDisplayName:te,onPinMouseUp:ne,onPinMouseDown:oe}=e,ie=(0,w.useDarkMode)(),{id:se}=T,re=l.useMemo((()=>{const e=(0,d.randomInt)(6,1);return{icon:(0,d.pickRandom)([["fab","discord"],["fab","slack"],"bug","cube"]),color:e,size:(0,d.randomInt)(3,1),variation:(0,d.randomInt)(5,1)}}),[]),ae=l.useRef(),ue=l.useMemo((()=>T.style||R.defaultStyle||{}),[R,T]),le=ue.size||"regular",ce=l.useMemo((()=>new Map(M.filter((e=>{let{to:t}=e;return t.insId===se})).map((e=>{let{to:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),de=l.useMemo((()=>new Map(M.filter((e=>{let{from:t}=e;return t.insId===se})).map((e=>{let{from:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),pe=(0,C.usePrompt)(),fe=l.useCallback((e=>A(T,e,"input")),[T,A]),me=l.useCallback(((e,t)=>V(T,e,"input",t)),[T,V]),ve=l.useCallback(((e,t)=>V(T,e,"output",t)),[T,V]),he=l.useCallback((e=>A(T,e,"output")),[T,A]),ge=l.useCallback(((e,t)=>{$(T,e,t)}),[T,$]),Ie=l.useCallback(((e,t)=>{const n=T.pos,o=(t.x-n.x)/k.zoom,i=(t.y-n.y)/k.zoom,s=n.x+o,r=n.y+i;z(T,e,{...t,x:s,y:r})}),[T,z,k.zoom]),ye=l.useCallback(((e,t)=>{H(T,e,{x:t.x,y:t.y})}),[T,H]),be=l.useCallback((e=>G(T,e)),[T,G]),Ce=l.useCallback((e=>O(T,e)),[T,O]),_e=l.useCallback((e=>E(T,e)),[T,E]),xe=l.useCallback((e=>D(T,e)),[T,D]),Ne=l.useCallback((e=>L(T,e)),[T,L]),we=l.useCallback((e=>F(T,e.shiftKey)),[T,F]),je=(0,d.entries)(R.inputs),{visibleInputs:Pe,visibleOutputs:Oe}=T;Pe&&je.sort(((e,t)=>Pe.indexOf(e[0])-Pe.indexOf(t[0])));const Ee=(0,d.entries)(R.outputs);Oe&&Ee.sort(((e,t)=>Oe.indexOf(e[0])-Oe.indexOf(t[0])));const De=(0,t.getVisibleInputs)(T,R,M),Se=(0,t.getVisibleOutputs)(T,R,M);je.push([m.TRIGGER_PIN_ID,{...(0,d.nodeInput)(),description:"Use this pin to manually trigger the node. If not connected, the node will be triggered automatically when all required inputs have data."}]),Ee.push([m.ERROR_PIN_ID,{...(0,m.nodeOutput)(),description:"Use this pin to catch errors that happen inside this node. If not connected, errors will bubble up to the parent node."}]);const Me=je.filter((e=>{let[t]=e;return De.includes(t)||(n||K)&&ce.has(t)})),Te=Ee.filter((t=>{let[o]=t;return Se.includes(o)||(n||K)&&de.has(o)||o===m.ERROR_PIN_ID&&e.hadError})),ke=M.some((e=>e.from.insId===se&&e.from.pinId===m.ERROR_PIN_ID)),Re=(0,p.default)("ins-view",{"no-inputs":0===je.length,"no-outputs":0===Ee.length,"display-mode":S,"force-minimized-input":"input"===e.forceShowMinimized||"both"===e.forceShowMinimized,"force-minimized-output":"output"===e.forceShowMinimized||"both"===e.forceShowMinimized,"inline-node-edited":!!W,"error-caught":ke}),Ae=(0,p.default)({selected:n,dragged:r,closest:s&&s.ins.id===T.id},`size-${le}`),Ve=new Set((0,d.entries)(R.inputs).filter((e=>{let[t,n]=e;return(0,m.isInputPinOptional)(n)})).map(d.pickFirst)),$e=(0,d.entries)(T.inputConfig).reduce(((e,t)=>{let[n,o]=t;return(0,m.isStickyInputPinConfig)(o)||o.sticky?{...e,[n]:!0}:e}),{}),ze=(0,h.calcNodeContent)(T,R),He=e=>{const t=T.inputConfig[e];if((0,I.isStaticInputPinConfig)(t))return t.value},Ge=l.useCallback((async()=>{const e=(0,d.okeys)(R.inputs),t=await pe("New order?",(T.visibleInputs||e).join(","));t&&B(T,t.split(","))}),[R.inputs,pe,T,B]),Le=l.useCallback((async()=>{const e=(0,d.okeys)(R.outputs),t=await pe("New order?",(T.visibleOutputs||e).join(","));t&&q(T,t.split(","))}),[R.outputs,pe,T,q]),Fe=l.useCallback((()=>{ee(T)}),[ee,T]),Be=l.useCallback((async()=>{const e=await pe("Set custom display name",T.displayName||R.id);te(T,e)}),[pe,T,te,R.id]),qe=Object.keys((0,v.getNodeInputs)(R)),Ue=Object.keys((0,d.getNodeOutputs)(R)),We=l.useCallback((e=>{U&&U(T,e)}),[T,U]),Ze=l.useCallback(((e,t)=>{ne&&ne(T,e,t)}),[T,ne]),Je=l.useCallback(((e,t)=>{oe&&oe(T,e,t)}),[T,oe]),Ye=()=>(0,u.jsx)("div",{className:"inputs no-drag",children:Me.map((t=>{let[i,r]=t;var a;return(0,u.jsx)(f.PinView,{type:"input",currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,id:i,optional:Ve.has(i),connected:ce.has(i),isSticky:$e[i],minimized:!n&&1===Me.length,onToggleSticky:be,onDetachConstValue:Ce,onCopyConstValue:_e,onPasteConstValue:xe,copiedConstValue:e.copiedConstValue,selected:i===o,onClick:fe,onDoubleClick:me,isClosestToMouse:!!s&&"input"===s.type&&s.pin===i,onToggleLogged:j,onToggleBreakpoint:P,onInspect:e.onInspectPin,constValue:He(i),onConvertConstToEnv:e.onConvertConstToEnv?We:void 0,description:r.description,queuedValues:null!==(a=e.queuedInputsData[i])&&void 0!==a?a:0,onMouseUp:Ze,onMouseDown:Je},i)}))}),Ke=()=>(0,u.jsx)("div",{className:"outputs no-drag",children:Te.map((t=>{let[o,r]=t;return(0,u.jsx)(f.PinView,{currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,connected:de.has(o),type:"output",id:o,minimized:!n&&1===Te.length,isClosestToMouse:!!s&&"output"===s.type&&s.pin===o,selected:o===i,onClick:he,onDoubleClick:ve,onToggleLogged:j,onToggleBreakpoint:P,onInspect:e.onInspectPin,description:r.description,onMouseUp:Ze,onMouseDown:Je},o)}))}),Qe=l.useCallback((e=>{X(T,e)}),[T,X]),Xe=l.useCallback((()=>{const e=[...qe.map((e=>{const t=De.includes(e),n=ce.has(e)&&!0!==ce.get(e),o=(0,d.getInputName)(e);return{text:t?n?`Hide input "${o}" (disconnect first)`:`Hide input "${o}"`:`Show input "${o}"`,onClick:()=>B(T,t?De.filter((t=>t!==e)):[...De,e]),disabled:n&&t}})),...Ue.map((e=>{const t=Se.includes(e),n=de.has(e),o=(0,d.getOutputName)(e);return{text:t?n?`Hide output "${o}" (disconnect first)`:`Hide output "${o}"`:`Show output "${o}"`,onClick:()=>q(T,t?Se.filter((t=>t!==e)):[...Se,e]),disabled:n&&t}})),...(0,d.isInlineNodeInstance)(T)&&(0,v.isVisualNode)(T.node)?[{text:"Ungroup inline node",onClick:()=>Z(T)}]:[],...(0,d.isInlineNodeInstance)(T)?[{text:"Extract inline node to file",onClick:()=>J(T)}]:[],{text:"Reorder inputs",onClick:Ge},{text:"Reorder outputs",onClick:Le},{text:"Set display name",onClick:Be},{text:"Group selected instances",onClick:Y},{text:"Delete instance",intent:"danger",onClick:Fe}];return(0,u.jsxs)(_.Menu,{children:[(0,u.jsx)(_.MenuItem,{text:"Style",children:(0,u.jsx)(N.NodeStyleMenu,{style:ue,onChange:Qe,promptFn:pe})}),e.map(((e,t)=>(0,a.createElement)(_.MenuItem,{...e,key:t})))]})}),[qe,Ue,T,Ge,Le,Be,Fe,ue,Qe,pe,De,ce,B,Se,de,q,Z,J,Y]),et={"--node-color":ue.color,...ue.cssOverride||{}},tt=(0,y.getInstanceDomId)(T.id,e.ancestorsInsIds);return(0,u.jsx)("div",{className:Re,children:(0,u.jsx)(g.BaseNodeView,{pos:T.pos,viewPort:k,onDragStart:ge,onDragMove:ye,onDragEnd:Ie,upperRenderer:Ye,bottomRenderer:Ke,displayMode:S,domId:tt,children:(0,u.jsxs)(l.Fragment,{children:[Ye(),W?x.default.createPortal((0,u.jsxs)("div",{className:"inline-group-editor-container no-drag",children:[(0,u.jsxs)("header",{children:[ze," ",(0,u.jsx)("button",{onClick:e.onCloseInlineEditor,children:"close"})]}),(0,u.jsx)(b.VisualNodeEditor,{...e.inlineGroupProps,className:"no-drag",ref:ae})]}),Q):(0,u.jsx)(_.ContextMenu,{className:(0,p.default)("ins-view-inner",Ae,`size-${re.size}`,{dark:ie}),onClick:Ne,onDoubleClick:we,content:Xe(),style:et,children:(0,u.jsx)(_.Tooltip,{content:R.description,children:(0,u.jsxs)(l.Fragment,{children:[ue.icon?(0,u.jsx)(c.FontAwesomeIcon,{icon:ue.icon}):null," ",ze]})})}),Ke()]})})})}},53568:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStyleMenu=t.nodeStylePresetColors=void 0;const r=n(35250),a=n(50382),u=s(n(70079)),l=n(84472);t.nodeStylePresetColors=[{name:"Amethyst",color:"#9b5de5"},{name:"Magenta",color:"#f15bb5"},{name:"Yellow",color:"#fee440"},{name:"Capri",color:"#00bbf9"},{name:"Sea Green",color:"#00f5d4"},{name:"Orange",color:"#ff7f00"}];const c={size:"regular"};t.NodeStyleMenu=e=>{var n;const{onChange:o,style:i}=e,s=i||c,d=e.promptFn,p=u.default.useCallback(((e,t)=>{o({...s,[e]:t})}),[s,o]),f=u.default.useCallback((async()=>{const e=await d("Icon name? (Font Awesome conventions)","rocket"),t=e.includes(",")?e.split(","):e;p("icon",t)}),[d,p]),m=(0,u.useCallback)((async()=>{const e=await d("Enter a custom style (valid JSON representing a React CSS object)",s.cssOverride?JSON.stringify(s.cssOverride):"");try{const t=JSON.parse(e);p("cssOverride",t)}catch(t){console.error(t),(0,l.toastMsg)("Invalid object","danger")}}),[d,p,s.cssOverride]);return(0,r.jsxs)(u.default.Fragment,{children:[(0,r.jsxs)(a.MenuItem,{text:"Color",children:[t.nodeStylePresetColors.map((e=>(0,r.jsx)(a.MenuItem,{text:e.name,onClick:()=>p("color",e.color)},e.name))),(0,r.jsx)(a.MenuDivider,{}),(0,r.jsx)(a.MenuItem,{text:"Remove Color",onClick:()=>p("color",void 0)})]}),(0,r.jsxs)(a.MenuItem,{text:`Size (${null!==(n=s.size)&&void 0!==n?n:"regular"})`,children:[(0,r.jsx)(a.MenuItem,{text:"Small",onClick:()=>p("size","small")}),(0,r.jsx)(a.MenuItem,{text:"Regular",onClick:()=>p("size","regular")}),(0,r.jsx)(a.MenuItem,{text:"Large",onClick:()=>p("size","large")})]}),(0,r.jsxs)(a.MenuItem,{text:"Icon",children:[(0,r.jsx)(a.MenuItem,{text:"Choose Icon",onClick:f}),(0,r.jsx)(a.MenuItem,{text:"Remove Icon",onClick:()=>p("icon",void 0)})]}),(0,r.jsx)(a.MenuItem,{text:"Custom Styling",onClick:m})]})}},88593:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(53568),t)},83651:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86553),t)},53159:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calcInstancePosition=t.calcNodeWidth=t.calcNodeContent=void 0;const i=n(74762),s=o(n(6576)),r=n(86553),a=n(61888),u=n(30994);t.calcNodeContent=(e,t)=>{if(e.displayName)return e.displayName;if(t.customViewCode)try{const n=Object.entries(e.inputConfig).filter((e=>{let[,t]=e;return(0,i.isStaticInputPinConfig)(t)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o.value}}),{});return s.default.compile(t.customViewCode)({inputs:n}).trim()}catch(n){return console.error("Error with custom view",n),`Error in custom view [${t.id}]`}return t.id};t.calcNodeWidth=(e,n)=>{const o=(0,i.okeys)(n.inputs).length*r.MIN_WIDTH_PER_PIN,s=(0,t.calcNodeContent)(e,n),u=r.PIECE_CHAR_WIDTH;return(0,a.clamp)(s.length*u+2*r.PIECE_HORIZONTAL_PADDING,o,r.MAX_INSTANCE_WIDTH)};t.calcInstancePosition=(e,t,n)=>{const o=(0,u.getInstanceDomId)(e,t),i=document.getElementById(o);if(i){const{x:e,y:t,width:o,height:s}=i.getBoundingClientRect(),r=t+s/2;return{x:e+o/2-n.x,y:r-n.y}}return console.warn("Cannot find element to draw connection to",o),{x:99999,y:99999}}},17841:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutDebugger=t.LayoutDebuggerItem=t.PosDebugger=void 0;const i=n(70079),s=n(35250),r=n(74762),a=o(n(70079)),u=n(7047),l=e=>{let{pos:t}=e;return(0,s.jsxs)("span",{children:[t.x.toFixed(1),", ",t.y.toFixed(1)]})};t.PosDebugger=e=>(0,s.jsx)("span",{className:"pos-debugger",children:(0,s.jsx)(l,{pos:e.pos})});t.LayoutDebuggerItem=e=>{const{pos:n,viewPort:o,size:i,color:r}=e,a=o.zoom,u=n.x*a-o.pos.x*a,l=n.y*a-o.pos.y*a,c={transform:`translate(${u-n.x}px, ${l-n.y}px)`},d={transform:`scale(${o.zoom})`},p={transform:`translate(${n.x}px, ${n.y}px)`},f={width:`${i.width}px`,height:`${i.height}px`,backgroundColor:r};return(0,s.jsx)("div",{className:"layout-debugger",style:c,children:(0,s.jsxs)("span",{className:"drag-sim",style:p,children:[(0,s.jsx)(t.PosDebugger,{pos:n}),(0,s.jsx)("div",{className:"layout-debugger-zoom-wrapper",style:d,children:(0,s.jsx)("div",{className:"layout-debugger-inner",style:f})})]})})};const c=(()=>{try{return"true"===localStorage.getItem("pos-debugger")}catch(e){return!1}})();t.LayoutDebugger=e=>{const{extraDebug:n,vp:o,node:d,mousePos:p}=e;if(!c)return null;const f=n.map(((e,n)=>(0,i.createElement)(t.LayoutDebuggerItem,{...e,key:n}))),m=[...d.instances.map((e=>e.pos)),...(0,r.values)(d.inputsPosition),...(0,r.values)(d.outputsPosition)].map((e=>(0,s.jsx)(t.LayoutDebuggerItem,{pos:e,viewPort:o,size:{width:0,height:0},color:"red"}))),v=(0,u.logicalPosToRenderedPos)(p,o),h=(0,s.jsxs)("div",{className:"viewport-data",children:[(0,s.jsxs)("div",{children:["Pos: ",(0,s.jsx)(l,{pos:o.pos})]}),(0,s.jsxs)("div",{children:["Zoom: ",o.zoom.toFixed(2)," "]}),(0,s.jsxs)("div",{children:["Mouse (logical): ",(0,s.jsx)(l,{pos:p})]}),(0,s.jsxs)("div",{children:["Rendered (rendered): ",(0,s.jsx)(l,{pos:v})]})]});return(0,s.jsxs)(a.default.Fragment,{children:[h,f,m]})}},44338:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(17841),t)},38259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateInstancesWithSingleConstPinsMap=t.getLeafInstancesOfSelection=void 0;t.getLeafInstancesOfSelection=(e,t,n)=>e.reduce(((e,o)=>[...e,...n.filter((e=>e.to.insId===o.id)).map((e=>t.find((t=>t.id===e.from.insId)))).filter((e=>!!e))]),[]).filter((t=>1===n.filter((e=>e.from.insId===t.id||e.to.insId===t.id)).length&&!e.includes(t)));t.calculateInstancesWithSingleConstPinsMap=(e,t)=>{const{connections:n}=e;return n.filter((e=>t.has(e.from.insId))).reduce(((e,n)=>{const o=t.get(n.from.insId),i=n.to.insId,s=e.get(i)||new Map;return s.set(n.to.pinId,{val:o,insId:n.from.insId}),e.set(i,s),e}),new Map)}},37488:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeIoView=void 0;const a=n(35250),u=n(70079),l=s(n(70079)),c=n(74762),d=n(83234),p=r(n(26372)),f=n(50382),m=n(43490),v=n(66189),h=n(74762),g=n(30994),I=n(30653);t.NodeIoView=l.memo((function(e){const{viewPort:t,selected:n,pos:o,type:i,id:s,onDblClick:r,onRename:y,onDelete:b,onChangeInputMode:C,inputMode:_,onSelect:x,closest:N,onSetDescription:w,description:j,onMouseUp:P,onMouseDown:O,currentInsId:E}=e,{history:D,resetHistory:S,refreshHistory:M}=(0,v.useHistoryHelpers)(E,s,i),T=(0,m.usePrompt)(),k=l.useCallback((async()=>{const e=await T("Description?",j);w(i,s,e)}),[T,j,w,i,s]),R=l.useCallback((()=>{b&&b(i,s)}),[i,s,b]),A=l.useCallback((()=>{y&&y(i,s)}),[i,s,y]),V=l.useCallback((e=>{C&&C(s,e)}),[s,C]),$=l.useCallback((()=>[{text:`Current mode - ${_}`,onClick:c.noop},{text:"Make required",onClick:()=>V("required")},{text:"Make optional",onClick:()=>V("optional")},{text:"Make required-if-connected",onClick:()=>V("required-if-connected")},{text:"Set description",onClick:k},...e.onRename?[{text:"Rename",onClick:A}]:[],...e.onDelete?[{text:"Delete",onClick:R}]:[]]),[k,_,V,R,A,e.onDelete,e.onRename]),z=l.useCallback((t=>{r&&r(e.id,t)}),[r,e.id]),H=l.useCallback((()=>{x(s,i)}),[s,i,x]),G=l.useCallback((()=>(0,a.jsx)(f.Menu,{children:$().map(((e,t)=>(0,u.createElement)(f.MenuItem,{...e,key:t})))})),[$]),L="input"===i?(0,h.getInputName)(s):(0,c.getOutputName)(s),F=l.useCallback((e=>{P(s,i,e)}),[s,P,i]),B=l.useCallback((e=>{O(s,i,e)}),[s,O,i]),q=(0,I.useDarkMode)();return(0,a.jsx)(d.BaseNodeView,{className:(0,p.default)("node-io-view",i,{dark:q}),pos:o,onDragEnd:(n,o)=>{const r=e.pos,a=(o.x-r.x)/t.zoom,u=(o.y-r.y)/t.zoom,l=r.x+a,c=r.y+u;e.onDragEnd(i,s,n,{...o,x:l,y:c})},onDragStart:(t,n)=>{e.onDragStart(s,t,n)},onDragMove:(t,n)=>{e.onDragMove(i,s,t,{x:n.x,y:n.y})},viewPort:t,children:(0,a.jsx)(l.Fragment,{children:(0,a.jsx)(f.Tooltip,{content:(()=>{const t=(0,v.calcHistoryContent)(D),n=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:L})," (",i,")"," "]}),n,(0,a.jsx)("hr",{}),t]})})(),children:(0,a.jsx)(f.ContextMenu,{onMouseEnter:M,onMouseOut:S,onMouseUp:F,onMouseDown:B,"data-tip":"","data-html":!0,"data-for":s+e.currentInsId,className:(0,p.default)("node-io-view-inner",{closest:N,selected:n,dark:q}),id:(0,g.getPinDomId)({fullInsIdPath:(0,c.fullInsIdPath)(e.currentInsId,e.ancestorInsIds),pinId:s,pinType:i,isMain:!0}),onClick:H,onDoubleClick:z,content:G(),children:s})})})})}))},66005:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37488),t)},83782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcNodeIoWidth=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0,t.PIECE_HORIZONTAL_PADDING=15,t.PIECE_CHAR_WIDTH=9,t.MIN_WIDTH_PER_PIN=40;t.calcNodeIoWidth=e=>Math.max(t.MIN_WIDTH_PER_PIN,e.length*t.PIECE_CHAR_WIDTH+2*t.PIECE_HORIZONTAL_PADDING)},99942:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderVisualNode=t.layoutToInstances=void 0;const i=n(63521),s=n(74762),r=n(90794),a=o(n(53865)),u=n(83782),l=n(60190),c=n(53159),d=n(41032);t.layoutToInstances=(e,t)=>(0,a.default)(t,(t=>{(0,s.entries)(e.nodes).forEach((e=>{let[n,o]=e;if(n.startsWith("ins-")){const e=n.replace("ins-",""),i=t.instances.find((t=>t.id===e));i?i.pos=o.p:console.warn("WAT")}if(n.startsWith("node-input-")){const e=n.replace("node-input-","");t.inputsPosition[e]=o.p}if(n.startsWith("node-output-")){const e=n.replace("node-output-","");t.outputsPosition[e]=o.p}}))}));t.orderVisualNode=(e,n,o,a)=>{const{instances:p,connections:f}=e,m={...p.reduce(((e,t)=>{const o=(0,l.size)((0,c.calcNodeWidth)(t,(0,d.safelyGetNodeDef)(t,n)),i.NODE_HEIGHT);return{...e,[`ins-${t.id}`]:{p:t.pos,s:o}}}),{}),...(0,s.okeys)(e.inputsPosition).reduce(((t,n)=>({...t,[`node-input-${n}`]:{p:e.inputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{}),...(0,s.okeys)(e.outputsPosition).reduce(((t,n)=>({...t,[`node-output-${n}`]:{p:e.outputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{})},v=f.map((e=>[(0,s.isExternalConnectionNode)(e.from)?`node-input-${e.from.pinId}`:`ins-${e.from.insId}`,(0,s.isExternalConnectionNode)(e.to)?`node-output-${e.to.pinId}`:`ins-${e.to.insId}`])),h=(0,r.orderLayout)({nodes:m,edges:v},o,((n,o)=>{a&&a((0,t.layoutToInstances)(n,e),o)}));return(0,t.layoutToInstances)(h,e)}},90794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderLayout=void 0;const o=n(60190),i=400,s=e=>e.reduce(((e,t)=>{const n=(0,o.vSub)(t.p,(0,o.vec)(t.s.width/2,t.s.height/2));return{...e,[t.id]:{p:n,s:t.s}}}),{});t.orderLayout=(e,t,n)=>{let{nodes:r,edges:a}=e,u=Object.entries(r).map((e=>{let[t,n]=e;return{id:t,p:(0,o.vAdd)(n.p,(0,o.vec)(n.s.width/2,n.s.height/2)),f:(0,o.vec)(0,0),v:(0,o.vec)(0,0),m:1,s:n.s}})),l=0;for(;l.01);){let e=u;for(let t=0;t{let n=e.find((e=>e.id===t[0])),i=e.find((e=>e.id===t[1]));if(!n||!i)return void console.warn("weoops",t[0],t[1]);const s=(0,o.vec)(0,-200),r=(0,o.vSub)(n.p,i.p),a=(0,o.vSub)(s,r),u=1e3*(0,o.vLen)(a),l=(0,o.vMul)((0,o.vNorm)(a),.5*u),c=(0,o.vMul)((0,o.vNorm)(a),-.5*u);n.f=(0,o.vAdd)(n.f,l),i.f=(0,o.vAdd)(i.f,c)})),e=e.map((e=>(0,o.itrPhysics)(15,e))),e=e.map((e=>{const t=(0,o.vMul)(e.v,.5),n=(0,o.vLen)(t)>100?(0,o.vMul)((0,o.vNorm)(t),100):t;return{...e,v:n}})),u=e,n&&n({nodes:s(e),edges:a},l),l++}return{nodes:s(u),edges:a,itrs:l,timeout:l>=t,total:(0,o.totalEnergy)(u)}}},2036:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PinView=t.PIN_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=n(50382),d=n(18420),p=n(74762),f=n(30994),m=n(96233),v=n(66189),h=n(30653);t.PIN_HEIGHT=23;t.PinView=u.memo((function(e){const{selected:t,type:n,connected:o,optional:i,currentInsId:s,isClosestToMouse:r,id:g,onMouseDown:I,onMouseUp:y}=e,{history:b,resetHistory:C,refreshHistory:_}=(0,v.useHistoryHelpers)(s,g,n),x=(0,h.useDarkMode)(),N="input"===n?(0,p.getInputName)(g):(0,p.getOutputName)(g),w="input"===e.type&&(0,d.isDefined)(e.constValue)?e.constValue:void 0,j=u.useCallback((e=>{0===e.button&&I(g,n,e)}),[g,n,I]),P=u.useCallback((e=>{0===e.button&&y(g,n,e)}),[g,n,y]);return(0,a.jsxs)("div",{className:(()=>{if("input"===e.type){const{isSticky:s,constValue:a}=e;return(0,l.default)("pin",{sticky:s,selected:t,closest:r,optional:i,connected:o,"const-value":(0,d.isDefined)(a),"env-value":(0,d.isDefined)(a)&&(0,p.isEnvValue)(a),minimized:e.minimized,dark:x},n)}return(0,l.default)("pin",{selected:t,connected:o,closest:r,optional:i,minimized:e.minimized,"error-pin":g===p.ERROR_PIN_ID,dark:x},n)})(),"data-pin-id":g,children:[(0,a.jsx)(c.Tooltip,{className:"pin-info-tooltip",content:(()=>{const t=(0,v.calcHistoryContent)(b,"input"===n?e.queuedValues:void 0),o=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:N})," (",n,")"," "]}),o,(0,a.jsx)("hr",{}),(0,d.isDefined)(w)?(0,a.jsxs)("div",{children:["Static value:"," ",(0,a.jsx)("strong",{children:(0,m.valuePreview)(w).substring(0,200)})]}):t]})})(),children:(0,a.jsxs)(c.ContextMenu,{onMouseEnter:_,onMouseOut:C,onMouseDown:j,onMouseUp:P,"data-tip":"","data-html":!0,"data-for":g+e.currentInsId,id:(0,f.getPinDomId)({fullInsIdPath:(0,p.fullInsIdPath)(e.currentInsId,e.ancestorsInsIds),pinId:g,pinType:n,isMain:!1}),onDoubleClick:t=>e.onDoubleClick&&e.onDoubleClick(g,t),className:(0,l.default)("pin-inner",{dark:x}),onClick:t=>{const{onShiftClick:o,onClick:i,id:s}=e;t.shiftKey&&o?o(s,t):i(s,n,t)},content:(()=>{const t=(0,a.jsx)(c.MenuItem,{onClick:()=>e.onInspect(e.currentInsId,{id:e.id,type:e.type}),text:"Inspect"});if("input"===e.type){const{onConvertConstToEnv:n}=e;return(0,d.isDefined)(w)?(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onDetachConstValue(e.id),text:"Detach value"}),(0,a.jsx)(c.MenuItem,{onClick:()=>e.onCopyConstValue(e.id),text:"Copy value"}),(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null,n?(0,a.jsx)(c.MenuItem,{onClick:()=>n(e.id),text:"Convert to Env Var"}):null]}):(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onToggleSticky(e.id),text:"Toggle sticky (square means sticky)"}),t,(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null]})}return(0,a.jsx)(c.Menu,{children:t})})(),children:[N," ",(0,d.isDefined)(w)?(0,a.jsxs)(u.Fragment,{children:[":",(0,a.jsx)("span",{className:"value",children:(0,d.toString)(w)})]}):null,"input"===e.type&&e.isSticky?(0,a.jsx)("span",{className:"suffix",children:"s"}):null,"input"===e.type&&e.queueSize?(0,a.jsxs)("span",{className:"suffix",children:[e.queueSize," in Q"]}):null]})}),(0,a.jsx)("div",{className:"wire"})]})}))},66189:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHistoryHelpers=t.calcHistoryContent=void 0;const i=n(35250),s=n(96233),r=o(n(70079)),a=n(70079),u=n(98158);t.calcHistoryContent=(e,t)=>{if(e){const{total:n,lastSamples:o}=e,a=(0,i.jsxs)("strong",{children:["Activated ",n," times this session"]}),u=o.length>0?(0,i.jsxs)("div",{children:["Last value:"," ",(0,i.jsx)("strong",{children:(0,s.valuePreview)(o[0].val).substring(0,200)}),(0,i.jsx)("br",{}),(0,i.jsx)("em",{children:"Inspect instance for the full value"})]}):"",l=t?(0,i.jsx)(r.default.Fragment,{children:(0,i.jsxs)("div",{children:["Queued values: ",(0,i.jsx)("strong",{children:t})]})}):"";return(0,i.jsxs)(r.default.Fragment,{children:[a,u,l]})}return"Loading session data.."};t.useHistoryHelpers=(e,t,n)=>{const o=(0,a.useRef)(),{onRequestHistory:i}=(0,u.useDebuggerContext)(),[s,l]=(0,a.useState)();return{history:s,refreshHistory:(0,a.useCallback)((()=>{clearInterval(o.current),i(e,t,n).then((e=>{l(e)})),o.current=setInterval((()=>{i(e,t,n).then((e=>{l(e)}))}),500)}),[e,i,t,n]),resetHistory:r.default.useCallback((()=>{clearInterval(o.current),l(void 0)}),[])}}},89440:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAddMenu=void 0;const r=n(35250),a=s(n(70079)),u=n(74762),l=n(50382),c=n(70457),d=n(9958),p=n(86125),f=c.Select.ofType(),m=e=>{switch(e.type){case"node":return`${e.node.id}`;case"value":return"Add inline value or function";case"import":return`Import ${e.importableNode.node.id} from ${e.importableNode.module}`}},v=(e,t)=>{let{handleClick:n,modifiers:o,query:i}=t;if(!o.matchesPredicate)return null;const s=m(e);return"value"===e.type?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(l.MenuDivider,{}),(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))]}):(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))},h=(e,t,n,o)=>{const i=m(t).toLocaleLowerCase(),s=e.toLowerCase();return o?i===s:i.includes(s)};t.QuickAddMenu=e=>{const{resolvedDependencies:t,targetNode:n}=e,o={left:e.pos.x,top:e.pos.y},{onRequestImportables:i}=(0,p.useDependenciesContext)(),[s,c]=a.useState();a.useEffect((()=>{i().then((e=>c(e.importables)))}),[i]);const d=(0,u.values)({...t,[n.id]:n}),m=d.map((e=>({type:"node",node:e}))),g=new Set(d.map((e=>e.id))),I=s?s.filter((e=>!g.has(e.node.id))).map((e=>({type:"import",importableNode:e}))):[],y=m.concat(I).concat({type:"value"});return(0,r.jsx)("div",{className:"quick-add-menu",style:o,children:(0,r.jsx)(f,{className:"quick-add-nodes-select",items:y,itemPredicate:h,itemRenderer:v,inputProps:{className:"quick-add-input"},noResults:(0,r.jsx)(l.MenuItem,{disabled:!0,text:"No results."}),onItemSelect:t=>e.onAdd(t),popoverProps:{isOpen:!0,onClose:()=>e.onClose()}})})}},71033:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89440),t)},73470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimePlayer=void 0;const o=n(74762),i=n(64955),s=(0,o.debugLogger)("runtime-player");t.createRuntimePlayer=()=>{let e=0,t=[];let n=!1,r=Date.now(),a=e;const u=()=>requestAnimationFrame((()=>{const l=Date.now();a=e,e+=l-r,r=l,((e,n)=>{const r=t;t=[],r.length&&s(`Playing ${r.length} events from`,e,n),r.forEach((e=>{s("Playing event",e),(0,i.playEvent)(e),e.insId===o.ROOT_INS_ID&&e.type===o.DebuggerEventType.PROCESSING_CHANGE&&!1===e.val&&(s("Main instance is done processing, clearing runtime UI",e),c())}))})(a,e),n&&u()})),l=()=>{n=!1},c=()=>{document.querySelectorAll("[data-runtime]").forEach((e=>{e.removeAttribute("data-runtime")})),document.querySelectorAll("[data-runtime-queue]").forEach((e=>{e.removeAttribute("data-runtime-queue")})),t=[]};return{stop:l,start:function(t){void 0===t&&(t=0),n=!0,e=t,r=Date.now(),u()},addEvents:e=>{t.push(...e)},destroy:()=>{l(),c()},clear:c,status:()=>({running:n,currDt:e,lastDt:a,queue:t,last:r})}}},64955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playEvent=t.cancelTimers=void 0;const o=n(74762),i=n(30994),s=5e3,r=(0,o.debugLogger)("runtime-player:play-event"),a=(e,t)=>e.type===o.DebuggerEventType.INPUT_CHANGE||e.type===o.DebuggerEventType.OUTPUT_CHANGE?`${(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds)}.${e.pinId}`:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds);t.cancelTimers=new Map;t.playEvent=e=>{switch(e.type){case o.DebuggerEventType.INPUT_CHANGE:case o.DebuggerEventType.OUTPUT_CHANGE:{const{pinId:n,insId:u,ancestorsInsIds:l}=e,c=e.type===o.DebuggerEventType.INPUT_CHANGE?"input":"output",d=[(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!0})];u!==o.ROOT_INS_ID&&d.push((0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!1})),d.forEach(((i,l)=>{const c=a(e);clearTimeout(t.cancelTimers.get(c));const d=document.getElementById(i),p=`${u}.${n}`,f=e.type===o.DebuggerEventType.OUTPUT_CHANGE?document.querySelectorAll(`[data-from-id="${p}"]`):[];if(d){clearTimeout(t.cancelTimers.get(c)),d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),setTimeout((()=>{d.setAttribute("data-runtime","active"),f.forEach((e=>{e.setAttribute("data-runtime","active")}))}),0);const n=setTimeout((()=>{d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),t.cancelTimers.delete(c)}),s);t.cancelTimers.set(a(e),n)}else console.warn(`No DOM element with Id [${i}] found to play event`),r(`No DOM element with Id [${i}] found to play event`,e)}));break}case o.DebuggerEventType.PROCESSING_CHANGE:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(l)if(!0===e.val)l.setAttribute("data-runtime","processing"),clearTimeout(t.cancelTimers.get(u));else{l.removeAttribute("data-runtime"),setTimeout((()=>{"error"!==l.getAttribute("data-runtime")&&l.setAttribute("data-runtime","done")}),0);const e=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,e)}else r(`No DOM element with Id [${n}] found to play event`,e)}));break}case o.DebuggerEventType.ERROR:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(!l)return void r(`No DOM element with Id [${n}] found to play event`,e);clearTimeout(t.cancelTimers.get(u)),l.removeAttribute("data-runtime"),setTimeout((()=>{l.setAttribute("data-runtime","error")}));const c=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,c)}));const c={...e,type:o.DebuggerEventType.OUTPUT_CHANGE,pinId:o.ERROR_PIN_ID};(0,t.playEvent)(c);break}case o.DebuggerEventType.INPUTS_STATE_CHANGE:(0,o.entries)(e.val).forEach((t=>{let[n,s]=t;const{insId:a,ancestorsInsIds:u}=e,l=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(a,u),pinId:n,pinType:"input",isMain:!1}),c=document.getElementById(l);c?s>0?c.setAttribute("data-runtime-queue",`${s}`):c.removeAttribute("data-runtime-queue"):r(`No DOM element with Id [${l}] found to play event`,e)}))}}},25804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounce=void 0;const o=n(70079);t.useDebounce=function(e,t){const[n,i]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}},7047:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.handleChangeNodeInputType=t.handleIoPinRename=t.handleInstanceDrag=t.getInstancesInRect=t.isJsxValue=t.getMiddleOfViewPort=t.fitViewPortToNode=t.centerBoardPosOnTarget=t.renderedPosToLogicalPos=t.logicalPosToRenderedPos=t.getEffectiveNodeDimensions=t.calcNodesPositions=t.calcSelectionBoxArea=t.animateViewPort=t.easeInOutNum=t.easeInOutPos=t.easeInOutQuad=t.center=t.distance=t.clamp=t.domToViewPort=t.roundNumber=t.createNewNodeInstance=t.createNewInlineNodeInstance=t.parseInputOutputTypes=t.parsePromptValue=t.getSelectionBoxRect=t.findClosestPin=t.changePinConfig=t.getInstancePinConfig=t.emptyList=t.emptyObj=void 0;const r=s(n(53865)),a=n(30721),u=n(63521),l=n(74762),c=n(18243),d=n(74762),p=n(53159),f=n(83782),m=n(60190),v=n(38259),h=n(83651),g=n(41032);t.emptyObj={},t.emptyList=[],t.getInstancePinConfig=function(e,n,o){var i;const s=e.instances.find((e=>e.id===n));if(!s)throw new Error(`Instance ${n} not found`);return null!==(i=(s.inputConfig||t.emptyObj)[o])&&void 0!==i?i:(0,l.queueInputPinConfig)()};t.changePinConfig=(e,t,n,o)=>r.produce(e,(e=>{var i;const{instances:s}=e,r=s.find((e=>e.id===t));if(!r)throw new Error("blah");const a=null!==(i=r.inputConfig)&&void 0!==i?i:{};a[n]=o,e.instances=s.map((e=>e===r?{...r,inputConfig:a}:e))}));t.findClosestPin=(e,t,n,o,i,s,r)=>{const a=(0,l.nodeInstance)(e.id,e.id),u=(0,d.okeys)(e.inputs).map((e=>({id:e,type:"input",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),p=(0,d.okeys)(e.outputs).map((e=>({id:e,type:"output",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),f=[...u,...e.instances.reduce(((n,a)=>{const u=(0,g.safelyGetNodeDef)(a,t),d=(0,h.getVisibleInputs)(a,u,e.connections),p=(0,h.getVisibleOutputs)(a,u,e.connections);return[...n,...d.map((e=>({ins:a,type:"input",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!1}),id:e}))),...p.map((e=>({ins:a,type:"output",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!1}),id:e})))]}),[]),...p];let m={dis:1e5,item:f[0]};return f.forEach((e=>{const t=e.pos.x-n.x,o=e.pos.y-n.y,i=Math.sqrt(t*t+o*o);i{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x,t.x)-n,h:Math.max(e.y,t.y)-o}};t.parsePromptValue=e=>{if(null===e)return;const t=parseInt(e,10);let n=e;return t.toString()!=e||isNaN(t)||(n=t),n};t.parseInputOutputTypes=e=>{const[,t,n]=e.match(/node\((.+)\|(.+)\)/)||[],o=(0,d.entries)(JSON.parse(t)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]})),i=(0,d.entries)(JSON.parse(n)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]}));return{inputs:(0,d.fromEntries)(o),outputs:(0,d.fromEntries)(i)}};t.createNewInlineNodeInstance=function(e,t,n){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const o=(0,l.inlineNodeInstance)(`${e.id}-${(0,d.randomInt)(999)}`,e,{},{x:0,y:0}),i=(0,p.calcNodeWidth)(o,e),{x:s,y:r}=n,a={x:s-i/2,y:r+t};return{...o,pos:a}};t.createNewNodeInstance=function(e,t,n,o){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const i="string"==typeof e?(0,g.safelyGetNodeDef)(e,o):e;if(!i)throw new Error(`${e} node not found in resolvedNodes`);const s=(0,d.entries)(i.inputs).reduce(((e,t)=>{let[n,o]=t;return o.defaultValue&&(e[n]=(0,l.staticInputPinConfig)(o.defaultValue)),e}),{}),r=(0,l.nodeInstance)((0,a.createId)(),i.id,s,{x:0,y:0}),c=(0,p.calcNodeWidth)(r,i),{x:f,y:m}=n,v={x:f-c/2,y:m+t};return{...r,pos:v}};t.roundNumber=e=>Math.round(100*e)/100;t.domToViewPort=(e,n,o)=>({x:(0,t.roundNumber)(n.pos.x+e.x/n.zoom/o.zoom),y:(0,t.roundNumber)(n.pos.y+e.y/n.zoom/o.zoom)});t.clamp=(e,t,n)=>Math.max(e,Math.min(t,n));t.distance=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)};t.center=(e,t,n)=>{let{zoom:o}=n;const i=e.x+e.w/2,s=e.y+e.h/2,{w:r,h:a}=t;return{x:i-r/o/2,y:s-a/o/2}};t.easeInOutQuad=e=>e<.5?2*e*e:(4-2*e)*e-1;t.easeInOutPos=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i),a=(0,t.easeInOutQuad)(r),u=n.x-e.x,l=n.y-e.y;return{x:e.x+u*a,y:e.y+l*a}};t.easeInOutNum=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i);return e+(n-e)*(0,t.easeInOutQuad)(r)};t.animateViewPort=(e,n,o,i)=>{const s=(0,t.distance)(e.pos,n.pos),r=Date.now(),a=o;if(0===s)return void i(e);const u=()=>{const o=Date.now(),s=(0,t.easeInOutPos)(e.pos,n.pos,r,a,o),l=(0,t.easeInOutNum)(e.zoom,n.zoom,r,a,o);o-r{const n=(0,t.getSelectionBoxRect)(e.from,e.to);return n.h*n.w};const I=(e,t,n,o)=>({left:n.x,right:n.x+e,top:n.y,bottom:n.y+t,tag:o,center:(0,l.calcCenter)({w:e,h:t,...n})});t.calcNodesPositions=(e,t)=>[...e.instances.map((e=>{const n=(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,t)),o=u.NODE_HEIGHT;return I(n,o,e.pos,e.id)})),...(0,d.okeys)(e.inputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.inputsPosition[t]||{x:0,y:0};return I(n,o,i,"input_"+t)})),...(0,d.okeys)(e.outputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.outputsPosition[t]||{x:0,y:0};return I(n,o,i,"output"+t)}))];t.getEffectiveNodeDimensions=(e,n)=>{const o=(0,t.calcNodesPositions)(e,n),i=o[0]||{left:0,right:0,top:0,bottom:0},s=o.reduce(((e,t)=>t.leftt.right>e?t.right:e),i.right),a=o.reduce(((e,t)=>t.topt.bottom>e?t.bottom:e),i.bottom)-a,d={x:s,y:a};return{size:{width:u,height:c},pos:d,center:(0,l.calcCenter)({w:u,h:c,...d})}};t.logicalPosToRenderedPos=(e,t)=>{const n=(0,m.vSub)(e,t.pos);return(0,m.vMul)(n,t.zoom)};t.renderedPosToLogicalPos=(e,t)=>{const n=(0,m.vDiv)(e,t.zoom);return(0,m.vAdd)(t.pos,n)};t.centerBoardPosOnTarget=(e,n,o,i)=>{const s=(0,t.logicalPosToRenderedPos)(e,i),r=(0,t.renderedPosToLogicalPos)(s,{...i,zoom:o}),a=Math.max(e.x,r.x)-Math.min(e.x,r.x),u=Math.max(e.y,r.y)-Math.min(e.y,r.y);return{x:o>i.zoom?i.pos.x+a:i.pos.x-a,y:o>i.zoom?i.pos.y+u:i.pos.y-u}};t.fitViewPortToNode=function(e,n,o,i){void 0===i&&(i=[20,150]);const{size:s,center:r}=(0,t.getEffectiveNodeDimensions)(e,n),a=i[0],u=i[1],l=s.width+a,c=s.height+u,d=o.width/l,p=o.height/c,f=Math.min(d,p)/1.15,m=(0,t.clamp)(.3,1.2,f);return{zoom:m,pos:{x:r.x-o.width/2/m,y:r.y-o.height/2/m+20}}};t.getMiddleOfViewPort=(e,n)=>{const o={x:n.width/2,y:n.height/2};return(0,t.renderedPosToLogicalPos)(o,e)};t.isJsxValue=e=>{const t=e=>(0,d.isDefined)(e.ref)&&(0,d.isDefined)(e.type)&&(0,d.isDefined)(e.props);try{const n=JSON.parse(e);return t(n)||Array.isArray(n)&&t(n[0])}catch(n){return!1}};t.getInstancesInRect=(e,n,o,i,s,r,a)=>{const{from:c,to:d}=e,f=(0,t.getSelectionBoxRect)(c,d);return s.filter((e=>{const{pos:t}=e,i={...t,w:(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,n))*o.zoom*a.zoom,h:u.NODE_HEIGHT*o.zoom*a.zoom};return(0,l.intersectRect)(f,i)||(0,l.intersectRect)(i,f)})).map((e=>e.id))};t.handleInstanceDrag=(e,t,n,o,i,s)=>{o.preventDefault(),o.stopPropagation();const a=(0,m.vSub)(n,t.pos);let u;const l=r.produce(e,(e=>{const r=e.instances.find((e=>e.id===t.id));if(!r)throw new Error("impossible state dragging instance that does not exist");!o.shiftKey&&s&&(u=[s]);const l=e.instances.filter((e=>i.includes(e.id)&&e!==r)),c=[r,...l],d=(0,v.getLeafInstancesOfSelection)(c,e.instances,e.connections);[...l,...d].forEach((e=>{e.pos=(0,m.vAdd)(e.pos,a)})),r.pos=n,!o.shiftKey&&s&&(u=[s])}));return{newValue:l,newSelected:u}};t.handleIoPinRename=(e,t,n,o)=>r.produce(e,(e=>{"input"===t?(e.inputs[o]=e.inputs[n],e.inputsPosition[o]=e.inputsPosition[n],delete e.inputs[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===n?{...e,from:{...e.from,pinId:o}}:e))):(e.outputs[o]=e.outputs[n],e.outputsPosition[o]=e.outputsPosition[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===n?{...e,to:{...e.to,pinId:o}}:e)),e.completionOutputs=(e.completionOutputs||[]).map((e=>e.split("+").map((e=>e===n?o:n)).join("+"))),delete e.outputs[n])}));t.handleChangeNodeInputType=(e,t,n)=>r.produce(e,(e=>{const o=e.inputs[t];if(!o)throw new Error("Wat");o.mode=n}))},42403:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorClient=void 0;const i=n(74762),s=o(n(18706)),r=n(32048),a=n(31758),u=(0,i.debugLogger)("remote-debugger:editor-client");t.createEditorClient=(e,t)=>{const n=new URL(e),o=(0,r.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/editor`,timeout:3e4});return o.emit("join-room-editor",t),{emitChange:e=>{o.emit(a.DebuggerServerEventType.CHANGE_EVENT_NAME,e)},emitBreakpointsChange:e=>{o.emit(a.DebuggerServerEventType.UPDATE_BREAKPOINTS,e)},interceptInput:e=>{o.emit(a.DebuggerServerEventType.INPUT_VALUE_OVERRIDE,e)},interceptOutput:e=>{o.emit(a.DebuggerServerEventType.OUTPUT_VALUE_OVERRIDE,e)},onRuntimeReady:e=>(o.on(a.DebuggerServerEventType.RUNTIME_READY,e),()=>o.off(a.DebuggerServerEventType.RUNTIME_READY,e)),onChangeAwk:e=>(o.on(a.DebuggerServerEventType.CHANGE_AWK,e),()=>o.off(a.DebuggerServerEventType.CHANGE_AWK,e)),onChangeError:e=>(o.on(a.DebuggerServerEventType.CHANGE_ERROR,e),()=>o.off(a.DebuggerServerEventType.CHANGE_ERROR,e)),onIsAlive:e=>(o.on(a.DebuggerServerEventType.IS_ALIVE,e),()=>o.off(a.DebuggerServerEventType.IS_ALIVE,e)),emitInputValue:(e,t)=>{u(`Emitting push input value to ${e} %o`,t),o.emit(a.DebuggerServerEventType.PUSH_INPUT_VALUE,{pinId:e,value:t})},destroy:()=>{o.disconnect(),(0,a.enumToArray)(a.DebuggerServerEventType).forEach((e=>o.off(e)))},onDisconnect:e=>(o.on("disconnect",e),()=>o.off("disconnect",e)),debugInfo:()=>`Remote debugger for ${e}`,onBatchedEvents:e=>(o.on(a.DebuggerServerEventType.EVENTS_BATCH,e),()=>o.off(a.DebuggerServerEventType.EVENTS_BATCH,e)),requestState:()=>s.default.get(`${e}/state`).then((e=>e.data.state)),getHistory:n=>s.default.get(`${e}/history`,{params:{insId:n.insId,pinId:n.pinId,limit:n.limit,executionId:t}}).then((e=>e.data)),clearHistory:()=>s.default.delete(`${e}/history`).then((()=>{})),triggerNode:(t,n)=>s.default.post(`${e}/trigger`,{nodeId:t,inputs:n}).then((e=>e.data))}}},58066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeData=void 0;const o=n(74762),i=n(36783),s=(0,o.debugLogger)("remote-debugger:normalize-data");t.normalizeData=e=>{if(e instanceof Error)return(0,i.serializeError)(e);if("object"==typeof e&&null!==e){e={...e};const t=new WeakSet,n=e=>{if("bigint"==typeof e)return e.toString();if("object"!=typeof e||Array.isArray(e))return e;if(null===e)return e;if(t.has(e))return"[Circular]";try{t.add(e)}catch(o){s("Error adding to WeakSet","data:",e,"type:",typeof e,"error:",o)}if(Array.isArray(e))return e.map(n);if("object"==typeof e){const t={};for(const o in e)t[o]=n(e[o]);return t}return e};return n(e)}return e}},39641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimeClient=t.DEFAULT_DT_SCALE=void 0;const o=n(74762),i=n(32048),s=n(31758),r=n(58066),a=(0,o.debugLogger)("remote-debugger:runtime-client");t.DEFAULT_DT_SCALE=1;t.createRuntimeClient=(e,t)=>{const n=new URL(e),u=(0,i.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/runtime`,timeout:1e3,reconnectionAttempts:3});u.emit("join-room-runtime",t),u.on("connection",(e=>{e.join(t)}));let l=new Set;u.on(s.DebuggerServerEventType.UPDATE_BREAKPOINTS,(e=>{l=new Set(e)}));const c=(0,o.cappedArrayDebounce)((e=>{a(`Emitting debounced batched events - ${e.length}`),u.emit(s.DebuggerServerEventType.EVENTS_BATCH,e)}),100,200);return{onChange:e=>(u.on(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e),()=>u.off(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e)),onInput:e=>(u.on(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e),()=>u.off(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e)),emitEvent:e=>{a(`Emitting event ${e.type} change event of ${e.insId}`),e.val=(0,r.normalizeData)(e.val),c.addItem({...e,time:Date.now()})},emitRuntimeReady:()=>{u.emit(s.DebuggerServerEventType.RUNTIME_READY,{})},emitChangeAwk:()=>{u.emit(s.DebuggerServerEventType.CHANGE_AWK,{})},emitChangeError:e=>{u.emit(s.DebuggerServerEventType.CHANGE_ERROR,{error:e})},emitIsAlive:e=>{u.emit(s.DebuggerServerEventType.IS_ALIVE,{time:e})},destroy:async()=>{c.pendingItems()&&(c.flush(),await(0,o.delay)(100)),(0,s.enumToArray)(s.DebuggerServerEventType).forEach((e=>u.off(e))),u.disconnect()},onDisconnect:e=>(u.on("disconnect",e),()=>u.off("disconnect",e)),waitForConnection:()=>new Promise(((e,t)=>{u.connected?e():(u.on("connect_error",(e=>{t(`Socket connect error: ${e}`)})),u.on("connect",(()=>{e()})))}))}}},31758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerServerEventType=t.enumToArray=t.isNumber=t.isSimpleType=t.valuePreview=t.toString=void 0;const o=n(36783);t.toString=e=>{if("object"===typeof e){if(e instanceof Error)return JSON.stringify((0,o.serializeError)(e));try{return JSON.stringify(e).substr(0,250)}catch(t){return"Object (cannot stringify)"}}return`${e}`.substr(0,250)};t.valuePreview=e=>(0,t.toString)(e).substr(0,100);t.isSimpleType=e=>["number","string","boolean"].includes(typeof e);t.isNumber=e=>!1===isNaN(Number(e)),t.enumToArray=function(e){return Object.keys(e).filter(t.isNumber).map((t=>e[t]))},function(e){e.RUNTIME_READY="runtime-ready",e.CHANGE_EVENT_NAME="change",e.PUSH_INPUT_VALUE="push-input-value",e.CHANGE_AWK="live-change-awk",e.CHANGE_ERROR="live-change-error",e.IS_ALIVE="is-alive",e.UPDATE_BREAKPOINTS="update-breakpoints",e.INPUT_VALUE_OVERRIDE="input-value-override",e.OUTPUT_VALUE_OVERRIDE="output-value-override",e.INPUT_VALUE_CHANGE="input-value-changed",e.OUTPUT_VALUE_CHANGE="output-value-changed",e.PROCESSING_CHANGE="processing-changed",e.INPUTS_STATE_CHANGE="inputs-state-changed",e.NODE_ERROR="node-error",e.EVENTS_BATCH="events-batch"}(t.DebuggerServerEventType||(t.DebuggerServerEventType={}))},96233:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31758),t),i(n(42403),t),i(n(39641),t)},43920:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Equals=t.EqualsBoolean=t.Throttle=t.ThrottleError=t.Debounce=t.Interval=t.Delay=t.Switch4=t.Switch2=t.Switch3=t.EmitOnTrigger=t.BooleanSplit=t.Subscribe=t.Publish=t.RoundRobin4=t.RoundRobin2=t.RoundRobin3=t.LimitTimes=void 0;const o=n(11253),i="Control Flow";t.LimitTimes={id:"Limit Times",namespace:i,description:"Item will be emitted until the limit is reached",inputs:{item:{mode:"required",description:"The item to emit"},times:{mode:"required",description:"The number of times to emit the item"},reset:{mode:"optional",description:"Reset the counter"}},outputs:{ok:{}},reactiveInputs:["item","reset"],completionOutputs:[],run:function(e,t,n){const{state:o}=n,{item:i,times:s,reset:r}=e,{ok:a}=t;if(void 0!==r)return void o.set("val",0);let u=o.get("val")||0;u++,o.set("val",u),u>=s?n.onError(new Error(`Limit of ${s} reached`)):a.next(i)}},t.RoundRobin3={id:"Round Robin 3",namespace:i,description:"Item will be emitted to one of the three outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r}=t,a=o.get("curr")||0,u=(a+1)%3;[i,s,r][a].next(e.item),o.set("curr",u)}},t.RoundRobin2={namespace:i,id:"Round Robin 2",description:"Item will be emitted to one of the 2 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s}=t,r=o.get("curr")||0,a=(r+1)%2;[i,s][r].next(e.item),o.set("curr",a)}},t.RoundRobin4={id:"Round Robin 4",namespace:i,description:"Item will be emitted to one of the 4 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves to "r4"\'s turn.'},r4:{description:'The fourth output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r,r4:a}=t,u=o.get("curr")||0,l=(u+1)%4;[i,s,r,a][u].next(e.item),o.set("curr",l)}},t.Publish={id:"Publish",namespace:i,description:"Publishes a value by a key to all listeners in the current flow. Use 'Subscribe' to listen to events.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},value:{mode:"required"}},outputs:{},run:function(e,t,n){const i=`${n.ancestorsInsIds}__${e.key}`;o.publish(i,e.value)}},t.Subscribe={id:"Subscribe",namespace:i,description:"Subscribes to a value published by a key. Use 'Publish' to publish values.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},initial:{mode:"required-if-connected",description:"If passed will be published has the first value"}},completionOutputs:[],outputs:{value:{description:"The value published by the key"}},run:function(e,t,n){const{value:i}=t,s=`${n.ancestorsInsIds}__${e.key}`,r=o.subscribe(s,((e,t)=>{i.next(t)}));void 0!==e.initial&&i.next(e.initial),n.onCleanup((()=>{o.unsubscribe(r)}))}},t.BooleanSplit={namespace:i,id:"Boolean Split",description:"Splits a boolean value into two outputs",inputs:{value:{mode:"required",description:"Boolean value"},trueValue:{mode:"required-if-connected",description:"Value to emit if the input is true. Defaults to true"},falseValue:{mode:"required-if-connected",description:"Value to emit if the input is false. Defaults to false"}},outputs:{true:{description:"The value is true"},false:{description:"The value is false"}},run:function(e,t){const{true:n,false:o}=t,{value:i,trueValue:s,falseValue:r}=e;i?n.next(null==s||s):o.next(null!=r&&r)}},t.EmitOnTrigger={namespace:i,id:"Emit on Trigger",description:"Emits the value when the trigger input receives any value",inputs:{value:{mode:"required",description:"The value to emit"},trigger:{mode:"required",description:"The trigger to emit the value"}},outputs:{result:{description:"The value emitted"}},run:function(e,t){const{result:n}=t,{value:o,trigger:i}=e;void 0!==i&&n.next(o)}},t.Switch3={namespace:i,id:"Switch 3",description:"Switches between 3 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,default:s,outputValue:r}=t,{value:a,firstCase:u,secondCase:l,thirdCase:c}=e;a===u?n.next(null!=r?r:a):a===l?o.next(null!=r?r:a):a===c?i.next(null!=r?r:a):s.next(null!=r?r:a)}},t.Switch2={id:"Switch 2",description:"Switches between 2 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,default:i,outputValue:s}=t,{value:r,firstCase:a,secondCase:u}=e;r===a?n.next(null!=s?s:r):r===u?o.next(null!=s?s:r):i.next(null!=s?s:r)}},t.Switch4={id:"Switch 4",description:"Switches between 4 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},fourthCase:{mode:"required",description:"The value to switch on for the fourth output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},fourth:{description:"The value emitted if the input value is equal to the fourth case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,fourth:s,default:r,outputValue:a}=t,{value:u,firstCase:l,secondCase:c,thirdCase:d,fourthCase:p}=e;u===l?n.next(null!=a?a:u):u===c?o.next(null!=a?a:u):u===d?i.next(null!=a?a:u):u===p?s.next(null!=a?a:u):r.next(null!=a?a:u)}},t.Delay={id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:i,description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:async(e,t)=>{let{value:n,delay:o}=e,{delayedValue:i}=t;await new Promise((e=>setTimeout(e,o))),i.next(n)}},t.Interval={id:"Interval",namespace:i,defaultStyle:{icon:"fa-clock"},description:"Emits a value every interval",inputs:{value:{description:"Value to emit"},interval:{description:"Interval in milliseconds"}},reactiveInputs:["value","interval"],outputs:{value:{description:"Emitted value"}},completionOutputs:[],run:(e,t,n)=>{n.state.get("timer")&&clearInterval(n.state.get("timer"));const o=setInterval((()=>{t.value.next(e.value)}),e.interval);n.state.set("timer",o),n.onCleanup((()=>{clearInterval(o)}))}},t.Debounce={id:"Debounce",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be debounced"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The debounced value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the last value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:s}=t,r=n.state.get("timer");r&&clearTimeout(r);const a=setTimeout((()=>{s.next(o)}),i);n.state.set("timer",a),n.onCleanup((()=>{clearTimeout(r)}))}};class s extends Error{constructor(e){super("Throttle: Value dropped"),this.value=e}}t.ThrottleError=s,t.Throttle={id:"Throttle",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be throttled"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The throttled value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the first value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:r}=t;if(n.state.get("timer"))n.onError(new s(o));else{r.next(o);const e=setTimeout((()=>{n.state.set("timer",null)}),i);n.state.set("timer",e)}}},t.EqualsBoolean={id:"Equals (Bool)",defaultStyle:{icon:"fa-equals"},namespace:i,description:"Emits true if two values are equal (=== equality). Otherwise emits false.",inputs:{a:{description:"First value"},b:{description:"Second value"}},outputs:{result:{description:"true if a is equal to b"}},run:(e,t)=>{let{a:n,b:o}=e,{result:i}=t;return i.next(n===o)}},t.Equals={id:"Equals",namespace:i,description:'Emits the value of "a" to output "true" if "a" is equal to "b". Otherwise emits the value of "a" to output "false".',inputs:{a:{mode:"required",description:"First value"},b:{mode:"required",description:"Second value"}},outputs:{true:{description:"Emits the value of a if a is equal to b"},false:{description:"Emits the value of a if a is not equal to b"}},run:(e,t)=>{const{a:n,b:o}=e,{true:i,false:s}=t;n===o?i.next(n):s.next(n)}}},65645:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var o=n(70079),i=n(11253),s=n(74089),r=n(74762),a=n(21766);var u=n(10831),l=n(61997),c=n(77852);const d=(0,a.S)(),p=[0,20],f=e=>{let{flow:t,output:n,inputs:o,onError:s,debugDelay:a,onCompleted:u,dependencies:l,player:c}=e;const p=((e,t)=>{const n=new Set;return{onEvent:o=>{const i={...o,time:Date.now(),executionId:"n/a"};console.info("Got debugger event",o),t.addEvents([i]),e.addEvents([i]),n.forEach((e=>e([i])))},onBatchedEvents:e=>(n.add(e),()=>n.delete(e))}})(c,d);p.debugDelay=a;const f=(0,r.keys)(t.node.outputs)[0];return{executeResult:(0,r.execute)({node:t.node,inputs:o,outputs:{[f]:n},resolvedDeps:{...l,[t.node.id]:t.node},_debugger:p,onCompleted:u,onBubbleError:e=>{s(e)},extraContext:{PubSub:i}}),localDebugger:p}},m=e=>{const{debugDelay:t,onOutput:i,flowProps:a}=e,{flow:m,inputs:v,output:h}=a,g=(0,o.useRef)((0,s.createRuntimePlayer)()),[I,y]=(0,o.useState)(e.flowProps.dependencies),[b,C]=(0,o.useState)(),[_]=(0,s.useDebounce)(I,500),x=(0,c.useDarkMode)(),N=async(e,t)=>{const{node:o}=e,i=Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).find((e=>(0,r.isBaseNode)(e)&&e.id===o.id));let a;y((e=>({...e,[i.id]:{...i,source:{path:"@flyde/stdlib/dist/all-browser",export:i.id}}})));const l=(0,u.ZP)(m,(n=>{if(t){const o=(0,s.vAdd)({x:0,y:0},t.pos);if(a=(0,s.createNewNodeInstance)(e.node,0,o,I),n.node.instances.push(a),t.connectTo){const{insId:e,outputId:o}=t.connectTo;n.node.connections.push({from:{insId:e,pinId:o},to:{insId:a.id,pinId:r.TRIGGER_PIN_ID}})}}}));await new Promise((e=>setTimeout(e,10)));const c=(0,u.ZP)(j,(e=>{e.flow=l,t?.selectAfterAdding&&a&&(e.boardData.selected=[a?.id])}));return P(c),(0,s.toastMsg)(`Node ${o.id} successfully imported from ${e.module}`),I},w=async()=>({importables:Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).filter(r.isBaseNode).map((e=>({node:{...e,source:{path:"n/a",export:"n/a"}},module:"@flyde/stdlib"}))),errors:[]}),[j,P]=(0,o.useState)({flow:m,boardData:{viewPort:{pos:{x:0,y:0},zoom:1},lastMousePos:{x:0,y:0},selected:[]}});(0,o.useEffect)((()=>{P((e=>({...e,flow:m})))}),[m]),(0,o.useEffect)((()=>{y((e=>({...e,main:j.flow.node})))}),[j.flow.node]);const O={state:j,onChangeEditorState:P,hideTemplatingTips:!0,initialPadding:p,onExtractInlineNode:r.noop,disableScrolling:!0,darkMode:x.isDarkMode};(0,o.useEffect)((()=>{g.current.start()}),[]),(0,o.useEffect)((()=>{const{executeResult:n,localDebugger:o}=f({flow:j.flow,dependencies:I,output:h,inputs:v,onError:r.noop,debugDelay:t,player:g.current,onCompleted:e.onCompleted}),s=e.flowProps.output.subscribe((e=>i(e)));return C(o),()=>{n(),s.unsubscribe()}}),[t,_]);const E=(0,o.useMemo)((()=>({resolvedDependencies:I,onImportNode:N,onRequestImportables:w})),[]),D=(0,o.useMemo)((()=>({debuggerClient:b,onRequestHistory:d.requestHistory})),[b]);return o.createElement(l.Z,null,(()=>o.createElement(s.DependenciesContextProvider,{value:E},o.createElement(s.DebuggerContextProvider,{value:D},o.createElement(s.FlowEditor,O)))))}},21766:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var o=n(74762);const i=200,s=()=>{const e=new Map,t=new Map;return{requestHistory:async(n,s,r)=>{const a="input"===r?o.DebuggerEventType.INPUT_CHANGE:o.DebuggerEventType.OUTPUT_CHANGE;if(console.log({insId:n,pinId:s,type:a}),s){const t=`${n}.${s}.${a}`,o=e.get(t)||{total:0,lastSamples:[]},r=o.lastSamples.slice(0,i);return{...o,lastSamples:r}}{const e=t.get(n)||{total:0,lastSamples:[]},o=e.lastSamples.slice(0,i);return{...e,lastSamples:o}}},addEvents:n=>{n.forEach((n=>{if(n.type===o.DebuggerEventType.ERROR){const e=n;e.type=o.DebuggerEventType.OUTPUT_CHANGE,e.pinId=o.ERROR_PIN_ID}if(n.type===o.DebuggerEventType.INPUT_CHANGE||n.type===o.DebuggerEventType.OUTPUT_CHANGE){const{insId:o,type:s,pinId:r}=n;{const t=`${o}.${r}.${s}`,a=e.get(t)||{total:0,lastSamples:[]};a.lastSamples.unshift(n),a.lastSamples.length>i&&a.lastSamples.splice(i,a.lastSamples.length-i),a.total++,e.set(t,a)}{const s=t.get(o)||{total:0,lastSamples:[]};s.lastSamples.unshift(n),s.lastSamples.length>i&&s.lastSamples.splice(i,s.lastSamples.length-i),s.total++,e.set(o,s)}}}))}}}},4144:(e,t,n)=>{"use strict";n.d(t,{V:()=>r});var o=n(10328),i=n(70079);const s=e=>i.createElement("li",{className:"log-item"},i.createElement("main",{className:"content"},e.value),i.createElement("aside",null,new Date(e.time).toLocaleTimeString())),r=e=>{const[t,n]=i.useState([]);return i.useEffect((()=>{e.output.subscribe((e=>{const t="object"==typeof e&&i.isValidElement(e)?e:`${e}`;n((e=>[...e,{value:t,time:Date.now()}]))}))}),[]),i.createElement("div",{className:"output-log"},i.createElement("header",null,"Output Log"," ",i.createElement("button",{className:"clear-btn button button--outline button--secondary button--sm",onClick:()=>n([])},"Clear")),i.createElement("main",null,i.createElement("ul",null,t.map(((e,t)=>i.createElement(s,(0,o.Z)({},e,{key:t}))))),0===t.length?i.createElement("div",{className:"empty-state"},"Nothing to show. Interact with the example to emit some outputs!"):null))}},79256:(e,t,n)=>{"use strict";n.d(t,{I:()=>p});var o=n(70079),i=n(65092),s=n(19841),r=n(49794),a=n(21766),u=n(73949),l=n(81098),c=n(65645);(0,a.S)();const d=[{title:"Hello World",key:"hello-world"},{title:"React Counter",key:"react-counter"},{title:"BMI Calculator",key:"bmi"},{title:"REST API Usage",key:"apis"},{title:"Debounce vs. Throttling",key:"debounce-throttling"},{title:"Fibonacci Seq.",key:"fibonacci"}],p=e=>{const[t,n]=(0,o.useState)(e.initWidth||500),[a,p]=(0,o.useState)(e.defaultDelay||0),[f,m]=(0,o.useState)(!1),v=(0,o.useCallback)(((e,t)=>{let{size:o}=t;n(o.width)}),[]),h=o.createElement("div",{className:"delay-container"},o.createElement("input",{type:"range",id:"volume",name:"delay",value:a,step:"100",min:"0",max:"300",onChange:e=>p(Number(e.target.value))}),o.createElement("label",{htmlFor:"volume"},"Debug Delay: ",a,"ms")),g=d.findIndex((t=>t.key===e.meta.key)),I=d[g+1],y=d[g-1];return o.createElement(i.Z,{title:`${e.meta.title} | Playground`,description:`Flyde Playground - ${e.meta.title} example`},o.createElement("header",{className:(0,s.default)("hero hero--primary",u.Z.heroBanner,"playground-hero")},o.createElement("div",{className:"container"},o.createElement("h1",{className:"hero__title"},"Welcome to Flyde's Online Playground"),o.createElement("p",{className:"hero__subtitle"},"Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!"))),o.createElement("div",{className:"mobile-warning"},"Flyde is currently not optimized for mobile devices. Please"," ",o.createElement("strong",null,"use a desktop computer for the best experience"),"."),o.createElement("ul",{className:"examples__menu"},d.map((e=>o.createElement("li",{key:e.key},o.createElement(r.Z,{to:`/playground/${e.key}`,className:"button button--primary"},e.title))))),o.createElement("div",{className:"playground-container"},o.createElement("header",null,o.createElement("h2",{className:"playground-title"},e.meta.title),o.createElement("div",{className:"playground-description"},e.meta.description),f?o.createElement(o.Fragment,null,o.createElement("hr",null),o.createElement("div",{className:"playground-extra"},e.extraInfo||e.meta.extraInfo,o.createElement("div",{className:"star-hint"},o.createElement("span",null,"\xa0 PS: Did you like this example?"),"Please consider giving a \u2b50\ufe0f to the project"," ",o.createElement("span",{className:"star-wrapper"},o.createElement("iframe",{className:"gh-stars-frame",src:"https://ghbtns.com/github-btn.html?user=flydelabs&repo=flyde&type=star&count=true&size=small",width:100,height:20,title:"GitHub Stars"}))))):null,e.prefixComponent),o.createElement("div",{className:"playground"},o.createElement("div",{className:"flow-container"},!0!==e.hideDelay?h:null,o.createElement(c.Y,{flowProps:e.flowProps,debugDelay:a,onOutput:()=>m(!0)})),o.createElement(l.Resizable,{height:0,width:t,onResize:v,handle:o.createElement("div",{className:"handle"}),axis:"x",resizeHandles:["w"]},o.createElement("div",{className:"output-container",style:{flexBasis:t}},e.children))),o.createElement("nav",{className:"pagination-nav"},o.createElement("div",{className:"pagination-nav__item"},y?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${y.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Previous Example"),o.createElement("div",{className:"pagination-nav__label"},y.title)):null),o.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},I?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${I.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Next Example"),o.createElement("div",{className:"pagination-nav__label"},I.title)):null))))}},44046:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var o=n(70079),i=n(74762),s=n(79256);const r={dependencies:{Delay:{id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:"Control Flow",description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:n(43920).Delay.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Delay"}}},flow:{imports:{"@flyde/stdlib":["Delay"]},node:{instances:[{pos:{x:-249.638056640625,y:-391.20183471679684},id:"Inline-value-Hello World-673",inputConfig:{},node:{id:"Inline-value-Hello",inputs:{},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:'const result = ("Hello"); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"Hello"',dataBuilderSource:"IkhlbGxvIg==",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},style:{size:"large",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-92.58089599609374,y:-99.73132080078125},id:"clbdutwlh000c4664hu8g9uxd",inputConfig:{},node:{id:"Inline-value-World!",inputs:{},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:'const result = ("World!"); Promise.resolve(result).then(val => outputs.value.next(val))',customViewCode:'"World!"',dataBuilderSource:"IldvcmxkISI=",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},style:{size:"large",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}},{pos:{x:-53.302717285156234,y:-233.93417114257812},id:"Delay-621",inputConfig:{delay:{mode:"static",value:3e3}},nodeId:"Delay"}],connections:[{from:{insId:"Inline-value-Hello World-673",pinId:"value"},to:{insId:"__this",pinId:"output"}},{from:{insId:"clbdutwlh000c4664hu8g9uxd",pinId:"value"},to:{insId:"__this",pinId:"output"}},{from:{insId:"Inline-value-Hello World-673",pinId:"value"},to:{insId:"Delay-621",pinId:"value"}},{from:{insId:"Delay-621",pinId:"delayedValue"},to:{insId:"clbdutwlh000c4664hu8g9uxd",pinId:"__trigger"}}],id:"Main",inputs:{},outputs:{output:{type:"any",optional:!1,delayed:!1}},inputsPosition:{},outputsPosition:{result:{x:-205.4333437325436,y:70.46791651575376},output:{x:-193.31878077738958,y:61.65730860559751}}}}};var a=n(4144);const u={title:"Hello World",description:'This is the "Hello, World!" example for Flyde. When you run this flow, it will output "Hello", wait for 3 seconds, and then output "World!". Click the "Run" button below to see it in action. This example highlights one of the key strengths of Flyde: the ability to view your program running in real-time. Note that the delay in the flow is intentional and added to make the example longer.',key:"hello-world"},l='Great job. You can change the strings double-clicking them. Double click on the green "ms: 3000" to edit the delay threshold. Go ahead, try it now!';function c(){const e=(0,o.useRef)((0,i.dynamicOutput)()),t=(0,o.useRef)({__trigger:(0,i.dynamicNodeInput)()}),[n,c]=(0,o.useState)({flow:r.flow,dependencies:r.dependencies,inputs:t.current,output:e.current}),d=o.createElement("button",{className:"button button--success",onClick:()=>t.current.__trigger.subject.next("run")},"Run!");return o.createElement(s.I,{meta:u,flowProps:n,hideDelay:!0,prefixComponent:d,initWidth:300,extraInfo:l},o.createElement(a.V,{output:e.current}))}},71216:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var o=n(70079),i=n(44046);function s(){return(0,o.useEffect)((()=>{history.pushState("/playground/hello-world","Hello World","/playground/hello-world")}),[]),(0,i.default)()}},73949:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={"flyde-flow-editor":"flyde-flow-editor_AAD4",_hj_feedback_container:"_hj_feedback_container_Af03"}},85721:(e,t,n)=>{var o={"./af":47654,"./af.js":47654,"./ar":61325,"./ar-dz":98344,"./ar-dz.js":98344,"./ar-kw":26230,"./ar-kw.js":26230,"./ar-ly":42524,"./ar-ly.js":42524,"./ar-ma":44119,"./ar-ma.js":44119,"./ar-sa":82625,"./ar-sa.js":82625,"./ar-tn":42182,"./ar-tn.js":42182,"./ar.js":61325,"./az":37093,"./az.js":37093,"./be":32721,"./be.js":32721,"./bg":59919,"./bg.js":59919,"./bm":95594,"./bm.js":95594,"./bn":563,"./bn-bd":41757,"./bn-bd.js":41757,"./bn.js":563,"./bo":73211,"./bo.js":73211,"./br":87438,"./br.js":87438,"./bs":83662,"./bs.js":83662,"./ca":61196,"./ca.js":61196,"./cs":5841,"./cs.js":5841,"./cv":85251,"./cv.js":85251,"./cy":24512,"./cy.js":24512,"./da":37539,"./da.js":37539,"./de":5059,"./de-at":53853,"./de-at.js":53853,"./de-ch":99378,"./de-ch.js":99378,"./de.js":5059,"./dv":91454,"./dv.js":91454,"./el":39651,"./el.js":39651,"./en-au":87953,"./en-au.js":87953,"./en-ca":98193,"./en-ca.js":98193,"./en-gb":61980,"./en-gb.js":61980,"./en-ie":14050,"./en-ie.js":14050,"./en-il":6502,"./en-il.js":6502,"./en-in":555,"./en-in.js":555,"./en-nz":11372,"./en-nz.js":11372,"./en-sg":26568,"./en-sg.js":26568,"./eo":69533,"./eo.js":69533,"./es":68327,"./es-do":17620,"./es-do.js":17620,"./es-mx":96467,"./es-mx.js":96467,"./es-us":83272,"./es-us.js":83272,"./es.js":68327,"./et":68523,"./et.js":68523,"./eu":19066,"./eu.js":19066,"./fa":59087,"./fa.js":59087,"./fi":96443,"./fi.js":96443,"./fil":93979,"./fil.js":93979,"./fo":90383,"./fo.js":90383,"./fr":56327,"./fr-ca":25610,"./fr-ca.js":25610,"./fr-ch":97274,"./fr-ch.js":97274,"./fr.js":56327,"./fy":67442,"./fy.js":67442,"./ga":44291,"./ga.js":44291,"./gd":77342,"./gd.js":77342,"./gl":96248,"./gl.js":96248,"./gom-deva":21404,"./gom-deva.js":21404,"./gom-latn":20833,"./gom-latn.js":20833,"./gu":9122,"./gu.js":9122,"./he":74623,"./he.js":74623,"./hi":60364,"./hi.js":60364,"./hr":30860,"./hr.js":30860,"./hu":70441,"./hu.js":70441,"./hy-am":90425,"./hy-am.js":90425,"./id":29672,"./id.js":29672,"./is":96150,"./is.js":96150,"./it":27852,"./it-ch":55603,"./it-ch.js":55603,"./it.js":27852,"./ja":16465,"./ja.js":16465,"./jv":20120,"./jv.js":20120,"./ka":87245,"./ka.js":87245,"./kk":21479,"./kk.js":21479,"./km":65038,"./km.js":65038,"./kn":63060,"./kn.js":63060,"./ko":85020,"./ko.js":85020,"./ku":90582,"./ku.js":90582,"./ky":34950,"./ky.js":34950,"./lb":94201,"./lb.js":94201,"./lo":87894,"./lo.js":87894,"./lt":70120,"./lt.js":70120,"./lv":4265,"./lv.js":4265,"./me":14030,"./me.js":14030,"./mi":9463,"./mi.js":9463,"./mk":25898,"./mk.js":25898,"./ml":64233,"./ml.js":64233,"./mn":47156,"./mn.js":47156,"./mr":34479,"./mr.js":34479,"./ms":24691,"./ms-my":6456,"./ms-my.js":6456,"./ms.js":24691,"./mt":81789,"./mt.js":81789,"./my":37452,"./my.js":37452,"./nb":91170,"./nb.js":91170,"./ne":87529,"./ne.js":87529,"./nl":81776,"./nl-be":24455,"./nl-be.js":24455,"./nl.js":81776,"./nn":34705,"./nn.js":34705,"./oc-lnc":36139,"./oc-lnc.js":36139,"./pa-in":17960,"./pa-in.js":17960,"./pl":1899,"./pl.js":1899,"./pt":31670,"./pt-br":29159,"./pt-br.js":29159,"./pt.js":31670,"./ro":55115,"./ro.js":55115,"./ru":45149,"./ru.js":45149,"./sd":81231,"./sd.js":81231,"./se":35397,"./se.js":35397,"./si":99786,"./si.js":99786,"./sk":39383,"./sk.js":39383,"./sl":68691,"./sl.js":68691,"./sq":34826,"./sq.js":34826,"./sr":40080,"./sr-cyrl":75673,"./sr-cyrl.js":75673,"./sr.js":40080,"./ss":54309,"./ss.js":54309,"./sv":52245,"./sv.js":52245,"./sw":8967,"./sw.js":8967,"./ta":10454,"./ta.js":10454,"./te":35204,"./te.js":35204,"./tet":81571,"./tet.js":81571,"./tg":15737,"./tg.js":15737,"./th":41786,"./th.js":41786,"./tk":50511,"./tk.js":50511,"./tl-ph":14828,"./tl-ph.js":14828,"./tlh":62422,"./tlh.js":62422,"./tr":97047,"./tr.js":97047,"./tzl":90792,"./tzl.js":90792,"./tzm":67730,"./tzm-latn":59963,"./tzm-latn.js":59963,"./tzm.js":67730,"./ug-cn":42535,"./ug-cn.js":42535,"./uk":33151,"./uk.js":33151,"./ur":22750,"./ur.js":22750,"./uz":61914,"./uz-latn":60231,"./uz-latn.js":60231,"./uz.js":61914,"./vi":55517,"./vi.js":55517,"./x-pseudo":64078,"./x-pseudo.js":64078,"./yo":70046,"./yo.js":70046,"./zh-cn":81832,"./zh-cn.js":81832,"./zh-hk":90953,"./zh-hk.js":90953,"./zh-mo":38236,"./zh-mo.js":38236,"./zh-tw":71001,"./zh-tw.js":71001};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=s,e.exports=i,i.id=85721}}]); \ No newline at end of file diff --git a/assets/js/d5c55fab.cff3822e.js b/assets/js/d5c55fab.0ab53de2.js similarity index 69% rename from assets/js/d5c55fab.cff3822e.js rename to assets/js/d5c55fab.0ab53de2.js index 9dffea8e9..dac1dfc08 100644 --- a/assets/js/d5c55fab.cff3822e.js +++ b/assets/js/d5c55fab.0ab53de2.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1988],{19121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cappedArrayDebounce=void 0;t.cappedArrayDebounce=function(e,t,n,o){void 0===o&&(o=500);let i=[],s=null,r=null;return{addItem:a=>{clearTimeout(s),i.push(a),r||(r=setTimeout((()=>{e(i),clearTimeout(s),r=null}),o)),i.length>=n?(e(i),clearTimeout(r),r=null,i=[]):s=setTimeout((()=>{e(i),clearTimeout(r),r=null,i=[]}),t)},flush:()=>{i.length&&(e(i),i=[],clearTimeout(r))},pendingItems:()=>i.length}}},59792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.dataShaper=t.DataShapeType=void 0,function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.ARRAY=3]="ARRAY",e[e.OBJECT=4]="OBJECT",e[e.NULL=5]="NULL",e[e.UNSUPPORTED=6]="UNSUPPORTED"}(n=t.DataShapeType||(t.DataShapeType={}));const o={string:n.STRING,number:n.NUMBER,boolean:n.BOOLEAN,object:n.OBJECT,array:n.ARRAY,null:n.NULL,symbol:n.UNSUPPORTED,undefined:n.UNSUPPORTED,function:n.UNSUPPORTED,bigint:n.UNSUPPORTED};t.dataShaper=function(e,n,i){void 0===n&&(n=5),void 0===i&&(i=5);const s=null===(r=e)?"null":typeof r;var r,a;if("object"===s){if(Array.isArray(e))return n>1?e.filter(((e,t)=>t(0,t.dataShaper)(e,n-1,i))):o.array;if(n>1){const o={};for(const s in e)o[s]=(0,t.dataShaper)(e[s],n-1,i);return a=o,Object.keys(a).sort().reduce(((e,t)=>(e[t]=a[t],e)),{})}return o.object}return o[s]}},23046:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.debugLogger=void 0;const i=(0,o(n(55899)).default)("flyde");t.debugLogger=e=>i.extend(e)},24331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullInsIdPath=void 0,t.fullInsIdPath=function(e,t){if(!e)throw new Error("insId is not defined");return t?`${t}.${e}`:e}},34459:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hashFlow=t.hashNode=void 0;const i=o(n(68805)),s=n(30292),r=e=>(0,i.default)(e);t.hashNode=function(e,t){var n;void 0===t&&(t=!0);const{id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l}=e,c={id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l};if((0,s.isVisualNode)(e)){const{instances:n,connections:o,inputsPosition:i,outputsPosition:s}=e,a=n.map((e=>{const{pos:t,...n}=e;return n})),u=t?{}:{inputsPosition:i,outputsPosition:s},l=t?a:n;l.sort(((e,t)=>e.id.localeCompare(t.id)));const d=[...o];d.sort(((e,t)=>{const n=`${e.from.insId}.${e.from.pinId}`,o=`${t.from.insId}.${t.from.pinId}`;return n.localeCompare(o)}));const p=JSON.stringify({instancesToUse:l,conns:d,...c,maybeIoPos:u});return r(p)}if((0,s.isInlineValueNode)(e)){const{customViewCode:t}=e,o=null!==(n=e.fnCode)&&void 0!==n?n:e.runFnRawCode,i=JSON.stringify({fnCode:o,customViewCode:t,...c});return r(i)}throw new Error("Hashing code nodes unsupported")};t.hashFlow=e=>{const{node:n,imports:o}=e,i=(0,t.hashNode)(n,!1),s=Object.entries(null!=o?o:{}).sort(((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)})).map((e=>{let[t,n]=e;return[t,n.sort()]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{}),a=JSON.stringify(s);return r(i+a)}},86873:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DepGraph=void 0,i(n(3172),t),i(n(59962),t),i(n(23046),t),i(n(19121),t),i(n(59962),t),i(n(34459),t),i(n(39043),t),i(n(59792),t),i(n(24331),t),t.DepGraph=n(60359).DepGraph},3172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testDataCreator=void 0;t.testDataCreator=e=>function(t){void 0===t&&(t={});return{..."function"==typeof e?e():e,...t}}},59962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplePluralize=t.eventually=t.delay=t.noop=t.removeDupes=t.ensure=t.isOptionalType=t.callFnOrFnPromise=t.isPromise=t.isDefined=t.containsAll=t.shuffle=t.randomInts=t.repeat=t.pickRandom=t.randomPos=t.randomInt=t.pickSecond=t.pickFirst=t.fromEntries=t.entries=t.okeys=t.values=t.keys=t.filterOMap=t.mapOMap=t.middlePos=t.calcCenter=t.intersectRect=void 0;t.intersectRect=(e,t)=>{const n=e.x+e.w,o=t.x+t.w;return!(t.x>n||oe.y+e.h||t.y+t.h{let{w:t,h:n,x:o,y:i}=e;return{x:o+t/2,y:i+n/2}};t.middlePos=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});t.mapOMap=(e,n)=>(0,t.entries)(e).map((e=>{let[t,o]=e;return[t,n(t,o)]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.filterOMap=(e,n)=>(0,t.entries)(e).filter((e=>{let[t,o]=e;return n(t,o)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.keys=e=>Object.keys(e);t.values=e=>Object.values(e),t.okeys=t.keys;t.entries=e=>(0,t.okeys)(e).map((t=>[t,e[t]]));t.fromEntries=e=>e.reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.pickFirst=e=>e[0];t.pickSecond=e=>e[1];t.randomInt=function(e,t){void 0===t&&(t=0);const n=Math.random();return t+Math.floor((e-t)*n)};t.randomPos=function(e,n){void 0===e&&(e=1e3),void 0===n&&(n=0);return{x:(0,t.randomInt)(e,n),y:(0,t.randomInt)(e,n)}};t.pickRandom=e=>e[(0,t.randomInt)(e.length)];t.repeat=(e,t)=>"x".repeat(e).split("").map(((e,n)=>t(n)));t.randomInts=function(e,n,o){return void 0===n&&(n=100),void 0===o&&(o=0),(0,t.repeat)(e,(()=>(0,t.randomInt)(n,o)))};t.shuffle=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t};t.containsAll=(e,t)=>t.every((t=>e.includes(t)));t.isDefined=e=>void 0!==e;t.isPromise=e=>e&&"function"==typeof e.then;t.callFnOrFnPromise=(e,n)=>{if(!(0,t.isDefined)(e))return;const o=e=>{try{e()}catch(t){console.error(n,t)}};"function"==typeof e?o(e):Promise.resolve(e).then((e=>{"function"==typeof e&&o(e)}))};t.isOptionalType=e=>/\?$/.test(e);t.ensure=(e,t)=>{if(void 0===e)throw new Error(t||"Undefined value passed");return e};t.removeDupes=e=>Array.from(new Set(e));t.noop=()=>{};t.delay=e=>new Promise((t=>setTimeout(t,e)));t.eventually=async function(e,n,o,i){if(void 0===n&&(n=1e3),void 0===o&&(o=100),void 0===i&&(i=new Set),n<0){const e=Array.from(i).reduce(((e,t,n)=>`${e}\n\t\t${n+1}. ${t}`),"");throw new Error(`[Eventually timeout exceeded after: timeout with error]: ${e}`)}try{await e()}catch(s){const r=Date.now();await(0,t.delay)(o);const a=Date.now()-r;return i.add(null==s?void 0:s.message),(0,t.eventually)(e,n-a,o,i)}},t.simplePluralize=function(e,t){return`${e} ${t}${1!==e?"s":""}`}},39043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileObjectTemplate=t.compileStringTemplate=void 0;t.compileStringTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=new RegExp("\\$\\{"+e+"\\}","g");n=n.replace(i,o)})),n};t.compileObjectTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=JSON.stringify(o),s=new RegExp('"\\$\\$\\{'+e+'\\}"',"g"),r=new RegExp("\\$\\{"+e+"\\}","g"),a="string"==typeof o?o.replace(/"/g,((e,t,n)=>"\\"!==n[t-1]?'\\"':n[t])):o;n=n.replace(s,i).replace(r,a).replace(/\n/g,"\\n")})),JSON.parse(n)}},69150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connection=t.connectionData=t.connectionDataEquals=t.connectionNodeEquals=t.connectionNode=t.externalConnectionNode=t.isInternalConnection=t.isExternalConnection=t.isInternalConnectionNode=t.isExternalConnectionNode=t.getNodeOutputs=t.getOutputName=t.getInputName=t.getNodeInputs=t.TRIGGER_PIN_ID=t.ERROR_PIN_ID=t.THIS_INS_ID=void 0;const o=n(30292);t.THIS_INS_ID="__this",t.ERROR_PIN_ID="__error",t.TRIGGER_PIN_ID="__trigger";t.getNodeInputs=e=>({...e.inputs,[t.TRIGGER_PIN_ID]:(0,o.nodeInput)()});t.getInputName=e=>e===t.TRIGGER_PIN_ID?"Trigger Node":e;t.getOutputName=e=>e===t.ERROR_PIN_ID?"Error":e;t.getNodeOutputs=e=>({...e.outputs,[t.ERROR_PIN_ID]:(0,o.nodeOutput)()});t.isExternalConnectionNode=e=>e&&e.insId===t.THIS_INS_ID;t.isInternalConnectionNode=e=>e.insId!==t.THIS_INS_ID;t.isExternalConnection=e=>{let{from:n,to:o}=e;return(0,t.isExternalConnectionNode)(n)||(0,t.isExternalConnectionNode)(o)};t.isInternalConnection=e=>!(0,t.isExternalConnection)(e);t.externalConnectionNode=e=>({insId:t.THIS_INS_ID,pinId:e});t.connectionNode=(e,t)=>({insId:e,pinId:t});t.connectionNodeEquals=(e,t)=>e.insId===t.insId&&e.pinId===t.pinId;t.connectionDataEquals=(e,n)=>!(!e||!n)&&((0,t.connectionNodeEquals)(e.from,n.from)&&(0,t.connectionNodeEquals)(e.to,n.to)),t.connectionData=function(e,n,o){const i="string"==typeof e?e.split("."):e,s="string"==typeof n?n.split("."):n;if(i.length>2||s.length>2)throw new Error(`invalid source or target to connection data - ${e} / ${n}`);return{from:2===i.length?(0,t.connectionNode)(i[0],i[1]):(0,t.externalConnectionNode)(i[0]),to:2===s.length?(0,t.connectionNode)(s[0],s[1]):(0,t.externalConnectionNode)(s[0]),delayed:o}};t.connection=function(e,t,n){return void 0===n&&(n=!1),{from:e,to:t,delayed:n}}},6775:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;const s=n(30292),r=n(47025),a=n(86873),u=n(69150);i(n(69150),t);t.connect=function(e,t,n,o,i,l,c,d){void 0===n&&(n={}),void 0===i&&(i={}),void 0===l&&(l=a.noop),void 0===c&&(c={}),void 0===d&&(d={});const{id:p,connections:f,instances:m}=e,g=p||"connected-node"+(0,a.randomInt)(999);return{inputs:e.inputs,outputs:e.outputs,id:g,completionOutputs:e.completionOutputs,reactiveInputs:e.reactiveInputs,run:(p,v)=>{let h=[];const I=new a.DepGraph({}),y=new Map,b=new Map,C=new Map,_=new Map,x=new Map,N=new Map;let j;const w=new Set;m.forEach((e=>{const n=(0,s.getNode)(e,t),o=e.id;y.set(e,o),b.set(o,e),I.addNode(o);const i=Object.keys(n.inputs),r=Object.keys(n.outputs),a={},l={};i.forEach((t=>{const n=(e.inputConfig||{})[t]||(0,s.queueInputPinConfig)();(0,s.isStaticInputPinConfig)(n)?a[t]=(0,s.staticNodeInput)(n.value):a[t]=(0,s.dynamicNodeInput)({config:n})})),a[u.TRIGGER_PIN_ID]=(0,s.dynamicNodeInput)({config:(0,s.queueInputPinConfig)()});if(f.some((t=>(0,u.isInternalConnectionNode)(t.to)&&t.to.insId===e.id&&t.to.pinId===u.TRIGGER_PIN_ID))&&e.inputConfig&&e.inputConfig[u.TRIGGER_PIN_ID])throw"Trigger connection can not be configured";r.forEach((e=>{const t=(0,s.dynamicOutput)();l[e]=t}));f.some((t=>(0,u.isInternalConnectionNode)(t.from)&&t.from.insId===e.id&&t.from.pinId===u.ERROR_PIN_ID))&&(l[u.ERROR_PIN_ID]=(0,s.dynamicOutput)()),C.set(o,a),_.set(o,l)}));const P=new Set;return f.forEach((n=>{const{from:o,to:i}=n,{insId:r,pinId:a}=o,{insId:l,pinId:c}=i,d=_.get(r),p=C.get(l);if((0,u.isInternalConnectionNode)(i)&&P.add(`${i.insId}.${i.pinId}`),(0,u.isExternalConnection)(n)){if((0,u.isExternalConnectionNode)(o)){const e=null==p?void 0:p[i.pinId];if(!e)throw new Error(`Input ${i.pinId} of instance ${l} not found`);const t=x.get(o.pinId)||[];t.push(e),x.set(o.pinId,t)}else{let e=null==d?void 0:d[o.pinId];if(!e)throw new Error(`Output ${o.pinId} of instance ${r} not found`);const t=N.get(i.pinId)||[];t.push(e),N.set(i.pinId,t)}return}if(!d)throw new Error(`No outputs found for instance [${r}]`);if(!p)throw b.has(l)?new Error(`No inputs found for instance [${l}]`):new Error(`Instance with id [${l}] does not exist!`);const f=d[a];if(!f)throw new Error(`Output source - [${a}] not found in node [${g}]`);const m=p[c],v=b.get(r);if(!v&&r!==u.THIS_INS_ID)throw new Error(`Instance [${r}] does not exist! failed to connect [${o}] -> [${i}]`);const y=(v?(0,s.getNode)(v,t):e).outputs[a];if(y&&y.delayed||n.delayed||r!==u.THIS_INS_ID&&l!==u.THIS_INS_ID&&I.addDependency(r,l),!m)throw new Error(`Target arg - [${i}] not found in node [${g}]`);const j=f.subscribe((async e=>{if(!(0,s.isDynamicInput)(m))throw console.info(m),new Error(`Impossible state listening to non dynamic input - ${l}.${c}`);m.subject.next(e)}));h.push((()=>j.unsubscribe()))})),(0,a.okeys)(v).forEach((e=>{(N.get(e)||[]).forEach((t=>{const n=t.subscribe((async t=>{if(!v[e])throw new Error(`Impossible state - output ${e} does not exist`);v[e].next(t)}));h.push((()=>n.unsubscribe()))}))})),I.overallOrder().map((e=>b.get(e))).forEach((e=>{const a=C.get(e.id),u=_.get(e.id),p=(0,s.getNode)(e,t);if(!a)throw new Error(`Unexpected error - args not found when running ${e}`);if(!u)throw new Error(`Unexpected error - outputs not found when running ${e}`);for(const t in a){const n=e.inputConfig[t];P.has(`${e.id}.${t}`)||(0,s.isStaticInputPinConfig)(n)||delete a[t]}const f=(0,r.execute)({node:p,inputs:a,outputs:u,resolvedDeps:t,_debugger:n,insId:e.id,extraContext:d,mainState:i,ancestorsInsIds:o,onBubbleError:l,onCompleted:()=>{return t=e.id,w.delete(t),void(0===w.size&&j&&j());var t},onStarted:()=>{return t=e.id,void w.add(t);var t},env:c});h.push(f)})),Object.keys(p).forEach((async e=>{(x.get(e)||[]).forEach((t=>{const n=p[e];if(!(0,s.isDynamicInput)(t))throw new Error(`Unsure what to do with key ${e}, input: ${t} of ins ${o}`);(0,a.isDefined)(n)&&t.subject.next(n)}))})),void 0===e.completionOutputs&&w.size>0?new Promise((e=>{j=e})):()=>h.forEach((e=>{try{e()}catch(t){console.error("error unsubscribing",t)}}))}}}},26488:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MINOR_DEBUGGER_EVENT_TYPES=t.MAJOR_DEBUGGER_EVENT_TYPES=t.DebuggerEventType=void 0,function(e){e.INPUT_CHANGE="i",e.OUTPUT_CHANGE="o",e.PROCESSING_CHANGE="pc",e.ERROR="err",e.INPUTS_STATE_CHANGE="isc"}(n=t.DebuggerEventType||(t.DebuggerEventType={})),t.MAJOR_DEBUGGER_EVENT_TYPES=[n.INPUT_CHANGE,n.OUTPUT_CHANGE,n.ERROR],t.MINOR_DEBUGGER_EVENT_TYPES=[n.PROCESSING_CHANGE,n.INPUTS_STATE_CHANGE]},43686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatEvent=void 0;const o=n(26488);t.formatEvent=function(e){var t,n,i;const s=[e.insId,...null!==(n=null===(t=e.ancestorsInsIds)||void 0===t?void 0:t.split("."))&&void 0!==n?n:[]];(null===(i=e.ancestorsInsIds)||void 0===i?void 0:i.length)>0&&e.ancestorsInsIds;const r=`Node <${e.nodeId}> `,a=`(${s.join(" -> ")})`;return`${r} - ${function(e){switch(e.type){case o.DebuggerEventType.PROCESSING_CHANGE:return e.val?"started processing":"stopped processing";case o.DebuggerEventType.INPUT_CHANGE:return`Input pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.OUTPUT_CHANGE:return`Output pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.INPUTS_STATE_CHANGE:return`Inputs queue size changed to ${Object.entries(e.val).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join(", ")}`;case o.DebuggerEventType.ERROR:return`Error: ${e.val}`}}(e)} ${a}`}},99896:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26488),t),i(n(43686),t)},47025:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.GLOBAL_STATE_NS=t.ROOT_INS_ID=t.INPUTS_STATE_SUFFIX=t.INNER_STATE_SUFFIX=void 0;const s=n(62600),r=n(87794);i(n(99896),t);const a=n(30292),u=n(6775),l=n(84479),c=n(86873),d=n(23046),p=n(30292),f=n(99896),m=n(79804);t.INNER_STATE_SUFFIX="_inner",t.INPUTS_STATE_SUFFIX="_inputs";t.ROOT_INS_ID="__root",t.GLOBAL_STATE_NS="____global";t.execute=e=>{let{node:n,inputs:o,outputs:i,resolvedDeps:g,_debugger:v={},insId:h=t.ROOT_INS_ID,extraContext:I={},mainState:y={},ancestorsInsIds:b,onBubbleError:C=s.noop,env:_={},onCompleted:x=s.noop,onStarted:N=s.noop}=e;const j=[];y[t.GLOBAL_STATE_NS]||(y[t.GLOBAL_STATE_NS]=new Map);const w={...I,ENV:_},P=(0,m.customNodesToNodesCollection)(g,w),O=e=>{const t=e instanceof a.NodeInstanceError?e:new a.NodeInstanceError(e,(0,c.fullInsIdPath)(h,b),n.id);v.onEvent&&v.onEvent({type:f.DebuggerEventType.ERROR,val:t,insId:h,ancestorsInsIds:b,nodeId:n.id}),i[u.ERROR_PIN_ID]?i[u.ERROR_PIN_ID].next(t):C(t)},E=(e=>(0,a.isVisualNode)(e)?(0,u.connect)(e,P,v,(0,c.fullInsIdPath)(h,b),y,O,_,I):(0,a.isInlineValueNode)(e)?(0,m.inlineValueNodeToNode)(e,w):e)(n),D=v.onEvent||s.noop,S={},M={};(0,c.entries)(o).forEach((e=>{let[t,o]=e;if((0,a.isDynamicInput)(o)){const e=(0,a.dynamicNodeInput)({config:o.config}),i=o.subject.subscribe((async o=>{const i=D({type:f.DebuggerEventType.INPUT_CHANGE,insId:h,pinId:t,val:o,ancestorsInsIds:b,nodeId:n.id});if(i){const t=await i.valuePromise;e.subject.next(t)}else v.debugDelay&&await(0,c.delay)(v.debugDelay),e.subject.next(o)}));j.push((()=>i.unsubscribe())),M[t]=e}else{D({type:f.DebuggerEventType.INPUT_CHANGE,insId:h,pinId:t,val:o.config.value,ancestorsInsIds:b,nodeId:n.id});const e=(0,a.staticNodeInput)((0,a.getStaticValue)(o.config.value,P,h));M[t]=e}})),(0,c.entries)(i).forEach((e=>{let[t,o]=e;const i=(0,a.dynamicOutput)(),s=i.subscribe((async e=>{const i=D({type:f.DebuggerEventType.OUTPUT_CHANGE,insId:h,pinId:t,val:e,ancestorsInsIds:b,nodeId:n.id});if(i){const e=await i.valuePromise;o.next(e)}else o.next(e)}));j.push((()=>s.unsubscribe())),S[t]=i}));const k=(e=>{var n,o;const{node:i,inputs:u,outputs:m,resolvedDeps:g,_debugger:v,insId:h,ancestorsInsIds:I,mainState:y,onError:b,onStarted:C,onCompleted:_,env:x,extraContext:N}=e,{run:j,fn:w}=i,P=(0,d.debugLogger)("core"),O=[];let E;const D=(null==v?void 0:v.onEvent)||s.noop,S=(0,c.fullInsIdPath)(h,I),M=`${S}${t.INNER_STATE_SUFFIX}`,k=`${S}${t.INPUTS_STATE_SUFFIX}`,T=P.extend(S),A=y[t.GLOBAL_STATE_NS];y[M]||(y[M]=new Map),y[k]||(y[k]=new Map);let R=null!==(n=y[k])&&void 0!==n?n:new Map;const V=()=>{const e=Array.from(R.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:(0,a.isQueueInputPinConfig)(u[n].config)?null==o?void 0:o.length:1}}),{});D({type:f.DebuggerEventType.INPUTS_STATE_CHANGE,val:e,insId:h,ancestorsInsIds:I,nodeId:i.id})},z={execute:(e,n,o,i)=>(0,t.execute)({node:e,inputs:n,outputs:o,resolvedDeps:g,_debugger:v,insId:i,onCompleted:_,onStarted:C}),insId:h,state:null!==(o=y[M])&&void 0!==o?o:new Map,onCleanup:e=>{O.push(e)},onError:e=>{b(e)},context:null!=N?N:{},ancestorsInsIds:I,globalState:A};let $,H=!1;const G=(i.reactiveInputs||[]).filter((e=>{var t;return!(0,p.isStaticInputPinConfig)(null===(t=u[e])||void 0===t?void 0:t.config)})),L=()=>{var e;null===(e=y[M])||void 0===e||e.clear(),(0,c.keys)(y).filter((e=>e.startsWith(`${S}.`))).forEach((e=>{y[e]=new Map}))},F=e=>{const t=(null==e?void 0:e.key)&&G.includes(null==e?void 0:e.key);if(H&&!t);else{const o=H&&t;if((0,l.isNodeStateValid)(u,R,i)||o){let t;if(H){if(!e)throw new Error("Unexpected state, got reactive node while not processing and not valid");const n=(0,l.pullValueForExecution)(e.key,u[e.key],R,x);t={...$,[e.key]:n},V()}else t=(0,l.pullValuesForExecution)(u,R,x),$=t,V();let o=new Set,s={};if(H=!0,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:h,ancestorsInsIds:I,nodeId:i.id}),i.completionOutputs){const e=i.completionOutputs.map((e=>e.split("+"))).reduce(((e,t)=>(t.forEach((n=>{e.set(n,t)})),e)),new Map);(0,c.entries)(m).forEach((t=>{let[n,a]=t;a.pipe((0,r.first)()).subscribe((t=>{o.add(n),s[n]=t;let r=e.get(n);r&&(r.splice(r.indexOf(n),1),0===r.length&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:h,ancestorsInsIds:I,nodeId:i.id}),_&&_(s),L(),(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),E=void 0,o.clear(),s={},(0,l.hasNewSignificantValues)(u,R,x,i.id)&&F()))}))}))}else(0,c.entries)(m).forEach((e=>{let[t,n]=e;n.subscribe((e=>{s[t]=e}))}));try{T("Running node %s with values %o",i.id,t),C&&C(),E=(null!=w?w:j)(t,m,z),(0,c.isPromise)(E)?E.then((()=>{void 0===i.completionOutputs&&_&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:h,ancestorsInsIds:I,nodeId:i.id}),_(s),L(),(0,l.hasNewSignificantValues)(u,R,x,i.id)&&F())})).catch((e=>{b(e),H=!1,T("Error in node %s - value %e",i.id,e),D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:h,ancestorsInsIds:I,nodeId:i.id})})):void 0===i.completionOutputs&&_&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:h,ancestorsInsIds:I,nodeId:i.id}),_(s),L())}catch(n){b(n),H=!1,T("Error in node %s - value %e",i.id,n),D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:h,ancestorsInsIds:I,nodeId:i.id})}const d=G.find((e=>u[e]&&(0,l.peekValueForExecution)(e,u[e],R,x,i.id)));if(d){const e=(0,l.peekValueForExecution)(d,u[d],R,x,i.id);F({key:d,value:e})}else{const e=(0,c.entries)(u).find((e=>{let[t,n]=e;const o=(0,a.isQueueInputPinConfig)(n.config),s=(0,l.peekValueForExecution)(t,n,R,x,i.id);return!!o&&(0,c.isDefined)(s)}));if(e){const[t,n]=e,o=(0,l.peekValueForExecution)(t,n,R,x,i.id);F({key:t,value:o})}}}}};F();const B=(0,l.subscribeInputsToState)(u,R,((e,t)=>{P("Got input %s - value is [%o]",e,t),V();try{F({key:e,value:t})}catch(n){b(n)}}));return O.push(B),()=>{(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),O.forEach((e=>e()))}})({node:E,inputs:M,outputs:S,resolvedDeps:P,_debugger:v,insId:h,mainState:y,ancestorsInsIds:b,onError:O,onBubbleError:C,env:_,extraContext:I,onCompleted:x,onStarted:N});return()=>{j.forEach((e=>e())),k()}}},84479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeInputsToState=t.isNodeStateValid=t.hasNewSignificantValues=t.peekValuesForExecution=t.pullValuesForExecution=t.pullValueForExecution=t.peekValueForExecution=void 0;const o=n(30292),i=n(86873),s=n(6775),r=(e,t)=>{const n=(0,o.extractStaticValue)(e);if((0,o.isEnvValue)(n)){return((e,t)=>{const n=e.split(".");let o={...t};for(let s of n){if(!o||!(0,i.isDefined)(o[s])||null===o[s])throw new Error(`Cannot find key ${e} inside obj ${t}`);o=o[s]}return o})((0,o.getEnvKeyFromValue)(n),t)}return n};t.peekValueForExecution=(e,t,n,i,s)=>{const a=n.get(e);let u;if(!t)throw new Error(`Trying to peek value of inexsting input in key "${e}" in node "${s}"`);return u=(0,o.isStaticInput)(t)?r(t,i):(0,o.isQueueInputPinConfig)(t.config)?a?[...a].shift():void 0:a,u};t.pullValueForExecution=(e,t,n,i)=>{const s=n.get(e);let a;return(0,o.isStaticInput)(t)?a=r(t,i):(0,o.isQueueInputPinConfig)(t.config)?(a=(s||[]).shift(),n.set(e,s)):(a=s,(0,o.isStickyInputPinConfig)(t.config)||n.delete(e)),a};t.pullValuesForExecution=(e,n,o)=>(0,i.entries)(e).reduce(((e,i)=>{let[s,r]=i;return e[s]=(0,t.pullValueForExecution)(s,r,n,o),e}),{});t.peekValuesForExecution=(e,n,o,s)=>(0,i.entries)(e).reduce(((e,i)=>{let[r,a]=i;return e[r]=(0,t.peekValueForExecution)(r,a,n,o,s),e}),{});t.hasNewSignificantValues=(e,n,s,r)=>(0,i.entries)(e).some((e=>{let[a,u]=e;const l=(0,o.isQueueInputPinConfig)(u.config),c=(0,t.peekValueForExecution)(a,u,n,s,r);return(0,i.isDefined)(c)&&l}));t.isNodeStateValid=(e,t,n)=>{const r=(0,i.keys)(e),a=(0,i.keys)(n.inputs).filter((e=>{var t;const o=null===(t=n.inputs[e])||void 0===t?void 0:t.mode;return!o||"required"===o}));r.includes(s.TRIGGER_PIN_ID)&&a.push(s.TRIGGER_PIN_ID);return!!(0,i.containsAll)(r,a)&&(0,i.entries)(e).filter((e=>{let[t]=e;return!!n.inputs[t]||t===s.TRIGGER_PIN_ID})).every((e=>{let[s,r]=e;var a;const u=t.get(s);return"optional"===((null===(a=n.inputs[s])||void 0===a?void 0:a.mode)||"required")||(!!(0,o.isStaticInput)(r)||((0,o.isQueueInputPinConfig)(r.config)?(0,i.isDefined)(u)&&u.length>0:(0,i.isDefined)(u)))}))};t.subscribeInputsToState=(e,t,n)=>{const s=[];return(0,i.entries)(e).forEach((e=>{let[i,r]=e;if(!r)return;if((0,o.isStaticInput)(r))return;const a=r.subject.subscribe((e=>{if((0,o.isQueueInputPinConfig)(r.config)){const o=t.get(i)||[];if(!Array.isArray(o))throw new Error(`impossible state - state of key ${i} is set but not an array`);o.push(e),t.set(i,o),n(i,e)}else t.set(i,e),n(i,e)}));s.push((()=>a.unsubscribe()))})),()=>s.forEach((e=>e()))}},5474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flydeFlowSchema=void 0;const o=n(29022),i=o.z.record(o.z.string(),o.z.string().or(o.z.array(o.z.string()))),s=o.z.strictObject({x:o.z.number(),y:o.z.number()}),r=o.z.discriminatedUnion("mode",[o.z.strictObject({mode:o.z.literal("static"),value:o.z.any()}),o.z.strictObject({mode:o.z.literal("queue")}),o.z.strictObject({mode:o.z.literal("sticky")})]),a=o.z.object({size:o.z.optional(o.z.enum(["small","regular","large"])),icon:o.z.optional(o.z.any()),color:o.z.optional(o.z.string()),cssOverride:o.z.optional(o.z.record(o.z.string()))}),u=o.z.object({pos:s.default({x:0,y:0}),id:o.z.string(),inputConfig:o.z.optional(o.z.record(o.z.string(),r)).default({}),visibleInputs:o.z.optional(o.z.array(o.z.string())),visibleOutputs:o.z.optional(o.z.array(o.z.string())),nodeId:o.z.optional(o.z.string()),node:o.z.optional(o.z.any()),style:o.z.optional(a)}).refine((e=>e.node||e.nodeId),{message:"Instance must have either an inline node or refer to a nodeId"}),l=o.z.union([o.z.string(),o.z.object({mode:o.z.enum(["required","optional","required-if-connected"]),type:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),defaultValue:o.z.optional(o.z.any())})]),c=o.z.object({type:o.z.optional(o.z.string()),optional:o.z.optional(o.z.boolean()),delayed:o.z.optional(o.z.boolean()),description:o.z.optional(o.z.string())}),d=o.z.object({id:o.z.optional(o.z.string()),inputs:o.z.record(o.z.string(),l),outputs:o.z.record(o.z.string(),c),inputsPosition:o.z.optional(o.z.record(o.z.string(),s)),outputsPosition:o.z.optional(o.z.record(o.z.string(),s)),customViewCode:o.z.optional(o.z.string()),dataBuilderSource:o.z.optional(o.z.string()),templateType:o.z.optional(o.z.string()),completionOutputs:o.z.optional(o.z.array(o.z.string())),reactiveInputs:o.z.optional(o.z.array(o.z.string())),defaultStyle:o.z.optional(a),description:o.z.optional(o.z.string()),searchKeywords:o.z.optional(o.z.array(o.z.string()))}),p=o.z.object({instances:o.z.array(u),connections:o.z.array(o.z.strictObject({from:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),to:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),delayed:o.z.optional(o.z.boolean()),hidden:o.z.optional(o.z.boolean())}))}).and(d);t.flydeFlowSchema=o.z.strictObject({imports:o.z.optional(i).default({}),node:p})},74762:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticValueVisualNode=void 0,i(n(86873),t);const s=n(30292);i(n(6775),t),i(n(47025),t),i(n(10418),t),i(n(30292),t),i(n(3320),t),i(n(79804),t),i(n(5474),t);t.isStaticValueVisualNode=e=>!!e&&!!(0,s.maybeGetStaticValueNodeId)(`${e}`)},87093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fakeVm=t.VM=t.VMScript=void 0;const o=n(86873);class i{constructor(e){this.script=e}}t.VMScript=i;class s{constructor(e){this.context=e}run(e){const t=(0,o.okeys)(this.context.sandbox),n=Object.values(this.context.sandbox);Function(...t,e.script)(...n)}}t.VM=s,t.fakeVm={VMScript:i,VM:s}},28145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVM2Instance=void 0;const o=n(87093);t.getVM2Instance=()=>o.fakeVm},79804:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.customNodesToNodesCollection=t.inlineValueNodeToNode=void 0;const i=o(n(18706)),s=n(86873),r=n(30292),a=(0,n(28145).getVM2Instance)();t.inlineValueNodeToNode=function(e,t){void 0===t&&(t={});const{runFnRawCode:n,...o}=e,u=(0,s.debugLogger)(`code-node:${e.id}`),l=`\n try {\n ${n}\n } catch (e) {\n adv.onError(e);\n }\n `,c=new a.VMScript(l),d={...o,run:(n,o,l)=>{const d=new a.VM({sandbox:{inputs:n,outputs:o,setInterval:setInterval,clearInterval:clearInterval,setTimeout:setTimeout,clearTimeout:clearTimeout,encodeURIComponent:encodeURIComponent,adv:l,log:function(){for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeWithDependencies=void 0;const o=n(30292),i=n(74762),s=n(88270);t.getNodeWithDependencies=function(e,n,r){if(void 0===r&&(r=[]),(0,o.isInlineValueNode)(e))return[e];if(r.includes(e.id))return[];const a=(0,i.removeDupes)(e.instances.filter((e=>(0,s.isRefNodeInstance)(e))).map((e=>e.nodeId)).filter((e=>n[e])));return[e,...a.flatMap((e=>{var t;return null!==(t=n[e])&&void 0!==t?t:[]})).reduce(((e,o)=>[...e,...(0,t.getNodeWithDependencies)(o,n,[...r,...a])]),[])]}},30292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88270),t),i(n(43069),t),i(n(79426),t),i(n(44535),t),i(n(18063),t),i(n(20359),t)},18063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeInstanceError=void 0;class n extends Error{constructor(e,t,n){let o="Unknown error";o="string"==typeof e?e:e instanceof Error?e.message:null!==e&&"object"==typeof e?JSON.stringify(e):String(e),super(`${o} (insId: ${t}, nodeId: ${n})`),this.name=this.constructor.name,this.message=`${o} (insId: ${t}, nodeId: ${n})`,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.fullInsIdsPath=t,this.nodeId=n}}t.NodeInstanceError=n},88270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInsId=t.NodeInstance=t.isRefNodeInstance=t.isInlineNodeInstance=t.inlineNodeInstance=t.nodeInstance=void 0;const o=n(36618);t.nodeInstance=(e,t,n,o)=>({id:e,nodeId:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.inlineNodeInstance=(e,t,n,o)=>({id:e,node:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.isInlineNodeInstance=e=>!!e.node;t.isRefNodeInstance=e=>!(0,t.isInlineNodeInstance)(e);t.NodeInstance=(e,t,n,o)=>({id:e,nodeId:t.id,inputConfig:n||{},pos:o||{x:0,y:0}});t.createInsId=e=>`${e.id}-${(0,o.slug)()}`},43069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvKeyFromValue=t.toEnvValue=t.isEnvValue=t.extractStaticValue=t.isStaticInput=t.isDynamicInput=t.staticNodeInput=t.dynamicNodeInputs=t.dynamicNodeInput=t.dynamicOutput=t.nodeOutputs=t.nodeOutput=t.nodeInputs=t.isInputPinOptional=t.nodeInput=void 0;const o=n(62600),i=n(30292),s=n(86873),r=n(79426);t.nodeInput=function(e){return void 0===e&&(e="required"),{mode:e}};t.isInputPinOptional=e=>"optional"===e.mode;t.nodeInputs=(e,n)=>(0,s.repeat)(e,(e=>(0,t.nodeInput)((null==n?void 0:n[e])||"required")));t.nodeOutput=function(e){return void 0===e&&(e=!1),{delayed:e}};t.nodeOutputs=e=>(0,s.repeat)(e,(()=>(0,t.nodeOutput)()));t.dynamicOutput=()=>new o.Subject,t.dynamicNodeInput=(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})));t.dynamicNodeInputs=function(e){return void 0===e&&(e=10),(0,s.repeat)(e,(()=>(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})))()))};t.staticNodeInput=e=>({config:(0,r.staticInputPinConfig)(e)});t.isDynamicInput=e=>{const t=e;return t&&t.subject&&!!t.subject.next};t.isStaticInput=e=>(0,i.isStaticInputPinConfig)(null==e?void 0:e.config);t.extractStaticValue=e=>{if((0,t.isStaticInput)(e))return e.config.value;throw new Error("Cannot extract static value from non static arg")};t.isEnvValue=e=>"string"==typeof e&&e.startsWith("$ENV.");t.toEnvValue=e=>`$ENV.${e}`;t.getEnvKeyFromValue=e=>"string"==typeof e?e.replace(/^\$ENV\./,""):e},20359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeFromFunction=t.getNodeDef=t.getNode=t.getStaticValue=t.maybeGetStaticValueNodeId=t.fromSimplified=t.inlineValueNode=t.codeNode=t.visualNode=t.isInlineValueNode=t.isVisualNode=t.isCodeNode=t.isBaseNode=t.InlineValueNodeType=void 0;const o=n(86873),i=n(88270),s=n(43069);!function(e){e.VALUE="value",e.FUNCTION="function"}(t.InlineValueNodeType||(t.InlineValueNodeType={}));t.isBaseNode=e=>e&&e.id&&e.inputs&&e.outputs;t.isCodeNode=e=>(0,t.isBaseNode)(e)&&"function"==typeof e.run;t.isVisualNode=e=>!!e.instances;t.isInlineValueNode=e=>(0,o.isDefined)(e)&&(0,o.isDefined)(e.runFnRawCode),t.visualNode=(0,o.testDataCreator)({id:"visual-node",inputs:{},outputs:{},instances:[],connections:[],outputsPosition:{},inputsPosition:{}}),t.codeNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},run:o.noop}),t.inlineValueNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},runFnRawCode:""});t.fromSimplified=e=>{let{run:t,inputTypes:n,outputTypes:i,id:s}=e;return{id:s,inputs:(0,o.entries)(n).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),outputs:(0,o.entries)(i).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),run:t}};t.maybeGetStaticValueNodeId=e=>{const t="string"==typeof e&&e.match(/^__node\:(.*)/);if(t){return t[1]}return null};t.getStaticValue=(e,n,o)=>{const i=(0,t.maybeGetStaticValueNodeId)(e);if(i){const e=n[i];if(!e)throw new Error(`Instance ${o} referrer to a node reference ${i} that does not exist`);return e}return e};t.getNode=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw new Error(`Node with id ${n} not found`);return o};t.getNodeDef=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw console.error(`Node with id ${n} not found`),new Error(`Node with id ${n} not found`);return o};t.codeFromFunction=e=>{let{id:t,fn:n,inputNames:o,outputName:i,defaultStyle:r}=e;return{id:t,inputs:o.reduce(((e,t)=>({...e,[t]:(0,s.nodeInput)()})),{}),outputs:{[i]:(0,s.nodeOutput)()},run:(e,t)=>{const s=o.map((t=>e[t])),r=t[i],a=n(...s);return Promise.resolve(a).then((e=>null==r?void 0:r.next(e)))},completionOutputs:[i],defaultStyle:r}}},44535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nodeFromSimpleFunction=void 0,t.nodeFromSimpleFunction=function(e){var t;return{...e,id:e.id,description:e.description,namespace:e.namespace,inputs:e.inputs?e.inputs.reduce(((e,t)=>{let{name:n,description:o,mode:i,defaultValue:s}=t;return{...e,[n]:{description:o,mode:null!=i?i:"required",defaultValue:s}}}),{}):{},outputs:e.output?{[e.output.name]:{description:e.output.description}}:{},defaultStyle:{icon:e.icon,size:e.size},run:null!==(t=e.fullRunFn)&&void 0!==t?t:async function(t,n,o){var i,s;const r=(null!==(i=e.inputs)&&void 0!==i?i:[]).map((e=>{let{name:n}=e;return t[n]}));try{const t=await Promise.resolve(e.run(...r));e.output&&(null===(s=n[e.output.name])||void 0===s||s.next(t))}catch(a){console.error("Error in node",a),o.onError(a)}},customViewCode:e.customViewCode}}},79426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticInputPinConfig=t.isStickyInputPinConfig=t.isQueueInputPinConfig=t.staticInputPinConfig=t.stickyInputPinConfig=t.queueInputPinConfig=t.INPUT_MODES=void 0,t.INPUT_MODES=["queue","sticky","static"];t.queueInputPinConfig=()=>({mode:"queue"});t.stickyInputPinConfig=()=>({mode:"sticky"});t.staticInputPinConfig=e=>({mode:"static",value:e});t.isQueueInputPinConfig=e=>"queue"===e.mode;t.isStickyInputPinConfig=e=>!!e&&"sticky"===e.mode,t.isStaticInputPinConfig=function(e){return!!e&&"static"===e.mode}},10418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedExecute=void 0;const o=n(74762),i=n(47025);t.simplifiedExecute=function(e,t,n,s,r){void 0===r&&(r={});const a=(0,o.keys)(e.outputs),u=Object.keys(n).reduce(((e,t)=>{const i=n[t];return{...e,[t]:(0,o.isDynamicInput)(i)?i:(0,o.staticNodeInput)(i)}}),{}),l=a.reduce(((e,t)=>{const n=(0,o.dynamicOutput)();return s&&n.subscribe((e=>{s(t,e)})),{...e,[t]:n}}),{});return(0,i.execute)({node:e,inputs:u,outputs:l,resolvedDeps:t,onBubbleError:e=>{throw e},...r})}},25779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodePreview=void 0;const o=n(35250),i=n(74762),s=n(86553);t.NodePreview=e=>{let{node:t}=e;const n={node:t,instance:(0,i.nodeInstance)("bob",t.id,{}),connections:[],viewPort:{pos:{x:0,y:0},zoom:1},resolvedDeps:{},connectionsPerInput:{},onUngroup:i.noop,onDblClick:i.noop,onDragEnd:i.noop,onDragMove:i.noop,onDragStart:i.noop,onPinClick:i.noop,onPinDblClick:i.noop,onSelect:i.noop,onTogglePinBreakpoint:i.noop,onTogglePinLog:i.noop,onToggleSticky:i.noop,displayMode:!0,onInspectPin:i.noop,onDetachConstValue:i.noop,onCopyConstValue:i.noop,onPasteConstValue:i.noop,ancestorsInsIds:"",onChangeVisibleInputs:i.noop,onChangeVisibleOutputs:i.noop,onConvertConstToEnv:i.noop,forceShowMinimized:"both",onExtractInlineNode:i.noop,onCloseInlineEditor:i.noop,isConnectedInstanceSelected:!1,inlineEditorPortalDomNode:null,onChangeStyle:i.noop,onDeleteInstance:i.noop,onGroupSelected:i.noop,onSetDisplayName:i.noop,hadError:!1,queuedInputsData:{},onPinMouseDown:i.noop,onPinMouseUp:i.noop};return(0,o.jsx)("div",{className:"node-preview",children:(0,o.jsx)(s.InstanceView,{...n})})}},30653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDarkMode=t.DarkModeProvider=void 0;const o=n(70079),i=(0,o.createContext)(!0);t.DarkModeProvider=i.Provider;t.useDarkMode=()=>(0,o.useContext)(i)},29183:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataInspectionModal=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=n(74089),p=n(83938),f=n(17102),m=n(98158);t.DataInspectionModal=e=>{var t;const{onRequestHistory:n}=(0,m.useDebuggerContext)(),{item:o}=e,[i,s]=c.default.useState(),[r,g]=c.default.useState(0),[v,h]=c.default.useState(""),[I,y]=c.default.useState(),[b]=(0,d.useDebounce)(v,300);(0,c.useEffect)((()=>{y(null==i?void 0:i.lastSamples.filter((e=>"object"==typeof e.val?JSON.stringify(e.val).includes(b):e.val.toString().includes(b)))),g(0)}),[null==i?void 0:i.lastSamples,b]),c.default.useEffect((()=>{!async function(){var e,t;const i=await n(o.insId,null===(e=o.pin)||void 0===e?void 0:e.id,null===(t=o.pin)||void 0===t?void 0:t.type);s(i)}()}),[o,n]);const C=e=>{const t=e.val;return"object"==typeof t?(0,a.jsx)(p.BrowserOnlyReactJson,{src:t}):(0,a.jsx)(u.Code,{children:t.toString()})},_=`"${o.insId}" ${(null===(t=o.pin)||void 0===t?void 0:t.id)?`(${o.pin.id})`:""}`;return(0,a.jsx)(u.Dialog,{isOpen:!0,title:`Inspecting data for instance ${_}`,onClose:e.onClose,canEscapeKeyClose:!1,className:"data-inspection-modal",children:(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{children:[i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("em",{children:[_," called ",i.total," time(s)"]}),i.total>10&&(0,a.jsx)("span",{children:"Showing last 10 samples"})]}):null,(0,a.jsx)("input",{className:"bp5-input bp5-small bp5-fill",type:"search",placeholder:"Search for values",dir:"auto",onChange:e=>h(e.target.value),value:v}),b.length>0&&(0,a.jsxs)("span",{children:["Showing ",null==I?void 0:I.length," of ",i.lastSamples.length," ",'samples matching query "',b,'"']})]}),(0,a.jsx)("main",{className:"main-wrapper",children:(()=>{if(!i)return(0,a.jsx)(f.Loader,{});if(0===i.total)return(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",(0,a.jsx)("em",{children:o.insId})," ",o.pin?(0,a.jsxs)(c.default.Fragment,{children:["and pin ",(0,a.jsx)("em",{children:o.pin.id})]}):null,". Make sure debugger is running and your program was triggered."]});const e=null==I?void 0:I[r];return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Card,{className:"content-wrapper",children:[e?(0,a.jsxs)("div",{className:"info",children:[(0,a.jsxs)("div",{children:["Showing sample ",r," of event from"," ",(0,a.jsx)("strong",{children:(0,d.timeAgo)(e.time)})," (",new Date(e.time).toLocaleString(),")"]}),(0,a.jsxs)("div",{children:["Instance: ",(0,a.jsx)("strong",{children:e.insId}),", Pin id:"," ",(0,a.jsx)("strong",{children:e.pinId})," "]}),(0,a.jsx)("div",{children:"Value:"})]}):null,C(e)]}),(0,a.jsx)(u.Menu,{className:"samples-menu",children:I.map(((e,t)=>{const n=e.pinId,o=`${i.total-t}. from pin "${n}"`;return(0,a.jsx)(u.MenuItem,{text:o,onClick:()=>g(t)},t)}))})]}):i.lastSamples.length>0&&v.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",children:['No data found for search query "',v,'"']}):(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",o.insId," ",o.pin?`and ${o.pin.id}`:"",". Make sure a debugger is connected and your program was triggered."]})})()})]})})})}},40471:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29183),t)},98158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebuggerContext=t.DebuggerContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({onRequestHistory:()=>Promise.reject(new Error("Not implemented"))});t.DebuggerContextProvider=i.Provider;t.useDebuggerContext=()=>(0,o.useContext)(i)},86125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDependenciesContext=t.DependenciesContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({resolvedDependencies:{},onImportNode:()=>Promise.reject(new Error("Not implemented")),onRequestImportables:()=>Promise.reject(new Error("Not implemented"))});t.DependenciesContextProvider=i.Provider;t.useDependenciesContext=()=>(0,o.useContext)(i)},97106:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FlowEditor=void 0;const u=n(35250),l=s(n(70079)),c=n(74762),d=n(63521),p=a(n(53865)),f=n(68120),m=n(7047),g=n(84472),v=n(82232),h=n(49283),I=n(43490),y=n(68840),b=n(78087),C=n(20079),_=n(60190),x=n(40471),N=n(98158),j=n(86125),w=n(30653),P=n(77852);r(n(43490),t),r(n(98158),t),r(n(86125),t),y.library.add(b.fab,C.fas);const O=["select","drag-move","order-step"];t.FlowEditor=l.memo(l.forwardRef(((e,t)=>{const{state:n,onChangeEditorState:o}=e,{resolvedDependencies:i,onImportNode:s}=(0,j.useDependenciesContext)(),[r,a]=l.useState([]),[y,b]=l.useState([]),{flow:C,boardData:E}=n,D=n.flow.node,[S,M]=l.useState({}),[k,T]=l.useState(new Set),{debuggerClient:A}=(0,N.useDebuggerContext)();l.useEffect((()=>{if(A)return A.onBatchedEvents((e=>{e.forEach((e=>{e.type===c.DebuggerEventType.INPUTS_STATE_CHANGE&&(console.log("INPUTS_STATE_CHANGE",e.insId,e.val),M((t=>({...t,[e.insId]:e.val})))),e.type===c.DebuggerEventType.ERROR&&T((t=>{const n=new Set(t);return n.add(e.insId),n}))}))}))}),[A]);const{openFile:R,reportEvent:V}=(0,I.usePorts)(),z=l.useCallback(((e,t)=>{console.info("onChangeFlow",t.type),"functional"===t.type&&(a([{flow:{...n.flow,...e}},...r.slice(0,50)]),b([])),o((t=>({...t,flow:{...t.flow,...e}})))}),[o,n.flow,r]),[$,H]=l.useState({instances:[],connections:[]}),[G,L]=l.useState(!1),F=l.useCallback((()=>L(!1)),[]),B=l.useCallback((()=>L(!0)),[]),U=l.useCallback((e=>{o((t=>({...t,boardData:{...t.boardData,...e}})))}),[o]);l.useEffect((()=>{U({selected:[],viewPort:d.defaultViewPort,from:void 0,to:void 0,lastMousePos:{x:0,y:0}})}),[D.id]),(0,f.useHotkeys)("cmd+z",(e=>{b([...y,n]);const[t,...i]=r;t&&(o((e=>({...e,...t}))),a(i)),e.preventDefault()}),{text:"Undo last change",group:"Editing"},[n,r,y]);const q=l.useCallback(((e,t)=>{O.some((e=>t.message.includes(e)))||b([]),z({node:e},t)}),[z]),W=l.useCallback((e=>{R({absPath:e.source.path})}),[R]),Z=l.useCallback((function(e,t){void 0===t&&(t=-1*d.NODE_HEIGHT*1.5);const n=(0,m.createNewNodeInstance)(e,t,E.lastMousePos,i);if(n){const e=(0,p.default)(C,(e=>{const t=e.node;if(!(0,c.isVisualNode)(t))throw new Error("Impossible state, adding node to non visual node");t.instances.push(n)}));return z(e,(0,v.functionalChange)("add-node")),F(),n}}),[E.lastMousePos,C,z,F,i]),J=l.useCallback((async e=>{switch(e.type){case h.OmniBarCmdType.ADD:return V("addNode",{nodeId:e.data,source:"omnibar"}),Z(e.data);case h.OmniBarCmdType.ADD_VALUE:{const e=t.current;null==e||e.requestNewInlineValue();break}case h.OmniBarCmdType.IMPORT:{await s(e.data,{pos:E.lastMousePos});const t=(0,_.vAdd)({x:0,y:0},E.lastMousePos),n=(0,m.createNewNodeInstance)(e.data.node,0,t,i),o=(0,p.default)(C,(e=>{e.node.instances.push(n)}));z(o,(0,v.functionalChange)("add-imported-node")),V("addNode",{nodeId:e.data.node.id,source:"omnibar"});break}default:g.AppToaster.show({intent:"warning",message:"Not supported yet"})}F()}),[F,V,Z,t,s,E.lastMousePos,i,C,z]),[Y,K]=l.useState(),X=l.useCallback((()=>K(void 0)),[]),Q=l.useCallback(((e,t)=>{K({insId:e,pin:t})}),[]),{isDarkMode:ee}=(0,P.useDarkMode)();return(0,u.jsx)("div",{className:"flyde-flow-editor",children:(()=>{var n;if((0,c.isInlineValueNode)(D))throw new Error("Impossible state");return(0,u.jsx)(w.DarkModeProvider,{value:null!==(n=e.darkMode)&&void 0!==n?n:ee,children:(0,u.jsxs)(l.Fragment,{children:[Y?(0,u.jsx)(x.DataInspectionModal,{item:Y,onClose:X}):null,(0,u.jsx)(d.VisualNodeEditor,{currentInsId:c.ROOT_INS_ID,ref:t,boardData:E,onChangeBoardData:U,node:D,onGoToNodeDef:W,onChangeNode:q,resolvedDependencies:i,clipboardData:$,onCopy:H,nodeIoEditable:!D.id.startsWith("Trigger"),onInspectPin:Q,onShowOmnibar:B,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:S,initialPadding:e.initialPadding,instancesWithErrors:k,disableScrolling:e.disableScrolling},D.id),G?(0,u.jsx)(h.Omnibar,{flow:C,resolvedNodes:i,onCommand:J,visible:G,onClose:F}):null]})})})()})})))},9001:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeEditor=t.renderCreateIOOption=void 0;const i=n(35250),s=o(n(70079)),r=n(74762),a=n(50382),u=o(n(53865)),l=n(70457),c=n(25779);t.renderCreateIOOption=(e,t,n)=>(0,i.jsx)(a.MenuItem,{icon:"add",text:`Create "${e}"`,active:t,onClick:n,shouldDismissPopover:!1});const d=l.MultiSelect.ofType();t.BaseNodeEditor=e=>{var n,o;const{node:l,onChange:p}=e,f=(0,r.entries)(l.inputs),m=f.filter((e=>{let[,t]=e;return"required"===t.mode})).map((e=>{let[t]=e;return t})),g=f.filter((e=>{let[,t]=e;return"optional"===t.mode})).map((e=>{let[t]=e;return t})),v=f.filter((e=>{let[,t]=e;return"required-if-connected"===t.mode})).map((e=>{let[t]=e;return t})),[h,I]=s.default.useState(!1),y=(0,r.okeys)(l.outputs),b=s.default.useCallback((e=>{p({...l,id:e})}),[l,p]),C=s.default.useCallback((e=>{let t=e?e.split(","):void 0;"[]"===e&&(t=[]),p({...l,completionOutputs:t})}),[l,p]),_=s.default.useCallback((e=>{let t=e?e.split(","):void 0;p({...l,reactiveInputs:t})}),[l,p]),x=s.default.useCallback(((e,t)=>{const n=(0,u.default)(l,(n=>{n.inputs[e]=(0,r.nodeInput)(t)}));p(n)}),[l,p]),N=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.inputs[e]}));p(t)}),[l,p]),j=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{t.outputs[e]=(0,r.nodeOutput)()}));p(t)}),[l,p]),w=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.outputs[e]}));p(t)}),[l,p]);return(0,i.jsxs)("div",{className:"base-node-editor",children:[(0,i.jsx)("div",{className:"form-row",children:(0,i.jsx)(a.FormGroup,{label:"Node Name",labelFor:"text-input",labelInfo:"(required)",children:(0,i.jsx)(a.InputGroup,{id:"node-name",disabled:e.idDisabled,placeholder:"Node ID",value:l.id,onChange:e=>b(e.target.value)})})}),(0,i.jsx)(a.FormGroup,{label:"Required Inputs",children:(0,i.jsx)(d,{selectedItems:m,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),!0!==e.hiddenOutputs?(0,i.jsx)(a.FormGroup,{label:"Outputs",children:(0,i.jsx)(d,{selectedItems:y,placeholder:"Enter output names here",items:[],tagRenderer:e=>e,onItemSelect:j,onRemove:w,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}):null,(0,i.jsx)(a.Checkbox,{checked:h,onChange:e=>I(e.target.checked),children:"Show advanced options"}),(0,i.jsxs)(a.Collapse,{isOpen:h,children:[(0,i.jsx)(a.FormGroup,{label:"Optional Inputs",children:(0,i.jsx)(d,{selectedItems:g,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"optional"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Required-if-connected Inputs",children:(0,i.jsx)(d,{selectedItems:v,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required-if-connected"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Completion Outputs",children:(0,i.jsx)(a.InputGroup,{id:"completion-outputs",placeholder:"completion outputs",value:(null===(n=l.completionOutputs)||void 0===n?void 0:n.join(","))||"",onChange:e=>C(e.target.value)})}),(0,i.jsx)(a.FormGroup,{label:"Reactive Inputs",children:(0,i.jsx)(a.InputGroup,{id:"reactive-inputs",placeholder:"Reactive inputs",value:(null===(o=l.reactiveInputs)||void 0===o?void 0:o.join(","))||"",onChange:e=>_(e.target.value)})})]}),(0,i.jsx)(a.FormGroup,{label:"Preview",children:(0,i.jsx)("div",{className:"preview-wrapper",children:(0,i.jsx)(c.NodePreview,{node:l})})})]})}},82232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metaChange=t.functionalChange=void 0;t.functionalChange=e=>({type:"functional",message:e});t.metaChange=function(e){return void 0===e&&(e="n/a"),{type:"meta",message:e}}},41032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safelyGetNodeDef=t.loadingDef=void 0;const o=n(74762);t.loadingDef={id:"Loading",inputs:{},outputs:{}};t.safelyGetNodeDef=(e,n)=>{try{return(0,o.getNodeDef)(e,n)}catch(i){const n="string"==typeof e?e:e.nodeId;return{...t.loadingDef,id:n}}}},72125:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCodeModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(68371),f=n(74762),m=n(31745),g="`Result is ${inputs.a + inputs.b}`";t.InlineCodeModal=u.memo((function(e){const{initialValue:t,initialType:n}=e,[o,i]=u.useState((0,f.isDefined)(t)?t:g),[s,r]=u.useState(n||f.InlineValueNodeType.VALUE),v=(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:['You can add variables to by referrencing the "inputs" object.',(0,a.jsx)("br",{})," For example:",(0,a.jsx)(c.Code,{children:"`Hello {inputs.name}`"}),' will expose an input pin named "name"']}),(0,a.jsxs)("p",{children:["You can also use ternery expressions, arithmetic operators and more!",(0,a.jsx)("br",{}),"For example:",(0,a.jsx)(c.Code,{children:"inputs.a > inputs.b ? inputs.a + 42 : Math.random() * inputs.b"})]})]}),h=(0,a.jsxs)("span",{children:["Type in any valid JS value, such as ",(0,a.jsx)(c.Code,{children:"true"}),", ",(0,a.jsx)(c.Code,{children:"42"}),","," ",(0,a.jsx)(c.Code,{children:'["bob", "alice", "dave"]'}),".",(0,a.jsx)("br",{})," Dynamic inputs may also be used"]}),I=(0,a.jsxs)("span",{children:["Write any JS code and return a value.",(0,a.jsx)("br",{})," The returned value will be the output.",(0,a.jsx)("br",{})," Example:",(0,a.jsx)(c.Code,{children:"const a = inputs.a; const b = inputs.b; return Math.floor(a/b);"})]}),y=(0,p.getVariables)(o);return u.useEffect((()=>{o===g&&s===f.InlineValueNodeType.FUNCTION&&i(`return ${g}`),o===`return ${g}`&&s===f.InlineValueNodeType.VALUE&&i(g)}),[o,s]),(0,a.jsxs)(c.Dialog,{isOpen:!0,title:"Inline Value / Code",onClose:e.onCancel,className:"inline-code-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:t=>{"Enter"===t.key&&t.metaKey&&e.onSubmit(s,o)},tabIndex:0,children:[(0,a.jsxs)(c.RadioGroup,{inline:!0,onChange:e=>r(e.target.value),selectedValue:s,children:[(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Value ",(0,a.jsx)(m.InfoTooltip,{content:h})]}),value:f.InlineValueNodeType.VALUE}),(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Function ",(0,a.jsx)(m.InfoTooltip,{content:I})]}),value:f.InlineValueNodeType.FUNCTION})]}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"javascript",value:o,onChange:e=>i(e||""),onMount:e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})}}),(()=>{const e=o.includes("return");return e&&s===f.InlineValueNodeType.VALUE?(0,a.jsx)(c.Callout,{intent:c.Intent.WARNING,children:'When using the "value" type you are not expected to return anything'}):e||s!==f.InlineValueNodeType.FUNCTION?null:(0,a.jsxs)(c.Callout,{intent:c.Intent.DANGER,children:['When using the "function" type you are expected to'," ",(0,a.jsx)(c.Code,{children:"return"})," a value.",(0,a.jsx)("br",{}),"Example: ",(0,a.jsx)(c.Code,{children:"return 42 + Date.now();"})]})})(),(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Input pins detected:"," ",y.length?y.map((e=>(0,a.jsx)(c.Code,{children:e},e))):"None",(0,a.jsx)(m.InfoTooltip,{content:v})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:e.onCancel,children:"Cancel"}),(0,a.jsx)(c.Button,{onClick:()=>e.onSubmit(s,o),intent:c.Intent.PRIMARY,className:"save-btn",children:"Save"})]})})]})}))},18594:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(72125),t)},68371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInlineValueNode=t.getVariables=void 0;const o=n(74762),i=n(74762);t.getVariables=e=>(e.match(/inputs\.([a-zA-Z]\w*)/g)||[]).map((e=>e.replace(/inputs\./,"")));t.createInlineValueNode=e=>{let{code:n,customView:s,nodeId:r,type:a}=e;const u=(0,t.getVariables)(n).reduce(((e,t)=>({...e,[t]:(0,o.nodeInput)()})),{}),l={value:(0,o.nodeOutput)()},c=a===o.InlineValueNodeType.FUNCTION?`const result = (function() { ${n}}());\n Promise.resolve(result).then(val => outputs.value.next(val))`:`const result = (${n}); Promise.resolve(result).then(val => outputs.value.next(val))`,d=btoa(n);return(0,i.inlineValueNode)({id:r||`Inline Code ${(0,o.randomInt)(99999)}`,inputs:u,outputs:l,runFnRawCode:c,customViewCode:s||n,dataBuilderSource:d,templateType:a,completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline "+(a===o.InlineValueNodeType.VALUE?"value":"function")})}},49283:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Omnibar=t.OmniBarCmdType=void 0;const a=n(35250),u=s(n(70079)),l=n(70457),c=n(74762),d=n(50382),p=r(n(26372));var f;!function(e){e.ADD="add",e.ADD_VALUE="add-value",e.IMPORT="import"}(f=t.OmniBarCmdType||(t.OmniBarCmdType={}));const m=[];t.Omnibar=e=>{const{resolvedNodes:t}=e,[n,o]=u.useState(""),[i,s]=u.useState(null),[r,g]=u.useState([]);u.useEffect((()=>{const e=(0,c.keys)(t).map((e=>({title:`${t[e].id}`,cmd:{type:f.ADD,data:e},extra:"current flow"}))),n=r.map((e=>({title:`${e.node.id}`,description:e.node.description,cmd:{type:f.IMPORT,data:e},extra:`${e.module}`}))),o={title:"Add inline value or code",suggestOnEmpty:!0,cmd:{type:f.ADD_VALUE}},i=[...m,...n,o,...e];s(i)}),[t,r]),u.useEffect((()=>{e.onRequestImportables&&e.onRequestImportables(n).then((e=>{g(e)}))}),[e,n]);const v=u.useCallback(((e,t)=>{let{handleClick:n,modifiers:o,query:i,index:s}=t;if(!o.matchesPredicate)return null;const r=`${e.title}`;return(0,a.jsx)(d.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,a.jsxs)("div",{className:(0,p.default)("omnibar-item",{active:o.active}),children:[(0,a.jsxs)("div",{className:"title",children:[r," ",e.extra?(0,a.jsx)("span",{className:"extra",children:e.extra}):null]}),e.description?(0,a.jsx)("div",{className:"description",children:e.description}):null]})},s)}),[]),h=u.useCallback(((e,t)=>{const n=e.toLowerCase().split("").map((e=>{return`${t=e,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*`;var t})).join(""),o=new RegExp(n);return!!t.title.toLowerCase().match(o)}),[]),I=u.useCallback((t=>{e.onCommand(t.cmd),e.onClose()}),[e]);return i?(0,a.jsx)(l.Omnibar,{query:n,onQueryChange:o,onClose:e.onClose,noResults:(0,a.jsx)(d.MenuItem,{disabled:!0,text:"No results."}),itemPredicate:h,isOpen:e.visible,items:i,initialContent:void 0,onItemSelect:I,itemRenderer:v,inputProps:{placeholder:"Search for nodes or commands.."}}):null}},60698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43490:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31874),t)},31874:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.usePorts=t.useConfirm=t.usePrompt=t.PortsContext=t.defaultPorts=void 0;const s=n(70079),r=n(74762),a=n(84472);i(n(60698),t);const u=e=>async()=>{console.warn(`${e} Not implemented`),(0,a.toastMsg)("Feature not implemented in this context yet","warning")};t.defaultPorts={prompt:async e=>{let{text:t,defaultValue:n}=e;return prompt(`${t}`,n)},openFile:async e=>{},confirm:async e=>{let{text:t}=e;return confirm(t)},readFlow:u("readFlow"),setFlow:u("setFlow"),resolveDeps:u("resolveDeps"),getImportables:u("getImportables"),onExternalFlowChange:u("onExternalFlowChange"),onInstallRuntimeRequest:u("onInstallRuntimeRequest"),onRunFlow:u("onRunFlow"),onStopFlow:u("onStopFlow"),reportEvent:r.noop,generateNodeFromPrompt:u("generateNodeFromPrompt"),hasOpenAiToken:()=>Promise.resolve(!1)},t.PortsContext=(0,s.createContext)(t.defaultPorts);t.usePrompt=()=>{const e=(0,s.useContext)(t.PortsContext).prompt;return(t,n)=>e({text:t,defaultValue:n})};t.useConfirm=()=>{const e=(0,s.useContext)(t.PortsContext).confirm;return t=>e({text:t})};t.usePorts=()=>(0,s.useContext)(t.PortsContext)},65758:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelected=void 0;const i=n(74762),s=o(n(53865)),r=n(22513);t.groupSelected=async(e,t,n,o,a)=>{const{instances:u,connections:l}=t,c=u.filter((t=>e.includes(t.id))),d=l.filter((t=>{let{from:n,to:o}=t;return-1!==e.indexOf(n.insId)||-1!==e.indexOf(o.insId)}));if(!c.length)throw new Error("visual without selections");const{visualNode:p,renamedInputs:f,renamedOutputs:m}=await(0,r.createGroup)(c,d,n,a),g=c.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),u[0].pos),v="ref"===o?(0,i.nodeInstance)((0,i.createInsId)(p),p.id,{},g):(0,i.inlineNodeInstance)((0,i.createInsId)(p),p,{},g),h=u.filter((t=>-1===e.indexOf(t.id))),I=l.map((e=>{const t=`${e.from.insId}.${e.from.pinId}`,n=`${e.to.insId}.${e.to.pinId}`;return f[n]?{...e,to:{insId:v.id,pinId:f[n]}}:m[t]?{...e,from:{insId:v.id,pinId:m[t]}}:e})).filter((t=>-1===e.indexOf(t.from.insId)&&-1===e.indexOf(t.to.insId)));return{newNode:p,currentNode:(0,s.default)(t,(e=>{e.instances=[...h,v],e.connections=I}))}}},74089:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(97106),t),i(n(18420),t),i(n(90680),t),i(n(84472),t),i(n(17102),t),i(n(82232),t),i(n(25779),t),i(n(25804),t),i(n(9958),t),i(n(68120),t),i(n(94651),t),i(n(73470),t),i(n(94007),t),i(n(60190),t),i(n(9001),t),i(n(7047),t),i(n(23386),t)},31745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoTooltip=void 0;const o=n(35250),i=n(50382),s=n(50382),r=n(44470),a=n(50382);t.InfoTooltip=e=>{const{content:t}=e;return(0,o.jsx)(s.Tooltip,{content:t,placement:"top",className:"info-tooltip",children:(0,o.jsx)(i.Icon,{icon:(0,o.jsx)(r.InfoSign,{className:a.Classes.INTENT_PRIMARY}),intent:i.Intent.SUCCESS,className:"info-tooltip-icon"})})}},83938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserOnlyReactJson=void 0;const o=n(35250);t.BrowserOnlyReactJson=e=>{if("undefined"==typeof window)return null;const t=n(73541).Z;return(0,o.jsx)(t,{...e})}},94651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsValueRenderer=void 0;const o=n(35250),i=n(74762),s=n(83938);t.AnalyticsValueRenderer=e=>{let{val:t}=e;try{const e=JSON.parse(t),n="object"==typeof e?e:{value:e},r=e&&[e.type,e.key,e.props,e.ref].every(i.isDefined),a=r?{jsxValue:e}:n;return(0,o.jsx)(s.BrowserOnlyReactJson,{src:a,collapseStringsAfterLength:50,collapsed:r})}catch(n){return(0,o.jsx)(s.BrowserOnlyReactJson,{src:{value:t},collapseStringsAfterLength:50})}}},22513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=void 0;const o=n(74762),i=n(74762),s=n(60190),r=n(88593);t.createGroup=async(e,t,n,a)=>{if(0===e.length)throw new Error("cannot create group without instances");const u=e.map((e=>e.id)),l=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return!t&&n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.to,e.to)))===t)),c=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return t&&!n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.from,e.from)))===t));let d={},p={},f={},m={};const g=[],v={};for(const o of l){const e=`${o.to.insId}.${o.to.pinId}`,t=`${o.from.insId}.${o.from.pinId}`,n=o.to.pinId;if(f[t]){g.push({from:(0,i.externalConnectionNode)(f[t]),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)});continue}const r=v[n]?await a(`Name this input (${n} of ${o.to.insId}) is already taken:`)||`i${(0,s.rnd)()}`:n;d[e]=r,f[t]=r,g.push({from:(0,i.externalConnectionNode)(r),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)}),v[r]=(0,i.nodeInput)()}const h={};for(const r of c){const e=`${r.to.insId}.${r.to.pinId}`,t=`${r.from.insId}.${r.from.pinId}`,n=r.from.pinId;if(m[e]){g.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(m[e])});continue}const u=h[n]?await a(`Name this output (${n} of ${r.from.insId} is already taken:`)||`i${(0,s.rnd)()}`:n;p[t]=u,m[e]=u,g.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(u)}),h[u]=(0,o.nodeOutput)()}e.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),e[0].pos);const I=t.filter((e=>u.includes(e.from.insId)&&u.includes(e.to.insId)));return{visualNode:{id:n,inputs:v,outputs:h,instances:e,defaultStyle:{size:"large",color:(0,o.pickRandom)(r.nodeStylePresetColors.map((e=>e.color)))},inputsPosition:(0,o.okeys)(v).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:0}})),{}),outputsPosition:(0,o.okeys)(h).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:400}})),{}),connections:[...I,...g],completionOutputs:(0,o.okeys)(h)},renamedInputs:d,renamedOutputs:p}}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightText=void 0;const o=n(35250);function i(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}t.highlightText=(e,t)=>{let n=0;const s=t.split(/\s+/).filter((e=>e.length>0)).map(i);if(0===s.length)return[e];const r=new RegExp(s.join("|"),"gi"),a=[];for(;;){const t=r.exec(e);if(!t)break;const i=t[0].length,s=e.slice(n,r.lastIndex-i);s.length>0&&a.push(s),n=r.lastIndex,a.push((0,o.jsx)("strong",{children:t[0]},n))}const u=e.slice(n);return u.length>0&&a.push(u),a}},17102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Loader=void 0;const o=n(35250);t.Loader=()=>(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)("svg",{width:"38",height:"38",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:"#007ec6",children:(0,o.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,o.jsxs)("g",{transform:"translate(1 1)",strokeWidth:"2",children:[(0,o.jsx)("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),(0,o.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:(0,o.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})})})},23386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;const o=n(74762);t.logger=(0,o.debugLogger)("editor")},561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadMonaco=void 0;const o=n(51848),i=n(23386);let s=!1;t.preloadMonaco=()=>{s||o.loader.init().then((()=>{(0,i.logger)("monaco preloaded"),s=!0}))}},68120:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHotkeys=t.currentHotkeys=void 0;const i=o(n(45240)),s=n(70079);t.currentHotkeys=new Map,t.useHotkeys=function(e,n,o,r,a){void 0===r&&(r=[]);const u=(0,s.useCallback)((function(){a&&!a.current||n(...arguments)}),[...r,n]);(0,s.useEffect)((()=>((0,i.default)(e,{},u),t.currentHotkeys.set(e,o),()=>{t.currentHotkeys.delete(e),i.default.unbind(e,u)})),[e,u,o])}},94007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeSessionStorage=t.safeLocalStorage=void 0,t.safeLocalStorage={getItem:function(){try{return localStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return localStorage.setItem(...arguments)}catch(e){return null}}},t.safeSessionStorage={getItem:function(){try{return sessionStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return sessionStorage.setItem(...arguments)}catch(e){return null}}}},90680:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocalStorage=t.useResizePref=t.userPreferences=t.useUserPref=void 0;const r=s(n(70079)),a=n(18420),u=n(94007);t.useUserPref=(e,n)=>{const[o,i]=r.useState((()=>{const o=t.userPreferences.getItem(e);return(0,a.isDefined)(o)?o:n}));r.useEffect((()=>{const o=t.userPreferences.getItem(e),s=(0,a.isDefined)(o)?o:n;i(s)}),[e]);return[o,n=>{t.userPreferences.setItem(e,n),i(n)}]},t.userPreferences=(()=>{const e=e=>`up.${e}`;return{getItem:t=>{const n=u.safeLocalStorage.getItem(e(t))||"",o=u.safeSessionStorage.getItem(e(t))||"";try{return JSON.parse(o||n).value}catch(i){return}},setItem:function(t,n,o){void 0===o&&(o=!1);const i=o?sessionStorage:u.safeLocalStorage;try{const o=JSON.stringify({value:n});return i.setItem(e(t),o),!0}catch(s){return console.error("Error saving user preference",s),!1}}}})();t.useResizePref=(e,n)=>{const o=`resize.${e}`;return(0,t.useUserPref)(o,n)};const l=e=>{const t=u.safeLocalStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch(n){return null}};t.useLocalStorage=(e,t)=>{const[n,o]=r.useState(l(e)||t),i=r.useCallback((t=>{u.safeLocalStorage.setItem(e,JSON.stringify({value:t})),o(t)}),[e]);return r.useEffect((()=>{l(e)||u.safeLocalStorage.setItem(e,JSON.stringify({value:t}))}),[e,t,i]),[n,i]}},60190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.totalEnergy=t.itrPhysics=t.hookes=t.coulombs=t.vToStr=t.vNorm=t.vLen=t.vSub=t.vAdd=t.vDiv=t.vMul=t.vZero=t.rnd=t.vec=t.size=void 0;t.size=(e,t)=>({width:e,height:t});t.vec=(e,t)=>({x:e,y:t});t.rnd=function(e,t){return void 0===e&&(e=100),void 0===t&&(t=0),Math.floor(Math.random()*(e-t))+t},t.vZero={x:0,y:0};t.vMul=(e,t)=>{let{x:n,y:o}=e;return{x:n*t,y:o*t}};t.vDiv=(e,n)=>{let{x:o,y:i}=e;return(0,t.vMul)({x:o,y:i},1/n)};t.vAdd=(e,t)=>({x:e.x+t.x,y:e.y+t.y});t.vSub=(e,n)=>(0,t.vAdd)(e,(0,t.vMul)(n,-1));t.vLen=e=>{let{x:t,y:n}=e;return Math.sqrt(t*t+n*n)};t.vNorm=e=>(0,t.vDiv)(e,(0,t.vLen)(e)||1);t.vToStr=e=>{let{x:t,y:n}=e;return`${t.toFixed(1)},${n.toFixed(1)}`};t.coulombs=(e,n,o)=>{const i=(0,t.vLen)((0,t.vSub)(e.p,n.p));if(0===i){const i=(0,t.vec)(2*Math.random()-1,2*Math.random()-1),s=e.m*n.m/Math.pow(10,2);return(0,t.vMul)(i,s*o)}{const s=(0,t.vNorm)((0,t.vSub)(n.p,e.p)),r=e.m*n.m/Math.pow(i+.1,2);return(0,t.vMul)(s,r*o)}};t.hookes=(e,n,o,i,s)=>{const r=(0,t.vLen)((0,t.vSub)(e.p,n.p)),a=(0,t.vNorm)((0,t.vSub)(e.p,n.p));let u=0;return ri&&(u=i-r),(0,t.vMul)(a,s*u)};t.itrPhysics=(e,n)=>{const{p:o,v:i,f:s,m:r}=n,a=(0,t.vDiv)(s,r),u=e/1e3,l=(0,t.vAdd)((0,t.vMul)(a,u),i),c=(0,t.vAdd)((0,t.vMul)(l,u),o);return{...n,p:c,v:l,f:(0,t.vec)(0,0)}};t.totalEnergy=e=>e.reduce(((e,n)=>{const o=(0,t.vLen)(n.v);return e+.5*n.m*o*o}),0)},84472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateToast=t.toastMsg=t.AppToaster=void 0;const o=n(50382);t.AppToaster=(()=>{try{return o.OverlayToaster.create({className:"app-toaster",position:o.Position.BOTTOM_RIGHT})}catch(e){return{}}})();t.toastMsg=(e,n,o)=>t.AppToaster.show({message:e,intent:n,timeout:o});t.updateToast=(e,n,o)=>t.AppToaster.show({message:n,intent:o},e)},18420:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultAnd=t.isLocal=t.fullTime=t.timeAgoFromDt=t.timeAgo=t.toString=t.isDefined=t.set=t.createOmap=t.toOmap=t.values=t.keys=t.entries=void 0;const i=n(7047),s=n(74762),r=o(n(73136));t.entries=e=>Object.keys(e).map((t=>[t,e[t]]));t.keys=e=>Object.keys(e);t.values=e=>Object.keys(e).map((t=>e[t]));t.toOmap=e=>Array.from(e.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.createOmap=function(e){return void 0===e&&(e=[]),e.reduce(((e,t)=>({...e,[t[0]]:t[1]})),{})};t.set=(e,t,n)=>{e[t]=n};t.isDefined=e=>void 0!==e;t.toString=e=>{const t=typeof e;if(""===e)return"(empty string)";if((0,i.isJsxValue)(e))return"JSX Value";if((0,s.isStaticValueVisualNode)(e))return"Embedded Node";if((0,s.isEnvValue)(e))return(0,s.getEnvKeyFromValue)(e);if("object"===t)try{const t=JSON.stringify(e);return"{}"===t?"Empty object":t}catch(n){return"Object (cannot stringify)"}return`${e}`};t.timeAgo=e=>(0,r.default)(new Date(e)).fromNow();t.timeAgoFromDt=e=>(0,r.default)(Date.now()-e).fromNow();t.fullTime=e=>(0,r.default)(new Date(e)).toString();t.isLocal=()=>location.href.includes(":300");t.preventDefaultAnd=e=>t=>{t.preventDefault(),e(t)}},67181:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ActionButton=t.ActionsMenu=t.ActionType=void 0;const r=n(35250),a=n(50382),u=n(50382),l=n(74762),c=s(n(70079)),d=n(86125),p=n(43490),f=n(68120),m=n(90680),g=n(84472),v=n(9971),h=n(47749),I=n(46334),y=n(47230),b=n(41032);var C;!function(e){e.AddNode="add-node",e.RemoveNode="remove-node",e.Group="group",e.UnGroup="un-group",e.AddInlineValue="add-inline-value",e.Inspect="inspect",e.Run="run",e.AI="ai"}(C=t.ActionType||(t.ActionType={}));t.ActionsMenu=e=>{const{onAction:n,selectedInstances:o,resolvedNodes:i,node:s,from:u,to:h,hotkeysEnabled:x,showRunFlowOptions:N}=e,{onRequestImportables:j}=(0,d.useDependenciesContext)(),[w,P]=c.default.useState(!1),[O,E]=c.default.useState(!1),[D,S]=c.default.useState(!1),[M,k]=c.default.useState(null),[T,A]=(0,m.useLocalStorage)("hideHotkeyHintMap",{}),R=(0,c.useCallback)((()=>{P(!1)}),[]),{onRunFlow:V,generateNodeFromPrompt:z,reportEvent:$}=(0,p.usePorts)(),H=(0,c.useCallback)(((e,t)=>(E(!1),V(e,t))),[V]),G=[];if(G.push(C.AddNode),G.push(C.AddInlineValue),1===o.length){const e=s.instances.find((e=>e.id===o[0]));if(e)try{const t=(0,b.safelyGetNodeDef)(e,i);(0,l.isVisualNode)(t)&&G.push(C.UnGroup)}catch(q){console.error(`Could not find node with id ${o[0]} - ${q}`)}else console.error(`Could not find instance with id ${o[0]}`)}N&&G.push(C.Run),o.length>0&&G.push(C.Group),(1===o.length||u||h)&&G.push(C.Inspect),o.length>0&&G.push(C.RemoveNode),G.push(C.AI);const L=(0,c.useCallback)(((e,t)=>{A({...T,[e]:!0}),g.AppToaster.dismiss(t)}),[T,A]),F=(0,c.useCallback)(((e,t)=>{const{hotkey:o}=_[e];if("click"===t.type&&o&&!T[o]){const t=(0,g.toastMsg)((0,r.jsxs)(r.Fragment,{children:["Did you know? you can also use the hotkey"," ",(0,r.jsx)("kbd",{className:"hotkey",children:o})," to"," ",_[e].text.replace(/^[A-Z]/,(e=>e.toLowerCase())),(0,r.jsxs)(a.Button,{minimal:!0,small:!0,onClick:()=>L(o,t),children:[" ","Don't show again"," "]})]}),"none",3e3)}switch(e){case C.AddNode:P(!0);break;case C.Run:!async function(){E(!0)}();break;case C.AI:S(!0);break;default:n({type:e,data:void 0})}}),[T,n,L,s.inputs]);Object.entries(_).forEach((e=>{let[t,n]=e;n.hotkey&&(0,f.useHotkeys)(n.hotkey,(e=>{e.preventDefault(),G.includes(t)&&(F(t,e),A({...T,[n.hotkey]:!0}))}),{text:n.text,group:"Action menu hotkeys"},[G],x)}));const B=(0,c.useCallback)((e=>{n({type:C.AddNode,data:{importableNode:e}})}),[n]),U=(0,c.useCallback)((async e=>{const t=Date.now();k(t);try{$("generateNodeFromPrompt:start",{promptLength:e.length});const o=await z({prompt:e}),{inputs:i,outputs:s}=o.importableNode.node,r=Date.now()-t;$("generateNodeFromPrompt:success",{totalTime:r,inputs:Object.keys(i),outputs:Object.keys(s)}),k(null),n({type:C.AI,data:o}),S(!1)}catch(q){k(null),g.AppToaster.show({message:"Failed to generate node",intent:"danger"}),$("generateNodeFromPrompt:failure",{error:q.message})}}),[z,n,$]);return(0,r.jsxs)("div",{className:"actions-menu",children:[G.map((e=>(0,r.jsx)(t.ActionButton,{type:e,onClick:F},e))),w?(0,r.jsx)(v.AddNodeMenu,{onRequestImportables:j,onAddNode:B,onClose:R}):null,O?(0,r.jsx)(y.RunFlowModal,{onClose:()=>E(!1),onRun:H,node:s}):null,D?(0,r.jsx)(I.PromptAIMenu,{onClose:()=>{S(!1),k(null)},onSubmit:U,submitting:null!==M,submitTime:M}):null]})};const _={[C.AddNode]:{icon:h.addNodeIcon,text:'Open the "add node" menu',hotkey:"a"},[C.RemoveNode]:{icon:h.removeNodeIcon,text:"Remove selected instances",hotkey:"backspace"},[C.Group]:{icon:h.groupIcon,text:"Group selection into a new node",hotkey:"g"},[C.UnGroup]:{icon:h.ungroupIcon,text:"Ungroup selected visual node"},[C.Inspect]:{icon:h.inspectIcon,text:"Inspect data",hotkey:"i"},[C.AddInlineValue]:{icon:h.pencilIcon,text:"Add value / inline function",hotkey:"v"},[C.Run]:{icon:h.playIcon,text:"Run flow",hotkey:"r"},[C.AI]:{icon:h.starIcon,text:"Generate new code node using AI \u2728"}},x={icon:"",text:"N/A",hotkey:void 0};t.ActionButton=e=>{var t;const{onClick:n,type:o}=e,i=(0,c.useCallback)((e=>n(o,e)),[n,o]),s=null!==(t=_[o])&&void 0!==t?t:x,a=s.hotkey?(0,r.jsxs)("span",{children:[s.text," ",(0,r.jsx)("kbd",{className:"hotkey",children:s.hotkey})]}):s.text;return(0,r.jsx)("div",{className:"action-button",onClick:i,"data-type":o,children:(0,r.jsx)(u.Tooltip,{hoverOpenDelay:100,content:a,className:"icon-wrapper",popoverClassName:"action-button-tooltip",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s.icon}})})})}},40149:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenu=t.AddNodeMenuFilterTree=void 0;const a=n(35250),u=n(50382),l=n(74762),c=r(n(26372)),d=s(n(70079)),p=n(43490),f=n(31745),m=n(17102),g=n(87935),v=n(74657),h=n(44470);t.AddNodeMenuFilterTree=u.Tree.ofType();function I(e,t,n){return[...e.external.map((e=>({id:e.module,label:e.module,hasCaret:!0,nodeData:{type:"external",module:e.module},isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module,isExpanded:n.has(e.module),childNodes:e.namespaces.map((o=>({id:`${e.module}/${o}`,label:o,hasCaret:!1,isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module&&t.namespace===o,isExpanded:n.has(`${e.module}/${o}`),nodeData:{type:"external",module:e.module,namespace:o}})))}))),{id:"internal",label:"Current Project",nodeData:{type:"internal"},isExpanded:n.has("internal"),hasCaret:!0,isSelected:"internal"===t.type,childNodes:e.internal.files.map((e=>({id:e,label:e,isSelected:"internal"===t.type&&t.file===e,hasCaret:!1,isExpanded:n.has(e),nodeData:{type:"internal",file:e}})))}]}function y(e){return/\.flyde(\.[jt]s)?$/.test(e.module)}t.AddNodeMenu=e=>{const{onRequestImportables:n,onAddNode:o,onClose:i}=e,[s,r]=d.default.useState(),[b,C]=d.default.useState([]),[_,x]=d.default.useState(new Set),[N,j]=d.default.useState(""),[w,P]=d.default.useState({type:"all"}),[O,E]=d.default.useState(null),[D,S]=d.default.useState(null),[M,k]=d.default.useState(null),T=(0,d.useCallback)((e=>{_.add(e.id),x(new Set(_))}),[_]),A=(0,d.useCallback)((e=>{_.delete(e.id),x(new Set(_))}),[_]),R=(0,d.useCallback)((e=>{o(e),i()}),[o,i]),{onInstallRuntimeRequest:V,reportEvent:z}=(0,p.usePorts)();(0,d.useEffect)((()=>{z("addNodeMenuOpen",{})}),[z]),(0,d.useEffect)((()=>{S(null==s?void 0:s.flatMap((e=>{var t,n,o;if(w)if("external"===w.type){if((e.module!==w.module||w.namespace)&&e.node.namespace!==w.namespace)return[]}else if("internal"===w.type&&(!y(e)||w.file&&e.module!==w.file))return[];if(N){const i=`${null!==(n=null===(t=e.node.searchKeywords)||void 0===t?void 0:t.join(" "))&&void 0!==n?n:[]} ${e.node.id} ${null!==(o=e.node.namespace)&&void 0!==o?o:""} ${e.node.description}`.toLowerCase().indexOf(N.toLowerCase());return-1===i?[]:[{importable:e,score:i}]}return[{importable:e,score:1}]})).sort(((e,t)=>e.score-t.score)).map((e=>{let{importable:t}=e;return t})))}),[s,w,N]),(0,d.useEffect)((()=>{n().then((e=>{let{importables:t,errors:n}=e;C(n);const o=t.filter((e=>!y(e))).reduce(((e,t)=>{var n,o,i;null!==(n=e[i=t.module])&&void 0!==n||(e[i]=[]);const s=null!==(o=t.node.namespace)&&void 0!==o?o:"";return e[t.module].includes(s)||e[t.module].push(s),e}),{}),i=t.filter(y).map((e=>e.module));E({external:Object.entries(o).map((e=>{let[t,n]=e;return{module:t,namespaces:n}})),internal:{files:i}}),r(t),x(new Set(["internal",...Object.keys(o)]))}))}),[n]);const $=(0,d.useCallback)((e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),D&&!M)return void k(D["ArrowDown"===e.key?0:D.length-1]);if(D&&M){const t=D.findIndex((e=>e===M));let n="ArrowDown"===e.key?t+1:t-1;n=n<0?D.length-1:n,n=n>=D.length?0:n,k(D[n])}break;case"Enter":M&&R(M)}}),[D,M,R]),H=(0,d.useCallback)((e=>{let{nodeData:t}=e;JSON.stringify(t)===JSON.stringify(w)?"external"===t.type?t.namespace?P({type:"external",module:t.module}):P({type:"all"}):"internal"===t.type&&(t.file?P({type:"internal"}):P({type:"all"})):P(t)}),[w]),G=!s||s.some((e=>e.module.includes("@flyde/stdlib"))),L=(0,d.useCallback)((()=>{V(),i()}),[i,V]);return(0,a.jsx)(u.Dialog,{isOpen:!0,title:"Add Node Menu",onClose:e.onClose,className:"add-node-menu",isCloseButtonShown:!0,children:(0,a.jsxs)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),children:[(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"bp5-input-group",children:[(0,a.jsx)(h.Search,{}),(0,a.jsx)("input",{className:"bp5-input",type:"search",placeholder:"Search input",dir:"auto",autoFocus:!0,onChange:e=>j(e.target.value),value:N,onKeyDown:$})]}),G?null:(0,a.jsxs)(u.Callout,{intent:u.Intent.NONE,style:{marginTop:10},children:["Using built-in @flyde/stdlib. It's recommended to explicitly install it instead."," ",(0,a.jsx)(u.Button,{minimal:!0,small:!0,intent:u.Intent.PRIMARY,onClick:L,children:"Click here to install it using npm/yarn"})]})]}),(0,a.jsx)("div",{className:"content-wrapper",children:s?(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsxs)("aside",{children:[(0,a.jsxs)("div",{className:"filter-header",children:["Filter by package"," ",(0,a.jsx)(u.Tooltip,{content:(0,a.jsxs)("span",{children:["Click to learn more about how packages work in Flyde"," "]}),hoverCloseDelay:1500,children:(0,a.jsx)("a",{target:"_blank",href:"https://www.flyde.dev/docs/packages",rel:"noreferrer",children:(0,a.jsx)(u.Icon,{icon:(0,a.jsx)(h.Help,{}),intent:"primary",iconSize:12})})})]}),(0,a.jsx)("div",{className:"tree-container",children:(0,a.jsx)(t.AddNodeMenuFilterTree,{contents:I(O,w,_),onNodeCollapse:A,onNodeExpand:T,onNodeClick:H,className:u.Classes.ELEVATION_0})})]}),(0,a.jsx)("main",{children:D?0===D.length?(0,a.jsxs)("div",{className:"no-results",children:[(0,a.jsx)(v.AddNodeMenuResultsSummary,{filter:w,onChangeFilter:P,query:N,onChangeQuery:j,resultsCount:D.length}),(0,a.jsxs)(u.Callout,{className:"callout",intent:"primary",children:["Can't find a suitable node? Create one yourself!"," ",(0,a.jsx)("a",{href:"https://www.flyde.dev/docs/code-nodes",target:"_blank",rel:"noreferrer",children:"Learn more"})]})]}):(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsx)(v.AddNodeMenuResultsSummary,{filter:w,onChangeFilter:P,query:N,onChangeQuery:j,resultsCount:D.length}),(0,a.jsx)("div",{className:"results",children:D.map((e=>(0,a.jsx)(g.AddNodeMenuListItem,{importableNode:e,onAdd:R,selected:(null==M?void 0:M.node)===e.node,onSelect:k,onSetFilter:P},e.node.id+e.node.namespace+e.module)))})]}):(0,a.jsx)(m.Loader,{})})]}):(0,a.jsx)(m.Loader,{})}),b.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",style:{marginTop:"10px"},children:["Found ",(0,l.simplePluralize)(b.length,"corrupt flow"),(0,a.jsx)(f.InfoTooltip,{content:b.map((e=>{let{path:t,message:n}=e;return`${t}: ${n}`})).join(", ")})," "]}):null]})})}},8470:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuListItem=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079));t.AddNodeMenuListItem=e=>{const{importableNode:t,onSetFilter:n,onAdd:o,onSelect:i}=e,{node:s,module:r}=t,{id:d,description:p}=s,f=c.default.useRef(null);c.default.useEffect((()=>{e.selected&&f.current&&f.current.scrollIntoView({block:"center"})}),[e.selected]);const m=(0,c.useCallback)((()=>{o(t)}),[o,t]),g=(0,c.useCallback)((()=>{i(t)}),[i,t]);return(0,a.jsxs)("div",{className:(0,l.default)("add-node-menu-list-item",{selected:e.selected}),ref:f,onClick:g,children:[(0,a.jsxs)("div",{className:"content",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("span",{className:"id",children:d}),(0,a.jsxs)(u.Tag,{interactive:!0,onClick:()=>n({type:"external",module:r,namespace:s.namespace}),className:"source",minimal:!0,children:[r,s.namespace?` / ${s.namespace}`:null]})]}),(0,a.jsx)("div",{className:"description",children:p||(0,a.jsx)("em",{children:"No description"})})]}),(0,a.jsx)("aside",{children:(0,a.jsx)(u.Button,{onClick:m,children:"Add"})})]})}},87935:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8470),t)},88671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuResultsSummary=void 0;const o=n(35250),i=n(50382);t.AddNodeMenuResultsSummary=e=>{const{resultsCount:t,query:n,filter:s,onChangeFilter:r,onChangeQuery:a}=e;return(0,o.jsxs)("div",{className:"add-node-menu-results-summary",children:[t?`Showing ${t} result${t>1?"s":""}`:"No results found","\xa0",n?(0,o.jsxs)(o.Fragment,{children:["matching query\xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>a(""),children:['"',n,'"']})]}):null,"all"===s.type?null:"external"===s.type?(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["package ",s.module,s.namespace?` / ${s.namespace}`:null]})]}):(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["\xa0this project ",s.file?` / ${s.file}`:null]})]})]})}},74657:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88671),t)},9971:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40149),t)},83159:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PromptAIMenu=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=1e4;t.PromptAIMenu=e=>{const{onClose:t}=e,[n,o]=c.default.useState(""),[i,s]=c.default.useState(0);return(0,c.useEffect)((()=>{s(0);const t=setInterval((()=>{s((t=>{const n=(Date.now()-e.submitTime)/d;return Math.min(n+.05*Math.random()/2,.95)}))}),500);return()=>clearInterval(t)}),[e.submitTime]),(0,a.jsxs)(u.Dialog,{isOpen:!0,onClose:t,className:"prompt-ai-menu",title:"\u2728 Generate Code Node using AI",children:[(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsx)(u.TextArea,{value:n,disabled:e.submitting,onChange:e=>o(e.target.value),placeholder:"Describe your node in details",fill:!0})}),e.submitTime?(0,a.jsx)("div",{className:"progress-bar-container",children:(0,a.jsx)(u.ProgressBar,{value:i})}):null,(0,a.jsx)("div",{className:u.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:u.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(u.Button,{onClick:t,children:"Close"}),(0,a.jsx)(u.Button,{intent:u.Intent.PRIMARY,className:"run-btn",disabled:e.submitting||!n,loading:e.submitting,onClick:()=>{s(0),e.onSubmit(n)},children:"Create \u2728"})]})})]})}},46334:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(83159),t)},3152:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RunFlowModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(90680),f=n(31745);t.RunFlowModal=u.memo((function(e){const{onRun:t,onClose:n,node:o}=e,[i,s]=u.useState(0),[r,m]=(0,p.useLocalStorage)(`run-inputs-${o.id}`,Object.keys(o.inputs).reduce(((e,t)=>(e[t]=`Enter a value for input ${t}`,e)),{})),[g,v]=u.useState(JSON.stringify(r,null,2)),h=e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})},I=u.useCallback((()=>{const e=JSON.parse(g);m(e),t(e,i)}),[t,m,g,i]),y=Object.keys(o.inputs),b=y.filter((e=>"required"!==o.inputs[e].mode)),C=u.useMemo((()=>y.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:"This node receives external inputs. Enter values for each input below:"}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"json",value:g,onChange:e=>v(null!=e?e:""),onMount:h}),b.length>0?(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Note: input(s) ",(0,a.jsx)("code",{children:b.join(", ")})," are optional"]}):null]}):(0,a.jsx)("strong",{children:"This node does not receive any external inputs."})),[y.length,b,g]);return(0,a.jsxs)(c.Dialog,{isOpen:!0,onClose:e.onClose,className:"run-flow-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&I()},tabIndex:0,children:[C,(0,a.jsxs)("div",{className:"execution-delay-wrapper",children:[(0,a.jsxs)("label",{children:["Execution delay:"," ",(0,a.jsx)(f.InfoTooltip,{content:"Delay between each node execution. Useful for debugging."})]}),(0,a.jsx)(c.Slider,{value:i,onChange:s,min:0,labelStepSize:500,stepSize:100,labelRenderer:e=>`${e}ms`,max:1e3})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:n,children:"Close"}),(0,a.jsx)(c.Button,{onClick:I,intent:c.Intent.PRIMARY,className:"run-btn",children:"Run"})]})})]})}))},47230:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3152),t)},47749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starIcon=t.stopIcon=t.playIcon=t.pencilIcon=t.ungroupIcon=t.groupIcon=t.inspectIcon=t.removeNodeIcon=t.addNodeIcon=void 0,t.addNodeIcon='\n\n',t.removeNodeIcon='\n\n',t.inspectIcon='\n\n\n',t.groupIcon='\n\n\n',t.ungroupIcon='\n\n\n',t.pencilIcon='\n\n',t.playIcon='\n\n\n',t.stopIcon='\n\n\n',t.starIcon='\n\n\n\n\n'},1237:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HelpBubble=void 0;const i=n(70079),s=n(35250),r=n(50382),a=n(99489),u=n(50382),l=o(n(70079)),c=n(68120),d=n(71644),p=n(43490),f={offset:{enabled:!0,options:{offset:[0,20]}},preventOverflow:{enabled:!0,options:{padding:10}}};const m=["Viewport Controls","Editing","Selection"];t.HelpBubble=()=>{const[e,t]=l.default.useState(!1),n=Array.from(c.currentHotkeys.entries()).map((e=>{let[t,n]=e;return{combo:(o={key:t,menuData:n}).key,label:o.menuData.text,group:o.menuData.group};var o})).reduce(((e,t)=>(e[t.group]||(e[t.group]=[]),e[t.group].push(t),e)),{}),o=Object.entries(n).sort(((e,t)=>m.indexOf(t[0])-m.indexOf(e[0]))),{reportEvent:g}=(0,p.usePorts)(),v=(0,s.jsx)(r.Dialog,{isOpen:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:r.Classes.DIALOG_BODY,children:o.map((e=>{let[t,n]=e;return(0,s.jsxs)(l.default.Fragment,{children:[(0,s.jsx)(r.H4,{children:t}),n.map((e=>(0,i.createElement)(a.Hotkey,{...e,key:e.combo})))]},t)}))})}),h=(0,s.jsxs)(r.Menu,{children:[(0,s.jsx)(r.MenuItem,{text:"Hotkeys",onClick:()=>{t(!0),g("helpMenuItem",{item:"hotkeys"})}}),(0,s.jsx)(r.MenuItem,{text:"Documentation",onClick:()=>g("helpMenuItem",{item:"documentation"}),href:"https://www.flyde.dev/docs",target:"_blank"}),(0,s.jsx)(r.MenuDivider,{}),(0,s.jsx)(r.MenuItem,{text:"Discord",onClick:()=>g("helpMenuItem",{item:"discord"}),href:"https://discord.gg/x7t4tjZQP8",target:"_blank"})]});return(0,s.jsxs)("div",{className:"help-bubble","data-tip":"Help",children:[(0,s.jsx)(u.Popover,{content:h,modifiers:f,onOpened:()=>g("helpMenuOpen",{}),children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:d.helpIcon}})}),v]})}},71644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpIcon=void 0,t.helpIcon='\n\n\n'},3354:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1237),t)},7011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainInstanceEventsIndicator=void 0;const o=n(35250),i=n(30994),s=n(66189),r=n(50382);t.MainInstanceEventsIndicator=e=>{const{currentInsId:t,ancestorsInsIds:n}=e,{history:a,refreshHistory:u,resetHistory:l}=(0,s.useHistoryHelpers)(t),c=`main-indicator-${t}}`;return(0,o.jsx)("div",{className:"main-instance-events-indicator",children:(0,o.jsx)(r.Tooltip,{content:(0,s.calcHistoryContent)(a),children:(0,o.jsx)("span",{onMouseEnter:u,onMouseOut:l,id:(0,i.getMainInstanceIndicatorDomId)(t,n),className:"status-text","data-tip":"","data-html":!0,"data-for":c})})})}},22714:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7011),t)},63521:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VisualNodeEditor=t.defaultBoardData=t.defaultViewPort=t.NODE_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=n(74762),c=n(86553),d=n(65082),p=n(18420),f=n(26701),m=n(7047),g=n(53865),v=n(70079),h=n(68120),I=r(n(27942)),y=n(50382),b=n(66005),C=n(60190),_=n(71033),x=n(74762),N=n(99942),j=n(44338),w=n(561),P=n(84472),O=n(82232),E=n(18594),D=n(68371),S=r(n(61888)),M=n(65758),k=n(43490),T=r(n(26372)),A=n(25044),R=n(80510),V=n(1788),z=n(2130),$=n(88593),H=n(97106),G=n(67181),L=n(22714),F=n(3354),B=n(41032),U=n(30653),q=u.memo(y.Slider),W=()=>null;t.NODE_HEIGHT=28;t.defaultViewPort={pos:{x:0,y:0},zoom:1},t.defaultBoardData={selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}},t.VisualNodeEditor=u.memo(u.forwardRef(((e,n)=>{const{onChangeNode:o,nodeIoEditable:i,onCopy:s,onGoToNodeDef:r,onInspectPin:J,boardData:Y,onChangeBoardData:K,currentInsId:X,ancestorsInsIds:Q,node:ee,onShowOmnibar:te,resolvedDependencies:ne,queuedInputsData:oe,initialPadding:ie,disableScrolling:se}=e,{onImportNode:re}=(0,H.useDependenciesContext)(),ae=(0,U.useDarkMode)(),{reportEvent:ue}=(0,k.usePorts)(),le=e.parentViewport||t.defaultViewPort,[ce,de]=(0,v.useState)({...ne,[ee.id]:ee});(0,v.useEffect)((()=>{de({...ne,[ee.id]:ee})}),[ne,ee]);const{selected:pe,from:fe,to:me}=Y,{instances:ge,connections:ve,inputsPosition:he,outputsPosition:Ie,inputs:ye,outputs:be}=ee,[Ce,_e]=(0,v.useState)(),[xe,Ne]=(0,v.useState)(),je=void 0===Q,[we,Pe]=(0,v.useState)(0),[Oe,Ee]=(0,v.useState)(),[De,Se]=(0,v.useState)(!1),[Me,ke]=(0,v.useState)(),[Te,Ae]=(0,v.useState)(),[Re,Ve]=(0,v.useState)(),[ze,$e]=(0,v.useState)(),He=(0,v.useRef)();(0,f.useDidMount)((()=>{He.current=Qe.current.querySelector(".inline-editor-portal-root")}));const Ge=(0,k.useConfirm)(),Le=(0,k.usePrompt)(),Fe=Y.viewPort,Be=(0,v.useRef)(!0),[Ue,qe]=(0,v.useState)(null),We=u.useCallback((e=>{K({viewPort:e})}),[K]),Ze=u.useCallback(((e,t)=>J(e,t)),[J]),Je=u.useCallback(((e,t,n)=>{const i=(0,R.handleConnectionCloseEditorCommand)(ee,{from:e,to:t}),s=(0,l.isInternalConnectionNode)(t)?ge.find((e=>e.id===t.insId)):null,r=(s?s.inputConfig:{})[t.pinId],a=(0,l.isStaticInputPinConfig)(r)?(0,V.handleDetachConstEditorCommand)(i,t.insId,t.pinId):i;o(a,(0,O.functionalChange)("close-connection")),K({from:void 0,to:void 0}),ue("createConnection",{source:n})}),[ge,o,K,ee,ue]),Ye=u.useCallback((async()=>{const e=await Le("New visual node name?");if(!e)return;const{currentNode:t}=await(0,M.groupSelected)(Y.selected,ee,e,"inline",Le);o(t,(0,O.functionalChange)("group node")),(0,P.toastMsg)("Node grouped"),ue("groupSelected",{count:Y.selected.length})}),[Le,Y.selected,o,ee,ue]);(0,v.useEffect)((()=>{if(Oe){const e=setTimeout((()=>{Ee(void 0)}),350);return()=>clearTimeout(e)}}),[Oe]);const[Ke,Xe]=(0,v.useState)();(0,v.useEffect)((()=>{(0,w.preloadMonaco)()}),[]);const Qe=(0,v.useRef)(),et=(0,I.default)(Qe),tt=u.useRef({x:400,y:400}),nt=(0,f.useBoundingclientrect)(Qe)||C.vZero,ot=()=>{const e=(0,m.fitViewPortToNode)(ee,ce,et);(0,m.animateViewPort)(Fe,e,500,(e=>{We(e)}))},it=u.useCallback(((e,t)=>{const{to:n,from:o}=Y,i="input"===t?o:n,s="input"===t?n:o,r={pinId:e,insId:l.THIS_INS_ID},a="input"===t?{from:r}:{to:r};i&&i.pinId===e?K({from:void 0,to:void 0}):s?"input"===t&&n?Je(r,n,"nodeIoClick"):o&&Je(o,r,"nodeIoClick"):K(a)}),[Y,K,Je]),st=u.useCallback(((e,t,n)=>{const i=(0,g.produce)(ee,(o=>{"input"===e?o.inputs[t].description=n:o.outputs[t].description=n}));o(i,(0,O.functionalChange)("Node io description"))}),[o,ee]),rt=u.useCallback(((e,t,n)=>{const{from:o,to:i}=Y;if(fe&&fe.insId===e.id||me&&me.insId===e.id)K({from:void 0,to:void 0});else if("input"===n){const n={insId:e.id,pinId:t};!i||i.pinId!==t||(0,l.isInternalConnectionNode)(i)&&i.insId!==e.id?fe?Je(fe,n,"pinClick"):K({to:n,selected:[]}):K({to:void 0})}else{const n={insId:e.id,pinId:t};!o||o.pinId!==t||(0,l.isInternalConnectionNode)(o)&&o.insId!==e.id?me?Je(n,me,"pinClick"):K({from:n,selected:[]}):K({from:void 0})}}),[Y,fe,K,Je,me]);(0,v.useEffect)((()=>{if(!De&&et.width){const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);We(t);const n=setTimeout((()=>{const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);e.thumbnailMode||We(t),Se(!0)}),100);return()=>clearTimeout(n)}}),[ee,ie,et,e.thumbnailMode,De,ce,We]);const at=u.useCallback((()=>{const{selected:e}=Y,t=ee.instances.filter((t=>e.includes(t.id))).map((e=>({...e,id:e.id+"-copy"}))),n=ee.connections.filter((t=>{let{from:n,to:o}=t;return e.includes(n.insId)&&e.includes(o.insId)}));s({instances:t,connections:n})}),[Y,s,ee]),ut=u.useCallback((()=>{const{newNode:t,newInstances:n}=(0,A.pasteInstancesCommand)(ee,tt.current,e.clipboardData);o(t,(0,O.functionalChange)("paste instances")),K({selected:n.map((e=>e.id))})}),[o,K,ee,e.clipboardData]),lt=u.useCallback((()=>{const e=ee.id;Ke?"input"===Ke.type?Ke.ins.id===e?it(Ke.pin,"input"):rt(Ke.ins,Ke.pin,"input"):Ke.ins.id===e?it(Ke.pin,"output"):rt(Ke.ins,Ke.pin,"output"):console.warn("tried selecting closest with no pin nearby")}),[ee.id,Ke,it,rt]),ct=u.useCallback(((e,t)=>{const n=Math.min(Math.max(e,.1),3),o="mouse"===t?tt.current:{x:Fe.pos.x+et.width/2,y:Fe.pos.y+et.height/2},i=(0,m.centerBoardPosOnTarget)(o,et,n,Fe);We({...Fe,zoom:n,pos:i})}),[We,Fe,et]);(0,h.useHotkeys)("cmd+=",(e=>{ct(Fe.zoom+.1,"hotkey"),e.preventDefault()}),{text:"Zoom in board",group:"Viewport Controls"},[Fe,ct],Be),(0,h.useHotkeys)("cmd+-",(e=>{ct(Fe.zoom-.1,"hotkey"),e.preventDefault()}),{text:"Zoom out board",group:"Viewport Controls"},[ct,Fe.zoom],Be),(0,h.useHotkeys)("cmd+o",(e=>{e.preventDefault(),(0,P.toastMsg)("Ordering");const t=[];(0,N.orderVisualNode)(ee,ce,200,((e,n)=>{n%3==0&&t.push(e)})),(async()=>{for(;t.length;){const e=t.shift();(0,P.toastMsg)(`Step ${t.length}!`),await(0,l.delay)(200),o(e,(0,O.metaChange)("order-step")),(0,P.toastMsg)(`Step ${t.length}! done`)}})()}),{text:"Auto-layout (experimental)",group:"Misc."},[o,ee,ne],Be),(0,h.useHotkeys)("cmd+0",(e=>{ct(1),e.preventDefault()}),{text:"Reset zoom",group:"Viewport Controls"},[Fe,ct],Be);const dt=()=>{K({from:void 0,to:void 0,selected:[]})},pt=u.useCallback(((e,t)=>{_e(e.id),o({...ee},(0,O.metaChange)("drag-start"))}),[o,ee]),ft=u.useCallback(((e,t,n)=>{const{newValue:i,newSelected:s}=(0,m.handleInstanceDrag)(ee,e,n,t,pe,Ce);o(i,(0,O.metaChange)("drag-move")),s&&K({selected:s})}),[Ce,o,K,pe,ee]),mt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(void 0)}),[]),gt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(l.THIS_INS_ID)}),[]),vt=u.useCallback((async(t,n,o,i)=>{o.preventDefault(),o.stopPropagation();const{x:s,y:r}=i,a=(0,g.produce)(ee,(e=>{"input"===t?e.inputsPosition[n]={x:s,y:r}:e.outputsPosition[n]={x:s,y:r}}));e.onChangeNode(a,(0,O.metaChange)("node-io-drag-move"))}),[e,ee]),ht=u.useCallback((async(e,t,n,o)=>{n.preventDefault(),n.stopPropagation(),_e(void 0)}),[]),It=u.useCallback(((e,t)=>{let{id:n}=e;const o=t.shiftKey?pe.filter((e=>e!==n)):[],i=t.shiftKey?[...pe,n]:[n],s=pe.includes(n)?o:i;K({selected:s,from:void 0,to:void 0})}),[K,pe]),yt=u.useCallback((()=>{const e=ee.instances.map((e=>e.id));K({selected:e,from:void 0,to:void 0})}),[K,ee.instances]),bt=u.useCallback((e=>{const t=ve.filter((t=>{let{from:n,to:o}=t;return-1===e.indexOf(n.insId)&&-1===e.indexOf(o.insId)})),n=(0,g.produce)(ee,(n=>{n.connections=t,n.instances=n.instances.filter((t=>!e.includes(t.id)))}));K({selected:[]}),o(n,(0,O.functionalChange)("delete-ins"))}),[ve,o,K,ee]),Ct=u.useCallback((e=>{bt([e.id])}),[bt]),_t=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{"input"===e?(delete n.inputs[t],n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===t)))):(n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===t))),n.completionOutputs=(n.completionOutputs||[]).map((e=>e.split("+").filter((e=>e!==t)).join("+"))).filter((e=>!!e)),delete n.outputs[t])}));fe&&fe.insId===l.THIS_INS_ID&&fe.pinId===t?K({from:void 0}):me&&me.insId===l.THIS_INS_ID&&me.pinId===t&&K({to:void 0}),o(n,(0,O.functionalChange)("remove io pin"))}),[ee,fe,me,o,K]),xt=u.useCallback((async()=>{const{selected:e,from:t,to:n}=Y;0===e.length?t&&(0,l.isExternalConnectionNode)(t)?await Ge(`Are you sure you want to remove main input ${t.pinId}?`)&&_t("input",t.pinId):n&&(0,l.isExternalConnectionNode)(n)&&await Ge(`Are you sure you want to remove main output ${n.pinId}?`)&&_t("output",n.pinId):bt(e)}),[Ge,Y,bt,_t]),Nt=u.useCallback(((e,t,n)=>{const i=(0,m.getInstancePinConfig)(ee,e.id,t),s=(0,l.isStickyInputPinConfig)(i)?(0,x.queueInputPinConfig)():(0,l.stickyInputPinConfig)();o((0,m.changePinConfig)(ee,e.id,t,s),(0,O.functionalChange)("toggle-sticky")),ue("togglePinSticky",{isSticky:(0,l.isStickyInputPinConfig)(s)})}),[o,ee,ue]),jt=u.useCallback((()=>{const{newNode:e,newInstances:t}=(0,z.handleDuplicateSelectedEditorCommand)(ee,pe);o(e,(0,O.functionalChange)("duplicated instances")),K({selected:t.map((e=>e.id))})}),[o,K,ee,pe]),wt=u.useCallback((e=>{const t=e.nativeEvent.target;if(0===e.button&&Z(e.nativeEvent,ee.id)&&t&&"board-editor-inner"===t.className){if(Date.now()-we<300)return void te(e);Pe(Date.now());const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,nt),o=(0,m.domToViewPort)(n,Fe,le);Ne({from:o,to:o})}}),[ee.id,Fe,we,nt,le,te]),Pt=u.useCallback((e=>{if(qe(null),Z(e.nativeEvent,ee.id)&&xe){if((0,m.calcSelectionBoxArea)(xe)>50){const t=(0,m.getInstancesInRect)(xe,ce,Fe,Kt.current,ee.instances,nt,le),n=e.shiftKey?[...pe,...t]:t;K({selected:n})}Ne(void 0)}}),[ee.id,ee.instances,xe,ce,Fe,nt,le,pe,K]),Ot=u.useCallback((e=>{if(!Z(e.nativeEvent,ee.id))return void(Be.current=!1);Be.current=!0;const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,(0,C.vAdd)(nt,C.vZero)),o=(0,m.domToViewPort)(n,Fe,le);xe&&Ne({...xe,to:o});const i=(0,m.findClosestPin)(ee,ce,n,nt,X,Q,Fe),s=Ke;if(i){(!s||s.ins!==i.ins||s.ins===i.ins&&s.pin!==i.pin)&&Xe({ins:i.ins,type:i.type,pin:i.id})}tt.current=o,K({lastMousePos:tt.current})}),[ee,nt,Fe,le,xe,ce,X,Q,Ke,K]),Et=u.useCallback((e=>{var t;"bp5-menu"!==(null===(t=e.relatedTarget)||void 0===t?void 0:t.className)&&(Xe(void 0),Be.current=!1)}),[]),Dt=u.useCallback(((e,t)=>{if(t){const t=(0,l.isInlineNodeInstance)(e)?e.node:(0,B.safelyGetNodeDef)(e.nodeId,ce);if(!t)throw new Error("Impossible state inspecting inexisting node");if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Cannot inspect a non visual node","warning");$e({insId:`${X}.${e.id}`,node:t})}else if((0,l.isRefNodeInstance)(e)){const t=(0,B.safelyGetNodeDef)(e,ce);r(t)}else{const t=e.node;if(!(0,l.isInlineValueNode)(t))return void((0,l.isVisualNode)(t)?$e({insId:e.id,node:t}):(0,P.toastMsg)("Editing this type of node is not supported"));const n=atob(t.dataBuilderSource);Ve({insId:e.id,templateType:t.templateType,value:n,type:"existing"}),(0,P.toastMsg)("Editing inline visual node not supported yet")}}),[r,ce,X]),St=u.useCallback((e=>{if((0,l.isInlineNodeInstance)(e)){const t=e.node;if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Not supported","warning");const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.filter((t=>t.id!==e.id)),n.connections=n.connections.filter((t=>{let{from:n,to:o}=t;return n.insId!==e.id&&o.insId!==e.id})),n.instances.push(...t.instances),n.connections.push(...t.connections.filter((e=>(0,l.isInternalConnectionNode)(e.from)&&(0,l.isInternalConnectionNode)(e.to))))}));o(n,{type:"functional",message:"ungroup"}),K({selected:[]})}else{const t=(0,B.safelyGetNodeDef)(e.nodeId,ce);if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Not supported","warning")}}),[ee,o,K,ce]),Mt=u.useCallback((async e=>{}),[]),kt=u.useCallback(((e,t)=>{const n=(0,V.handleDetachConstEditorCommand)(ee,e.id,t);o(n,(0,O.functionalChange)("detach-const"))}),[o,ee]),Tt=u.useCallback(((e,t)=>{const n=e.inputConfig[t]||(0,x.queueInputPinConfig)();(0,l.isStaticInputPinConfig)(n)&&(Ae(n.value),P.AppToaster.show({message:"Value copied"}))}),[]),At=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{const o=n.instances.find((t=>t.id===e.id));if(!o)throw new Error("Impossible state");o.inputConfig[t]=(0,l.staticInputPinConfig)(Te),n.connections=n.connections.filter((n=>!(0,l.isInternalConnectionNode)(n.to)||!(n.to.insId===e.id&&n.to.pinId===t)))}));o(n,(0,O.functionalChange)("paste const value"))}),[ee,o,Te]),Rt=u.useCallback((async e=>{const t=await Le("New name?");if(!t)return;const n=(0,g.produce)(ee,(n=>{var o;"input"===e?(ee.inputs||(n.inputs={}),n.inputs[t]=(0,l.nodeInput)(),n.inputsPosition[t]=tt.current):(ee.outputs||(n.outputs={}),n.outputs[t]=(0,l.nodeOutput)(),n.outputsPosition[t]=tt.current,(null===(o=n.completionOutputs)||void 0===o?void 0:o.length)&&(0,P.toastMsg)("Note that this node has explicit completion outputs set. You may need to update them."))}));o(n,(0,O.functionalChange)("add new io pin")),ue("addIoPin",{type:e})}),[Le,ee,o,ue]),Vt=u.useCallback((async()=>{var e;const t=null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","),n=await Le("Edit completion outputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,g.produce)(ee,(e=>{e.completionOutputs=""===n?void 0:n.split(",")}));o(e,(0,O.functionalChange)("change node completions")),ue("editCompletionOutputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),zt=u.useCallback((async()=>{var e;const t=null===(e=ee.reactiveInputs)||void 0===e?void 0:e.join(","),n=await Le("Edit reactive inputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,g.produce)(ee,(e=>{e.reactiveInputs=""===n?void 0:n.split(",")}));o(e,(0,O.functionalChange)("change reactive inputs")),ue("editReactiveInputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),$t=u.useCallback((async()=>{const e=await Le("Description?",ee.description),t=(0,g.produce)(ee,(t=>{t.description=e}));o(t,(0,O.functionalChange)("Edit node description"))}),[Le,o,ee]),Ht=u.useCallback((e=>{const t=(0,g.produce)(ee,(t=>{t.defaultStyle=e}));o(t,(0,O.functionalChange)("change default style")),ue("changeStyle",{isDefault:!0})}),[o,ee,ue]),Gt=u.useCallback((async(e,t)=>{const n=await Le("New name?",t)||t,i=(0,m.handleIoPinRename)(ee,e,t,n);o(i,(0,O.functionalChange)("rename io pin"))}),[ee,o,Le]),Lt=u.useCallback(((e,t)=>{const n=(0,m.handleChangeNodeInputType)(ee,e,t);o(n,(0,O.functionalChange)("toggle io pin optional"))}),[ee,o]),Ft=u.useCallback((e=>{switch(e.type){case G.ActionType.RemoveNode:{const e=(0,g.produce)(ee,(e=>{if(!(0,l.isVisualNode)(ee))throw new Error("Impossible state, deleting instances opf non visual node");e.instances=e.instances.filter((e=>!pe.includes(e.id))),e.connections=e.connections.filter((e=>!pe.includes(e.from.insId)&&!pe.includes(e.to.insId)))}));K({selected:[]}),o(e,(0,O.functionalChange)("remove-instances")),(0,P.toastMsg)(`Removed ${pe.length} instances(s)`),ue("deleteInstances",{count:pe.length});break}case G.ActionType.Inspect:if(1===pe.length)J(pe[0]);else if(fe||me){const e=null!=fe?fe:me,t=(0,l.isExternalConnectionNode)(e)?l.ROOT_INS_ID:e.insId;J(t,{type:fe?"output":"input",id:e.pinId})}ue("openInspectMenu",{source:"actionMenu"});break;case G.ActionType.Group:(async()=>{await Ye()})();break;case G.ActionType.UnGroup:{const e=ee.instances.find((e=>e.id===pe[0]));St(e);const t=(0,B.safelyGetNodeDef)(e,ce);(0,P.toastMsg)(`Ungrouped inline node ${t.id}`),ue("unGroupNode",{instancesCount:t.instances.length});break}case G.ActionType.AddInlineValue:Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"actionMenu"});break;case G.ActionType.AddNode:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,g.produce)(ee,(e=>{e.instances.push(r)})),u=(0,g.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,O.functionalChange)("add new instance")),K(u),(0,P.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;case G.ActionType.AI:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,g.produce)(ee,(e=>{e.instances.push(r)})),u=(0,g.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,O.functionalChange)("add new instance")),K(u),(0,P.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;default:(0,P.toastMsg)(`${e.type} not supported yet`)}}),[Y,fe,o,K,Ye,re,J,St,ee,ce,ue,pe,me,Fe,et]),Bt=()=>{const t=Y.from;return(0,p.entries)(ye).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:X,ancestorInsIds:e.ancestorsInsIds,type:"input",pos:he[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,onDblClick:Zt,closest:!(!Ke||"input"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,inputMode:s.mode,onChangeInputMode:Lt,viewPort:Fe,onDragStart:gt,onDragEnd:ht,onDragMove:vt,onSelect:it,onSetDescription:st,selected:(null==t?void 0:t.pinId)===o,description:s.description,onMouseUp:Nn,onMouseDown:xn},o)}))},Ut=()=>{const{to:t}=Y;return(0,p.entries)(be).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:X,ancestorInsIds:e.ancestorsInsIds,type:"output",pos:Ie[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,closest:!(!Ke||"output"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,viewPort:Fe,onDragStart:gt,onDragEnd:ht,onDragMove:vt,onSelect:it,onSetDescription:st,description:s.description,selected:(null==t?void 0:t.pinId)===o,onMouseUp:Nn,onMouseDown:xn},o)}))},qt=()=>{if(xe){const{from:e,to:t}=xe,n=(0,m.logicalPosToRenderedPos)(e,Fe),o=(0,m.logicalPosToRenderedPos)(t,Fe),{x:i,y:s,w:r,h:u}=(0,m.getSelectionBoxRect)(n,o);return(0,a.jsx)("div",{className:"selection-box",style:{top:s,left:i,width:r,height:u}})}return null},Wt=u.useCallback((async(e,t,n,o)=>{if("input"===n){const n=e.inputConfig[t],o=(0,l.isStaticInputPinConfig)(n)?JSON.stringify(n.value):void 0;Ve({type:"static-input",insId:e.id,pinId:t,value:null!=o?o:JSON.stringify("Some static value")}),ue("addValueModalOpen",{source:"dblClickPin"})}else{const i=(0,B.safelyGetNodeDef)(e,ce);if(!(0,l.getNodeOutputs)(i)[t])throw new Error("Dbl clicked on un-existing pin");ke({pos:{x:o.clientX,y:o.clientY},ins:e,targetNode:i,pinId:t,pinType:n})}}),[ce,ue]),Zt=u.useCallback((async(e,t)=>{if(!ee.inputs[e])throw new Error("Dbl clicked on un-existing pin");ke({pos:{x:t.clientX,y:t.clientY},pinId:e,pinType:"input",targetNode:ee})}),[ee]),Jt=u.useCallback((e=>{if(e.metaKey||e.ctrlKey){const t=-.005*e.deltaY;ct(Fe.zoom+t,"mouse"),e.preventDefault(),e.stopPropagation()}else{if(se)return;const t=e.deltaX,n=e.deltaY,o=(0,g.produce)(Fe,(e=>{e.pos.x=e.pos.x+t/e.zoom,e.pos.y=e.pos.y+n/e.zoom}));We(o),e.stopPropagation(),e.preventDefault()}}),[se,ct,We,Fe]);(0,v.useEffect)((()=>{const{current:e}=Qe;if(e)return e.addEventListener("wheel",Jt),()=>{e.removeEventListener("wheel",Jt)}}),[Jt]);const Yt={backgroundPositionX:(0,m.roundNumber)(-Fe.pos.x*Fe.zoom),backgroundPositionY:(0,m.roundNumber)(-Fe.pos.y*Fe.zoom),backgroundSize:(0,m.roundNumber)(10*Fe.zoom)+"px"},Kt=u.useRef(new Map);u.useEffect((()=>{const e=ge.reduce(((e,t)=>{const n=(0,B.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeInputs)(n))),e}),new Map),t=ge.reduce(((e,t)=>{const n=(0,B.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeOutputs)(n))),e}),new Map);e.set(l.THIS_INS_ID,(0,l.keys)(ee.outputs)),t.set(l.THIS_INS_ID,(0,l.keys)(ee.inputs));const n=ve.filter((n=>{const o=e.get(n.to.insId)&&e.get(n.to.insId).includes(n.to.pinId),i=t.get(n.from.insId)&&t.get(n.from.insId).includes(n.from.pinId);return!(o&&i)}));if(n.length>0){(0,P.toastMsg)(`${n.length} orphan connections removed`,"warning"),console.warn(`${n.length} orphan connections removed`,n);const e=(0,g.produce)(ee,(e=>{e.connections=ee.connections.filter((e=>!n.includes(e)))}));o(e,(0,O.functionalChange)("prune orphan connections"))}}),[ge,o,ve,ee,ce]),u.useEffect((()=>{let e=[];const t=(0,g.produce)(ee,(t=>{t.instances=t.instances.map((t=>{const n=(0,B.safelyGetNodeDef)(t,ce);if(n){const o=(0,l.getNodeInputs)(n),i=(0,l.getNodeOutputs)(n);if(t.visibleInputs){const n=t.visibleInputs.filter((e=>!o[e]));n.length>0&&(t.visibleInputs=(0,l.keys)(o),e.push(...n))}if(t.visibleOutputs){const n=t.visibleOutputs.filter((e=>!i[e]));n.length>0&&(t.visibleOutputs=(0,l.keys)(i),e.push(...n))}}return t}))}));e.length>0&&((0,P.toastMsg)(`Found ${e.length} invalid visible inputs/outputs: ${e.join(", ")}. Reset them`,"warning"),o(t,(0,O.functionalChange)("reset corrupt visible inputs/outputs")))}),[ge,o,ee,ce]),(0,v.useEffect)((()=>{const e=new Map(ge.map((e=>[e.id,e])));Kt.current=ve.reduce(((t,n)=>{const o=t.get(n.to.insId)||{},i=o[n.to.pinId]||[],s={...o,[n.to.pinId]:[...i,e.get(n.from.insId)]};return t.set(n.to.insId,s),t}),new Map)}),[ve,ge]);const Xt=u.useCallback((()=>{ke(void 0)}),[]),Qt=u.useCallback((async e=>{if(!Me)throw new Error("impossible state - quick add menu invoked but not available");const{ins:t,pinId:n}=Me;switch(e.type){case"import":case"node":{const i="import"===e.type?await re(e.importableNode):ce,s="import"===e.type?e.importableNode.node:e.node,r=(0,m.createNewNodeInstance)(s.id,100,tt.current,i);if(r){const e=(0,g.produce)(ee,(e=>{e.instances.push(r),e.connections.push({from:{insId:t?t.id:l.THIS_INS_ID,pinId:n},to:{insId:r.id,pinId:l.TRIGGER_PIN_ID}})}));o(e,(0,O.functionalChange)("add-item-quick-menu")),Xt()}ue("addNode",{nodeId:s.id,source:"quickAdd"});break}case"value":if(!t)return void(0,P.toastMsg)("Cannot add value to main input");Ve({type:"new-output",insId:t.id,pinId:n}),ue("addValueModalOpen",{source:"quickAdd"})}}),[Me,ce,ue,ee,o,Xt,re]),en=u.useCallback((async()=>{const e=JSON.stringify(ee);await navigator.clipboard.writeText(e),P.AppToaster.show({message:"Copied!"})}),[ee]),tn=u.useCallback((()=>{var e,t;const n=i?"":" (cannot edit main node, only visual)";return(0,a.jsxs)(y.Menu,{children:[(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"New Value",onClick:(0,p.preventDefaultAnd)((()=>{Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"contextMenu"})}))}),(0,a.jsx)(y.MenuItem,{text:`New input ${n}`,onMouseDown:e=>e.stopPropagation(),onClick:(0,p.preventDefaultAnd)((()=>Rt("input"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`New output ${n}`,onClick:(0,p.preventDefaultAnd)((()=>Rt("output"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Copy node to clipboard",onClick:(0,p.preventDefaultAnd)(en)}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Completion Outputs (${(null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Vt()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Reactive inputs (${(null===(t=ee.reactiveInputs)||void 0===t?void 0:t.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>zt()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Edit description",onClick:(0,p.preventDefaultAnd)((()=>$t()))}),(0,a.jsx)(y.MenuDivider,{}),(0,a.jsx)(y.MenuItem,{text:"Default Style",children:(0,a.jsx)($.NodeStyleMenu,{style:ee.defaultStyle,onChange:Ht,promptFn:Le})})]})}),[i,en,ee.completionOutputs,ee.reactiveInputs,ee.defaultStyle,Ht,Le,ue,Rt,Vt,zt,$t]);(0,h.useHotkeys)("shift+c",ot,{text:"Center viewport",group:"Viewport Controls"},[],Be),(0,h.useHotkeys)("cmd+c",at,{text:"Copy instances",group:"Editing"},[],Be),(0,h.useHotkeys)("cmd+v",ut,{text:"Paste instances",group:"Editing"},[],Be),(0,h.useHotkeys)("esc",dt,{text:"Clear selections",group:"Selection"},[],Be),(0,h.useHotkeys)("backspace",xt,{text:"Delete instances",group:"Editing"},[],Be),(0,h.useHotkeys)("shift+d",jt,{text:"Duplicate selected instances",group:"Editing"},[],Be),(0,h.useHotkeys)("cmd+a",yt,{text:"Select all",group:"Selection"},[],Be),(0,h.useHotkeys)("s",lt,{text:"Select pin closest to mouse",group:"Selection"},[],Be);const nn=u.useCallback(((e,t)=>{if(!ze)throw new Error("impossible state");const n=(0,g.produce)(ee,(t=>{const n=t.instances.find((e=>e.id===ze.insId));if(!n||!(0,l.isInlineNodeInstance)(n))throw new Error("impossible state");n.node=e}));o(n,(0,O.functionalChange)("Inner change: "+t.message)),$e((t=>({...t,node:e})))}),[o,ze,ee]),[on,sn]=(0,v.useState)({selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}}),rn=u.useCallback((e=>sn((t=>({...t,...e})))),[]),an=n=>ze&&ze.insId===n.id?{currentInsId:ze.insId,ancestorsInsIds:(0,l.fullInsIdPath)(X,Q),boardData:on,onChangeBoardData:rn,resolvedDependencies:ne,onCopy:s,clipboardData:e.clipboardData,onInspectPin:e.onInspectPin,onGoToNodeDef:e.onGoToNodeDef,nodeIoEditable:e.nodeIoEditable,node:ze.node,onChangeNode:nn,onShowOmnibar:te,parentViewport:t.defaultViewPort,parentBoardPos:nt,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:e.queuedInputsData}:void 0,un=()=>{if(fe&&("input"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"output"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(e)&&!(0,l.isInternalConnectionNode)(fe))return;return{from:fe,to:e}}if(me&&("output"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"input"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(me)&&!(0,l.isInternalConnectionNode)(e))return;return{from:e,to:me}}},ln=()=>{const e=un();if(e){const{from:t,to:n}=e;return{connection:{from:t,to:n},type:ve.some((t=>(0,l.connectionDataEquals)(t,e)))?"future-remove":"future-add"}}},cn=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleInputs:t}:n))}));o(n,(0,O.functionalChange)("change instance visible inputs"))}),[ee,o]),dn=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,style:t}:n))}));o(n,(0,O.functionalChange)("change instance style")),ue("changeStyle",{isDefault:!1})}),[o,ee,ue]),pn=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleOutputs:t}:n))}));o(n,(0,O.functionalChange)("change instance visible outputs"))}),[ee,o]),fn=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,displayName:t}:n))}));o(n,(0,O.functionalChange)("change instance display name"))}),[ee,o]);u.useImperativeHandle(n,(()=>({centerInstance(e){const t=ee.instances.find((t=>t.id===e));if(t){const e=(0,C.vSub)(t.pos,(0,C.vec)(et.width/2,et.height/2));We({...Fe,pos:e})}},centerViewPort(){ot()},getViewPort:()=>Fe,clearSelection:()=>{dt()},requestNewInlineValue:()=>{Ve({type:"new-floating",pos:tt.current})}})));const[mn,gn]=u.useState([]),vn=u.useCallback(((e,t)=>{const n=t.trim().substr(0,100),i=`Inline-value-${n.substr(0,15).replace(/["'`]/g,"")}`,s=(0,D.createInlineValueNode)({code:t,customView:n,nodeId:i,type:e});switch(Re.type){case"existing":{const[e]=ee.instances.filter((e=>e.id===Re.insId)).filter((e=>(0,l.isInlineNodeInstance)(e))).map((e=>e.node));if(!e)throw new Error("Unable to find inline node to save to");const t=(0,l.keys)(e.inputs),n=(0,l.keys)(s.inputs),i=new Set(S.default.difference(t,n)),r=(0,g.produce)(ee,(e=>{e.instances=e.instances.map((e=>e.id===Re.insId?(0,l.inlineNodeInstance)(e.id,s,e.inputConfig,e.pos):e)),e.connections=e.connections.filter((e=>!(e.to.insId===Re.insId&&i.has(e.to.pinId))))}));o(r,(0,O.functionalChange)("change inline value")),Ve(void 0);break}case"static-input":{let e;try{const n=t.replace(/^['`]/,'"').replace(/['`]$/,'"');e=JSON.parse(n)}catch(r){return void(0,P.toastMsg)("Input values must not be formulas or code")}const n=(0,g.produce)(ee,(t=>{t.instances.find((e=>e.id===Re.insId)).inputConfig[Re.pinId]=(0,l.staticInputPinConfig)(e)}));o(n,(0,O.functionalChange)("set static input value")),Ve(void 0);break}case"new-floating":{const e=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},Re.pos),t=(0,g.produce)(ee,(t=>{t.instances.push(e)}));o(t,(0,O.functionalChange)("new floating value")),Ve(void 0);break}case"new-output":{const{insId:e,pinId:t}=Re,n=ee.instances.find((t=>t.id===e));if(!n)throw new Error("Impossible state");const i=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},(0,C.vAdd)(n.pos,{x:-50,y:150})),r=(0,g.produce)(ee,(n=>{n.instances.push(i),n.connections.push({from:(0,l.connectionNode)(e,t),to:(0,l.connectionNode)(i.id,l.TRIGGER_PIN_ID)})}));o(r,(0,O.functionalChange)("new value connected to output")),Ve(void 0)}}ue("addValue",{type:e,placeholdersCount:(0,l.keys)(s.inputs).length})}),[Re,o,ee,ue]),hn=ve.filter((e=>{const t=un();return!t||!(0,l.connectionDataEquals)(t,e)})),In=u.useCallback((()=>{$e(void 0),sn(t.defaultBoardData)}),[]),yn=u.useCallback((e=>{const t=(0,g.produce)(ee,(t=>{const n=t.connections.find((t=>(0,l.connectionDataEquals)(t,e)));n.hidden=!n.hidden}));o(t,(0,O.functionalChange)("toggle connection hidden"))}),[o,ee]),bn=u.useCallback((e=>{const t=(0,g.produce)(ee,(t=>{t.connections=t.connections.filter((t=>!(0,l.connectionDataEquals)(t,e)))}));o(t,(0,O.functionalChange)("remove connection"))}),[o,ee]),Cn=u.useCallback(((e,t,n)=>{qe("input"===n?{to:(0,l.connectionNode)(e.id,t),from:void 0}:{from:(0,l.connectionNode)(e.id,t),to:void 0})}),[]),_n=u.useCallback(((e,t,n)=>{Ue&&(Ue.from&&"input"===n?Je(Ue.from,(0,l.connectionNode)(e.id,t),"pinDrag"):Ue.to&&"output"===n&&Je((0,l.connectionNode)(e.id,t),Ue.to,"pinDrag")),qe(null)}),[Ue,Je]),xn=u.useCallback(((e,t)=>{}),[]),Nn=u.useCallback(((e,t)=>{Ue&&(Ue.from&&"output"===t?Je(Ue.from,(0,l.externalConnectionNode)(e),"nodeIoPinDrag"):Ue.to&&"input"===t&&Je((0,l.externalConnectionNode)(e),Ue.to,"nodeIoPinDrag"))}),[Ue,Je]);try{return(0,a.jsxs)(y.ContextMenu,{className:(0,T.default)("visual-node-editor",e.className,{dark:ae}),"data-id":ee.id,content:tn(),disabled:!Be.current,children:[(0,a.jsxs)("main",{className:"board-editor-inner",onMouseDown:wt,onMouseUp:Pt,onMouseMove:Ot,onMouseLeave:Et,ref:Qe,style:Yt,children:[(0,a.jsx)(u.Fragment,{children:(0,a.jsx)(j.LayoutDebugger,{vp:Fe,node:ee,extraDebug:m.emptyList,mousePos:tt.current})}),(0,a.jsx)(d.ConnectionView,{resolvedNodes:ce,currentInsId:X,ancestorsInsIds:Q,size:et,node:ee,boardPos:nt,instances:ge,connections:hn,futureConnection:ln(),onDblClick:l.noop,viewPort:Fe,parentVp:le,selectedInstances:pe,toggleHidden:yn,removeConnection:bn,lastMousePos:tt.current,draggedSource:Ue}),Bt(),ge.map((t=>{var n,o,i,s,r;return(0,a.jsx)(c.InstanceView,{onUngroup:St,onExtractInlineNode:Mt,onDetachConstValue:kt,onCopyConstValue:Tt,onPasteConstValue:At,copiedConstValue:Te,connectionsPerInput:Kt.current.get(t.id)||m.emptyObj,node:(0,B.safelyGetNodeDef)(t,ce),ancestorsInsIds:(0,l.fullInsIdPath)(X,Q),onPinClick:rt,onPinDblClick:Wt,onDragStart:pt,onDragEnd:mt,resolvedDeps:ce,onDragMove:ft,onDblClick:Dt,onSelect:It,onToggleSticky:Nt,selected:-1!==pe.indexOf(t.id),dragged:Ce===t.id,onInspectPin:Ze,selectedInput:me&&(0,l.isInternalConnectionNode)(me)&&me.insId===t.id?me.pinId:void 0,selectedOutput:fe&&(0,l.isInternalConnectionNode)(fe)&&fe.insId===t.id?fe.pinId:void 0,closestPin:Ke&&Ke.ins.id===t.id?Ke:void 0,queuedInputsData:null!==(n=oe[t.id])&&void 0!==n?n:m.emptyObj,instance:t,connections:ve,onTogglePinBreakpoint:l.noop,onTogglePinLog:l.noop,viewPort:Fe,onChangeVisibleInputs:cn,onChangeVisibleOutputs:pn,onSetDisplayName:fn,onDeleteInstance:Ct,forceShowMinimized:fe||(null===(o=null==Ue?void 0:Ue.to)||void 0===o?void 0:o.insId)===t.id?"input":me||(null===(i=null==Ue?void 0:Ue.from)||void 0===i?void 0:i.insId)===t.id?"output":void 0,isConnectedInstanceSelected:pe.some((e=>ve.some((n=>{let{from:o,to:i}=n;return o.insId===t.id&&i.insId===e||o.insId===e&&i.insId===t.id})))),inlineGroupProps:an(t),onCloseInlineEditor:In,inlineEditorPortalDomNode:He.current,onChangeStyle:dn,onGroupSelected:Ye,onPinMouseDown:Cn,onPinMouseUp:_n,hadError:null!==(r=null===(s=e.instancesWithErrors)||void 0===s?void 0:s.has((0,l.fullInsIdPath)(t.id)))&&void 0!==r&&r},t.id)})),qt(),Ut(),(0,a.jsx)(L.MainInstanceEventsIndicator,{currentInsId:X,ancestorsInsIds:Q,viewPort:Fe}),Me?(0,a.jsx)(_.QuickAddMenu,{targetNode:Me.targetNode,pinId:Me.pinId,pinType:Me.pinType,pos:Me.pos,resolvedDependencies:ne,node:ee,onAdd:Qt,onClose:Xt}):null,(0,a.jsxs)("div",{className:"viewport-controls-and-help",children:[(0,a.jsx)(y.Button,{small:!0,onClick:ot,minimal:!0,intent:"primary",children:"Center"}),(0,a.jsx)(q,{min:.15,max:3,stepSize:.05,labelStepSize:10,labelRenderer:W,onChange:ct,value:Fe.zoom}),je?(0,a.jsx)(F.HelpBubble,{}):null]}),Re?(0,a.jsx)(E.InlineCodeModal,{env:m.emptyObj,initialValue:Re.value,initialType:"existing"===Re.type?Re.templateType:void 0,onCancel:()=>Ve(void 0),onSubmit:vn}):null,(0,a.jsx)("div",{className:"inline-editor-portal-root"})]}),(0,a.jsx)(G.ActionsMenu,{showRunFlowOptions:je,onAction:Ft,selectedInstances:pe,node:ee,resolvedNodes:ce,to:me,from:fe,hotkeysEnabled:Be})]})}catch(jn){return console.error(jn),(0,a.jsxs)("div",{children:["Error rendering board - ",jn.toString()]})}})));const Z=(e,t)=>{const n=e.target.closest(".visual-node-editor");return n&&n.getAttribute("data-id")===t}},83234:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeView=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=r(n(59349)),d=n(30653);t.BaseNodeView=function(e){const{dragged:t,viewPort:n,pos:o,onDragEnd:i,onDragMove:s,onDragStart:r,displayMode:p}=e,f=(0,d.useDarkMode)(),m=u.useCallback(((e,t)=>{r(e,t)}),[r]),g=u.useCallback(((e,t)=>{const s=o,r=(t.x-s.x)/n.zoom,a=(t.y-s.y)/n.zoom,u=s.x+r,l=s.y+a;i(e,{...t,x:u,y:l})}),[o,i,n]),v=u.useCallback(((e,t)=>{s(e,{x:t.x,y:t.y})}),[s]),h={transform:`scale(${n.zoom})`},I=(0,l.default)("base-node-view",e.className,{dragged:t,dark:f,"display-mode":p}),y=o.x*n.zoom-n.pos.x*n.zoom,b=o.y*n.zoom-n.pos.y*n.zoom,C={transform:`translate(${y-o.x}px, ${b-o.y}px)`},_=(0,l.default)("base-node-view-vp-fixer",{"display-mode":p}),x=(0,a.jsx)("span",{className:"base-node-view-wrapper",children:(0,a.jsx)("div",{className:I,style:h,id:e.domId,children:e.children})});return(0,a.jsx)("div",{className:_,style:C,children:(0,a.jsx)(c.default,{onStop:g,onStart:m,onDrag:v,position:o,cancel:".no-drag",children:x})})}},80510:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleConnectionCloseEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleConnectionCloseEditorCommand=(e,t)=>{let{from:n,to:o}=t;return(0,s.default)(e,(e=>{const t=e.connections.find((e=>{const t=(0,i.connectionNodeEquals)(n,e.from),s=(0,i.connectionNodeEquals)(o,e.to);return t&&s}));t?e.connections=e.connections.filter((e=>e!==t)):e.connections.push({from:n,to:o})}))}},1788:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDetachConstEditorCommand=void 0;const i=n(74762),s=o(n(53865)),r=n(68371);t.handleDetachConstEditorCommand=(e,t,n)=>(0,s.default)(e,(e=>{const{instances:o}=e,s=o.find((e=>e.id===t));if(!s)throw new Error("Impossible state ins id with no matching instance");const a=s.inputConfig[n];if(!a)throw new Error("impossible state detaching const from unexistent config");if(!(0,i.isStaticInputPinConfig)(a))throw new Error("impossible state detaching const with no value");const u=JSON.stringify(a.value),l=(0,r.createInlineValueNode)({code:`${u}`,type:i.InlineValueNodeType.VALUE}),c=(0,i.inlineNodeInstance)(`value-${(0,i.randomInt)(999)}`,l,{},{x:s.pos.x,y:s.pos.y-100});if(!e.instances.find((e=>e.id===s.id)))throw new Error("impossible state instance not found");s.inputConfig[n]=(0,i.queueInputPinConfig)(),e.instances.push(c),e.connections.push((0,i.connectionData)(`${c.id}.value`,`${s.id}.${n}`))}))},2130:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDuplicateSelectedEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleDuplicateSelectedEditorCommand=(e,t)=>{const n=[];return{newNode:(0,s.default)(e,(o=>{const s=o.instances;t.forEach((t=>{const o=s.find((e=>e.id===t));if(!o)throw new Error("impossible state duplicate selected no matching instance");if(o){const{pos:t}=o,r={...o,pos:{x:t.x+20,y:t.y+20},id:(0,i.createInsId)(e)};s.push(r),n.push(r.id)}}))})),newInstances:n}}},25044:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.pasteInstancesCommand=void 0;const i=n(74762),s=o(n(53865));t.pasteInstancesCommand=(e,t,n)=>{const o=n.instances.map((n=>({...n,pos:t,id:(0,i.createInsId)(e)}))),r=new Map(o.map(((e,t)=>[n.instances[t].id,e.id])));return{newNode:(0,s.default)(e,(e=>{e.instances.push(...o);const t=n.connections.map((e=>{let{from:t,to:n}=e;return{from:{...t,insId:r.get(t.insId)||t.insId},to:{...n,insId:r.get(n.insId)||n.insId}}}));e.connections.push(...t)})),newInstances:o}}},65082:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionView=t.SingleConnectionView=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=r(n(26372)),d=n(74762),p=n(18243),f=n(77852),m=n(74089),g=n(60190),v=n(50382),h=n(76064),I=n(41032);t.SingleConnectionView=e=>{const{isBrowser:t}=(0,f.useSsr)(),{connection:n,node:o,resolvedNodes:i,instances:s,type:r,viewPort:a,toggleHidden:l,parentSelected:m,removeConnection:y}=e,{from:b}=n,C=(0,d.isInternalConnectionNode)(b)&&s.find((e=>e.id===b.insId));if(!C&&(0,d.isInternalConnectionNode)(b))throw new Error(`impossible state - "from instance id - [${b.insId}] does not exist"`);const _=((0,d.isInternalConnectionNode)(b)&&C?(0,I.safelyGetNodeDef)(C,i):o).outputs[b.pinId],x=_&&_.delayed,N=t?(0,p.calcStartPos)({...e,connectionNode:b}):{x:0,y:0},j=t?(0,p.calcTargetPos)({...e,connectionNode:n.to}):{x:0,y:0},{x:w,y:P}=(0,g.vDiv)(N,e.parentVp.zoom),{x:O,y:E}=(0,g.vDiv)(j,e.parentVp.zoom),D=(0,c.default)({delayed:x,hidden:n.hidden,"parent-selected":m},r),S=(0,u.jsxs)(v.Menu,{children:[(0,u.jsx)(v.MenuItem,{text:n.hidden?"Show connection":"Hide connection",onClick:()=>l(n)}),(0,u.jsx)(v.MenuItem,{text:"Remove connection",onClick:()=>y(n)})]});return(0,u.jsx)(v.ContextMenu,{content:S,children:e=>(0,u.jsx)(h.ConnectionViewPath,{className:D,from:{x:w,y:P},to:{x:O,y:E},dashed:"regular"!==r,zoom:a.zoom,onContextMenu:e.onContextMenu})})};t.ConnectionView=e=>{var n;const{viewPort:o,futureConnection:i,toggleHidden:s,selectedInstances:r,draggedSource:c}=e,[d,f]=l.useState(0),g=l.useCallback((e=>requestAnimationFrame((()=>{f((e=>(e+1)%9)),e>0&&g(e-1)}))),[]);l.useEffect((()=>{const e=g(10);return()=>{cancelAnimationFrame(e)}}),[g]),l.useEffect((()=>{const e=()=>{g(3)};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[g,d]);const v=e.connections.map((n=>{const o=r.includes(n.from.insId)||r.includes(n.to.insId);return(0,a.createElement)(t.SingleConnectionView,{...e,connection:n,type:"regular",parentSelected:o,key:n.from.insId+n.from.pinId+n.to.insId+n.to.pinId})}));if(i&&v.push((0,a.createElement)(t.SingleConnectionView,{...e,connection:i.connection,type:i.type,toggleHidden:s,parentSelected:!1,key:"future"})),c){const t=(c.from?p.calcStartPos:p.calcTargetPos)({connectionNode:null!==(n=c.from)&&void 0!==n?n:c.to,viewPort:o,boardPos:e.boardPos,ancestorsInsIds:e.ancestorsInsIds,currentInsId:e.currentInsId});v.push((0,u.jsx)(h.ConnectionViewPath,{className:"dragged",from:t,to:(0,m.logicalPosToRenderedPos)(e.lastMousePos,o),zoom:o.zoom},"dragged"))}return(0,u.jsx)("span",{className:"connections-view",style:{opacity:o.zoom},children:(0,u.jsx)("svg",{style:{width:"100%"},children:v})})}},76064:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionViewPath=void 0;const i=n(35250),s=o(n(26372)),r=n(70079),a=n(23381);t.ConnectionViewPath=(0,r.forwardRef)(((e,t)=>{const{from:n,to:o,className:r,onContextMenu:u,zoom:l,dashed:c}=e,{x:d,y:p}=n,{x:f,y:m}=o,g=(0,a.calcBezierPath)({sourceX:d,sourceY:p,targetX:f,targetY:m,curvature:.15}),v=2.5*l,h=c?6*l:void 0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:g,ref:t,className:(0,s.default)("connection",r),style:{strokeWidth:v,strokeDasharray:h},onContextMenu:u}),e.label?(0,i.jsx)("text",{className:"label",x:(d+f)/2,y:(p+m)/2,fontSize:"12px"}):null,(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%"}),(0,i.jsx)("stop",{offset:"100%"})]})]})}))},23381:(e,t)=>{"use strict";var n;function o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i(e){let t,i,{pos:s,x1:r,y1:a,x2:u,y2:l,c:c}=e;switch(s){case n.Left:t=r-o(r-u,c),i=a;break;case n.Right:t=r+o(u-r,c),i=a;break;case n.Top:t=r,i=a-o(a-l,c);break;case n.Bottom:t=r,i=a+o(l-a,c)}return[t,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.getBezierCenter=t.calcBezierPath=t.Position=void 0,function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(n=t.Position||(t.Position={}));t.calcBezierPath=e=>{let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l});return`M${t},${o} C${c},${d} ${p},${f} ${r},${a}`},t.getBezierCenter=function(e){let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l}),m=.125*t+.375*c+.375*p+.125*r,g=.125*o+.375*d+.375*f+.125*a;return[m,g,Math.abs(m-t),Math.abs(g-o)]}},18243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcTargetPos=t.calcStartPos=t.calcPinPosition=void 0;const o=n(74762),i=n(30994),s={x:99999,y:99999};function r(e){const t=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds),pinId:e.pinId,pinType:e.pinType,isMain:e.isMain});return((e,t,n,o)=>{if(!e)return console.warn(`Cannot find element ${n} to calculate position.`),s;const{x:i,y:r,width:a,height:u}=e.getBoundingClientRect(),l=r+u/2;return{x:i+a/2-t.x,y:l-t.y}})(document.getElementById(t),e.boardPos,t,e.viewPort)}t.calcPinPosition=r;t.calcStartPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"input",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"output",boardPos:n,viewPort:s})};t.calcTargetPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"output",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"input",boardPos:n,viewPort:s})}},30994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPinDomId=t.getMainInstanceIndicatorDomId=t.getInstanceDomId=void 0;const o=n(74762);t.getInstanceDomId=(e,t)=>`ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getMainInstanceIndicatorDomId=(e,t)=>`main-ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getPinDomId=e=>{let{pinType:t,fullInsIdPath:n,pinId:o,isMain:i}=e;return`${i?"main-":""}pin:${t}:${n}:${o}`.replace(/\s+/g,"-")}},86553:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceView=t.getVisibleOutputs=t.getVisibleInputs=t.INSTANCE_INFO_TOOLTIP_DELAY=t.MAX_INSTANCE_WIDTH=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=n(66074),d=n(74762),p=r(n(26372)),f=n(2036),m=n(74762),g=n(74762),v=n(53159),h=n(83234),I=n(74762),y=n(30994),b=n(63521),C=n(74089),_=n(50382),x=r(n(99581)),N=n(88593),j=n(30653);t.PIECE_HORIZONTAL_PADDING=25,t.PIECE_CHAR_WIDTH=11,t.MIN_WIDTH_PER_PIN=40,t.MAX_INSTANCE_WIDTH=400,t.INSTANCE_INFO_TOOLTIP_DELAY=400;t.getVisibleInputs=(e,t,n)=>{const{visibleInputs:o}=e;if(o)return o;const i=(0,d.keys)((0,g.getNodeInputs)(t)).filter(((o,i)=>{var s;const r=n.some((t=>t.to.insId===e.id&&t.to.pinId===o)),a=t.inputs[o]&&"optional"===(null===(s=t.inputs[o])||void 0===s?void 0:s.mode);return r||!a&&o!==m.TRIGGER_PIN_ID}));return 0===i.length?[m.TRIGGER_PIN_ID]:i};t.getVisibleOutputs=(e,t,n)=>{const{visibleOutputs:o}=e;if(o)return o;const i=Object.keys(t.outputs);return n.some((t=>t.from.insId===e.id&&t.from.pinId===m.ERROR_PIN_ID))?[...i,m.ERROR_PIN_ID]:i};t.InstanceView=function(e){const{selected:n,selectedInput:o,selectedOutput:i,closestPin:s,dragged:r,onTogglePinLog:w,onTogglePinBreakpoint:P,onDetachConstValue:O,onCopyConstValue:E,onPasteConstValue:D,displayMode:S,connections:M,instance:k,viewPort:T,node:A,onPinClick:R,onPinDblClick:V,onDragStart:z,onDragEnd:$,onDragMove:H,onToggleSticky:G,onSelect:L,onDblClick:F,onChangeVisibleInputs:B,onChangeVisibleOutputs:U,onConvertConstToEnv:q,inlineGroupProps:W,onUngroup:Z,onExtractInlineNode:J,onGroupSelected:Y,isConnectedInstanceSelected:K,inlineEditorPortalDomNode:X,onChangeStyle:Q,onDeleteInstance:ee,onSetDisplayName:te,onPinMouseUp:ne,onPinMouseDown:oe}=e,ie=(0,j.useDarkMode)(),{id:se}=k,re=l.useMemo((()=>{const e=(0,d.randomInt)(6,1);return{icon:(0,d.pickRandom)([["fab","discord"],["fab","slack"],"bug","cube"]),color:e,size:(0,d.randomInt)(3,1),variation:(0,d.randomInt)(5,1)}}),[]),ae=l.useRef(),ue=l.useMemo((()=>k.style||A.defaultStyle||{}),[A,k]),le=ue.size||"regular",ce=l.useMemo((()=>new Map(M.filter((e=>{let{to:t}=e;return t.insId===se})).map((e=>{let{to:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),de=l.useMemo((()=>new Map(M.filter((e=>{let{from:t}=e;return t.insId===se})).map((e=>{let{from:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),pe=(0,C.usePrompt)(),fe=l.useCallback((e=>R(k,e,"input")),[k,R]),me=l.useCallback(((e,t)=>V(k,e,"input",t)),[k,V]),ge=l.useCallback(((e,t)=>V(k,e,"output",t)),[k,V]),ve=l.useCallback((e=>R(k,e,"output")),[k,R]),he=l.useCallback(((e,t)=>{z(k,e,t)}),[k,z]),Ie=l.useCallback(((e,t)=>{const n=k.pos,o=(t.x-n.x)/T.zoom,i=(t.y-n.y)/T.zoom,s=n.x+o,r=n.y+i;$(k,e,{...t,x:s,y:r})}),[k,$,T.zoom]),ye=l.useCallback(((e,t)=>{H(k,e,{x:t.x,y:t.y})}),[k,H]),be=l.useCallback((e=>G(k,e)),[k,G]),Ce=l.useCallback((e=>O(k,e)),[k,O]),_e=l.useCallback((e=>E(k,e)),[k,E]),xe=l.useCallback((e=>D(k,e)),[k,D]),Ne=l.useCallback((e=>L(k,e)),[k,L]),je=l.useCallback((e=>F(k,e.shiftKey)),[k,F]),we=(0,d.entries)(A.inputs),{visibleInputs:Pe,visibleOutputs:Oe}=k;Pe&&we.sort(((e,t)=>Pe.indexOf(e[0])-Pe.indexOf(t[0])));const Ee=(0,d.entries)(A.outputs);Oe&&Ee.sort(((e,t)=>Oe.indexOf(e[0])-Oe.indexOf(t[0])));const De=(0,t.getVisibleInputs)(k,A,M),Se=(0,t.getVisibleOutputs)(k,A,M);we.push([m.TRIGGER_PIN_ID,{...(0,d.nodeInput)(),description:"Use this pin to manually trigger the node. If not connected, the node will be triggered automatically when all required inputs have data."}]),Ee.push([m.ERROR_PIN_ID,{...(0,m.nodeOutput)(),description:"Use this pin to catch errors that happen inside this node. If not connected, errors will bubble up to the parent node."}]);const Me=we.filter((e=>{let[t]=e;return De.includes(t)||(n||K)&&ce.has(t)})),ke=Ee.filter((t=>{let[o]=t;return Se.includes(o)||(n||K)&&de.has(o)||o===m.ERROR_PIN_ID&&e.hadError})),Te=M.some((e=>e.from.insId===se&&e.from.pinId===m.ERROR_PIN_ID)),Ae=(0,p.default)("ins-view",{"no-inputs":0===we.length,"no-outputs":0===Ee.length,"display-mode":S,"force-minimized-input":"input"===e.forceShowMinimized||"both"===e.forceShowMinimized,"force-minimized-output":"output"===e.forceShowMinimized||"both"===e.forceShowMinimized,"inline-node-edited":!!W,"error-caught":Te}),Re=(0,p.default)({selected:n,dragged:r,closest:s&&s.ins.id===k.id},`size-${le}`),Ve=new Set((0,d.entries)(A.inputs).filter((e=>{let[t,n]=e;return(0,m.isInputPinOptional)(n)})).map(d.pickFirst)),ze=(0,d.entries)(k.inputConfig).reduce(((e,t)=>{let[n,o]=t;return(0,m.isStickyInputPinConfig)(o)||o.sticky?{...e,[n]:!0}:e}),{}),$e=(0,v.calcNodeContent)(k,A),He=e=>{const t=k.inputConfig[e];if((0,I.isStaticInputPinConfig)(t))return t.value},Ge=l.useCallback((async()=>{const e=(0,d.okeys)(A.inputs),t=await pe("New order?",(k.visibleInputs||e).join(","));t&&B(k,t.split(","))}),[A.inputs,pe,k,B]),Le=l.useCallback((async()=>{const e=(0,d.okeys)(A.outputs),t=await pe("New order?",(k.visibleOutputs||e).join(","));t&&U(k,t.split(","))}),[A.outputs,pe,k,U]),Fe=l.useCallback((()=>{ee(k)}),[ee,k]),Be=l.useCallback((async()=>{const e=await pe("Set custom display name",k.displayName||A.id);te(k,e)}),[pe,k,te,A.id]),Ue=Object.keys((0,g.getNodeInputs)(A)),qe=Object.keys((0,d.getNodeOutputs)(A)),We=l.useCallback((e=>{q&&q(k,e)}),[k,q]),Ze=l.useCallback(((e,t)=>{ne&&ne(k,e,t)}),[k,ne]),Je=l.useCallback(((e,t)=>{oe&&oe(k,e,t)}),[k,oe]),Ye=()=>(0,u.jsx)("div",{className:"inputs no-drag",children:Me.map((t=>{let[i,r]=t;var a;return(0,u.jsx)(f.PinView,{type:"input",currentInsId:k.id,ancestorsInsIds:e.ancestorsInsIds,id:i,optional:Ve.has(i),connected:ce.has(i),isSticky:ze[i],minimized:!n&&1===Me.length,onToggleSticky:be,onDetachConstValue:Ce,onCopyConstValue:_e,onPasteConstValue:xe,copiedConstValue:e.copiedConstValue,selected:i===o,onClick:fe,onDoubleClick:me,isClosestToMouse:!!s&&"input"===s.type&&s.pin===i,onToggleLogged:w,onToggleBreakpoint:P,onInspect:e.onInspectPin,constValue:He(i),onConvertConstToEnv:e.onConvertConstToEnv?We:void 0,description:r.description,queuedValues:null!==(a=e.queuedInputsData[i])&&void 0!==a?a:0,onMouseUp:Ze,onMouseDown:Je},i)}))}),Ke=()=>(0,u.jsx)("div",{className:"outputs no-drag",children:ke.map((t=>{let[o,r]=t;return(0,u.jsx)(f.PinView,{currentInsId:k.id,ancestorsInsIds:e.ancestorsInsIds,connected:de.has(o),type:"output",id:o,minimized:!n&&1===ke.length,isClosestToMouse:!!s&&"output"===s.type&&s.pin===o,selected:o===i,onClick:ve,onDoubleClick:ge,onToggleLogged:w,onToggleBreakpoint:P,onInspect:e.onInspectPin,description:r.description,onMouseUp:Ze,onMouseDown:Je},o)}))}),Xe=l.useCallback((e=>{Q(k,e)}),[k,Q]),Qe=l.useCallback((()=>{const e=[...Ue.map((e=>{const t=De.includes(e),n=ce.has(e)&&!0!==ce.get(e),o=(0,d.getInputName)(e);return{text:t?n?`Hide input "${o}" (disconnect first)`:`Hide input "${o}"`:`Show input "${o}"`,onClick:()=>B(k,t?De.filter((t=>t!==e)):[...De,e]),disabled:n&&t}})),...qe.map((e=>{const t=Se.includes(e),n=de.has(e),o=(0,d.getOutputName)(e);return{text:t?n?`Hide output "${o}" (disconnect first)`:`Hide output "${o}"`:`Show output "${o}"`,onClick:()=>U(k,t?Se.filter((t=>t!==e)):[...Se,e]),disabled:n&&t}})),...(0,d.isInlineNodeInstance)(k)&&(0,g.isVisualNode)(k.node)?[{text:"Ungroup inline node",onClick:()=>Z(k)}]:[],...(0,d.isInlineNodeInstance)(k)?[{text:"Extract inline node to file",onClick:()=>J(k)}]:[],{text:"Reorder inputs",onClick:Ge},{text:"Reorder outputs",onClick:Le},{text:"Set display name",onClick:Be},{text:"Group selected instances",onClick:Y},{text:"Delete instance",intent:"danger",onClick:Fe}];return(0,u.jsxs)(_.Menu,{children:[(0,u.jsx)(_.MenuItem,{text:"Style",children:(0,u.jsx)(N.NodeStyleMenu,{style:ue,onChange:Xe,promptFn:pe})}),e.map(((e,t)=>(0,a.createElement)(_.MenuItem,{...e,key:t})))]})}),[Ue,qe,k,Ge,Le,Be,Fe,ue,Xe,pe,De,ce,B,Se,de,U,Z,J,Y]),et={"--node-color":ue.color,...ue.cssOverride||{}},tt=(0,y.getInstanceDomId)(k.id,e.ancestorsInsIds);return(0,u.jsx)("div",{className:Ae,children:(0,u.jsx)(h.BaseNodeView,{pos:k.pos,viewPort:T,onDragStart:he,onDragMove:ye,onDragEnd:Ie,upperRenderer:Ye,bottomRenderer:Ke,displayMode:S,domId:tt,children:(0,u.jsxs)(l.Fragment,{children:[Ye(),W?x.default.createPortal((0,u.jsxs)("div",{className:"inline-group-editor-container no-drag",children:[(0,u.jsxs)("header",{children:[$e," ",(0,u.jsx)("button",{onClick:e.onCloseInlineEditor,children:"close"})]}),(0,u.jsx)(b.VisualNodeEditor,{...e.inlineGroupProps,className:"no-drag",ref:ae})]}),X):(0,u.jsx)(_.ContextMenu,{className:(0,p.default)("ins-view-inner",Re,`size-${re.size}`,{dark:ie}),onClick:Ne,onDoubleClick:je,content:Qe(),style:et,children:(0,u.jsx)(_.Tooltip,{content:A.description,children:(0,u.jsxs)(l.Fragment,{children:[ue.icon?(0,u.jsx)(c.FontAwesomeIcon,{icon:ue.icon}):null," ",$e]})})}),Ke()]})})})}},53568:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStyleMenu=t.nodeStylePresetColors=void 0;const r=n(35250),a=n(50382),u=s(n(70079)),l=n(84472);t.nodeStylePresetColors=[{name:"Amethyst",color:"#9b5de5"},{name:"Magenta",color:"#f15bb5"},{name:"Yellow",color:"#fee440"},{name:"Capri",color:"#00bbf9"},{name:"Sea Green",color:"#00f5d4"},{name:"Orange",color:"#ff7f00"}];const c={size:"regular"};t.NodeStyleMenu=e=>{var n;const{onChange:o,style:i}=e,s=i||c,d=e.promptFn,p=u.default.useCallback(((e,t)=>{o({...s,[e]:t})}),[s,o]),f=u.default.useCallback((async()=>{const e=await d("Icon name? (Font Awesome conventions)","rocket"),t=e.includes(",")?e.split(","):e;p("icon",t)}),[d,p]),m=(0,u.useCallback)((async()=>{const e=await d("Enter a custom style (valid JSON representing a React CSS object)",s.cssOverride?JSON.stringify(s.cssOverride):"");try{const t=JSON.parse(e);p("cssOverride",t)}catch(t){console.error(t),(0,l.toastMsg)("Invalid object","danger")}}),[d,p,s.cssOverride]);return(0,r.jsxs)(u.default.Fragment,{children:[(0,r.jsxs)(a.MenuItem,{text:"Color",children:[t.nodeStylePresetColors.map((e=>(0,r.jsx)(a.MenuItem,{text:e.name,onClick:()=>p("color",e.color)},e.name))),(0,r.jsx)(a.MenuDivider,{}),(0,r.jsx)(a.MenuItem,{text:"Remove Color",onClick:()=>p("color",void 0)})]}),(0,r.jsxs)(a.MenuItem,{text:`Size (${null!==(n=s.size)&&void 0!==n?n:"regular"})`,children:[(0,r.jsx)(a.MenuItem,{text:"Small",onClick:()=>p("size","small")}),(0,r.jsx)(a.MenuItem,{text:"Regular",onClick:()=>p("size","regular")}),(0,r.jsx)(a.MenuItem,{text:"Large",onClick:()=>p("size","large")})]}),(0,r.jsxs)(a.MenuItem,{text:"Icon",children:[(0,r.jsx)(a.MenuItem,{text:"Choose Icon",onClick:f}),(0,r.jsx)(a.MenuItem,{text:"Remove Icon",onClick:()=>p("icon",void 0)})]}),(0,r.jsx)(a.MenuItem,{text:"Custom Styling",onClick:m})]})}},88593:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(53568),t)},83651:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86553),t)},53159:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calcInstancePosition=t.calcNodeWidth=t.calcNodeContent=void 0;const i=n(74762),s=o(n(6576)),r=n(86553),a=n(61888),u=n(30994);t.calcNodeContent=(e,t)=>{if(e.displayName)return e.displayName;if(t.customViewCode)try{const n=Object.entries(e.inputConfig).filter((e=>{let[,t]=e;return(0,i.isStaticInputPinConfig)(t)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o.value}}),{});return s.default.compile(t.customViewCode)({inputs:n}).trim()}catch(n){return console.error("Error with custom view",n),`Error in custom view [${t.id}]`}return t.id};t.calcNodeWidth=(e,n)=>{const o=(0,i.okeys)(n.inputs).length*r.MIN_WIDTH_PER_PIN,s=(0,t.calcNodeContent)(e,n),u=r.PIECE_CHAR_WIDTH;return(0,a.clamp)(s.length*u+2*r.PIECE_HORIZONTAL_PADDING,o,r.MAX_INSTANCE_WIDTH)};t.calcInstancePosition=(e,t,n)=>{const o=(0,u.getInstanceDomId)(e,t),i=document.getElementById(o);if(i){const{x:e,y:t,width:o,height:s}=i.getBoundingClientRect(),r=t+s/2;return{x:e+o/2-n.x,y:r-n.y}}return console.warn("Cannot find element to draw connection to",o),{x:99999,y:99999}}},17841:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutDebugger=t.LayoutDebuggerItem=t.PosDebugger=void 0;const i=n(70079),s=n(35250),r=n(74762),a=o(n(70079)),u=n(7047),l=e=>{let{pos:t}=e;return(0,s.jsxs)("span",{children:[t.x.toFixed(1),", ",t.y.toFixed(1)]})};t.PosDebugger=e=>(0,s.jsx)("span",{className:"pos-debugger",children:(0,s.jsx)(l,{pos:e.pos})});t.LayoutDebuggerItem=e=>{const{pos:n,viewPort:o,size:i,color:r}=e,a=o.zoom,u=n.x*a-o.pos.x*a,l=n.y*a-o.pos.y*a,c={transform:`translate(${u-n.x}px, ${l-n.y}px)`},d={transform:`scale(${o.zoom})`},p={transform:`translate(${n.x}px, ${n.y}px)`},f={width:`${i.width}px`,height:`${i.height}px`,backgroundColor:r};return(0,s.jsx)("div",{className:"layout-debugger",style:c,children:(0,s.jsxs)("span",{className:"drag-sim",style:p,children:[(0,s.jsx)(t.PosDebugger,{pos:n}),(0,s.jsx)("div",{className:"layout-debugger-zoom-wrapper",style:d,children:(0,s.jsx)("div",{className:"layout-debugger-inner",style:f})})]})})};const c=(()=>{try{return"true"===localStorage.getItem("pos-debugger")}catch(e){return!1}})();t.LayoutDebugger=e=>{const{extraDebug:n,vp:o,node:d,mousePos:p}=e;if(!c)return null;const f=n.map(((e,n)=>(0,i.createElement)(t.LayoutDebuggerItem,{...e,key:n}))),m=[...d.instances.map((e=>e.pos)),...(0,r.values)(d.inputsPosition),...(0,r.values)(d.outputsPosition)].map((e=>(0,s.jsx)(t.LayoutDebuggerItem,{pos:e,viewPort:o,size:{width:0,height:0},color:"red"}))),g=(0,u.logicalPosToRenderedPos)(p,o),v=(0,s.jsxs)("div",{className:"viewport-data",children:[(0,s.jsxs)("div",{children:["Pos: ",(0,s.jsx)(l,{pos:o.pos})]}),(0,s.jsxs)("div",{children:["Zoom: ",o.zoom.toFixed(2)," "]}),(0,s.jsxs)("div",{children:["Mouse (logical): ",(0,s.jsx)(l,{pos:p})]}),(0,s.jsxs)("div",{children:["Rendered (rendered): ",(0,s.jsx)(l,{pos:g})]})]});return(0,s.jsxs)(a.default.Fragment,{children:[v,f,m]})}},44338:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(17841),t)},38259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateInstancesWithSingleConstPinsMap=t.getLeafInstancesOfSelection=void 0;t.getLeafInstancesOfSelection=(e,t,n)=>e.reduce(((e,o)=>[...e,...n.filter((e=>e.to.insId===o.id)).map((e=>t.find((t=>t.id===e.from.insId)))).filter((e=>!!e))]),[]).filter((t=>1===n.filter((e=>e.from.insId===t.id||e.to.insId===t.id)).length&&!e.includes(t)));t.calculateInstancesWithSingleConstPinsMap=(e,t)=>{const{connections:n}=e;return n.filter((e=>t.has(e.from.insId))).reduce(((e,n)=>{const o=t.get(n.from.insId),i=n.to.insId,s=e.get(i)||new Map;return s.set(n.to.pinId,{val:o,insId:n.from.insId}),e.set(i,s),e}),new Map)}},37488:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeIoView=void 0;const a=n(35250),u=n(70079),l=s(n(70079)),c=n(74762),d=n(83234),p=r(n(26372)),f=n(50382),m=n(43490),g=n(66189),v=n(74762),h=n(30994),I=n(30653);t.NodeIoView=l.memo((function(e){const{viewPort:t,selected:n,pos:o,type:i,id:s,onDblClick:r,onRename:y,onDelete:b,onChangeInputMode:C,inputMode:_,onSelect:x,closest:N,onSetDescription:j,description:w,onMouseUp:P,onMouseDown:O,currentInsId:E}=e,{history:D,resetHistory:S,refreshHistory:M}=(0,g.useHistoryHelpers)(E,s,i),k=(0,m.usePrompt)(),T=l.useCallback((async()=>{const e=await k("Description?",w);j(i,s,e)}),[k,w,j,i,s]),A=l.useCallback((()=>{b&&b(i,s)}),[i,s,b]),R=l.useCallback((()=>{y&&y(i,s)}),[i,s,y]),V=l.useCallback((e=>{C&&C(s,e)}),[s,C]),z=l.useCallback((()=>[{text:`Current mode - ${_}`,onClick:c.noop},{text:"Make required",onClick:()=>V("required")},{text:"Make optional",onClick:()=>V("optional")},{text:"Make required-if-connected",onClick:()=>V("required-if-connected")},{text:"Set description",onClick:T},...e.onRename?[{text:"Rename",onClick:R}]:[],...e.onDelete?[{text:"Delete",onClick:A}]:[]]),[T,_,V,A,R,e.onDelete,e.onRename]),$=l.useCallback((t=>{r&&r(e.id,t)}),[r,e.id]),H=l.useCallback((()=>{x(s,i)}),[s,i,x]),G=l.useCallback((()=>(0,a.jsx)(f.Menu,{children:z().map(((e,t)=>(0,u.createElement)(f.MenuItem,{...e,key:t})))})),[z]),L="input"===i?(0,v.getInputName)(s):(0,c.getOutputName)(s),F=l.useCallback((e=>{P(s,i,e)}),[s,P,i]),B=l.useCallback((e=>{O(s,i,e)}),[s,O,i]),U=(0,I.useDarkMode)();return(0,a.jsx)(d.BaseNodeView,{className:(0,p.default)("node-io-view",i,{dark:U}),pos:o,onDragEnd:(n,o)=>{const r=e.pos,a=(o.x-r.x)/t.zoom,u=(o.y-r.y)/t.zoom,l=r.x+a,c=r.y+u;e.onDragEnd(i,s,n,{...o,x:l,y:c})},onDragStart:(t,n)=>{e.onDragStart(s,t,n)},onDragMove:(t,n)=>{e.onDragMove(i,s,t,{x:n.x,y:n.y})},viewPort:t,children:(0,a.jsx)(l.Fragment,{children:(0,a.jsx)(f.Tooltip,{content:(()=>{const t=(0,g.calcHistoryContent)(D),n=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:L})," (",i,")"," "]}),n,(0,a.jsx)("hr",{}),t]})})(),children:(0,a.jsx)(f.ContextMenu,{onMouseEnter:M,onMouseOut:S,onMouseUp:F,onMouseDown:B,"data-tip":"","data-html":!0,"data-for":s+e.currentInsId,className:(0,p.default)("node-io-view-inner",{closest:N,selected:n,dark:U}),id:(0,h.getPinDomId)({fullInsIdPath:(0,c.fullInsIdPath)(e.currentInsId,e.ancestorInsIds),pinId:s,pinType:i,isMain:!0}),onClick:H,onDoubleClick:$,content:G(),children:s})})})})}))},66005:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37488),t)},83782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcNodeIoWidth=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0,t.PIECE_HORIZONTAL_PADDING=15,t.PIECE_CHAR_WIDTH=9,t.MIN_WIDTH_PER_PIN=40;t.calcNodeIoWidth=e=>Math.max(t.MIN_WIDTH_PER_PIN,e.length*t.PIECE_CHAR_WIDTH+2*t.PIECE_HORIZONTAL_PADDING)},99942:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderVisualNode=t.layoutToInstances=void 0;const i=n(63521),s=n(74762),r=n(90794),a=o(n(53865)),u=n(83782),l=n(60190),c=n(53159),d=n(41032);t.layoutToInstances=(e,t)=>(0,a.default)(t,(t=>{(0,s.entries)(e.nodes).forEach((e=>{let[n,o]=e;if(n.startsWith("ins-")){const e=n.replace("ins-",""),i=t.instances.find((t=>t.id===e));i?i.pos=o.p:console.warn("WAT")}if(n.startsWith("node-input-")){const e=n.replace("node-input-","");t.inputsPosition[e]=o.p}if(n.startsWith("node-output-")){const e=n.replace("node-output-","");t.outputsPosition[e]=o.p}}))}));t.orderVisualNode=(e,n,o,a)=>{const{instances:p,connections:f}=e,m={...p.reduce(((e,t)=>{const o=(0,l.size)((0,c.calcNodeWidth)(t,(0,d.safelyGetNodeDef)(t,n)),i.NODE_HEIGHT);return{...e,[`ins-${t.id}`]:{p:t.pos,s:o}}}),{}),...(0,s.okeys)(e.inputsPosition).reduce(((t,n)=>({...t,[`node-input-${n}`]:{p:e.inputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{}),...(0,s.okeys)(e.outputsPosition).reduce(((t,n)=>({...t,[`node-output-${n}`]:{p:e.outputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{})},g=f.map((e=>[(0,s.isExternalConnectionNode)(e.from)?`node-input-${e.from.pinId}`:`ins-${e.from.insId}`,(0,s.isExternalConnectionNode)(e.to)?`node-output-${e.to.pinId}`:`ins-${e.to.insId}`])),v=(0,r.orderLayout)({nodes:m,edges:g},o,((n,o)=>{a&&a((0,t.layoutToInstances)(n,e),o)}));return(0,t.layoutToInstances)(v,e)}},90794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderLayout=void 0;const o=n(60190),i=400,s=e=>e.reduce(((e,t)=>{const n=(0,o.vSub)(t.p,(0,o.vec)(t.s.width/2,t.s.height/2));return{...e,[t.id]:{p:n,s:t.s}}}),{});t.orderLayout=(e,t,n)=>{let{nodes:r,edges:a}=e,u=Object.entries(r).map((e=>{let[t,n]=e;return{id:t,p:(0,o.vAdd)(n.p,(0,o.vec)(n.s.width/2,n.s.height/2)),f:(0,o.vec)(0,0),v:(0,o.vec)(0,0),m:1,s:n.s}})),l=0;for(;l.01);){let e=u;for(let t=0;t{let n=e.find((e=>e.id===t[0])),i=e.find((e=>e.id===t[1]));if(!n||!i)return void console.warn("weoops",t[0],t[1]);const s=(0,o.vec)(0,-200),r=(0,o.vSub)(n.p,i.p),a=(0,o.vSub)(s,r),u=1e3*(0,o.vLen)(a),l=(0,o.vMul)((0,o.vNorm)(a),.5*u),c=(0,o.vMul)((0,o.vNorm)(a),-.5*u);n.f=(0,o.vAdd)(n.f,l),i.f=(0,o.vAdd)(i.f,c)})),e=e.map((e=>(0,o.itrPhysics)(15,e))),e=e.map((e=>{const t=(0,o.vMul)(e.v,.5),n=(0,o.vLen)(t)>100?(0,o.vMul)((0,o.vNorm)(t),100):t;return{...e,v:n}})),u=e,n&&n({nodes:s(e),edges:a},l),l++}return{nodes:s(u),edges:a,itrs:l,timeout:l>=t,total:(0,o.totalEnergy)(u)}}},2036:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PinView=t.PIN_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=n(50382),d=n(18420),p=n(74762),f=n(30994),m=n(96233),g=n(66189),v=n(30653);t.PIN_HEIGHT=23;t.PinView=u.memo((function(e){const{selected:t,type:n,connected:o,optional:i,currentInsId:s,isClosestToMouse:r,id:h,onMouseDown:I,onMouseUp:y}=e,{history:b,resetHistory:C,refreshHistory:_}=(0,g.useHistoryHelpers)(s,h,n),x=(0,v.useDarkMode)(),N="input"===n?(0,p.getInputName)(h):(0,p.getOutputName)(h),j="input"===e.type&&(0,d.isDefined)(e.constValue)?e.constValue:void 0,w=u.useCallback((e=>{0===e.button&&I(h,n,e)}),[h,n,I]),P=u.useCallback((e=>{0===e.button&&y(h,n,e)}),[h,n,y]);return(0,a.jsxs)("div",{className:(()=>{if("input"===e.type){const{isSticky:s,constValue:a}=e;return(0,l.default)("pin",{sticky:s,selected:t,closest:r,optional:i,connected:o,"const-value":(0,d.isDefined)(a),"env-value":(0,d.isDefined)(a)&&(0,p.isEnvValue)(a),minimized:e.minimized,dark:x},n)}return(0,l.default)("pin",{selected:t,connected:o,closest:r,optional:i,minimized:e.minimized,"error-pin":h===p.ERROR_PIN_ID,dark:x},n)})(),"data-pin-id":h,children:[(0,a.jsx)(c.Tooltip,{className:"pin-info-tooltip",content:(()=>{const t=(0,g.calcHistoryContent)(b,"input"===n?e.queuedValues:void 0),o=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:N})," (",n,")"," "]}),o,(0,a.jsx)("hr",{}),(0,d.isDefined)(j)?(0,a.jsxs)("div",{children:["Static value:"," ",(0,a.jsx)("strong",{children:(0,m.valuePreview)(j).substring(0,200)})]}):t]})})(),children:(0,a.jsxs)(c.ContextMenu,{onMouseEnter:_,onMouseOut:C,onMouseDown:w,onMouseUp:P,"data-tip":"","data-html":!0,"data-for":h+e.currentInsId,id:(0,f.getPinDomId)({fullInsIdPath:(0,p.fullInsIdPath)(e.currentInsId,e.ancestorsInsIds),pinId:h,pinType:n,isMain:!1}),onDoubleClick:t=>e.onDoubleClick&&e.onDoubleClick(h,t),className:(0,l.default)("pin-inner",{dark:x}),onClick:t=>{const{onShiftClick:o,onClick:i,id:s}=e;t.shiftKey&&o?o(s,t):i(s,n,t)},content:(()=>{const t=(0,a.jsx)(c.MenuItem,{onClick:()=>e.onInspect(e.currentInsId,{id:e.id,type:e.type}),text:"Inspect"});if("input"===e.type){const{onConvertConstToEnv:n}=e;return(0,d.isDefined)(j)?(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onDetachConstValue(e.id),text:"Detach value"}),(0,a.jsx)(c.MenuItem,{onClick:()=>e.onCopyConstValue(e.id),text:"Copy value"}),(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null,n?(0,a.jsx)(c.MenuItem,{onClick:()=>n(e.id),text:"Convert to Env Var"}):null]}):(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onToggleSticky(e.id),text:"Toggle sticky (square means sticky)"}),t,(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null]})}return(0,a.jsx)(c.Menu,{children:t})})(),children:[N," ",(0,d.isDefined)(j)?(0,a.jsxs)(u.Fragment,{children:[":",(0,a.jsx)("span",{className:"value",children:(0,d.toString)(j)})]}):null,"input"===e.type&&e.isSticky?(0,a.jsx)("span",{className:"suffix",children:"s"}):null,"input"===e.type&&e.queueSize?(0,a.jsxs)("span",{className:"suffix",children:[e.queueSize," in Q"]}):null]})}),(0,a.jsx)("div",{className:"wire"})]})}))},66189:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHistoryHelpers=t.calcHistoryContent=void 0;const i=n(35250),s=n(96233),r=o(n(70079)),a=n(70079),u=n(98158);t.calcHistoryContent=(e,t)=>{if(e){const{total:n,lastSamples:o}=e,a=(0,i.jsxs)("strong",{children:["Activated ",n," times this session"]}),u=o.length>0?(0,i.jsxs)("div",{children:["Last value:"," ",(0,i.jsx)("strong",{children:(0,s.valuePreview)(o[0].val).substring(0,200)}),(0,i.jsx)("br",{}),(0,i.jsx)("em",{children:"Inspect instance for the full value"})]}):"",l=t?(0,i.jsx)(r.default.Fragment,{children:(0,i.jsxs)("div",{children:["Queued values: ",(0,i.jsx)("strong",{children:t})]})}):"";return(0,i.jsxs)(r.default.Fragment,{children:[a,u,l]})}return"Loading session data.."};t.useHistoryHelpers=(e,t,n)=>{const o=(0,a.useRef)(),{onRequestHistory:i}=(0,u.useDebuggerContext)(),[s,l]=(0,a.useState)();return{history:s,refreshHistory:(0,a.useCallback)((()=>{clearInterval(o.current),i(e,t,n).then((e=>{l(e)})),o.current=setInterval((()=>{i(e,t,n).then((e=>{l(e)}))}),500)}),[e,i,t,n]),resetHistory:r.default.useCallback((()=>{clearInterval(o.current),l(void 0)}),[])}}},89440:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAddMenu=void 0;const r=n(35250),a=s(n(70079)),u=n(74762),l=n(50382),c=n(70457),d=n(9958),p=n(86125),f=c.Select.ofType(),m=e=>{switch(e.type){case"node":return`${e.node.id}`;case"value":return"Add inline value or function";case"import":return`Import ${e.importableNode.node.id} from ${e.importableNode.module}`}},g=(e,t)=>{let{handleClick:n,modifiers:o,query:i}=t;if(!o.matchesPredicate)return null;const s=m(e);return"value"===e.type?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(l.MenuDivider,{}),(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))]}):(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))},v=(e,t,n,o)=>{const i=m(t).toLocaleLowerCase(),s=e.toLowerCase();return o?i===s:i.includes(s)};t.QuickAddMenu=e=>{const{resolvedDependencies:t,targetNode:n}=e,o={left:e.pos.x,top:e.pos.y},{onRequestImportables:i}=(0,p.useDependenciesContext)(),[s,c]=a.useState();a.useEffect((()=>{i().then((e=>c(e.importables)))}),[i]);const d=(0,u.values)({...t,[n.id]:n}),m=d.map((e=>({type:"node",node:e}))),h=new Set(d.map((e=>e.id))),I=s?s.filter((e=>!h.has(e.node.id))).map((e=>({type:"import",importableNode:e}))):[],y=m.concat(I).concat({type:"value"});return(0,r.jsx)("div",{className:"quick-add-menu",style:o,children:(0,r.jsx)(f,{className:"quick-add-nodes-select",items:y,itemPredicate:v,itemRenderer:g,inputProps:{className:"quick-add-input"},noResults:(0,r.jsx)(l.MenuItem,{disabled:!0,text:"No results."}),onItemSelect:t=>e.onAdd(t),popoverProps:{isOpen:!0,onClose:()=>e.onClose()}})})}},71033:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89440),t)},73470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimePlayer=void 0;const o=n(74762),i=n(64955),s=(0,o.debugLogger)("runtime-player");t.createRuntimePlayer=()=>{let e=0,t=[];let n=!1,r=Date.now(),a=e;const u=()=>requestAnimationFrame((()=>{const l=Date.now();a=e,e+=l-r,r=l,((e,n)=>{const r=t;t=[],r.length&&s(`Playing ${r.length} events from`,e,n),r.forEach((e=>{s("Playing event",e),(0,i.playEvent)(e),e.insId===o.ROOT_INS_ID&&e.type===o.DebuggerEventType.PROCESSING_CHANGE&&!1===e.val&&(s("Main instance is done processing, clearing runtime UI",e),c())}))})(a,e),n&&u()})),l=()=>{n=!1},c=()=>{document.querySelectorAll("[data-runtime]").forEach((e=>{e.removeAttribute("data-runtime")})),document.querySelectorAll("[data-runtime-queue]").forEach((e=>{e.removeAttribute("data-runtime-queue")})),t=[]};return{stop:l,start:function(t){void 0===t&&(t=0),n=!0,e=t,r=Date.now(),u()},addEvents:e=>{t.push(...e)},destroy:()=>{l(),c()},clear:c,status:()=>({running:n,currDt:e,lastDt:a,queue:t,last:r})}}},64955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playEvent=t.cancelTimers=void 0;const o=n(74762),i=n(30994),s=5e3,r=(0,o.debugLogger)("runtime-player:play-event"),a=(e,t)=>e.type===o.DebuggerEventType.INPUT_CHANGE||e.type===o.DebuggerEventType.OUTPUT_CHANGE?`${(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds)}.${e.pinId}`:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds);t.cancelTimers=new Map;t.playEvent=e=>{switch(e.type){case o.DebuggerEventType.INPUT_CHANGE:case o.DebuggerEventType.OUTPUT_CHANGE:{const{pinId:n,insId:u,ancestorsInsIds:l}=e,c=e.type===o.DebuggerEventType.INPUT_CHANGE?"input":"output",d=[(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!0})];u!==o.ROOT_INS_ID&&d.push((0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!1})),d.forEach(((i,l)=>{const c=a(e);clearTimeout(t.cancelTimers.get(c));const d=document.getElementById(i),p=`${u}.${n}`,f=e.type===o.DebuggerEventType.OUTPUT_CHANGE?document.querySelectorAll(`[data-from-id="${p}"]`):[];if(d){clearTimeout(t.cancelTimers.get(c)),d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),setTimeout((()=>{d.setAttribute("data-runtime","active"),f.forEach((e=>{e.setAttribute("data-runtime","active")}))}),0);const n=setTimeout((()=>{d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),t.cancelTimers.delete(c)}),s);t.cancelTimers.set(a(e),n)}else console.warn(`No DOM element with Id [${i}] found to play event`),r(`No DOM element with Id [${i}] found to play event`,e)}));break}case o.DebuggerEventType.PROCESSING_CHANGE:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(l)if(!0===e.val)l.setAttribute("data-runtime","processing"),clearTimeout(t.cancelTimers.get(u));else{l.removeAttribute("data-runtime"),setTimeout((()=>{"error"!==l.getAttribute("data-runtime")&&l.setAttribute("data-runtime","done")}),0);const e=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,e)}else r(`No DOM element with Id [${n}] found to play event`,e)}));break}case o.DebuggerEventType.ERROR:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(!l)return void r(`No DOM element with Id [${n}] found to play event`,e);clearTimeout(t.cancelTimers.get(u)),l.removeAttribute("data-runtime"),setTimeout((()=>{l.setAttribute("data-runtime","error")}));const c=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,c)}));const c={...e,type:o.DebuggerEventType.OUTPUT_CHANGE,pinId:o.ERROR_PIN_ID};(0,t.playEvent)(c);break}case o.DebuggerEventType.INPUTS_STATE_CHANGE:(0,o.entries)(e.val).forEach((t=>{let[n,s]=t;const{insId:a,ancestorsInsIds:u}=e,l=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(a,u),pinId:n,pinType:"input",isMain:!1}),c=document.getElementById(l);c?s>0?c.setAttribute("data-runtime-queue",`${s}`):c.removeAttribute("data-runtime-queue"):r(`No DOM element with Id [${l}] found to play event`,e)}))}}},25804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounce=void 0;const o=n(70079);t.useDebounce=function(e,t){const[n,i]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}},7047:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.handleChangeNodeInputType=t.handleIoPinRename=t.handleInstanceDrag=t.getInstancesInRect=t.isJsxValue=t.getMiddleOfViewPort=t.fitViewPortToNode=t.centerBoardPosOnTarget=t.renderedPosToLogicalPos=t.logicalPosToRenderedPos=t.getEffectiveNodeDimensions=t.calcNodesPositions=t.calcSelectionBoxArea=t.animateViewPort=t.easeInOutNum=t.easeInOutPos=t.easeInOutQuad=t.center=t.distance=t.clamp=t.domToViewPort=t.roundNumber=t.createNewNodeInstance=t.createNewInlineNodeInstance=t.parseInputOutputTypes=t.parsePromptValue=t.getSelectionBoxRect=t.findClosestPin=t.changePinConfig=t.getInstancePinConfig=t.emptyList=t.emptyObj=void 0;const r=s(n(53865)),a=n(30721),u=n(63521),l=n(74762),c=n(18243),d=n(74762),p=n(53159),f=n(83782),m=n(60190),g=n(38259),v=n(83651),h=n(41032);t.emptyObj={},t.emptyList=[],t.getInstancePinConfig=function(e,n,o){var i;const s=e.instances.find((e=>e.id===n));if(!s)throw new Error(`Instance ${n} not found`);return null!==(i=(s.inputConfig||t.emptyObj)[o])&&void 0!==i?i:(0,l.queueInputPinConfig)()};t.changePinConfig=(e,t,n,o)=>r.produce(e,(e=>{var i;const{instances:s}=e,r=s.find((e=>e.id===t));if(!r)throw new Error("blah");const a=null!==(i=r.inputConfig)&&void 0!==i?i:{};a[n]=o,e.instances=s.map((e=>e===r?{...r,inputConfig:a}:e))}));t.findClosestPin=(e,t,n,o,i,s,r)=>{const a=(0,l.nodeInstance)(e.id,e.id),u=(0,d.okeys)(e.inputs).map((e=>({id:e,type:"input",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),p=(0,d.okeys)(e.outputs).map((e=>({id:e,type:"output",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),f=[...u,...e.instances.reduce(((n,a)=>{const u=(0,h.safelyGetNodeDef)(a,t),d=(0,v.getVisibleInputs)(a,u,e.connections),p=(0,v.getVisibleOutputs)(a,u,e.connections);return[...n,...d.map((e=>({ins:a,type:"input",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!1}),id:e}))),...p.map((e=>({ins:a,type:"output",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!1}),id:e})))]}),[]),...p];let m={dis:1e5,item:f[0]};return f.forEach((e=>{const t=e.pos.x-n.x,o=e.pos.y-n.y,i=Math.sqrt(t*t+o*o);i{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x,t.x)-n,h:Math.max(e.y,t.y)-o}};t.parsePromptValue=e=>{if(null===e)return;const t=parseInt(e,10);let n=e;return t.toString()!=e||isNaN(t)||(n=t),n};t.parseInputOutputTypes=e=>{const[,t,n]=e.match(/node\((.+)\|(.+)\)/)||[],o=(0,d.entries)(JSON.parse(t)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]})),i=(0,d.entries)(JSON.parse(n)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]}));return{inputs:(0,d.fromEntries)(o),outputs:(0,d.fromEntries)(i)}};t.createNewInlineNodeInstance=function(e,t,n){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const o=(0,l.inlineNodeInstance)(`${e.id}-${(0,d.randomInt)(999)}`,e,{},{x:0,y:0}),i=(0,p.calcNodeWidth)(o,e),{x:s,y:r}=n,a={x:s-i/2,y:r+t};return{...o,pos:a}};t.createNewNodeInstance=function(e,t,n,o){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const i="string"==typeof e?(0,h.safelyGetNodeDef)(e,o):e;if(!i)throw new Error(`${e} node not found in resolvedNodes`);const s=(0,d.entries)(i.inputs).reduce(((e,t)=>{let[n,o]=t;return o.defaultValue&&(e[n]=(0,l.staticInputPinConfig)(o.defaultValue)),e}),{}),r=(0,l.nodeInstance)((0,a.createId)(),i.id,s,{x:0,y:0}),c=(0,p.calcNodeWidth)(r,i),{x:f,y:m}=n,g={x:f-c/2,y:m+t};return{...r,pos:g}};t.roundNumber=e=>Math.round(100*e)/100;t.domToViewPort=(e,n,o)=>({x:(0,t.roundNumber)(n.pos.x+e.x/n.zoom/o.zoom),y:(0,t.roundNumber)(n.pos.y+e.y/n.zoom/o.zoom)});t.clamp=(e,t,n)=>Math.max(e,Math.min(t,n));t.distance=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)};t.center=(e,t,n)=>{let{zoom:o}=n;const i=e.x+e.w/2,s=e.y+e.h/2,{w:r,h:a}=t;return{x:i-r/o/2,y:s-a/o/2}};t.easeInOutQuad=e=>e<.5?2*e*e:(4-2*e)*e-1;t.easeInOutPos=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i),a=(0,t.easeInOutQuad)(r),u=n.x-e.x,l=n.y-e.y;return{x:e.x+u*a,y:e.y+l*a}};t.easeInOutNum=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i);return e+(n-e)*(0,t.easeInOutQuad)(r)};t.animateViewPort=(e,n,o,i)=>{const s=(0,t.distance)(e.pos,n.pos),r=Date.now(),a=o;if(0===s)return void i(e);const u=()=>{const o=Date.now(),s=(0,t.easeInOutPos)(e.pos,n.pos,r,a,o),l=(0,t.easeInOutNum)(e.zoom,n.zoom,r,a,o);o-r{const n=(0,t.getSelectionBoxRect)(e.from,e.to);return n.h*n.w};const I=(e,t,n,o)=>({left:n.x,right:n.x+e,top:n.y,bottom:n.y+t,tag:o,center:(0,l.calcCenter)({w:e,h:t,...n})});t.calcNodesPositions=(e,t)=>[...e.instances.map((e=>{const n=(0,p.calcNodeWidth)(e,(0,h.safelyGetNodeDef)(e,t)),o=u.NODE_HEIGHT;return I(n,o,e.pos,e.id)})),...(0,d.okeys)(e.inputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.inputsPosition[t]||{x:0,y:0};return I(n,o,i,"input_"+t)})),...(0,d.okeys)(e.outputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.outputsPosition[t]||{x:0,y:0};return I(n,o,i,"output"+t)}))];t.getEffectiveNodeDimensions=(e,n)=>{const o=(0,t.calcNodesPositions)(e,n),i=o[0]||{left:0,right:0,top:0,bottom:0},s=o.reduce(((e,t)=>t.leftt.right>e?t.right:e),i.right),a=o.reduce(((e,t)=>t.topt.bottom>e?t.bottom:e),i.bottom)-a,d={x:s,y:a};return{size:{width:u,height:c},pos:d,center:(0,l.calcCenter)({w:u,h:c,...d})}};t.logicalPosToRenderedPos=(e,t)=>{const n=(0,m.vSub)(e,t.pos);return(0,m.vMul)(n,t.zoom)};t.renderedPosToLogicalPos=(e,t)=>{const n=(0,m.vDiv)(e,t.zoom);return(0,m.vAdd)(t.pos,n)};t.centerBoardPosOnTarget=(e,n,o,i)=>{const s=(0,t.logicalPosToRenderedPos)(e,i),r=(0,t.renderedPosToLogicalPos)(s,{...i,zoom:o}),a=Math.max(e.x,r.x)-Math.min(e.x,r.x),u=Math.max(e.y,r.y)-Math.min(e.y,r.y);return{x:o>i.zoom?i.pos.x+a:i.pos.x-a,y:o>i.zoom?i.pos.y+u:i.pos.y-u}};t.fitViewPortToNode=function(e,n,o,i){void 0===i&&(i=[20,150]);const{size:s,center:r}=(0,t.getEffectiveNodeDimensions)(e,n),a=i[0],u=i[1],l=s.width+a,c=s.height+u,d=o.width/l,p=o.height/c,f=Math.min(d,p)/1.15,m=(0,t.clamp)(.3,1.2,f);return{zoom:m,pos:{x:r.x-o.width/2/m,y:r.y-o.height/2/m+20}}};t.getMiddleOfViewPort=(e,n)=>{const o={x:n.width/2,y:n.height/2};return(0,t.renderedPosToLogicalPos)(o,e)};t.isJsxValue=e=>{const t=e=>(0,d.isDefined)(e.ref)&&(0,d.isDefined)(e.type)&&(0,d.isDefined)(e.props);try{const n=JSON.parse(e);return t(n)||Array.isArray(n)&&t(n[0])}catch(n){return!1}};t.getInstancesInRect=(e,n,o,i,s,r,a)=>{const{from:c,to:d}=e,f=(0,t.getSelectionBoxRect)(c,d);return s.filter((e=>{const{pos:t}=e,i={...t,w:(0,p.calcNodeWidth)(e,(0,h.safelyGetNodeDef)(e,n))*o.zoom*a.zoom,h:u.NODE_HEIGHT*o.zoom*a.zoom};return(0,l.intersectRect)(f,i)||(0,l.intersectRect)(i,f)})).map((e=>e.id))};t.handleInstanceDrag=(e,t,n,o,i,s)=>{o.preventDefault(),o.stopPropagation();const a=(0,m.vSub)(n,t.pos);let u;const l=r.produce(e,(e=>{const r=e.instances.find((e=>e.id===t.id));if(!r)throw new Error("impossible state dragging instance that does not exist");!o.shiftKey&&s&&(u=[s]);const l=e.instances.filter((e=>i.includes(e.id)&&e!==r)),c=[r,...l],d=(0,g.getLeafInstancesOfSelection)(c,e.instances,e.connections);[...l,...d].forEach((e=>{e.pos=(0,m.vAdd)(e.pos,a)})),r.pos=n,!o.shiftKey&&s&&(u=[s])}));return{newValue:l,newSelected:u}};t.handleIoPinRename=(e,t,n,o)=>r.produce(e,(e=>{"input"===t?(e.inputs[o]=e.inputs[n],e.inputsPosition[o]=e.inputsPosition[n],delete e.inputs[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===n?{...e,from:{...e.from,pinId:o}}:e))):(e.outputs[o]=e.outputs[n],e.outputsPosition[o]=e.outputsPosition[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===n?{...e,to:{...e.to,pinId:o}}:e)),e.completionOutputs=(e.completionOutputs||[]).map((e=>e.split("+").map((e=>e===n?o:n)).join("+"))),delete e.outputs[n])}));t.handleChangeNodeInputType=(e,t,n)=>r.produce(e,(e=>{const o=e.inputs[t];if(!o)throw new Error("Wat");o.mode=n}))},42403:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorClient=void 0;const i=n(74762),s=o(n(18706)),r=n(32048),a=n(31758),u=(0,i.debugLogger)("remote-debugger:editor-client");t.createEditorClient=(e,t)=>{const n=new URL(e),o=(0,r.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/editor`,timeout:3e4});return o.emit("join-room-editor",t),{emitChange:e=>{o.emit(a.DebuggerServerEventType.CHANGE_EVENT_NAME,e)},emitBreakpointsChange:e=>{o.emit(a.DebuggerServerEventType.UPDATE_BREAKPOINTS,e)},interceptInput:e=>{o.emit(a.DebuggerServerEventType.INPUT_VALUE_OVERRIDE,e)},interceptOutput:e=>{o.emit(a.DebuggerServerEventType.OUTPUT_VALUE_OVERRIDE,e)},onRuntimeReady:e=>(o.on(a.DebuggerServerEventType.RUNTIME_READY,e),()=>o.off(a.DebuggerServerEventType.RUNTIME_READY,e)),onChangeAwk:e=>(o.on(a.DebuggerServerEventType.CHANGE_AWK,e),()=>o.off(a.DebuggerServerEventType.CHANGE_AWK,e)),onChangeError:e=>(o.on(a.DebuggerServerEventType.CHANGE_ERROR,e),()=>o.off(a.DebuggerServerEventType.CHANGE_ERROR,e)),onIsAlive:e=>(o.on(a.DebuggerServerEventType.IS_ALIVE,e),()=>o.off(a.DebuggerServerEventType.IS_ALIVE,e)),emitInputValue:(e,t)=>{u(`Emitting push input value to ${e} %o`,t),o.emit(a.DebuggerServerEventType.PUSH_INPUT_VALUE,{pinId:e,value:t})},destroy:()=>{o.disconnect(),(0,a.enumToArray)(a.DebuggerServerEventType).forEach((e=>o.off(e)))},onDisconnect:e=>(o.on("disconnect",e),()=>o.off("disconnect",e)),debugInfo:()=>`Remote debugger for ${e}`,onBatchedEvents:e=>(o.on(a.DebuggerServerEventType.EVENTS_BATCH,e),()=>o.off(a.DebuggerServerEventType.EVENTS_BATCH,e)),requestState:()=>s.default.get(`${e}/state`).then((e=>e.data.state)),getHistory:n=>s.default.get(`${e}/history`,{params:{insId:n.insId,pinId:n.pinId,limit:n.limit,executionId:t}}).then((e=>e.data)),clearHistory:()=>s.default.delete(`${e}/history`).then((()=>{})),triggerNode:(t,n)=>s.default.post(`${e}/trigger`,{nodeId:t,inputs:n}).then((e=>e.data))}}},58066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeData=void 0;const o=n(74762),i=n(36783),s=(0,o.debugLogger)("remote-debugger:normalize-data");t.normalizeData=e=>{if(e instanceof Error)return(0,i.serializeError)(e);if("object"==typeof e&&null!==e){e={...e};const t=new WeakSet,n=e=>{if("bigint"==typeof e)return e.toString();if("object"!=typeof e||Array.isArray(e))return e;if(null===e)return e;if(t.has(e))return"[Circular]";try{t.add(e)}catch(o){s("Error adding to WeakSet","data:",e,"type:",typeof e,"error:",o)}if(Array.isArray(e))return e.map(n);if("object"==typeof e){const t={};for(const o in e)t[o]=n(e[o]);return t}return e};return n(e)}return e}},39641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimeClient=t.DEFAULT_DT_SCALE=void 0;const o=n(74762),i=n(32048),s=n(31758),r=n(58066),a=(0,o.debugLogger)("remote-debugger:runtime-client");t.DEFAULT_DT_SCALE=1;t.createRuntimeClient=(e,t)=>{const n=new URL(e),u=(0,i.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/runtime`,timeout:1e3,reconnectionAttempts:3});u.emit("join-room-runtime",t),u.on("connection",(e=>{e.join(t)}));let l=new Set;u.on(s.DebuggerServerEventType.UPDATE_BREAKPOINTS,(e=>{l=new Set(e)}));const c=(0,o.cappedArrayDebounce)((e=>{a(`Emitting debounced batched events - ${e.length}`),u.emit(s.DebuggerServerEventType.EVENTS_BATCH,e)}),100,200);return{onChange:e=>(u.on(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e),()=>u.off(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e)),onInput:e=>(u.on(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e),()=>u.off(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e)),emitEvent:e=>{a(`Emitting event ${e.type} change event of ${e.insId}`),e.val=(0,r.normalizeData)(e.val),c.addItem({...e,time:Date.now()})},emitRuntimeReady:()=>{u.emit(s.DebuggerServerEventType.RUNTIME_READY,{})},emitChangeAwk:()=>{u.emit(s.DebuggerServerEventType.CHANGE_AWK,{})},emitChangeError:e=>{u.emit(s.DebuggerServerEventType.CHANGE_ERROR,{error:e})},emitIsAlive:e=>{u.emit(s.DebuggerServerEventType.IS_ALIVE,{time:e})},destroy:async()=>{c.pendingItems()&&(c.flush(),await(0,o.delay)(100)),(0,s.enumToArray)(s.DebuggerServerEventType).forEach((e=>u.off(e))),u.disconnect()},onDisconnect:e=>(u.on("disconnect",e),()=>u.off("disconnect",e)),waitForConnection:()=>new Promise(((e,t)=>{u.connected?e():(u.on("connect_error",(e=>{t(`Socket connect error: ${e}`)})),u.on("connect",(()=>{e()})))}))}}},31758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerServerEventType=t.enumToArray=t.isNumber=t.isSimpleType=t.valuePreview=t.toString=void 0;const o=n(36783);t.toString=e=>{if("object"===typeof e){if(e instanceof Error)return JSON.stringify((0,o.serializeError)(e));try{return JSON.stringify(e).substr(0,250)}catch(t){return"Object (cannot stringify)"}}return`${e}`.substr(0,250)};t.valuePreview=e=>(0,t.toString)(e).substr(0,100);t.isSimpleType=e=>["number","string","boolean"].includes(typeof e);t.isNumber=e=>!1===isNaN(Number(e)),t.enumToArray=function(e){return Object.keys(e).filter(t.isNumber).map((t=>e[t]))},function(e){e.RUNTIME_READY="runtime-ready",e.CHANGE_EVENT_NAME="change",e.PUSH_INPUT_VALUE="push-input-value",e.CHANGE_AWK="live-change-awk",e.CHANGE_ERROR="live-change-error",e.IS_ALIVE="is-alive",e.UPDATE_BREAKPOINTS="update-breakpoints",e.INPUT_VALUE_OVERRIDE="input-value-override",e.OUTPUT_VALUE_OVERRIDE="output-value-override",e.INPUT_VALUE_CHANGE="input-value-changed",e.OUTPUT_VALUE_CHANGE="output-value-changed",e.PROCESSING_CHANGE="processing-changed",e.INPUTS_STATE_CHANGE="inputs-state-changed",e.NODE_ERROR="node-error",e.EVENTS_BATCH="events-batch"}(t.DebuggerServerEventType||(t.DebuggerServerEventType={}))},96233:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31758),t),i(n(42403),t),i(n(39641),t)},65645:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var o=n(70079),i=n(11253),s=n(74089),r=n(74762),a=n(21766);var u=n(10831),l=n(61997),c=n(77852);const d=(0,a.S)(),p=[0,20],f=e=>{let{flow:t,output:n,inputs:o,onError:s,debugDelay:a,onCompleted:u,dependencies:l,player:c}=e;const p=((e,t)=>{const n=new Set;return{onEvent:o=>{const i={...o,time:Date.now(),executionId:"n/a"};console.info("Got debugger event",o),t.addEvents([i]),e.addEvents([i]),n.forEach((e=>e([i])))},onBatchedEvents:e=>(n.add(e),()=>n.delete(e))}})(c,d);p.debugDelay=a;const f=(0,r.keys)(t.node.outputs)[0];return{executeResult:(0,r.execute)({node:t.node,inputs:o,outputs:{[f]:n},resolvedDeps:{...l,[t.node.id]:t.node},_debugger:p,onCompleted:u,onBubbleError:e=>{s(e)},extraContext:{PubSub:i}}),localDebugger:p}},m=e=>{const{debugDelay:t,onOutput:i,flowProps:a}=e,{flow:m,inputs:g,output:v}=a,h=(0,o.useRef)((0,s.createRuntimePlayer)()),[I,y]=(0,o.useState)(e.flowProps.dependencies),[b,C]=(0,o.useState)(),[_]=(0,s.useDebounce)(I,500),x=(0,c.useDarkMode)(),N=async(e,t)=>{const{node:o}=e,i=Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).find((e=>(0,r.isBaseNode)(e)&&e.id===o.id));let a;y((e=>({...e,[i.id]:{...i,source:{path:"@flyde/stdlib/dist/all-browser",export:i.id}}})));const l=(0,u.ZP)(m,(n=>{if(t){const o=(0,s.vAdd)({x:0,y:0},t.pos);if(a=(0,s.createNewNodeInstance)(e.node,0,o,I),n.node.instances.push(a),t.connectTo){const{insId:e,outputId:o}=t.connectTo;n.node.connections.push({from:{insId:e,pinId:o},to:{insId:a.id,pinId:r.TRIGGER_PIN_ID}})}}}));await new Promise((e=>setTimeout(e,10)));const c=(0,u.ZP)(w,(e=>{e.flow=l,t?.selectAfterAdding&&a&&(e.boardData.selected=[a?.id])}));return P(c),(0,s.toastMsg)(`Node ${o.id} successfully imported from ${e.module}`),I},j=async()=>({importables:Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).filter(r.isBaseNode).map((e=>({node:{...e,source:{path:"n/a",export:"n/a"}},module:"@flyde/stdlib"}))),errors:[]}),[w,P]=(0,o.useState)({flow:m,boardData:{viewPort:{pos:{x:0,y:0},zoom:1},lastMousePos:{x:0,y:0},selected:[]}});(0,o.useEffect)((()=>{P((e=>({...e,flow:m})))}),[m]),(0,o.useEffect)((()=>{y((e=>({...e,main:w.flow.node})))}),[w.flow.node]);const O={state:w,onChangeEditorState:P,hideTemplatingTips:!0,initialPadding:p,onExtractInlineNode:r.noop,disableScrolling:!0,darkMode:x.isDarkMode};(0,o.useEffect)((()=>{h.current.start()}),[]),(0,o.useEffect)((()=>{const{executeResult:n,localDebugger:o}=f({flow:w.flow,dependencies:I,output:v,inputs:g,onError:r.noop,debugDelay:t,player:h.current,onCompleted:e.onCompleted}),s=e.flowProps.output.subscribe((e=>i(e)));return C(o),()=>{n(),s.unsubscribe()}}),[t,_]);const E=(0,o.useMemo)((()=>({resolvedDependencies:I,onImportNode:N,onRequestImportables:j})),[]),D=(0,o.useMemo)((()=>({debuggerClient:b,onRequestHistory:d.requestHistory})),[b]);return o.createElement(l.Z,null,(()=>o.createElement(s.DependenciesContextProvider,{value:E},o.createElement(s.DebuggerContextProvider,{value:D},o.createElement(s.FlowEditor,O)))))}},21766:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var o=n(74762);const i=200,s=()=>{const e=new Map,t=new Map;return{requestHistory:async(n,s,r)=>{const a="input"===r?o.DebuggerEventType.INPUT_CHANGE:o.DebuggerEventType.OUTPUT_CHANGE;if(console.log({insId:n,pinId:s,type:a}),s){const t=`${n}.${s}.${a}`,o=e.get(t)||{total:0,lastSamples:[]},r=o.lastSamples.slice(0,i);return{...o,lastSamples:r}}{const e=t.get(n)||{total:0,lastSamples:[]},o=e.lastSamples.slice(0,i);return{...e,lastSamples:o}}},addEvents:n=>{n.forEach((n=>{if(n.type===o.DebuggerEventType.ERROR){const e=n;e.type=o.DebuggerEventType.OUTPUT_CHANGE,e.pinId=o.ERROR_PIN_ID}if(n.type===o.DebuggerEventType.INPUT_CHANGE||n.type===o.DebuggerEventType.OUTPUT_CHANGE){const{insId:o,type:s,pinId:r}=n;{const t=`${o}.${r}.${s}`,a=e.get(t)||{total:0,lastSamples:[]};a.lastSamples.unshift(n),a.lastSamples.length>i&&a.lastSamples.splice(i,a.lastSamples.length-i),a.total++,e.set(t,a)}{const s=t.get(o)||{total:0,lastSamples:[]};s.lastSamples.unshift(n),s.lastSamples.length>i&&s.lastSamples.splice(i,s.lastSamples.length-i),s.total++,e.set(o,s)}}}))}}}},4144:(e,t,n)=>{"use strict";n.d(t,{V:()=>r});var o=n(10328),i=n(70079);const s=e=>i.createElement("li",{className:"log-item"},i.createElement("main",{className:"content"},e.value),i.createElement("aside",null,new Date(e.time).toLocaleTimeString())),r=e=>{const[t,n]=i.useState([]);return i.useEffect((()=>{e.output.subscribe((e=>{const t="object"==typeof e&&i.isValidElement(e)?e:`${e}`;n((e=>[...e,{value:t,time:Date.now()}]))}))}),[]),i.createElement("div",{className:"output-log"},i.createElement("header",null,"Output Log"," ",i.createElement("button",{className:"clear-btn button button--outline button--secondary button--sm",onClick:()=>n([])},"Clear")),i.createElement("main",null,i.createElement("ul",null,t.map(((e,t)=>i.createElement(s,(0,o.Z)({},e,{key:t}))))),0===t.length?i.createElement("div",{className:"empty-state"},"Nothing to show. Interact with the example to emit some outputs!"):null))}},79256:(e,t,n)=>{"use strict";n.d(t,{I:()=>p});var o=n(70079),i=n(65092),s=n(19841),r=n(49794),a=n(21766),u=n(73949),l=n(81098),c=n(65645);(0,a.S)();const d=[{title:"Hello World",key:"hello-world"},{title:"React Counter",key:"react-counter"},{title:"BMI Calculator",key:"bmi"},{title:"REST API Usage",key:"apis"},{title:"Debounce vs. Throttling",key:"debounce-throttling"},{title:"Fibonacci Seq.",key:"fibonacci"}],p=e=>{const[t,n]=(0,o.useState)(e.initWidth||500),[a,p]=(0,o.useState)(e.defaultDelay||0),[f,m]=(0,o.useState)(!1),g=(0,o.useCallback)(((e,t)=>{let{size:o}=t;n(o.width)}),[]),v=o.createElement("div",{className:"delay-container"},o.createElement("input",{type:"range",id:"volume",name:"delay",value:a,step:"100",min:"0",max:"300",onChange:e=>p(Number(e.target.value))}),o.createElement("label",{htmlFor:"volume"},"Debug Delay: ",a,"ms")),h=d.findIndex((t=>t.key===e.meta.key)),I=d[h+1],y=d[h-1];return o.createElement(i.Z,{title:`${e.meta.title} | Playground`,description:`Flyde Playground - ${e.meta.title} example`},o.createElement("header",{className:(0,s.default)("hero hero--primary",u.Z.heroBanner,"playground-hero")},o.createElement("div",{className:"container"},o.createElement("h1",{className:"hero__title"},"Welcome to Flyde's Online Playground"),o.createElement("p",{className:"hero__subtitle"},"Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!"))),o.createElement("div",{className:"mobile-warning"},"Flyde is currently not optimized for mobile devices. Please"," ",o.createElement("strong",null,"use a desktop computer for the best experience"),"."),o.createElement("ul",{className:"examples__menu"},d.map((e=>o.createElement("li",{key:e.key},o.createElement(r.Z,{to:`/playground/${e.key}`,className:"button button--primary"},e.title))))),o.createElement("div",{className:"playground-container"},o.createElement("header",null,o.createElement("h2",{className:"playground-title"},e.meta.title),o.createElement("div",{className:"playground-description"},e.meta.description),f?o.createElement(o.Fragment,null,o.createElement("hr",null),o.createElement("div",{className:"playground-extra"},e.extraInfo||e.meta.extraInfo,o.createElement("div",{className:"star-hint"},o.createElement("span",null,"\xa0 PS: Did you like this example?"),"Please consider giving a \u2b50\ufe0f to the project"," ",o.createElement("span",{className:"star-wrapper"},o.createElement("iframe",{className:"gh-stars-frame",src:"https://ghbtns.com/github-btn.html?user=flydelabs&repo=flyde&type=star&count=true&size=small",width:100,height:20,title:"GitHub Stars"}))))):null,e.prefixComponent),o.createElement("div",{className:"playground"},o.createElement("div",{className:"flow-container"},!0!==e.hideDelay?v:null,o.createElement(c.Y,{flowProps:e.flowProps,debugDelay:a,onOutput:()=>m(!0)})),o.createElement(l.Resizable,{height:0,width:t,onResize:g,handle:o.createElement("div",{className:"handle"}),axis:"x",resizeHandles:["w"]},o.createElement("div",{className:"output-container",style:{flexBasis:t}},e.children))),o.createElement("nav",{className:"pagination-nav"},o.createElement("div",{className:"pagination-nav__item"},y?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${y.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Previous Example"),o.createElement("div",{className:"pagination-nav__label"},y.title)):null),o.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},I?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${I.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Next Example"),o.createElement("div",{className:"pagination-nav__label"},I.title)):null))))}},26641:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var o=n(70079),i=n(74762),s=n(79256);const r={dependencies:[],flow:{imports:{"@flyde/stdlib":["IsGreater"]},node:{instances:[{pos:{x:-339.8445458984375,y:-298.6939727783203},id:"clal8c6ws00054664pn7mxwak",inputConfig:{},node:{id:"Inline-value-prompt(What is",inputs:{},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"const result = (prompt('What is your weight (in kilograms)?')); Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"prompt('What is your weight (in kilograms)?')",dataBuilderSource:"cHJvbXB0KCdXaGF0IGlzIHlvdXIgd2VpZ2h0IChpbiBraWxvZ3JhbXMpPycp",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}}},{pos:{x:97.43304077148437,y:-298.35113525390625},id:"clal8cm19000b4664u3iz2pbb",inputConfig:{},node:{id:"Inline-value-prompt(What is",inputs:{},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"const result = (prompt('What is your height (in cm)?')); Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"prompt('What is your height (in cm)?')",dataBuilderSource:"cHJvbXB0KCdXaGF0IGlzIHlvdXIgaGVpZ2h0IChpbiBjbSk/Jyk=",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}}},{pos:{x:-140.88708862304688,y:-123.31595092773438},id:"clal8dus5000j4664s9pwujgy",inputConfig:{},node:{id:"Inline-value-(inputs.weight ",inputs:{weight:{type:"any",mode:"required"},height:{type:"any",mode:"required"}},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"const result = ((inputs.weight / inputs.height**2) * 10000); Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"(inputs.weight / inputs.height**2) * 10000",dataBuilderSource:"KGlucHV0cy53ZWlnaHQgLyBpbnB1dHMuaGVpZ2h0KioyKSAgKiAxMDAwMA==",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}}},{pos:{x:-122.89145629882813,y:6.26922607421875},id:"clal91glf00024664mfh47zbj",inputConfig:{},node:{id:"Inline-value-let range;\nif (",inputs:{bmi:{type:"any",mode:"required"}},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"const result = (function() { let range;\nif (inputs.bmi < 18.5) \n range = 'overweight'\nelse if (inputs.bmi < 25) {\n range = 'normal';\n} else if (inputs.bmi < 30) {\n range = 'overweight';\n} else {\n range = 'obese';\n}\n\nreturn `You are in the ${range} range`}());\n Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"let range;\nif (inputs.bmi < 18.5) \n range = 'overweight'\nelse if (inputs.bmi < 25) {\n range = ",dataBuilderSource:"bGV0IHJhbmdlOwppZiAoaW5wdXRzLmJtaSA8IDE4LjUpIAogICAgcmFuZ2UgPSAnb3ZlcndlaWdodCcKZWxzZSBpZiAoaW5wdXRzLmJtaSA8IDI1KSB7CiAgICByYW5nZSA9ICdub3JtYWwnOwp9IGVsc2UgaWYgKGlucHV0cy5ibWkgPCAzMCkgewogICAgcmFuZ2UgPSAnb3ZlcndlaWdodCc7Cn0gZWxzZSB7CiAgICByYW5nZSA9ICdvYmVzZSc7Cn0KCnJldHVybiBgWW91IGFyZSBpbiB0aGUgJHtyYW5nZX0gcmFuZ2Vg",templateType:"function",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}}}],connections:[{from:{insId:"clal8c6ws00054664pn7mxwak",pinId:"value"},to:{insId:"clal8dus5000j4664s9pwujgy",pinId:"weight"}},{from:{insId:"clal8cm19000b4664u3iz2pbb",pinId:"value"},to:{insId:"clal8dus5000j4664s9pwujgy",pinId:"height"}},{from:{insId:"clal8dus5000j4664s9pwujgy",pinId:"value"},to:{insId:"clal91glf00024664mfh47zbj",pinId:"bmi"}},{from:{insId:"clal91glf00024664mfh47zbj",pinId:"value"},to:{insId:"__this",pinId:"rename"}}],id:"BMI",inputs:{},outputs:{rename:{type:"any",optional:!1,delayed:!1}},inputsPosition:{},outputsPosition:{result:{x:24.354419059198683,y:165.7657006221402},r:{x:24.354419059198683,y:165.7657006221402},rename:{x:33.925163537262904,y:163.67737650172523}},completionOutputs:["rename"]}}};var a=n(4144);const u={title:"BMI Calculator",description:"Simple BMI calculator with a decision tree. There are many things that make sense done visually, and even more that don't. This example showcases Flyde's support for inline code. The BMI calculation uses a simple inline formula, and the final string uses a textual switch case. Flyde exposes dynamic arguments to your inline code automatically if you use the special \"inputs.\" object!",key:"bmi"},l="Try adding another prompt and another input to the formula!";function c(){const e=(0,o.useRef)((0,i.dynamicOutput)()),t=(0,o.useRef)({__trigger:(0,i.dynamicNodeInput)()}),[n,c]=(0,o.useState)({flow:r.flow,dependencies:r.dependencies,inputs:t.current,output:e.current}),d=o.createElement("button",{className:"button button--success ",onClick:()=>t.current.__trigger.subject.next("run")},"Run!");return o.createElement(s.I,{meta:u,flowProps:n,prefixComponent:d,initWidth:300,extraInfo:l,defaultDelay:500},o.createElement(a.V,{output:e.current}))}},73949:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={"flyde-flow-editor":"flyde-flow-editor_AAD4",_hj_feedback_container:"_hj_feedback_container_Af03"}},85721:(e,t,n)=>{var o={"./af":47654,"./af.js":47654,"./ar":61325,"./ar-dz":98344,"./ar-dz.js":98344,"./ar-kw":26230,"./ar-kw.js":26230,"./ar-ly":42524,"./ar-ly.js":42524,"./ar-ma":44119,"./ar-ma.js":44119,"./ar-sa":82625,"./ar-sa.js":82625,"./ar-tn":42182,"./ar-tn.js":42182,"./ar.js":61325,"./az":37093,"./az.js":37093,"./be":32721,"./be.js":32721,"./bg":59919,"./bg.js":59919,"./bm":95594,"./bm.js":95594,"./bn":563,"./bn-bd":41757,"./bn-bd.js":41757,"./bn.js":563,"./bo":73211,"./bo.js":73211,"./br":87438,"./br.js":87438,"./bs":83662,"./bs.js":83662,"./ca":61196,"./ca.js":61196,"./cs":5841,"./cs.js":5841,"./cv":85251,"./cv.js":85251,"./cy":24512,"./cy.js":24512,"./da":37539,"./da.js":37539,"./de":5059,"./de-at":53853,"./de-at.js":53853,"./de-ch":99378,"./de-ch.js":99378,"./de.js":5059,"./dv":91454,"./dv.js":91454,"./el":39651,"./el.js":39651,"./en-au":87953,"./en-au.js":87953,"./en-ca":98193,"./en-ca.js":98193,"./en-gb":61980,"./en-gb.js":61980,"./en-ie":14050,"./en-ie.js":14050,"./en-il":6502,"./en-il.js":6502,"./en-in":555,"./en-in.js":555,"./en-nz":11372,"./en-nz.js":11372,"./en-sg":26568,"./en-sg.js":26568,"./eo":69533,"./eo.js":69533,"./es":68327,"./es-do":17620,"./es-do.js":17620,"./es-mx":96467,"./es-mx.js":96467,"./es-us":83272,"./es-us.js":83272,"./es.js":68327,"./et":68523,"./et.js":68523,"./eu":19066,"./eu.js":19066,"./fa":59087,"./fa.js":59087,"./fi":96443,"./fi.js":96443,"./fil":93979,"./fil.js":93979,"./fo":90383,"./fo.js":90383,"./fr":56327,"./fr-ca":25610,"./fr-ca.js":25610,"./fr-ch":97274,"./fr-ch.js":97274,"./fr.js":56327,"./fy":67442,"./fy.js":67442,"./ga":44291,"./ga.js":44291,"./gd":77342,"./gd.js":77342,"./gl":96248,"./gl.js":96248,"./gom-deva":21404,"./gom-deva.js":21404,"./gom-latn":20833,"./gom-latn.js":20833,"./gu":9122,"./gu.js":9122,"./he":74623,"./he.js":74623,"./hi":60364,"./hi.js":60364,"./hr":30860,"./hr.js":30860,"./hu":70441,"./hu.js":70441,"./hy-am":90425,"./hy-am.js":90425,"./id":29672,"./id.js":29672,"./is":96150,"./is.js":96150,"./it":27852,"./it-ch":55603,"./it-ch.js":55603,"./it.js":27852,"./ja":16465,"./ja.js":16465,"./jv":20120,"./jv.js":20120,"./ka":87245,"./ka.js":87245,"./kk":21479,"./kk.js":21479,"./km":65038,"./km.js":65038,"./kn":63060,"./kn.js":63060,"./ko":85020,"./ko.js":85020,"./ku":90582,"./ku.js":90582,"./ky":34950,"./ky.js":34950,"./lb":94201,"./lb.js":94201,"./lo":87894,"./lo.js":87894,"./lt":70120,"./lt.js":70120,"./lv":4265,"./lv.js":4265,"./me":14030,"./me.js":14030,"./mi":9463,"./mi.js":9463,"./mk":25898,"./mk.js":25898,"./ml":64233,"./ml.js":64233,"./mn":47156,"./mn.js":47156,"./mr":34479,"./mr.js":34479,"./ms":24691,"./ms-my":6456,"./ms-my.js":6456,"./ms.js":24691,"./mt":81789,"./mt.js":81789,"./my":37452,"./my.js":37452,"./nb":91170,"./nb.js":91170,"./ne":87529,"./ne.js":87529,"./nl":81776,"./nl-be":24455,"./nl-be.js":24455,"./nl.js":81776,"./nn":34705,"./nn.js":34705,"./oc-lnc":36139,"./oc-lnc.js":36139,"./pa-in":17960,"./pa-in.js":17960,"./pl":1899,"./pl.js":1899,"./pt":31670,"./pt-br":29159,"./pt-br.js":29159,"./pt.js":31670,"./ro":55115,"./ro.js":55115,"./ru":45149,"./ru.js":45149,"./sd":81231,"./sd.js":81231,"./se":35397,"./se.js":35397,"./si":99786,"./si.js":99786,"./sk":39383,"./sk.js":39383,"./sl":68691,"./sl.js":68691,"./sq":34826,"./sq.js":34826,"./sr":40080,"./sr-cyrl":75673,"./sr-cyrl.js":75673,"./sr.js":40080,"./ss":54309,"./ss.js":54309,"./sv":52245,"./sv.js":52245,"./sw":8967,"./sw.js":8967,"./ta":10454,"./ta.js":10454,"./te":35204,"./te.js":35204,"./tet":81571,"./tet.js":81571,"./tg":15737,"./tg.js":15737,"./th":41786,"./th.js":41786,"./tk":50511,"./tk.js":50511,"./tl-ph":14828,"./tl-ph.js":14828,"./tlh":62422,"./tlh.js":62422,"./tr":97047,"./tr.js":97047,"./tzl":90792,"./tzl.js":90792,"./tzm":67730,"./tzm-latn":59963,"./tzm-latn.js":59963,"./tzm.js":67730,"./ug-cn":42535,"./ug-cn.js":42535,"./uk":33151,"./uk.js":33151,"./ur":22750,"./ur.js":22750,"./uz":61914,"./uz-latn":60231,"./uz-latn.js":60231,"./uz.js":61914,"./vi":55517,"./vi.js":55517,"./x-pseudo":64078,"./x-pseudo.js":64078,"./yo":70046,"./yo.js":70046,"./zh-cn":81832,"./zh-cn.js":81832,"./zh-hk":90953,"./zh-hk.js":90953,"./zh-mo":38236,"./zh-mo.js":38236,"./zh-tw":71001,"./zh-tw.js":71001};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=s,e.exports=i,i.id=85721}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1988],{19121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cappedArrayDebounce=void 0;t.cappedArrayDebounce=function(e,t,n,o){void 0===o&&(o=500);let i=[],s=null,r=null;return{addItem:a=>{clearTimeout(s),i.push(a),r||(r=setTimeout((()=>{e(i),clearTimeout(s),r=null}),o)),i.length>=n?(e(i),clearTimeout(r),r=null,i=[]):s=setTimeout((()=>{e(i),clearTimeout(r),r=null,i=[]}),t)},flush:()=>{i.length&&(e(i),i=[],clearTimeout(r))},pendingItems:()=>i.length}}},59792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.dataShaper=t.DataShapeType=void 0,function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.ARRAY=3]="ARRAY",e[e.OBJECT=4]="OBJECT",e[e.NULL=5]="NULL",e[e.UNSUPPORTED=6]="UNSUPPORTED"}(n=t.DataShapeType||(t.DataShapeType={}));const o={string:n.STRING,number:n.NUMBER,boolean:n.BOOLEAN,object:n.OBJECT,array:n.ARRAY,null:n.NULL,symbol:n.UNSUPPORTED,undefined:n.UNSUPPORTED,function:n.UNSUPPORTED,bigint:n.UNSUPPORTED};t.dataShaper=function(e,n,i){void 0===n&&(n=5),void 0===i&&(i=5);const s=null===(r=e)?"null":typeof r;var r,a;if("object"===s){if(Array.isArray(e))return n>1?e.filter(((e,t)=>t(0,t.dataShaper)(e,n-1,i))):o.array;if(n>1){const o={};for(const s in e)o[s]=(0,t.dataShaper)(e[s],n-1,i);return a=o,Object.keys(a).sort().reduce(((e,t)=>(e[t]=a[t],e)),{})}return o.object}return o[s]}},23046:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.debugLogger=void 0;const i=(0,o(n(55899)).default)("flyde");t.debugLogger=e=>i.extend(e)},24331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullInsIdPath=void 0,t.fullInsIdPath=function(e,t){if(!e)throw new Error("insId is not defined");return t?`${t}.${e}`:e}},34459:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hashFlow=t.hashNode=void 0;const i=o(n(68805)),s=n(30292),r=e=>(0,i.default)(e);t.hashNode=function(e,t){var n;void 0===t&&(t=!0);const{id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l}=e,c={id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l};if((0,s.isVisualNode)(e)){const{instances:n,connections:o,inputsPosition:i,outputsPosition:s}=e,a=n.map((e=>{const{pos:t,...n}=e;return n})),u=t?{}:{inputsPosition:i,outputsPosition:s},l=t?a:n;l.sort(((e,t)=>e.id.localeCompare(t.id)));const d=[...o];d.sort(((e,t)=>{const n=`${e.from.insId}.${e.from.pinId}`,o=`${t.from.insId}.${t.from.pinId}`;return n.localeCompare(o)}));const p=JSON.stringify({instancesToUse:l,conns:d,...c,maybeIoPos:u});return r(p)}if((0,s.isInlineValueNode)(e)){const{customViewCode:t}=e,o=null!==(n=e.fnCode)&&void 0!==n?n:e.runFnRawCode,i=JSON.stringify({fnCode:o,customViewCode:t,...c});return r(i)}throw new Error("Hashing code nodes unsupported")};t.hashFlow=e=>{const{node:n,imports:o}=e,i=(0,t.hashNode)(n,!1),s=Object.entries(null!=o?o:{}).sort(((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)})).map((e=>{let[t,n]=e;return[t,n.sort()]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{}),a=JSON.stringify(s);return r(i+a)}},86873:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DepGraph=void 0,i(n(3172),t),i(n(59962),t),i(n(23046),t),i(n(19121),t),i(n(59962),t),i(n(34459),t),i(n(39043),t),i(n(59792),t),i(n(24331),t),t.DepGraph=n(60359).DepGraph},3172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testDataCreator=void 0;t.testDataCreator=e=>function(t){void 0===t&&(t={});return{..."function"==typeof e?e():e,...t}}},59962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplePluralize=t.eventually=t.delay=t.noop=t.removeDupes=t.ensure=t.isOptionalType=t.callFnOrFnPromise=t.isPromise=t.isDefined=t.containsAll=t.shuffle=t.randomInts=t.repeat=t.pickRandom=t.randomPos=t.randomInt=t.pickSecond=t.pickFirst=t.fromEntries=t.entries=t.okeys=t.values=t.keys=t.filterOMap=t.mapOMap=t.middlePos=t.calcCenter=t.intersectRect=void 0;t.intersectRect=(e,t)=>{const n=e.x+e.w,o=t.x+t.w;return!(t.x>n||oe.y+e.h||t.y+t.h{let{w:t,h:n,x:o,y:i}=e;return{x:o+t/2,y:i+n/2}};t.middlePos=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});t.mapOMap=(e,n)=>(0,t.entries)(e).map((e=>{let[t,o]=e;return[t,n(t,o)]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.filterOMap=(e,n)=>(0,t.entries)(e).filter((e=>{let[t,o]=e;return n(t,o)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.keys=e=>Object.keys(e);t.values=e=>Object.values(e),t.okeys=t.keys;t.entries=e=>(0,t.okeys)(e).map((t=>[t,e[t]]));t.fromEntries=e=>e.reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.pickFirst=e=>e[0];t.pickSecond=e=>e[1];t.randomInt=function(e,t){void 0===t&&(t=0);const n=Math.random();return t+Math.floor((e-t)*n)};t.randomPos=function(e,n){void 0===e&&(e=1e3),void 0===n&&(n=0);return{x:(0,t.randomInt)(e,n),y:(0,t.randomInt)(e,n)}};t.pickRandom=e=>e[(0,t.randomInt)(e.length)];t.repeat=(e,t)=>"x".repeat(e).split("").map(((e,n)=>t(n)));t.randomInts=function(e,n,o){return void 0===n&&(n=100),void 0===o&&(o=0),(0,t.repeat)(e,(()=>(0,t.randomInt)(n,o)))};t.shuffle=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t};t.containsAll=(e,t)=>t.every((t=>e.includes(t)));t.isDefined=e=>void 0!==e;t.isPromise=e=>e&&"function"==typeof e.then;t.callFnOrFnPromise=(e,n)=>{if(!(0,t.isDefined)(e))return;const o=e=>{try{e()}catch(t){console.error(n,t)}};"function"==typeof e?o(e):Promise.resolve(e).then((e=>{"function"==typeof e&&o(e)}))};t.isOptionalType=e=>/\?$/.test(e);t.ensure=(e,t)=>{if(void 0===e)throw new Error(t||"Undefined value passed");return e};t.removeDupes=e=>Array.from(new Set(e));t.noop=()=>{};t.delay=e=>new Promise((t=>setTimeout(t,e)));t.eventually=async function(e,n,o,i){if(void 0===n&&(n=1e3),void 0===o&&(o=100),void 0===i&&(i=new Set),n<0){const e=Array.from(i).reduce(((e,t,n)=>`${e}\n\t\t${n+1}. ${t}`),"");throw new Error(`[Eventually timeout exceeded after: timeout with error]: ${e}`)}try{await e()}catch(s){const r=Date.now();await(0,t.delay)(o);const a=Date.now()-r;return i.add(null==s?void 0:s.message),(0,t.eventually)(e,n-a,o,i)}},t.simplePluralize=function(e,t){return`${e} ${t}${1!==e?"s":""}`}},39043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileObjectTemplate=t.compileStringTemplate=void 0;t.compileStringTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=new RegExp("\\$\\{"+e+"\\}","g");n=n.replace(i,o)})),n};t.compileObjectTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=JSON.stringify(o),s=new RegExp('"\\$\\$\\{'+e+'\\}"',"g"),r=new RegExp("\\$\\{"+e+"\\}","g"),a="string"==typeof o?o.replace(/"/g,((e,t,n)=>"\\"!==n[t-1]?'\\"':n[t])):o;n=n.replace(s,i).replace(r,a).replace(/\n/g,"\\n")})),JSON.parse(n)}},69150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connection=t.connectionData=t.connectionDataEquals=t.connectionNodeEquals=t.connectionNode=t.externalConnectionNode=t.isInternalConnection=t.isExternalConnection=t.isInternalConnectionNode=t.isExternalConnectionNode=t.getNodeOutputs=t.getOutputName=t.getInputName=t.getNodeInputs=t.TRIGGER_PIN_ID=t.ERROR_PIN_ID=t.THIS_INS_ID=void 0;const o=n(30292);t.THIS_INS_ID="__this",t.ERROR_PIN_ID="__error",t.TRIGGER_PIN_ID="__trigger";t.getNodeInputs=e=>({...e.inputs,[t.TRIGGER_PIN_ID]:(0,o.nodeInput)()});t.getInputName=e=>e===t.TRIGGER_PIN_ID?"Trigger Node":e;t.getOutputName=e=>e===t.ERROR_PIN_ID?"Error":e;t.getNodeOutputs=e=>({...e.outputs,[t.ERROR_PIN_ID]:(0,o.nodeOutput)()});t.isExternalConnectionNode=e=>e&&e.insId===t.THIS_INS_ID;t.isInternalConnectionNode=e=>e.insId!==t.THIS_INS_ID;t.isExternalConnection=e=>{let{from:n,to:o}=e;return(0,t.isExternalConnectionNode)(n)||(0,t.isExternalConnectionNode)(o)};t.isInternalConnection=e=>!(0,t.isExternalConnection)(e);t.externalConnectionNode=e=>({insId:t.THIS_INS_ID,pinId:e});t.connectionNode=(e,t)=>({insId:e,pinId:t});t.connectionNodeEquals=(e,t)=>e.insId===t.insId&&e.pinId===t.pinId;t.connectionDataEquals=(e,n)=>!(!e||!n)&&((0,t.connectionNodeEquals)(e.from,n.from)&&(0,t.connectionNodeEquals)(e.to,n.to)),t.connectionData=function(e,n,o){const i="string"==typeof e?e.split("."):e,s="string"==typeof n?n.split("."):n;if(i.length>2||s.length>2)throw new Error(`invalid source or target to connection data - ${e} / ${n}`);return{from:2===i.length?(0,t.connectionNode)(i[0],i[1]):(0,t.externalConnectionNode)(i[0]),to:2===s.length?(0,t.connectionNode)(s[0],s[1]):(0,t.externalConnectionNode)(s[0]),delayed:o}};t.connection=function(e,t,n){return void 0===n&&(n=!1),{from:e,to:t,delayed:n}}},6775:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;const s=n(30292),r=n(47025),a=n(86873),u=n(69150);i(n(69150),t);t.connect=function(e,t,n,o,i,l,c,d){void 0===n&&(n={}),void 0===i&&(i={}),void 0===l&&(l=a.noop),void 0===c&&(c={}),void 0===d&&(d={});const{id:p,connections:f,instances:m}=e,g=p||"connected-node"+(0,a.randomInt)(999);return{inputs:e.inputs,outputs:e.outputs,id:g,completionOutputs:e.completionOutputs,reactiveInputs:e.reactiveInputs,run:(p,v)=>{let h=[];const I=new a.DepGraph({}),y=new Map,b=new Map,C=new Map,_=new Map,x=new Map,N=new Map;let j;const w=new Set;m.forEach((e=>{const n=(0,s.getNode)(e,t),o=e.id;y.set(e,o),b.set(o,e),I.addNode(o);const i=Object.keys(n.inputs),r=Object.keys(n.outputs),a={},l={};i.forEach((t=>{const n=(e.inputConfig||{})[t]||(0,s.queueInputPinConfig)();(0,s.isStaticInputPinConfig)(n)?a[t]=(0,s.staticNodeInput)(n.value):a[t]=(0,s.dynamicNodeInput)({config:n})})),a[u.TRIGGER_PIN_ID]=(0,s.dynamicNodeInput)({config:(0,s.queueInputPinConfig)()});if(f.some((t=>(0,u.isInternalConnectionNode)(t.to)&&t.to.insId===e.id&&t.to.pinId===u.TRIGGER_PIN_ID))&&e.inputConfig&&e.inputConfig[u.TRIGGER_PIN_ID])throw"Trigger connection can not be configured";r.forEach((e=>{const t=(0,s.dynamicOutput)();l[e]=t}));f.some((t=>(0,u.isInternalConnectionNode)(t.from)&&t.from.insId===e.id&&t.from.pinId===u.ERROR_PIN_ID))&&(l[u.ERROR_PIN_ID]=(0,s.dynamicOutput)()),C.set(o,a),_.set(o,l)}));const P=new Set;return f.forEach((n=>{const{from:o,to:i}=n,{insId:r,pinId:a}=o,{insId:l,pinId:c}=i,d=_.get(r),p=C.get(l);if((0,u.isInternalConnectionNode)(i)&&P.add(`${i.insId}.${i.pinId}`),(0,u.isExternalConnection)(n)){if((0,u.isExternalConnectionNode)(o)){const e=null==p?void 0:p[i.pinId];if(!e)throw new Error(`Input ${i.pinId} of instance ${l} not found`);const t=x.get(o.pinId)||[];t.push(e),x.set(o.pinId,t)}else{let e=null==d?void 0:d[o.pinId];if(!e)throw new Error(`Output ${o.pinId} of instance ${r} not found`);const t=N.get(i.pinId)||[];t.push(e),N.set(i.pinId,t)}return}if(!d)throw new Error(`No outputs found for instance [${r}]`);if(!p)throw b.has(l)?new Error(`No inputs found for instance [${l}]`):new Error(`Instance with id [${l}] does not exist!`);const f=d[a];if(!f)throw new Error(`Output source - [${a}] not found in node [${g}]`);const m=p[c],v=b.get(r);if(!v&&r!==u.THIS_INS_ID)throw new Error(`Instance [${r}] does not exist! failed to connect [${o}] -> [${i}]`);const y=(v?(0,s.getNode)(v,t):e).outputs[a];if(y&&y.delayed||n.delayed||r!==u.THIS_INS_ID&&l!==u.THIS_INS_ID&&I.addDependency(r,l),!m)throw new Error(`Target arg - [${i}] not found in node [${g}]`);const j=f.subscribe((async e=>{if(!(0,s.isDynamicInput)(m))throw console.info(m),new Error(`Impossible state listening to non dynamic input - ${l}.${c}`);m.subject.next(e)}));h.push((()=>j.unsubscribe()))})),(0,a.okeys)(v).forEach((e=>{(N.get(e)||[]).forEach((t=>{const n=t.subscribe((async t=>{if(!v[e])throw new Error(`Impossible state - output ${e} does not exist`);v[e].next(t)}));h.push((()=>n.unsubscribe()))}))})),I.overallOrder().map((e=>b.get(e))).forEach((e=>{const a=C.get(e.id),u=_.get(e.id),p=(0,s.getNode)(e,t);if(!a)throw new Error(`Unexpected error - args not found when running ${e}`);if(!u)throw new Error(`Unexpected error - outputs not found when running ${e}`);for(const t in a){const n=e.inputConfig[t];P.has(`${e.id}.${t}`)||(0,s.isStaticInputPinConfig)(n)||delete a[t]}const f=(0,r.execute)({node:p,inputs:a,outputs:u,resolvedDeps:t,_debugger:n,insId:e.id,extraContext:d,mainState:i,ancestorsInsIds:o,onBubbleError:l,onCompleted:()=>{return t=e.id,w.delete(t),void(0===w.size&&j&&j());var t},onStarted:()=>{return t=e.id,void w.add(t);var t},env:c});h.push(f)})),Object.keys(p).forEach((async e=>{(x.get(e)||[]).forEach((t=>{const n=p[e];if(!(0,s.isDynamicInput)(t))throw new Error(`Unsure what to do with key ${e}, input: ${t} of ins ${o}`);(0,a.isDefined)(n)&&t.subject.next(n)}))})),void 0===e.completionOutputs&&w.size>0?new Promise((e=>{j=e})):()=>h.forEach((e=>{try{e()}catch(t){console.error("error unsubscribing",t)}}))}}}},26488:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MINOR_DEBUGGER_EVENT_TYPES=t.MAJOR_DEBUGGER_EVENT_TYPES=t.DebuggerEventType=void 0,function(e){e.INPUT_CHANGE="i",e.OUTPUT_CHANGE="o",e.PROCESSING_CHANGE="pc",e.ERROR="err",e.INPUTS_STATE_CHANGE="isc"}(n=t.DebuggerEventType||(t.DebuggerEventType={})),t.MAJOR_DEBUGGER_EVENT_TYPES=[n.INPUT_CHANGE,n.OUTPUT_CHANGE,n.ERROR],t.MINOR_DEBUGGER_EVENT_TYPES=[n.PROCESSING_CHANGE,n.INPUTS_STATE_CHANGE]},43686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatEvent=void 0;const o=n(26488);t.formatEvent=function(e){var t,n,i;const s=[e.insId,...null!==(n=null===(t=e.ancestorsInsIds)||void 0===t?void 0:t.split("."))&&void 0!==n?n:[]];(null===(i=e.ancestorsInsIds)||void 0===i?void 0:i.length)>0&&e.ancestorsInsIds;const r=`Node <${e.nodeId}> `,a=`(${s.join(" -> ")})`;return`${r} - ${function(e){switch(e.type){case o.DebuggerEventType.PROCESSING_CHANGE:return e.val?"started processing":"stopped processing";case o.DebuggerEventType.INPUT_CHANGE:return`Input pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.OUTPUT_CHANGE:return`Output pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.INPUTS_STATE_CHANGE:return`Inputs queue size changed to ${Object.entries(e.val).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join(", ")}`;case o.DebuggerEventType.ERROR:return`Error: ${e.val}`}}(e)} ${a}`}},99896:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26488),t),i(n(43686),t)},47025:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.GLOBAL_STATE_NS=t.ROOT_INS_ID=t.INPUTS_STATE_SUFFIX=t.INNER_STATE_SUFFIX=void 0;const s=n(62600),r=n(87794);i(n(99896),t);const a=n(30292),u=n(6775),l=n(84479),c=n(86873),d=n(23046),p=n(30292),f=n(99896),m=n(79804);t.INNER_STATE_SUFFIX="_inner",t.INPUTS_STATE_SUFFIX="_inputs";t.ROOT_INS_ID="__root",t.GLOBAL_STATE_NS="____global";t.execute=e=>{let{node:n,inputs:o,outputs:i,resolvedDeps:g,_debugger:v={},insId:h=t.ROOT_INS_ID,extraContext:I={},mainState:y={},ancestorsInsIds:b,onBubbleError:C=s.noop,env:_={},onCompleted:x=s.noop,onStarted:N=s.noop}=e;const j=[];y[t.GLOBAL_STATE_NS]||(y[t.GLOBAL_STATE_NS]=new Map);const w={...I,ENV:_},P=(0,m.customNodesToNodesCollection)(g,w),O=e=>{const t=e instanceof a.NodeInstanceError?e:new a.NodeInstanceError(e,(0,c.fullInsIdPath)(h,b),n.id);v.onEvent&&v.onEvent({type:f.DebuggerEventType.ERROR,val:t,insId:h,ancestorsInsIds:b,nodeId:n.id}),i[u.ERROR_PIN_ID]?i[u.ERROR_PIN_ID].next(t):C(t)},E=(e=>(0,a.isVisualNode)(e)?(0,u.connect)(e,P,v,(0,c.fullInsIdPath)(h,b),y,O,_,I):(0,a.isInlineValueNode)(e)?(0,m.inlineValueNodeToNode)(e,w):e)(n),D=v.onEvent||s.noop,S={},M={};(0,c.entries)(o).forEach((e=>{let[t,o]=e;if((0,a.isDynamicInput)(o)){const e=(0,a.dynamicNodeInput)({config:o.config}),i=o.subject.subscribe((async o=>{const i=D({type:f.DebuggerEventType.INPUT_CHANGE,insId:h,pinId:t,val:o,ancestorsInsIds:b,nodeId:n.id});if(i){const t=await i.valuePromise;e.subject.next(t)}else v.debugDelay&&await(0,c.delay)(v.debugDelay),e.subject.next(o)}));j.push((()=>i.unsubscribe())),M[t]=e}else{D({type:f.DebuggerEventType.INPUT_CHANGE,insId:h,pinId:t,val:o.config.value,ancestorsInsIds:b,nodeId:n.id});const e=(0,a.staticNodeInput)((0,a.getStaticValue)(o.config.value,P,h));M[t]=e}})),(0,c.entries)(i).forEach((e=>{let[t,o]=e;const i=(0,a.dynamicOutput)(),s=i.subscribe((async e=>{const i=D({type:f.DebuggerEventType.OUTPUT_CHANGE,insId:h,pinId:t,val:e,ancestorsInsIds:b,nodeId:n.id});if(i){const e=await i.valuePromise;o.next(e)}else o.next(e)}));j.push((()=>s.unsubscribe())),S[t]=i}));const k=(e=>{var n,o;const{node:i,inputs:u,outputs:m,resolvedDeps:g,_debugger:v,insId:h,ancestorsInsIds:I,mainState:y,onError:b,onStarted:C,onCompleted:_,env:x,extraContext:N}=e,{run:j,fn:w}=i,P=(0,d.debugLogger)("core"),O=[];let E;const D=(null==v?void 0:v.onEvent)||s.noop,S=(0,c.fullInsIdPath)(h,I),M=`${S}${t.INNER_STATE_SUFFIX}`,k=`${S}${t.INPUTS_STATE_SUFFIX}`,T=P.extend(S),A=y[t.GLOBAL_STATE_NS];y[M]||(y[M]=new Map),y[k]||(y[k]=new Map);let R=null!==(n=y[k])&&void 0!==n?n:new Map;const V=()=>{const e=Array.from(R.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:(0,a.isQueueInputPinConfig)(u[n].config)?null==o?void 0:o.length:1}}),{});D({type:f.DebuggerEventType.INPUTS_STATE_CHANGE,val:e,insId:h,ancestorsInsIds:I,nodeId:i.id})},z={execute:(e,n,o,i)=>(0,t.execute)({node:e,inputs:n,outputs:o,resolvedDeps:g,_debugger:v,insId:i,onCompleted:_,onStarted:C}),insId:h,state:null!==(o=y[M])&&void 0!==o?o:new Map,onCleanup:e=>{O.push(e)},onError:e=>{b(e)},context:null!=N?N:{},ancestorsInsIds:I,globalState:A};let $,H=!1;const G=(i.reactiveInputs||[]).filter((e=>{var t;return!(0,p.isStaticInputPinConfig)(null===(t=u[e])||void 0===t?void 0:t.config)})),L=()=>{var e;null===(e=y[M])||void 0===e||e.clear(),(0,c.keys)(y).filter((e=>e.startsWith(`${S}.`))).forEach((e=>{y[e]=new Map}))},F=e=>{const t=(null==e?void 0:e.key)&&G.includes(null==e?void 0:e.key);if(H&&!t);else{const o=H&&t;if((0,l.isNodeStateValid)(u,R,i)||o){let t;if(H){if(!e)throw new Error("Unexpected state, got reactive node while not processing and not valid");const n=(0,l.pullValueForExecution)(e.key,u[e.key],R,x);t={...$,[e.key]:n},V()}else t=(0,l.pullValuesForExecution)(u,R,x),$=t,V();let o=new Set,s={};if(H=!0,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:h,ancestorsInsIds:I,nodeId:i.id}),i.completionOutputs){const e=i.completionOutputs.map((e=>e.split("+"))).reduce(((e,t)=>(t.forEach((n=>{e.set(n,t)})),e)),new Map);(0,c.entries)(m).forEach((t=>{let[n,a]=t;a.pipe((0,r.first)()).subscribe((t=>{o.add(n),s[n]=t;let r=e.get(n);r&&(r.splice(r.indexOf(n),1),0===r.length&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:h,ancestorsInsIds:I,nodeId:i.id}),_&&_(s),L(),(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),E=void 0,o.clear(),s={},(0,l.hasNewSignificantValues)(u,R,x,i.id)&&F()))}))}))}else(0,c.entries)(m).forEach((e=>{let[t,n]=e;n.subscribe((e=>{s[t]=e}))}));try{T("Running node %s with values %o",i.id,t),C&&C(),E=(null!=w?w:j)(t,m,z),(0,c.isPromise)(E)?E.then((()=>{void 0===i.completionOutputs&&_&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:h,ancestorsInsIds:I,nodeId:i.id}),_(s),L(),(0,l.hasNewSignificantValues)(u,R,x,i.id)&&F())})).catch((e=>{b(e),H=!1,T("Error in node %s - value %e",i.id,e),D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:h,ancestorsInsIds:I,nodeId:i.id})})):void 0===i.completionOutputs&&_&&(H=!1,D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:h,ancestorsInsIds:I,nodeId:i.id}),_(s),L())}catch(n){b(n),H=!1,T("Error in node %s - value %e",i.id,n),D({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:h,ancestorsInsIds:I,nodeId:i.id})}const d=G.find((e=>u[e]&&(0,l.peekValueForExecution)(e,u[e],R,x,i.id)));if(d){const e=(0,l.peekValueForExecution)(d,u[d],R,x,i.id);F({key:d,value:e})}else{const e=(0,c.entries)(u).find((e=>{let[t,n]=e;const o=(0,a.isQueueInputPinConfig)(n.config),s=(0,l.peekValueForExecution)(t,n,R,x,i.id);return!!o&&(0,c.isDefined)(s)}));if(e){const[t,n]=e,o=(0,l.peekValueForExecution)(t,n,R,x,i.id);F({key:t,value:o})}}}}};F();const B=(0,l.subscribeInputsToState)(u,R,((e,t)=>{P("Got input %s - value is [%o]",e,t),V();try{F({key:e,value:t})}catch(n){b(n)}}));return O.push(B),()=>{(0,c.callFnOrFnPromise)(E,`Error with cleanup function of ${i.id}`),O.forEach((e=>e()))}})({node:E,inputs:M,outputs:S,resolvedDeps:P,_debugger:v,insId:h,mainState:y,ancestorsInsIds:b,onError:O,onBubbleError:C,env:_,extraContext:I,onCompleted:x,onStarted:N});return()=>{j.forEach((e=>e())),k()}}},84479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeInputsToState=t.isNodeStateValid=t.hasNewSignificantValues=t.peekValuesForExecution=t.pullValuesForExecution=t.pullValueForExecution=t.peekValueForExecution=void 0;const o=n(30292),i=n(86873),s=n(6775),r=(e,t)=>{const n=(0,o.extractStaticValue)(e);if((0,o.isEnvValue)(n)){return((e,t)=>{const n=e.split(".");let o={...t};for(let s of n){if(!o||!(0,i.isDefined)(o[s])||null===o[s])throw new Error(`Cannot find key ${e} inside obj ${t}`);o=o[s]}return o})((0,o.getEnvKeyFromValue)(n),t)}return n};t.peekValueForExecution=(e,t,n,i,s)=>{const a=n.get(e);let u;if(!t)throw new Error(`Trying to peek value of inexsting input in key "${e}" in node "${s}"`);return u=(0,o.isStaticInput)(t)?r(t,i):(0,o.isQueueInputPinConfig)(t.config)?a?[...a].shift():void 0:a,u};t.pullValueForExecution=(e,t,n,i)=>{const s=n.get(e);let a;return(0,o.isStaticInput)(t)?a=r(t,i):(0,o.isQueueInputPinConfig)(t.config)?(a=(s||[]).shift(),n.set(e,s)):(a=s,(0,o.isStickyInputPinConfig)(t.config)||n.delete(e)),a};t.pullValuesForExecution=(e,n,o)=>(0,i.entries)(e).reduce(((e,i)=>{let[s,r]=i;return e[s]=(0,t.pullValueForExecution)(s,r,n,o),e}),{});t.peekValuesForExecution=(e,n,o,s)=>(0,i.entries)(e).reduce(((e,i)=>{let[r,a]=i;return e[r]=(0,t.peekValueForExecution)(r,a,n,o,s),e}),{});t.hasNewSignificantValues=(e,n,s,r)=>(0,i.entries)(e).some((e=>{let[a,u]=e;const l=(0,o.isQueueInputPinConfig)(u.config),c=(0,t.peekValueForExecution)(a,u,n,s,r);return(0,i.isDefined)(c)&&l}));t.isNodeStateValid=(e,t,n)=>{const r=(0,i.keys)(e),a=(0,i.keys)(n.inputs).filter((e=>{var t;const o=null===(t=n.inputs[e])||void 0===t?void 0:t.mode;return!o||"required"===o}));r.includes(s.TRIGGER_PIN_ID)&&a.push(s.TRIGGER_PIN_ID);return!!(0,i.containsAll)(r,a)&&(0,i.entries)(e).filter((e=>{let[t]=e;return!!n.inputs[t]||t===s.TRIGGER_PIN_ID})).every((e=>{let[s,r]=e;var a;const u=t.get(s);return"optional"===((null===(a=n.inputs[s])||void 0===a?void 0:a.mode)||"required")||(!!(0,o.isStaticInput)(r)||((0,o.isQueueInputPinConfig)(r.config)?(0,i.isDefined)(u)&&u.length>0:(0,i.isDefined)(u)))}))};t.subscribeInputsToState=(e,t,n)=>{const s=[];return(0,i.entries)(e).forEach((e=>{let[i,r]=e;if(!r)return;if((0,o.isStaticInput)(r))return;const a=r.subject.subscribe((e=>{if((0,o.isQueueInputPinConfig)(r.config)){const o=t.get(i)||[];if(!Array.isArray(o))throw new Error(`impossible state - state of key ${i} is set but not an array`);o.push(e),t.set(i,o),n(i,e)}else t.set(i,e),n(i,e)}));s.push((()=>a.unsubscribe()))})),()=>s.forEach((e=>e()))}},5474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flydeFlowSchema=void 0;const o=n(29022),i=o.z.record(o.z.string(),o.z.string().or(o.z.array(o.z.string()))),s=o.z.strictObject({x:o.z.number(),y:o.z.number()}),r=o.z.discriminatedUnion("mode",[o.z.strictObject({mode:o.z.literal("static"),value:o.z.any()}),o.z.strictObject({mode:o.z.literal("queue")}),o.z.strictObject({mode:o.z.literal("sticky")})]),a=o.z.object({size:o.z.optional(o.z.enum(["small","regular","large"])),icon:o.z.optional(o.z.any()),color:o.z.optional(o.z.string()),cssOverride:o.z.optional(o.z.record(o.z.string()))}),u=o.z.object({pos:s.default({x:0,y:0}),id:o.z.string(),inputConfig:o.z.optional(o.z.record(o.z.string(),r)).default({}),visibleInputs:o.z.optional(o.z.array(o.z.string())),visibleOutputs:o.z.optional(o.z.array(o.z.string())),nodeId:o.z.optional(o.z.string()),node:o.z.optional(o.z.any()),style:o.z.optional(a)}).refine((e=>e.node||e.nodeId),{message:"Instance must have either an inline node or refer to a nodeId"}),l=o.z.union([o.z.string(),o.z.object({mode:o.z.enum(["required","optional","required-if-connected"]),type:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),defaultValue:o.z.optional(o.z.any())})]),c=o.z.object({type:o.z.optional(o.z.string()),optional:o.z.optional(o.z.boolean()),delayed:o.z.optional(o.z.boolean()),description:o.z.optional(o.z.string())}),d=o.z.object({id:o.z.optional(o.z.string()),inputs:o.z.record(o.z.string(),l),outputs:o.z.record(o.z.string(),c),inputsPosition:o.z.optional(o.z.record(o.z.string(),s)),outputsPosition:o.z.optional(o.z.record(o.z.string(),s)),customViewCode:o.z.optional(o.z.string()),dataBuilderSource:o.z.optional(o.z.string()),templateType:o.z.optional(o.z.string()),completionOutputs:o.z.optional(o.z.array(o.z.string())),reactiveInputs:o.z.optional(o.z.array(o.z.string())),defaultStyle:o.z.optional(a),description:o.z.optional(o.z.string()),searchKeywords:o.z.optional(o.z.array(o.z.string()))}),p=o.z.object({instances:o.z.array(u),connections:o.z.array(o.z.strictObject({from:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),to:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),delayed:o.z.optional(o.z.boolean()),hidden:o.z.optional(o.z.boolean())}))}).and(d);t.flydeFlowSchema=o.z.strictObject({imports:o.z.optional(i).default({}),node:p})},74762:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticValueVisualNode=void 0,i(n(86873),t);const s=n(30292);i(n(6775),t),i(n(47025),t),i(n(10418),t),i(n(30292),t),i(n(3320),t),i(n(79804),t),i(n(5474),t);t.isStaticValueVisualNode=e=>!!e&&!!(0,s.maybeGetStaticValueNodeId)(`${e}`)},87093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fakeVm=t.VM=t.VMScript=void 0;const o=n(86873);class i{constructor(e){this.script=e}}t.VMScript=i;class s{constructor(e){this.context=e}run(e){const t=(0,o.okeys)(this.context.sandbox),n=Object.values(this.context.sandbox);Function(...t,e.script)(...n)}}t.VM=s,t.fakeVm={VMScript:i,VM:s}},28145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVM2Instance=void 0;const o=n(87093);t.getVM2Instance=()=>o.fakeVm},79804:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.customNodesToNodesCollection=t.inlineValueNodeToNode=void 0;const i=o(n(18706)),s=n(86873),r=n(30292),a=(0,n(28145).getVM2Instance)();t.inlineValueNodeToNode=function(e,t){void 0===t&&(t={});const{runFnRawCode:n,...o}=e,u=(0,s.debugLogger)(`code-node:${e.id}`),l=`\n try {\n ${n}\n } catch (e) {\n adv.onError(e);\n }\n `,c=new a.VMScript(l),d={...o,run:(n,o,l)=>{const d=new a.VM({sandbox:{inputs:n,outputs:o,setInterval:setInterval,clearInterval:clearInterval,setTimeout:setTimeout,clearTimeout:clearTimeout,encodeURIComponent:encodeURIComponent,adv:l,log:function(){for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeWithDependencies=void 0;const o=n(30292),i=n(74762),s=n(88270);t.getNodeWithDependencies=function(e,n,r){if(void 0===r&&(r=[]),(0,o.isInlineValueNode)(e))return[e];if(r.includes(e.id))return[];const a=(0,i.removeDupes)(e.instances.filter((e=>(0,s.isRefNodeInstance)(e))).map((e=>e.nodeId)).filter((e=>n[e])));return[e,...a.flatMap((e=>{var t;return null!==(t=n[e])&&void 0!==t?t:[]})).reduce(((e,o)=>[...e,...(0,t.getNodeWithDependencies)(o,n,[...r,...a])]),[])]}},30292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88270),t),i(n(43069),t),i(n(79426),t),i(n(44535),t),i(n(18063),t),i(n(20359),t)},18063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeInstanceError=void 0;class n extends Error{constructor(e,t,n){let o="Unknown error";o="string"==typeof e?e:e instanceof Error?e.message:null!==e&&"object"==typeof e?JSON.stringify(e):String(e),super(`${o} (insId: ${t}, nodeId: ${n})`),this.name=this.constructor.name,this.message=`${o} (insId: ${t}, nodeId: ${n})`,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.fullInsIdsPath=t,this.nodeId=n}}t.NodeInstanceError=n},88270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInsId=t.NodeInstance=t.isRefNodeInstance=t.isInlineNodeInstance=t.inlineNodeInstance=t.nodeInstance=void 0;const o=n(36618);t.nodeInstance=(e,t,n,o)=>({id:e,nodeId:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.inlineNodeInstance=(e,t,n,o)=>({id:e,node:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.isInlineNodeInstance=e=>!!e.node;t.isRefNodeInstance=e=>!(0,t.isInlineNodeInstance)(e);t.NodeInstance=(e,t,n,o)=>({id:e,nodeId:t.id,inputConfig:n||{},pos:o||{x:0,y:0}});t.createInsId=e=>`${e.id}-${(0,o.slug)()}`},43069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvKeyFromValue=t.toEnvValue=t.isEnvValue=t.extractStaticValue=t.isStaticInput=t.isDynamicInput=t.staticNodeInput=t.dynamicNodeInputs=t.dynamicNodeInput=t.dynamicOutput=t.nodeOutputs=t.nodeOutput=t.nodeInputs=t.isInputPinOptional=t.nodeInput=void 0;const o=n(62600),i=n(30292),s=n(86873),r=n(79426);t.nodeInput=function(e){return void 0===e&&(e="required"),{mode:e}};t.isInputPinOptional=e=>"optional"===e.mode;t.nodeInputs=(e,n)=>(0,s.repeat)(e,(e=>(0,t.nodeInput)((null==n?void 0:n[e])||"required")));t.nodeOutput=function(e){return void 0===e&&(e=!1),{delayed:e}};t.nodeOutputs=e=>(0,s.repeat)(e,(()=>(0,t.nodeOutput)()));t.dynamicOutput=()=>new o.Subject,t.dynamicNodeInput=(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})));t.dynamicNodeInputs=function(e){return void 0===e&&(e=10),(0,s.repeat)(e,(()=>(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})))()))};t.staticNodeInput=e=>({config:(0,r.staticInputPinConfig)(e)});t.isDynamicInput=e=>{const t=e;return t&&t.subject&&!!t.subject.next};t.isStaticInput=e=>(0,i.isStaticInputPinConfig)(null==e?void 0:e.config);t.extractStaticValue=e=>{if((0,t.isStaticInput)(e))return e.config.value;throw new Error("Cannot extract static value from non static arg")};t.isEnvValue=e=>"string"==typeof e&&e.startsWith("$ENV.");t.toEnvValue=e=>`$ENV.${e}`;t.getEnvKeyFromValue=e=>"string"==typeof e?e.replace(/^\$ENV\./,""):e},20359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeFromFunction=t.getNodeDef=t.getNode=t.getStaticValue=t.maybeGetStaticValueNodeId=t.fromSimplified=t.inlineValueNode=t.codeNode=t.visualNode=t.isInlineValueNode=t.isVisualNode=t.isCodeNode=t.isBaseNode=t.InlineValueNodeType=void 0;const o=n(86873),i=n(88270),s=n(43069);!function(e){e.VALUE="value",e.FUNCTION="function"}(t.InlineValueNodeType||(t.InlineValueNodeType={}));t.isBaseNode=e=>e&&e.id&&e.inputs&&e.outputs;t.isCodeNode=e=>(0,t.isBaseNode)(e)&&"function"==typeof e.run;t.isVisualNode=e=>!!e.instances;t.isInlineValueNode=e=>(0,o.isDefined)(e)&&(0,o.isDefined)(e.runFnRawCode),t.visualNode=(0,o.testDataCreator)({id:"visual-node",inputs:{},outputs:{},instances:[],connections:[],outputsPosition:{},inputsPosition:{}}),t.codeNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},run:o.noop}),t.inlineValueNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},runFnRawCode:""});t.fromSimplified=e=>{let{run:t,inputTypes:n,outputTypes:i,id:s}=e;return{id:s,inputs:(0,o.entries)(n).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),outputs:(0,o.entries)(i).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),run:t}};t.maybeGetStaticValueNodeId=e=>{const t="string"==typeof e&&e.match(/^__node\:(.*)/);if(t){return t[1]}return null};t.getStaticValue=(e,n,o)=>{const i=(0,t.maybeGetStaticValueNodeId)(e);if(i){const e=n[i];if(!e)throw new Error(`Instance ${o} referrer to a node reference ${i} that does not exist`);return e}return e};t.getNode=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw new Error(`Node with id ${n} not found`);return o};t.getNodeDef=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw console.error(`Node with id ${n} not found`),new Error(`Node with id ${n} not found`);return o};t.codeFromFunction=e=>{let{id:t,fn:n,inputNames:o,outputName:i,defaultStyle:r}=e;return{id:t,inputs:o.reduce(((e,t)=>({...e,[t]:(0,s.nodeInput)()})),{}),outputs:{[i]:(0,s.nodeOutput)()},run:(e,t)=>{const s=o.map((t=>e[t])),r=t[i],a=n(...s);return Promise.resolve(a).then((e=>null==r?void 0:r.next(e)))},completionOutputs:[i],defaultStyle:r}}},44535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nodeFromSimpleFunction=void 0,t.nodeFromSimpleFunction=function(e){var t;return{...e,id:e.id,description:e.description,namespace:e.namespace,inputs:e.inputs?e.inputs.reduce(((e,t)=>{let{name:n,description:o,mode:i,defaultValue:s}=t;return{...e,[n]:{description:o,mode:null!=i?i:"required",defaultValue:s}}}),{}):{},outputs:e.output?{[e.output.name]:{description:e.output.description}}:{},defaultStyle:{icon:e.icon,size:e.size},run:null!==(t=e.fullRunFn)&&void 0!==t?t:async function(t,n,o){var i,s;const r=(null!==(i=e.inputs)&&void 0!==i?i:[]).map((e=>{let{name:n}=e;return t[n]}));try{const t=await Promise.resolve(e.run(...r));e.output&&(null===(s=n[e.output.name])||void 0===s||s.next(t))}catch(a){console.error("Error in node",a),o.onError(a)}},customViewCode:e.customViewCode}}},79426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticInputPinConfig=t.isStickyInputPinConfig=t.isQueueInputPinConfig=t.staticInputPinConfig=t.stickyInputPinConfig=t.queueInputPinConfig=t.INPUT_MODES=void 0,t.INPUT_MODES=["queue","sticky","static"];t.queueInputPinConfig=()=>({mode:"queue"});t.stickyInputPinConfig=()=>({mode:"sticky"});t.staticInputPinConfig=e=>({mode:"static",value:e});t.isQueueInputPinConfig=e=>"queue"===e.mode;t.isStickyInputPinConfig=e=>!!e&&"sticky"===e.mode,t.isStaticInputPinConfig=function(e){return!!e&&"static"===e.mode}},10418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedExecute=void 0;const o=n(74762),i=n(47025);t.simplifiedExecute=function(e,t,n,s,r){void 0===r&&(r={});const a=(0,o.keys)(e.outputs),u=Object.keys(n).reduce(((e,t)=>{const i=n[t];return{...e,[t]:(0,o.isDynamicInput)(i)?i:(0,o.staticNodeInput)(i)}}),{}),l=a.reduce(((e,t)=>{const n=(0,o.dynamicOutput)();return s&&n.subscribe((e=>{s(t,e)})),{...e,[t]:n}}),{});return(0,i.execute)({node:e,inputs:u,outputs:l,resolvedDeps:t,onBubbleError:e=>{throw e},...r})}},25779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodePreview=void 0;const o=n(35250),i=n(74762),s=n(86553);t.NodePreview=e=>{let{node:t}=e;const n={node:t,instance:(0,i.nodeInstance)("bob",t.id,{}),connections:[],viewPort:{pos:{x:0,y:0},zoom:1},resolvedDeps:{},connectionsPerInput:{},onUngroup:i.noop,onDblClick:i.noop,onDragEnd:i.noop,onDragMove:i.noop,onDragStart:i.noop,onPinClick:i.noop,onPinDblClick:i.noop,onSelect:i.noop,onTogglePinBreakpoint:i.noop,onTogglePinLog:i.noop,onToggleSticky:i.noop,displayMode:!0,onInspectPin:i.noop,onDetachConstValue:i.noop,onCopyConstValue:i.noop,onPasteConstValue:i.noop,ancestorsInsIds:"",onChangeVisibleInputs:i.noop,onChangeVisibleOutputs:i.noop,onConvertConstToEnv:i.noop,forceShowMinimized:"both",onExtractInlineNode:i.noop,onCloseInlineEditor:i.noop,isConnectedInstanceSelected:!1,inlineEditorPortalDomNode:null,onChangeStyle:i.noop,onDeleteInstance:i.noop,onGroupSelected:i.noop,onSetDisplayName:i.noop,hadError:!1,queuedInputsData:{},onPinMouseDown:i.noop,onPinMouseUp:i.noop};return(0,o.jsx)("div",{className:"node-preview",children:(0,o.jsx)(s.InstanceView,{...n})})}},30653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDarkMode=t.DarkModeProvider=void 0;const o=n(70079),i=(0,o.createContext)(!0);t.DarkModeProvider=i.Provider;t.useDarkMode=()=>(0,o.useContext)(i)},29183:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataInspectionModal=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=n(74089),p=n(83938),f=n(17102),m=n(98158);t.DataInspectionModal=e=>{var t;const{onRequestHistory:n}=(0,m.useDebuggerContext)(),{item:o}=e,[i,s]=c.default.useState(),[r,g]=c.default.useState(0),[v,h]=c.default.useState(""),[I,y]=c.default.useState(),[b]=(0,d.useDebounce)(v,300);(0,c.useEffect)((()=>{y(null==i?void 0:i.lastSamples.filter((e=>"object"==typeof e.val?JSON.stringify(e.val).includes(b):e.val.toString().includes(b)))),g(0)}),[null==i?void 0:i.lastSamples,b]),c.default.useEffect((()=>{!async function(){var e,t;const i=await n(o.insId,null===(e=o.pin)||void 0===e?void 0:e.id,null===(t=o.pin)||void 0===t?void 0:t.type);s(i)}()}),[o,n]);const C=e=>{const t=e.val;return"object"==typeof t?(0,a.jsx)(p.BrowserOnlyReactJson,{src:t}):(0,a.jsx)(u.Code,{children:t.toString()})},_=`"${o.insId}" ${(null===(t=o.pin)||void 0===t?void 0:t.id)?`(${o.pin.id})`:""}`;return(0,a.jsx)(u.Dialog,{isOpen:!0,title:`Inspecting data for instance ${_}`,onClose:e.onClose,canEscapeKeyClose:!1,className:"data-inspection-modal",children:(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{children:[i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("em",{children:[_," called ",i.total," time(s)"]}),i.total>10&&(0,a.jsx)("span",{children:"Showing last 10 samples"})]}):null,(0,a.jsx)("input",{className:"bp5-input bp5-small bp5-fill",type:"search",placeholder:"Search for values",dir:"auto",onChange:e=>h(e.target.value),value:v}),b.length>0&&(0,a.jsxs)("span",{children:["Showing ",null==I?void 0:I.length," of ",i.lastSamples.length," ",'samples matching query "',b,'"']})]}),(0,a.jsx)("main",{className:"main-wrapper",children:(()=>{if(!i)return(0,a.jsx)(f.Loader,{});if(0===i.total)return(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",(0,a.jsx)("em",{children:o.insId})," ",o.pin?(0,a.jsxs)(c.default.Fragment,{children:["and pin ",(0,a.jsx)("em",{children:o.pin.id})]}):null,". Make sure debugger is running and your program was triggered."]});const e=null==I?void 0:I[r];return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Card,{className:"content-wrapper",children:[e?(0,a.jsxs)("div",{className:"info",children:[(0,a.jsxs)("div",{children:["Showing sample ",r," of event from"," ",(0,a.jsx)("strong",{children:(0,d.timeAgo)(e.time)})," (",new Date(e.time).toLocaleString(),")"]}),(0,a.jsxs)("div",{children:["Instance: ",(0,a.jsx)("strong",{children:e.insId}),", Pin id:"," ",(0,a.jsx)("strong",{children:e.pinId})," "]}),(0,a.jsx)("div",{children:"Value:"})]}):null,C(e)]}),(0,a.jsx)(u.Menu,{className:"samples-menu",children:I.map(((e,t)=>{const n=e.pinId,o=`${i.total-t}. from pin "${n}"`;return(0,a.jsx)(u.MenuItem,{text:o,onClick:()=>g(t)},t)}))})]}):i.lastSamples.length>0&&v.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",children:['No data found for search query "',v,'"']}):(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",o.insId," ",o.pin?`and ${o.pin.id}`:"",". Make sure a debugger is connected and your program was triggered."]})})()})]})})})}},40471:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29183),t)},98158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebuggerContext=t.DebuggerContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({onRequestHistory:()=>Promise.reject(new Error("Not implemented"))});t.DebuggerContextProvider=i.Provider;t.useDebuggerContext=()=>(0,o.useContext)(i)},86125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDependenciesContext=t.DependenciesContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({resolvedDependencies:{},onImportNode:()=>Promise.reject(new Error("Not implemented")),onRequestImportables:()=>Promise.reject(new Error("Not implemented"))});t.DependenciesContextProvider=i.Provider;t.useDependenciesContext=()=>(0,o.useContext)(i)},97106:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FlowEditor=void 0;const u=n(35250),l=s(n(70079)),c=n(74762),d=n(63521),p=a(n(53865)),f=n(68120),m=n(7047),g=n(84472),v=n(82232),h=n(49283),I=n(43490),y=n(68840),b=n(78087),C=n(20079),_=n(60190),x=n(40471),N=n(98158),j=n(86125),w=n(30653),P=n(77852);r(n(43490),t),r(n(98158),t),r(n(86125),t),y.library.add(b.fab,C.fas);const O=["select","drag-move","order-step"];t.FlowEditor=l.memo(l.forwardRef(((e,t)=>{const{state:n,onChangeEditorState:o}=e,{resolvedDependencies:i,onImportNode:s}=(0,j.useDependenciesContext)(),[r,a]=l.useState([]),[y,b]=l.useState([]),{flow:C,boardData:E}=n,D=n.flow.node,[S,M]=l.useState({}),[k,T]=l.useState(new Set),{debuggerClient:A}=(0,N.useDebuggerContext)();l.useEffect((()=>{if(A)return A.onBatchedEvents((e=>{e.forEach((e=>{e.type===c.DebuggerEventType.INPUTS_STATE_CHANGE&&(console.log("INPUTS_STATE_CHANGE",e.insId,e.val),M((t=>({...t,[e.insId]:e.val})))),e.type===c.DebuggerEventType.ERROR&&T((t=>{const n=new Set(t);return n.add(e.insId),n}))}))}))}),[A]);const{openFile:R,reportEvent:V}=(0,I.usePorts)(),z=l.useCallback(((e,t)=>{console.info("onChangeFlow",t.type),"functional"===t.type&&(a([{flow:{...n.flow,...e}},...r.slice(0,50)]),b([])),o((t=>({...t,flow:{...t.flow,...e}})))}),[o,n.flow,r]),[$,H]=l.useState({instances:[],connections:[]}),[G,L]=l.useState(!1),F=l.useCallback((()=>L(!1)),[]),B=l.useCallback((()=>L(!0)),[]),U=l.useCallback((e=>{o((t=>({...t,boardData:{...t.boardData,...e}})))}),[o]);l.useEffect((()=>{U({selected:[],viewPort:d.defaultViewPort,from:void 0,to:void 0,lastMousePos:{x:0,y:0}})}),[D.id]),(0,f.useHotkeys)("cmd+z",(e=>{b([...y,n]);const[t,...i]=r;t&&(o((e=>({...e,...t}))),a(i)),e.preventDefault()}),{text:"Undo last change",group:"Editing"},[n,r,y]);const q=l.useCallback(((e,t)=>{O.some((e=>t.message.includes(e)))||b([]),z({node:e},t)}),[z]),W=l.useCallback((e=>{R({absPath:e.source.path})}),[R]),Z=l.useCallback((function(e,t){void 0===t&&(t=-1*d.NODE_HEIGHT*1.5);const n=(0,m.createNewNodeInstance)(e,t,E.lastMousePos,i);if(n){const e=(0,p.default)(C,(e=>{const t=e.node;if(!(0,c.isVisualNode)(t))throw new Error("Impossible state, adding node to non visual node");t.instances.push(n)}));return z(e,(0,v.functionalChange)("add-node")),F(),n}}),[E.lastMousePos,C,z,F,i]),J=l.useCallback((async e=>{switch(e.type){case h.OmniBarCmdType.ADD:return V("addNode",{nodeId:e.data,source:"omnibar"}),Z(e.data);case h.OmniBarCmdType.ADD_VALUE:{const e=t.current;null==e||e.requestNewInlineValue();break}case h.OmniBarCmdType.IMPORT:{await s(e.data,{pos:E.lastMousePos});const t=(0,_.vAdd)({x:0,y:0},E.lastMousePos),n=(0,m.createNewNodeInstance)(e.data.node,0,t,i),o=(0,p.default)(C,(e=>{e.node.instances.push(n)}));z(o,(0,v.functionalChange)("add-imported-node")),V("addNode",{nodeId:e.data.node.id,source:"omnibar"});break}default:g.AppToaster.show({intent:"warning",message:"Not supported yet"})}F()}),[F,V,Z,t,s,E.lastMousePos,i,C,z]),[Y,K]=l.useState(),X=l.useCallback((()=>K(void 0)),[]),Q=l.useCallback(((e,t)=>{K({insId:e,pin:t})}),[]),{isDarkMode:ee}=(0,P.useDarkMode)();return(0,u.jsx)("div",{className:"flyde-flow-editor",children:(()=>{var n;if((0,c.isInlineValueNode)(D))throw new Error("Impossible state");return(0,u.jsx)(w.DarkModeProvider,{value:null!==(n=e.darkMode)&&void 0!==n?n:ee,children:(0,u.jsxs)(l.Fragment,{children:[Y?(0,u.jsx)(x.DataInspectionModal,{item:Y,onClose:X}):null,(0,u.jsx)(d.VisualNodeEditor,{currentInsId:c.ROOT_INS_ID,ref:t,boardData:E,onChangeBoardData:U,node:D,onGoToNodeDef:W,onChangeNode:q,resolvedDependencies:i,clipboardData:$,onCopy:H,nodeIoEditable:!D.id.startsWith("Trigger"),onInspectPin:Q,onShowOmnibar:B,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:S,initialPadding:e.initialPadding,instancesWithErrors:k,disableScrolling:e.disableScrolling},D.id),G?(0,u.jsx)(h.Omnibar,{flow:C,resolvedNodes:i,onCommand:J,visible:G,onClose:F}):null]})})})()})})))},9001:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeEditor=t.renderCreateIOOption=void 0;const i=n(35250),s=o(n(70079)),r=n(74762),a=n(50382),u=o(n(53865)),l=n(70457),c=n(25779);t.renderCreateIOOption=(e,t,n)=>(0,i.jsx)(a.MenuItem,{icon:"add",text:`Create "${e}"`,active:t,onClick:n,shouldDismissPopover:!1});const d=l.MultiSelect.ofType();t.BaseNodeEditor=e=>{var n,o;const{node:l,onChange:p}=e,f=(0,r.entries)(l.inputs),m=f.filter((e=>{let[,t]=e;return"required"===t.mode})).map((e=>{let[t]=e;return t})),g=f.filter((e=>{let[,t]=e;return"optional"===t.mode})).map((e=>{let[t]=e;return t})),v=f.filter((e=>{let[,t]=e;return"required-if-connected"===t.mode})).map((e=>{let[t]=e;return t})),[h,I]=s.default.useState(!1),y=(0,r.okeys)(l.outputs),b=s.default.useCallback((e=>{p({...l,id:e})}),[l,p]),C=s.default.useCallback((e=>{let t=e?e.split(","):void 0;"[]"===e&&(t=[]),p({...l,completionOutputs:t})}),[l,p]),_=s.default.useCallback((e=>{let t=e?e.split(","):void 0;p({...l,reactiveInputs:t})}),[l,p]),x=s.default.useCallback(((e,t)=>{const n=(0,u.default)(l,(n=>{n.inputs[e]=(0,r.nodeInput)(t)}));p(n)}),[l,p]),N=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.inputs[e]}));p(t)}),[l,p]),j=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{t.outputs[e]=(0,r.nodeOutput)()}));p(t)}),[l,p]),w=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.outputs[e]}));p(t)}),[l,p]);return(0,i.jsxs)("div",{className:"base-node-editor",children:[(0,i.jsx)("div",{className:"form-row",children:(0,i.jsx)(a.FormGroup,{label:"Node Name",labelFor:"text-input",labelInfo:"(required)",children:(0,i.jsx)(a.InputGroup,{id:"node-name",disabled:e.idDisabled,placeholder:"Node ID",value:l.id,onChange:e=>b(e.target.value)})})}),(0,i.jsx)(a.FormGroup,{label:"Required Inputs",children:(0,i.jsx)(d,{selectedItems:m,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),!0!==e.hiddenOutputs?(0,i.jsx)(a.FormGroup,{label:"Outputs",children:(0,i.jsx)(d,{selectedItems:y,placeholder:"Enter output names here",items:[],tagRenderer:e=>e,onItemSelect:j,onRemove:w,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}):null,(0,i.jsx)(a.Checkbox,{checked:h,onChange:e=>I(e.target.checked),children:"Show advanced options"}),(0,i.jsxs)(a.Collapse,{isOpen:h,children:[(0,i.jsx)(a.FormGroup,{label:"Optional Inputs",children:(0,i.jsx)(d,{selectedItems:g,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"optional"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Required-if-connected Inputs",children:(0,i.jsx)(d,{selectedItems:v,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required-if-connected"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Completion Outputs",children:(0,i.jsx)(a.InputGroup,{id:"completion-outputs",placeholder:"completion outputs",value:(null===(n=l.completionOutputs)||void 0===n?void 0:n.join(","))||"",onChange:e=>C(e.target.value)})}),(0,i.jsx)(a.FormGroup,{label:"Reactive Inputs",children:(0,i.jsx)(a.InputGroup,{id:"reactive-inputs",placeholder:"Reactive inputs",value:(null===(o=l.reactiveInputs)||void 0===o?void 0:o.join(","))||"",onChange:e=>_(e.target.value)})})]}),(0,i.jsx)(a.FormGroup,{label:"Preview",children:(0,i.jsx)("div",{className:"preview-wrapper",children:(0,i.jsx)(c.NodePreview,{node:l})})})]})}},82232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metaChange=t.functionalChange=void 0;t.functionalChange=e=>({type:"functional",message:e});t.metaChange=function(e){return void 0===e&&(e="n/a"),{type:"meta",message:e}}},41032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safelyGetNodeDef=t.loadingDef=void 0;const o=n(74762);t.loadingDef={id:"Loading",inputs:{},outputs:{}};t.safelyGetNodeDef=(e,n)=>{try{return(0,o.getNodeDef)(e,n)}catch(i){const n="string"==typeof e?e:e.nodeId;return{...t.loadingDef,id:n}}}},72125:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCodeModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(68371),f=n(74762),m=n(31745),g="`Result is ${inputs.a + inputs.b}`";t.InlineCodeModal=u.memo((function(e){const{initialValue:t,initialType:n}=e,[o,i]=u.useState((0,f.isDefined)(t)?t:g),[s,r]=u.useState(n||f.InlineValueNodeType.VALUE),v=(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:['You can add variables to by referrencing the "inputs" object.',(0,a.jsx)("br",{})," For example:",(0,a.jsx)(c.Code,{children:"`Hello {inputs.name}`"}),' will expose an input pin named "name"']}),(0,a.jsxs)("p",{children:["You can also use ternery expressions, arithmetic operators and more!",(0,a.jsx)("br",{}),"For example:",(0,a.jsx)(c.Code,{children:"inputs.a > inputs.b ? inputs.a + 42 : Math.random() * inputs.b"})]})]}),h=(0,a.jsxs)("span",{children:["Type in any valid JS value, such as ",(0,a.jsx)(c.Code,{children:"true"}),", ",(0,a.jsx)(c.Code,{children:"42"}),","," ",(0,a.jsx)(c.Code,{children:'["bob", "alice", "dave"]'}),".",(0,a.jsx)("br",{})," Dynamic inputs may also be used"]}),I=(0,a.jsxs)("span",{children:["Write any JS code and return a value.",(0,a.jsx)("br",{})," The returned value will be the output.",(0,a.jsx)("br",{})," Example:",(0,a.jsx)(c.Code,{children:"const a = inputs.a; const b = inputs.b; return Math.floor(a/b);"})]}),y=(0,p.getVariables)(o);return u.useEffect((()=>{o===g&&s===f.InlineValueNodeType.FUNCTION&&i(`return ${g}`),o===`return ${g}`&&s===f.InlineValueNodeType.VALUE&&i(g)}),[o,s]),(0,a.jsxs)(c.Dialog,{isOpen:!0,title:"Inline Value / Code",onClose:e.onCancel,className:"inline-code-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:t=>{"Enter"===t.key&&t.metaKey&&e.onSubmit(s,o)},tabIndex:0,children:[(0,a.jsxs)(c.RadioGroup,{inline:!0,onChange:e=>r(e.target.value),selectedValue:s,children:[(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Value ",(0,a.jsx)(m.InfoTooltip,{content:h})]}),value:f.InlineValueNodeType.VALUE}),(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Function ",(0,a.jsx)(m.InfoTooltip,{content:I})]}),value:f.InlineValueNodeType.FUNCTION})]}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"javascript",value:o,onChange:e=>i(e||""),onMount:e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})}}),(()=>{const e=o.includes("return");return e&&s===f.InlineValueNodeType.VALUE?(0,a.jsx)(c.Callout,{intent:c.Intent.WARNING,children:'When using the "value" type you are not expected to return anything'}):e||s!==f.InlineValueNodeType.FUNCTION?null:(0,a.jsxs)(c.Callout,{intent:c.Intent.DANGER,children:['When using the "function" type you are expected to'," ",(0,a.jsx)(c.Code,{children:"return"})," a value.",(0,a.jsx)("br",{}),"Example: ",(0,a.jsx)(c.Code,{children:"return 42 + Date.now();"})]})})(),(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Input pins detected:"," ",y.length?y.map((e=>(0,a.jsx)(c.Code,{children:e},e))):"None",(0,a.jsx)(m.InfoTooltip,{content:v})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:e.onCancel,children:"Cancel"}),(0,a.jsx)(c.Button,{onClick:()=>e.onSubmit(s,o),intent:c.Intent.PRIMARY,className:"save-btn",children:"Save"})]})})]})}))},18594:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(72125),t)},68371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInlineValueNode=t.getVariables=void 0;const o=n(74762),i=n(74762);t.getVariables=e=>(e.match(/inputs\.([a-zA-Z]\w*)/g)||[]).map((e=>e.replace(/inputs\./,"")));t.createInlineValueNode=e=>{let{code:n,customView:s,nodeId:r,type:a}=e;const u=(0,t.getVariables)(n).reduce(((e,t)=>({...e,[t]:(0,o.nodeInput)()})),{}),l={value:(0,o.nodeOutput)()},c=a===o.InlineValueNodeType.FUNCTION?`const result = (function() { ${n}}());\n Promise.resolve(result).then(val => outputs.value.next(val))`:`const result = (${n}); Promise.resolve(result).then(val => outputs.value.next(val))`,d=btoa(n);return(0,i.inlineValueNode)({id:r||`Inline Code ${(0,o.randomInt)(99999)}`,inputs:u,outputs:l,runFnRawCode:c,customViewCode:s||n,dataBuilderSource:d,templateType:a,completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline "+(a===o.InlineValueNodeType.VALUE?"value":"function")})}},49283:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Omnibar=t.OmniBarCmdType=void 0;const a=n(35250),u=s(n(70079)),l=n(70457),c=n(74762),d=n(50382),p=r(n(26372));var f;!function(e){e.ADD="add",e.ADD_VALUE="add-value",e.IMPORT="import"}(f=t.OmniBarCmdType||(t.OmniBarCmdType={}));const m=[];t.Omnibar=e=>{const{resolvedNodes:t}=e,[n,o]=u.useState(""),[i,s]=u.useState(null),[r,g]=u.useState([]);u.useEffect((()=>{const e=(0,c.keys)(t).map((e=>({title:`${t[e].id}`,cmd:{type:f.ADD,data:e},extra:"current flow"}))),n=r.map((e=>({title:`${e.node.id}`,description:e.node.description,cmd:{type:f.IMPORT,data:e},extra:`${e.module}`}))),o={title:"Add inline value or code",suggestOnEmpty:!0,cmd:{type:f.ADD_VALUE}},i=[...m,...n,o,...e];s(i)}),[t,r]),u.useEffect((()=>{e.onRequestImportables&&e.onRequestImportables(n).then((e=>{g(e)}))}),[e,n]);const v=u.useCallback(((e,t)=>{let{handleClick:n,modifiers:o,query:i,index:s}=t;if(!o.matchesPredicate)return null;const r=`${e.title}`;return(0,a.jsx)(d.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,a.jsxs)("div",{className:(0,p.default)("omnibar-item",{active:o.active}),children:[(0,a.jsxs)("div",{className:"title",children:[r," ",e.extra?(0,a.jsx)("span",{className:"extra",children:e.extra}):null]}),e.description?(0,a.jsx)("div",{className:"description",children:e.description}):null]})},s)}),[]),h=u.useCallback(((e,t)=>{const n=e.toLowerCase().split("").map((e=>{return`${t=e,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*`;var t})).join(""),o=new RegExp(n);return!!t.title.toLowerCase().match(o)}),[]),I=u.useCallback((t=>{e.onCommand(t.cmd),e.onClose()}),[e]);return i?(0,a.jsx)(l.Omnibar,{query:n,onQueryChange:o,onClose:e.onClose,noResults:(0,a.jsx)(d.MenuItem,{disabled:!0,text:"No results."}),itemPredicate:h,isOpen:e.visible,items:i,initialContent:void 0,onItemSelect:I,itemRenderer:v,inputProps:{placeholder:"Search for nodes or commands.."}}):null}},60698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43490:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31874),t)},31874:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.usePorts=t.useConfirm=t.usePrompt=t.PortsContext=t.defaultPorts=void 0;const s=n(70079),r=n(74762),a=n(84472);i(n(60698),t);const u=e=>async()=>{console.warn(`${e} Not implemented`),(0,a.toastMsg)("Feature not implemented in this context yet","warning")};t.defaultPorts={prompt:async e=>{let{text:t,defaultValue:n}=e;return prompt(`${t}`,n)},openFile:async e=>{},confirm:async e=>{let{text:t}=e;return confirm(t)},readFlow:u("readFlow"),setFlow:u("setFlow"),resolveDeps:u("resolveDeps"),getImportables:u("getImportables"),onExternalFlowChange:u("onExternalFlowChange"),onInstallRuntimeRequest:u("onInstallRuntimeRequest"),onRunFlow:u("onRunFlow"),onStopFlow:u("onStopFlow"),reportEvent:r.noop,generateNodeFromPrompt:u("generateNodeFromPrompt"),hasOpenAiToken:()=>Promise.resolve(!1)},t.PortsContext=(0,s.createContext)(t.defaultPorts);t.usePrompt=()=>{const e=(0,s.useContext)(t.PortsContext).prompt;return(t,n)=>e({text:t,defaultValue:n})};t.useConfirm=()=>{const e=(0,s.useContext)(t.PortsContext).confirm;return t=>e({text:t})};t.usePorts=()=>(0,s.useContext)(t.PortsContext)},65758:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelected=void 0;const i=n(74762),s=o(n(53865)),r=n(22513);t.groupSelected=async(e,t,n,o,a)=>{const{instances:u,connections:l}=t,c=u.filter((t=>e.includes(t.id))),d=l.filter((t=>{let{from:n,to:o}=t;return-1!==e.indexOf(n.insId)||-1!==e.indexOf(o.insId)}));if(!c.length)throw new Error("visual without selections");const{visualNode:p,renamedInputs:f,renamedOutputs:m}=await(0,r.createGroup)(c,d,n,a),g=c.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),u[0].pos),v="ref"===o?(0,i.nodeInstance)((0,i.createInsId)(p),p.id,{},g):(0,i.inlineNodeInstance)((0,i.createInsId)(p),p,{},g),h=u.filter((t=>-1===e.indexOf(t.id))),I=l.map((e=>{const t=`${e.from.insId}.${e.from.pinId}`,n=`${e.to.insId}.${e.to.pinId}`;return f[n]?{...e,to:{insId:v.id,pinId:f[n]}}:m[t]?{...e,from:{insId:v.id,pinId:m[t]}}:e})).filter((t=>-1===e.indexOf(t.from.insId)&&-1===e.indexOf(t.to.insId)));return{newNode:p,currentNode:(0,s.default)(t,(e=>{e.instances=[...h,v],e.connections=I}))}}},74089:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(97106),t),i(n(18420),t),i(n(90680),t),i(n(84472),t),i(n(17102),t),i(n(82232),t),i(n(25779),t),i(n(25804),t),i(n(9958),t),i(n(68120),t),i(n(94651),t),i(n(73470),t),i(n(94007),t),i(n(60190),t),i(n(9001),t),i(n(7047),t),i(n(23386),t)},31745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoTooltip=void 0;const o=n(35250),i=n(50382),s=n(50382),r=n(44470),a=n(50382);t.InfoTooltip=e=>{const{content:t}=e;return(0,o.jsx)(s.Tooltip,{content:t,placement:"top",className:"info-tooltip",children:(0,o.jsx)(i.Icon,{icon:(0,o.jsx)(r.InfoSign,{className:a.Classes.INTENT_PRIMARY}),intent:i.Intent.SUCCESS,className:"info-tooltip-icon"})})}},83938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserOnlyReactJson=void 0;const o=n(35250);t.BrowserOnlyReactJson=e=>{if("undefined"==typeof window)return null;const t=n(73541).Z;return(0,o.jsx)(t,{...e})}},94651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsValueRenderer=void 0;const o=n(35250),i=n(74762),s=n(83938);t.AnalyticsValueRenderer=e=>{let{val:t}=e;try{const e=JSON.parse(t),n="object"==typeof e?e:{value:e},r=e&&[e.type,e.key,e.props,e.ref].every(i.isDefined),a=r?{jsxValue:e}:n;return(0,o.jsx)(s.BrowserOnlyReactJson,{src:a,collapseStringsAfterLength:50,collapsed:r})}catch(n){return(0,o.jsx)(s.BrowserOnlyReactJson,{src:{value:t},collapseStringsAfterLength:50})}}},22513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=void 0;const o=n(74762),i=n(74762),s=n(60190),r=n(88593);t.createGroup=async(e,t,n,a)=>{if(0===e.length)throw new Error("cannot create group without instances");const u=e.map((e=>e.id)),l=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return!t&&n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.to,e.to)))===t)),c=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return t&&!n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.from,e.from)))===t));let d={},p={},f={},m={};const g=[],v={};for(const o of l){const e=`${o.to.insId}.${o.to.pinId}`,t=`${o.from.insId}.${o.from.pinId}`,n=o.to.pinId;if(f[t]){g.push({from:(0,i.externalConnectionNode)(f[t]),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)});continue}const r=v[n]?await a(`Name this input (${n} of ${o.to.insId}) is already taken:`)||`i${(0,s.rnd)()}`:n;d[e]=r,f[t]=r,g.push({from:(0,i.externalConnectionNode)(r),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)}),v[r]=(0,i.nodeInput)()}const h={};for(const r of c){const e=`${r.to.insId}.${r.to.pinId}`,t=`${r.from.insId}.${r.from.pinId}`,n=r.from.pinId;if(m[e]){g.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(m[e])});continue}const u=h[n]?await a(`Name this output (${n} of ${r.from.insId} is already taken:`)||`i${(0,s.rnd)()}`:n;p[t]=u,m[e]=u,g.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(u)}),h[u]=(0,o.nodeOutput)()}e.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),e[0].pos);const I=t.filter((e=>u.includes(e.from.insId)&&u.includes(e.to.insId)));return{visualNode:{id:n,inputs:v,outputs:h,instances:e,defaultStyle:{size:"large",color:(0,o.pickRandom)(r.nodeStylePresetColors.map((e=>e.color)))},inputsPosition:(0,o.okeys)(v).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:0}})),{}),outputsPosition:(0,o.okeys)(h).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:400}})),{}),connections:[...I,...g],completionOutputs:(0,o.okeys)(h)},renamedInputs:d,renamedOutputs:p}}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightText=void 0;const o=n(35250);function i(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}t.highlightText=(e,t)=>{let n=0;const s=t.split(/\s+/).filter((e=>e.length>0)).map(i);if(0===s.length)return[e];const r=new RegExp(s.join("|"),"gi"),a=[];for(;;){const t=r.exec(e);if(!t)break;const i=t[0].length,s=e.slice(n,r.lastIndex-i);s.length>0&&a.push(s),n=r.lastIndex,a.push((0,o.jsx)("strong",{children:t[0]},n))}const u=e.slice(n);return u.length>0&&a.push(u),a}},17102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Loader=void 0;const o=n(35250);t.Loader=()=>(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)("svg",{width:"38",height:"38",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:"#007ec6",children:(0,o.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,o.jsxs)("g",{transform:"translate(1 1)",strokeWidth:"2",children:[(0,o.jsx)("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),(0,o.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:(0,o.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})})})},23386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;const o=n(74762);t.logger=(0,o.debugLogger)("editor")},561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadMonaco=void 0;const o=n(51848),i=n(23386);let s=!1;t.preloadMonaco=()=>{s||o.loader.init().then((()=>{(0,i.logger)("monaco preloaded"),s=!0}))}},68120:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHotkeys=t.currentHotkeys=void 0;const i=o(n(45240)),s=n(70079);t.currentHotkeys=new Map,t.useHotkeys=function(e,n,o,r,a){void 0===r&&(r=[]);const u=(0,s.useCallback)((function(){a&&!a.current||n(...arguments)}),[...r,n]);(0,s.useEffect)((()=>((0,i.default)(e,{},u),t.currentHotkeys.set(e,o),()=>{t.currentHotkeys.delete(e),i.default.unbind(e,u)})),[e,u,o])}},94007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeSessionStorage=t.safeLocalStorage=void 0,t.safeLocalStorage={getItem:function(){try{return localStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return localStorage.setItem(...arguments)}catch(e){return null}}},t.safeSessionStorage={getItem:function(){try{return sessionStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return sessionStorage.setItem(...arguments)}catch(e){return null}}}},90680:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocalStorage=t.useResizePref=t.userPreferences=t.useUserPref=void 0;const r=s(n(70079)),a=n(18420),u=n(94007);t.useUserPref=(e,n)=>{const[o,i]=r.useState((()=>{const o=t.userPreferences.getItem(e);return(0,a.isDefined)(o)?o:n}));r.useEffect((()=>{const o=t.userPreferences.getItem(e),s=(0,a.isDefined)(o)?o:n;i(s)}),[e]);return[o,n=>{t.userPreferences.setItem(e,n),i(n)}]},t.userPreferences=(()=>{const e=e=>`up.${e}`;return{getItem:t=>{const n=u.safeLocalStorage.getItem(e(t))||"",o=u.safeSessionStorage.getItem(e(t))||"";try{return JSON.parse(o||n).value}catch(i){return}},setItem:function(t,n,o){void 0===o&&(o=!1);const i=o?sessionStorage:u.safeLocalStorage;try{const o=JSON.stringify({value:n});return i.setItem(e(t),o),!0}catch(s){return console.error("Error saving user preference",s),!1}}}})();t.useResizePref=(e,n)=>{const o=`resize.${e}`;return(0,t.useUserPref)(o,n)};const l=e=>{const t=u.safeLocalStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch(n){return null}};t.useLocalStorage=(e,t)=>{const[n,o]=r.useState(l(e)||t),i=r.useCallback((t=>{u.safeLocalStorage.setItem(e,JSON.stringify({value:t})),o(t)}),[e]);return r.useEffect((()=>{l(e)||u.safeLocalStorage.setItem(e,JSON.stringify({value:t}))}),[e,t,i]),[n,i]}},60190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.totalEnergy=t.itrPhysics=t.hookes=t.coulombs=t.vToStr=t.vNorm=t.vLen=t.vSub=t.vAdd=t.vDiv=t.vMul=t.vZero=t.rnd=t.vec=t.size=void 0;t.size=(e,t)=>({width:e,height:t});t.vec=(e,t)=>({x:e,y:t});t.rnd=function(e,t){return void 0===e&&(e=100),void 0===t&&(t=0),Math.floor(Math.random()*(e-t))+t},t.vZero={x:0,y:0};t.vMul=(e,t)=>{let{x:n,y:o}=e;return{x:n*t,y:o*t}};t.vDiv=(e,n)=>{let{x:o,y:i}=e;return(0,t.vMul)({x:o,y:i},1/n)};t.vAdd=(e,t)=>({x:e.x+t.x,y:e.y+t.y});t.vSub=(e,n)=>(0,t.vAdd)(e,(0,t.vMul)(n,-1));t.vLen=e=>{let{x:t,y:n}=e;return Math.sqrt(t*t+n*n)};t.vNorm=e=>(0,t.vDiv)(e,(0,t.vLen)(e)||1);t.vToStr=e=>{let{x:t,y:n}=e;return`${t.toFixed(1)},${n.toFixed(1)}`};t.coulombs=(e,n,o)=>{const i=(0,t.vLen)((0,t.vSub)(e.p,n.p));if(0===i){const i=(0,t.vec)(2*Math.random()-1,2*Math.random()-1),s=e.m*n.m/Math.pow(10,2);return(0,t.vMul)(i,s*o)}{const s=(0,t.vNorm)((0,t.vSub)(n.p,e.p)),r=e.m*n.m/Math.pow(i+.1,2);return(0,t.vMul)(s,r*o)}};t.hookes=(e,n,o,i,s)=>{const r=(0,t.vLen)((0,t.vSub)(e.p,n.p)),a=(0,t.vNorm)((0,t.vSub)(e.p,n.p));let u=0;return ri&&(u=i-r),(0,t.vMul)(a,s*u)};t.itrPhysics=(e,n)=>{const{p:o,v:i,f:s,m:r}=n,a=(0,t.vDiv)(s,r),u=e/1e3,l=(0,t.vAdd)((0,t.vMul)(a,u),i),c=(0,t.vAdd)((0,t.vMul)(l,u),o);return{...n,p:c,v:l,f:(0,t.vec)(0,0)}};t.totalEnergy=e=>e.reduce(((e,n)=>{const o=(0,t.vLen)(n.v);return e+.5*n.m*o*o}),0)},84472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateToast=t.toastMsg=t.AppToaster=void 0;const o=n(50382);t.AppToaster=(()=>{try{return o.OverlayToaster.create({className:"app-toaster",position:o.Position.BOTTOM_RIGHT})}catch(e){return{}}})();t.toastMsg=(e,n,o)=>t.AppToaster.show({message:e,intent:n,timeout:o});t.updateToast=(e,n,o)=>t.AppToaster.show({message:n,intent:o},e)},18420:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultAnd=t.isLocal=t.fullTime=t.timeAgoFromDt=t.timeAgo=t.toString=t.isDefined=t.set=t.createOmap=t.toOmap=t.values=t.keys=t.entries=void 0;const i=n(7047),s=n(74762),r=o(n(73136));t.entries=e=>Object.keys(e).map((t=>[t,e[t]]));t.keys=e=>Object.keys(e);t.values=e=>Object.keys(e).map((t=>e[t]));t.toOmap=e=>Array.from(e.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.createOmap=function(e){return void 0===e&&(e=[]),e.reduce(((e,t)=>({...e,[t[0]]:t[1]})),{})};t.set=(e,t,n)=>{e[t]=n};t.isDefined=e=>void 0!==e;t.toString=e=>{const t=typeof e;if(""===e)return"(empty string)";if((0,i.isJsxValue)(e))return"JSX Value";if((0,s.isStaticValueVisualNode)(e))return"Embedded Node";if((0,s.isEnvValue)(e))return(0,s.getEnvKeyFromValue)(e);if("object"===t)try{const t=JSON.stringify(e);return"{}"===t?"Empty object":t}catch(n){return"Object (cannot stringify)"}return`${e}`};t.timeAgo=e=>(0,r.default)(new Date(e)).fromNow();t.timeAgoFromDt=e=>(0,r.default)(Date.now()-e).fromNow();t.fullTime=e=>(0,r.default)(new Date(e)).toString();t.isLocal=()=>location.href.includes(":300");t.preventDefaultAnd=e=>t=>{t.preventDefault(),e(t)}},67181:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ActionButton=t.ActionsMenu=t.ActionType=void 0;const r=n(35250),a=n(50382),u=n(50382),l=n(74762),c=s(n(70079)),d=n(86125),p=n(43490),f=n(68120),m=n(90680),g=n(84472),v=n(9971),h=n(47749),I=n(46334),y=n(47230),b=n(41032);var C;!function(e){e.AddNode="add-node",e.RemoveNode="remove-node",e.Group="group",e.UnGroup="un-group",e.AddInlineValue="add-inline-value",e.Inspect="inspect",e.Run="run",e.AI="ai"}(C=t.ActionType||(t.ActionType={}));t.ActionsMenu=e=>{const{onAction:n,selectedInstances:o,resolvedNodes:i,node:s,from:u,to:h,hotkeysEnabled:x,showRunFlowOptions:N}=e,{onRequestImportables:j}=(0,d.useDependenciesContext)(),[w,P]=c.default.useState(!1),[O,E]=c.default.useState(!1),[D,S]=c.default.useState(!1),[M,k]=c.default.useState(null),[T,A]=(0,m.useLocalStorage)("hideHotkeyHintMap",{}),R=(0,c.useCallback)((()=>{P(!1)}),[]),{onRunFlow:V,generateNodeFromPrompt:z,reportEvent:$}=(0,p.usePorts)(),H=(0,c.useCallback)(((e,t)=>(E(!1),V(e,t))),[V]),G=[];if(G.push(C.AddNode),G.push(C.AddInlineValue),1===o.length){const e=s.instances.find((e=>e.id===o[0]));if(e)try{const t=(0,b.safelyGetNodeDef)(e,i);(0,l.isVisualNode)(t)&&G.push(C.UnGroup)}catch(q){console.error(`Could not find node with id ${o[0]} - ${q}`)}else console.error(`Could not find instance with id ${o[0]}`)}N&&G.push(C.Run),o.length>0&&G.push(C.Group),(1===o.length||u||h)&&G.push(C.Inspect),o.length>0&&G.push(C.RemoveNode),G.push(C.AI);const L=(0,c.useCallback)(((e,t)=>{A({...T,[e]:!0}),g.AppToaster.dismiss(t)}),[T,A]),F=(0,c.useCallback)(((e,t)=>{const{hotkey:o}=_[e];if("click"===t.type&&o&&!T[o]){const t=(0,g.toastMsg)((0,r.jsxs)(r.Fragment,{children:["Did you know? you can also use the hotkey"," ",(0,r.jsx)("kbd",{className:"hotkey",children:o})," to"," ",_[e].text.replace(/^[A-Z]/,(e=>e.toLowerCase())),(0,r.jsxs)(a.Button,{minimal:!0,small:!0,onClick:()=>L(o,t),children:[" ","Don't show again"," "]})]}),"none",3e3)}switch(e){case C.AddNode:P(!0);break;case C.Run:!async function(){E(!0)}();break;case C.AI:S(!0);break;default:n({type:e,data:void 0})}}),[T,n,L,s.inputs]);Object.entries(_).forEach((e=>{let[t,n]=e;n.hotkey&&(0,f.useHotkeys)(n.hotkey,(e=>{e.preventDefault(),G.includes(t)&&(F(t,e),A({...T,[n.hotkey]:!0}))}),{text:n.text,group:"Action menu hotkeys"},[G],x)}));const B=(0,c.useCallback)((e=>{n({type:C.AddNode,data:{importableNode:e}})}),[n]),U=(0,c.useCallback)((async e=>{const t=Date.now();k(t);try{$("generateNodeFromPrompt:start",{promptLength:e.length});const o=await z({prompt:e}),{inputs:i,outputs:s}=o.importableNode.node,r=Date.now()-t;$("generateNodeFromPrompt:success",{totalTime:r,inputs:Object.keys(i),outputs:Object.keys(s)}),k(null),n({type:C.AI,data:o}),S(!1)}catch(q){k(null),g.AppToaster.show({message:"Failed to generate node",intent:"danger"}),$("generateNodeFromPrompt:failure",{error:q.message})}}),[z,n,$]);return(0,r.jsxs)("div",{className:"actions-menu",children:[G.map((e=>(0,r.jsx)(t.ActionButton,{type:e,onClick:F},e))),w?(0,r.jsx)(v.AddNodeMenu,{onRequestImportables:j,onAddNode:B,onClose:R}):null,O?(0,r.jsx)(y.RunFlowModal,{onClose:()=>E(!1),onRun:H,node:s}):null,D?(0,r.jsx)(I.PromptAIMenu,{onClose:()=>{S(!1),k(null)},onSubmit:U,submitting:null!==M,submitTime:M}):null]})};const _={[C.AddNode]:{icon:h.addNodeIcon,text:'Open the "add node" menu',hotkey:"a"},[C.RemoveNode]:{icon:h.removeNodeIcon,text:"Remove selected instances",hotkey:"backspace"},[C.Group]:{icon:h.groupIcon,text:"Group selection into a new node",hotkey:"g"},[C.UnGroup]:{icon:h.ungroupIcon,text:"Ungroup selected visual node"},[C.Inspect]:{icon:h.inspectIcon,text:"Inspect data",hotkey:"i"},[C.AddInlineValue]:{icon:h.pencilIcon,text:"Add value / inline function",hotkey:"v"},[C.Run]:{icon:h.playIcon,text:"Run flow",hotkey:"r"},[C.AI]:{icon:h.starIcon,text:"Generate new code node using AI \u2728"}},x={icon:"",text:"N/A",hotkey:void 0};t.ActionButton=e=>{var t;const{onClick:n,type:o}=e,i=(0,c.useCallback)((e=>n(o,e)),[n,o]),s=null!==(t=_[o])&&void 0!==t?t:x,a=s.hotkey?(0,r.jsxs)("span",{children:[s.text," ",(0,r.jsx)("kbd",{className:"hotkey",children:s.hotkey})]}):s.text;return(0,r.jsx)("div",{className:"action-button",onClick:i,"data-type":o,children:(0,r.jsx)(u.Tooltip,{hoverOpenDelay:100,content:a,className:"icon-wrapper",popoverClassName:"action-button-tooltip",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s.icon}})})})}},40149:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenu=t.AddNodeMenuFilterTree=void 0;const a=n(35250),u=n(50382),l=n(74762),c=r(n(26372)),d=s(n(70079)),p=n(43490),f=n(31745),m=n(17102),g=n(87935),v=n(74657),h=n(44470);t.AddNodeMenuFilterTree=u.Tree.ofType();function I(e,t,n){return[...e.external.map((e=>({id:e.module,label:e.module,hasCaret:!0,nodeData:{type:"external",module:e.module},isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module,isExpanded:n.has(e.module),childNodes:e.namespaces.map((o=>({id:`${e.module}/${o}`,label:o,hasCaret:!1,isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module&&t.namespace===o,isExpanded:n.has(`${e.module}/${o}`),nodeData:{type:"external",module:e.module,namespace:o}})))}))),{id:"internal",label:"Current Project",nodeData:{type:"internal"},isExpanded:n.has("internal"),hasCaret:!0,isSelected:"internal"===t.type,childNodes:e.internal.files.map((e=>({id:e,label:e,isSelected:"internal"===t.type&&t.file===e,hasCaret:!1,isExpanded:n.has(e),nodeData:{type:"internal",file:e}})))}]}function y(e){return/\.flyde(\.[jt]s)?$/.test(e.module)}t.AddNodeMenu=e=>{const{onRequestImportables:n,onAddNode:o,onClose:i}=e,[s,r]=d.default.useState(),[b,C]=d.default.useState([]),[_,x]=d.default.useState(new Set),[N,j]=d.default.useState(""),[w,P]=d.default.useState({type:"all"}),[O,E]=d.default.useState(null),[D,S]=d.default.useState(null),[M,k]=d.default.useState(null),T=(0,d.useCallback)((e=>{_.add(e.id),x(new Set(_))}),[_]),A=(0,d.useCallback)((e=>{_.delete(e.id),x(new Set(_))}),[_]),R=(0,d.useCallback)((e=>{o(e),i()}),[o,i]),{onInstallRuntimeRequest:V,reportEvent:z}=(0,p.usePorts)();(0,d.useEffect)((()=>{z("addNodeMenuOpen",{})}),[z]),(0,d.useEffect)((()=>{S(null==s?void 0:s.flatMap((e=>{var t,n,o;if(w)if("external"===w.type){if((e.module!==w.module||w.namespace)&&e.node.namespace!==w.namespace)return[]}else if("internal"===w.type&&(!y(e)||w.file&&e.module!==w.file))return[];if(N){const i=`${null!==(n=null===(t=e.node.searchKeywords)||void 0===t?void 0:t.join(" "))&&void 0!==n?n:[]} ${e.node.id} ${null!==(o=e.node.namespace)&&void 0!==o?o:""} ${e.node.description}`.toLowerCase().indexOf(N.toLowerCase());return-1===i?[]:[{importable:e,score:i}]}return[{importable:e,score:1}]})).sort(((e,t)=>e.score-t.score)).map((e=>{let{importable:t}=e;return t})))}),[s,w,N]),(0,d.useEffect)((()=>{n().then((e=>{let{importables:t,errors:n}=e;C(n);const o=t.filter((e=>!y(e))).reduce(((e,t)=>{var n,o,i;null!==(n=e[i=t.module])&&void 0!==n||(e[i]=[]);const s=null!==(o=t.node.namespace)&&void 0!==o?o:"";return e[t.module].includes(s)||e[t.module].push(s),e}),{}),i=t.filter(y).map((e=>e.module));E({external:Object.entries(o).map((e=>{let[t,n]=e;return{module:t,namespaces:n}})),internal:{files:i}}),r(t),x(new Set(["internal",...Object.keys(o)]))}))}),[n]);const $=(0,d.useCallback)((e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),D&&!M)return void k(D["ArrowDown"===e.key?0:D.length-1]);if(D&&M){const t=D.findIndex((e=>e===M));let n="ArrowDown"===e.key?t+1:t-1;n=n<0?D.length-1:n,n=n>=D.length?0:n,k(D[n])}break;case"Enter":M&&R(M)}}),[D,M,R]),H=(0,d.useCallback)((e=>{let{nodeData:t}=e;JSON.stringify(t)===JSON.stringify(w)?"external"===t.type?t.namespace?P({type:"external",module:t.module}):P({type:"all"}):"internal"===t.type&&(t.file?P({type:"internal"}):P({type:"all"})):P(t)}),[w]),G=!s||s.some((e=>e.module.includes("@flyde/stdlib"))),L=(0,d.useCallback)((()=>{V(),i()}),[i,V]);return(0,a.jsx)(u.Dialog,{isOpen:!0,title:"Add Node Menu",onClose:e.onClose,className:"add-node-menu",isCloseButtonShown:!0,children:(0,a.jsxs)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),children:[(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"bp5-input-group",children:[(0,a.jsx)(h.Search,{}),(0,a.jsx)("input",{className:"bp5-input",type:"search",placeholder:"Search input",dir:"auto",autoFocus:!0,onChange:e=>j(e.target.value),value:N,onKeyDown:$})]}),G?null:(0,a.jsxs)(u.Callout,{intent:u.Intent.NONE,style:{marginTop:10},children:["Using built-in @flyde/stdlib. It's recommended to explicitly install it instead."," ",(0,a.jsx)(u.Button,{minimal:!0,small:!0,intent:u.Intent.PRIMARY,onClick:L,children:"Click here to install it using npm/yarn"})]})]}),(0,a.jsx)("div",{className:"content-wrapper",children:s?(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsxs)("aside",{children:[(0,a.jsxs)("div",{className:"filter-header",children:["Filter by package"," ",(0,a.jsx)(u.Tooltip,{content:(0,a.jsxs)("span",{children:["Click to learn more about how packages work in Flyde"," "]}),hoverCloseDelay:1500,children:(0,a.jsx)("a",{target:"_blank",href:"https://www.flyde.dev/docs/packages",rel:"noreferrer",children:(0,a.jsx)(u.Icon,{icon:(0,a.jsx)(h.Help,{}),intent:"primary",iconSize:12})})})]}),(0,a.jsx)("div",{className:"tree-container",children:(0,a.jsx)(t.AddNodeMenuFilterTree,{contents:I(O,w,_),onNodeCollapse:A,onNodeExpand:T,onNodeClick:H,className:u.Classes.ELEVATION_0})})]}),(0,a.jsx)("main",{children:D?0===D.length?(0,a.jsxs)("div",{className:"no-results",children:[(0,a.jsx)(v.AddNodeMenuResultsSummary,{filter:w,onChangeFilter:P,query:N,onChangeQuery:j,resultsCount:D.length}),(0,a.jsxs)(u.Callout,{className:"callout",intent:"primary",children:["Can't find a suitable node? Create one yourself!"," ",(0,a.jsx)("a",{href:"https://www.flyde.dev/docs/code-nodes",target:"_blank",rel:"noreferrer",children:"Learn more"})]})]}):(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsx)(v.AddNodeMenuResultsSummary,{filter:w,onChangeFilter:P,query:N,onChangeQuery:j,resultsCount:D.length}),(0,a.jsx)("div",{className:"results",children:D.map((e=>(0,a.jsx)(g.AddNodeMenuListItem,{importableNode:e,onAdd:R,selected:(null==M?void 0:M.node)===e.node,onSelect:k,onSetFilter:P},e.node.id+e.node.namespace+e.module)))})]}):(0,a.jsx)(m.Loader,{})})]}):(0,a.jsx)(m.Loader,{})}),b.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",style:{marginTop:"10px"},children:["Found ",(0,l.simplePluralize)(b.length,"corrupt flow"),(0,a.jsx)(f.InfoTooltip,{content:b.map((e=>{let{path:t,message:n}=e;return`${t}: ${n}`})).join(", ")})," "]}):null]})})}},8470:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuListItem=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079));t.AddNodeMenuListItem=e=>{const{importableNode:t,onSetFilter:n,onAdd:o,onSelect:i}=e,{node:s,module:r}=t,{id:d,description:p}=s,f=c.default.useRef(null);c.default.useEffect((()=>{e.selected&&f.current&&f.current.scrollIntoView({block:"center"})}),[e.selected]);const m=(0,c.useCallback)((()=>{o(t)}),[o,t]),g=(0,c.useCallback)((()=>{i(t)}),[i,t]);return(0,a.jsxs)("div",{className:(0,l.default)("add-node-menu-list-item",{selected:e.selected}),ref:f,onClick:g,children:[(0,a.jsxs)("div",{className:"content",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("span",{className:"id",children:d}),(0,a.jsxs)(u.Tag,{interactive:!0,onClick:()=>n({type:"external",module:r,namespace:s.namespace}),className:"source",minimal:!0,children:[r,s.namespace?` / ${s.namespace}`:null]})]}),(0,a.jsx)("div",{className:"description",children:p||(0,a.jsx)("em",{children:"No description"})})]}),(0,a.jsx)("aside",{children:(0,a.jsx)(u.Button,{onClick:m,children:"Add"})})]})}},87935:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8470),t)},88671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuResultsSummary=void 0;const o=n(35250),i=n(50382);t.AddNodeMenuResultsSummary=e=>{const{resultsCount:t,query:n,filter:s,onChangeFilter:r,onChangeQuery:a}=e;return(0,o.jsxs)("div",{className:"add-node-menu-results-summary",children:[t?`Showing ${t} result${t>1?"s":""}`:"No results found","\xa0",n?(0,o.jsxs)(o.Fragment,{children:["matching query\xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>a(""),children:['"',n,'"']})]}):null,"all"===s.type?null:"external"===s.type?(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["package ",s.module,s.namespace?` / ${s.namespace}`:null]})]}):(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["\xa0this project ",s.file?` / ${s.file}`:null]})]})]})}},74657:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88671),t)},9971:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40149),t)},83159:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PromptAIMenu=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=1e4;t.PromptAIMenu=e=>{const{onClose:t}=e,[n,o]=c.default.useState(""),[i,s]=c.default.useState(0);return(0,c.useEffect)((()=>{s(0);const t=setInterval((()=>{s((t=>{const n=(Date.now()-e.submitTime)/d;return Math.min(n+.05*Math.random()/2,.95)}))}),500);return()=>clearInterval(t)}),[e.submitTime]),(0,a.jsxs)(u.Dialog,{isOpen:!0,onClose:t,className:"prompt-ai-menu",title:"\u2728 Generate Code Node using AI",children:[(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsx)(u.TextArea,{value:n,disabled:e.submitting,onChange:e=>o(e.target.value),placeholder:"Describe your node in details",fill:!0})}),e.submitTime?(0,a.jsx)("div",{className:"progress-bar-container",children:(0,a.jsx)(u.ProgressBar,{value:i})}):null,(0,a.jsx)("div",{className:u.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:u.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(u.Button,{onClick:t,children:"Close"}),(0,a.jsx)(u.Button,{intent:u.Intent.PRIMARY,className:"run-btn",disabled:e.submitting||!n,loading:e.submitting,onClick:()=>{s(0),e.onSubmit(n)},children:"Create \u2728"})]})})]})}},46334:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(83159),t)},3152:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RunFlowModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(90680),f=n(31745);t.RunFlowModal=u.memo((function(e){const{onRun:t,onClose:n,node:o}=e,[i,s]=u.useState(0),[r,m]=(0,p.useLocalStorage)(`run-inputs-${o.id}`,Object.keys(o.inputs).reduce(((e,t)=>(e[t]=`Enter a value for input ${t}`,e)),{})),[g,v]=u.useState(JSON.stringify(r,null,2)),h=e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})},I=u.useCallback((()=>{const e=JSON.parse(g);m(e),t(e,i)}),[t,m,g,i]),y=Object.keys(o.inputs),b=y.filter((e=>"required"!==o.inputs[e].mode)),C=u.useMemo((()=>y.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:"This node receives external inputs. Enter values for each input below:"}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"json",value:g,onChange:e=>v(null!=e?e:""),onMount:h}),b.length>0?(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Note: input(s) ",(0,a.jsx)("code",{children:b.join(", ")})," are optional"]}):null]}):(0,a.jsx)("strong",{children:"This node does not receive any external inputs."})),[y.length,b,g]);return(0,a.jsxs)(c.Dialog,{isOpen:!0,onClose:e.onClose,className:"run-flow-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&I()},tabIndex:0,children:[C,(0,a.jsxs)("div",{className:"execution-delay-wrapper",children:[(0,a.jsxs)("label",{children:["Execution delay:"," ",(0,a.jsx)(f.InfoTooltip,{content:"Delay between each node execution. Useful for debugging."})]}),(0,a.jsx)(c.Slider,{value:i,onChange:s,min:0,labelStepSize:500,stepSize:100,labelRenderer:e=>`${e}ms`,max:1e3})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:n,children:"Close"}),(0,a.jsx)(c.Button,{onClick:I,intent:c.Intent.PRIMARY,className:"run-btn",children:"Run"})]})})]})}))},47230:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3152),t)},47749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starIcon=t.stopIcon=t.playIcon=t.pencilIcon=t.ungroupIcon=t.groupIcon=t.inspectIcon=t.removeNodeIcon=t.addNodeIcon=void 0,t.addNodeIcon='\n\n',t.removeNodeIcon='\n\n',t.inspectIcon='\n\n\n',t.groupIcon='\n\n\n',t.ungroupIcon='\n\n\n',t.pencilIcon='\n\n',t.playIcon='\n\n\n',t.stopIcon='\n\n\n',t.starIcon='\n\n\n\n\n'},1237:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HelpBubble=void 0;const i=n(70079),s=n(35250),r=n(50382),a=n(99489),u=n(50382),l=o(n(70079)),c=n(68120),d=n(71644),p=n(43490),f={offset:{enabled:!0,options:{offset:[0,20]}},preventOverflow:{enabled:!0,options:{padding:10}}};const m=["Viewport Controls","Editing","Selection"];t.HelpBubble=()=>{const[e,t]=l.default.useState(!1),n=Array.from(c.currentHotkeys.entries()).map((e=>{let[t,n]=e;return{combo:(o={key:t,menuData:n}).key,label:o.menuData.text,group:o.menuData.group};var o})).reduce(((e,t)=>(e[t.group]||(e[t.group]=[]),e[t.group].push(t),e)),{}),o=Object.entries(n).sort(((e,t)=>m.indexOf(t[0])-m.indexOf(e[0]))),{reportEvent:g}=(0,p.usePorts)(),v=(0,s.jsx)(r.Dialog,{isOpen:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:r.Classes.DIALOG_BODY,children:o.map((e=>{let[t,n]=e;return(0,s.jsxs)(l.default.Fragment,{children:[(0,s.jsx)(r.H4,{children:t}),n.map((e=>(0,i.createElement)(a.Hotkey,{...e,key:e.combo})))]},t)}))})}),h=(0,s.jsxs)(r.Menu,{children:[(0,s.jsx)(r.MenuItem,{text:"Hotkeys",onClick:()=>{t(!0),g("helpMenuItem",{item:"hotkeys"})}}),(0,s.jsx)(r.MenuItem,{text:"Documentation",onClick:()=>g("helpMenuItem",{item:"documentation"}),href:"https://www.flyde.dev/docs",target:"_blank"}),(0,s.jsx)(r.MenuDivider,{}),(0,s.jsx)(r.MenuItem,{text:"Discord",onClick:()=>g("helpMenuItem",{item:"discord"}),href:"https://discord.gg/x7t4tjZQP8",target:"_blank"})]});return(0,s.jsxs)("div",{className:"help-bubble","data-tip":"Help",children:[(0,s.jsx)(u.Popover,{content:h,modifiers:f,onOpened:()=>g("helpMenuOpen",{}),children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:d.helpIcon}})}),v]})}},71644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpIcon=void 0,t.helpIcon='\n\n\n'},3354:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1237),t)},7011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainInstanceEventsIndicator=void 0;const o=n(35250),i=n(30994),s=n(66189),r=n(50382);t.MainInstanceEventsIndicator=e=>{const{currentInsId:t,ancestorsInsIds:n}=e,{history:a,refreshHistory:u,resetHistory:l}=(0,s.useHistoryHelpers)(t),c=`main-indicator-${t}}`;return(0,o.jsx)("div",{className:"main-instance-events-indicator",children:(0,o.jsx)(r.Tooltip,{content:(0,s.calcHistoryContent)(a),children:(0,o.jsx)("span",{onMouseEnter:u,onMouseOut:l,id:(0,i.getMainInstanceIndicatorDomId)(t,n),className:"status-text","data-tip":"","data-html":!0,"data-for":c})})})}},22714:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7011),t)},63521:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VisualNodeEditor=t.defaultBoardData=t.defaultViewPort=t.NODE_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=n(74762),c=n(86553),d=n(65082),p=n(18420),f=n(26701),m=n(7047),g=n(53865),v=n(70079),h=n(68120),I=r(n(27942)),y=n(50382),b=n(66005),C=n(60190),_=n(71033),x=n(74762),N=n(99942),j=n(44338),w=n(561),P=n(84472),O=n(82232),E=n(18594),D=n(68371),S=r(n(61888)),M=n(65758),k=n(43490),T=r(n(26372)),A=n(25044),R=n(80510),V=n(1788),z=n(2130),$=n(88593),H=n(97106),G=n(67181),L=n(22714),F=n(3354),B=n(41032),U=n(30653),q=u.memo(y.Slider),W=()=>null;t.NODE_HEIGHT=28;t.defaultViewPort={pos:{x:0,y:0},zoom:1},t.defaultBoardData={selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}},t.VisualNodeEditor=u.memo(u.forwardRef(((e,n)=>{const{onChangeNode:o,nodeIoEditable:i,onCopy:s,onGoToNodeDef:r,onInspectPin:J,boardData:Y,onChangeBoardData:K,currentInsId:X,ancestorsInsIds:Q,node:ee,onShowOmnibar:te,resolvedDependencies:ne,queuedInputsData:oe,initialPadding:ie,disableScrolling:se}=e,{onImportNode:re}=(0,H.useDependenciesContext)(),ae=(0,U.useDarkMode)(),{reportEvent:ue}=(0,k.usePorts)(),le=e.parentViewport||t.defaultViewPort,[ce,de]=(0,v.useState)({...ne,[ee.id]:ee});(0,v.useEffect)((()=>{de({...ne,[ee.id]:ee})}),[ne,ee]);const{selected:pe,from:fe,to:me}=Y,{instances:ge,connections:ve,inputsPosition:he,outputsPosition:Ie,inputs:ye,outputs:be}=ee,[Ce,_e]=(0,v.useState)(),[xe,Ne]=(0,v.useState)(),je=void 0===Q,[we,Pe]=(0,v.useState)(0),[Oe,Ee]=(0,v.useState)(),[De,Se]=(0,v.useState)(!1),[Me,ke]=(0,v.useState)(),[Te,Ae]=(0,v.useState)(),[Re,Ve]=(0,v.useState)(),[ze,$e]=(0,v.useState)(),He=(0,v.useRef)();(0,f.useDidMount)((()=>{He.current=Qe.current.querySelector(".inline-editor-portal-root")}));const Ge=(0,k.useConfirm)(),Le=(0,k.usePrompt)(),Fe=Y.viewPort,Be=(0,v.useRef)(!0),[Ue,qe]=(0,v.useState)(null),We=u.useCallback((e=>{K({viewPort:e})}),[K]),Ze=u.useCallback(((e,t)=>J(e,t)),[J]),Je=u.useCallback(((e,t,n)=>{const i=(0,R.handleConnectionCloseEditorCommand)(ee,{from:e,to:t}),s=(0,l.isInternalConnectionNode)(t)?ge.find((e=>e.id===t.insId)):null,r=(s?s.inputConfig:{})[t.pinId],a=(0,l.isStaticInputPinConfig)(r)?(0,V.handleDetachConstEditorCommand)(i,t.insId,t.pinId):i;o(a,(0,O.functionalChange)("close-connection")),K({from:void 0,to:void 0}),ue("createConnection",{source:n})}),[ge,o,K,ee,ue]),Ye=u.useCallback((async()=>{const e=await Le("New visual node name?");if(!e)return;const{currentNode:t}=await(0,M.groupSelected)(Y.selected,ee,e,"inline",Le);o(t,(0,O.functionalChange)("group node")),(0,P.toastMsg)("Node grouped"),ue("groupSelected",{count:Y.selected.length})}),[Le,Y.selected,o,ee,ue]);(0,v.useEffect)((()=>{if(Oe){const e=setTimeout((()=>{Ee(void 0)}),350);return()=>clearTimeout(e)}}),[Oe]);const[Ke,Xe]=(0,v.useState)();(0,v.useEffect)((()=>{(0,w.preloadMonaco)()}),[]);const Qe=(0,v.useRef)(),et=(0,I.default)(Qe),tt=u.useRef({x:400,y:400}),nt=(0,f.useBoundingclientrect)(Qe)||C.vZero,ot=()=>{const e=(0,m.fitViewPortToNode)(ee,ce,et);(0,m.animateViewPort)(Fe,e,500,(e=>{We(e)}))},it=u.useCallback(((e,t)=>{const{to:n,from:o}=Y,i="input"===t?o:n,s="input"===t?n:o,r={pinId:e,insId:l.THIS_INS_ID},a="input"===t?{from:r}:{to:r};i&&i.pinId===e?K({from:void 0,to:void 0}):s?"input"===t&&n?Je(r,n,"nodeIoClick"):o&&Je(o,r,"nodeIoClick"):K(a)}),[Y,K,Je]),st=u.useCallback(((e,t,n)=>{const i=(0,g.produce)(ee,(o=>{"input"===e?o.inputs[t].description=n:o.outputs[t].description=n}));o(i,(0,O.functionalChange)("Node io description"))}),[o,ee]),rt=u.useCallback(((e,t,n)=>{const{from:o,to:i}=Y;if(fe&&fe.insId===e.id||me&&me.insId===e.id)K({from:void 0,to:void 0});else if("input"===n){const n={insId:e.id,pinId:t};!i||i.pinId!==t||(0,l.isInternalConnectionNode)(i)&&i.insId!==e.id?fe?Je(fe,n,"pinClick"):K({to:n,selected:[]}):K({to:void 0})}else{const n={insId:e.id,pinId:t};!o||o.pinId!==t||(0,l.isInternalConnectionNode)(o)&&o.insId!==e.id?me?Je(n,me,"pinClick"):K({from:n,selected:[]}):K({from:void 0})}}),[Y,fe,K,Je,me]);(0,v.useEffect)((()=>{if(!De&&et.width){const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);We(t);const n=setTimeout((()=>{const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);e.thumbnailMode||We(t),Se(!0)}),100);return()=>clearTimeout(n)}}),[ee,ie,et,e.thumbnailMode,De,ce,We]);const at=u.useCallback((()=>{const{selected:e}=Y,t=ee.instances.filter((t=>e.includes(t.id))).map((e=>({...e,id:e.id+"-copy"}))),n=ee.connections.filter((t=>{let{from:n,to:o}=t;return e.includes(n.insId)&&e.includes(o.insId)}));s({instances:t,connections:n})}),[Y,s,ee]),ut=u.useCallback((()=>{const{newNode:t,newInstances:n}=(0,A.pasteInstancesCommand)(ee,tt.current,e.clipboardData);o(t,(0,O.functionalChange)("paste instances")),K({selected:n.map((e=>e.id))})}),[o,K,ee,e.clipboardData]),lt=u.useCallback((()=>{const e=ee.id;Ke?"input"===Ke.type?Ke.ins.id===e?it(Ke.pin,"input"):rt(Ke.ins,Ke.pin,"input"):Ke.ins.id===e?it(Ke.pin,"output"):rt(Ke.ins,Ke.pin,"output"):console.warn("tried selecting closest with no pin nearby")}),[ee.id,Ke,it,rt]),ct=u.useCallback(((e,t)=>{const n=Math.min(Math.max(e,.1),3),o="mouse"===t?tt.current:{x:Fe.pos.x+et.width/2,y:Fe.pos.y+et.height/2},i=(0,m.centerBoardPosOnTarget)(o,et,n,Fe);We({...Fe,zoom:n,pos:i})}),[We,Fe,et]);(0,h.useHotkeys)("cmd+=",(e=>{ct(Fe.zoom+.1,"hotkey"),e.preventDefault()}),{text:"Zoom in board",group:"Viewport Controls"},[Fe,ct],Be),(0,h.useHotkeys)("cmd+-",(e=>{ct(Fe.zoom-.1,"hotkey"),e.preventDefault()}),{text:"Zoom out board",group:"Viewport Controls"},[ct,Fe.zoom],Be),(0,h.useHotkeys)("cmd+o",(e=>{e.preventDefault(),(0,P.toastMsg)("Ordering");const t=[];(0,N.orderVisualNode)(ee,ce,200,((e,n)=>{n%3==0&&t.push(e)})),(async()=>{for(;t.length;){const e=t.shift();(0,P.toastMsg)(`Step ${t.length}!`),await(0,l.delay)(200),o(e,(0,O.metaChange)("order-step")),(0,P.toastMsg)(`Step ${t.length}! done`)}})()}),{text:"Auto-layout (experimental)",group:"Misc."},[o,ee,ne],Be),(0,h.useHotkeys)("cmd+0",(e=>{ct(1),e.preventDefault()}),{text:"Reset zoom",group:"Viewport Controls"},[Fe,ct],Be);const dt=()=>{K({from:void 0,to:void 0,selected:[]})},pt=u.useCallback(((e,t)=>{_e(e.id),o({...ee},(0,O.metaChange)("drag-start"))}),[o,ee]),ft=u.useCallback(((e,t,n)=>{const{newValue:i,newSelected:s}=(0,m.handleInstanceDrag)(ee,e,n,t,pe,Ce);o(i,(0,O.metaChange)("drag-move")),s&&K({selected:s})}),[Ce,o,K,pe,ee]),mt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(void 0)}),[]),gt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(l.THIS_INS_ID)}),[]),vt=u.useCallback((async(t,n,o,i)=>{o.preventDefault(),o.stopPropagation();const{x:s,y:r}=i,a=(0,g.produce)(ee,(e=>{"input"===t?e.inputsPosition[n]={x:s,y:r}:e.outputsPosition[n]={x:s,y:r}}));e.onChangeNode(a,(0,O.metaChange)("node-io-drag-move"))}),[e,ee]),ht=u.useCallback((async(e,t,n,o)=>{n.preventDefault(),n.stopPropagation(),_e(void 0)}),[]),It=u.useCallback(((e,t)=>{let{id:n}=e;const o=t.shiftKey?pe.filter((e=>e!==n)):[],i=t.shiftKey?[...pe,n]:[n],s=pe.includes(n)?o:i;K({selected:s,from:void 0,to:void 0})}),[K,pe]),yt=u.useCallback((()=>{const e=ee.instances.map((e=>e.id));K({selected:e,from:void 0,to:void 0})}),[K,ee.instances]),bt=u.useCallback((e=>{const t=ve.filter((t=>{let{from:n,to:o}=t;return-1===e.indexOf(n.insId)&&-1===e.indexOf(o.insId)})),n=(0,g.produce)(ee,(n=>{n.connections=t,n.instances=n.instances.filter((t=>!e.includes(t.id)))}));K({selected:[]}),o(n,(0,O.functionalChange)("delete-ins"))}),[ve,o,K,ee]),Ct=u.useCallback((e=>{bt([e.id])}),[bt]),_t=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{"input"===e?(delete n.inputs[t],n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===t)))):(n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===t))),n.completionOutputs=(n.completionOutputs||[]).map((e=>e.split("+").filter((e=>e!==t)).join("+"))).filter((e=>!!e)),delete n.outputs[t])}));fe&&fe.insId===l.THIS_INS_ID&&fe.pinId===t?K({from:void 0}):me&&me.insId===l.THIS_INS_ID&&me.pinId===t&&K({to:void 0}),o(n,(0,O.functionalChange)("remove io pin"))}),[ee,fe,me,o,K]),xt=u.useCallback((async()=>{const{selected:e,from:t,to:n}=Y;0===e.length?t&&(0,l.isExternalConnectionNode)(t)?await Ge(`Are you sure you want to remove main input ${t.pinId}?`)&&_t("input",t.pinId):n&&(0,l.isExternalConnectionNode)(n)&&await Ge(`Are you sure you want to remove main output ${n.pinId}?`)&&_t("output",n.pinId):bt(e)}),[Ge,Y,bt,_t]),Nt=u.useCallback(((e,t,n)=>{const i=(0,m.getInstancePinConfig)(ee,e.id,t),s=(0,l.isStickyInputPinConfig)(i)?(0,x.queueInputPinConfig)():(0,l.stickyInputPinConfig)();o((0,m.changePinConfig)(ee,e.id,t,s),(0,O.functionalChange)("toggle-sticky")),ue("togglePinSticky",{isSticky:(0,l.isStickyInputPinConfig)(s)})}),[o,ee,ue]),jt=u.useCallback((()=>{const{newNode:e,newInstances:t}=(0,z.handleDuplicateSelectedEditorCommand)(ee,pe);o(e,(0,O.functionalChange)("duplicated instances")),K({selected:t.map((e=>e.id))})}),[o,K,ee,pe]),wt=u.useCallback((e=>{const t=e.nativeEvent.target;if(0===e.button&&Z(e.nativeEvent,ee.id)&&t&&"board-editor-inner"===t.className){if(Date.now()-we<300)return void te(e);Pe(Date.now());const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,nt),o=(0,m.domToViewPort)(n,Fe,le);Ne({from:o,to:o})}}),[ee.id,Fe,we,nt,le,te]),Pt=u.useCallback((e=>{if(qe(null),Z(e.nativeEvent,ee.id)&&xe){if((0,m.calcSelectionBoxArea)(xe)>50){const t=(0,m.getInstancesInRect)(xe,ce,Fe,Kt.current,ee.instances,nt,le),n=e.shiftKey?[...pe,...t]:t;K({selected:n})}Ne(void 0)}}),[ee.id,ee.instances,xe,ce,Fe,nt,le,pe,K]),Ot=u.useCallback((e=>{if(!Z(e.nativeEvent,ee.id))return void(Be.current=!1);Be.current=!0;const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,(0,C.vAdd)(nt,C.vZero)),o=(0,m.domToViewPort)(n,Fe,le);xe&&Ne({...xe,to:o});const i=(0,m.findClosestPin)(ee,ce,n,nt,X,Q,Fe),s=Ke;if(i){(!s||s.ins!==i.ins||s.ins===i.ins&&s.pin!==i.pin)&&Xe({ins:i.ins,type:i.type,pin:i.id})}tt.current=o,K({lastMousePos:tt.current})}),[ee,nt,Fe,le,xe,ce,X,Q,Ke,K]),Et=u.useCallback((e=>{var t;"bp5-menu"!==(null===(t=e.relatedTarget)||void 0===t?void 0:t.className)&&(Xe(void 0),Be.current=!1)}),[]),Dt=u.useCallback(((e,t)=>{if(t){const t=(0,l.isInlineNodeInstance)(e)?e.node:(0,B.safelyGetNodeDef)(e.nodeId,ce);if(!t)throw new Error("Impossible state inspecting inexisting node");if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Cannot inspect a non visual node","warning");$e({insId:`${X}.${e.id}`,node:t})}else if((0,l.isRefNodeInstance)(e)){const t=(0,B.safelyGetNodeDef)(e,ce);r(t)}else{const t=e.node;if(!(0,l.isInlineValueNode)(t))return void((0,l.isVisualNode)(t)?$e({insId:e.id,node:t}):(0,P.toastMsg)("Editing this type of node is not supported"));const n=atob(t.dataBuilderSource);Ve({insId:e.id,templateType:t.templateType,value:n,type:"existing"}),(0,P.toastMsg)("Editing inline visual node not supported yet")}}),[r,ce,X]),St=u.useCallback((e=>{if((0,l.isInlineNodeInstance)(e)){const t=e.node;if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Not supported","warning");const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.filter((t=>t.id!==e.id)),n.connections=n.connections.filter((t=>{let{from:n,to:o}=t;return n.insId!==e.id&&o.insId!==e.id})),n.instances.push(...t.instances),n.connections.push(...t.connections.filter((e=>(0,l.isInternalConnectionNode)(e.from)&&(0,l.isInternalConnectionNode)(e.to))))}));o(n,{type:"functional",message:"ungroup"}),K({selected:[]})}else{const t=(0,B.safelyGetNodeDef)(e.nodeId,ce);if(!(0,l.isVisualNode)(t))return void(0,P.toastMsg)("Not supported","warning")}}),[ee,o,K,ce]),Mt=u.useCallback((async e=>{}),[]),kt=u.useCallback(((e,t)=>{const n=(0,V.handleDetachConstEditorCommand)(ee,e.id,t);o(n,(0,O.functionalChange)("detach-const"))}),[o,ee]),Tt=u.useCallback(((e,t)=>{const n=e.inputConfig[t]||(0,x.queueInputPinConfig)();(0,l.isStaticInputPinConfig)(n)&&(Ae(n.value),P.AppToaster.show({message:"Value copied"}))}),[]),At=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{const o=n.instances.find((t=>t.id===e.id));if(!o)throw new Error("Impossible state");o.inputConfig[t]=(0,l.staticInputPinConfig)(Te),n.connections=n.connections.filter((n=>!(0,l.isInternalConnectionNode)(n.to)||!(n.to.insId===e.id&&n.to.pinId===t)))}));o(n,(0,O.functionalChange)("paste const value"))}),[ee,o,Te]),Rt=u.useCallback((async e=>{const t=await Le("New name?");if(!t)return;const n=(0,g.produce)(ee,(n=>{var o;"input"===e?(ee.inputs||(n.inputs={}),n.inputs[t]=(0,l.nodeInput)(),n.inputsPosition[t]=tt.current):(ee.outputs||(n.outputs={}),n.outputs[t]=(0,l.nodeOutput)(),n.outputsPosition[t]=tt.current,(null===(o=n.completionOutputs)||void 0===o?void 0:o.length)&&(0,P.toastMsg)("Note that this node has explicit completion outputs set. You may need to update them."))}));o(n,(0,O.functionalChange)("add new io pin")),ue("addIoPin",{type:e})}),[Le,ee,o,ue]),Vt=u.useCallback((async()=>{var e;const t=null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","),n=await Le("Edit completion outputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,g.produce)(ee,(e=>{e.completionOutputs=""===n?void 0:n.split(",")}));o(e,(0,O.functionalChange)("change node completions")),ue("editCompletionOutputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),zt=u.useCallback((async()=>{var e;const t=null===(e=ee.reactiveInputs)||void 0===e?void 0:e.join(","),n=await Le("Edit reactive inputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,g.produce)(ee,(e=>{e.reactiveInputs=""===n?void 0:n.split(",")}));o(e,(0,O.functionalChange)("change reactive inputs")),ue("editReactiveInputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),$t=u.useCallback((async()=>{const e=await Le("Description?",ee.description),t=(0,g.produce)(ee,(t=>{t.description=e}));o(t,(0,O.functionalChange)("Edit node description"))}),[Le,o,ee]),Ht=u.useCallback((e=>{const t=(0,g.produce)(ee,(t=>{t.defaultStyle=e}));o(t,(0,O.functionalChange)("change default style")),ue("changeStyle",{isDefault:!0})}),[o,ee,ue]),Gt=u.useCallback((async(e,t)=>{const n=await Le("New name?",t)||t,i=(0,m.handleIoPinRename)(ee,e,t,n);o(i,(0,O.functionalChange)("rename io pin"))}),[ee,o,Le]),Lt=u.useCallback(((e,t)=>{const n=(0,m.handleChangeNodeInputType)(ee,e,t);o(n,(0,O.functionalChange)("toggle io pin optional"))}),[ee,o]),Ft=u.useCallback((e=>{switch(e.type){case G.ActionType.RemoveNode:{const e=(0,g.produce)(ee,(e=>{if(!(0,l.isVisualNode)(ee))throw new Error("Impossible state, deleting instances opf non visual node");e.instances=e.instances.filter((e=>!pe.includes(e.id))),e.connections=e.connections.filter((e=>!pe.includes(e.from.insId)&&!pe.includes(e.to.insId)))}));K({selected:[]}),o(e,(0,O.functionalChange)("remove-instances")),(0,P.toastMsg)(`Removed ${pe.length} instances(s)`),ue("deleteInstances",{count:pe.length});break}case G.ActionType.Inspect:if(1===pe.length)J(pe[0]);else if(fe||me){const e=null!=fe?fe:me,t=(0,l.isExternalConnectionNode)(e)?l.ROOT_INS_ID:e.insId;J(t,{type:fe?"output":"input",id:e.pinId})}ue("openInspectMenu",{source:"actionMenu"});break;case G.ActionType.Group:(async()=>{await Ye()})();break;case G.ActionType.UnGroup:{const e=ee.instances.find((e=>e.id===pe[0]));St(e);const t=(0,B.safelyGetNodeDef)(e,ce);(0,P.toastMsg)(`Ungrouped inline node ${t.id}`),ue("unGroupNode",{instancesCount:t.instances.length});break}case G.ActionType.AddInlineValue:Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"actionMenu"});break;case G.ActionType.AddNode:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,g.produce)(ee,(e=>{e.instances.push(r)})),u=(0,g.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,O.functionalChange)("add new instance")),K(u),(0,P.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;case G.ActionType.AI:!async function(){const t=(0,m.getMiddleOfViewPort)(Fe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*Fe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,g.produce)(ee,(e=>{e.instances.push(r)})),u=(0,g.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,O.functionalChange)("add new instance")),K(u),(0,P.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;default:(0,P.toastMsg)(`${e.type} not supported yet`)}}),[Y,fe,o,K,Ye,re,J,St,ee,ce,ue,pe,me,Fe,et]),Bt=()=>{const t=Y.from;return(0,p.entries)(ye).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:X,ancestorInsIds:e.ancestorsInsIds,type:"input",pos:he[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,onDblClick:Zt,closest:!(!Ke||"input"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,inputMode:s.mode,onChangeInputMode:Lt,viewPort:Fe,onDragStart:gt,onDragEnd:ht,onDragMove:vt,onSelect:it,onSetDescription:st,selected:(null==t?void 0:t.pinId)===o,description:s.description,onMouseUp:Nn,onMouseDown:xn},o)}))},Ut=()=>{const{to:t}=Y;return(0,p.entries)(be).map((n=>{let[o,s]=n;return(0,a.jsx)(b.NodeIoView,{currentInsId:X,ancestorInsIds:e.ancestorsInsIds,type:"output",pos:Ie[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Gt:void 0,closest:!(!Ke||"output"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,viewPort:Fe,onDragStart:gt,onDragEnd:ht,onDragMove:vt,onSelect:it,onSetDescription:st,description:s.description,selected:(null==t?void 0:t.pinId)===o,onMouseUp:Nn,onMouseDown:xn},o)}))},qt=()=>{if(xe){const{from:e,to:t}=xe,n=(0,m.logicalPosToRenderedPos)(e,Fe),o=(0,m.logicalPosToRenderedPos)(t,Fe),{x:i,y:s,w:r,h:u}=(0,m.getSelectionBoxRect)(n,o);return(0,a.jsx)("div",{className:"selection-box",style:{top:s,left:i,width:r,height:u}})}return null},Wt=u.useCallback((async(e,t,n,o)=>{if("input"===n){const n=e.inputConfig[t],o=(0,l.isStaticInputPinConfig)(n)?JSON.stringify(n.value):void 0;Ve({type:"static-input",insId:e.id,pinId:t,value:null!=o?o:JSON.stringify("Some static value")}),ue("addValueModalOpen",{source:"dblClickPin"})}else{const i=(0,B.safelyGetNodeDef)(e,ce);if(!(0,l.getNodeOutputs)(i)[t])throw new Error("Dbl clicked on un-existing pin");ke({pos:{x:o.clientX,y:o.clientY},ins:e,targetNode:i,pinId:t,pinType:n})}}),[ce,ue]),Zt=u.useCallback((async(e,t)=>{if(!ee.inputs[e])throw new Error("Dbl clicked on un-existing pin");ke({pos:{x:t.clientX,y:t.clientY},pinId:e,pinType:"input",targetNode:ee})}),[ee]),Jt=u.useCallback((e=>{if(e.metaKey||e.ctrlKey){const t=-.005*e.deltaY;ct(Fe.zoom+t,"mouse"),e.preventDefault(),e.stopPropagation()}else{if(se)return;const t=e.deltaX,n=e.deltaY,o=(0,g.produce)(Fe,(e=>{e.pos.x=e.pos.x+t/e.zoom,e.pos.y=e.pos.y+n/e.zoom}));We(o),e.stopPropagation(),e.preventDefault()}}),[se,ct,We,Fe]);(0,v.useEffect)((()=>{const{current:e}=Qe;if(e)return e.addEventListener("wheel",Jt),()=>{e.removeEventListener("wheel",Jt)}}),[Jt]);const Yt={backgroundPositionX:(0,m.roundNumber)(-Fe.pos.x*Fe.zoom),backgroundPositionY:(0,m.roundNumber)(-Fe.pos.y*Fe.zoom),backgroundSize:(0,m.roundNumber)(10*Fe.zoom)+"px"},Kt=u.useRef(new Map);u.useEffect((()=>{const e=ge.reduce(((e,t)=>{const n=(0,B.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeInputs)(n))),e}),new Map),t=ge.reduce(((e,t)=>{const n=(0,B.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeOutputs)(n))),e}),new Map);e.set(l.THIS_INS_ID,(0,l.keys)(ee.outputs)),t.set(l.THIS_INS_ID,(0,l.keys)(ee.inputs));const n=ve.filter((n=>{const o=e.get(n.to.insId)&&e.get(n.to.insId).includes(n.to.pinId),i=t.get(n.from.insId)&&t.get(n.from.insId).includes(n.from.pinId);return!(o&&i)}));if(n.length>0){(0,P.toastMsg)(`${n.length} orphan connections removed`,"warning"),console.warn(`${n.length} orphan connections removed`,n);const e=(0,g.produce)(ee,(e=>{e.connections=ee.connections.filter((e=>!n.includes(e)))}));o(e,(0,O.functionalChange)("prune orphan connections"))}}),[ge,o,ve,ee,ce]),u.useEffect((()=>{let e=[];const t=(0,g.produce)(ee,(t=>{t.instances=t.instances.map((t=>{const n=(0,B.safelyGetNodeDef)(t,ce);if(n){const o=(0,l.getNodeInputs)(n),i=(0,l.getNodeOutputs)(n);if(t.visibleInputs){const n=t.visibleInputs.filter((e=>!o[e]));n.length>0&&(t.visibleInputs=(0,l.keys)(o),e.push(...n))}if(t.visibleOutputs){const n=t.visibleOutputs.filter((e=>!i[e]));n.length>0&&(t.visibleOutputs=(0,l.keys)(i),e.push(...n))}}return t}))}));e.length>0&&((0,P.toastMsg)(`Found ${e.length} invalid visible inputs/outputs: ${e.join(", ")}. Reset them`,"warning"),o(t,(0,O.functionalChange)("reset corrupt visible inputs/outputs")))}),[ge,o,ee,ce]),(0,v.useEffect)((()=>{const e=new Map(ge.map((e=>[e.id,e])));Kt.current=ve.reduce(((t,n)=>{const o=t.get(n.to.insId)||{},i=o[n.to.pinId]||[],s={...o,[n.to.pinId]:[...i,e.get(n.from.insId)]};return t.set(n.to.insId,s),t}),new Map)}),[ve,ge]);const Xt=u.useCallback((()=>{ke(void 0)}),[]),Qt=u.useCallback((async e=>{if(!Me)throw new Error("impossible state - quick add menu invoked but not available");const{ins:t,pinId:n}=Me;switch(e.type){case"import":case"node":{const i="import"===e.type?await re(e.importableNode):ce,s="import"===e.type?e.importableNode.node:e.node,r=(0,m.createNewNodeInstance)(s.id,100,tt.current,i);if(r){const e=(0,g.produce)(ee,(e=>{e.instances.push(r),e.connections.push({from:{insId:t?t.id:l.THIS_INS_ID,pinId:n},to:{insId:r.id,pinId:l.TRIGGER_PIN_ID}})}));o(e,(0,O.functionalChange)("add-item-quick-menu")),Xt()}ue("addNode",{nodeId:s.id,source:"quickAdd"});break}case"value":if(!t)return void(0,P.toastMsg)("Cannot add value to main input");Ve({type:"new-output",insId:t.id,pinId:n}),ue("addValueModalOpen",{source:"quickAdd"})}}),[Me,ce,ue,ee,o,Xt,re]),en=u.useCallback((async()=>{const e=JSON.stringify(ee);await navigator.clipboard.writeText(e),P.AppToaster.show({message:"Copied!"})}),[ee]),tn=u.useCallback((()=>{var e,t;const n=i?"":" (cannot edit main node, only visual)";return(0,a.jsxs)(y.Menu,{children:[(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"New Value",onClick:(0,p.preventDefaultAnd)((()=>{Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"contextMenu"})}))}),(0,a.jsx)(y.MenuItem,{text:`New input ${n}`,onMouseDown:e=>e.stopPropagation(),onClick:(0,p.preventDefaultAnd)((()=>Rt("input"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`New output ${n}`,onClick:(0,p.preventDefaultAnd)((()=>Rt("output"))),disabled:!i}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Copy node to clipboard",onClick:(0,p.preventDefaultAnd)(en)}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Completion Outputs (${(null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Vt()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Reactive inputs (${(null===(t=ee.reactiveInputs)||void 0===t?void 0:t.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>zt()))}),(0,a.jsx)(y.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Edit description",onClick:(0,p.preventDefaultAnd)((()=>$t()))}),(0,a.jsx)(y.MenuDivider,{}),(0,a.jsx)(y.MenuItem,{text:"Default Style",children:(0,a.jsx)($.NodeStyleMenu,{style:ee.defaultStyle,onChange:Ht,promptFn:Le})})]})}),[i,en,ee.completionOutputs,ee.reactiveInputs,ee.defaultStyle,Ht,Le,ue,Rt,Vt,zt,$t]);(0,h.useHotkeys)("shift+c",ot,{text:"Center viewport",group:"Viewport Controls"},[],Be),(0,h.useHotkeys)("cmd+c",at,{text:"Copy instances",group:"Editing"},[],Be),(0,h.useHotkeys)("cmd+v",ut,{text:"Paste instances",group:"Editing"},[],Be),(0,h.useHotkeys)("esc",dt,{text:"Clear selections",group:"Selection"},[],Be),(0,h.useHotkeys)("backspace",xt,{text:"Delete instances",group:"Editing"},[],Be),(0,h.useHotkeys)("shift+d",jt,{text:"Duplicate selected instances",group:"Editing"},[],Be),(0,h.useHotkeys)("cmd+a",yt,{text:"Select all",group:"Selection"},[],Be),(0,h.useHotkeys)("s",lt,{text:"Select pin closest to mouse",group:"Selection"},[],Be);const nn=u.useCallback(((e,t)=>{if(!ze)throw new Error("impossible state");const n=(0,g.produce)(ee,(t=>{const n=t.instances.find((e=>e.id===ze.insId));if(!n||!(0,l.isInlineNodeInstance)(n))throw new Error("impossible state");n.node=e}));o(n,(0,O.functionalChange)("Inner change: "+t.message)),$e((t=>({...t,node:e})))}),[o,ze,ee]),[on,sn]=(0,v.useState)({selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}}),rn=u.useCallback((e=>sn((t=>({...t,...e})))),[]),an=n=>ze&&ze.insId===n.id?{currentInsId:ze.insId,ancestorsInsIds:(0,l.fullInsIdPath)(X,Q),boardData:on,onChangeBoardData:rn,resolvedDependencies:ne,onCopy:s,clipboardData:e.clipboardData,onInspectPin:e.onInspectPin,onGoToNodeDef:e.onGoToNodeDef,nodeIoEditable:e.nodeIoEditable,node:ze.node,onChangeNode:nn,onShowOmnibar:te,parentViewport:t.defaultViewPort,parentBoardPos:nt,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:e.queuedInputsData}:void 0,un=()=>{if(fe&&("input"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"output"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(e)&&!(0,l.isInternalConnectionNode)(fe))return;return{from:fe,to:e}}if(me&&("output"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"input"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(me)&&!(0,l.isInternalConnectionNode)(e))return;return{from:e,to:me}}},ln=()=>{const e=un();if(e){const{from:t,to:n}=e;return{connection:{from:t,to:n},type:ve.some((t=>(0,l.connectionDataEquals)(t,e)))?"future-remove":"future-add"}}},cn=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleInputs:t}:n))}));o(n,(0,O.functionalChange)("change instance visible inputs"))}),[ee,o]),dn=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,style:t}:n))}));o(n,(0,O.functionalChange)("change instance style")),ue("changeStyle",{isDefault:!1})}),[o,ee,ue]),pn=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleOutputs:t}:n))}));o(n,(0,O.functionalChange)("change instance visible outputs"))}),[ee,o]),fn=u.useCallback(((e,t)=>{const n=(0,g.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,displayName:t}:n))}));o(n,(0,O.functionalChange)("change instance display name"))}),[ee,o]);u.useImperativeHandle(n,(()=>({centerInstance(e){const t=ee.instances.find((t=>t.id===e));if(t){const e=(0,C.vSub)(t.pos,(0,C.vec)(et.width/2,et.height/2));We({...Fe,pos:e})}},centerViewPort(){ot()},getViewPort:()=>Fe,clearSelection:()=>{dt()},requestNewInlineValue:()=>{Ve({type:"new-floating",pos:tt.current})}})));const[mn,gn]=u.useState([]),vn=u.useCallback(((e,t)=>{const n=t.trim().substr(0,100),i=`Inline-value-${n.substr(0,15).replace(/["'`]/g,"")}`,s=(0,D.createInlineValueNode)({code:t,customView:n,nodeId:i,type:e});switch(Re.type){case"existing":{const[e]=ee.instances.filter((e=>e.id===Re.insId)).filter((e=>(0,l.isInlineNodeInstance)(e))).map((e=>e.node));if(!e)throw new Error("Unable to find inline node to save to");const t=(0,l.keys)(e.inputs),n=(0,l.keys)(s.inputs),i=new Set(S.default.difference(t,n)),r=(0,g.produce)(ee,(e=>{e.instances=e.instances.map((e=>e.id===Re.insId?(0,l.inlineNodeInstance)(e.id,s,e.inputConfig,e.pos):e)),e.connections=e.connections.filter((e=>!(e.to.insId===Re.insId&&i.has(e.to.pinId))))}));o(r,(0,O.functionalChange)("change inline value")),Ve(void 0);break}case"static-input":{let e;try{const n=t.replace(/^['`]/,'"').replace(/['`]$/,'"');e=JSON.parse(n)}catch(r){return void(0,P.toastMsg)("Input values must not be formulas or code")}const n=(0,g.produce)(ee,(t=>{t.instances.find((e=>e.id===Re.insId)).inputConfig[Re.pinId]=(0,l.staticInputPinConfig)(e)}));o(n,(0,O.functionalChange)("set static input value")),Ve(void 0);break}case"new-floating":{const e=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},Re.pos),t=(0,g.produce)(ee,(t=>{t.instances.push(e)}));o(t,(0,O.functionalChange)("new floating value")),Ve(void 0);break}case"new-output":{const{insId:e,pinId:t}=Re,n=ee.instances.find((t=>t.id===e));if(!n)throw new Error("Impossible state");const i=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},(0,C.vAdd)(n.pos,{x:-50,y:150})),r=(0,g.produce)(ee,(n=>{n.instances.push(i),n.connections.push({from:(0,l.connectionNode)(e,t),to:(0,l.connectionNode)(i.id,l.TRIGGER_PIN_ID)})}));o(r,(0,O.functionalChange)("new value connected to output")),Ve(void 0)}}ue("addValue",{type:e,placeholdersCount:(0,l.keys)(s.inputs).length})}),[Re,o,ee,ue]),hn=ve.filter((e=>{const t=un();return!t||!(0,l.connectionDataEquals)(t,e)})),In=u.useCallback((()=>{$e(void 0),sn(t.defaultBoardData)}),[]),yn=u.useCallback((e=>{const t=(0,g.produce)(ee,(t=>{const n=t.connections.find((t=>(0,l.connectionDataEquals)(t,e)));n.hidden=!n.hidden}));o(t,(0,O.functionalChange)("toggle connection hidden"))}),[o,ee]),bn=u.useCallback((e=>{const t=(0,g.produce)(ee,(t=>{t.connections=t.connections.filter((t=>!(0,l.connectionDataEquals)(t,e)))}));o(t,(0,O.functionalChange)("remove connection"))}),[o,ee]),Cn=u.useCallback(((e,t,n)=>{qe("input"===n?{to:(0,l.connectionNode)(e.id,t),from:void 0}:{from:(0,l.connectionNode)(e.id,t),to:void 0})}),[]),_n=u.useCallback(((e,t,n)=>{Ue&&(Ue.from&&"input"===n?Je(Ue.from,(0,l.connectionNode)(e.id,t),"pinDrag"):Ue.to&&"output"===n&&Je((0,l.connectionNode)(e.id,t),Ue.to,"pinDrag")),qe(null)}),[Ue,Je]),xn=u.useCallback(((e,t)=>{}),[]),Nn=u.useCallback(((e,t)=>{Ue&&(Ue.from&&"output"===t?Je(Ue.from,(0,l.externalConnectionNode)(e),"nodeIoPinDrag"):Ue.to&&"input"===t&&Je((0,l.externalConnectionNode)(e),Ue.to,"nodeIoPinDrag"))}),[Ue,Je]);try{return(0,a.jsxs)(y.ContextMenu,{className:(0,T.default)("visual-node-editor",e.className,{dark:ae}),"data-id":ee.id,content:tn(),disabled:!Be.current,children:[(0,a.jsxs)("main",{className:"board-editor-inner",onMouseDown:wt,onMouseUp:Pt,onMouseMove:Ot,onMouseLeave:Et,ref:Qe,style:Yt,children:[(0,a.jsx)(u.Fragment,{children:(0,a.jsx)(j.LayoutDebugger,{vp:Fe,node:ee,extraDebug:m.emptyList,mousePos:tt.current})}),(0,a.jsx)(d.ConnectionView,{resolvedNodes:ce,currentInsId:X,ancestorsInsIds:Q,size:et,node:ee,boardPos:nt,instances:ge,connections:hn,futureConnection:ln(),onDblClick:l.noop,viewPort:Fe,parentVp:le,selectedInstances:pe,toggleHidden:yn,removeConnection:bn,lastMousePos:tt.current,draggedSource:Ue}),Bt(),ge.map((t=>{var n,o,i,s,r;return(0,a.jsx)(c.InstanceView,{onUngroup:St,onExtractInlineNode:Mt,onDetachConstValue:kt,onCopyConstValue:Tt,onPasteConstValue:At,copiedConstValue:Te,connectionsPerInput:Kt.current.get(t.id)||m.emptyObj,node:(0,B.safelyGetNodeDef)(t,ce),ancestorsInsIds:(0,l.fullInsIdPath)(X,Q),onPinClick:rt,onPinDblClick:Wt,onDragStart:pt,onDragEnd:mt,resolvedDeps:ce,onDragMove:ft,onDblClick:Dt,onSelect:It,onToggleSticky:Nt,selected:-1!==pe.indexOf(t.id),dragged:Ce===t.id,onInspectPin:Ze,selectedInput:me&&(0,l.isInternalConnectionNode)(me)&&me.insId===t.id?me.pinId:void 0,selectedOutput:fe&&(0,l.isInternalConnectionNode)(fe)&&fe.insId===t.id?fe.pinId:void 0,closestPin:Ke&&Ke.ins.id===t.id?Ke:void 0,queuedInputsData:null!==(n=oe[t.id])&&void 0!==n?n:m.emptyObj,instance:t,connections:ve,onTogglePinBreakpoint:l.noop,onTogglePinLog:l.noop,viewPort:Fe,onChangeVisibleInputs:cn,onChangeVisibleOutputs:pn,onSetDisplayName:fn,onDeleteInstance:Ct,forceShowMinimized:fe||(null===(o=null==Ue?void 0:Ue.to)||void 0===o?void 0:o.insId)===t.id?"input":me||(null===(i=null==Ue?void 0:Ue.from)||void 0===i?void 0:i.insId)===t.id?"output":void 0,isConnectedInstanceSelected:pe.some((e=>ve.some((n=>{let{from:o,to:i}=n;return o.insId===t.id&&i.insId===e||o.insId===e&&i.insId===t.id})))),inlineGroupProps:an(t),onCloseInlineEditor:In,inlineEditorPortalDomNode:He.current,onChangeStyle:dn,onGroupSelected:Ye,onPinMouseDown:Cn,onPinMouseUp:_n,hadError:null!==(r=null===(s=e.instancesWithErrors)||void 0===s?void 0:s.has((0,l.fullInsIdPath)(t.id)))&&void 0!==r&&r},t.id)})),qt(),Ut(),(0,a.jsx)(L.MainInstanceEventsIndicator,{currentInsId:X,ancestorsInsIds:Q,viewPort:Fe}),Me?(0,a.jsx)(_.QuickAddMenu,{targetNode:Me.targetNode,pinId:Me.pinId,pinType:Me.pinType,pos:Me.pos,resolvedDependencies:ne,node:ee,onAdd:Qt,onClose:Xt}):null,(0,a.jsxs)("div",{className:"viewport-controls-and-help",children:[(0,a.jsx)(y.Button,{small:!0,onClick:ot,minimal:!0,intent:"primary",children:"Center"}),(0,a.jsx)(q,{min:.15,max:3,stepSize:.05,labelStepSize:10,labelRenderer:W,onChange:ct,value:Fe.zoom}),je?(0,a.jsx)(F.HelpBubble,{}):null]}),Re?(0,a.jsx)(E.InlineCodeModal,{env:m.emptyObj,initialValue:Re.value,initialType:"existing"===Re.type?Re.templateType:void 0,onCancel:()=>Ve(void 0),onSubmit:vn}):null,(0,a.jsx)("div",{className:"inline-editor-portal-root"})]}),(0,a.jsx)(G.ActionsMenu,{showRunFlowOptions:je,onAction:Ft,selectedInstances:pe,node:ee,resolvedNodes:ce,to:me,from:fe,hotkeysEnabled:Be})]})}catch(jn){return console.error(jn),(0,a.jsxs)("div",{children:["Error rendering board - ",jn.toString()]})}})));const Z=(e,t)=>{const n=e.target.closest(".visual-node-editor");return n&&n.getAttribute("data-id")===t}},83234:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeView=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=r(n(59349)),d=n(30653);t.BaseNodeView=function(e){const{dragged:t,viewPort:n,pos:o,onDragEnd:i,onDragMove:s,onDragStart:r,displayMode:p}=e,f=(0,d.useDarkMode)(),m=u.useCallback(((e,t)=>{r(e,t)}),[r]),g=u.useCallback(((e,t)=>{const s=o,r=(t.x-s.x)/n.zoom,a=(t.y-s.y)/n.zoom,u=s.x+r,l=s.y+a;i(e,{...t,x:u,y:l})}),[o,i,n]),v=u.useCallback(((e,t)=>{s(e,{x:t.x,y:t.y})}),[s]),h={transform:`scale(${n.zoom})`},I=(0,l.default)("base-node-view",e.className,{dragged:t,dark:f,"display-mode":p}),y=o.x*n.zoom-n.pos.x*n.zoom,b=o.y*n.zoom-n.pos.y*n.zoom,C={transform:`translate(${y-o.x}px, ${b-o.y}px)`},_=(0,l.default)("base-node-view-vp-fixer",{"display-mode":p}),x=(0,a.jsx)("span",{className:"base-node-view-wrapper",children:(0,a.jsx)("div",{className:I,style:h,id:e.domId,children:e.children})});return(0,a.jsx)("div",{className:_,style:C,children:(0,a.jsx)(c.default,{onStop:g,onStart:m,onDrag:v,position:o,cancel:".no-drag",children:x})})}},80510:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleConnectionCloseEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleConnectionCloseEditorCommand=(e,t)=>{let{from:n,to:o}=t;return(0,s.default)(e,(e=>{const t=e.connections.find((e=>{const t=(0,i.connectionNodeEquals)(n,e.from),s=(0,i.connectionNodeEquals)(o,e.to);return t&&s}));t?e.connections=e.connections.filter((e=>e!==t)):e.connections.push({from:n,to:o})}))}},1788:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDetachConstEditorCommand=void 0;const i=n(74762),s=o(n(53865)),r=n(68371);t.handleDetachConstEditorCommand=(e,t,n)=>(0,s.default)(e,(e=>{const{instances:o}=e,s=o.find((e=>e.id===t));if(!s)throw new Error("Impossible state ins id with no matching instance");const a=s.inputConfig[n];if(!a)throw new Error("impossible state detaching const from unexistent config");if(!(0,i.isStaticInputPinConfig)(a))throw new Error("impossible state detaching const with no value");const u=JSON.stringify(a.value),l=(0,r.createInlineValueNode)({code:`${u}`,type:i.InlineValueNodeType.VALUE}),c=(0,i.inlineNodeInstance)(`value-${(0,i.randomInt)(999)}`,l,{},{x:s.pos.x,y:s.pos.y-100});if(!e.instances.find((e=>e.id===s.id)))throw new Error("impossible state instance not found");s.inputConfig[n]=(0,i.queueInputPinConfig)(),e.instances.push(c),e.connections.push((0,i.connectionData)(`${c.id}.value`,`${s.id}.${n}`))}))},2130:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDuplicateSelectedEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleDuplicateSelectedEditorCommand=(e,t)=>{const n=[];return{newNode:(0,s.default)(e,(o=>{const s=o.instances;t.forEach((t=>{const o=s.find((e=>e.id===t));if(!o)throw new Error("impossible state duplicate selected no matching instance");if(o){const{pos:t}=o,r={...o,pos:{x:t.x+20,y:t.y+20},id:(0,i.createInsId)(e)};s.push(r),n.push(r.id)}}))})),newInstances:n}}},25044:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.pasteInstancesCommand=void 0;const i=n(74762),s=o(n(53865));t.pasteInstancesCommand=(e,t,n)=>{const o=n.instances.map((n=>({...n,pos:t,id:(0,i.createInsId)(e)}))),r=new Map(o.map(((e,t)=>[n.instances[t].id,e.id])));return{newNode:(0,s.default)(e,(e=>{e.instances.push(...o);const t=n.connections.map((e=>{let{from:t,to:n}=e;return{from:{...t,insId:r.get(t.insId)||t.insId},to:{...n,insId:r.get(n.insId)||n.insId}}}));e.connections.push(...t)})),newInstances:o}}},65082:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionView=t.SingleConnectionView=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=r(n(26372)),d=n(74762),p=n(18243),f=n(77852),m=n(74089),g=n(60190),v=n(50382),h=n(76064),I=n(41032);t.SingleConnectionView=e=>{const{isBrowser:t}=(0,f.useSsr)(),{connection:n,node:o,resolvedNodes:i,instances:s,type:r,viewPort:a,toggleHidden:l,parentSelected:m,removeConnection:y}=e,{from:b}=n,C=(0,d.isInternalConnectionNode)(b)&&s.find((e=>e.id===b.insId));if(!C&&(0,d.isInternalConnectionNode)(b))throw new Error(`impossible state - "from instance id - [${b.insId}] does not exist"`);const _=((0,d.isInternalConnectionNode)(b)&&C?(0,I.safelyGetNodeDef)(C,i):o).outputs[b.pinId],x=_&&_.delayed,N=t?(0,p.calcStartPos)({...e,connectionNode:b}):{x:0,y:0},j=t?(0,p.calcTargetPos)({...e,connectionNode:n.to}):{x:0,y:0},{x:w,y:P}=(0,g.vDiv)(N,e.parentVp.zoom),{x:O,y:E}=(0,g.vDiv)(j,e.parentVp.zoom),D=(0,c.default)({delayed:x,hidden:n.hidden,"parent-selected":m},r),S=(0,u.jsxs)(v.Menu,{children:[(0,u.jsx)(v.MenuItem,{text:n.hidden?"Show connection":"Hide connection",onClick:()=>l(n)}),(0,u.jsx)(v.MenuItem,{text:"Remove connection",onClick:()=>y(n)})]});return(0,u.jsx)(v.ContextMenu,{content:S,children:e=>(0,u.jsx)(h.ConnectionViewPath,{className:D,from:{x:w,y:P},to:{x:O,y:E},dashed:"regular"!==r,zoom:a.zoom,onContextMenu:e.onContextMenu})})};t.ConnectionView=e=>{var n;const{viewPort:o,futureConnection:i,toggleHidden:s,selectedInstances:r,draggedSource:c}=e,[d,f]=l.useState(0),g=l.useCallback((e=>requestAnimationFrame((()=>{f((e=>(e+1)%9)),e>0&&g(e-1)}))),[]);l.useEffect((()=>{const e=g(10);return()=>{cancelAnimationFrame(e)}}),[g]),l.useEffect((()=>{const e=()=>{g(3)};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[g,d]);const v=e.connections.map((n=>{const o=r.includes(n.from.insId)||r.includes(n.to.insId);return(0,a.createElement)(t.SingleConnectionView,{...e,connection:n,type:"regular",parentSelected:o,key:n.from.insId+n.from.pinId+n.to.insId+n.to.pinId})}));if(i&&v.push((0,a.createElement)(t.SingleConnectionView,{...e,connection:i.connection,type:i.type,toggleHidden:s,parentSelected:!1,key:"future"})),c){const t=(c.from?p.calcStartPos:p.calcTargetPos)({connectionNode:null!==(n=c.from)&&void 0!==n?n:c.to,viewPort:o,boardPos:e.boardPos,ancestorsInsIds:e.ancestorsInsIds,currentInsId:e.currentInsId});v.push((0,u.jsx)(h.ConnectionViewPath,{className:"dragged",from:t,to:(0,m.logicalPosToRenderedPos)(e.lastMousePos,o),zoom:o.zoom},"dragged"))}return(0,u.jsx)("svg",{className:"connections-view",children:v})}},76064:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionViewPath=void 0;const i=n(35250),s=o(n(26372)),r=n(70079),a=n(23381);t.ConnectionViewPath=(0,r.forwardRef)(((e,t)=>{const{from:n,to:o,className:r,onContextMenu:u,zoom:l,dashed:c}=e,{x:d,y:p}=n,{x:f,y:m}=o,g=(0,a.calcBezierPath)({sourceX:d,sourceY:p,targetX:f,targetY:m,curvature:.15}),v=2.5*l,h=c?6*l:void 0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:g,ref:t,className:(0,s.default)("connection",r),style:{strokeWidth:v,strokeDasharray:h},onContextMenu:u}),e.label?(0,i.jsx)("text",{className:"label",x:(d+f)/2,y:(p+m)/2,fontSize:"12px"}):null,(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%"}),(0,i.jsx)("stop",{offset:"100%"})]})]})}))},23381:(e,t)=>{"use strict";var n;function o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i(e){let t,i,{pos:s,x1:r,y1:a,x2:u,y2:l,c:c}=e;switch(s){case n.Left:t=r-o(r-u,c),i=a;break;case n.Right:t=r+o(u-r,c),i=a;break;case n.Top:t=r,i=a-o(a-l,c);break;case n.Bottom:t=r,i=a+o(l-a,c)}return[t,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.getBezierCenter=t.calcBezierPath=t.Position=void 0,function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(n=t.Position||(t.Position={}));t.calcBezierPath=e=>{let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l});return`M${t},${o} C${c},${d} ${p},${f} ${r},${a}`},t.getBezierCenter=function(e){let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l}),m=.125*t+.375*c+.375*p+.125*r,g=.125*o+.375*d+.375*f+.125*a;return[m,g,Math.abs(m-t),Math.abs(g-o)]}},18243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcTargetPos=t.calcStartPos=t.calcPinPosition=void 0;const o=n(74762),i=n(30994),s={x:99999,y:99999};function r(e){const t=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds),pinId:e.pinId,pinType:e.pinType,isMain:e.isMain});return((e,t,n,o)=>{if(!e)return console.warn(`Cannot find element ${n} to calculate position.`),s;const{x:i,y:r,width:a,height:u}=e.getBoundingClientRect(),l=r+u/2;return{x:i+a/2-t.x,y:l-t.y}})(document.getElementById(t),e.boardPos,t,e.viewPort)}t.calcPinPosition=r;t.calcStartPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"input",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"output",boardPos:n,viewPort:s})};t.calcTargetPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"output",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"input",boardPos:n,viewPort:s})}},30994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPinDomId=t.getMainInstanceIndicatorDomId=t.getInstanceDomId=void 0;const o=n(74762);t.getInstanceDomId=(e,t)=>`ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getMainInstanceIndicatorDomId=(e,t)=>`main-ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getPinDomId=e=>{let{pinType:t,fullInsIdPath:n,pinId:o,isMain:i}=e;return`${i?"main-":""}pin:${t}:${n}:${o}`.replace(/\s+/g,"-")}},86553:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceView=t.getVisibleOutputs=t.getVisibleInputs=t.INSTANCE_INFO_TOOLTIP_DELAY=t.MAX_INSTANCE_WIDTH=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=n(66074),d=n(74762),p=r(n(26372)),f=n(2036),m=n(74762),g=n(74762),v=n(53159),h=n(83234),I=n(74762),y=n(30994),b=n(63521),C=n(74089),_=n(50382),x=r(n(99581)),N=n(88593),j=n(30653);t.PIECE_HORIZONTAL_PADDING=25,t.PIECE_CHAR_WIDTH=11,t.MIN_WIDTH_PER_PIN=40,t.MAX_INSTANCE_WIDTH=400,t.INSTANCE_INFO_TOOLTIP_DELAY=400;t.getVisibleInputs=(e,t,n)=>{const{visibleInputs:o}=e;if(o)return o;const i=(0,d.keys)((0,g.getNodeInputs)(t)).filter(((o,i)=>{var s;const r=n.some((t=>t.to.insId===e.id&&t.to.pinId===o)),a=t.inputs[o]&&"optional"===(null===(s=t.inputs[o])||void 0===s?void 0:s.mode);return r||!a&&o!==m.TRIGGER_PIN_ID}));return 0===i.length?[m.TRIGGER_PIN_ID]:i};t.getVisibleOutputs=(e,t,n)=>{const{visibleOutputs:o}=e;if(o)return o;const i=Object.keys(t.outputs);return n.some((t=>t.from.insId===e.id&&t.from.pinId===m.ERROR_PIN_ID))?[...i,m.ERROR_PIN_ID]:i};t.InstanceView=function(e){const{selected:n,selectedInput:o,selectedOutput:i,closestPin:s,dragged:r,onTogglePinLog:w,onTogglePinBreakpoint:P,onDetachConstValue:O,onCopyConstValue:E,onPasteConstValue:D,displayMode:S,connections:M,instance:k,viewPort:T,node:A,onPinClick:R,onPinDblClick:V,onDragStart:z,onDragEnd:$,onDragMove:H,onToggleSticky:G,onSelect:L,onDblClick:F,onChangeVisibleInputs:B,onChangeVisibleOutputs:U,onConvertConstToEnv:q,inlineGroupProps:W,onUngroup:Z,onExtractInlineNode:J,onGroupSelected:Y,isConnectedInstanceSelected:K,inlineEditorPortalDomNode:X,onChangeStyle:Q,onDeleteInstance:ee,onSetDisplayName:te,onPinMouseUp:ne,onPinMouseDown:oe}=e,ie=(0,j.useDarkMode)(),{id:se}=k,re=l.useMemo((()=>{const e=(0,d.randomInt)(6,1);return{icon:(0,d.pickRandom)([["fab","discord"],["fab","slack"],"bug","cube"]),color:e,size:(0,d.randomInt)(3,1),variation:(0,d.randomInt)(5,1)}}),[]),ae=l.useRef(),ue=l.useMemo((()=>k.style||A.defaultStyle||{}),[A,k]),le=ue.size||"regular",ce=l.useMemo((()=>new Map(M.filter((e=>{let{to:t}=e;return t.insId===se})).map((e=>{let{to:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),de=l.useMemo((()=>new Map(M.filter((e=>{let{from:t}=e;return t.insId===se})).map((e=>{let{from:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),pe=(0,C.usePrompt)(),fe=l.useCallback((e=>R(k,e,"input")),[k,R]),me=l.useCallback(((e,t)=>V(k,e,"input",t)),[k,V]),ge=l.useCallback(((e,t)=>V(k,e,"output",t)),[k,V]),ve=l.useCallback((e=>R(k,e,"output")),[k,R]),he=l.useCallback(((e,t)=>{z(k,e,t)}),[k,z]),Ie=l.useCallback(((e,t)=>{const n=k.pos,o=(t.x-n.x)/T.zoom,i=(t.y-n.y)/T.zoom,s=n.x+o,r=n.y+i;$(k,e,{...t,x:s,y:r})}),[k,$,T.zoom]),ye=l.useCallback(((e,t)=>{H(k,e,{x:t.x,y:t.y})}),[k,H]),be=l.useCallback((e=>G(k,e)),[k,G]),Ce=l.useCallback((e=>O(k,e)),[k,O]),_e=l.useCallback((e=>E(k,e)),[k,E]),xe=l.useCallback((e=>D(k,e)),[k,D]),Ne=l.useCallback((e=>L(k,e)),[k,L]),je=l.useCallback((e=>F(k,e.shiftKey)),[k,F]),we=(0,d.entries)(A.inputs),{visibleInputs:Pe,visibleOutputs:Oe}=k;Pe&&we.sort(((e,t)=>Pe.indexOf(e[0])-Pe.indexOf(t[0])));const Ee=(0,d.entries)(A.outputs);Oe&&Ee.sort(((e,t)=>Oe.indexOf(e[0])-Oe.indexOf(t[0])));const De=(0,t.getVisibleInputs)(k,A,M),Se=(0,t.getVisibleOutputs)(k,A,M);we.push([m.TRIGGER_PIN_ID,{...(0,d.nodeInput)(),description:"Use this pin to manually trigger the node. If not connected, the node will be triggered automatically when all required inputs have data."}]),Ee.push([m.ERROR_PIN_ID,{...(0,m.nodeOutput)(),description:"Use this pin to catch errors that happen inside this node. If not connected, errors will bubble up to the parent node."}]);const Me=we.filter((e=>{let[t]=e;return De.includes(t)||(n||K)&&ce.has(t)})),ke=Ee.filter((t=>{let[o]=t;return Se.includes(o)||(n||K)&&de.has(o)||o===m.ERROR_PIN_ID&&e.hadError})),Te=M.some((e=>e.from.insId===se&&e.from.pinId===m.ERROR_PIN_ID)),Ae=(0,p.default)("ins-view",{"no-inputs":0===we.length,"no-outputs":0===Ee.length,"display-mode":S,"force-minimized-input":"input"===e.forceShowMinimized||"both"===e.forceShowMinimized,"force-minimized-output":"output"===e.forceShowMinimized||"both"===e.forceShowMinimized,"inline-node-edited":!!W,"error-caught":Te}),Re=(0,p.default)({selected:n,dragged:r,closest:s&&s.ins.id===k.id},`size-${le}`),Ve=new Set((0,d.entries)(A.inputs).filter((e=>{let[t,n]=e;return(0,m.isInputPinOptional)(n)})).map(d.pickFirst)),ze=(0,d.entries)(k.inputConfig).reduce(((e,t)=>{let[n,o]=t;return(0,m.isStickyInputPinConfig)(o)||o.sticky?{...e,[n]:!0}:e}),{}),$e=(0,v.calcNodeContent)(k,A),He=e=>{const t=k.inputConfig[e];if((0,I.isStaticInputPinConfig)(t))return t.value},Ge=l.useCallback((async()=>{const e=(0,d.okeys)(A.inputs),t=await pe("New order?",(k.visibleInputs||e).join(","));t&&B(k,t.split(","))}),[A.inputs,pe,k,B]),Le=l.useCallback((async()=>{const e=(0,d.okeys)(A.outputs),t=await pe("New order?",(k.visibleOutputs||e).join(","));t&&U(k,t.split(","))}),[A.outputs,pe,k,U]),Fe=l.useCallback((()=>{ee(k)}),[ee,k]),Be=l.useCallback((async()=>{const e=await pe("Set custom display name",k.displayName||A.id);te(k,e)}),[pe,k,te,A.id]),Ue=Object.keys((0,g.getNodeInputs)(A)),qe=Object.keys((0,d.getNodeOutputs)(A)),We=l.useCallback((e=>{q&&q(k,e)}),[k,q]),Ze=l.useCallback(((e,t)=>{ne&&ne(k,e,t)}),[k,ne]),Je=l.useCallback(((e,t)=>{oe&&oe(k,e,t)}),[k,oe]),Ye=()=>(0,u.jsx)("div",{className:"inputs no-drag",children:Me.map((t=>{let[i,r]=t;var a;return(0,u.jsx)(f.PinView,{type:"input",currentInsId:k.id,ancestorsInsIds:e.ancestorsInsIds,id:i,optional:Ve.has(i),connected:ce.has(i),isSticky:ze[i],minimized:!n&&1===Me.length,onToggleSticky:be,onDetachConstValue:Ce,onCopyConstValue:_e,onPasteConstValue:xe,copiedConstValue:e.copiedConstValue,selected:i===o,onClick:fe,onDoubleClick:me,isClosestToMouse:!!s&&"input"===s.type&&s.pin===i,onToggleLogged:w,onToggleBreakpoint:P,onInspect:e.onInspectPin,constValue:He(i),onConvertConstToEnv:e.onConvertConstToEnv?We:void 0,description:r.description,queuedValues:null!==(a=e.queuedInputsData[i])&&void 0!==a?a:0,onMouseUp:Ze,onMouseDown:Je},i)}))}),Ke=()=>(0,u.jsx)("div",{className:"outputs no-drag",children:ke.map((t=>{let[o,r]=t;return(0,u.jsx)(f.PinView,{currentInsId:k.id,ancestorsInsIds:e.ancestorsInsIds,connected:de.has(o),type:"output",id:o,minimized:!n&&1===ke.length,isClosestToMouse:!!s&&"output"===s.type&&s.pin===o,selected:o===i,onClick:ve,onDoubleClick:ge,onToggleLogged:w,onToggleBreakpoint:P,onInspect:e.onInspectPin,description:r.description,onMouseUp:Ze,onMouseDown:Je},o)}))}),Xe=l.useCallback((e=>{Q(k,e)}),[k,Q]),Qe=l.useCallback((()=>{const e=[...Ue.map((e=>{const t=De.includes(e),n=ce.has(e)&&!0!==ce.get(e),o=(0,d.getInputName)(e);return{text:t?n?`Hide input "${o}" (disconnect first)`:`Hide input "${o}"`:`Show input "${o}"`,onClick:()=>B(k,t?De.filter((t=>t!==e)):[...De,e]),disabled:n&&t}})),...qe.map((e=>{const t=Se.includes(e),n=de.has(e),o=(0,d.getOutputName)(e);return{text:t?n?`Hide output "${o}" (disconnect first)`:`Hide output "${o}"`:`Show output "${o}"`,onClick:()=>U(k,t?Se.filter((t=>t!==e)):[...Se,e]),disabled:n&&t}})),...(0,d.isInlineNodeInstance)(k)&&(0,g.isVisualNode)(k.node)?[{text:"Ungroup inline node",onClick:()=>Z(k)}]:[],...(0,d.isInlineNodeInstance)(k)?[{text:"Extract inline node to file",onClick:()=>J(k)}]:[],{text:"Reorder inputs",onClick:Ge},{text:"Reorder outputs",onClick:Le},{text:"Set display name",onClick:Be},{text:"Group selected instances",onClick:Y},{text:"Delete instance",intent:"danger",onClick:Fe}];return(0,u.jsxs)(_.Menu,{children:[(0,u.jsx)(_.MenuItem,{text:"Style",children:(0,u.jsx)(N.NodeStyleMenu,{style:ue,onChange:Xe,promptFn:pe})}),e.map(((e,t)=>(0,a.createElement)(_.MenuItem,{...e,key:t})))]})}),[Ue,qe,k,Ge,Le,Be,Fe,ue,Xe,pe,De,ce,B,Se,de,U,Z,J,Y]),et={"--node-color":ue.color,...ue.cssOverride||{}},tt=(0,y.getInstanceDomId)(k.id,e.ancestorsInsIds);return(0,u.jsx)("div",{className:Ae,children:(0,u.jsx)(h.BaseNodeView,{pos:k.pos,viewPort:T,onDragStart:he,onDragMove:ye,onDragEnd:Ie,upperRenderer:Ye,bottomRenderer:Ke,displayMode:S,domId:tt,children:(0,u.jsxs)(l.Fragment,{children:[Ye(),W?x.default.createPortal((0,u.jsxs)("div",{className:"inline-group-editor-container no-drag",children:[(0,u.jsxs)("header",{children:[$e," ",(0,u.jsx)("button",{onClick:e.onCloseInlineEditor,children:"close"})]}),(0,u.jsx)(b.VisualNodeEditor,{...e.inlineGroupProps,className:"no-drag",ref:ae})]}),X):(0,u.jsx)(_.ContextMenu,{className:(0,p.default)("ins-view-inner",Re,`size-${re.size}`,{dark:ie}),onClick:Ne,onDoubleClick:je,content:Qe(),style:et,children:(0,u.jsx)(_.Tooltip,{content:A.description,children:(0,u.jsxs)(l.Fragment,{children:[ue.icon?(0,u.jsx)(c.FontAwesomeIcon,{icon:ue.icon}):null," ",$e]})})}),Ke()]})})})}},53568:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStyleMenu=t.nodeStylePresetColors=void 0;const r=n(35250),a=n(50382),u=s(n(70079)),l=n(84472);t.nodeStylePresetColors=[{name:"Amethyst",color:"#9b5de5"},{name:"Magenta",color:"#f15bb5"},{name:"Yellow",color:"#fee440"},{name:"Capri",color:"#00bbf9"},{name:"Sea Green",color:"#00f5d4"},{name:"Orange",color:"#ff7f00"}];const c={size:"regular"};t.NodeStyleMenu=e=>{var n;const{onChange:o,style:i}=e,s=i||c,d=e.promptFn,p=u.default.useCallback(((e,t)=>{o({...s,[e]:t})}),[s,o]),f=u.default.useCallback((async()=>{const e=await d("Icon name? (Font Awesome conventions)","rocket"),t=e.includes(",")?e.split(","):e;p("icon",t)}),[d,p]),m=(0,u.useCallback)((async()=>{const e=await d("Enter a custom style (valid JSON representing a React CSS object)",s.cssOverride?JSON.stringify(s.cssOverride):"");try{const t=JSON.parse(e);p("cssOverride",t)}catch(t){console.error(t),(0,l.toastMsg)("Invalid object","danger")}}),[d,p,s.cssOverride]);return(0,r.jsxs)(u.default.Fragment,{children:[(0,r.jsxs)(a.MenuItem,{text:"Color",children:[t.nodeStylePresetColors.map((e=>(0,r.jsx)(a.MenuItem,{text:e.name,onClick:()=>p("color",e.color)},e.name))),(0,r.jsx)(a.MenuDivider,{}),(0,r.jsx)(a.MenuItem,{text:"Remove Color",onClick:()=>p("color",void 0)})]}),(0,r.jsxs)(a.MenuItem,{text:`Size (${null!==(n=s.size)&&void 0!==n?n:"regular"})`,children:[(0,r.jsx)(a.MenuItem,{text:"Small",onClick:()=>p("size","small")}),(0,r.jsx)(a.MenuItem,{text:"Regular",onClick:()=>p("size","regular")}),(0,r.jsx)(a.MenuItem,{text:"Large",onClick:()=>p("size","large")})]}),(0,r.jsxs)(a.MenuItem,{text:"Icon",children:[(0,r.jsx)(a.MenuItem,{text:"Choose Icon",onClick:f}),(0,r.jsx)(a.MenuItem,{text:"Remove Icon",onClick:()=>p("icon",void 0)})]}),(0,r.jsx)(a.MenuItem,{text:"Custom Styling",onClick:m})]})}},88593:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(53568),t)},83651:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86553),t)},53159:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calcInstancePosition=t.calcNodeWidth=t.calcNodeContent=void 0;const i=n(74762),s=o(n(6576)),r=n(86553),a=n(61888),u=n(30994);t.calcNodeContent=(e,t)=>{if(e.displayName)return e.displayName;if(t.customViewCode)try{const n=Object.entries(e.inputConfig).filter((e=>{let[,t]=e;return(0,i.isStaticInputPinConfig)(t)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o.value}}),{});return s.default.compile(t.customViewCode)({inputs:n}).trim()}catch(n){return console.error("Error with custom view",n),`Error in custom view [${t.id}]`}return t.id};t.calcNodeWidth=(e,n)=>{const o=(0,i.okeys)(n.inputs).length*r.MIN_WIDTH_PER_PIN,s=(0,t.calcNodeContent)(e,n),u=r.PIECE_CHAR_WIDTH;return(0,a.clamp)(s.length*u+2*r.PIECE_HORIZONTAL_PADDING,o,r.MAX_INSTANCE_WIDTH)};t.calcInstancePosition=(e,t,n)=>{const o=(0,u.getInstanceDomId)(e,t),i=document.getElementById(o);if(i){const{x:e,y:t,width:o,height:s}=i.getBoundingClientRect(),r=t+s/2;return{x:e+o/2-n.x,y:r-n.y}}return console.warn("Cannot find element to draw connection to",o),{x:99999,y:99999}}},17841:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutDebugger=t.LayoutDebuggerItem=t.PosDebugger=void 0;const i=n(70079),s=n(35250),r=n(74762),a=o(n(70079)),u=n(7047),l=e=>{let{pos:t}=e;return(0,s.jsxs)("span",{children:[t.x.toFixed(1),", ",t.y.toFixed(1)]})};t.PosDebugger=e=>(0,s.jsx)("span",{className:"pos-debugger",children:(0,s.jsx)(l,{pos:e.pos})});t.LayoutDebuggerItem=e=>{const{pos:n,viewPort:o,size:i,color:r}=e,a=o.zoom,u=n.x*a-o.pos.x*a,l=n.y*a-o.pos.y*a,c={transform:`translate(${u-n.x}px, ${l-n.y}px)`},d={transform:`scale(${o.zoom})`},p={transform:`translate(${n.x}px, ${n.y}px)`},f={width:`${i.width}px`,height:`${i.height}px`,backgroundColor:r};return(0,s.jsx)("div",{className:"layout-debugger",style:c,children:(0,s.jsxs)("span",{className:"drag-sim",style:p,children:[(0,s.jsx)(t.PosDebugger,{pos:n}),(0,s.jsx)("div",{className:"layout-debugger-zoom-wrapper",style:d,children:(0,s.jsx)("div",{className:"layout-debugger-inner",style:f})})]})})};const c=(()=>{try{return"true"===localStorage.getItem("pos-debugger")}catch(e){return!1}})();t.LayoutDebugger=e=>{const{extraDebug:n,vp:o,node:d,mousePos:p}=e;if(!c)return null;const f=n.map(((e,n)=>(0,i.createElement)(t.LayoutDebuggerItem,{...e,key:n}))),m=[...d.instances.map((e=>e.pos)),...(0,r.values)(d.inputsPosition),...(0,r.values)(d.outputsPosition)].map((e=>(0,s.jsx)(t.LayoutDebuggerItem,{pos:e,viewPort:o,size:{width:0,height:0},color:"red"}))),g=(0,u.logicalPosToRenderedPos)(p,o),v=(0,s.jsxs)("div",{className:"viewport-data",children:[(0,s.jsxs)("div",{children:["Pos: ",(0,s.jsx)(l,{pos:o.pos})]}),(0,s.jsxs)("div",{children:["Zoom: ",o.zoom.toFixed(2)," "]}),(0,s.jsxs)("div",{children:["Mouse (logical): ",(0,s.jsx)(l,{pos:p})]}),(0,s.jsxs)("div",{children:["Rendered (rendered): ",(0,s.jsx)(l,{pos:g})]})]});return(0,s.jsxs)(a.default.Fragment,{children:[v,f,m]})}},44338:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(17841),t)},38259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateInstancesWithSingleConstPinsMap=t.getLeafInstancesOfSelection=void 0;t.getLeafInstancesOfSelection=(e,t,n)=>e.reduce(((e,o)=>[...e,...n.filter((e=>e.to.insId===o.id)).map((e=>t.find((t=>t.id===e.from.insId)))).filter((e=>!!e))]),[]).filter((t=>1===n.filter((e=>e.from.insId===t.id||e.to.insId===t.id)).length&&!e.includes(t)));t.calculateInstancesWithSingleConstPinsMap=(e,t)=>{const{connections:n}=e;return n.filter((e=>t.has(e.from.insId))).reduce(((e,n)=>{const o=t.get(n.from.insId),i=n.to.insId,s=e.get(i)||new Map;return s.set(n.to.pinId,{val:o,insId:n.from.insId}),e.set(i,s),e}),new Map)}},37488:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeIoView=void 0;const a=n(35250),u=n(70079),l=s(n(70079)),c=n(74762),d=n(83234),p=r(n(26372)),f=n(50382),m=n(43490),g=n(66189),v=n(74762),h=n(30994),I=n(30653);t.NodeIoView=l.memo((function(e){const{viewPort:t,selected:n,pos:o,type:i,id:s,onDblClick:r,onRename:y,onDelete:b,onChangeInputMode:C,inputMode:_,onSelect:x,closest:N,onSetDescription:j,description:w,onMouseUp:P,onMouseDown:O,currentInsId:E}=e,{history:D,resetHistory:S,refreshHistory:M}=(0,g.useHistoryHelpers)(E,s,i),k=(0,m.usePrompt)(),T=l.useCallback((async()=>{const e=await k("Description?",w);j(i,s,e)}),[k,w,j,i,s]),A=l.useCallback((()=>{b&&b(i,s)}),[i,s,b]),R=l.useCallback((()=>{y&&y(i,s)}),[i,s,y]),V=l.useCallback((e=>{C&&C(s,e)}),[s,C]),z=l.useCallback((()=>[{text:`Current mode - ${_}`,onClick:c.noop},{text:"Make required",onClick:()=>V("required")},{text:"Make optional",onClick:()=>V("optional")},{text:"Make required-if-connected",onClick:()=>V("required-if-connected")},{text:"Set description",onClick:T},...e.onRename?[{text:"Rename",onClick:R}]:[],...e.onDelete?[{text:"Delete",onClick:A}]:[]]),[T,_,V,A,R,e.onDelete,e.onRename]),$=l.useCallback((t=>{r&&r(e.id,t)}),[r,e.id]),H=l.useCallback((()=>{x(s,i)}),[s,i,x]),G=l.useCallback((()=>(0,a.jsx)(f.Menu,{children:z().map(((e,t)=>(0,u.createElement)(f.MenuItem,{...e,key:t})))})),[z]),L="input"===i?(0,v.getInputName)(s):(0,c.getOutputName)(s),F=l.useCallback((e=>{P(s,i,e)}),[s,P,i]),B=l.useCallback((e=>{O(s,i,e)}),[s,O,i]),U=(0,I.useDarkMode)();return(0,a.jsx)(d.BaseNodeView,{className:(0,p.default)("node-io-view",i,{dark:U}),pos:o,onDragEnd:(n,o)=>{const r=e.pos,a=(o.x-r.x)/t.zoom,u=(o.y-r.y)/t.zoom,l=r.x+a,c=r.y+u;e.onDragEnd(i,s,n,{...o,x:l,y:c})},onDragStart:(t,n)=>{e.onDragStart(s,t,n)},onDragMove:(t,n)=>{e.onDragMove(i,s,t,{x:n.x,y:n.y})},viewPort:t,children:(0,a.jsx)(l.Fragment,{children:(0,a.jsx)(f.Tooltip,{content:(()=>{const t=(0,g.calcHistoryContent)(D),n=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:L})," (",i,")"," "]}),n,(0,a.jsx)("hr",{}),t]})})(),children:(0,a.jsx)(f.ContextMenu,{onMouseEnter:M,onMouseOut:S,onMouseUp:F,onMouseDown:B,"data-tip":"","data-html":!0,"data-for":s+e.currentInsId,className:(0,p.default)("node-io-view-inner",{closest:N,selected:n,dark:U}),id:(0,h.getPinDomId)({fullInsIdPath:(0,c.fullInsIdPath)(e.currentInsId,e.ancestorInsIds),pinId:s,pinType:i,isMain:!0}),onClick:H,onDoubleClick:$,content:G(),children:s})})})})}))},66005:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37488),t)},83782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcNodeIoWidth=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0,t.PIECE_HORIZONTAL_PADDING=15,t.PIECE_CHAR_WIDTH=9,t.MIN_WIDTH_PER_PIN=40;t.calcNodeIoWidth=e=>Math.max(t.MIN_WIDTH_PER_PIN,e.length*t.PIECE_CHAR_WIDTH+2*t.PIECE_HORIZONTAL_PADDING)},99942:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderVisualNode=t.layoutToInstances=void 0;const i=n(63521),s=n(74762),r=n(90794),a=o(n(53865)),u=n(83782),l=n(60190),c=n(53159),d=n(41032);t.layoutToInstances=(e,t)=>(0,a.default)(t,(t=>{(0,s.entries)(e.nodes).forEach((e=>{let[n,o]=e;if(n.startsWith("ins-")){const e=n.replace("ins-",""),i=t.instances.find((t=>t.id===e));i?i.pos=o.p:console.warn("WAT")}if(n.startsWith("node-input-")){const e=n.replace("node-input-","");t.inputsPosition[e]=o.p}if(n.startsWith("node-output-")){const e=n.replace("node-output-","");t.outputsPosition[e]=o.p}}))}));t.orderVisualNode=(e,n,o,a)=>{const{instances:p,connections:f}=e,m={...p.reduce(((e,t)=>{const o=(0,l.size)((0,c.calcNodeWidth)(t,(0,d.safelyGetNodeDef)(t,n)),i.NODE_HEIGHT);return{...e,[`ins-${t.id}`]:{p:t.pos,s:o}}}),{}),...(0,s.okeys)(e.inputsPosition).reduce(((t,n)=>({...t,[`node-input-${n}`]:{p:e.inputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{}),...(0,s.okeys)(e.outputsPosition).reduce(((t,n)=>({...t,[`node-output-${n}`]:{p:e.outputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{})},g=f.map((e=>[(0,s.isExternalConnectionNode)(e.from)?`node-input-${e.from.pinId}`:`ins-${e.from.insId}`,(0,s.isExternalConnectionNode)(e.to)?`node-output-${e.to.pinId}`:`ins-${e.to.insId}`])),v=(0,r.orderLayout)({nodes:m,edges:g},o,((n,o)=>{a&&a((0,t.layoutToInstances)(n,e),o)}));return(0,t.layoutToInstances)(v,e)}},90794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderLayout=void 0;const o=n(60190),i=400,s=e=>e.reduce(((e,t)=>{const n=(0,o.vSub)(t.p,(0,o.vec)(t.s.width/2,t.s.height/2));return{...e,[t.id]:{p:n,s:t.s}}}),{});t.orderLayout=(e,t,n)=>{let{nodes:r,edges:a}=e,u=Object.entries(r).map((e=>{let[t,n]=e;return{id:t,p:(0,o.vAdd)(n.p,(0,o.vec)(n.s.width/2,n.s.height/2)),f:(0,o.vec)(0,0),v:(0,o.vec)(0,0),m:1,s:n.s}})),l=0;for(;l.01);){let e=u;for(let t=0;t{let n=e.find((e=>e.id===t[0])),i=e.find((e=>e.id===t[1]));if(!n||!i)return void console.warn("weoops",t[0],t[1]);const s=(0,o.vec)(0,-200),r=(0,o.vSub)(n.p,i.p),a=(0,o.vSub)(s,r),u=1e3*(0,o.vLen)(a),l=(0,o.vMul)((0,o.vNorm)(a),.5*u),c=(0,o.vMul)((0,o.vNorm)(a),-.5*u);n.f=(0,o.vAdd)(n.f,l),i.f=(0,o.vAdd)(i.f,c)})),e=e.map((e=>(0,o.itrPhysics)(15,e))),e=e.map((e=>{const t=(0,o.vMul)(e.v,.5),n=(0,o.vLen)(t)>100?(0,o.vMul)((0,o.vNorm)(t),100):t;return{...e,v:n}})),u=e,n&&n({nodes:s(e),edges:a},l),l++}return{nodes:s(u),edges:a,itrs:l,timeout:l>=t,total:(0,o.totalEnergy)(u)}}},2036:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PinView=t.PIN_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=n(50382),d=n(18420),p=n(74762),f=n(30994),m=n(96233),g=n(66189),v=n(30653);t.PIN_HEIGHT=23;t.PinView=u.memo((function(e){const{selected:t,type:n,connected:o,optional:i,currentInsId:s,isClosestToMouse:r,id:h,onMouseDown:I,onMouseUp:y}=e,{history:b,resetHistory:C,refreshHistory:_}=(0,g.useHistoryHelpers)(s,h,n),x=(0,v.useDarkMode)(),N="input"===n?(0,p.getInputName)(h):(0,p.getOutputName)(h),j="input"===e.type&&(0,d.isDefined)(e.constValue)?e.constValue:void 0,w=u.useCallback((e=>{0===e.button&&I(h,n,e)}),[h,n,I]),P=u.useCallback((e=>{0===e.button&&y(h,n,e)}),[h,n,y]);return(0,a.jsxs)("div",{className:(()=>{if("input"===e.type){const{isSticky:s,constValue:a}=e;return(0,l.default)("pin",{sticky:s,selected:t,closest:r,optional:i,connected:o,"const-value":(0,d.isDefined)(a),"env-value":(0,d.isDefined)(a)&&(0,p.isEnvValue)(a),minimized:e.minimized,dark:x},n)}return(0,l.default)("pin",{selected:t,connected:o,closest:r,optional:i,minimized:e.minimized,"error-pin":h===p.ERROR_PIN_ID,dark:x},n)})(),"data-pin-id":h,children:[(0,a.jsx)(c.Tooltip,{className:"pin-info-tooltip",content:(()=>{const t=(0,g.calcHistoryContent)(b,"input"===n?e.queuedValues:void 0),o=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:N})," (",n,")"," "]}),o,(0,a.jsx)("hr",{}),(0,d.isDefined)(j)?(0,a.jsxs)("div",{children:["Static value:"," ",(0,a.jsx)("strong",{children:(0,m.valuePreview)(j).substring(0,200)})]}):t]})})(),children:(0,a.jsxs)(c.ContextMenu,{onMouseEnter:_,onMouseOut:C,onMouseDown:w,onMouseUp:P,"data-tip":"","data-html":!0,"data-for":h+e.currentInsId,id:(0,f.getPinDomId)({fullInsIdPath:(0,p.fullInsIdPath)(e.currentInsId,e.ancestorsInsIds),pinId:h,pinType:n,isMain:!1}),onDoubleClick:t=>e.onDoubleClick&&e.onDoubleClick(h,t),className:(0,l.default)("pin-inner",{dark:x}),onClick:t=>{const{onShiftClick:o,onClick:i,id:s}=e;t.shiftKey&&o?o(s,t):i(s,n,t)},content:(()=>{const t=(0,a.jsx)(c.MenuItem,{onClick:()=>e.onInspect(e.currentInsId,{id:e.id,type:e.type}),text:"Inspect"});if("input"===e.type){const{onConvertConstToEnv:n}=e;return(0,d.isDefined)(j)?(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onDetachConstValue(e.id),text:"Detach value"}),(0,a.jsx)(c.MenuItem,{onClick:()=>e.onCopyConstValue(e.id),text:"Copy value"}),(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null,n?(0,a.jsx)(c.MenuItem,{onClick:()=>n(e.id),text:"Convert to Env Var"}):null]}):(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onToggleSticky(e.id),text:"Toggle sticky (square means sticky)"}),t,(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null]})}return(0,a.jsx)(c.Menu,{children:t})})(),children:[N," ",(0,d.isDefined)(j)?(0,a.jsxs)(u.Fragment,{children:[":",(0,a.jsx)("span",{className:"value",children:(0,d.toString)(j)})]}):null,"input"===e.type&&e.isSticky?(0,a.jsx)("span",{className:"suffix",children:"s"}):null,"input"===e.type&&e.queueSize?(0,a.jsxs)("span",{className:"suffix",children:[e.queueSize," in Q"]}):null]})}),(0,a.jsx)("div",{className:"wire"})]})}))},66189:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHistoryHelpers=t.calcHistoryContent=void 0;const i=n(35250),s=n(96233),r=o(n(70079)),a=n(70079),u=n(98158);t.calcHistoryContent=(e,t)=>{if(e){const{total:n,lastSamples:o}=e,a=(0,i.jsxs)("strong",{children:["Activated ",n," times this session"]}),u=o.length>0?(0,i.jsxs)("div",{children:["Last value:"," ",(0,i.jsx)("strong",{children:(0,s.valuePreview)(o[0].val).substring(0,200)}),(0,i.jsx)("br",{}),(0,i.jsx)("em",{children:"Inspect instance for the full value"})]}):"",l=t?(0,i.jsx)(r.default.Fragment,{children:(0,i.jsxs)("div",{children:["Queued values: ",(0,i.jsx)("strong",{children:t})]})}):"";return(0,i.jsxs)(r.default.Fragment,{children:[a,u,l]})}return"Loading session data.."};t.useHistoryHelpers=(e,t,n)=>{const o=(0,a.useRef)(),{onRequestHistory:i}=(0,u.useDebuggerContext)(),[s,l]=(0,a.useState)();return{history:s,refreshHistory:(0,a.useCallback)((()=>{clearInterval(o.current),i(e,t,n).then((e=>{l(e)})),o.current=setInterval((()=>{i(e,t,n).then((e=>{l(e)}))}),500)}),[e,i,t,n]),resetHistory:r.default.useCallback((()=>{clearInterval(o.current),l(void 0)}),[])}}},89440:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAddMenu=void 0;const r=n(35250),a=s(n(70079)),u=n(74762),l=n(50382),c=n(70457),d=n(9958),p=n(86125),f=c.Select.ofType(),m=e=>{switch(e.type){case"node":return`${e.node.id}`;case"value":return"Add inline value or function";case"import":return`Import ${e.importableNode.node.id} from ${e.importableNode.module}`}},g=(e,t)=>{let{handleClick:n,modifiers:o,query:i}=t;if(!o.matchesPredicate)return null;const s=m(e);return"value"===e.type?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(l.MenuDivider,{}),(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))]}):(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))},v=(e,t,n,o)=>{const i=m(t).toLocaleLowerCase(),s=e.toLowerCase();return o?i===s:i.includes(s)};t.QuickAddMenu=e=>{const{resolvedDependencies:t,targetNode:n}=e,o={left:e.pos.x,top:e.pos.y},{onRequestImportables:i}=(0,p.useDependenciesContext)(),[s,c]=a.useState();a.useEffect((()=>{i().then((e=>c(e.importables)))}),[i]);const d=(0,u.values)({...t,[n.id]:n}),m=d.map((e=>({type:"node",node:e}))),h=new Set(d.map((e=>e.id))),I=s?s.filter((e=>!h.has(e.node.id))).map((e=>({type:"import",importableNode:e}))):[],y=m.concat(I).concat({type:"value"});return(0,r.jsx)("div",{className:"quick-add-menu",style:o,children:(0,r.jsx)(f,{className:"quick-add-nodes-select",items:y,itemPredicate:v,itemRenderer:g,inputProps:{className:"quick-add-input"},noResults:(0,r.jsx)(l.MenuItem,{disabled:!0,text:"No results."}),onItemSelect:t=>e.onAdd(t),popoverProps:{isOpen:!0,onClose:()=>e.onClose()}})})}},71033:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89440),t)},73470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimePlayer=void 0;const o=n(74762),i=n(64955),s=(0,o.debugLogger)("runtime-player");t.createRuntimePlayer=()=>{let e=0,t=[];let n=!1,r=Date.now(),a=e;const u=()=>requestAnimationFrame((()=>{const l=Date.now();a=e,e+=l-r,r=l,((e,n)=>{const r=t;t=[],r.length&&s(`Playing ${r.length} events from`,e,n),r.forEach((e=>{s("Playing event",e),(0,i.playEvent)(e),e.insId===o.ROOT_INS_ID&&e.type===o.DebuggerEventType.PROCESSING_CHANGE&&!1===e.val&&(s("Main instance is done processing, clearing runtime UI",e),c())}))})(a,e),n&&u()})),l=()=>{n=!1},c=()=>{document.querySelectorAll("[data-runtime]").forEach((e=>{e.removeAttribute("data-runtime")})),document.querySelectorAll("[data-runtime-queue]").forEach((e=>{e.removeAttribute("data-runtime-queue")})),t=[]};return{stop:l,start:function(t){void 0===t&&(t=0),n=!0,e=t,r=Date.now(),u()},addEvents:e=>{t.push(...e)},destroy:()=>{l(),c()},clear:c,status:()=>({running:n,currDt:e,lastDt:a,queue:t,last:r})}}},64955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playEvent=t.cancelTimers=void 0;const o=n(74762),i=n(30994),s=5e3,r=(0,o.debugLogger)("runtime-player:play-event"),a=(e,t)=>e.type===o.DebuggerEventType.INPUT_CHANGE||e.type===o.DebuggerEventType.OUTPUT_CHANGE?`${(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds)}.${e.pinId}`:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds);t.cancelTimers=new Map;t.playEvent=e=>{switch(e.type){case o.DebuggerEventType.INPUT_CHANGE:case o.DebuggerEventType.OUTPUT_CHANGE:{const{pinId:n,insId:u,ancestorsInsIds:l}=e,c=e.type===o.DebuggerEventType.INPUT_CHANGE?"input":"output",d=[(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!0})];u!==o.ROOT_INS_ID&&d.push((0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!1})),d.forEach(((i,l)=>{const c=a(e);clearTimeout(t.cancelTimers.get(c));const d=document.getElementById(i),p=`${u}.${n}`,f=e.type===o.DebuggerEventType.OUTPUT_CHANGE?document.querySelectorAll(`[data-from-id="${p}"]`):[];if(d){clearTimeout(t.cancelTimers.get(c)),d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),setTimeout((()=>{d.setAttribute("data-runtime","active"),f.forEach((e=>{e.setAttribute("data-runtime","active")}))}),0);const n=setTimeout((()=>{d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),t.cancelTimers.delete(c)}),s);t.cancelTimers.set(a(e),n)}else console.warn(`No DOM element with Id [${i}] found to play event`),r(`No DOM element with Id [${i}] found to play event`,e)}));break}case o.DebuggerEventType.PROCESSING_CHANGE:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(l)if(!0===e.val)l.setAttribute("data-runtime","processing"),clearTimeout(t.cancelTimers.get(u));else{l.removeAttribute("data-runtime"),setTimeout((()=>{"error"!==l.getAttribute("data-runtime")&&l.setAttribute("data-runtime","done")}),0);const e=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,e)}else r(`No DOM element with Id [${n}] found to play event`,e)}));break}case o.DebuggerEventType.ERROR:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(!l)return void r(`No DOM element with Id [${n}] found to play event`,e);clearTimeout(t.cancelTimers.get(u)),l.removeAttribute("data-runtime"),setTimeout((()=>{l.setAttribute("data-runtime","error")}));const c=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,c)}));const c={...e,type:o.DebuggerEventType.OUTPUT_CHANGE,pinId:o.ERROR_PIN_ID};(0,t.playEvent)(c);break}case o.DebuggerEventType.INPUTS_STATE_CHANGE:(0,o.entries)(e.val).forEach((t=>{let[n,s]=t;const{insId:a,ancestorsInsIds:u}=e,l=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(a,u),pinId:n,pinType:"input",isMain:!1}),c=document.getElementById(l);c?s>0?c.setAttribute("data-runtime-queue",`${s}`):c.removeAttribute("data-runtime-queue"):r(`No DOM element with Id [${l}] found to play event`,e)}))}}},25804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounce=void 0;const o=n(70079);t.useDebounce=function(e,t){const[n,i]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}},7047:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.handleChangeNodeInputType=t.handleIoPinRename=t.handleInstanceDrag=t.getInstancesInRect=t.isJsxValue=t.getMiddleOfViewPort=t.fitViewPortToNode=t.centerBoardPosOnTarget=t.renderedPosToLogicalPos=t.logicalPosToRenderedPos=t.getEffectiveNodeDimensions=t.calcNodesPositions=t.calcSelectionBoxArea=t.animateViewPort=t.easeInOutNum=t.easeInOutPos=t.easeInOutQuad=t.center=t.distance=t.clamp=t.domToViewPort=t.roundNumber=t.createNewNodeInstance=t.createNewInlineNodeInstance=t.parseInputOutputTypes=t.parsePromptValue=t.getSelectionBoxRect=t.findClosestPin=t.changePinConfig=t.getInstancePinConfig=t.emptyList=t.emptyObj=void 0;const r=s(n(53865)),a=n(30721),u=n(63521),l=n(74762),c=n(18243),d=n(74762),p=n(53159),f=n(83782),m=n(60190),g=n(38259),v=n(83651),h=n(41032);t.emptyObj={},t.emptyList=[],t.getInstancePinConfig=function(e,n,o){var i;const s=e.instances.find((e=>e.id===n));if(!s)throw new Error(`Instance ${n} not found`);return null!==(i=(s.inputConfig||t.emptyObj)[o])&&void 0!==i?i:(0,l.queueInputPinConfig)()};t.changePinConfig=(e,t,n,o)=>r.produce(e,(e=>{var i;const{instances:s}=e,r=s.find((e=>e.id===t));if(!r)throw new Error("blah");const a=null!==(i=r.inputConfig)&&void 0!==i?i:{};a[n]=o,e.instances=s.map((e=>e===r?{...r,inputConfig:a}:e))}));t.findClosestPin=(e,t,n,o,i,s,r)=>{const a=(0,l.nodeInstance)(e.id,e.id),u=(0,d.okeys)(e.inputs).map((e=>({id:e,type:"input",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),p=(0,d.okeys)(e.outputs).map((e=>({id:e,type:"output",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),f=[...u,...e.instances.reduce(((n,a)=>{const u=(0,h.safelyGetNodeDef)(a,t),d=(0,v.getVisibleInputs)(a,u,e.connections),p=(0,v.getVisibleOutputs)(a,u,e.connections);return[...n,...d.map((e=>({ins:a,type:"input",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!1}),id:e}))),...p.map((e=>({ins:a,type:"output",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!1}),id:e})))]}),[]),...p];let m={dis:1e5,item:f[0]};return f.forEach((e=>{const t=e.pos.x-n.x,o=e.pos.y-n.y,i=Math.sqrt(t*t+o*o);i{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x,t.x)-n,h:Math.max(e.y,t.y)-o}};t.parsePromptValue=e=>{if(null===e)return;const t=parseInt(e,10);let n=e;return t.toString()!=e||isNaN(t)||(n=t),n};t.parseInputOutputTypes=e=>{const[,t,n]=e.match(/node\((.+)\|(.+)\)/)||[],o=(0,d.entries)(JSON.parse(t)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]})),i=(0,d.entries)(JSON.parse(n)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]}));return{inputs:(0,d.fromEntries)(o),outputs:(0,d.fromEntries)(i)}};t.createNewInlineNodeInstance=function(e,t,n){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const o=(0,l.inlineNodeInstance)(`${e.id}-${(0,d.randomInt)(999)}`,e,{},{x:0,y:0}),i=(0,p.calcNodeWidth)(o,e),{x:s,y:r}=n,a={x:s-i/2,y:r+t};return{...o,pos:a}};t.createNewNodeInstance=function(e,t,n,o){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const i="string"==typeof e?(0,h.safelyGetNodeDef)(e,o):e;if(!i)throw new Error(`${e} node not found in resolvedNodes`);const s=(0,d.entries)(i.inputs).reduce(((e,t)=>{let[n,o]=t;return o.defaultValue&&(e[n]=(0,l.staticInputPinConfig)(o.defaultValue)),e}),{}),r=(0,l.nodeInstance)((0,a.createId)(),i.id,s,{x:0,y:0}),c=(0,p.calcNodeWidth)(r,i),{x:f,y:m}=n,g={x:f-c/2,y:m+t};return{...r,pos:g}};t.roundNumber=e=>Math.round(100*e)/100;t.domToViewPort=(e,n,o)=>({x:(0,t.roundNumber)(n.pos.x+e.x/n.zoom/o.zoom),y:(0,t.roundNumber)(n.pos.y+e.y/n.zoom/o.zoom)});t.clamp=(e,t,n)=>Math.max(e,Math.min(t,n));t.distance=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)};t.center=(e,t,n)=>{let{zoom:o}=n;const i=e.x+e.w/2,s=e.y+e.h/2,{w:r,h:a}=t;return{x:i-r/o/2,y:s-a/o/2}};t.easeInOutQuad=e=>e<.5?2*e*e:(4-2*e)*e-1;t.easeInOutPos=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i),a=(0,t.easeInOutQuad)(r),u=n.x-e.x,l=n.y-e.y;return{x:e.x+u*a,y:e.y+l*a}};t.easeInOutNum=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i);return e+(n-e)*(0,t.easeInOutQuad)(r)};t.animateViewPort=(e,n,o,i)=>{const s=(0,t.distance)(e.pos,n.pos),r=Date.now(),a=o;if(0===s)return void i(e);const u=()=>{const o=Date.now(),s=(0,t.easeInOutPos)(e.pos,n.pos,r,a,o),l=(0,t.easeInOutNum)(e.zoom,n.zoom,r,a,o);o-r{const n=(0,t.getSelectionBoxRect)(e.from,e.to);return n.h*n.w};const I=(e,t,n,o)=>({left:n.x,right:n.x+e,top:n.y,bottom:n.y+t,tag:o,center:(0,l.calcCenter)({w:e,h:t,...n})});t.calcNodesPositions=(e,t)=>[...e.instances.map((e=>{const n=(0,p.calcNodeWidth)(e,(0,h.safelyGetNodeDef)(e,t)),o=u.NODE_HEIGHT;return I(n,o,e.pos,e.id)})),...(0,d.okeys)(e.inputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.inputsPosition[t]||{x:0,y:0};return I(n,o,i,"input_"+t)})),...(0,d.okeys)(e.outputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.outputsPosition[t]||{x:0,y:0};return I(n,o,i,"output"+t)}))];t.getEffectiveNodeDimensions=(e,n)=>{const o=(0,t.calcNodesPositions)(e,n),i=o[0]||{left:0,right:0,top:0,bottom:0},s=o.reduce(((e,t)=>t.leftt.right>e?t.right:e),i.right),a=o.reduce(((e,t)=>t.topt.bottom>e?t.bottom:e),i.bottom)-a,d={x:s,y:a};return{size:{width:u,height:c},pos:d,center:(0,l.calcCenter)({w:u,h:c,...d})}};t.logicalPosToRenderedPos=(e,t)=>{const n=(0,m.vSub)(e,t.pos);return(0,m.vMul)(n,t.zoom)};t.renderedPosToLogicalPos=(e,t)=>{const n=(0,m.vDiv)(e,t.zoom);return(0,m.vAdd)(t.pos,n)};t.centerBoardPosOnTarget=(e,n,o,i)=>{const s=(0,t.logicalPosToRenderedPos)(e,i),r=(0,t.renderedPosToLogicalPos)(s,{...i,zoom:o}),a=Math.max(e.x,r.x)-Math.min(e.x,r.x),u=Math.max(e.y,r.y)-Math.min(e.y,r.y);return{x:o>i.zoom?i.pos.x+a:i.pos.x-a,y:o>i.zoom?i.pos.y+u:i.pos.y-u}};t.fitViewPortToNode=function(e,n,o,i){void 0===i&&(i=[20,150]);const{size:s,center:r}=(0,t.getEffectiveNodeDimensions)(e,n),a=i[0],u=i[1],l=s.width+a,c=s.height+u,d=o.width/l,p=o.height/c,f=Math.min(d,p)/1.15,m=(0,t.clamp)(.3,1.2,f);return{zoom:m,pos:{x:r.x-o.width/2/m,y:r.y-o.height/2/m+20}}};t.getMiddleOfViewPort=(e,n)=>{const o={x:n.width/2,y:n.height/2};return(0,t.renderedPosToLogicalPos)(o,e)};t.isJsxValue=e=>{const t=e=>(0,d.isDefined)(e.ref)&&(0,d.isDefined)(e.type)&&(0,d.isDefined)(e.props);try{const n=JSON.parse(e);return t(n)||Array.isArray(n)&&t(n[0])}catch(n){return!1}};t.getInstancesInRect=(e,n,o,i,s,r,a)=>{const{from:c,to:d}=e,f=(0,t.getSelectionBoxRect)(c,d);return s.filter((e=>{const{pos:t}=e,i={...t,w:(0,p.calcNodeWidth)(e,(0,h.safelyGetNodeDef)(e,n))*o.zoom*a.zoom,h:u.NODE_HEIGHT*o.zoom*a.zoom};return(0,l.intersectRect)(f,i)||(0,l.intersectRect)(i,f)})).map((e=>e.id))};t.handleInstanceDrag=(e,t,n,o,i,s)=>{o.preventDefault(),o.stopPropagation();const a=(0,m.vSub)(n,t.pos);let u;const l=r.produce(e,(e=>{const r=e.instances.find((e=>e.id===t.id));if(!r)throw new Error("impossible state dragging instance that does not exist");!o.shiftKey&&s&&(u=[s]);const l=e.instances.filter((e=>i.includes(e.id)&&e!==r)),c=[r,...l],d=(0,g.getLeafInstancesOfSelection)(c,e.instances,e.connections);[...l,...d].forEach((e=>{e.pos=(0,m.vAdd)(e.pos,a)})),r.pos=n,!o.shiftKey&&s&&(u=[s])}));return{newValue:l,newSelected:u}};t.handleIoPinRename=(e,t,n,o)=>r.produce(e,(e=>{"input"===t?(e.inputs[o]=e.inputs[n],e.inputsPosition[o]=e.inputsPosition[n],delete e.inputs[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===n?{...e,from:{...e.from,pinId:o}}:e))):(e.outputs[o]=e.outputs[n],e.outputsPosition[o]=e.outputsPosition[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===n?{...e,to:{...e.to,pinId:o}}:e)),e.completionOutputs=(e.completionOutputs||[]).map((e=>e.split("+").map((e=>e===n?o:n)).join("+"))),delete e.outputs[n])}));t.handleChangeNodeInputType=(e,t,n)=>r.produce(e,(e=>{const o=e.inputs[t];if(!o)throw new Error("Wat");o.mode=n}))},42403:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorClient=void 0;const i=n(74762),s=o(n(18706)),r=n(32048),a=n(31758),u=(0,i.debugLogger)("remote-debugger:editor-client");t.createEditorClient=(e,t)=>{const n=new URL(e),o=(0,r.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/editor`,timeout:3e4});return o.emit("join-room-editor",t),{emitChange:e=>{o.emit(a.DebuggerServerEventType.CHANGE_EVENT_NAME,e)},emitBreakpointsChange:e=>{o.emit(a.DebuggerServerEventType.UPDATE_BREAKPOINTS,e)},interceptInput:e=>{o.emit(a.DebuggerServerEventType.INPUT_VALUE_OVERRIDE,e)},interceptOutput:e=>{o.emit(a.DebuggerServerEventType.OUTPUT_VALUE_OVERRIDE,e)},onRuntimeReady:e=>(o.on(a.DebuggerServerEventType.RUNTIME_READY,e),()=>o.off(a.DebuggerServerEventType.RUNTIME_READY,e)),onChangeAwk:e=>(o.on(a.DebuggerServerEventType.CHANGE_AWK,e),()=>o.off(a.DebuggerServerEventType.CHANGE_AWK,e)),onChangeError:e=>(o.on(a.DebuggerServerEventType.CHANGE_ERROR,e),()=>o.off(a.DebuggerServerEventType.CHANGE_ERROR,e)),onIsAlive:e=>(o.on(a.DebuggerServerEventType.IS_ALIVE,e),()=>o.off(a.DebuggerServerEventType.IS_ALIVE,e)),emitInputValue:(e,t)=>{u(`Emitting push input value to ${e} %o`,t),o.emit(a.DebuggerServerEventType.PUSH_INPUT_VALUE,{pinId:e,value:t})},destroy:()=>{o.disconnect(),(0,a.enumToArray)(a.DebuggerServerEventType).forEach((e=>o.off(e)))},onDisconnect:e=>(o.on("disconnect",e),()=>o.off("disconnect",e)),debugInfo:()=>`Remote debugger for ${e}`,onBatchedEvents:e=>(o.on(a.DebuggerServerEventType.EVENTS_BATCH,e),()=>o.off(a.DebuggerServerEventType.EVENTS_BATCH,e)),requestState:()=>s.default.get(`${e}/state`).then((e=>e.data.state)),getHistory:n=>s.default.get(`${e}/history`,{params:{insId:n.insId,pinId:n.pinId,limit:n.limit,executionId:t}}).then((e=>e.data)),clearHistory:()=>s.default.delete(`${e}/history`).then((()=>{})),triggerNode:(t,n)=>s.default.post(`${e}/trigger`,{nodeId:t,inputs:n}).then((e=>e.data))}}},58066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeData=void 0;const o=n(74762),i=n(36783),s=(0,o.debugLogger)("remote-debugger:normalize-data");t.normalizeData=e=>{if(e instanceof Error)return(0,i.serializeError)(e);if("object"==typeof e&&null!==e){e={...e};const t=new WeakSet,n=e=>{if("bigint"==typeof e)return e.toString();if("object"!=typeof e||Array.isArray(e))return e;if(null===e)return e;if(t.has(e))return"[Circular]";try{t.add(e)}catch(o){s("Error adding to WeakSet","data:",e,"type:",typeof e,"error:",o)}if(Array.isArray(e))return e.map(n);if("object"==typeof e){const t={};for(const o in e)t[o]=n(e[o]);return t}return e};return n(e)}return e}},39641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimeClient=t.DEFAULT_DT_SCALE=void 0;const o=n(74762),i=n(32048),s=n(31758),r=n(58066),a=(0,o.debugLogger)("remote-debugger:runtime-client");t.DEFAULT_DT_SCALE=1;t.createRuntimeClient=(e,t)=>{const n=new URL(e),u=(0,i.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/runtime`,timeout:1e3,reconnectionAttempts:3});u.emit("join-room-runtime",t),u.on("connection",(e=>{e.join(t)}));let l=new Set;u.on(s.DebuggerServerEventType.UPDATE_BREAKPOINTS,(e=>{l=new Set(e)}));const c=(0,o.cappedArrayDebounce)((e=>{a(`Emitting debounced batched events - ${e.length}`),u.emit(s.DebuggerServerEventType.EVENTS_BATCH,e)}),100,200);return{onChange:e=>(u.on(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e),()=>u.off(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e)),onInput:e=>(u.on(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e),()=>u.off(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e)),emitEvent:e=>{a(`Emitting event ${e.type} change event of ${e.insId}`),e.val=(0,r.normalizeData)(e.val),c.addItem({...e,time:Date.now()})},emitRuntimeReady:()=>{u.emit(s.DebuggerServerEventType.RUNTIME_READY,{})},emitChangeAwk:()=>{u.emit(s.DebuggerServerEventType.CHANGE_AWK,{})},emitChangeError:e=>{u.emit(s.DebuggerServerEventType.CHANGE_ERROR,{error:e})},emitIsAlive:e=>{u.emit(s.DebuggerServerEventType.IS_ALIVE,{time:e})},destroy:async()=>{c.pendingItems()&&(c.flush(),await(0,o.delay)(100)),(0,s.enumToArray)(s.DebuggerServerEventType).forEach((e=>u.off(e))),u.disconnect()},onDisconnect:e=>(u.on("disconnect",e),()=>u.off("disconnect",e)),waitForConnection:()=>new Promise(((e,t)=>{u.connected?e():(u.on("connect_error",(e=>{t(`Socket connect error: ${e}`)})),u.on("connect",(()=>{e()})))}))}}},31758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerServerEventType=t.enumToArray=t.isNumber=t.isSimpleType=t.valuePreview=t.toString=void 0;const o=n(36783);t.toString=e=>{if("object"===typeof e){if(e instanceof Error)return JSON.stringify((0,o.serializeError)(e));try{return JSON.stringify(e).substr(0,250)}catch(t){return"Object (cannot stringify)"}}return`${e}`.substr(0,250)};t.valuePreview=e=>(0,t.toString)(e).substr(0,100);t.isSimpleType=e=>["number","string","boolean"].includes(typeof e);t.isNumber=e=>!1===isNaN(Number(e)),t.enumToArray=function(e){return Object.keys(e).filter(t.isNumber).map((t=>e[t]))},function(e){e.RUNTIME_READY="runtime-ready",e.CHANGE_EVENT_NAME="change",e.PUSH_INPUT_VALUE="push-input-value",e.CHANGE_AWK="live-change-awk",e.CHANGE_ERROR="live-change-error",e.IS_ALIVE="is-alive",e.UPDATE_BREAKPOINTS="update-breakpoints",e.INPUT_VALUE_OVERRIDE="input-value-override",e.OUTPUT_VALUE_OVERRIDE="output-value-override",e.INPUT_VALUE_CHANGE="input-value-changed",e.OUTPUT_VALUE_CHANGE="output-value-changed",e.PROCESSING_CHANGE="processing-changed",e.INPUTS_STATE_CHANGE="inputs-state-changed",e.NODE_ERROR="node-error",e.EVENTS_BATCH="events-batch"}(t.DebuggerServerEventType||(t.DebuggerServerEventType={}))},96233:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31758),t),i(n(42403),t),i(n(39641),t)},65645:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var o=n(70079),i=n(11253),s=n(74089),r=n(74762),a=n(21766);var u=n(10831),l=n(61997),c=n(77852);const d=(0,a.S)(),p=[0,20],f=e=>{let{flow:t,output:n,inputs:o,onError:s,debugDelay:a,onCompleted:u,dependencies:l,player:c}=e;const p=((e,t)=>{const n=new Set;return{onEvent:o=>{const i={...o,time:Date.now(),executionId:"n/a"};console.info("Got debugger event",o),t.addEvents([i]),e.addEvents([i]),n.forEach((e=>e([i])))},onBatchedEvents:e=>(n.add(e),()=>n.delete(e))}})(c,d);p.debugDelay=a;const f=(0,r.keys)(t.node.outputs)[0];return{executeResult:(0,r.execute)({node:t.node,inputs:o,outputs:{[f]:n},resolvedDeps:{...l,[t.node.id]:t.node},_debugger:p,onCompleted:u,onBubbleError:e=>{s(e)},extraContext:{PubSub:i}}),localDebugger:p}},m=e=>{const{debugDelay:t,onOutput:i,flowProps:a}=e,{flow:m,inputs:g,output:v}=a,h=(0,o.useRef)((0,s.createRuntimePlayer)()),[I,y]=(0,o.useState)(e.flowProps.dependencies),[b,C]=(0,o.useState)(),[_]=(0,s.useDebounce)(I,500),x=(0,c.useDarkMode)(),N=async(e,t)=>{const{node:o}=e,i=Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).find((e=>(0,r.isBaseNode)(e)&&e.id===o.id));let a;y((e=>({...e,[i.id]:{...i,source:{path:"@flyde/stdlib/dist/all-browser",export:i.id}}})));const l=(0,u.ZP)(m,(n=>{if(t){const o=(0,s.vAdd)({x:0,y:0},t.pos);if(a=(0,s.createNewNodeInstance)(e.node,0,o,I),n.node.instances.push(a),t.connectTo){const{insId:e,outputId:o}=t.connectTo;n.node.connections.push({from:{insId:e,pinId:o},to:{insId:a.id,pinId:r.TRIGGER_PIN_ID}})}}}));await new Promise((e=>setTimeout(e,10)));const c=(0,u.ZP)(w,(e=>{e.flow=l,t?.selectAfterAdding&&a&&(e.boardData.selected=[a?.id])}));return P(c),(0,s.toastMsg)(`Node ${o.id} successfully imported from ${e.module}`),I},j=async()=>({importables:Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).filter(r.isBaseNode).map((e=>({node:{...e,source:{path:"n/a",export:"n/a"}},module:"@flyde/stdlib"}))),errors:[]}),[w,P]=(0,o.useState)({flow:m,boardData:{viewPort:{pos:{x:0,y:0},zoom:1},lastMousePos:{x:0,y:0},selected:[]}});(0,o.useEffect)((()=>{P((e=>({...e,flow:m})))}),[m]),(0,o.useEffect)((()=>{y((e=>({...e,main:w.flow.node})))}),[w.flow.node]);const O={state:w,onChangeEditorState:P,hideTemplatingTips:!0,initialPadding:p,onExtractInlineNode:r.noop,disableScrolling:!0,darkMode:x.isDarkMode};(0,o.useEffect)((()=>{h.current.start()}),[]),(0,o.useEffect)((()=>{const{executeResult:n,localDebugger:o}=f({flow:w.flow,dependencies:I,output:v,inputs:g,onError:r.noop,debugDelay:t,player:h.current,onCompleted:e.onCompleted}),s=e.flowProps.output.subscribe((e=>i(e)));return C(o),()=>{n(),s.unsubscribe()}}),[t,_]);const E=(0,o.useMemo)((()=>({resolvedDependencies:I,onImportNode:N,onRequestImportables:j})),[]),D=(0,o.useMemo)((()=>({debuggerClient:b,onRequestHistory:d.requestHistory})),[b]);return o.createElement(l.Z,null,(()=>o.createElement(s.DependenciesContextProvider,{value:E},o.createElement(s.DebuggerContextProvider,{value:D},o.createElement(s.FlowEditor,O)))))}},21766:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var o=n(74762);const i=200,s=()=>{const e=new Map,t=new Map;return{requestHistory:async(n,s,r)=>{const a="input"===r?o.DebuggerEventType.INPUT_CHANGE:o.DebuggerEventType.OUTPUT_CHANGE;if(console.log({insId:n,pinId:s,type:a}),s){const t=`${n}.${s}.${a}`,o=e.get(t)||{total:0,lastSamples:[]},r=o.lastSamples.slice(0,i);return{...o,lastSamples:r}}{const e=t.get(n)||{total:0,lastSamples:[]},o=e.lastSamples.slice(0,i);return{...e,lastSamples:o}}},addEvents:n=>{n.forEach((n=>{if(n.type===o.DebuggerEventType.ERROR){const e=n;e.type=o.DebuggerEventType.OUTPUT_CHANGE,e.pinId=o.ERROR_PIN_ID}if(n.type===o.DebuggerEventType.INPUT_CHANGE||n.type===o.DebuggerEventType.OUTPUT_CHANGE){const{insId:o,type:s,pinId:r}=n;{const t=`${o}.${r}.${s}`,a=e.get(t)||{total:0,lastSamples:[]};a.lastSamples.unshift(n),a.lastSamples.length>i&&a.lastSamples.splice(i,a.lastSamples.length-i),a.total++,e.set(t,a)}{const s=t.get(o)||{total:0,lastSamples:[]};s.lastSamples.unshift(n),s.lastSamples.length>i&&s.lastSamples.splice(i,s.lastSamples.length-i),s.total++,e.set(o,s)}}}))}}}},4144:(e,t,n)=>{"use strict";n.d(t,{V:()=>r});var o=n(10328),i=n(70079);const s=e=>i.createElement("li",{className:"log-item"},i.createElement("main",{className:"content"},e.value),i.createElement("aside",null,new Date(e.time).toLocaleTimeString())),r=e=>{const[t,n]=i.useState([]);return i.useEffect((()=>{e.output.subscribe((e=>{const t="object"==typeof e&&i.isValidElement(e)?e:`${e}`;n((e=>[...e,{value:t,time:Date.now()}]))}))}),[]),i.createElement("div",{className:"output-log"},i.createElement("header",null,"Output Log"," ",i.createElement("button",{className:"clear-btn button button--outline button--secondary button--sm",onClick:()=>n([])},"Clear")),i.createElement("main",null,i.createElement("ul",null,t.map(((e,t)=>i.createElement(s,(0,o.Z)({},e,{key:t}))))),0===t.length?i.createElement("div",{className:"empty-state"},"Nothing to show. Interact with the example to emit some outputs!"):null))}},79256:(e,t,n)=>{"use strict";n.d(t,{I:()=>p});var o=n(70079),i=n(65092),s=n(19841),r=n(49794),a=n(21766),u=n(73949),l=n(81098),c=n(65645);(0,a.S)();const d=[{title:"Hello World",key:"hello-world"},{title:"React Counter",key:"react-counter"},{title:"BMI Calculator",key:"bmi"},{title:"REST API Usage",key:"apis"},{title:"Debounce vs. Throttling",key:"debounce-throttling"},{title:"Fibonacci Seq.",key:"fibonacci"}],p=e=>{const[t,n]=(0,o.useState)(e.initWidth||500),[a,p]=(0,o.useState)(e.defaultDelay||0),[f,m]=(0,o.useState)(!1),g=(0,o.useCallback)(((e,t)=>{let{size:o}=t;n(o.width)}),[]),v=o.createElement("div",{className:"delay-container"},o.createElement("input",{type:"range",id:"volume",name:"delay",value:a,step:"100",min:"0",max:"300",onChange:e=>p(Number(e.target.value))}),o.createElement("label",{htmlFor:"volume"},"Debug Delay: ",a,"ms")),h=d.findIndex((t=>t.key===e.meta.key)),I=d[h+1],y=d[h-1];return o.createElement(i.Z,{title:`${e.meta.title} | Playground`,description:`Flyde Playground - ${e.meta.title} example`},o.createElement("header",{className:(0,s.default)("hero hero--primary",u.Z.heroBanner,"playground-hero")},o.createElement("div",{className:"container"},o.createElement("h1",{className:"hero__title"},"Welcome to Flyde's Online Playground"),o.createElement("p",{className:"hero__subtitle"},"Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!"))),o.createElement("div",{className:"mobile-warning"},"Flyde is currently not optimized for mobile devices. Please"," ",o.createElement("strong",null,"use a desktop computer for the best experience"),"."),o.createElement("ul",{className:"examples__menu"},d.map((e=>o.createElement("li",{key:e.key},o.createElement(r.Z,{to:`/playground/${e.key}`,className:"button button--primary"},e.title))))),o.createElement("div",{className:"playground-container"},o.createElement("header",null,o.createElement("h2",{className:"playground-title"},e.meta.title),o.createElement("div",{className:"playground-description"},e.meta.description),f?o.createElement(o.Fragment,null,o.createElement("hr",null),o.createElement("div",{className:"playground-extra"},e.extraInfo||e.meta.extraInfo,o.createElement("div",{className:"star-hint"},o.createElement("span",null,"\xa0 PS: Did you like this example?"),"Please consider giving a \u2b50\ufe0f to the project"," ",o.createElement("span",{className:"star-wrapper"},o.createElement("iframe",{className:"gh-stars-frame",src:"https://ghbtns.com/github-btn.html?user=flydelabs&repo=flyde&type=star&count=true&size=small",width:100,height:20,title:"GitHub Stars"}))))):null,e.prefixComponent),o.createElement("div",{className:"playground"},o.createElement("div",{className:"flow-container"},!0!==e.hideDelay?v:null,o.createElement(c.Y,{flowProps:e.flowProps,debugDelay:a,onOutput:()=>m(!0)})),o.createElement(l.Resizable,{height:0,width:t,onResize:g,handle:o.createElement("div",{className:"handle"}),axis:"x",resizeHandles:["w"]},o.createElement("div",{className:"output-container",style:{flexBasis:t}},e.children))),o.createElement("nav",{className:"pagination-nav"},o.createElement("div",{className:"pagination-nav__item"},y?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${y.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Previous Example"),o.createElement("div",{className:"pagination-nav__label"},y.title)):null),o.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},I?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${I.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Next Example"),o.createElement("div",{className:"pagination-nav__label"},I.title)):null))))}},26641:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var o=n(70079),i=n(74762),s=n(79256);const r={dependencies:[],flow:{imports:{"@flyde/stdlib":["IsGreater"]},node:{instances:[{pos:{x:-339.8445458984375,y:-298.6939727783203},id:"clal8c6ws00054664pn7mxwak",inputConfig:{},node:{id:"Inline-value-prompt(What is",inputs:{},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"const result = (prompt('What is your weight (in kilograms)?')); Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"prompt('What is your weight (in kilograms)?')",dataBuilderSource:"cHJvbXB0KCdXaGF0IGlzIHlvdXIgd2VpZ2h0IChpbiBraWxvZ3JhbXMpPycp",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}}},{pos:{x:97.43304077148437,y:-298.35113525390625},id:"clal8cm19000b4664u3iz2pbb",inputConfig:{},node:{id:"Inline-value-prompt(What is",inputs:{},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"const result = (prompt('What is your height (in cm)?')); Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"prompt('What is your height (in cm)?')",dataBuilderSource:"cHJvbXB0KCdXaGF0IGlzIHlvdXIgaGVpZ2h0IChpbiBjbSk/Jyk=",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}}},{pos:{x:-140.88708862304688,y:-123.31595092773438},id:"clal8dus5000j4664s9pwujgy",inputConfig:{},node:{id:"Inline-value-(inputs.weight ",inputs:{weight:{type:"any",mode:"required"},height:{type:"any",mode:"required"}},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"const result = ((inputs.weight / inputs.height**2) * 10000); Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"(inputs.weight / inputs.height**2) * 10000",dataBuilderSource:"KGlucHV0cy53ZWlnaHQgLyBpbnB1dHMuaGVpZ2h0KioyKSAgKiAxMDAwMA==",templateType:"value",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}}},{pos:{x:-122.89145629882813,y:6.26922607421875},id:"clal91glf00024664mfh47zbj",inputConfig:{},node:{id:"Inline-value-let range;\nif (",inputs:{bmi:{type:"any",mode:"required"}},outputs:{value:{type:"any",delayed:!1,optional:!1}},runFnRawCode:"const result = (function() { let range;\nif (inputs.bmi < 18.5) \n range = 'overweight'\nelse if (inputs.bmi < 25) {\n range = 'normal';\n} else if (inputs.bmi < 30) {\n range = 'overweight';\n} else {\n range = 'obese';\n}\n\nreturn `You are in the ${range} range`}());\n Promise.resolve(result).then(val => outputs.value.next(val))",customViewCode:"let range;\nif (inputs.bmi < 18.5) \n range = 'overweight'\nelse if (inputs.bmi < 25) {\n range = ",dataBuilderSource:"bGV0IHJhbmdlOwppZiAoaW5wdXRzLmJtaSA8IDE4LjUpIAogICAgcmFuZ2UgPSAnb3ZlcndlaWdodCcKZWxzZSBpZiAoaW5wdXRzLmJtaSA8IDI1KSB7CiAgICByYW5nZSA9ICdub3JtYWwnOwp9IGVsc2UgaWYgKGlucHV0cy5ibWkgPCAzMCkgewogICAgcmFuZ2UgPSAnb3ZlcndlaWdodCc7Cn0gZWxzZSB7CiAgICByYW5nZSA9ICdvYmVzZSc7Cn0KCnJldHVybiBgWW91IGFyZSBpbiB0aGUgJHtyYW5nZX0gcmFuZ2Vg",templateType:"function",completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}}}}],connections:[{from:{insId:"clal8c6ws00054664pn7mxwak",pinId:"value"},to:{insId:"clal8dus5000j4664s9pwujgy",pinId:"weight"}},{from:{insId:"clal8cm19000b4664u3iz2pbb",pinId:"value"},to:{insId:"clal8dus5000j4664s9pwujgy",pinId:"height"}},{from:{insId:"clal8dus5000j4664s9pwujgy",pinId:"value"},to:{insId:"clal91glf00024664mfh47zbj",pinId:"bmi"}},{from:{insId:"clal91glf00024664mfh47zbj",pinId:"value"},to:{insId:"__this",pinId:"rename"}}],id:"BMI",inputs:{},outputs:{rename:{type:"any",optional:!1,delayed:!1}},inputsPosition:{},outputsPosition:{result:{x:24.354419059198683,y:165.7657006221402},r:{x:24.354419059198683,y:165.7657006221402},rename:{x:33.925163537262904,y:163.67737650172523}},completionOutputs:["rename"]}}};var a=n(4144);const u={title:"BMI Calculator",description:"Simple BMI calculator with a decision tree. There are many things that make sense done visually, and even more that don't. This example showcases Flyde's support for inline code. The BMI calculation uses a simple inline formula, and the final string uses a textual switch case. Flyde exposes dynamic arguments to your inline code automatically if you use the special \"inputs.\" object!",key:"bmi"},l="Try adding another prompt and another input to the formula!";function c(){const e=(0,o.useRef)((0,i.dynamicOutput)()),t=(0,o.useRef)({__trigger:(0,i.dynamicNodeInput)()}),[n,c]=(0,o.useState)({flow:r.flow,dependencies:r.dependencies,inputs:t.current,output:e.current}),d=o.createElement("button",{className:"button button--success ",onClick:()=>t.current.__trigger.subject.next("run")},"Run!");return o.createElement(s.I,{meta:u,flowProps:n,prefixComponent:d,initWidth:300,extraInfo:l,defaultDelay:500},o.createElement(a.V,{output:e.current}))}},73949:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={"flyde-flow-editor":"flyde-flow-editor_AAD4",_hj_feedback_container:"_hj_feedback_container_Af03"}},85721:(e,t,n)=>{var o={"./af":47654,"./af.js":47654,"./ar":61325,"./ar-dz":98344,"./ar-dz.js":98344,"./ar-kw":26230,"./ar-kw.js":26230,"./ar-ly":42524,"./ar-ly.js":42524,"./ar-ma":44119,"./ar-ma.js":44119,"./ar-sa":82625,"./ar-sa.js":82625,"./ar-tn":42182,"./ar-tn.js":42182,"./ar.js":61325,"./az":37093,"./az.js":37093,"./be":32721,"./be.js":32721,"./bg":59919,"./bg.js":59919,"./bm":95594,"./bm.js":95594,"./bn":563,"./bn-bd":41757,"./bn-bd.js":41757,"./bn.js":563,"./bo":73211,"./bo.js":73211,"./br":87438,"./br.js":87438,"./bs":83662,"./bs.js":83662,"./ca":61196,"./ca.js":61196,"./cs":5841,"./cs.js":5841,"./cv":85251,"./cv.js":85251,"./cy":24512,"./cy.js":24512,"./da":37539,"./da.js":37539,"./de":5059,"./de-at":53853,"./de-at.js":53853,"./de-ch":99378,"./de-ch.js":99378,"./de.js":5059,"./dv":91454,"./dv.js":91454,"./el":39651,"./el.js":39651,"./en-au":87953,"./en-au.js":87953,"./en-ca":98193,"./en-ca.js":98193,"./en-gb":61980,"./en-gb.js":61980,"./en-ie":14050,"./en-ie.js":14050,"./en-il":6502,"./en-il.js":6502,"./en-in":555,"./en-in.js":555,"./en-nz":11372,"./en-nz.js":11372,"./en-sg":26568,"./en-sg.js":26568,"./eo":69533,"./eo.js":69533,"./es":68327,"./es-do":17620,"./es-do.js":17620,"./es-mx":96467,"./es-mx.js":96467,"./es-us":83272,"./es-us.js":83272,"./es.js":68327,"./et":68523,"./et.js":68523,"./eu":19066,"./eu.js":19066,"./fa":59087,"./fa.js":59087,"./fi":96443,"./fi.js":96443,"./fil":93979,"./fil.js":93979,"./fo":90383,"./fo.js":90383,"./fr":56327,"./fr-ca":25610,"./fr-ca.js":25610,"./fr-ch":97274,"./fr-ch.js":97274,"./fr.js":56327,"./fy":67442,"./fy.js":67442,"./ga":44291,"./ga.js":44291,"./gd":77342,"./gd.js":77342,"./gl":96248,"./gl.js":96248,"./gom-deva":21404,"./gom-deva.js":21404,"./gom-latn":20833,"./gom-latn.js":20833,"./gu":9122,"./gu.js":9122,"./he":74623,"./he.js":74623,"./hi":60364,"./hi.js":60364,"./hr":30860,"./hr.js":30860,"./hu":70441,"./hu.js":70441,"./hy-am":90425,"./hy-am.js":90425,"./id":29672,"./id.js":29672,"./is":96150,"./is.js":96150,"./it":27852,"./it-ch":55603,"./it-ch.js":55603,"./it.js":27852,"./ja":16465,"./ja.js":16465,"./jv":20120,"./jv.js":20120,"./ka":87245,"./ka.js":87245,"./kk":21479,"./kk.js":21479,"./km":65038,"./km.js":65038,"./kn":63060,"./kn.js":63060,"./ko":85020,"./ko.js":85020,"./ku":90582,"./ku.js":90582,"./ky":34950,"./ky.js":34950,"./lb":94201,"./lb.js":94201,"./lo":87894,"./lo.js":87894,"./lt":70120,"./lt.js":70120,"./lv":4265,"./lv.js":4265,"./me":14030,"./me.js":14030,"./mi":9463,"./mi.js":9463,"./mk":25898,"./mk.js":25898,"./ml":64233,"./ml.js":64233,"./mn":47156,"./mn.js":47156,"./mr":34479,"./mr.js":34479,"./ms":24691,"./ms-my":6456,"./ms-my.js":6456,"./ms.js":24691,"./mt":81789,"./mt.js":81789,"./my":37452,"./my.js":37452,"./nb":91170,"./nb.js":91170,"./ne":87529,"./ne.js":87529,"./nl":81776,"./nl-be":24455,"./nl-be.js":24455,"./nl.js":81776,"./nn":34705,"./nn.js":34705,"./oc-lnc":36139,"./oc-lnc.js":36139,"./pa-in":17960,"./pa-in.js":17960,"./pl":1899,"./pl.js":1899,"./pt":31670,"./pt-br":29159,"./pt-br.js":29159,"./pt.js":31670,"./ro":55115,"./ro.js":55115,"./ru":45149,"./ru.js":45149,"./sd":81231,"./sd.js":81231,"./se":35397,"./se.js":35397,"./si":99786,"./si.js":99786,"./sk":39383,"./sk.js":39383,"./sl":68691,"./sl.js":68691,"./sq":34826,"./sq.js":34826,"./sr":40080,"./sr-cyrl":75673,"./sr-cyrl.js":75673,"./sr.js":40080,"./ss":54309,"./ss.js":54309,"./sv":52245,"./sv.js":52245,"./sw":8967,"./sw.js":8967,"./ta":10454,"./ta.js":10454,"./te":35204,"./te.js":35204,"./tet":81571,"./tet.js":81571,"./tg":15737,"./tg.js":15737,"./th":41786,"./th.js":41786,"./tk":50511,"./tk.js":50511,"./tl-ph":14828,"./tl-ph.js":14828,"./tlh":62422,"./tlh.js":62422,"./tr":97047,"./tr.js":97047,"./tzl":90792,"./tzl.js":90792,"./tzm":67730,"./tzm-latn":59963,"./tzm-latn.js":59963,"./tzm.js":67730,"./ug-cn":42535,"./ug-cn.js":42535,"./uk":33151,"./uk.js":33151,"./ur":22750,"./ur.js":22750,"./uz":61914,"./uz-latn":60231,"./uz-latn.js":60231,"./uz.js":61914,"./vi":55517,"./vi.js":55517,"./x-pseudo":64078,"./x-pseudo.js":64078,"./yo":70046,"./yo.js":70046,"./zh-cn":81832,"./zh-cn.js":81832,"./zh-hk":90953,"./zh-hk.js":90953,"./zh-mo":38236,"./zh-mo.js":38236,"./zh-tw":71001,"./zh-tw.js":71001};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=s,e.exports=i,i.id=85721}}]); \ No newline at end of file diff --git a/assets/js/f989b58c.8457b8a7.js b/assets/js/f989b58c.3ebfd358.js similarity index 63% rename from assets/js/f989b58c.8457b8a7.js rename to assets/js/f989b58c.3ebfd358.js index a81e6a081..046b38293 100644 --- a/assets/js/f989b58c.8457b8a7.js +++ b/assets/js/f989b58c.3ebfd358.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2710],{19121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cappedArrayDebounce=void 0;t.cappedArrayDebounce=function(e,t,n,o){void 0===o&&(o=500);let i=[],s=null,r=null;return{addItem:a=>{clearTimeout(s),i.push(a),r||(r=setTimeout((()=>{e(i),clearTimeout(s),r=null}),o)),i.length>=n?(e(i),clearTimeout(r),r=null,i=[]):s=setTimeout((()=>{e(i),clearTimeout(r),r=null,i=[]}),t)},flush:()=>{i.length&&(e(i),i=[],clearTimeout(r))},pendingItems:()=>i.length}}},59792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.dataShaper=t.DataShapeType=void 0,function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.ARRAY=3]="ARRAY",e[e.OBJECT=4]="OBJECT",e[e.NULL=5]="NULL",e[e.UNSUPPORTED=6]="UNSUPPORTED"}(n=t.DataShapeType||(t.DataShapeType={}));const o={string:n.STRING,number:n.NUMBER,boolean:n.BOOLEAN,object:n.OBJECT,array:n.ARRAY,null:n.NULL,symbol:n.UNSUPPORTED,undefined:n.UNSUPPORTED,function:n.UNSUPPORTED,bigint:n.UNSUPPORTED};t.dataShaper=function(e,n,i){void 0===n&&(n=5),void 0===i&&(i=5);const s=null===(r=e)?"null":typeof r;var r,a;if("object"===s){if(Array.isArray(e))return n>1?e.filter(((e,t)=>t(0,t.dataShaper)(e,n-1,i))):o.array;if(n>1){const o={};for(const s in e)o[s]=(0,t.dataShaper)(e[s],n-1,i);return a=o,Object.keys(a).sort().reduce(((e,t)=>(e[t]=a[t],e)),{})}return o.object}return o[s]}},23046:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.debugLogger=void 0;const i=(0,o(n(55899)).default)("flyde");t.debugLogger=e=>i.extend(e)},24331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullInsIdPath=void 0,t.fullInsIdPath=function(e,t){if(!e)throw new Error("insId is not defined");return t?`${t}.${e}`:e}},34459:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hashFlow=t.hashNode=void 0;const i=o(n(68805)),s=n(30292),r=e=>(0,i.default)(e);t.hashNode=function(e,t){var n;void 0===t&&(t=!0);const{id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l}=e,c={id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l};if((0,s.isVisualNode)(e)){const{instances:n,connections:o,inputsPosition:i,outputsPosition:s}=e,a=n.map((e=>{const{pos:t,...n}=e;return n})),u=t?{}:{inputsPosition:i,outputsPosition:s},l=t?a:n;l.sort(((e,t)=>e.id.localeCompare(t.id)));const d=[...o];d.sort(((e,t)=>{const n=`${e.from.insId}.${e.from.pinId}`,o=`${t.from.insId}.${t.from.pinId}`;return n.localeCompare(o)}));const p=JSON.stringify({instancesToUse:l,conns:d,...c,maybeIoPos:u});return r(p)}if((0,s.isInlineValueNode)(e)){const{customViewCode:t}=e,o=null!==(n=e.fnCode)&&void 0!==n?n:e.runFnRawCode,i=JSON.stringify({fnCode:o,customViewCode:t,...c});return r(i)}throw new Error("Hashing code nodes unsupported")};t.hashFlow=e=>{const{node:n,imports:o}=e,i=(0,t.hashNode)(n,!1),s=Object.entries(null!=o?o:{}).sort(((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)})).map((e=>{let[t,n]=e;return[t,n.sort()]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{}),a=JSON.stringify(s);return r(i+a)}},86873:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DepGraph=void 0,i(n(3172),t),i(n(59962),t),i(n(23046),t),i(n(19121),t),i(n(59962),t),i(n(34459),t),i(n(39043),t),i(n(59792),t),i(n(24331),t),t.DepGraph=n(60359).DepGraph},3172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testDataCreator=void 0;t.testDataCreator=e=>function(t){void 0===t&&(t={});return{..."function"==typeof e?e():e,...t}}},59962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplePluralize=t.eventually=t.delay=t.noop=t.removeDupes=t.ensure=t.isOptionalType=t.callFnOrFnPromise=t.isPromise=t.isDefined=t.containsAll=t.shuffle=t.randomInts=t.repeat=t.pickRandom=t.randomPos=t.randomInt=t.pickSecond=t.pickFirst=t.fromEntries=t.entries=t.okeys=t.values=t.keys=t.filterOMap=t.mapOMap=t.middlePos=t.calcCenter=t.intersectRect=void 0;t.intersectRect=(e,t)=>{const n=e.x+e.w,o=t.x+t.w;return!(t.x>n||oe.y+e.h||t.y+t.h{let{w:t,h:n,x:o,y:i}=e;return{x:o+t/2,y:i+n/2}};t.middlePos=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});t.mapOMap=(e,n)=>(0,t.entries)(e).map((e=>{let[t,o]=e;return[t,n(t,o)]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.filterOMap=(e,n)=>(0,t.entries)(e).filter((e=>{let[t,o]=e;return n(t,o)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.keys=e=>Object.keys(e);t.values=e=>Object.values(e),t.okeys=t.keys;t.entries=e=>(0,t.okeys)(e).map((t=>[t,e[t]]));t.fromEntries=e=>e.reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.pickFirst=e=>e[0];t.pickSecond=e=>e[1];t.randomInt=function(e,t){void 0===t&&(t=0);const n=Math.random();return t+Math.floor((e-t)*n)};t.randomPos=function(e,n){void 0===e&&(e=1e3),void 0===n&&(n=0);return{x:(0,t.randomInt)(e,n),y:(0,t.randomInt)(e,n)}};t.pickRandom=e=>e[(0,t.randomInt)(e.length)];t.repeat=(e,t)=>"x".repeat(e).split("").map(((e,n)=>t(n)));t.randomInts=function(e,n,o){return void 0===n&&(n=100),void 0===o&&(o=0),(0,t.repeat)(e,(()=>(0,t.randomInt)(n,o)))};t.shuffle=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t};t.containsAll=(e,t)=>t.every((t=>e.includes(t)));t.isDefined=e=>void 0!==e;t.isPromise=e=>e&&"function"==typeof e.then;t.callFnOrFnPromise=(e,n)=>{if(!(0,t.isDefined)(e))return;const o=e=>{try{e()}catch(t){console.error(n,t)}};"function"==typeof e?o(e):Promise.resolve(e).then((e=>{"function"==typeof e&&o(e)}))};t.isOptionalType=e=>/\?$/.test(e);t.ensure=(e,t)=>{if(void 0===e)throw new Error(t||"Undefined value passed");return e};t.removeDupes=e=>Array.from(new Set(e));t.noop=()=>{};t.delay=e=>new Promise((t=>setTimeout(t,e)));t.eventually=async function(e,n,o,i){if(void 0===n&&(n=1e3),void 0===o&&(o=100),void 0===i&&(i=new Set),n<0){const e=Array.from(i).reduce(((e,t,n)=>`${e}\n\t\t${n+1}. ${t}`),"");throw new Error(`[Eventually timeout exceeded after: timeout with error]: ${e}`)}try{await e()}catch(s){const r=Date.now();await(0,t.delay)(o);const a=Date.now()-r;return i.add(null==s?void 0:s.message),(0,t.eventually)(e,n-a,o,i)}},t.simplePluralize=function(e,t){return`${e} ${t}${1!==e?"s":""}`}},39043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileObjectTemplate=t.compileStringTemplate=void 0;t.compileStringTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=new RegExp("\\$\\{"+e+"\\}","g");n=n.replace(i,o)})),n};t.compileObjectTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=JSON.stringify(o),s=new RegExp('"\\$\\$\\{'+e+'\\}"',"g"),r=new RegExp("\\$\\{"+e+"\\}","g"),a="string"==typeof o?o.replace(/"/g,((e,t,n)=>"\\"!==n[t-1]?'\\"':n[t])):o;n=n.replace(s,i).replace(r,a).replace(/\n/g,"\\n")})),JSON.parse(n)}},69150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connection=t.connectionData=t.connectionDataEquals=t.connectionNodeEquals=t.connectionNode=t.externalConnectionNode=t.isInternalConnection=t.isExternalConnection=t.isInternalConnectionNode=t.isExternalConnectionNode=t.getNodeOutputs=t.getOutputName=t.getInputName=t.getNodeInputs=t.TRIGGER_PIN_ID=t.ERROR_PIN_ID=t.THIS_INS_ID=void 0;const o=n(30292);t.THIS_INS_ID="__this",t.ERROR_PIN_ID="__error",t.TRIGGER_PIN_ID="__trigger";t.getNodeInputs=e=>({...e.inputs,[t.TRIGGER_PIN_ID]:(0,o.nodeInput)()});t.getInputName=e=>e===t.TRIGGER_PIN_ID?"Trigger Node":e;t.getOutputName=e=>e===t.ERROR_PIN_ID?"Error":e;t.getNodeOutputs=e=>({...e.outputs,[t.ERROR_PIN_ID]:(0,o.nodeOutput)()});t.isExternalConnectionNode=e=>e&&e.insId===t.THIS_INS_ID;t.isInternalConnectionNode=e=>e.insId!==t.THIS_INS_ID;t.isExternalConnection=e=>{let{from:n,to:o}=e;return(0,t.isExternalConnectionNode)(n)||(0,t.isExternalConnectionNode)(o)};t.isInternalConnection=e=>!(0,t.isExternalConnection)(e);t.externalConnectionNode=e=>({insId:t.THIS_INS_ID,pinId:e});t.connectionNode=(e,t)=>({insId:e,pinId:t});t.connectionNodeEquals=(e,t)=>e.insId===t.insId&&e.pinId===t.pinId;t.connectionDataEquals=(e,n)=>!(!e||!n)&&((0,t.connectionNodeEquals)(e.from,n.from)&&(0,t.connectionNodeEquals)(e.to,n.to)),t.connectionData=function(e,n,o){const i="string"==typeof e?e.split("."):e,s="string"==typeof n?n.split("."):n;if(i.length>2||s.length>2)throw new Error(`invalid source or target to connection data - ${e} / ${n}`);return{from:2===i.length?(0,t.connectionNode)(i[0],i[1]):(0,t.externalConnectionNode)(i[0]),to:2===s.length?(0,t.connectionNode)(s[0],s[1]):(0,t.externalConnectionNode)(s[0]),delayed:o}};t.connection=function(e,t,n){return void 0===n&&(n=!1),{from:e,to:t,delayed:n}}},6775:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;const s=n(30292),r=n(47025),a=n(86873),u=n(69150);i(n(69150),t);t.connect=function(e,t,n,o,i,l,c,d){void 0===n&&(n={}),void 0===i&&(i={}),void 0===l&&(l=a.noop),void 0===c&&(c={}),void 0===d&&(d={});const{id:p,connections:f,instances:m}=e,h=p||"connected-node"+(0,a.randomInt)(999);return{inputs:e.inputs,outputs:e.outputs,id:h,completionOutputs:e.completionOutputs,reactiveInputs:e.reactiveInputs,run:(p,v)=>{let g=[];const I=new a.DepGraph({}),b=new Map,y=new Map,C=new Map,_=new Map,x=new Map,N=new Map;let w;const j=new Set;m.forEach((e=>{const n=(0,s.getNode)(e,t),o=e.id;b.set(e,o),y.set(o,e),I.addNode(o);const i=Object.keys(n.inputs),r=Object.keys(n.outputs),a={},l={};i.forEach((t=>{const n=(e.inputConfig||{})[t]||(0,s.queueInputPinConfig)();(0,s.isStaticInputPinConfig)(n)?a[t]=(0,s.staticNodeInput)(n.value):a[t]=(0,s.dynamicNodeInput)({config:n})})),a[u.TRIGGER_PIN_ID]=(0,s.dynamicNodeInput)({config:(0,s.queueInputPinConfig)()});if(f.some((t=>(0,u.isInternalConnectionNode)(t.to)&&t.to.insId===e.id&&t.to.pinId===u.TRIGGER_PIN_ID))&&e.inputConfig&&e.inputConfig[u.TRIGGER_PIN_ID])throw"Trigger connection can not be configured";r.forEach((e=>{const t=(0,s.dynamicOutput)();l[e]=t}));f.some((t=>(0,u.isInternalConnectionNode)(t.from)&&t.from.insId===e.id&&t.from.pinId===u.ERROR_PIN_ID))&&(l[u.ERROR_PIN_ID]=(0,s.dynamicOutput)()),C.set(o,a),_.set(o,l)}));const E=new Set;return f.forEach((n=>{const{from:o,to:i}=n,{insId:r,pinId:a}=o,{insId:l,pinId:c}=i,d=_.get(r),p=C.get(l);if((0,u.isInternalConnectionNode)(i)&&E.add(`${i.insId}.${i.pinId}`),(0,u.isExternalConnection)(n)){if((0,u.isExternalConnectionNode)(o)){const e=null==p?void 0:p[i.pinId];if(!e)throw new Error(`Input ${i.pinId} of instance ${l} not found`);const t=x.get(o.pinId)||[];t.push(e),x.set(o.pinId,t)}else{let e=null==d?void 0:d[o.pinId];if(!e)throw new Error(`Output ${o.pinId} of instance ${r} not found`);const t=N.get(i.pinId)||[];t.push(e),N.set(i.pinId,t)}return}if(!d)throw new Error(`No outputs found for instance [${r}]`);if(!p)throw y.has(l)?new Error(`No inputs found for instance [${l}]`):new Error(`Instance with id [${l}] does not exist!`);const f=d[a];if(!f)throw new Error(`Output source - [${a}] not found in node [${h}]`);const m=p[c],v=y.get(r);if(!v&&r!==u.THIS_INS_ID)throw new Error(`Instance [${r}] does not exist! failed to connect [${o}] -> [${i}]`);const b=(v?(0,s.getNode)(v,t):e).outputs[a];if(b&&b.delayed||n.delayed||r!==u.THIS_INS_ID&&l!==u.THIS_INS_ID&&I.addDependency(r,l),!m)throw new Error(`Target arg - [${i}] not found in node [${h}]`);const w=f.subscribe((async e=>{if(!(0,s.isDynamicInput)(m))throw console.info(m),new Error(`Impossible state listening to non dynamic input - ${l}.${c}`);m.subject.next(e)}));g.push((()=>w.unsubscribe()))})),(0,a.okeys)(v).forEach((e=>{(N.get(e)||[]).forEach((t=>{const n=t.subscribe((async t=>{if(!v[e])throw new Error(`Impossible state - output ${e} does not exist`);v[e].next(t)}));g.push((()=>n.unsubscribe()))}))})),I.overallOrder().map((e=>y.get(e))).forEach((e=>{const a=C.get(e.id),u=_.get(e.id),p=(0,s.getNode)(e,t);if(!a)throw new Error(`Unexpected error - args not found when running ${e}`);if(!u)throw new Error(`Unexpected error - outputs not found when running ${e}`);for(const t in a){const n=e.inputConfig[t];E.has(`${e.id}.${t}`)||(0,s.isStaticInputPinConfig)(n)||delete a[t]}const f=(0,r.execute)({node:p,inputs:a,outputs:u,resolvedDeps:t,_debugger:n,insId:e.id,extraContext:d,mainState:i,ancestorsInsIds:o,onBubbleError:l,onCompleted:()=>{return t=e.id,j.delete(t),void(0===j.size&&w&&w());var t},onStarted:()=>{return t=e.id,void j.add(t);var t},env:c});g.push(f)})),Object.keys(p).forEach((async e=>{(x.get(e)||[]).forEach((t=>{const n=p[e];if(!(0,s.isDynamicInput)(t))throw new Error(`Unsure what to do with key ${e}, input: ${t} of ins ${o}`);(0,a.isDefined)(n)&&t.subject.next(n)}))})),void 0===e.completionOutputs&&j.size>0?new Promise((e=>{w=e})):()=>g.forEach((e=>{try{e()}catch(t){console.error("error unsubscribing",t)}}))}}}},26488:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MINOR_DEBUGGER_EVENT_TYPES=t.MAJOR_DEBUGGER_EVENT_TYPES=t.DebuggerEventType=void 0,function(e){e.INPUT_CHANGE="i",e.OUTPUT_CHANGE="o",e.PROCESSING_CHANGE="pc",e.ERROR="err",e.INPUTS_STATE_CHANGE="isc"}(n=t.DebuggerEventType||(t.DebuggerEventType={})),t.MAJOR_DEBUGGER_EVENT_TYPES=[n.INPUT_CHANGE,n.OUTPUT_CHANGE,n.ERROR],t.MINOR_DEBUGGER_EVENT_TYPES=[n.PROCESSING_CHANGE,n.INPUTS_STATE_CHANGE]},43686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatEvent=void 0;const o=n(26488);t.formatEvent=function(e){var t,n,i;const s=[e.insId,...null!==(n=null===(t=e.ancestorsInsIds)||void 0===t?void 0:t.split("."))&&void 0!==n?n:[]];(null===(i=e.ancestorsInsIds)||void 0===i?void 0:i.length)>0&&e.ancestorsInsIds;const r=`Node <${e.nodeId}> `,a=`(${s.join(" -> ")})`;return`${r} - ${function(e){switch(e.type){case o.DebuggerEventType.PROCESSING_CHANGE:return e.val?"started processing":"stopped processing";case o.DebuggerEventType.INPUT_CHANGE:return`Input pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.OUTPUT_CHANGE:return`Output pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.INPUTS_STATE_CHANGE:return`Inputs queue size changed to ${Object.entries(e.val).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join(", ")}`;case o.DebuggerEventType.ERROR:return`Error: ${e.val}`}}(e)} ${a}`}},99896:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26488),t),i(n(43686),t)},47025:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.GLOBAL_STATE_NS=t.ROOT_INS_ID=t.INPUTS_STATE_SUFFIX=t.INNER_STATE_SUFFIX=void 0;const s=n(62600),r=n(87794);i(n(99896),t);const a=n(30292),u=n(6775),l=n(84479),c=n(86873),d=n(23046),p=n(30292),f=n(99896),m=n(79804);t.INNER_STATE_SUFFIX="_inner",t.INPUTS_STATE_SUFFIX="_inputs";t.ROOT_INS_ID="__root",t.GLOBAL_STATE_NS="____global";t.execute=e=>{let{node:n,inputs:o,outputs:i,resolvedDeps:h,_debugger:v={},insId:g=t.ROOT_INS_ID,extraContext:I={},mainState:b={},ancestorsInsIds:y,onBubbleError:C=s.noop,env:_={},onCompleted:x=s.noop,onStarted:N=s.noop}=e;const w=[];b[t.GLOBAL_STATE_NS]||(b[t.GLOBAL_STATE_NS]=new Map);const j={...I,ENV:_},E=(0,m.customNodesToNodesCollection)(h,j),P=e=>{const t=e instanceof a.NodeInstanceError?e:new a.NodeInstanceError(e,(0,c.fullInsIdPath)(g,y),n.id);v.onEvent&&v.onEvent({type:f.DebuggerEventType.ERROR,val:t,insId:g,ancestorsInsIds:y,nodeId:n.id}),i[u.ERROR_PIN_ID]?i[u.ERROR_PIN_ID].next(t):C(t)},O=(e=>(0,a.isVisualNode)(e)?(0,u.connect)(e,E,v,(0,c.fullInsIdPath)(g,y),b,P,_,I):(0,a.isInlineValueNode)(e)?(0,m.inlineValueNodeToNode)(e,j):e)(n),S=v.onEvent||s.noop,D={},M={};(0,c.entries)(o).forEach((e=>{let[t,o]=e;if((0,a.isDynamicInput)(o)){const e=(0,a.dynamicNodeInput)({config:o.config}),i=o.subject.subscribe((async o=>{const i=S({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o,ancestorsInsIds:y,nodeId:n.id});if(i){const t=await i.valuePromise;e.subject.next(t)}else v.debugDelay&&await(0,c.delay)(v.debugDelay),e.subject.next(o)}));w.push((()=>i.unsubscribe())),M[t]=e}else{S({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o.config.value,ancestorsInsIds:y,nodeId:n.id});const e=(0,a.staticNodeInput)((0,a.getStaticValue)(o.config.value,E,g));M[t]=e}})),(0,c.entries)(i).forEach((e=>{let[t,o]=e;const i=(0,a.dynamicOutput)(),s=i.subscribe((async e=>{const i=S({type:f.DebuggerEventType.OUTPUT_CHANGE,insId:g,pinId:t,val:e,ancestorsInsIds:y,nodeId:n.id});if(i){const e=await i.valuePromise;o.next(e)}else o.next(e)}));w.push((()=>s.unsubscribe())),D[t]=i}));const T=(e=>{var n,o;const{node:i,inputs:u,outputs:m,resolvedDeps:h,_debugger:v,insId:g,ancestorsInsIds:I,mainState:b,onError:y,onStarted:C,onCompleted:_,env:x,extraContext:N}=e,{run:w,fn:j}=i,E=(0,d.debugLogger)("core"),P=[];let O;const S=(null==v?void 0:v.onEvent)||s.noop,D=(0,c.fullInsIdPath)(g,I),M=`${D}${t.INNER_STATE_SUFFIX}`,T=`${D}${t.INPUTS_STATE_SUFFIX}`,k=E.extend(D),R=b[t.GLOBAL_STATE_NS];b[M]||(b[M]=new Map),b[T]||(b[T]=new Map);let A=null!==(n=b[T])&&void 0!==n?n:new Map;const V=()=>{const e=Array.from(A.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:(0,a.isQueueInputPinConfig)(u[n].config)?null==o?void 0:o.length:1}}),{});S({type:f.DebuggerEventType.INPUTS_STATE_CHANGE,val:e,insId:g,ancestorsInsIds:I,nodeId:i.id})},$={execute:(e,n,o,i)=>(0,t.execute)({node:e,inputs:n,outputs:o,resolvedDeps:h,_debugger:v,insId:i,onCompleted:_,onStarted:C}),insId:g,state:null!==(o=b[M])&&void 0!==o?o:new Map,onCleanup:e=>{P.push(e)},onError:e=>{y(e)},context:null!=N?N:{},ancestorsInsIds:I,globalState:R};let z,H=!1;const F=(i.reactiveInputs||[]).filter((e=>{var t;return!(0,p.isStaticInputPinConfig)(null===(t=u[e])||void 0===t?void 0:t.config)})),L=()=>{var e;null===(e=b[M])||void 0===e||e.clear(),(0,c.keys)(b).filter((e=>e.startsWith(`${D}.`))).forEach((e=>{b[e]=new Map}))},q=e=>{const t=(null==e?void 0:e.key)&&F.includes(null==e?void 0:e.key);if(H&&!t);else{const o=H&&t;if((0,l.isNodeStateValid)(u,A,i)||o){let t;if(H){if(!e)throw new Error("Unexpected state, got reactive node while not processing and not valid");const n=(0,l.pullValueForExecution)(e.key,u[e.key],A,x);t={...z,[e.key]:n},V()}else t=(0,l.pullValuesForExecution)(u,A,x),z=t,V();let o=new Set,s={};if(H=!0,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),i.completionOutputs){const e=i.completionOutputs.map((e=>e.split("+"))).reduce(((e,t)=>(t.forEach((n=>{e.set(n,t)})),e)),new Map);(0,c.entries)(m).forEach((t=>{let[n,a]=t;a.pipe((0,r.first)()).subscribe((t=>{o.add(n),s[n]=t;let r=e.get(n);r&&(r.splice(r.indexOf(n),1),0===r.length&&(H=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_&&_(s),L(),(0,c.callFnOrFnPromise)(O,`Error with cleanup function of ${i.id}`),O=void 0,o.clear(),s={},(0,l.hasNewSignificantValues)(u,A,x,i.id)&&q()))}))}))}else(0,c.entries)(m).forEach((e=>{let[t,n]=e;n.subscribe((e=>{s[t]=e}))}));try{k("Running node %s with values %o",i.id,t),C&&C(),O=(null!=j?j:w)(t,m,$),(0,c.isPromise)(O)?O.then((()=>{void 0===i.completionOutputs&&_&&(H=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_(s),L(),(0,l.hasNewSignificantValues)(u,A,x,i.id)&&q())})).catch((e=>{y(e),H=!1,k("Error in node %s - value %e",i.id,e),S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id})})):void 0===i.completionOutputs&&_&&(H=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_(s),L())}catch(n){y(n),H=!1,k("Error in node %s - value %e",i.id,n),S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id})}const d=F.find((e=>u[e]&&(0,l.peekValueForExecution)(e,u[e],A,x,i.id)));if(d){const e=(0,l.peekValueForExecution)(d,u[d],A,x,i.id);q({key:d,value:e})}else{const e=(0,c.entries)(u).find((e=>{let[t,n]=e;const o=(0,a.isQueueInputPinConfig)(n.config),s=(0,l.peekValueForExecution)(t,n,A,x,i.id);return!!o&&(0,c.isDefined)(s)}));if(e){const[t,n]=e,o=(0,l.peekValueForExecution)(t,n,A,x,i.id);q({key:t,value:o})}}}}};q();const G=(0,l.subscribeInputsToState)(u,A,((e,t)=>{E("Got input %s - value is [%o]",e,t),V();try{q({key:e,value:t})}catch(n){y(n)}}));return P.push(G),()=>{(0,c.callFnOrFnPromise)(O,`Error with cleanup function of ${i.id}`),P.forEach((e=>e()))}})({node:O,inputs:M,outputs:D,resolvedDeps:E,_debugger:v,insId:g,mainState:b,ancestorsInsIds:y,onError:P,onBubbleError:C,env:_,extraContext:I,onCompleted:x,onStarted:N});return()=>{w.forEach((e=>e())),T()}}},84479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeInputsToState=t.isNodeStateValid=t.hasNewSignificantValues=t.peekValuesForExecution=t.pullValuesForExecution=t.pullValueForExecution=t.peekValueForExecution=void 0;const o=n(30292),i=n(86873),s=n(6775),r=(e,t)=>{const n=(0,o.extractStaticValue)(e);if((0,o.isEnvValue)(n)){return((e,t)=>{const n=e.split(".");let o={...t};for(let s of n){if(!o||!(0,i.isDefined)(o[s])||null===o[s])throw new Error(`Cannot find key ${e} inside obj ${t}`);o=o[s]}return o})((0,o.getEnvKeyFromValue)(n),t)}return n};t.peekValueForExecution=(e,t,n,i,s)=>{const a=n.get(e);let u;if(!t)throw new Error(`Trying to peek value of inexsting input in key "${e}" in node "${s}"`);return u=(0,o.isStaticInput)(t)?r(t,i):(0,o.isQueueInputPinConfig)(t.config)?a?[...a].shift():void 0:a,u};t.pullValueForExecution=(e,t,n,i)=>{const s=n.get(e);let a;return(0,o.isStaticInput)(t)?a=r(t,i):(0,o.isQueueInputPinConfig)(t.config)?(a=(s||[]).shift(),n.set(e,s)):(a=s,(0,o.isStickyInputPinConfig)(t.config)||n.delete(e)),a};t.pullValuesForExecution=(e,n,o)=>(0,i.entries)(e).reduce(((e,i)=>{let[s,r]=i;return e[s]=(0,t.pullValueForExecution)(s,r,n,o),e}),{});t.peekValuesForExecution=(e,n,o,s)=>(0,i.entries)(e).reduce(((e,i)=>{let[r,a]=i;return e[r]=(0,t.peekValueForExecution)(r,a,n,o,s),e}),{});t.hasNewSignificantValues=(e,n,s,r)=>(0,i.entries)(e).some((e=>{let[a,u]=e;const l=(0,o.isQueueInputPinConfig)(u.config),c=(0,t.peekValueForExecution)(a,u,n,s,r);return(0,i.isDefined)(c)&&l}));t.isNodeStateValid=(e,t,n)=>{const r=(0,i.keys)(e),a=(0,i.keys)(n.inputs).filter((e=>{var t;const o=null===(t=n.inputs[e])||void 0===t?void 0:t.mode;return!o||"required"===o}));r.includes(s.TRIGGER_PIN_ID)&&a.push(s.TRIGGER_PIN_ID);return!!(0,i.containsAll)(r,a)&&(0,i.entries)(e).filter((e=>{let[t]=e;return!!n.inputs[t]||t===s.TRIGGER_PIN_ID})).every((e=>{let[s,r]=e;var a;const u=t.get(s);return"optional"===((null===(a=n.inputs[s])||void 0===a?void 0:a.mode)||"required")||(!!(0,o.isStaticInput)(r)||((0,o.isQueueInputPinConfig)(r.config)?(0,i.isDefined)(u)&&u.length>0:(0,i.isDefined)(u)))}))};t.subscribeInputsToState=(e,t,n)=>{const s=[];return(0,i.entries)(e).forEach((e=>{let[i,r]=e;if(!r)return;if((0,o.isStaticInput)(r))return;const a=r.subject.subscribe((e=>{if((0,o.isQueueInputPinConfig)(r.config)){const o=t.get(i)||[];if(!Array.isArray(o))throw new Error(`impossible state - state of key ${i} is set but not an array`);o.push(e),t.set(i,o),n(i,e)}else t.set(i,e),n(i,e)}));s.push((()=>a.unsubscribe()))})),()=>s.forEach((e=>e()))}},5474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flydeFlowSchema=void 0;const o=n(29022),i=o.z.record(o.z.string(),o.z.string().or(o.z.array(o.z.string()))),s=o.z.strictObject({x:o.z.number(),y:o.z.number()}),r=o.z.discriminatedUnion("mode",[o.z.strictObject({mode:o.z.literal("static"),value:o.z.any()}),o.z.strictObject({mode:o.z.literal("queue")}),o.z.strictObject({mode:o.z.literal("sticky")})]),a=o.z.object({size:o.z.optional(o.z.enum(["small","regular","large"])),icon:o.z.optional(o.z.any()),color:o.z.optional(o.z.string()),cssOverride:o.z.optional(o.z.record(o.z.string()))}),u=o.z.object({pos:s.default({x:0,y:0}),id:o.z.string(),inputConfig:o.z.optional(o.z.record(o.z.string(),r)).default({}),visibleInputs:o.z.optional(o.z.array(o.z.string())),visibleOutputs:o.z.optional(o.z.array(o.z.string())),nodeId:o.z.optional(o.z.string()),node:o.z.optional(o.z.any()),style:o.z.optional(a)}).refine((e=>e.node||e.nodeId),{message:"Instance must have either an inline node or refer to a nodeId"}),l=o.z.union([o.z.string(),o.z.object({mode:o.z.enum(["required","optional","required-if-connected"]),type:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),defaultValue:o.z.optional(o.z.any())})]),c=o.z.object({type:o.z.optional(o.z.string()),optional:o.z.optional(o.z.boolean()),delayed:o.z.optional(o.z.boolean()),description:o.z.optional(o.z.string())}),d=o.z.object({id:o.z.optional(o.z.string()),inputs:o.z.record(o.z.string(),l),outputs:o.z.record(o.z.string(),c),inputsPosition:o.z.optional(o.z.record(o.z.string(),s)),outputsPosition:o.z.optional(o.z.record(o.z.string(),s)),customViewCode:o.z.optional(o.z.string()),dataBuilderSource:o.z.optional(o.z.string()),templateType:o.z.optional(o.z.string()),completionOutputs:o.z.optional(o.z.array(o.z.string())),reactiveInputs:o.z.optional(o.z.array(o.z.string())),defaultStyle:o.z.optional(a),description:o.z.optional(o.z.string()),searchKeywords:o.z.optional(o.z.array(o.z.string()))}),p=o.z.object({instances:o.z.array(u),connections:o.z.array(o.z.strictObject({from:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),to:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),delayed:o.z.optional(o.z.boolean()),hidden:o.z.optional(o.z.boolean())}))}).and(d);t.flydeFlowSchema=o.z.strictObject({imports:o.z.optional(i).default({}),node:p})},74762:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticValueVisualNode=void 0,i(n(86873),t);const s=n(30292);i(n(6775),t),i(n(47025),t),i(n(10418),t),i(n(30292),t),i(n(3320),t),i(n(79804),t),i(n(5474),t);t.isStaticValueVisualNode=e=>!!e&&!!(0,s.maybeGetStaticValueNodeId)(`${e}`)},87093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fakeVm=t.VM=t.VMScript=void 0;const o=n(86873);class i{constructor(e){this.script=e}}t.VMScript=i;class s{constructor(e){this.context=e}run(e){const t=(0,o.okeys)(this.context.sandbox),n=Object.values(this.context.sandbox);Function(...t,e.script)(...n)}}t.VM=s,t.fakeVm={VMScript:i,VM:s}},28145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVM2Instance=void 0;const o=n(87093);t.getVM2Instance=()=>o.fakeVm},79804:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.customNodesToNodesCollection=t.inlineValueNodeToNode=void 0;const i=o(n(18706)),s=n(86873),r=n(30292),a=(0,n(28145).getVM2Instance)();t.inlineValueNodeToNode=function(e,t){void 0===t&&(t={});const{runFnRawCode:n,...o}=e,u=(0,s.debugLogger)(`code-node:${e.id}`),l=`\n try {\n ${n}\n } catch (e) {\n adv.onError(e);\n }\n `,c=new a.VMScript(l),d={...o,run:(n,o,l)=>{const d=new a.VM({sandbox:{inputs:n,outputs:o,setInterval:setInterval,clearInterval:clearInterval,setTimeout:setTimeout,clearTimeout:clearTimeout,encodeURIComponent:encodeURIComponent,adv:l,log:function(){for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeWithDependencies=void 0;const o=n(30292),i=n(74762),s=n(88270);t.getNodeWithDependencies=function(e,n,r){if(void 0===r&&(r=[]),(0,o.isInlineValueNode)(e))return[e];if(r.includes(e.id))return[];const a=(0,i.removeDupes)(e.instances.filter((e=>(0,s.isRefNodeInstance)(e))).map((e=>e.nodeId)).filter((e=>n[e])));return[e,...a.flatMap((e=>{var t;return null!==(t=n[e])&&void 0!==t?t:[]})).reduce(((e,o)=>[...e,...(0,t.getNodeWithDependencies)(o,n,[...r,...a])]),[])]}},30292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88270),t),i(n(43069),t),i(n(79426),t),i(n(44535),t),i(n(18063),t),i(n(20359),t)},18063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeInstanceError=void 0;class n extends Error{constructor(e,t,n){let o="Unknown error";o="string"==typeof e?e:e instanceof Error?e.message:null!==e&&"object"==typeof e?JSON.stringify(e):String(e),super(`${o} (insId: ${t}, nodeId: ${n})`),this.name=this.constructor.name,this.message=`${o} (insId: ${t}, nodeId: ${n})`,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.fullInsIdsPath=t,this.nodeId=n}}t.NodeInstanceError=n},88270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInsId=t.NodeInstance=t.isRefNodeInstance=t.isInlineNodeInstance=t.inlineNodeInstance=t.nodeInstance=void 0;const o=n(36618);t.nodeInstance=(e,t,n,o)=>({id:e,nodeId:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.inlineNodeInstance=(e,t,n,o)=>({id:e,node:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.isInlineNodeInstance=e=>!!e.node;t.isRefNodeInstance=e=>!(0,t.isInlineNodeInstance)(e);t.NodeInstance=(e,t,n,o)=>({id:e,nodeId:t.id,inputConfig:n||{},pos:o||{x:0,y:0}});t.createInsId=e=>`${e.id}-${(0,o.slug)()}`},43069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvKeyFromValue=t.toEnvValue=t.isEnvValue=t.extractStaticValue=t.isStaticInput=t.isDynamicInput=t.staticNodeInput=t.dynamicNodeInputs=t.dynamicNodeInput=t.dynamicOutput=t.nodeOutputs=t.nodeOutput=t.nodeInputs=t.isInputPinOptional=t.nodeInput=void 0;const o=n(62600),i=n(30292),s=n(86873),r=n(79426);t.nodeInput=function(e){return void 0===e&&(e="required"),{mode:e}};t.isInputPinOptional=e=>"optional"===e.mode;t.nodeInputs=(e,n)=>(0,s.repeat)(e,(e=>(0,t.nodeInput)((null==n?void 0:n[e])||"required")));t.nodeOutput=function(e){return void 0===e&&(e=!1),{delayed:e}};t.nodeOutputs=e=>(0,s.repeat)(e,(()=>(0,t.nodeOutput)()));t.dynamicOutput=()=>new o.Subject,t.dynamicNodeInput=(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})));t.dynamicNodeInputs=function(e){return void 0===e&&(e=10),(0,s.repeat)(e,(()=>(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})))()))};t.staticNodeInput=e=>({config:(0,r.staticInputPinConfig)(e)});t.isDynamicInput=e=>{const t=e;return t&&t.subject&&!!t.subject.next};t.isStaticInput=e=>(0,i.isStaticInputPinConfig)(null==e?void 0:e.config);t.extractStaticValue=e=>{if((0,t.isStaticInput)(e))return e.config.value;throw new Error("Cannot extract static value from non static arg")};t.isEnvValue=e=>"string"==typeof e&&e.startsWith("$ENV.");t.toEnvValue=e=>`$ENV.${e}`;t.getEnvKeyFromValue=e=>"string"==typeof e?e.replace(/^\$ENV\./,""):e},20359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeFromFunction=t.getNodeDef=t.getNode=t.getStaticValue=t.maybeGetStaticValueNodeId=t.fromSimplified=t.inlineValueNode=t.codeNode=t.visualNode=t.isInlineValueNode=t.isVisualNode=t.isCodeNode=t.isBaseNode=t.InlineValueNodeType=void 0;const o=n(86873),i=n(88270),s=n(43069);!function(e){e.VALUE="value",e.FUNCTION="function"}(t.InlineValueNodeType||(t.InlineValueNodeType={}));t.isBaseNode=e=>e&&e.id&&e.inputs&&e.outputs;t.isCodeNode=e=>(0,t.isBaseNode)(e)&&"function"==typeof e.run;t.isVisualNode=e=>!!e.instances;t.isInlineValueNode=e=>(0,o.isDefined)(e)&&(0,o.isDefined)(e.runFnRawCode),t.visualNode=(0,o.testDataCreator)({id:"visual-node",inputs:{},outputs:{},instances:[],connections:[],outputsPosition:{},inputsPosition:{}}),t.codeNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},run:o.noop}),t.inlineValueNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},runFnRawCode:""});t.fromSimplified=e=>{let{run:t,inputTypes:n,outputTypes:i,id:s}=e;return{id:s,inputs:(0,o.entries)(n).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),outputs:(0,o.entries)(i).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),run:t}};t.maybeGetStaticValueNodeId=e=>{const t="string"==typeof e&&e.match(/^__node\:(.*)/);if(t){return t[1]}return null};t.getStaticValue=(e,n,o)=>{const i=(0,t.maybeGetStaticValueNodeId)(e);if(i){const e=n[i];if(!e)throw new Error(`Instance ${o} referrer to a node reference ${i} that does not exist`);return e}return e};t.getNode=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw new Error(`Node with id ${n} not found`);return o};t.getNodeDef=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw console.error(`Node with id ${n} not found`),new Error(`Node with id ${n} not found`);return o};t.codeFromFunction=e=>{let{id:t,fn:n,inputNames:o,outputName:i,defaultStyle:r}=e;return{id:t,inputs:o.reduce(((e,t)=>({...e,[t]:(0,s.nodeInput)()})),{}),outputs:{[i]:(0,s.nodeOutput)()},run:(e,t)=>{const s=o.map((t=>e[t])),r=t[i],a=n(...s);return Promise.resolve(a).then((e=>null==r?void 0:r.next(e)))},completionOutputs:[i],defaultStyle:r}}},44535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nodeFromSimpleFunction=void 0,t.nodeFromSimpleFunction=function(e){var t;return{...e,id:e.id,description:e.description,namespace:e.namespace,inputs:e.inputs?e.inputs.reduce(((e,t)=>{let{name:n,description:o,mode:i,defaultValue:s}=t;return{...e,[n]:{description:o,mode:null!=i?i:"required",defaultValue:s}}}),{}):{},outputs:e.output?{[e.output.name]:{description:e.output.description}}:{},defaultStyle:{icon:e.icon,size:e.size},run:null!==(t=e.fullRunFn)&&void 0!==t?t:async function(t,n,o){var i,s;const r=(null!==(i=e.inputs)&&void 0!==i?i:[]).map((e=>{let{name:n}=e;return t[n]}));try{const t=await Promise.resolve(e.run(...r));e.output&&(null===(s=n[e.output.name])||void 0===s||s.next(t))}catch(a){console.error("Error in node",a),o.onError(a)}},customViewCode:e.customViewCode}}},79426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticInputPinConfig=t.isStickyInputPinConfig=t.isQueueInputPinConfig=t.staticInputPinConfig=t.stickyInputPinConfig=t.queueInputPinConfig=t.INPUT_MODES=void 0,t.INPUT_MODES=["queue","sticky","static"];t.queueInputPinConfig=()=>({mode:"queue"});t.stickyInputPinConfig=()=>({mode:"sticky"});t.staticInputPinConfig=e=>({mode:"static",value:e});t.isQueueInputPinConfig=e=>"queue"===e.mode;t.isStickyInputPinConfig=e=>!!e&&"sticky"===e.mode,t.isStaticInputPinConfig=function(e){return!!e&&"static"===e.mode}},10418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedExecute=void 0;const o=n(74762),i=n(47025);t.simplifiedExecute=function(e,t,n,s,r){void 0===r&&(r={});const a=(0,o.keys)(e.outputs),u=Object.keys(n).reduce(((e,t)=>{const i=n[t];return{...e,[t]:(0,o.isDynamicInput)(i)?i:(0,o.staticNodeInput)(i)}}),{}),l=a.reduce(((e,t)=>{const n=(0,o.dynamicOutput)();return s&&n.subscribe((e=>{s(t,e)})),{...e,[t]:n}}),{});return(0,i.execute)({node:e,inputs:u,outputs:l,resolvedDeps:t,onBubbleError:e=>{throw e},...r})}},25779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodePreview=void 0;const o=n(35250),i=n(74762),s=n(86553);t.NodePreview=e=>{let{node:t}=e;const n={node:t,instance:(0,i.nodeInstance)("bob",t.id,{}),connections:[],viewPort:{pos:{x:0,y:0},zoom:1},resolvedDeps:{},connectionsPerInput:{},onUngroup:i.noop,onDblClick:i.noop,onDragEnd:i.noop,onDragMove:i.noop,onDragStart:i.noop,onPinClick:i.noop,onPinDblClick:i.noop,onSelect:i.noop,onTogglePinBreakpoint:i.noop,onTogglePinLog:i.noop,onToggleSticky:i.noop,displayMode:!0,onInspectPin:i.noop,onDetachConstValue:i.noop,onCopyConstValue:i.noop,onPasteConstValue:i.noop,ancestorsInsIds:"",onChangeVisibleInputs:i.noop,onChangeVisibleOutputs:i.noop,onConvertConstToEnv:i.noop,forceShowMinimized:"both",onExtractInlineNode:i.noop,onCloseInlineEditor:i.noop,isConnectedInstanceSelected:!1,inlineEditorPortalDomNode:null,onChangeStyle:i.noop,onDeleteInstance:i.noop,onGroupSelected:i.noop,onSetDisplayName:i.noop,hadError:!1,queuedInputsData:{},onPinMouseDown:i.noop,onPinMouseUp:i.noop};return(0,o.jsx)("div",{className:"node-preview",children:(0,o.jsx)(s.InstanceView,{...n})})}},30653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDarkMode=t.DarkModeProvider=void 0;const o=n(70079),i=(0,o.createContext)(!0);t.DarkModeProvider=i.Provider;t.useDarkMode=()=>(0,o.useContext)(i)},29183:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataInspectionModal=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=n(74089),p=n(83938),f=n(17102),m=n(98158);t.DataInspectionModal=e=>{var t;const{onRequestHistory:n}=(0,m.useDebuggerContext)(),{item:o}=e,[i,s]=c.default.useState(),[r,h]=c.default.useState(0),[v,g]=c.default.useState(""),[I,b]=c.default.useState(),[y]=(0,d.useDebounce)(v,300);(0,c.useEffect)((()=>{b(null==i?void 0:i.lastSamples.filter((e=>"object"==typeof e.val?JSON.stringify(e.val).includes(y):e.val.toString().includes(y)))),h(0)}),[null==i?void 0:i.lastSamples,y]),c.default.useEffect((()=>{!async function(){var e,t;const i=await n(o.insId,null===(e=o.pin)||void 0===e?void 0:e.id,null===(t=o.pin)||void 0===t?void 0:t.type);s(i)}()}),[o,n]);const C=e=>{const t=e.val;return"object"==typeof t?(0,a.jsx)(p.BrowserOnlyReactJson,{src:t}):(0,a.jsx)(u.Code,{children:t.toString()})},_=`"${o.insId}" ${(null===(t=o.pin)||void 0===t?void 0:t.id)?`(${o.pin.id})`:""}`;return(0,a.jsx)(u.Dialog,{isOpen:!0,title:`Inspecting data for instance ${_}`,onClose:e.onClose,canEscapeKeyClose:!1,className:"data-inspection-modal",children:(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{children:[i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("em",{children:[_," called ",i.total," time(s)"]}),i.total>10&&(0,a.jsx)("span",{children:"Showing last 10 samples"})]}):null,(0,a.jsx)("input",{className:"bp5-input bp5-small bp5-fill",type:"search",placeholder:"Search for values",dir:"auto",onChange:e=>g(e.target.value),value:v}),y.length>0&&(0,a.jsxs)("span",{children:["Showing ",null==I?void 0:I.length," of ",i.lastSamples.length," ",'samples matching query "',y,'"']})]}),(0,a.jsx)("main",{className:"main-wrapper",children:(()=>{if(!i)return(0,a.jsx)(f.Loader,{});if(0===i.total)return(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",(0,a.jsx)("em",{children:o.insId})," ",o.pin?(0,a.jsxs)(c.default.Fragment,{children:["and pin ",(0,a.jsx)("em",{children:o.pin.id})]}):null,". Make sure debugger is running and your program was triggered."]});const e=null==I?void 0:I[r];return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Card,{className:"content-wrapper",children:[e?(0,a.jsxs)("div",{className:"info",children:[(0,a.jsxs)("div",{children:["Showing sample ",r," of event from"," ",(0,a.jsx)("strong",{children:(0,d.timeAgo)(e.time)})," (",new Date(e.time).toLocaleString(),")"]}),(0,a.jsxs)("div",{children:["Instance: ",(0,a.jsx)("strong",{children:e.insId}),", Pin id:"," ",(0,a.jsx)("strong",{children:e.pinId})," "]}),(0,a.jsx)("div",{children:"Value:"})]}):null,C(e)]}),(0,a.jsx)(u.Menu,{className:"samples-menu",children:I.map(((e,t)=>{const n=e.pinId,o=`${i.total-t}. from pin "${n}"`;return(0,a.jsx)(u.MenuItem,{text:o,onClick:()=>h(t)},t)}))})]}):i.lastSamples.length>0&&v.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",children:['No data found for search query "',v,'"']}):(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",o.insId," ",o.pin?`and ${o.pin.id}`:"",". Make sure a debugger is connected and your program was triggered."]})})()})]})})})}},40471:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29183),t)},98158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebuggerContext=t.DebuggerContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({onRequestHistory:()=>Promise.reject(new Error("Not implemented"))});t.DebuggerContextProvider=i.Provider;t.useDebuggerContext=()=>(0,o.useContext)(i)},86125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDependenciesContext=t.DependenciesContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({resolvedDependencies:{},onImportNode:()=>Promise.reject(new Error("Not implemented")),onRequestImportables:()=>Promise.reject(new Error("Not implemented"))});t.DependenciesContextProvider=i.Provider;t.useDependenciesContext=()=>(0,o.useContext)(i)},97106:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FlowEditor=void 0;const u=n(35250),l=s(n(70079)),c=n(74762),d=n(63521),p=a(n(53865)),f=n(68120),m=n(7047),h=n(84472),v=n(82232),g=n(49283),I=n(43490),b=n(68840),y=n(78087),C=n(20079),_=n(60190),x=n(40471),N=n(98158),w=n(86125),j=n(30653),E=n(77852);r(n(43490),t),r(n(98158),t),r(n(86125),t),b.library.add(y.fab,C.fas);const P=["select","drag-move","order-step"];t.FlowEditor=l.memo(l.forwardRef(((e,t)=>{const{state:n,onChangeEditorState:o}=e,{resolvedDependencies:i,onImportNode:s}=(0,w.useDependenciesContext)(),[r,a]=l.useState([]),[b,y]=l.useState([]),{flow:C,boardData:O}=n,S=n.flow.node,[D,M]=l.useState({}),[T,k]=l.useState(new Set),{debuggerClient:R}=(0,N.useDebuggerContext)();l.useEffect((()=>{if(R)return R.onBatchedEvents((e=>{e.forEach((e=>{e.type===c.DebuggerEventType.INPUTS_STATE_CHANGE&&(console.log("INPUTS_STATE_CHANGE",e.insId,e.val),M((t=>({...t,[e.insId]:e.val})))),e.type===c.DebuggerEventType.ERROR&&k((t=>{const n=new Set(t);return n.add(e.insId),n}))}))}))}),[R]);const{openFile:A,reportEvent:V}=(0,I.usePorts)(),$=l.useCallback(((e,t)=>{console.info("onChangeFlow",t.type),"functional"===t.type&&(a([{flow:{...n.flow,...e}},...r.slice(0,50)]),y([])),o((t=>({...t,flow:{...t.flow,...e}})))}),[o,n.flow,r]),[z,H]=l.useState({instances:[],connections:[]}),[F,L]=l.useState(!1),q=l.useCallback((()=>L(!1)),[]),G=l.useCallback((()=>L(!0)),[]),B=l.useCallback((e=>{o((t=>({...t,boardData:{...t.boardData,...e}})))}),[o]);l.useEffect((()=>{B({selected:[],viewPort:d.defaultViewPort,from:void 0,to:void 0,lastMousePos:{x:0,y:0}})}),[S.id]),(0,f.useHotkeys)("cmd+z",(e=>{y([...b,n]);const[t,...i]=r;t&&(o((e=>({...e,...t}))),a(i)),e.preventDefault()}),{text:"Undo last change",group:"Editing"},[n,r,b]);const U=l.useCallback(((e,t)=>{P.some((e=>t.message.includes(e)))||y([]),$({node:e},t)}),[$]),W=l.useCallback((e=>{A({absPath:e.source.path})}),[A]),Z=l.useCallback((function(e,t){void 0===t&&(t=-1*d.NODE_HEIGHT*1.5);const n=(0,m.createNewNodeInstance)(e,t,O.lastMousePos,i);if(n){const e=(0,p.default)(C,(e=>{const t=e.node;if(!(0,c.isVisualNode)(t))throw new Error("Impossible state, adding node to non visual node");t.instances.push(n)}));return $(e,(0,v.functionalChange)("add-node")),q(),n}}),[O.lastMousePos,C,$,q,i]),J=l.useCallback((async e=>{switch(e.type){case g.OmniBarCmdType.ADD:return V("addNode",{nodeId:e.data,source:"omnibar"}),Z(e.data);case g.OmniBarCmdType.ADD_VALUE:{const e=t.current;null==e||e.requestNewInlineValue();break}case g.OmniBarCmdType.IMPORT:{await s(e.data,{pos:O.lastMousePos});const t=(0,_.vAdd)({x:0,y:0},O.lastMousePos),n=(0,m.createNewNodeInstance)(e.data.node,0,t,i),o=(0,p.default)(C,(e=>{e.node.instances.push(n)}));$(o,(0,v.functionalChange)("add-imported-node")),V("addNode",{nodeId:e.data.node.id,source:"omnibar"});break}default:h.AppToaster.show({intent:"warning",message:"Not supported yet"})}q()}),[q,V,Z,t,s,O.lastMousePos,i,C,$]),[Y,K]=l.useState(),Q=l.useCallback((()=>K(void 0)),[]),X=l.useCallback(((e,t)=>{K({insId:e,pin:t})}),[]),{isDarkMode:ee}=(0,E.useDarkMode)();return(0,u.jsx)("div",{className:"flyde-flow-editor",children:(()=>{var n;if((0,c.isInlineValueNode)(S))throw new Error("Impossible state");return(0,u.jsx)(j.DarkModeProvider,{value:null!==(n=e.darkMode)&&void 0!==n?n:ee,children:(0,u.jsxs)(l.Fragment,{children:[Y?(0,u.jsx)(x.DataInspectionModal,{item:Y,onClose:Q}):null,(0,u.jsx)(d.VisualNodeEditor,{currentInsId:c.ROOT_INS_ID,ref:t,boardData:O,onChangeBoardData:B,node:S,onGoToNodeDef:W,onChangeNode:U,resolvedDependencies:i,clipboardData:z,onCopy:H,nodeIoEditable:!S.id.startsWith("Trigger"),onInspectPin:X,onShowOmnibar:G,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:D,initialPadding:e.initialPadding,instancesWithErrors:T,disableScrolling:e.disableScrolling},S.id),F?(0,u.jsx)(g.Omnibar,{flow:C,resolvedNodes:i,onCommand:J,visible:F,onClose:q}):null]})})})()})})))},9001:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeEditor=t.renderCreateIOOption=void 0;const i=n(35250),s=o(n(70079)),r=n(74762),a=n(50382),u=o(n(53865)),l=n(70457),c=n(25779);t.renderCreateIOOption=(e,t,n)=>(0,i.jsx)(a.MenuItem,{icon:"add",text:`Create "${e}"`,active:t,onClick:n,shouldDismissPopover:!1});const d=l.MultiSelect.ofType();t.BaseNodeEditor=e=>{var n,o;const{node:l,onChange:p}=e,f=(0,r.entries)(l.inputs),m=f.filter((e=>{let[,t]=e;return"required"===t.mode})).map((e=>{let[t]=e;return t})),h=f.filter((e=>{let[,t]=e;return"optional"===t.mode})).map((e=>{let[t]=e;return t})),v=f.filter((e=>{let[,t]=e;return"required-if-connected"===t.mode})).map((e=>{let[t]=e;return t})),[g,I]=s.default.useState(!1),b=(0,r.okeys)(l.outputs),y=s.default.useCallback((e=>{p({...l,id:e})}),[l,p]),C=s.default.useCallback((e=>{let t=e?e.split(","):void 0;"[]"===e&&(t=[]),p({...l,completionOutputs:t})}),[l,p]),_=s.default.useCallback((e=>{let t=e?e.split(","):void 0;p({...l,reactiveInputs:t})}),[l,p]),x=s.default.useCallback(((e,t)=>{const n=(0,u.default)(l,(n=>{n.inputs[e]=(0,r.nodeInput)(t)}));p(n)}),[l,p]),N=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.inputs[e]}));p(t)}),[l,p]),w=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{t.outputs[e]=(0,r.nodeOutput)()}));p(t)}),[l,p]),j=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.outputs[e]}));p(t)}),[l,p]);return(0,i.jsxs)("div",{className:"base-node-editor",children:[(0,i.jsx)("div",{className:"form-row",children:(0,i.jsx)(a.FormGroup,{label:"Node Name",labelFor:"text-input",labelInfo:"(required)",children:(0,i.jsx)(a.InputGroup,{id:"node-name",disabled:e.idDisabled,placeholder:"Node ID",value:l.id,onChange:e=>y(e.target.value)})})}),(0,i.jsx)(a.FormGroup,{label:"Required Inputs",children:(0,i.jsx)(d,{selectedItems:m,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),!0!==e.hiddenOutputs?(0,i.jsx)(a.FormGroup,{label:"Outputs",children:(0,i.jsx)(d,{selectedItems:b,placeholder:"Enter output names here",items:[],tagRenderer:e=>e,onItemSelect:w,onRemove:j,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}):null,(0,i.jsx)(a.Checkbox,{checked:g,onChange:e=>I(e.target.checked),children:"Show advanced options"}),(0,i.jsxs)(a.Collapse,{isOpen:g,children:[(0,i.jsx)(a.FormGroup,{label:"Optional Inputs",children:(0,i.jsx)(d,{selectedItems:h,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"optional"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Required-if-connected Inputs",children:(0,i.jsx)(d,{selectedItems:v,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required-if-connected"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Completion Outputs",children:(0,i.jsx)(a.InputGroup,{id:"completion-outputs",placeholder:"completion outputs",value:(null===(n=l.completionOutputs)||void 0===n?void 0:n.join(","))||"",onChange:e=>C(e.target.value)})}),(0,i.jsx)(a.FormGroup,{label:"Reactive Inputs",children:(0,i.jsx)(a.InputGroup,{id:"reactive-inputs",placeholder:"Reactive inputs",value:(null===(o=l.reactiveInputs)||void 0===o?void 0:o.join(","))||"",onChange:e=>_(e.target.value)})})]}),(0,i.jsx)(a.FormGroup,{label:"Preview",children:(0,i.jsx)("div",{className:"preview-wrapper",children:(0,i.jsx)(c.NodePreview,{node:l})})})]})}},82232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metaChange=t.functionalChange=void 0;t.functionalChange=e=>({type:"functional",message:e});t.metaChange=function(e){return void 0===e&&(e="n/a"),{type:"meta",message:e}}},41032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safelyGetNodeDef=t.loadingDef=void 0;const o=n(74762);t.loadingDef={id:"Loading",inputs:{},outputs:{}};t.safelyGetNodeDef=(e,n)=>{try{return(0,o.getNodeDef)(e,n)}catch(i){const n="string"==typeof e?e:e.nodeId;return{...t.loadingDef,id:n}}}},72125:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCodeModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(68371),f=n(74762),m=n(31745),h="`Result is ${inputs.a + inputs.b}`";t.InlineCodeModal=u.memo((function(e){const{initialValue:t,initialType:n}=e,[o,i]=u.useState((0,f.isDefined)(t)?t:h),[s,r]=u.useState(n||f.InlineValueNodeType.VALUE),v=(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:['You can add variables to by referrencing the "inputs" object.',(0,a.jsx)("br",{})," For example:",(0,a.jsx)(c.Code,{children:"`Hello {inputs.name}`"}),' will expose an input pin named "name"']}),(0,a.jsxs)("p",{children:["You can also use ternery expressions, arithmetic operators and more!",(0,a.jsx)("br",{}),"For example:",(0,a.jsx)(c.Code,{children:"inputs.a > inputs.b ? inputs.a + 42 : Math.random() * inputs.b"})]})]}),g=(0,a.jsxs)("span",{children:["Type in any valid JS value, such as ",(0,a.jsx)(c.Code,{children:"true"}),", ",(0,a.jsx)(c.Code,{children:"42"}),","," ",(0,a.jsx)(c.Code,{children:'["bob", "alice", "dave"]'}),".",(0,a.jsx)("br",{})," Dynamic inputs may also be used"]}),I=(0,a.jsxs)("span",{children:["Write any JS code and return a value.",(0,a.jsx)("br",{})," The returned value will be the output.",(0,a.jsx)("br",{})," Example:",(0,a.jsx)(c.Code,{children:"const a = inputs.a; const b = inputs.b; return Math.floor(a/b);"})]}),b=(0,p.getVariables)(o);return u.useEffect((()=>{o===h&&s===f.InlineValueNodeType.FUNCTION&&i(`return ${h}`),o===`return ${h}`&&s===f.InlineValueNodeType.VALUE&&i(h)}),[o,s]),(0,a.jsxs)(c.Dialog,{isOpen:!0,title:"Inline Value / Code",onClose:e.onCancel,className:"inline-code-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:t=>{"Enter"===t.key&&t.metaKey&&e.onSubmit(s,o)},tabIndex:0,children:[(0,a.jsxs)(c.RadioGroup,{inline:!0,onChange:e=>r(e.target.value),selectedValue:s,children:[(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Value ",(0,a.jsx)(m.InfoTooltip,{content:g})]}),value:f.InlineValueNodeType.VALUE}),(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Function ",(0,a.jsx)(m.InfoTooltip,{content:I})]}),value:f.InlineValueNodeType.FUNCTION})]}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"javascript",value:o,onChange:e=>i(e||""),onMount:e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})}}),(()=>{const e=o.includes("return");return e&&s===f.InlineValueNodeType.VALUE?(0,a.jsx)(c.Callout,{intent:c.Intent.WARNING,children:'When using the "value" type you are not expected to return anything'}):e||s!==f.InlineValueNodeType.FUNCTION?null:(0,a.jsxs)(c.Callout,{intent:c.Intent.DANGER,children:['When using the "function" type you are expected to'," ",(0,a.jsx)(c.Code,{children:"return"})," a value.",(0,a.jsx)("br",{}),"Example: ",(0,a.jsx)(c.Code,{children:"return 42 + Date.now();"})]})})(),(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Input pins detected:"," ",b.length?b.map((e=>(0,a.jsx)(c.Code,{children:e},e))):"None",(0,a.jsx)(m.InfoTooltip,{content:v})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:e.onCancel,children:"Cancel"}),(0,a.jsx)(c.Button,{onClick:()=>e.onSubmit(s,o),intent:c.Intent.PRIMARY,className:"save-btn",children:"Save"})]})})]})}))},18594:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(72125),t)},68371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInlineValueNode=t.getVariables=void 0;const o=n(74762),i=n(74762);t.getVariables=e=>(e.match(/inputs\.([a-zA-Z]\w*)/g)||[]).map((e=>e.replace(/inputs\./,"")));t.createInlineValueNode=e=>{let{code:n,customView:s,nodeId:r,type:a}=e;const u=(0,t.getVariables)(n).reduce(((e,t)=>({...e,[t]:(0,o.nodeInput)()})),{}),l={value:(0,o.nodeOutput)()},c=a===o.InlineValueNodeType.FUNCTION?`const result = (function() { ${n}}());\n Promise.resolve(result).then(val => outputs.value.next(val))`:`const result = (${n}); Promise.resolve(result).then(val => outputs.value.next(val))`,d=btoa(n);return(0,i.inlineValueNode)({id:r||`Inline Code ${(0,o.randomInt)(99999)}`,inputs:u,outputs:l,runFnRawCode:c,customViewCode:s||n,dataBuilderSource:d,templateType:a,completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline "+(a===o.InlineValueNodeType.VALUE?"value":"function")})}},49283:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Omnibar=t.OmniBarCmdType=void 0;const a=n(35250),u=s(n(70079)),l=n(70457),c=n(74762),d=n(50382),p=r(n(26372));var f;!function(e){e.ADD="add",e.ADD_VALUE="add-value",e.IMPORT="import"}(f=t.OmniBarCmdType||(t.OmniBarCmdType={}));const m=[];t.Omnibar=e=>{const{resolvedNodes:t}=e,[n,o]=u.useState(""),[i,s]=u.useState(null),[r,h]=u.useState([]);u.useEffect((()=>{const e=(0,c.keys)(t).map((e=>({title:`${t[e].id}`,cmd:{type:f.ADD,data:e},extra:"current flow"}))),n=r.map((e=>({title:`${e.node.id}`,description:e.node.description,cmd:{type:f.IMPORT,data:e},extra:`${e.module}`}))),o={title:"Add inline value or code",suggestOnEmpty:!0,cmd:{type:f.ADD_VALUE}},i=[...m,...n,o,...e];s(i)}),[t,r]),u.useEffect((()=>{e.onRequestImportables&&e.onRequestImportables(n).then((e=>{h(e)}))}),[e,n]);const v=u.useCallback(((e,t)=>{let{handleClick:n,modifiers:o,query:i,index:s}=t;if(!o.matchesPredicate)return null;const r=`${e.title}`;return(0,a.jsx)(d.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,a.jsxs)("div",{className:(0,p.default)("omnibar-item",{active:o.active}),children:[(0,a.jsxs)("div",{className:"title",children:[r," ",e.extra?(0,a.jsx)("span",{className:"extra",children:e.extra}):null]}),e.description?(0,a.jsx)("div",{className:"description",children:e.description}):null]})},s)}),[]),g=u.useCallback(((e,t)=>{const n=e.toLowerCase().split("").map((e=>{return`${t=e,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*`;var t})).join(""),o=new RegExp(n);return!!t.title.toLowerCase().match(o)}),[]),I=u.useCallback((t=>{e.onCommand(t.cmd),e.onClose()}),[e]);return i?(0,a.jsx)(l.Omnibar,{query:n,onQueryChange:o,onClose:e.onClose,noResults:(0,a.jsx)(d.MenuItem,{disabled:!0,text:"No results."}),itemPredicate:g,isOpen:e.visible,items:i,initialContent:void 0,onItemSelect:I,itemRenderer:v,inputProps:{placeholder:"Search for nodes or commands.."}}):null}},60698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43490:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31874),t)},31874:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.usePorts=t.useConfirm=t.usePrompt=t.PortsContext=t.defaultPorts=void 0;const s=n(70079),r=n(74762),a=n(84472);i(n(60698),t);const u=e=>async()=>{console.warn(`${e} Not implemented`),(0,a.toastMsg)("Feature not implemented in this context yet","warning")};t.defaultPorts={prompt:async e=>{let{text:t,defaultValue:n}=e;return prompt(`${t}`,n)},openFile:async e=>{},confirm:async e=>{let{text:t}=e;return confirm(t)},readFlow:u("readFlow"),setFlow:u("setFlow"),resolveDeps:u("resolveDeps"),getImportables:u("getImportables"),onExternalFlowChange:u("onExternalFlowChange"),onInstallRuntimeRequest:u("onInstallRuntimeRequest"),onRunFlow:u("onRunFlow"),onStopFlow:u("onStopFlow"),reportEvent:r.noop,generateNodeFromPrompt:u("generateNodeFromPrompt"),hasOpenAiToken:()=>Promise.resolve(!1)},t.PortsContext=(0,s.createContext)(t.defaultPorts);t.usePrompt=()=>{const e=(0,s.useContext)(t.PortsContext).prompt;return(t,n)=>e({text:t,defaultValue:n})};t.useConfirm=()=>{const e=(0,s.useContext)(t.PortsContext).confirm;return t=>e({text:t})};t.usePorts=()=>(0,s.useContext)(t.PortsContext)},65758:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelected=void 0;const i=n(74762),s=o(n(53865)),r=n(22513);t.groupSelected=async(e,t,n,o,a)=>{const{instances:u,connections:l}=t,c=u.filter((t=>e.includes(t.id))),d=l.filter((t=>{let{from:n,to:o}=t;return-1!==e.indexOf(n.insId)||-1!==e.indexOf(o.insId)}));if(!c.length)throw new Error("visual without selections");const{visualNode:p,renamedInputs:f,renamedOutputs:m}=await(0,r.createGroup)(c,d,n,a),h=c.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),u[0].pos),v="ref"===o?(0,i.nodeInstance)((0,i.createInsId)(p),p.id,{},h):(0,i.inlineNodeInstance)((0,i.createInsId)(p),p,{},h),g=u.filter((t=>-1===e.indexOf(t.id))),I=l.map((e=>{const t=`${e.from.insId}.${e.from.pinId}`,n=`${e.to.insId}.${e.to.pinId}`;return f[n]?{...e,to:{insId:v.id,pinId:f[n]}}:m[t]?{...e,from:{insId:v.id,pinId:m[t]}}:e})).filter((t=>-1===e.indexOf(t.from.insId)&&-1===e.indexOf(t.to.insId)));return{newNode:p,currentNode:(0,s.default)(t,(e=>{e.instances=[...g,v],e.connections=I}))}}},74089:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(97106),t),i(n(18420),t),i(n(90680),t),i(n(84472),t),i(n(17102),t),i(n(82232),t),i(n(25779),t),i(n(25804),t),i(n(9958),t),i(n(68120),t),i(n(94651),t),i(n(73470),t),i(n(94007),t),i(n(60190),t),i(n(9001),t),i(n(7047),t),i(n(23386),t)},31745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoTooltip=void 0;const o=n(35250),i=n(50382),s=n(50382),r=n(44470),a=n(50382);t.InfoTooltip=e=>{const{content:t}=e;return(0,o.jsx)(s.Tooltip,{content:t,placement:"top",className:"info-tooltip",children:(0,o.jsx)(i.Icon,{icon:(0,o.jsx)(r.InfoSign,{className:a.Classes.INTENT_PRIMARY}),intent:i.Intent.SUCCESS,className:"info-tooltip-icon"})})}},83938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserOnlyReactJson=void 0;const o=n(35250);t.BrowserOnlyReactJson=e=>{if("undefined"==typeof window)return null;const t=n(73541).Z;return(0,o.jsx)(t,{...e})}},94651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsValueRenderer=void 0;const o=n(35250),i=n(74762),s=n(83938);t.AnalyticsValueRenderer=e=>{let{val:t}=e;try{const e=JSON.parse(t),n="object"==typeof e?e:{value:e},r=e&&[e.type,e.key,e.props,e.ref].every(i.isDefined),a=r?{jsxValue:e}:n;return(0,o.jsx)(s.BrowserOnlyReactJson,{src:a,collapseStringsAfterLength:50,collapsed:r})}catch(n){return(0,o.jsx)(s.BrowserOnlyReactJson,{src:{value:t},collapseStringsAfterLength:50})}}},22513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=void 0;const o=n(74762),i=n(74762),s=n(60190),r=n(88593);t.createGroup=async(e,t,n,a)=>{if(0===e.length)throw new Error("cannot create group without instances");const u=e.map((e=>e.id)),l=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return!t&&n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.to,e.to)))===t)),c=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return t&&!n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.from,e.from)))===t));let d={},p={},f={},m={};const h=[],v={};for(const o of l){const e=`${o.to.insId}.${o.to.pinId}`,t=`${o.from.insId}.${o.from.pinId}`,n=o.to.pinId;if(f[t]){h.push({from:(0,i.externalConnectionNode)(f[t]),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)});continue}const r=v[n]?await a(`Name this input (${n} of ${o.to.insId}) is already taken:`)||`i${(0,s.rnd)()}`:n;d[e]=r,f[t]=r,h.push({from:(0,i.externalConnectionNode)(r),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)}),v[r]=(0,i.nodeInput)()}const g={};for(const r of c){const e=`${r.to.insId}.${r.to.pinId}`,t=`${r.from.insId}.${r.from.pinId}`,n=r.from.pinId;if(m[e]){h.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(m[e])});continue}const u=g[n]?await a(`Name this output (${n} of ${r.from.insId} is already taken:`)||`i${(0,s.rnd)()}`:n;p[t]=u,m[e]=u,h.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(u)}),g[u]=(0,o.nodeOutput)()}e.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),e[0].pos);const I=t.filter((e=>u.includes(e.from.insId)&&u.includes(e.to.insId)));return{visualNode:{id:n,inputs:v,outputs:g,instances:e,defaultStyle:{size:"large",color:(0,o.pickRandom)(r.nodeStylePresetColors.map((e=>e.color)))},inputsPosition:(0,o.okeys)(v).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:0}})),{}),outputsPosition:(0,o.okeys)(g).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:400}})),{}),connections:[...I,...h],completionOutputs:(0,o.okeys)(g)},renamedInputs:d,renamedOutputs:p}}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightText=void 0;const o=n(35250);function i(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}t.highlightText=(e,t)=>{let n=0;const s=t.split(/\s+/).filter((e=>e.length>0)).map(i);if(0===s.length)return[e];const r=new RegExp(s.join("|"),"gi"),a=[];for(;;){const t=r.exec(e);if(!t)break;const i=t[0].length,s=e.slice(n,r.lastIndex-i);s.length>0&&a.push(s),n=r.lastIndex,a.push((0,o.jsx)("strong",{children:t[0]},n))}const u=e.slice(n);return u.length>0&&a.push(u),a}},17102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Loader=void 0;const o=n(35250);t.Loader=()=>(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)("svg",{width:"38",height:"38",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:"#007ec6",children:(0,o.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,o.jsxs)("g",{transform:"translate(1 1)",strokeWidth:"2",children:[(0,o.jsx)("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),(0,o.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:(0,o.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})})})},23386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;const o=n(74762);t.logger=(0,o.debugLogger)("editor")},561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadMonaco=void 0;const o=n(51848),i=n(23386);let s=!1;t.preloadMonaco=()=>{s||o.loader.init().then((()=>{(0,i.logger)("monaco preloaded"),s=!0}))}},68120:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHotkeys=t.currentHotkeys=void 0;const i=o(n(45240)),s=n(70079);t.currentHotkeys=new Map,t.useHotkeys=function(e,n,o,r,a){void 0===r&&(r=[]);const u=(0,s.useCallback)((function(){a&&!a.current||n(...arguments)}),[...r,n]);(0,s.useEffect)((()=>((0,i.default)(e,{},u),t.currentHotkeys.set(e,o),()=>{t.currentHotkeys.delete(e),i.default.unbind(e,u)})),[e,u,o])}},94007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeSessionStorage=t.safeLocalStorage=void 0,t.safeLocalStorage={getItem:function(){try{return localStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return localStorage.setItem(...arguments)}catch(e){return null}}},t.safeSessionStorage={getItem:function(){try{return sessionStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return sessionStorage.setItem(...arguments)}catch(e){return null}}}},90680:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocalStorage=t.useResizePref=t.userPreferences=t.useUserPref=void 0;const r=s(n(70079)),a=n(18420),u=n(94007);t.useUserPref=(e,n)=>{const[o,i]=r.useState((()=>{const o=t.userPreferences.getItem(e);return(0,a.isDefined)(o)?o:n}));r.useEffect((()=>{const o=t.userPreferences.getItem(e),s=(0,a.isDefined)(o)?o:n;i(s)}),[e]);return[o,n=>{t.userPreferences.setItem(e,n),i(n)}]},t.userPreferences=(()=>{const e=e=>`up.${e}`;return{getItem:t=>{const n=u.safeLocalStorage.getItem(e(t))||"",o=u.safeSessionStorage.getItem(e(t))||"";try{return JSON.parse(o||n).value}catch(i){return}},setItem:function(t,n,o){void 0===o&&(o=!1);const i=o?sessionStorage:u.safeLocalStorage;try{const o=JSON.stringify({value:n});return i.setItem(e(t),o),!0}catch(s){return console.error("Error saving user preference",s),!1}}}})();t.useResizePref=(e,n)=>{const o=`resize.${e}`;return(0,t.useUserPref)(o,n)};const l=e=>{const t=u.safeLocalStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch(n){return null}};t.useLocalStorage=(e,t)=>{const[n,o]=r.useState(l(e)||t),i=r.useCallback((t=>{u.safeLocalStorage.setItem(e,JSON.stringify({value:t})),o(t)}),[e]);return r.useEffect((()=>{l(e)||u.safeLocalStorage.setItem(e,JSON.stringify({value:t}))}),[e,t,i]),[n,i]}},60190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.totalEnergy=t.itrPhysics=t.hookes=t.coulombs=t.vToStr=t.vNorm=t.vLen=t.vSub=t.vAdd=t.vDiv=t.vMul=t.vZero=t.rnd=t.vec=t.size=void 0;t.size=(e,t)=>({width:e,height:t});t.vec=(e,t)=>({x:e,y:t});t.rnd=function(e,t){return void 0===e&&(e=100),void 0===t&&(t=0),Math.floor(Math.random()*(e-t))+t},t.vZero={x:0,y:0};t.vMul=(e,t)=>{let{x:n,y:o}=e;return{x:n*t,y:o*t}};t.vDiv=(e,n)=>{let{x:o,y:i}=e;return(0,t.vMul)({x:o,y:i},1/n)};t.vAdd=(e,t)=>({x:e.x+t.x,y:e.y+t.y});t.vSub=(e,n)=>(0,t.vAdd)(e,(0,t.vMul)(n,-1));t.vLen=e=>{let{x:t,y:n}=e;return Math.sqrt(t*t+n*n)};t.vNorm=e=>(0,t.vDiv)(e,(0,t.vLen)(e)||1);t.vToStr=e=>{let{x:t,y:n}=e;return`${t.toFixed(1)},${n.toFixed(1)}`};t.coulombs=(e,n,o)=>{const i=(0,t.vLen)((0,t.vSub)(e.p,n.p));if(0===i){const i=(0,t.vec)(2*Math.random()-1,2*Math.random()-1),s=e.m*n.m/Math.pow(10,2);return(0,t.vMul)(i,s*o)}{const s=(0,t.vNorm)((0,t.vSub)(n.p,e.p)),r=e.m*n.m/Math.pow(i+.1,2);return(0,t.vMul)(s,r*o)}};t.hookes=(e,n,o,i,s)=>{const r=(0,t.vLen)((0,t.vSub)(e.p,n.p)),a=(0,t.vNorm)((0,t.vSub)(e.p,n.p));let u=0;return ri&&(u=i-r),(0,t.vMul)(a,s*u)};t.itrPhysics=(e,n)=>{const{p:o,v:i,f:s,m:r}=n,a=(0,t.vDiv)(s,r),u=e/1e3,l=(0,t.vAdd)((0,t.vMul)(a,u),i),c=(0,t.vAdd)((0,t.vMul)(l,u),o);return{...n,p:c,v:l,f:(0,t.vec)(0,0)}};t.totalEnergy=e=>e.reduce(((e,n)=>{const o=(0,t.vLen)(n.v);return e+.5*n.m*o*o}),0)},84472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateToast=t.toastMsg=t.AppToaster=void 0;const o=n(50382);t.AppToaster=(()=>{try{return o.OverlayToaster.create({className:"app-toaster",position:o.Position.BOTTOM_RIGHT})}catch(e){return{}}})();t.toastMsg=(e,n,o)=>t.AppToaster.show({message:e,intent:n,timeout:o});t.updateToast=(e,n,o)=>t.AppToaster.show({message:n,intent:o},e)},18420:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultAnd=t.isLocal=t.fullTime=t.timeAgoFromDt=t.timeAgo=t.toString=t.isDefined=t.set=t.createOmap=t.toOmap=t.values=t.keys=t.entries=void 0;const i=n(7047),s=n(74762),r=o(n(73136));t.entries=e=>Object.keys(e).map((t=>[t,e[t]]));t.keys=e=>Object.keys(e);t.values=e=>Object.keys(e).map((t=>e[t]));t.toOmap=e=>Array.from(e.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.createOmap=function(e){return void 0===e&&(e=[]),e.reduce(((e,t)=>({...e,[t[0]]:t[1]})),{})};t.set=(e,t,n)=>{e[t]=n};t.isDefined=e=>void 0!==e;t.toString=e=>{const t=typeof e;if(""===e)return"(empty string)";if((0,i.isJsxValue)(e))return"JSX Value";if((0,s.isStaticValueVisualNode)(e))return"Embedded Node";if((0,s.isEnvValue)(e))return(0,s.getEnvKeyFromValue)(e);if("object"===t)try{const t=JSON.stringify(e);return"{}"===t?"Empty object":t}catch(n){return"Object (cannot stringify)"}return`${e}`};t.timeAgo=e=>(0,r.default)(new Date(e)).fromNow();t.timeAgoFromDt=e=>(0,r.default)(Date.now()-e).fromNow();t.fullTime=e=>(0,r.default)(new Date(e)).toString();t.isLocal=()=>location.href.includes(":300");t.preventDefaultAnd=e=>t=>{t.preventDefault(),e(t)}},67181:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ActionButton=t.ActionsMenu=t.ActionType=void 0;const r=n(35250),a=n(50382),u=n(50382),l=n(74762),c=s(n(70079)),d=n(86125),p=n(43490),f=n(68120),m=n(90680),h=n(84472),v=n(9971),g=n(47749),I=n(46334),b=n(47230),y=n(41032);var C;!function(e){e.AddNode="add-node",e.RemoveNode="remove-node",e.Group="group",e.UnGroup="un-group",e.AddInlineValue="add-inline-value",e.Inspect="inspect",e.Run="run",e.AI="ai"}(C=t.ActionType||(t.ActionType={}));t.ActionsMenu=e=>{const{onAction:n,selectedInstances:o,resolvedNodes:i,node:s,from:u,to:g,hotkeysEnabled:x,showRunFlowOptions:N}=e,{onRequestImportables:w}=(0,d.useDependenciesContext)(),[j,E]=c.default.useState(!1),[P,O]=c.default.useState(!1),[S,D]=c.default.useState(!1),[M,T]=c.default.useState(null),[k,R]=(0,m.useLocalStorage)("hideHotkeyHintMap",{}),A=(0,c.useCallback)((()=>{E(!1)}),[]),{onRunFlow:V,generateNodeFromPrompt:$,reportEvent:z}=(0,p.usePorts)(),H=(0,c.useCallback)(((e,t)=>(O(!1),V(e,t))),[V]),F=[];if(F.push(C.AddNode),F.push(C.AddInlineValue),1===o.length){const e=s.instances.find((e=>e.id===o[0]));if(e)try{const t=(0,y.safelyGetNodeDef)(e,i);(0,l.isVisualNode)(t)&&F.push(C.UnGroup)}catch(U){console.error(`Could not find node with id ${o[0]} - ${U}`)}else console.error(`Could not find instance with id ${o[0]}`)}N&&F.push(C.Run),o.length>0&&F.push(C.Group),(1===o.length||u||g)&&F.push(C.Inspect),o.length>0&&F.push(C.RemoveNode),F.push(C.AI);const L=(0,c.useCallback)(((e,t)=>{R({...k,[e]:!0}),h.AppToaster.dismiss(t)}),[k,R]),q=(0,c.useCallback)(((e,t)=>{const{hotkey:o}=_[e];if("click"===t.type&&o&&!k[o]){const t=(0,h.toastMsg)((0,r.jsxs)(r.Fragment,{children:["Did you know? you can also use the hotkey"," ",(0,r.jsx)("kbd",{className:"hotkey",children:o})," to"," ",_[e].text.replace(/^[A-Z]/,(e=>e.toLowerCase())),(0,r.jsxs)(a.Button,{minimal:!0,small:!0,onClick:()=>L(o,t),children:[" ","Don't show again"," "]})]}),"none",3e3)}switch(e){case C.AddNode:E(!0);break;case C.Run:!async function(){O(!0)}();break;case C.AI:D(!0);break;default:n({type:e,data:void 0})}}),[k,n,L,s.inputs]);Object.entries(_).forEach((e=>{let[t,n]=e;n.hotkey&&(0,f.useHotkeys)(n.hotkey,(e=>{e.preventDefault(),F.includes(t)&&(q(t,e),R({...k,[n.hotkey]:!0}))}),{text:n.text,group:"Action menu hotkeys"},[F],x)}));const G=(0,c.useCallback)((e=>{n({type:C.AddNode,data:{importableNode:e}})}),[n]),B=(0,c.useCallback)((async e=>{const t=Date.now();T(t);try{z("generateNodeFromPrompt:start",{promptLength:e.length});const o=await $({prompt:e}),{inputs:i,outputs:s}=o.importableNode.node,r=Date.now()-t;z("generateNodeFromPrompt:success",{totalTime:r,inputs:Object.keys(i),outputs:Object.keys(s)}),T(null),n({type:C.AI,data:o}),D(!1)}catch(U){T(null),h.AppToaster.show({message:"Failed to generate node",intent:"danger"}),z("generateNodeFromPrompt:failure",{error:U.message})}}),[$,n,z]);return(0,r.jsxs)("div",{className:"actions-menu",children:[F.map((e=>(0,r.jsx)(t.ActionButton,{type:e,onClick:q},e))),j?(0,r.jsx)(v.AddNodeMenu,{onRequestImportables:w,onAddNode:G,onClose:A}):null,P?(0,r.jsx)(b.RunFlowModal,{onClose:()=>O(!1),onRun:H,node:s}):null,S?(0,r.jsx)(I.PromptAIMenu,{onClose:()=>{D(!1),T(null)},onSubmit:B,submitting:null!==M,submitTime:M}):null]})};const _={[C.AddNode]:{icon:g.addNodeIcon,text:'Open the "add node" menu',hotkey:"a"},[C.RemoveNode]:{icon:g.removeNodeIcon,text:"Remove selected instances",hotkey:"backspace"},[C.Group]:{icon:g.groupIcon,text:"Group selection into a new node",hotkey:"g"},[C.UnGroup]:{icon:g.ungroupIcon,text:"Ungroup selected visual node"},[C.Inspect]:{icon:g.inspectIcon,text:"Inspect data",hotkey:"i"},[C.AddInlineValue]:{icon:g.pencilIcon,text:"Add value / inline function",hotkey:"v"},[C.Run]:{icon:g.playIcon,text:"Run flow",hotkey:"r"},[C.AI]:{icon:g.starIcon,text:"Generate new code node using AI \u2728"}},x={icon:"",text:"N/A",hotkey:void 0};t.ActionButton=e=>{var t;const{onClick:n,type:o}=e,i=(0,c.useCallback)((e=>n(o,e)),[n,o]),s=null!==(t=_[o])&&void 0!==t?t:x,a=s.hotkey?(0,r.jsxs)("span",{children:[s.text," ",(0,r.jsx)("kbd",{className:"hotkey",children:s.hotkey})]}):s.text;return(0,r.jsx)("div",{className:"action-button",onClick:i,"data-type":o,children:(0,r.jsx)(u.Tooltip,{hoverOpenDelay:100,content:a,className:"icon-wrapper",popoverClassName:"action-button-tooltip",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s.icon}})})})}},40149:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenu=t.AddNodeMenuFilterTree=void 0;const a=n(35250),u=n(50382),l=n(74762),c=r(n(26372)),d=s(n(70079)),p=n(43490),f=n(31745),m=n(17102),h=n(87935),v=n(74657),g=n(44470);t.AddNodeMenuFilterTree=u.Tree.ofType();function I(e,t,n){return[...e.external.map((e=>({id:e.module,label:e.module,hasCaret:!0,nodeData:{type:"external",module:e.module},isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module,isExpanded:n.has(e.module),childNodes:e.namespaces.map((o=>({id:`${e.module}/${o}`,label:o,hasCaret:!1,isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module&&t.namespace===o,isExpanded:n.has(`${e.module}/${o}`),nodeData:{type:"external",module:e.module,namespace:o}})))}))),{id:"internal",label:"Current Project",nodeData:{type:"internal"},isExpanded:n.has("internal"),hasCaret:!0,isSelected:"internal"===t.type,childNodes:e.internal.files.map((e=>({id:e,label:e,isSelected:"internal"===t.type&&t.file===e,hasCaret:!1,isExpanded:n.has(e),nodeData:{type:"internal",file:e}})))}]}function b(e){return/\.flyde(\.[jt]s)?$/.test(e.module)}t.AddNodeMenu=e=>{const{onRequestImportables:n,onAddNode:o,onClose:i}=e,[s,r]=d.default.useState(),[y,C]=d.default.useState([]),[_,x]=d.default.useState(new Set),[N,w]=d.default.useState(""),[j,E]=d.default.useState({type:"all"}),[P,O]=d.default.useState(null),[S,D]=d.default.useState(null),[M,T]=d.default.useState(null),k=(0,d.useCallback)((e=>{_.add(e.id),x(new Set(_))}),[_]),R=(0,d.useCallback)((e=>{_.delete(e.id),x(new Set(_))}),[_]),A=(0,d.useCallback)((e=>{o(e),i()}),[o,i]),{onInstallRuntimeRequest:V,reportEvent:$}=(0,p.usePorts)();(0,d.useEffect)((()=>{$("addNodeMenuOpen",{})}),[$]),(0,d.useEffect)((()=>{D(null==s?void 0:s.flatMap((e=>{var t,n,o;if(j)if("external"===j.type){if((e.module!==j.module||j.namespace)&&e.node.namespace!==j.namespace)return[]}else if("internal"===j.type&&(!b(e)||j.file&&e.module!==j.file))return[];if(N){const i=`${null!==(n=null===(t=e.node.searchKeywords)||void 0===t?void 0:t.join(" "))&&void 0!==n?n:[]} ${e.node.id} ${null!==(o=e.node.namespace)&&void 0!==o?o:""} ${e.node.description}`.toLowerCase().indexOf(N.toLowerCase());return-1===i?[]:[{importable:e,score:i}]}return[{importable:e,score:1}]})).sort(((e,t)=>e.score-t.score)).map((e=>{let{importable:t}=e;return t})))}),[s,j,N]),(0,d.useEffect)((()=>{n().then((e=>{let{importables:t,errors:n}=e;C(n);const o=t.filter((e=>!b(e))).reduce(((e,t)=>{var n,o,i;null!==(n=e[i=t.module])&&void 0!==n||(e[i]=[]);const s=null!==(o=t.node.namespace)&&void 0!==o?o:"";return e[t.module].includes(s)||e[t.module].push(s),e}),{}),i=t.filter(b).map((e=>e.module));O({external:Object.entries(o).map((e=>{let[t,n]=e;return{module:t,namespaces:n}})),internal:{files:i}}),r(t),x(new Set(["internal",...Object.keys(o)]))}))}),[n]);const z=(0,d.useCallback)((e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),S&&!M)return void T(S["ArrowDown"===e.key?0:S.length-1]);if(S&&M){const t=S.findIndex((e=>e===M));let n="ArrowDown"===e.key?t+1:t-1;n=n<0?S.length-1:n,n=n>=S.length?0:n,T(S[n])}break;case"Enter":M&&A(M)}}),[S,M,A]),H=(0,d.useCallback)((e=>{let{nodeData:t}=e;JSON.stringify(t)===JSON.stringify(j)?"external"===t.type?t.namespace?E({type:"external",module:t.module}):E({type:"all"}):"internal"===t.type&&(t.file?E({type:"internal"}):E({type:"all"})):E(t)}),[j]),F=!s||s.some((e=>e.module.includes("@flyde/stdlib"))),L=(0,d.useCallback)((()=>{V(),i()}),[i,V]);return(0,a.jsx)(u.Dialog,{isOpen:!0,title:"Add Node Menu",onClose:e.onClose,className:"add-node-menu",isCloseButtonShown:!0,children:(0,a.jsxs)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),children:[(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"bp5-input-group",children:[(0,a.jsx)(g.Search,{}),(0,a.jsx)("input",{className:"bp5-input",type:"search",placeholder:"Search input",dir:"auto",autoFocus:!0,onChange:e=>w(e.target.value),value:N,onKeyDown:z})]}),F?null:(0,a.jsxs)(u.Callout,{intent:u.Intent.NONE,style:{marginTop:10},children:["Using built-in @flyde/stdlib. It's recommended to explicitly install it instead."," ",(0,a.jsx)(u.Button,{minimal:!0,small:!0,intent:u.Intent.PRIMARY,onClick:L,children:"Click here to install it using npm/yarn"})]})]}),(0,a.jsx)("div",{className:"content-wrapper",children:s?(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsxs)("aside",{children:[(0,a.jsxs)("div",{className:"filter-header",children:["Filter by package"," ",(0,a.jsx)(u.Tooltip,{content:(0,a.jsxs)("span",{children:["Click to learn more about how packages work in Flyde"," "]}),hoverCloseDelay:1500,children:(0,a.jsx)("a",{target:"_blank",href:"https://www.flyde.dev/docs/packages",rel:"noreferrer",children:(0,a.jsx)(u.Icon,{icon:(0,a.jsx)(g.Help,{}),intent:"primary",iconSize:12})})})]}),(0,a.jsx)("div",{className:"tree-container",children:(0,a.jsx)(t.AddNodeMenuFilterTree,{contents:I(P,j,_),onNodeCollapse:R,onNodeExpand:k,onNodeClick:H,className:u.Classes.ELEVATION_0})})]}),(0,a.jsx)("main",{children:S?0===S.length?(0,a.jsxs)("div",{className:"no-results",children:[(0,a.jsx)(v.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:E,query:N,onChangeQuery:w,resultsCount:S.length}),(0,a.jsxs)(u.Callout,{className:"callout",intent:"primary",children:["Can't find a suitable node? Create one yourself!"," ",(0,a.jsx)("a",{href:"https://www.flyde.dev/docs/code-nodes",target:"_blank",rel:"noreferrer",children:"Learn more"})]})]}):(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsx)(v.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:E,query:N,onChangeQuery:w,resultsCount:S.length}),(0,a.jsx)("div",{className:"results",children:S.map((e=>(0,a.jsx)(h.AddNodeMenuListItem,{importableNode:e,onAdd:A,selected:(null==M?void 0:M.node)===e.node,onSelect:T,onSetFilter:E},e.node.id+e.node.namespace+e.module)))})]}):(0,a.jsx)(m.Loader,{})})]}):(0,a.jsx)(m.Loader,{})}),y.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",style:{marginTop:"10px"},children:["Found ",(0,l.simplePluralize)(y.length,"corrupt flow"),(0,a.jsx)(f.InfoTooltip,{content:y.map((e=>{let{path:t,message:n}=e;return`${t}: ${n}`})).join(", ")})," "]}):null]})})}},8470:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuListItem=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079));t.AddNodeMenuListItem=e=>{const{importableNode:t,onSetFilter:n,onAdd:o,onSelect:i}=e,{node:s,module:r}=t,{id:d,description:p}=s,f=c.default.useRef(null);c.default.useEffect((()=>{e.selected&&f.current&&f.current.scrollIntoView({block:"center"})}),[e.selected]);const m=(0,c.useCallback)((()=>{o(t)}),[o,t]),h=(0,c.useCallback)((()=>{i(t)}),[i,t]);return(0,a.jsxs)("div",{className:(0,l.default)("add-node-menu-list-item",{selected:e.selected}),ref:f,onClick:h,children:[(0,a.jsxs)("div",{className:"content",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("span",{className:"id",children:d}),(0,a.jsxs)(u.Tag,{interactive:!0,onClick:()=>n({type:"external",module:r,namespace:s.namespace}),className:"source",minimal:!0,children:[r,s.namespace?` / ${s.namespace}`:null]})]}),(0,a.jsx)("div",{className:"description",children:p||(0,a.jsx)("em",{children:"No description"})})]}),(0,a.jsx)("aside",{children:(0,a.jsx)(u.Button,{onClick:m,children:"Add"})})]})}},87935:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8470),t)},88671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuResultsSummary=void 0;const o=n(35250),i=n(50382);t.AddNodeMenuResultsSummary=e=>{const{resultsCount:t,query:n,filter:s,onChangeFilter:r,onChangeQuery:a}=e;return(0,o.jsxs)("div",{className:"add-node-menu-results-summary",children:[t?`Showing ${t} result${t>1?"s":""}`:"No results found","\xa0",n?(0,o.jsxs)(o.Fragment,{children:["matching query\xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>a(""),children:['"',n,'"']})]}):null,"all"===s.type?null:"external"===s.type?(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["package ",s.module,s.namespace?` / ${s.namespace}`:null]})]}):(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["\xa0this project ",s.file?` / ${s.file}`:null]})]})]})}},74657:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88671),t)},9971:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40149),t)},83159:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PromptAIMenu=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=1e4;t.PromptAIMenu=e=>{const{onClose:t}=e,[n,o]=c.default.useState(""),[i,s]=c.default.useState(0);return(0,c.useEffect)((()=>{s(0);const t=setInterval((()=>{s((t=>{const n=(Date.now()-e.submitTime)/d;return Math.min(n+.05*Math.random()/2,.95)}))}),500);return()=>clearInterval(t)}),[e.submitTime]),(0,a.jsxs)(u.Dialog,{isOpen:!0,onClose:t,className:"prompt-ai-menu",title:"\u2728 Generate Code Node using AI",children:[(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsx)(u.TextArea,{value:n,disabled:e.submitting,onChange:e=>o(e.target.value),placeholder:"Describe your node in details",fill:!0})}),e.submitTime?(0,a.jsx)("div",{className:"progress-bar-container",children:(0,a.jsx)(u.ProgressBar,{value:i})}):null,(0,a.jsx)("div",{className:u.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:u.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(u.Button,{onClick:t,children:"Close"}),(0,a.jsx)(u.Button,{intent:u.Intent.PRIMARY,className:"run-btn",disabled:e.submitting||!n,loading:e.submitting,onClick:()=>{s(0),e.onSubmit(n)},children:"Create \u2728"})]})})]})}},46334:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(83159),t)},3152:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RunFlowModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(90680),f=n(31745);t.RunFlowModal=u.memo((function(e){const{onRun:t,onClose:n,node:o}=e,[i,s]=u.useState(0),[r,m]=(0,p.useLocalStorage)(`run-inputs-${o.id}`,Object.keys(o.inputs).reduce(((e,t)=>(e[t]=`Enter a value for input ${t}`,e)),{})),[h,v]=u.useState(JSON.stringify(r,null,2)),g=e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})},I=u.useCallback((()=>{const e=JSON.parse(h);m(e),t(e,i)}),[t,m,h,i]),b=Object.keys(o.inputs),y=b.filter((e=>"required"!==o.inputs[e].mode)),C=u.useMemo((()=>b.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:"This node receives external inputs. Enter values for each input below:"}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"json",value:h,onChange:e=>v(null!=e?e:""),onMount:g}),y.length>0?(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Note: input(s) ",(0,a.jsx)("code",{children:y.join(", ")})," are optional"]}):null]}):(0,a.jsx)("strong",{children:"This node does not receive any external inputs."})),[b.length,y,h]);return(0,a.jsxs)(c.Dialog,{isOpen:!0,onClose:e.onClose,className:"run-flow-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&I()},tabIndex:0,children:[C,(0,a.jsxs)("div",{className:"execution-delay-wrapper",children:[(0,a.jsxs)("label",{children:["Execution delay:"," ",(0,a.jsx)(f.InfoTooltip,{content:"Delay between each node execution. Useful for debugging."})]}),(0,a.jsx)(c.Slider,{value:i,onChange:s,min:0,labelStepSize:500,stepSize:100,labelRenderer:e=>`${e}ms`,max:1e3})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:n,children:"Close"}),(0,a.jsx)(c.Button,{onClick:I,intent:c.Intent.PRIMARY,className:"run-btn",children:"Run"})]})})]})}))},47230:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3152),t)},47749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starIcon=t.stopIcon=t.playIcon=t.pencilIcon=t.ungroupIcon=t.groupIcon=t.inspectIcon=t.removeNodeIcon=t.addNodeIcon=void 0,t.addNodeIcon='\n\n',t.removeNodeIcon='\n\n',t.inspectIcon='\n\n\n',t.groupIcon='\n\n\n',t.ungroupIcon='\n\n\n',t.pencilIcon='\n\n',t.playIcon='\n\n\n',t.stopIcon='\n\n\n',t.starIcon='\n\n\n\n\n'},1237:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HelpBubble=void 0;const i=n(70079),s=n(35250),r=n(50382),a=n(99489),u=n(50382),l=o(n(70079)),c=n(68120),d=n(71644),p=n(43490),f={offset:{enabled:!0,options:{offset:[0,20]}},preventOverflow:{enabled:!0,options:{padding:10}}};const m=["Viewport Controls","Editing","Selection"];t.HelpBubble=()=>{const[e,t]=l.default.useState(!1),n=Array.from(c.currentHotkeys.entries()).map((e=>{let[t,n]=e;return{combo:(o={key:t,menuData:n}).key,label:o.menuData.text,group:o.menuData.group};var o})).reduce(((e,t)=>(e[t.group]||(e[t.group]=[]),e[t.group].push(t),e)),{}),o=Object.entries(n).sort(((e,t)=>m.indexOf(t[0])-m.indexOf(e[0]))),{reportEvent:h}=(0,p.usePorts)(),v=(0,s.jsx)(r.Dialog,{isOpen:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:r.Classes.DIALOG_BODY,children:o.map((e=>{let[t,n]=e;return(0,s.jsxs)(l.default.Fragment,{children:[(0,s.jsx)(r.H4,{children:t}),n.map((e=>(0,i.createElement)(a.Hotkey,{...e,key:e.combo})))]},t)}))})}),g=(0,s.jsxs)(r.Menu,{children:[(0,s.jsx)(r.MenuItem,{text:"Hotkeys",onClick:()=>{t(!0),h("helpMenuItem",{item:"hotkeys"})}}),(0,s.jsx)(r.MenuItem,{text:"Documentation",onClick:()=>h("helpMenuItem",{item:"documentation"}),href:"https://www.flyde.dev/docs",target:"_blank"}),(0,s.jsx)(r.MenuDivider,{}),(0,s.jsx)(r.MenuItem,{text:"Discord",onClick:()=>h("helpMenuItem",{item:"discord"}),href:"https://discord.gg/x7t4tjZQP8",target:"_blank"})]});return(0,s.jsxs)("div",{className:"help-bubble","data-tip":"Help",children:[(0,s.jsx)(u.Popover,{content:g,modifiers:f,onOpened:()=>h("helpMenuOpen",{}),children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:d.helpIcon}})}),v]})}},71644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpIcon=void 0,t.helpIcon='\n\n\n'},3354:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1237),t)},7011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainInstanceEventsIndicator=void 0;const o=n(35250),i=n(30994),s=n(66189),r=n(50382);t.MainInstanceEventsIndicator=e=>{const{currentInsId:t,ancestorsInsIds:n}=e,{history:a,refreshHistory:u,resetHistory:l}=(0,s.useHistoryHelpers)(t),c=`main-indicator-${t}}`;return(0,o.jsx)("div",{className:"main-instance-events-indicator",children:(0,o.jsx)(r.Tooltip,{content:(0,s.calcHistoryContent)(a),children:(0,o.jsx)("span",{onMouseEnter:u,onMouseOut:l,id:(0,i.getMainInstanceIndicatorDomId)(t,n),className:"status-text","data-tip":"","data-html":!0,"data-for":c})})})}},22714:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7011),t)},63521:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VisualNodeEditor=t.defaultBoardData=t.defaultViewPort=t.NODE_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=n(74762),c=n(86553),d=n(65082),p=n(18420),f=n(26701),m=n(7047),h=n(53865),v=n(70079),g=n(68120),I=r(n(27942)),b=n(50382),y=n(66005),C=n(60190),_=n(71033),x=n(74762),N=n(99942),w=n(44338),j=n(561),E=n(84472),P=n(82232),O=n(18594),S=n(68371),D=r(n(61888)),M=n(65758),T=n(43490),k=r(n(26372)),R=n(25044),A=n(80510),V=n(1788),$=n(2130),z=n(88593),H=n(97106),F=n(67181),L=n(22714),q=n(3354),G=n(41032),B=n(30653),U=u.memo(b.Slider),W=()=>null;t.NODE_HEIGHT=28;t.defaultViewPort={pos:{x:0,y:0},zoom:1},t.defaultBoardData={selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}},t.VisualNodeEditor=u.memo(u.forwardRef(((e,n)=>{const{onChangeNode:o,nodeIoEditable:i,onCopy:s,onGoToNodeDef:r,onInspectPin:J,boardData:Y,onChangeBoardData:K,currentInsId:Q,ancestorsInsIds:X,node:ee,onShowOmnibar:te,resolvedDependencies:ne,queuedInputsData:oe,initialPadding:ie,disableScrolling:se}=e,{onImportNode:re}=(0,H.useDependenciesContext)(),ae=(0,B.useDarkMode)(),{reportEvent:ue}=(0,T.usePorts)(),le=e.parentViewport||t.defaultViewPort,[ce,de]=(0,v.useState)({...ne,[ee.id]:ee});(0,v.useEffect)((()=>{de({...ne,[ee.id]:ee})}),[ne,ee]);const{selected:pe,from:fe,to:me}=Y,{instances:he,connections:ve,inputsPosition:ge,outputsPosition:Ie,inputs:be,outputs:ye}=ee,[Ce,_e]=(0,v.useState)(),[xe,Ne]=(0,v.useState)(),we=void 0===X,[je,Ee]=(0,v.useState)(0),[Pe,Oe]=(0,v.useState)(),[Se,De]=(0,v.useState)(!1),[Me,Te]=(0,v.useState)(),[ke,Re]=(0,v.useState)(),[Ae,Ve]=(0,v.useState)(),[$e,ze]=(0,v.useState)(),He=(0,v.useRef)();(0,f.useDidMount)((()=>{He.current=Xe.current.querySelector(".inline-editor-portal-root")}));const Fe=(0,T.useConfirm)(),Le=(0,T.usePrompt)(),qe=Y.viewPort,Ge=(0,v.useRef)(!0),[Be,Ue]=(0,v.useState)(null),We=u.useCallback((e=>{K({viewPort:e})}),[K]),Ze=u.useCallback(((e,t)=>J(e,t)),[J]),Je=u.useCallback(((e,t,n)=>{const i=(0,A.handleConnectionCloseEditorCommand)(ee,{from:e,to:t}),s=(0,l.isInternalConnectionNode)(t)?he.find((e=>e.id===t.insId)):null,r=(s?s.inputConfig:{})[t.pinId],a=(0,l.isStaticInputPinConfig)(r)?(0,V.handleDetachConstEditorCommand)(i,t.insId,t.pinId):i;o(a,(0,P.functionalChange)("close-connection")),K({from:void 0,to:void 0}),ue("createConnection",{source:n})}),[he,o,K,ee,ue]),Ye=u.useCallback((async()=>{const e=await Le("New visual node name?");if(!e)return;const{currentNode:t}=await(0,M.groupSelected)(Y.selected,ee,e,"inline",Le);o(t,(0,P.functionalChange)("group node")),(0,E.toastMsg)("Node grouped"),ue("groupSelected",{count:Y.selected.length})}),[Le,Y.selected,o,ee,ue]);(0,v.useEffect)((()=>{if(Pe){const e=setTimeout((()=>{Oe(void 0)}),350);return()=>clearTimeout(e)}}),[Pe]);const[Ke,Qe]=(0,v.useState)();(0,v.useEffect)((()=>{(0,j.preloadMonaco)()}),[]);const Xe=(0,v.useRef)(),et=(0,I.default)(Xe),tt=u.useRef({x:400,y:400}),nt=(0,f.useBoundingclientrect)(Xe)||C.vZero,ot=()=>{const e=(0,m.fitViewPortToNode)(ee,ce,et);(0,m.animateViewPort)(qe,e,500,(e=>{We(e)}))},it=u.useCallback(((e,t)=>{const{to:n,from:o}=Y,i="input"===t?o:n,s="input"===t?n:o,r={pinId:e,insId:l.THIS_INS_ID},a="input"===t?{from:r}:{to:r};i&&i.pinId===e?K({from:void 0,to:void 0}):s?"input"===t&&n?Je(r,n,"nodeIoClick"):o&&Je(o,r,"nodeIoClick"):K(a)}),[Y,K,Je]),st=u.useCallback(((e,t,n)=>{const i=(0,h.produce)(ee,(o=>{"input"===e?o.inputs[t].description=n:o.outputs[t].description=n}));o(i,(0,P.functionalChange)("Node io description"))}),[o,ee]),rt=u.useCallback(((e,t,n)=>{const{from:o,to:i}=Y;if(fe&&fe.insId===e.id||me&&me.insId===e.id)K({from:void 0,to:void 0});else if("input"===n){const n={insId:e.id,pinId:t};!i||i.pinId!==t||(0,l.isInternalConnectionNode)(i)&&i.insId!==e.id?fe?Je(fe,n,"pinClick"):K({to:n,selected:[]}):K({to:void 0})}else{const n={insId:e.id,pinId:t};!o||o.pinId!==t||(0,l.isInternalConnectionNode)(o)&&o.insId!==e.id?me?Je(n,me,"pinClick"):K({from:n,selected:[]}):K({from:void 0})}}),[Y,fe,K,Je,me]);(0,v.useEffect)((()=>{if(!Se&&et.width){const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);We(t);const n=setTimeout((()=>{const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);e.thumbnailMode||We(t),De(!0)}),100);return()=>clearTimeout(n)}}),[ee,ie,et,e.thumbnailMode,Se,ce,We]);const at=u.useCallback((()=>{const{selected:e}=Y,t=ee.instances.filter((t=>e.includes(t.id))).map((e=>({...e,id:e.id+"-copy"}))),n=ee.connections.filter((t=>{let{from:n,to:o}=t;return e.includes(n.insId)&&e.includes(o.insId)}));s({instances:t,connections:n})}),[Y,s,ee]),ut=u.useCallback((()=>{const{newNode:t,newInstances:n}=(0,R.pasteInstancesCommand)(ee,tt.current,e.clipboardData);o(t,(0,P.functionalChange)("paste instances")),K({selected:n.map((e=>e.id))})}),[o,K,ee,e.clipboardData]),lt=u.useCallback((()=>{const e=ee.id;Ke?"input"===Ke.type?Ke.ins.id===e?it(Ke.pin,"input"):rt(Ke.ins,Ke.pin,"input"):Ke.ins.id===e?it(Ke.pin,"output"):rt(Ke.ins,Ke.pin,"output"):console.warn("tried selecting closest with no pin nearby")}),[ee.id,Ke,it,rt]),ct=u.useCallback(((e,t)=>{const n=Math.min(Math.max(e,.1),3),o="mouse"===t?tt.current:{x:qe.pos.x+et.width/2,y:qe.pos.y+et.height/2},i=(0,m.centerBoardPosOnTarget)(o,et,n,qe);We({...qe,zoom:n,pos:i})}),[We,qe,et]);(0,g.useHotkeys)("cmd+=",(e=>{ct(qe.zoom+.1,"hotkey"),e.preventDefault()}),{text:"Zoom in board",group:"Viewport Controls"},[qe,ct],Ge),(0,g.useHotkeys)("cmd+-",(e=>{ct(qe.zoom-.1,"hotkey"),e.preventDefault()}),{text:"Zoom out board",group:"Viewport Controls"},[ct,qe.zoom],Ge),(0,g.useHotkeys)("cmd+o",(e=>{e.preventDefault(),(0,E.toastMsg)("Ordering");const t=[];(0,N.orderVisualNode)(ee,ce,200,((e,n)=>{n%3==0&&t.push(e)})),(async()=>{for(;t.length;){const e=t.shift();(0,E.toastMsg)(`Step ${t.length}!`),await(0,l.delay)(200),o(e,(0,P.metaChange)("order-step")),(0,E.toastMsg)(`Step ${t.length}! done`)}})()}),{text:"Auto-layout (experimental)",group:"Misc."},[o,ee,ne],Ge),(0,g.useHotkeys)("cmd+0",(e=>{ct(1),e.preventDefault()}),{text:"Reset zoom",group:"Viewport Controls"},[qe,ct],Ge);const dt=()=>{K({from:void 0,to:void 0,selected:[]})},pt=u.useCallback(((e,t)=>{_e(e.id),o({...ee},(0,P.metaChange)("drag-start"))}),[o,ee]),ft=u.useCallback(((e,t,n)=>{const{newValue:i,newSelected:s}=(0,m.handleInstanceDrag)(ee,e,n,t,pe,Ce);o(i,(0,P.metaChange)("drag-move")),s&&K({selected:s})}),[Ce,o,K,pe,ee]),mt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(void 0)}),[]),ht=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(l.THIS_INS_ID)}),[]),vt=u.useCallback((async(t,n,o,i)=>{o.preventDefault(),o.stopPropagation();const{x:s,y:r}=i,a=(0,h.produce)(ee,(e=>{"input"===t?e.inputsPosition[n]={x:s,y:r}:e.outputsPosition[n]={x:s,y:r}}));e.onChangeNode(a,(0,P.metaChange)("node-io-drag-move"))}),[e,ee]),gt=u.useCallback((async(e,t,n,o)=>{n.preventDefault(),n.stopPropagation(),_e(void 0)}),[]),It=u.useCallback(((e,t)=>{let{id:n}=e;const o=t.shiftKey?pe.filter((e=>e!==n)):[],i=t.shiftKey?[...pe,n]:[n],s=pe.includes(n)?o:i;K({selected:s,from:void 0,to:void 0})}),[K,pe]),bt=u.useCallback((()=>{const e=ee.instances.map((e=>e.id));K({selected:e,from:void 0,to:void 0})}),[K,ee.instances]),yt=u.useCallback((e=>{const t=ve.filter((t=>{let{from:n,to:o}=t;return-1===e.indexOf(n.insId)&&-1===e.indexOf(o.insId)})),n=(0,h.produce)(ee,(n=>{n.connections=t,n.instances=n.instances.filter((t=>!e.includes(t.id)))}));K({selected:[]}),o(n,(0,P.functionalChange)("delete-ins"))}),[ve,o,K,ee]),Ct=u.useCallback((e=>{yt([e.id])}),[yt]),_t=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{"input"===e?(delete n.inputs[t],n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===t)))):(n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===t))),n.completionOutputs=(n.completionOutputs||[]).map((e=>e.split("+").filter((e=>e!==t)).join("+"))).filter((e=>!!e)),delete n.outputs[t])}));fe&&fe.insId===l.THIS_INS_ID&&fe.pinId===t?K({from:void 0}):me&&me.insId===l.THIS_INS_ID&&me.pinId===t&&K({to:void 0}),o(n,(0,P.functionalChange)("remove io pin"))}),[ee,fe,me,o,K]),xt=u.useCallback((async()=>{const{selected:e,from:t,to:n}=Y;0===e.length?t&&(0,l.isExternalConnectionNode)(t)?await Fe(`Are you sure you want to remove main input ${t.pinId}?`)&&_t("input",t.pinId):n&&(0,l.isExternalConnectionNode)(n)&&await Fe(`Are you sure you want to remove main output ${n.pinId}?`)&&_t("output",n.pinId):yt(e)}),[Fe,Y,yt,_t]),Nt=u.useCallback(((e,t,n)=>{const i=(0,m.getInstancePinConfig)(ee,e.id,t),s=(0,l.isStickyInputPinConfig)(i)?(0,x.queueInputPinConfig)():(0,l.stickyInputPinConfig)();o((0,m.changePinConfig)(ee,e.id,t,s),(0,P.functionalChange)("toggle-sticky")),ue("togglePinSticky",{isSticky:(0,l.isStickyInputPinConfig)(s)})}),[o,ee,ue]),wt=u.useCallback((()=>{const{newNode:e,newInstances:t}=(0,$.handleDuplicateSelectedEditorCommand)(ee,pe);o(e,(0,P.functionalChange)("duplicated instances")),K({selected:t.map((e=>e.id))})}),[o,K,ee,pe]),jt=u.useCallback((e=>{const t=e.nativeEvent.target;if(0===e.button&&Z(e.nativeEvent,ee.id)&&t&&"board-editor-inner"===t.className){if(Date.now()-je<300)return void te(e);Ee(Date.now());const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,nt),o=(0,m.domToViewPort)(n,qe,le);Ne({from:o,to:o})}}),[ee.id,qe,je,nt,le,te]),Et=u.useCallback((e=>{if(Ue(null),Z(e.nativeEvent,ee.id)&&xe){if((0,m.calcSelectionBoxArea)(xe)>50){const t=(0,m.getInstancesInRect)(xe,ce,qe,Kt.current,ee.instances,nt,le),n=e.shiftKey?[...pe,...t]:t;K({selected:n})}Ne(void 0)}}),[ee.id,ee.instances,xe,ce,qe,nt,le,pe,K]),Pt=u.useCallback((e=>{if(!Z(e.nativeEvent,ee.id))return void(Ge.current=!1);Ge.current=!0;const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,(0,C.vAdd)(nt,C.vZero)),o=(0,m.domToViewPort)(n,qe,le);xe&&Ne({...xe,to:o});const i=(0,m.findClosestPin)(ee,ce,n,nt,Q,X,qe),s=Ke;if(i){(!s||s.ins!==i.ins||s.ins===i.ins&&s.pin!==i.pin)&&Qe({ins:i.ins,type:i.type,pin:i.id})}tt.current=o,K({lastMousePos:tt.current})}),[ee,nt,qe,le,xe,ce,Q,X,Ke,K]),Ot=u.useCallback((e=>{var t;"bp5-menu"!==(null===(t=e.relatedTarget)||void 0===t?void 0:t.className)&&(Qe(void 0),Ge.current=!1)}),[]),St=u.useCallback(((e,t)=>{if(t){const t=(0,l.isInlineNodeInstance)(e)?e.node:(0,G.safelyGetNodeDef)(e.nodeId,ce);if(!t)throw new Error("Impossible state inspecting inexisting node");if(!(0,l.isVisualNode)(t))return void(0,E.toastMsg)("Cannot inspect a non visual node","warning");ze({insId:`${Q}.${e.id}`,node:t})}else if((0,l.isRefNodeInstance)(e)){const t=(0,G.safelyGetNodeDef)(e,ce);r(t)}else{const t=e.node;if(!(0,l.isInlineValueNode)(t))return void((0,l.isVisualNode)(t)?ze({insId:e.id,node:t}):(0,E.toastMsg)("Editing this type of node is not supported"));const n=atob(t.dataBuilderSource);Ve({insId:e.id,templateType:t.templateType,value:n,type:"existing"}),(0,E.toastMsg)("Editing inline visual node not supported yet")}}),[r,ce,Q]),Dt=u.useCallback((e=>{if((0,l.isInlineNodeInstance)(e)){const t=e.node;if(!(0,l.isVisualNode)(t))return void(0,E.toastMsg)("Not supported","warning");const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.filter((t=>t.id!==e.id)),n.connections=n.connections.filter((t=>{let{from:n,to:o}=t;return n.insId!==e.id&&o.insId!==e.id})),n.instances.push(...t.instances),n.connections.push(...t.connections.filter((e=>(0,l.isInternalConnectionNode)(e.from)&&(0,l.isInternalConnectionNode)(e.to))))}));o(n,{type:"functional",message:"ungroup"}),K({selected:[]})}else{const t=(0,G.safelyGetNodeDef)(e.nodeId,ce);if(!(0,l.isVisualNode)(t))return void(0,E.toastMsg)("Not supported","warning")}}),[ee,o,K,ce]),Mt=u.useCallback((async e=>{}),[]),Tt=u.useCallback(((e,t)=>{const n=(0,V.handleDetachConstEditorCommand)(ee,e.id,t);o(n,(0,P.functionalChange)("detach-const"))}),[o,ee]),kt=u.useCallback(((e,t)=>{const n=e.inputConfig[t]||(0,x.queueInputPinConfig)();(0,l.isStaticInputPinConfig)(n)&&(Re(n.value),E.AppToaster.show({message:"Value copied"}))}),[]),Rt=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{const o=n.instances.find((t=>t.id===e.id));if(!o)throw new Error("Impossible state");o.inputConfig[t]=(0,l.staticInputPinConfig)(ke),n.connections=n.connections.filter((n=>!(0,l.isInternalConnectionNode)(n.to)||!(n.to.insId===e.id&&n.to.pinId===t)))}));o(n,(0,P.functionalChange)("paste const value"))}),[ee,o,ke]),At=u.useCallback((async e=>{const t=await Le("New name?");if(!t)return;const n=(0,h.produce)(ee,(n=>{var o;"input"===e?(ee.inputs||(n.inputs={}),n.inputs[t]=(0,l.nodeInput)(),n.inputsPosition[t]=tt.current):(ee.outputs||(n.outputs={}),n.outputs[t]=(0,l.nodeOutput)(),n.outputsPosition[t]=tt.current,(null===(o=n.completionOutputs)||void 0===o?void 0:o.length)&&(0,E.toastMsg)("Note that this node has explicit completion outputs set. You may need to update them."))}));o(n,(0,P.functionalChange)("add new io pin")),ue("addIoPin",{type:e})}),[Le,ee,o,ue]),Vt=u.useCallback((async()=>{var e;const t=null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","),n=await Le("Edit completion outputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,h.produce)(ee,(e=>{e.completionOutputs=""===n?void 0:n.split(",")}));o(e,(0,P.functionalChange)("change node completions")),ue("editCompletionOutputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),$t=u.useCallback((async()=>{var e;const t=null===(e=ee.reactiveInputs)||void 0===e?void 0:e.join(","),n=await Le("Edit reactive inputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,h.produce)(ee,(e=>{e.reactiveInputs=""===n?void 0:n.split(",")}));o(e,(0,P.functionalChange)("change reactive inputs")),ue("editReactiveInputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),zt=u.useCallback((async()=>{const e=await Le("Description?",ee.description),t=(0,h.produce)(ee,(t=>{t.description=e}));o(t,(0,P.functionalChange)("Edit node description"))}),[Le,o,ee]),Ht=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{t.defaultStyle=e}));o(t,(0,P.functionalChange)("change default style")),ue("changeStyle",{isDefault:!0})}),[o,ee,ue]),Ft=u.useCallback((async(e,t)=>{const n=await Le("New name?",t)||t,i=(0,m.handleIoPinRename)(ee,e,t,n);o(i,(0,P.functionalChange)("rename io pin"))}),[ee,o,Le]),Lt=u.useCallback(((e,t)=>{const n=(0,m.handleChangeNodeInputType)(ee,e,t);o(n,(0,P.functionalChange)("toggle io pin optional"))}),[ee,o]),qt=u.useCallback((e=>{switch(e.type){case F.ActionType.RemoveNode:{const e=(0,h.produce)(ee,(e=>{if(!(0,l.isVisualNode)(ee))throw new Error("Impossible state, deleting instances opf non visual node");e.instances=e.instances.filter((e=>!pe.includes(e.id))),e.connections=e.connections.filter((e=>!pe.includes(e.from.insId)&&!pe.includes(e.to.insId)))}));K({selected:[]}),o(e,(0,P.functionalChange)("remove-instances")),(0,E.toastMsg)(`Removed ${pe.length} instances(s)`),ue("deleteInstances",{count:pe.length});break}case F.ActionType.Inspect:if(1===pe.length)J(pe[0]);else if(fe||me){const e=null!=fe?fe:me,t=(0,l.isExternalConnectionNode)(e)?l.ROOT_INS_ID:e.insId;J(t,{type:fe?"output":"input",id:e.pinId})}ue("openInspectMenu",{source:"actionMenu"});break;case F.ActionType.Group:(async()=>{await Ye()})();break;case F.ActionType.UnGroup:{const e=ee.instances.find((e=>e.id===pe[0]));Dt(e);const t=(0,G.safelyGetNodeDef)(e,ce);(0,E.toastMsg)(`Ungrouped inline node ${t.id}`),ue("unGroupNode",{instancesCount:t.instances.length});break}case F.ActionType.AddInlineValue:Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"actionMenu"});break;case F.ActionType.AddNode:!async function(){const t=(0,m.getMiddleOfViewPort)(qe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*qe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,h.produce)(ee,(e=>{e.instances.push(r)})),u=(0,h.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,P.functionalChange)("add new instance")),K(u),(0,E.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;case F.ActionType.AI:!async function(){const t=(0,m.getMiddleOfViewPort)(qe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*qe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,h.produce)(ee,(e=>{e.instances.push(r)})),u=(0,h.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,P.functionalChange)("add new instance")),K(u),(0,E.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;default:(0,E.toastMsg)(`${e.type} not supported yet`)}}),[Y,fe,o,K,Ye,re,J,Dt,ee,ce,ue,pe,me,qe,et]),Gt=()=>{const t=Y.from;return(0,p.entries)(be).map((n=>{let[o,s]=n;return(0,a.jsx)(y.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"input",pos:ge[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Ft:void 0,onDblClick:Zt,closest:!(!Ke||"input"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,inputMode:s.mode,onChangeInputMode:Lt,viewPort:qe,onDragStart:ht,onDragEnd:gt,onDragMove:vt,onSelect:it,onSetDescription:st,selected:(null==t?void 0:t.pinId)===o,description:s.description,onMouseUp:Nn,onMouseDown:xn},o)}))},Bt=()=>{const{to:t}=Y;return(0,p.entries)(ye).map((n=>{let[o,s]=n;return(0,a.jsx)(y.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"output",pos:Ie[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Ft:void 0,closest:!(!Ke||"output"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,viewPort:qe,onDragStart:ht,onDragEnd:gt,onDragMove:vt,onSelect:it,onSetDescription:st,description:s.description,selected:(null==t?void 0:t.pinId)===o,onMouseUp:Nn,onMouseDown:xn},o)}))},Ut=()=>{if(xe){const{from:e,to:t}=xe,n=(0,m.logicalPosToRenderedPos)(e,qe),o=(0,m.logicalPosToRenderedPos)(t,qe),{x:i,y:s,w:r,h:u}=(0,m.getSelectionBoxRect)(n,o);return(0,a.jsx)("div",{className:"selection-box",style:{top:s,left:i,width:r,height:u}})}return null},Wt=u.useCallback((async(e,t,n,o)=>{if("input"===n){const n=e.inputConfig[t],o=(0,l.isStaticInputPinConfig)(n)?JSON.stringify(n.value):void 0;Ve({type:"static-input",insId:e.id,pinId:t,value:null!=o?o:JSON.stringify("Some static value")}),ue("addValueModalOpen",{source:"dblClickPin"})}else{const i=(0,G.safelyGetNodeDef)(e,ce);if(!(0,l.getNodeOutputs)(i)[t])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:o.clientX,y:o.clientY},ins:e,targetNode:i,pinId:t,pinType:n})}}),[ce,ue]),Zt=u.useCallback((async(e,t)=>{if(!ee.inputs[e])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:t.clientX,y:t.clientY},pinId:e,pinType:"input",targetNode:ee})}),[ee]),Jt=u.useCallback((e=>{if(e.metaKey||e.ctrlKey){const t=-.005*e.deltaY;ct(qe.zoom+t,"mouse"),e.preventDefault(),e.stopPropagation()}else{if(se)return;const t=e.deltaX,n=e.deltaY,o=(0,h.produce)(qe,(e=>{e.pos.x=e.pos.x+t/e.zoom,e.pos.y=e.pos.y+n/e.zoom}));We(o),e.stopPropagation(),e.preventDefault()}}),[se,ct,We,qe]);(0,v.useEffect)((()=>{const{current:e}=Xe;if(e)return e.addEventListener("wheel",Jt),()=>{e.removeEventListener("wheel",Jt)}}),[Jt]);const Yt={backgroundPositionX:(0,m.roundNumber)(-qe.pos.x*qe.zoom),backgroundPositionY:(0,m.roundNumber)(-qe.pos.y*qe.zoom),backgroundSize:(0,m.roundNumber)(10*qe.zoom)+"px"},Kt=u.useRef(new Map);u.useEffect((()=>{const e=he.reduce(((e,t)=>{const n=(0,G.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeInputs)(n))),e}),new Map),t=he.reduce(((e,t)=>{const n=(0,G.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeOutputs)(n))),e}),new Map);e.set(l.THIS_INS_ID,(0,l.keys)(ee.outputs)),t.set(l.THIS_INS_ID,(0,l.keys)(ee.inputs));const n=ve.filter((n=>{const o=e.get(n.to.insId)&&e.get(n.to.insId).includes(n.to.pinId),i=t.get(n.from.insId)&&t.get(n.from.insId).includes(n.from.pinId);return!(o&&i)}));if(n.length>0){(0,E.toastMsg)(`${n.length} orphan connections removed`,"warning"),console.warn(`${n.length} orphan connections removed`,n);const e=(0,h.produce)(ee,(e=>{e.connections=ee.connections.filter((e=>!n.includes(e)))}));o(e,(0,P.functionalChange)("prune orphan connections"))}}),[he,o,ve,ee,ce]),u.useEffect((()=>{let e=[];const t=(0,h.produce)(ee,(t=>{t.instances=t.instances.map((t=>{const n=(0,G.safelyGetNodeDef)(t,ce);if(n){const o=(0,l.getNodeInputs)(n),i=(0,l.getNodeOutputs)(n);if(t.visibleInputs){const n=t.visibleInputs.filter((e=>!o[e]));n.length>0&&(t.visibleInputs=(0,l.keys)(o),e.push(...n))}if(t.visibleOutputs){const n=t.visibleOutputs.filter((e=>!i[e]));n.length>0&&(t.visibleOutputs=(0,l.keys)(i),e.push(...n))}}return t}))}));e.length>0&&((0,E.toastMsg)(`Found ${e.length} invalid visible inputs/outputs: ${e.join(", ")}. Reset them`,"warning"),o(t,(0,P.functionalChange)("reset corrupt visible inputs/outputs")))}),[he,o,ee,ce]),(0,v.useEffect)((()=>{const e=new Map(he.map((e=>[e.id,e])));Kt.current=ve.reduce(((t,n)=>{const o=t.get(n.to.insId)||{},i=o[n.to.pinId]||[],s={...o,[n.to.pinId]:[...i,e.get(n.from.insId)]};return t.set(n.to.insId,s),t}),new Map)}),[ve,he]);const Qt=u.useCallback((()=>{Te(void 0)}),[]),Xt=u.useCallback((async e=>{if(!Me)throw new Error("impossible state - quick add menu invoked but not available");const{ins:t,pinId:n}=Me;switch(e.type){case"import":case"node":{const i="import"===e.type?await re(e.importableNode):ce,s="import"===e.type?e.importableNode.node:e.node,r=(0,m.createNewNodeInstance)(s.id,100,tt.current,i);if(r){const e=(0,h.produce)(ee,(e=>{e.instances.push(r),e.connections.push({from:{insId:t?t.id:l.THIS_INS_ID,pinId:n},to:{insId:r.id,pinId:l.TRIGGER_PIN_ID}})}));o(e,(0,P.functionalChange)("add-item-quick-menu")),Qt()}ue("addNode",{nodeId:s.id,source:"quickAdd"});break}case"value":if(!t)return void(0,E.toastMsg)("Cannot add value to main input");Ve({type:"new-output",insId:t.id,pinId:n}),ue("addValueModalOpen",{source:"quickAdd"})}}),[Me,ce,ue,ee,o,Qt,re]),en=u.useCallback((async()=>{const e=JSON.stringify(ee);await navigator.clipboard.writeText(e),E.AppToaster.show({message:"Copied!"})}),[ee]),tn=u.useCallback((()=>{var e,t;const n=i?"":" (cannot edit main node, only visual)";return(0,a.jsxs)(b.Menu,{children:[(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"New Value",onClick:(0,p.preventDefaultAnd)((()=>{Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"contextMenu"})}))}),(0,a.jsx)(b.MenuItem,{text:`New input ${n}`,onMouseDown:e=>e.stopPropagation(),onClick:(0,p.preventDefaultAnd)((()=>At("input"))),disabled:!i}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`New output ${n}`,onClick:(0,p.preventDefaultAnd)((()=>At("output"))),disabled:!i}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Copy node to clipboard",onClick:(0,p.preventDefaultAnd)(en)}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Completion Outputs (${(null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Vt()))}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Reactive inputs (${(null===(t=ee.reactiveInputs)||void 0===t?void 0:t.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>$t()))}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Edit description",onClick:(0,p.preventDefaultAnd)((()=>zt()))}),(0,a.jsx)(b.MenuDivider,{}),(0,a.jsx)(b.MenuItem,{text:"Default Style",children:(0,a.jsx)(z.NodeStyleMenu,{style:ee.defaultStyle,onChange:Ht,promptFn:Le})})]})}),[i,en,ee.completionOutputs,ee.reactiveInputs,ee.defaultStyle,Ht,Le,ue,At,Vt,$t,zt]);(0,g.useHotkeys)("shift+c",ot,{text:"Center viewport",group:"Viewport Controls"},[],Ge),(0,g.useHotkeys)("cmd+c",at,{text:"Copy instances",group:"Editing"},[],Ge),(0,g.useHotkeys)("cmd+v",ut,{text:"Paste instances",group:"Editing"},[],Ge),(0,g.useHotkeys)("esc",dt,{text:"Clear selections",group:"Selection"},[],Ge),(0,g.useHotkeys)("backspace",xt,{text:"Delete instances",group:"Editing"},[],Ge),(0,g.useHotkeys)("shift+d",wt,{text:"Duplicate selected instances",group:"Editing"},[],Ge),(0,g.useHotkeys)("cmd+a",bt,{text:"Select all",group:"Selection"},[],Ge),(0,g.useHotkeys)("s",lt,{text:"Select pin closest to mouse",group:"Selection"},[],Ge);const nn=u.useCallback(((e,t)=>{if(!$e)throw new Error("impossible state");const n=(0,h.produce)(ee,(t=>{const n=t.instances.find((e=>e.id===$e.insId));if(!n||!(0,l.isInlineNodeInstance)(n))throw new Error("impossible state");n.node=e}));o(n,(0,P.functionalChange)("Inner change: "+t.message)),ze((t=>({...t,node:e})))}),[o,$e,ee]),[on,sn]=(0,v.useState)({selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}}),rn=u.useCallback((e=>sn((t=>({...t,...e})))),[]),an=n=>$e&&$e.insId===n.id?{currentInsId:$e.insId,ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),boardData:on,onChangeBoardData:rn,resolvedDependencies:ne,onCopy:s,clipboardData:e.clipboardData,onInspectPin:e.onInspectPin,onGoToNodeDef:e.onGoToNodeDef,nodeIoEditable:e.nodeIoEditable,node:$e.node,onChangeNode:nn,onShowOmnibar:te,parentViewport:t.defaultViewPort,parentBoardPos:nt,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:e.queuedInputsData}:void 0,un=()=>{if(fe&&("input"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"output"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(e)&&!(0,l.isInternalConnectionNode)(fe))return;return{from:fe,to:e}}if(me&&("output"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"input"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(me)&&!(0,l.isInternalConnectionNode)(e))return;return{from:e,to:me}}},ln=()=>{const e=un();if(e){const{from:t,to:n}=e;return{connection:{from:t,to:n},type:ve.some((t=>(0,l.connectionDataEquals)(t,e)))?"future-remove":"future-add"}}},cn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleInputs:t}:n))}));o(n,(0,P.functionalChange)("change instance visible inputs"))}),[ee,o]),dn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,style:t}:n))}));o(n,(0,P.functionalChange)("change instance style")),ue("changeStyle",{isDefault:!1})}),[o,ee,ue]),pn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleOutputs:t}:n))}));o(n,(0,P.functionalChange)("change instance visible outputs"))}),[ee,o]),fn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,displayName:t}:n))}));o(n,(0,P.functionalChange)("change instance display name"))}),[ee,o]);u.useImperativeHandle(n,(()=>({centerInstance(e){const t=ee.instances.find((t=>t.id===e));if(t){const e=(0,C.vSub)(t.pos,(0,C.vec)(et.width/2,et.height/2));We({...qe,pos:e})}},centerViewPort(){ot()},getViewPort:()=>qe,clearSelection:()=>{dt()},requestNewInlineValue:()=>{Ve({type:"new-floating",pos:tt.current})}})));const[mn,hn]=u.useState([]),vn=u.useCallback(((e,t)=>{const n=t.trim().substr(0,100),i=`Inline-value-${n.substr(0,15).replace(/["'`]/g,"")}`,s=(0,S.createInlineValueNode)({code:t,customView:n,nodeId:i,type:e});switch(Ae.type){case"existing":{const[e]=ee.instances.filter((e=>e.id===Ae.insId)).filter((e=>(0,l.isInlineNodeInstance)(e))).map((e=>e.node));if(!e)throw new Error("Unable to find inline node to save to");const t=(0,l.keys)(e.inputs),n=(0,l.keys)(s.inputs),i=new Set(D.default.difference(t,n)),r=(0,h.produce)(ee,(e=>{e.instances=e.instances.map((e=>e.id===Ae.insId?(0,l.inlineNodeInstance)(e.id,s,e.inputConfig,e.pos):e)),e.connections=e.connections.filter((e=>!(e.to.insId===Ae.insId&&i.has(e.to.pinId))))}));o(r,(0,P.functionalChange)("change inline value")),Ve(void 0);break}case"static-input":{let e;try{const n=t.replace(/^['`]/,'"').replace(/['`]$/,'"');e=JSON.parse(n)}catch(r){return void(0,E.toastMsg)("Input values must not be formulas or code")}const n=(0,h.produce)(ee,(t=>{t.instances.find((e=>e.id===Ae.insId)).inputConfig[Ae.pinId]=(0,l.staticInputPinConfig)(e)}));o(n,(0,P.functionalChange)("set static input value")),Ve(void 0);break}case"new-floating":{const e=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},Ae.pos),t=(0,h.produce)(ee,(t=>{t.instances.push(e)}));o(t,(0,P.functionalChange)("new floating value")),Ve(void 0);break}case"new-output":{const{insId:e,pinId:t}=Ae,n=ee.instances.find((t=>t.id===e));if(!n)throw new Error("Impossible state");const i=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},(0,C.vAdd)(n.pos,{x:-50,y:150})),r=(0,h.produce)(ee,(n=>{n.instances.push(i),n.connections.push({from:(0,l.connectionNode)(e,t),to:(0,l.connectionNode)(i.id,l.TRIGGER_PIN_ID)})}));o(r,(0,P.functionalChange)("new value connected to output")),Ve(void 0)}}ue("addValue",{type:e,placeholdersCount:(0,l.keys)(s.inputs).length})}),[Ae,o,ee,ue]),gn=ve.filter((e=>{const t=un();return!t||!(0,l.connectionDataEquals)(t,e)})),In=u.useCallback((()=>{ze(void 0),sn(t.defaultBoardData)}),[]),bn=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{const n=t.connections.find((t=>(0,l.connectionDataEquals)(t,e)));n.hidden=!n.hidden}));o(t,(0,P.functionalChange)("toggle connection hidden"))}),[o,ee]),yn=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{t.connections=t.connections.filter((t=>!(0,l.connectionDataEquals)(t,e)))}));o(t,(0,P.functionalChange)("remove connection"))}),[o,ee]),Cn=u.useCallback(((e,t,n)=>{Ue("input"===n?{to:(0,l.connectionNode)(e.id,t),from:void 0}:{from:(0,l.connectionNode)(e.id,t),to:void 0})}),[]),_n=u.useCallback(((e,t,n)=>{Be&&(Be.from&&"input"===n?Je(Be.from,(0,l.connectionNode)(e.id,t),"pinDrag"):Be.to&&"output"===n&&Je((0,l.connectionNode)(e.id,t),Be.to,"pinDrag")),Ue(null)}),[Be,Je]),xn=u.useCallback(((e,t)=>{}),[]),Nn=u.useCallback(((e,t)=>{Be&&(Be.from&&"output"===t?Je(Be.from,(0,l.externalConnectionNode)(e),"nodeIoPinDrag"):Be.to&&"input"===t&&Je((0,l.externalConnectionNode)(e),Be.to,"nodeIoPinDrag"))}),[Be,Je]);try{return(0,a.jsxs)(b.ContextMenu,{className:(0,k.default)("visual-node-editor",e.className,{dark:ae}),"data-id":ee.id,content:tn(),disabled:!Ge.current,children:[(0,a.jsxs)("main",{className:"board-editor-inner",onMouseDown:jt,onMouseUp:Et,onMouseMove:Pt,onMouseLeave:Ot,ref:Xe,style:Yt,children:[(0,a.jsx)(u.Fragment,{children:(0,a.jsx)(w.LayoutDebugger,{vp:qe,node:ee,extraDebug:m.emptyList,mousePos:tt.current})}),(0,a.jsx)(d.ConnectionView,{resolvedNodes:ce,currentInsId:Q,ancestorsInsIds:X,size:et,node:ee,boardPos:nt,instances:he,connections:gn,futureConnection:ln(),onDblClick:l.noop,viewPort:qe,parentVp:le,selectedInstances:pe,toggleHidden:bn,removeConnection:yn,lastMousePos:tt.current,draggedSource:Be}),Gt(),he.map((t=>{var n,o,i,s,r;return(0,a.jsx)(c.InstanceView,{onUngroup:Dt,onExtractInlineNode:Mt,onDetachConstValue:Tt,onCopyConstValue:kt,onPasteConstValue:Rt,copiedConstValue:ke,connectionsPerInput:Kt.current.get(t.id)||m.emptyObj,node:(0,G.safelyGetNodeDef)(t,ce),ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),onPinClick:rt,onPinDblClick:Wt,onDragStart:pt,onDragEnd:mt,resolvedDeps:ce,onDragMove:ft,onDblClick:St,onSelect:It,onToggleSticky:Nt,selected:-1!==pe.indexOf(t.id),dragged:Ce===t.id,onInspectPin:Ze,selectedInput:me&&(0,l.isInternalConnectionNode)(me)&&me.insId===t.id?me.pinId:void 0,selectedOutput:fe&&(0,l.isInternalConnectionNode)(fe)&&fe.insId===t.id?fe.pinId:void 0,closestPin:Ke&&Ke.ins.id===t.id?Ke:void 0,queuedInputsData:null!==(n=oe[t.id])&&void 0!==n?n:m.emptyObj,instance:t,connections:ve,onTogglePinBreakpoint:l.noop,onTogglePinLog:l.noop,viewPort:qe,onChangeVisibleInputs:cn,onChangeVisibleOutputs:pn,onSetDisplayName:fn,onDeleteInstance:Ct,forceShowMinimized:fe||(null===(o=null==Be?void 0:Be.to)||void 0===o?void 0:o.insId)===t.id?"input":me||(null===(i=null==Be?void 0:Be.from)||void 0===i?void 0:i.insId)===t.id?"output":void 0,isConnectedInstanceSelected:pe.some((e=>ve.some((n=>{let{from:o,to:i}=n;return o.insId===t.id&&i.insId===e||o.insId===e&&i.insId===t.id})))),inlineGroupProps:an(t),onCloseInlineEditor:In,inlineEditorPortalDomNode:He.current,onChangeStyle:dn,onGroupSelected:Ye,onPinMouseDown:Cn,onPinMouseUp:_n,hadError:null!==(r=null===(s=e.instancesWithErrors)||void 0===s?void 0:s.has((0,l.fullInsIdPath)(t.id)))&&void 0!==r&&r},t.id)})),Ut(),Bt(),(0,a.jsx)(L.MainInstanceEventsIndicator,{currentInsId:Q,ancestorsInsIds:X,viewPort:qe}),Me?(0,a.jsx)(_.QuickAddMenu,{targetNode:Me.targetNode,pinId:Me.pinId,pinType:Me.pinType,pos:Me.pos,resolvedDependencies:ne,node:ee,onAdd:Xt,onClose:Qt}):null,(0,a.jsxs)("div",{className:"viewport-controls-and-help",children:[(0,a.jsx)(b.Button,{small:!0,onClick:ot,minimal:!0,intent:"primary",children:"Center"}),(0,a.jsx)(U,{min:.15,max:3,stepSize:.05,labelStepSize:10,labelRenderer:W,onChange:ct,value:qe.zoom}),we?(0,a.jsx)(q.HelpBubble,{}):null]}),Ae?(0,a.jsx)(O.InlineCodeModal,{env:m.emptyObj,initialValue:Ae.value,initialType:"existing"===Ae.type?Ae.templateType:void 0,onCancel:()=>Ve(void 0),onSubmit:vn}):null,(0,a.jsx)("div",{className:"inline-editor-portal-root"})]}),(0,a.jsx)(F.ActionsMenu,{showRunFlowOptions:we,onAction:qt,selectedInstances:pe,node:ee,resolvedNodes:ce,to:me,from:fe,hotkeysEnabled:Ge})]})}catch(wn){return console.error(wn),(0,a.jsxs)("div",{children:["Error rendering board - ",wn.toString()]})}})));const Z=(e,t)=>{const n=e.target.closest(".visual-node-editor");return n&&n.getAttribute("data-id")===t}},83234:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeView=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=r(n(59349)),d=n(30653);t.BaseNodeView=function(e){const{dragged:t,viewPort:n,pos:o,onDragEnd:i,onDragMove:s,onDragStart:r,displayMode:p}=e,f=(0,d.useDarkMode)(),m=u.useCallback(((e,t)=>{r(e,t)}),[r]),h=u.useCallback(((e,t)=>{const s=o,r=(t.x-s.x)/n.zoom,a=(t.y-s.y)/n.zoom,u=s.x+r,l=s.y+a;i(e,{...t,x:u,y:l})}),[o,i,n]),v=u.useCallback(((e,t)=>{s(e,{x:t.x,y:t.y})}),[s]),g={transform:`scale(${n.zoom})`},I=(0,l.default)("base-node-view",e.className,{dragged:t,dark:f,"display-mode":p}),b=o.x*n.zoom-n.pos.x*n.zoom,y=o.y*n.zoom-n.pos.y*n.zoom,C={transform:`translate(${b-o.x}px, ${y-o.y}px)`},_=(0,l.default)("base-node-view-vp-fixer",{"display-mode":p}),x=(0,a.jsx)("span",{className:"base-node-view-wrapper",children:(0,a.jsx)("div",{className:I,style:g,id:e.domId,children:e.children})});return(0,a.jsx)("div",{className:_,style:C,children:(0,a.jsx)(c.default,{onStop:h,onStart:m,onDrag:v,position:o,cancel:".no-drag",children:x})})}},80510:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleConnectionCloseEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleConnectionCloseEditorCommand=(e,t)=>{let{from:n,to:o}=t;return(0,s.default)(e,(e=>{const t=e.connections.find((e=>{const t=(0,i.connectionNodeEquals)(n,e.from),s=(0,i.connectionNodeEquals)(o,e.to);return t&&s}));t?e.connections=e.connections.filter((e=>e!==t)):e.connections.push({from:n,to:o})}))}},1788:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDetachConstEditorCommand=void 0;const i=n(74762),s=o(n(53865)),r=n(68371);t.handleDetachConstEditorCommand=(e,t,n)=>(0,s.default)(e,(e=>{const{instances:o}=e,s=o.find((e=>e.id===t));if(!s)throw new Error("Impossible state ins id with no matching instance");const a=s.inputConfig[n];if(!a)throw new Error("impossible state detaching const from unexistent config");if(!(0,i.isStaticInputPinConfig)(a))throw new Error("impossible state detaching const with no value");const u=JSON.stringify(a.value),l=(0,r.createInlineValueNode)({code:`${u}`,type:i.InlineValueNodeType.VALUE}),c=(0,i.inlineNodeInstance)(`value-${(0,i.randomInt)(999)}`,l,{},{x:s.pos.x,y:s.pos.y-100});if(!e.instances.find((e=>e.id===s.id)))throw new Error("impossible state instance not found");s.inputConfig[n]=(0,i.queueInputPinConfig)(),e.instances.push(c),e.connections.push((0,i.connectionData)(`${c.id}.value`,`${s.id}.${n}`))}))},2130:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDuplicateSelectedEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleDuplicateSelectedEditorCommand=(e,t)=>{const n=[];return{newNode:(0,s.default)(e,(o=>{const s=o.instances;t.forEach((t=>{const o=s.find((e=>e.id===t));if(!o)throw new Error("impossible state duplicate selected no matching instance");if(o){const{pos:t}=o,r={...o,pos:{x:t.x+20,y:t.y+20},id:(0,i.createInsId)(e)};s.push(r),n.push(r.id)}}))})),newInstances:n}}},25044:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.pasteInstancesCommand=void 0;const i=n(74762),s=o(n(53865));t.pasteInstancesCommand=(e,t,n)=>{const o=n.instances.map((n=>({...n,pos:t,id:(0,i.createInsId)(e)}))),r=new Map(o.map(((e,t)=>[n.instances[t].id,e.id])));return{newNode:(0,s.default)(e,(e=>{e.instances.push(...o);const t=n.connections.map((e=>{let{from:t,to:n}=e;return{from:{...t,insId:r.get(t.insId)||t.insId},to:{...n,insId:r.get(n.insId)||n.insId}}}));e.connections.push(...t)})),newInstances:o}}},65082:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionView=t.SingleConnectionView=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=r(n(26372)),d=n(74762),p=n(18243),f=n(77852),m=n(74089),h=n(60190),v=n(50382),g=n(76064),I=n(41032);t.SingleConnectionView=e=>{const{isBrowser:t}=(0,f.useSsr)(),{connection:n,node:o,resolvedNodes:i,instances:s,type:r,viewPort:a,toggleHidden:l,parentSelected:m,removeConnection:b}=e,{from:y}=n,C=(0,d.isInternalConnectionNode)(y)&&s.find((e=>e.id===y.insId));if(!C&&(0,d.isInternalConnectionNode)(y))throw new Error(`impossible state - "from instance id - [${y.insId}] does not exist"`);const _=((0,d.isInternalConnectionNode)(y)&&C?(0,I.safelyGetNodeDef)(C,i):o).outputs[y.pinId],x=_&&_.delayed,N=t?(0,p.calcStartPos)({...e,connectionNode:y}):{x:0,y:0},w=t?(0,p.calcTargetPos)({...e,connectionNode:n.to}):{x:0,y:0},{x:j,y:E}=(0,h.vDiv)(N,e.parentVp.zoom),{x:P,y:O}=(0,h.vDiv)(w,e.parentVp.zoom),S=(0,c.default)({delayed:x,hidden:n.hidden,"parent-selected":m},r),D=(0,u.jsxs)(v.Menu,{children:[(0,u.jsx)(v.MenuItem,{text:n.hidden?"Show connection":"Hide connection",onClick:()=>l(n)}),(0,u.jsx)(v.MenuItem,{text:"Remove connection",onClick:()=>b(n)})]});return(0,u.jsx)(v.ContextMenu,{content:D,children:e=>(0,u.jsx)(g.ConnectionViewPath,{className:S,from:{x:j,y:E},to:{x:P,y:O},dashed:"regular"!==r,zoom:a.zoom,onContextMenu:e.onContextMenu})})};t.ConnectionView=e=>{var n;const{viewPort:o,futureConnection:i,toggleHidden:s,selectedInstances:r,draggedSource:c}=e,[d,f]=l.useState(0),h=l.useCallback((e=>requestAnimationFrame((()=>{f((e=>(e+1)%9)),e>0&&h(e-1)}))),[]);l.useEffect((()=>{const e=h(10);return()=>{cancelAnimationFrame(e)}}),[h]),l.useEffect((()=>{const e=()=>{h(3)};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[h,d]);const v=e.connections.map((n=>{const o=r.includes(n.from.insId)||r.includes(n.to.insId);return(0,a.createElement)(t.SingleConnectionView,{...e,connection:n,type:"regular",parentSelected:o,key:n.from.insId+n.from.pinId+n.to.insId+n.to.pinId})}));if(i&&v.push((0,a.createElement)(t.SingleConnectionView,{...e,connection:i.connection,type:i.type,toggleHidden:s,parentSelected:!1,key:"future"})),c){const t=(c.from?p.calcStartPos:p.calcTargetPos)({connectionNode:null!==(n=c.from)&&void 0!==n?n:c.to,viewPort:o,boardPos:e.boardPos,ancestorsInsIds:e.ancestorsInsIds,currentInsId:e.currentInsId});v.push((0,u.jsx)(g.ConnectionViewPath,{className:"dragged",from:t,to:(0,m.logicalPosToRenderedPos)(e.lastMousePos,o),zoom:o.zoom},"dragged"))}return(0,u.jsx)("span",{className:"connections-view",style:{opacity:o.zoom},children:(0,u.jsx)("svg",{style:{width:"100%"},children:v})})}},76064:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionViewPath=void 0;const i=n(35250),s=o(n(26372)),r=n(70079),a=n(23381);t.ConnectionViewPath=(0,r.forwardRef)(((e,t)=>{const{from:n,to:o,className:r,onContextMenu:u,zoom:l,dashed:c}=e,{x:d,y:p}=n,{x:f,y:m}=o,h=(0,a.calcBezierPath)({sourceX:d,sourceY:p,targetX:f,targetY:m,curvature:.15}),v=2.5*l,g=c?6*l:void 0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:h,ref:t,className:(0,s.default)("connection",r),style:{strokeWidth:v,strokeDasharray:g},onContextMenu:u}),e.label?(0,i.jsx)("text",{className:"label",x:(d+f)/2,y:(p+m)/2,fontSize:"12px"}):null,(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%"}),(0,i.jsx)("stop",{offset:"100%"})]})]})}))},23381:(e,t)=>{"use strict";var n;function o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i(e){let t,i,{pos:s,x1:r,y1:a,x2:u,y2:l,c:c}=e;switch(s){case n.Left:t=r-o(r-u,c),i=a;break;case n.Right:t=r+o(u-r,c),i=a;break;case n.Top:t=r,i=a-o(a-l,c);break;case n.Bottom:t=r,i=a+o(l-a,c)}return[t,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.getBezierCenter=t.calcBezierPath=t.Position=void 0,function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(n=t.Position||(t.Position={}));t.calcBezierPath=e=>{let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l});return`M${t},${o} C${c},${d} ${p},${f} ${r},${a}`},t.getBezierCenter=function(e){let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l}),m=.125*t+.375*c+.375*p+.125*r,h=.125*o+.375*d+.375*f+.125*a;return[m,h,Math.abs(m-t),Math.abs(h-o)]}},18243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcTargetPos=t.calcStartPos=t.calcPinPosition=void 0;const o=n(74762),i=n(30994),s={x:99999,y:99999};function r(e){const t=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds),pinId:e.pinId,pinType:e.pinType,isMain:e.isMain});return((e,t,n,o)=>{if(!e)return console.warn(`Cannot find element ${n} to calculate position.`),s;const{x:i,y:r,width:a,height:u}=e.getBoundingClientRect(),l=r+u/2;return{x:i+a/2-t.x,y:l-t.y}})(document.getElementById(t),e.boardPos,t,e.viewPort)}t.calcPinPosition=r;t.calcStartPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"input",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"output",boardPos:n,viewPort:s})};t.calcTargetPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"output",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"input",boardPos:n,viewPort:s})}},30994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPinDomId=t.getMainInstanceIndicatorDomId=t.getInstanceDomId=void 0;const o=n(74762);t.getInstanceDomId=(e,t)=>`ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getMainInstanceIndicatorDomId=(e,t)=>`main-ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getPinDomId=e=>{let{pinType:t,fullInsIdPath:n,pinId:o,isMain:i}=e;return`${i?"main-":""}pin:${t}:${n}:${o}`.replace(/\s+/g,"-")}},86553:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceView=t.getVisibleOutputs=t.getVisibleInputs=t.INSTANCE_INFO_TOOLTIP_DELAY=t.MAX_INSTANCE_WIDTH=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=n(66074),d=n(74762),p=r(n(26372)),f=n(2036),m=n(74762),h=n(74762),v=n(53159),g=n(83234),I=n(74762),b=n(30994),y=n(63521),C=n(74089),_=n(50382),x=r(n(99581)),N=n(88593),w=n(30653);t.PIECE_HORIZONTAL_PADDING=25,t.PIECE_CHAR_WIDTH=11,t.MIN_WIDTH_PER_PIN=40,t.MAX_INSTANCE_WIDTH=400,t.INSTANCE_INFO_TOOLTIP_DELAY=400;t.getVisibleInputs=(e,t,n)=>{const{visibleInputs:o}=e;if(o)return o;const i=(0,d.keys)((0,h.getNodeInputs)(t)).filter(((o,i)=>{var s;const r=n.some((t=>t.to.insId===e.id&&t.to.pinId===o)),a=t.inputs[o]&&"optional"===(null===(s=t.inputs[o])||void 0===s?void 0:s.mode);return r||!a&&o!==m.TRIGGER_PIN_ID}));return 0===i.length?[m.TRIGGER_PIN_ID]:i};t.getVisibleOutputs=(e,t,n)=>{const{visibleOutputs:o}=e;if(o)return o;const i=Object.keys(t.outputs);return n.some((t=>t.from.insId===e.id&&t.from.pinId===m.ERROR_PIN_ID))?[...i,m.ERROR_PIN_ID]:i};t.InstanceView=function(e){const{selected:n,selectedInput:o,selectedOutput:i,closestPin:s,dragged:r,onTogglePinLog:j,onTogglePinBreakpoint:E,onDetachConstValue:P,onCopyConstValue:O,onPasteConstValue:S,displayMode:D,connections:M,instance:T,viewPort:k,node:R,onPinClick:A,onPinDblClick:V,onDragStart:$,onDragEnd:z,onDragMove:H,onToggleSticky:F,onSelect:L,onDblClick:q,onChangeVisibleInputs:G,onChangeVisibleOutputs:B,onConvertConstToEnv:U,inlineGroupProps:W,onUngroup:Z,onExtractInlineNode:J,onGroupSelected:Y,isConnectedInstanceSelected:K,inlineEditorPortalDomNode:Q,onChangeStyle:X,onDeleteInstance:ee,onSetDisplayName:te,onPinMouseUp:ne,onPinMouseDown:oe}=e,ie=(0,w.useDarkMode)(),{id:se}=T,re=l.useMemo((()=>{const e=(0,d.randomInt)(6,1);return{icon:(0,d.pickRandom)([["fab","discord"],["fab","slack"],"bug","cube"]),color:e,size:(0,d.randomInt)(3,1),variation:(0,d.randomInt)(5,1)}}),[]),ae=l.useRef(),ue=l.useMemo((()=>T.style||R.defaultStyle||{}),[R,T]),le=ue.size||"regular",ce=l.useMemo((()=>new Map(M.filter((e=>{let{to:t}=e;return t.insId===se})).map((e=>{let{to:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),de=l.useMemo((()=>new Map(M.filter((e=>{let{from:t}=e;return t.insId===se})).map((e=>{let{from:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),pe=(0,C.usePrompt)(),fe=l.useCallback((e=>A(T,e,"input")),[T,A]),me=l.useCallback(((e,t)=>V(T,e,"input",t)),[T,V]),he=l.useCallback(((e,t)=>V(T,e,"output",t)),[T,V]),ve=l.useCallback((e=>A(T,e,"output")),[T,A]),ge=l.useCallback(((e,t)=>{$(T,e,t)}),[T,$]),Ie=l.useCallback(((e,t)=>{const n=T.pos,o=(t.x-n.x)/k.zoom,i=(t.y-n.y)/k.zoom,s=n.x+o,r=n.y+i;z(T,e,{...t,x:s,y:r})}),[T,z,k.zoom]),be=l.useCallback(((e,t)=>{H(T,e,{x:t.x,y:t.y})}),[T,H]),ye=l.useCallback((e=>F(T,e)),[T,F]),Ce=l.useCallback((e=>P(T,e)),[T,P]),_e=l.useCallback((e=>O(T,e)),[T,O]),xe=l.useCallback((e=>S(T,e)),[T,S]),Ne=l.useCallback((e=>L(T,e)),[T,L]),we=l.useCallback((e=>q(T,e.shiftKey)),[T,q]),je=(0,d.entries)(R.inputs),{visibleInputs:Ee,visibleOutputs:Pe}=T;Ee&&je.sort(((e,t)=>Ee.indexOf(e[0])-Ee.indexOf(t[0])));const Oe=(0,d.entries)(R.outputs);Pe&&Oe.sort(((e,t)=>Pe.indexOf(e[0])-Pe.indexOf(t[0])));const Se=(0,t.getVisibleInputs)(T,R,M),De=(0,t.getVisibleOutputs)(T,R,M);je.push([m.TRIGGER_PIN_ID,{...(0,d.nodeInput)(),description:"Use this pin to manually trigger the node. If not connected, the node will be triggered automatically when all required inputs have data."}]),Oe.push([m.ERROR_PIN_ID,{...(0,m.nodeOutput)(),description:"Use this pin to catch errors that happen inside this node. If not connected, errors will bubble up to the parent node."}]);const Me=je.filter((e=>{let[t]=e;return Se.includes(t)||(n||K)&&ce.has(t)})),Te=Oe.filter((t=>{let[o]=t;return De.includes(o)||(n||K)&&de.has(o)||o===m.ERROR_PIN_ID&&e.hadError})),ke=M.some((e=>e.from.insId===se&&e.from.pinId===m.ERROR_PIN_ID)),Re=(0,p.default)("ins-view",{"no-inputs":0===je.length,"no-outputs":0===Oe.length,"display-mode":D,"force-minimized-input":"input"===e.forceShowMinimized||"both"===e.forceShowMinimized,"force-minimized-output":"output"===e.forceShowMinimized||"both"===e.forceShowMinimized,"inline-node-edited":!!W,"error-caught":ke}),Ae=(0,p.default)({selected:n,dragged:r,closest:s&&s.ins.id===T.id},`size-${le}`),Ve=new Set((0,d.entries)(R.inputs).filter((e=>{let[t,n]=e;return(0,m.isInputPinOptional)(n)})).map(d.pickFirst)),$e=(0,d.entries)(T.inputConfig).reduce(((e,t)=>{let[n,o]=t;return(0,m.isStickyInputPinConfig)(o)||o.sticky?{...e,[n]:!0}:e}),{}),ze=(0,v.calcNodeContent)(T,R),He=e=>{const t=T.inputConfig[e];if((0,I.isStaticInputPinConfig)(t))return t.value},Fe=l.useCallback((async()=>{const e=(0,d.okeys)(R.inputs),t=await pe("New order?",(T.visibleInputs||e).join(","));t&&G(T,t.split(","))}),[R.inputs,pe,T,G]),Le=l.useCallback((async()=>{const e=(0,d.okeys)(R.outputs),t=await pe("New order?",(T.visibleOutputs||e).join(","));t&&B(T,t.split(","))}),[R.outputs,pe,T,B]),qe=l.useCallback((()=>{ee(T)}),[ee,T]),Ge=l.useCallback((async()=>{const e=await pe("Set custom display name",T.displayName||R.id);te(T,e)}),[pe,T,te,R.id]),Be=Object.keys((0,h.getNodeInputs)(R)),Ue=Object.keys((0,d.getNodeOutputs)(R)),We=l.useCallback((e=>{U&&U(T,e)}),[T,U]),Ze=l.useCallback(((e,t)=>{ne&&ne(T,e,t)}),[T,ne]),Je=l.useCallback(((e,t)=>{oe&&oe(T,e,t)}),[T,oe]),Ye=()=>(0,u.jsx)("div",{className:"inputs no-drag",children:Me.map((t=>{let[i,r]=t;var a;return(0,u.jsx)(f.PinView,{type:"input",currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,id:i,optional:Ve.has(i),connected:ce.has(i),isSticky:$e[i],minimized:!n&&1===Me.length,onToggleSticky:ye,onDetachConstValue:Ce,onCopyConstValue:_e,onPasteConstValue:xe,copiedConstValue:e.copiedConstValue,selected:i===o,onClick:fe,onDoubleClick:me,isClosestToMouse:!!s&&"input"===s.type&&s.pin===i,onToggleLogged:j,onToggleBreakpoint:E,onInspect:e.onInspectPin,constValue:He(i),onConvertConstToEnv:e.onConvertConstToEnv?We:void 0,description:r.description,queuedValues:null!==(a=e.queuedInputsData[i])&&void 0!==a?a:0,onMouseUp:Ze,onMouseDown:Je},i)}))}),Ke=()=>(0,u.jsx)("div",{className:"outputs no-drag",children:Te.map((t=>{let[o,r]=t;return(0,u.jsx)(f.PinView,{currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,connected:de.has(o),type:"output",id:o,minimized:!n&&1===Te.length,isClosestToMouse:!!s&&"output"===s.type&&s.pin===o,selected:o===i,onClick:ve,onDoubleClick:he,onToggleLogged:j,onToggleBreakpoint:E,onInspect:e.onInspectPin,description:r.description,onMouseUp:Ze,onMouseDown:Je},o)}))}),Qe=l.useCallback((e=>{X(T,e)}),[T,X]),Xe=l.useCallback((()=>{const e=[...Be.map((e=>{const t=Se.includes(e),n=ce.has(e)&&!0!==ce.get(e),o=(0,d.getInputName)(e);return{text:t?n?`Hide input "${o}" (disconnect first)`:`Hide input "${o}"`:`Show input "${o}"`,onClick:()=>G(T,t?Se.filter((t=>t!==e)):[...Se,e]),disabled:n&&t}})),...Ue.map((e=>{const t=De.includes(e),n=de.has(e),o=(0,d.getOutputName)(e);return{text:t?n?`Hide output "${o}" (disconnect first)`:`Hide output "${o}"`:`Show output "${o}"`,onClick:()=>B(T,t?De.filter((t=>t!==e)):[...De,e]),disabled:n&&t}})),...(0,d.isInlineNodeInstance)(T)&&(0,h.isVisualNode)(T.node)?[{text:"Ungroup inline node",onClick:()=>Z(T)}]:[],...(0,d.isInlineNodeInstance)(T)?[{text:"Extract inline node to file",onClick:()=>J(T)}]:[],{text:"Reorder inputs",onClick:Fe},{text:"Reorder outputs",onClick:Le},{text:"Set display name",onClick:Ge},{text:"Group selected instances",onClick:Y},{text:"Delete instance",intent:"danger",onClick:qe}];return(0,u.jsxs)(_.Menu,{children:[(0,u.jsx)(_.MenuItem,{text:"Style",children:(0,u.jsx)(N.NodeStyleMenu,{style:ue,onChange:Qe,promptFn:pe})}),e.map(((e,t)=>(0,a.createElement)(_.MenuItem,{...e,key:t})))]})}),[Be,Ue,T,Fe,Le,Ge,qe,ue,Qe,pe,Se,ce,G,De,de,B,Z,J,Y]),et={"--node-color":ue.color,...ue.cssOverride||{}},tt=(0,b.getInstanceDomId)(T.id,e.ancestorsInsIds);return(0,u.jsx)("div",{className:Re,children:(0,u.jsx)(g.BaseNodeView,{pos:T.pos,viewPort:k,onDragStart:ge,onDragMove:be,onDragEnd:Ie,upperRenderer:Ye,bottomRenderer:Ke,displayMode:D,domId:tt,children:(0,u.jsxs)(l.Fragment,{children:[Ye(),W?x.default.createPortal((0,u.jsxs)("div",{className:"inline-group-editor-container no-drag",children:[(0,u.jsxs)("header",{children:[ze," ",(0,u.jsx)("button",{onClick:e.onCloseInlineEditor,children:"close"})]}),(0,u.jsx)(y.VisualNodeEditor,{...e.inlineGroupProps,className:"no-drag",ref:ae})]}),Q):(0,u.jsx)(_.ContextMenu,{className:(0,p.default)("ins-view-inner",Ae,`size-${re.size}`,{dark:ie}),onClick:Ne,onDoubleClick:we,content:Xe(),style:et,children:(0,u.jsx)(_.Tooltip,{content:R.description,children:(0,u.jsxs)(l.Fragment,{children:[ue.icon?(0,u.jsx)(c.FontAwesomeIcon,{icon:ue.icon}):null," ",ze]})})}),Ke()]})})})}},53568:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStyleMenu=t.nodeStylePresetColors=void 0;const r=n(35250),a=n(50382),u=s(n(70079)),l=n(84472);t.nodeStylePresetColors=[{name:"Amethyst",color:"#9b5de5"},{name:"Magenta",color:"#f15bb5"},{name:"Yellow",color:"#fee440"},{name:"Capri",color:"#00bbf9"},{name:"Sea Green",color:"#00f5d4"},{name:"Orange",color:"#ff7f00"}];const c={size:"regular"};t.NodeStyleMenu=e=>{var n;const{onChange:o,style:i}=e,s=i||c,d=e.promptFn,p=u.default.useCallback(((e,t)=>{o({...s,[e]:t})}),[s,o]),f=u.default.useCallback((async()=>{const e=await d("Icon name? (Font Awesome conventions)","rocket"),t=e.includes(",")?e.split(","):e;p("icon",t)}),[d,p]),m=(0,u.useCallback)((async()=>{const e=await d("Enter a custom style (valid JSON representing a React CSS object)",s.cssOverride?JSON.stringify(s.cssOverride):"");try{const t=JSON.parse(e);p("cssOverride",t)}catch(t){console.error(t),(0,l.toastMsg)("Invalid object","danger")}}),[d,p,s.cssOverride]);return(0,r.jsxs)(u.default.Fragment,{children:[(0,r.jsxs)(a.MenuItem,{text:"Color",children:[t.nodeStylePresetColors.map((e=>(0,r.jsx)(a.MenuItem,{text:e.name,onClick:()=>p("color",e.color)},e.name))),(0,r.jsx)(a.MenuDivider,{}),(0,r.jsx)(a.MenuItem,{text:"Remove Color",onClick:()=>p("color",void 0)})]}),(0,r.jsxs)(a.MenuItem,{text:`Size (${null!==(n=s.size)&&void 0!==n?n:"regular"})`,children:[(0,r.jsx)(a.MenuItem,{text:"Small",onClick:()=>p("size","small")}),(0,r.jsx)(a.MenuItem,{text:"Regular",onClick:()=>p("size","regular")}),(0,r.jsx)(a.MenuItem,{text:"Large",onClick:()=>p("size","large")})]}),(0,r.jsxs)(a.MenuItem,{text:"Icon",children:[(0,r.jsx)(a.MenuItem,{text:"Choose Icon",onClick:f}),(0,r.jsx)(a.MenuItem,{text:"Remove Icon",onClick:()=>p("icon",void 0)})]}),(0,r.jsx)(a.MenuItem,{text:"Custom Styling",onClick:m})]})}},88593:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(53568),t)},83651:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86553),t)},53159:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calcInstancePosition=t.calcNodeWidth=t.calcNodeContent=void 0;const i=n(74762),s=o(n(6576)),r=n(86553),a=n(61888),u=n(30994);t.calcNodeContent=(e,t)=>{if(e.displayName)return e.displayName;if(t.customViewCode)try{const n=Object.entries(e.inputConfig).filter((e=>{let[,t]=e;return(0,i.isStaticInputPinConfig)(t)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o.value}}),{});return s.default.compile(t.customViewCode)({inputs:n}).trim()}catch(n){return console.error("Error with custom view",n),`Error in custom view [${t.id}]`}return t.id};t.calcNodeWidth=(e,n)=>{const o=(0,i.okeys)(n.inputs).length*r.MIN_WIDTH_PER_PIN,s=(0,t.calcNodeContent)(e,n),u=r.PIECE_CHAR_WIDTH;return(0,a.clamp)(s.length*u+2*r.PIECE_HORIZONTAL_PADDING,o,r.MAX_INSTANCE_WIDTH)};t.calcInstancePosition=(e,t,n)=>{const o=(0,u.getInstanceDomId)(e,t),i=document.getElementById(o);if(i){const{x:e,y:t,width:o,height:s}=i.getBoundingClientRect(),r=t+s/2;return{x:e+o/2-n.x,y:r-n.y}}return console.warn("Cannot find element to draw connection to",o),{x:99999,y:99999}}},17841:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutDebugger=t.LayoutDebuggerItem=t.PosDebugger=void 0;const i=n(70079),s=n(35250),r=n(74762),a=o(n(70079)),u=n(7047),l=e=>{let{pos:t}=e;return(0,s.jsxs)("span",{children:[t.x.toFixed(1),", ",t.y.toFixed(1)]})};t.PosDebugger=e=>(0,s.jsx)("span",{className:"pos-debugger",children:(0,s.jsx)(l,{pos:e.pos})});t.LayoutDebuggerItem=e=>{const{pos:n,viewPort:o,size:i,color:r}=e,a=o.zoom,u=n.x*a-o.pos.x*a,l=n.y*a-o.pos.y*a,c={transform:`translate(${u-n.x}px, ${l-n.y}px)`},d={transform:`scale(${o.zoom})`},p={transform:`translate(${n.x}px, ${n.y}px)`},f={width:`${i.width}px`,height:`${i.height}px`,backgroundColor:r};return(0,s.jsx)("div",{className:"layout-debugger",style:c,children:(0,s.jsxs)("span",{className:"drag-sim",style:p,children:[(0,s.jsx)(t.PosDebugger,{pos:n}),(0,s.jsx)("div",{className:"layout-debugger-zoom-wrapper",style:d,children:(0,s.jsx)("div",{className:"layout-debugger-inner",style:f})})]})})};const c=(()=>{try{return"true"===localStorage.getItem("pos-debugger")}catch(e){return!1}})();t.LayoutDebugger=e=>{const{extraDebug:n,vp:o,node:d,mousePos:p}=e;if(!c)return null;const f=n.map(((e,n)=>(0,i.createElement)(t.LayoutDebuggerItem,{...e,key:n}))),m=[...d.instances.map((e=>e.pos)),...(0,r.values)(d.inputsPosition),...(0,r.values)(d.outputsPosition)].map((e=>(0,s.jsx)(t.LayoutDebuggerItem,{pos:e,viewPort:o,size:{width:0,height:0},color:"red"}))),h=(0,u.logicalPosToRenderedPos)(p,o),v=(0,s.jsxs)("div",{className:"viewport-data",children:[(0,s.jsxs)("div",{children:["Pos: ",(0,s.jsx)(l,{pos:o.pos})]}),(0,s.jsxs)("div",{children:["Zoom: ",o.zoom.toFixed(2)," "]}),(0,s.jsxs)("div",{children:["Mouse (logical): ",(0,s.jsx)(l,{pos:p})]}),(0,s.jsxs)("div",{children:["Rendered (rendered): ",(0,s.jsx)(l,{pos:h})]})]});return(0,s.jsxs)(a.default.Fragment,{children:[v,f,m]})}},44338:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(17841),t)},38259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateInstancesWithSingleConstPinsMap=t.getLeafInstancesOfSelection=void 0;t.getLeafInstancesOfSelection=(e,t,n)=>e.reduce(((e,o)=>[...e,...n.filter((e=>e.to.insId===o.id)).map((e=>t.find((t=>t.id===e.from.insId)))).filter((e=>!!e))]),[]).filter((t=>1===n.filter((e=>e.from.insId===t.id||e.to.insId===t.id)).length&&!e.includes(t)));t.calculateInstancesWithSingleConstPinsMap=(e,t)=>{const{connections:n}=e;return n.filter((e=>t.has(e.from.insId))).reduce(((e,n)=>{const o=t.get(n.from.insId),i=n.to.insId,s=e.get(i)||new Map;return s.set(n.to.pinId,{val:o,insId:n.from.insId}),e.set(i,s),e}),new Map)}},37488:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeIoView=void 0;const a=n(35250),u=n(70079),l=s(n(70079)),c=n(74762),d=n(83234),p=r(n(26372)),f=n(50382),m=n(43490),h=n(66189),v=n(74762),g=n(30994),I=n(30653);t.NodeIoView=l.memo((function(e){const{viewPort:t,selected:n,pos:o,type:i,id:s,onDblClick:r,onRename:b,onDelete:y,onChangeInputMode:C,inputMode:_,onSelect:x,closest:N,onSetDescription:w,description:j,onMouseUp:E,onMouseDown:P,currentInsId:O}=e,{history:S,resetHistory:D,refreshHistory:M}=(0,h.useHistoryHelpers)(O,s,i),T=(0,m.usePrompt)(),k=l.useCallback((async()=>{const e=await T("Description?",j);w(i,s,e)}),[T,j,w,i,s]),R=l.useCallback((()=>{y&&y(i,s)}),[i,s,y]),A=l.useCallback((()=>{b&&b(i,s)}),[i,s,b]),V=l.useCallback((e=>{C&&C(s,e)}),[s,C]),$=l.useCallback((()=>[{text:`Current mode - ${_}`,onClick:c.noop},{text:"Make required",onClick:()=>V("required")},{text:"Make optional",onClick:()=>V("optional")},{text:"Make required-if-connected",onClick:()=>V("required-if-connected")},{text:"Set description",onClick:k},...e.onRename?[{text:"Rename",onClick:A}]:[],...e.onDelete?[{text:"Delete",onClick:R}]:[]]),[k,_,V,R,A,e.onDelete,e.onRename]),z=l.useCallback((t=>{r&&r(e.id,t)}),[r,e.id]),H=l.useCallback((()=>{x(s,i)}),[s,i,x]),F=l.useCallback((()=>(0,a.jsx)(f.Menu,{children:$().map(((e,t)=>(0,u.createElement)(f.MenuItem,{...e,key:t})))})),[$]),L="input"===i?(0,v.getInputName)(s):(0,c.getOutputName)(s),q=l.useCallback((e=>{E(s,i,e)}),[s,E,i]),G=l.useCallback((e=>{P(s,i,e)}),[s,P,i]),B=(0,I.useDarkMode)();return(0,a.jsx)(d.BaseNodeView,{className:(0,p.default)("node-io-view",i,{dark:B}),pos:o,onDragEnd:(n,o)=>{const r=e.pos,a=(o.x-r.x)/t.zoom,u=(o.y-r.y)/t.zoom,l=r.x+a,c=r.y+u;e.onDragEnd(i,s,n,{...o,x:l,y:c})},onDragStart:(t,n)=>{e.onDragStart(s,t,n)},onDragMove:(t,n)=>{e.onDragMove(i,s,t,{x:n.x,y:n.y})},viewPort:t,children:(0,a.jsx)(l.Fragment,{children:(0,a.jsx)(f.Tooltip,{content:(()=>{const t=(0,h.calcHistoryContent)(S),n=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:L})," (",i,")"," "]}),n,(0,a.jsx)("hr",{}),t]})})(),children:(0,a.jsx)(f.ContextMenu,{onMouseEnter:M,onMouseOut:D,onMouseUp:q,onMouseDown:G,"data-tip":"","data-html":!0,"data-for":s+e.currentInsId,className:(0,p.default)("node-io-view-inner",{closest:N,selected:n,dark:B}),id:(0,g.getPinDomId)({fullInsIdPath:(0,c.fullInsIdPath)(e.currentInsId,e.ancestorInsIds),pinId:s,pinType:i,isMain:!0}),onClick:H,onDoubleClick:z,content:F(),children:s})})})})}))},66005:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37488),t)},83782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcNodeIoWidth=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0,t.PIECE_HORIZONTAL_PADDING=15,t.PIECE_CHAR_WIDTH=9,t.MIN_WIDTH_PER_PIN=40;t.calcNodeIoWidth=e=>Math.max(t.MIN_WIDTH_PER_PIN,e.length*t.PIECE_CHAR_WIDTH+2*t.PIECE_HORIZONTAL_PADDING)},99942:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderVisualNode=t.layoutToInstances=void 0;const i=n(63521),s=n(74762),r=n(90794),a=o(n(53865)),u=n(83782),l=n(60190),c=n(53159),d=n(41032);t.layoutToInstances=(e,t)=>(0,a.default)(t,(t=>{(0,s.entries)(e.nodes).forEach((e=>{let[n,o]=e;if(n.startsWith("ins-")){const e=n.replace("ins-",""),i=t.instances.find((t=>t.id===e));i?i.pos=o.p:console.warn("WAT")}if(n.startsWith("node-input-")){const e=n.replace("node-input-","");t.inputsPosition[e]=o.p}if(n.startsWith("node-output-")){const e=n.replace("node-output-","");t.outputsPosition[e]=o.p}}))}));t.orderVisualNode=(e,n,o,a)=>{const{instances:p,connections:f}=e,m={...p.reduce(((e,t)=>{const o=(0,l.size)((0,c.calcNodeWidth)(t,(0,d.safelyGetNodeDef)(t,n)),i.NODE_HEIGHT);return{...e,[`ins-${t.id}`]:{p:t.pos,s:o}}}),{}),...(0,s.okeys)(e.inputsPosition).reduce(((t,n)=>({...t,[`node-input-${n}`]:{p:e.inputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{}),...(0,s.okeys)(e.outputsPosition).reduce(((t,n)=>({...t,[`node-output-${n}`]:{p:e.outputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{})},h=f.map((e=>[(0,s.isExternalConnectionNode)(e.from)?`node-input-${e.from.pinId}`:`ins-${e.from.insId}`,(0,s.isExternalConnectionNode)(e.to)?`node-output-${e.to.pinId}`:`ins-${e.to.insId}`])),v=(0,r.orderLayout)({nodes:m,edges:h},o,((n,o)=>{a&&a((0,t.layoutToInstances)(n,e),o)}));return(0,t.layoutToInstances)(v,e)}},90794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderLayout=void 0;const o=n(60190),i=400,s=e=>e.reduce(((e,t)=>{const n=(0,o.vSub)(t.p,(0,o.vec)(t.s.width/2,t.s.height/2));return{...e,[t.id]:{p:n,s:t.s}}}),{});t.orderLayout=(e,t,n)=>{let{nodes:r,edges:a}=e,u=Object.entries(r).map((e=>{let[t,n]=e;return{id:t,p:(0,o.vAdd)(n.p,(0,o.vec)(n.s.width/2,n.s.height/2)),f:(0,o.vec)(0,0),v:(0,o.vec)(0,0),m:1,s:n.s}})),l=0;for(;l.01);){let e=u;for(let t=0;t{let n=e.find((e=>e.id===t[0])),i=e.find((e=>e.id===t[1]));if(!n||!i)return void console.warn("weoops",t[0],t[1]);const s=(0,o.vec)(0,-200),r=(0,o.vSub)(n.p,i.p),a=(0,o.vSub)(s,r),u=1e3*(0,o.vLen)(a),l=(0,o.vMul)((0,o.vNorm)(a),.5*u),c=(0,o.vMul)((0,o.vNorm)(a),-.5*u);n.f=(0,o.vAdd)(n.f,l),i.f=(0,o.vAdd)(i.f,c)})),e=e.map((e=>(0,o.itrPhysics)(15,e))),e=e.map((e=>{const t=(0,o.vMul)(e.v,.5),n=(0,o.vLen)(t)>100?(0,o.vMul)((0,o.vNorm)(t),100):t;return{...e,v:n}})),u=e,n&&n({nodes:s(e),edges:a},l),l++}return{nodes:s(u),edges:a,itrs:l,timeout:l>=t,total:(0,o.totalEnergy)(u)}}},2036:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PinView=t.PIN_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=n(50382),d=n(18420),p=n(74762),f=n(30994),m=n(96233),h=n(66189),v=n(30653);t.PIN_HEIGHT=23;t.PinView=u.memo((function(e){const{selected:t,type:n,connected:o,optional:i,currentInsId:s,isClosestToMouse:r,id:g,onMouseDown:I,onMouseUp:b}=e,{history:y,resetHistory:C,refreshHistory:_}=(0,h.useHistoryHelpers)(s,g,n),x=(0,v.useDarkMode)(),N="input"===n?(0,p.getInputName)(g):(0,p.getOutputName)(g),w="input"===e.type&&(0,d.isDefined)(e.constValue)?e.constValue:void 0,j=u.useCallback((e=>{0===e.button&&I(g,n,e)}),[g,n,I]),E=u.useCallback((e=>{0===e.button&&b(g,n,e)}),[g,n,b]);return(0,a.jsxs)("div",{className:(()=>{if("input"===e.type){const{isSticky:s,constValue:a}=e;return(0,l.default)("pin",{sticky:s,selected:t,closest:r,optional:i,connected:o,"const-value":(0,d.isDefined)(a),"env-value":(0,d.isDefined)(a)&&(0,p.isEnvValue)(a),minimized:e.minimized,dark:x},n)}return(0,l.default)("pin",{selected:t,connected:o,closest:r,optional:i,minimized:e.minimized,"error-pin":g===p.ERROR_PIN_ID,dark:x},n)})(),"data-pin-id":g,children:[(0,a.jsx)(c.Tooltip,{className:"pin-info-tooltip",content:(()=>{const t=(0,h.calcHistoryContent)(y,"input"===n?e.queuedValues:void 0),o=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:N})," (",n,")"," "]}),o,(0,a.jsx)("hr",{}),(0,d.isDefined)(w)?(0,a.jsxs)("div",{children:["Static value:"," ",(0,a.jsx)("strong",{children:(0,m.valuePreview)(w).substring(0,200)})]}):t]})})(),children:(0,a.jsxs)(c.ContextMenu,{onMouseEnter:_,onMouseOut:C,onMouseDown:j,onMouseUp:E,"data-tip":"","data-html":!0,"data-for":g+e.currentInsId,id:(0,f.getPinDomId)({fullInsIdPath:(0,p.fullInsIdPath)(e.currentInsId,e.ancestorsInsIds),pinId:g,pinType:n,isMain:!1}),onDoubleClick:t=>e.onDoubleClick&&e.onDoubleClick(g,t),className:(0,l.default)("pin-inner",{dark:x}),onClick:t=>{const{onShiftClick:o,onClick:i,id:s}=e;t.shiftKey&&o?o(s,t):i(s,n,t)},content:(()=>{const t=(0,a.jsx)(c.MenuItem,{onClick:()=>e.onInspect(e.currentInsId,{id:e.id,type:e.type}),text:"Inspect"});if("input"===e.type){const{onConvertConstToEnv:n}=e;return(0,d.isDefined)(w)?(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onDetachConstValue(e.id),text:"Detach value"}),(0,a.jsx)(c.MenuItem,{onClick:()=>e.onCopyConstValue(e.id),text:"Copy value"}),(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null,n?(0,a.jsx)(c.MenuItem,{onClick:()=>n(e.id),text:"Convert to Env Var"}):null]}):(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onToggleSticky(e.id),text:"Toggle sticky (square means sticky)"}),t,(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null]})}return(0,a.jsx)(c.Menu,{children:t})})(),children:[N," ",(0,d.isDefined)(w)?(0,a.jsxs)(u.Fragment,{children:[":",(0,a.jsx)("span",{className:"value",children:(0,d.toString)(w)})]}):null,"input"===e.type&&e.isSticky?(0,a.jsx)("span",{className:"suffix",children:"s"}):null,"input"===e.type&&e.queueSize?(0,a.jsxs)("span",{className:"suffix",children:[e.queueSize," in Q"]}):null]})}),(0,a.jsx)("div",{className:"wire"})]})}))},66189:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHistoryHelpers=t.calcHistoryContent=void 0;const i=n(35250),s=n(96233),r=o(n(70079)),a=n(70079),u=n(98158);t.calcHistoryContent=(e,t)=>{if(e){const{total:n,lastSamples:o}=e,a=(0,i.jsxs)("strong",{children:["Activated ",n," times this session"]}),u=o.length>0?(0,i.jsxs)("div",{children:["Last value:"," ",(0,i.jsx)("strong",{children:(0,s.valuePreview)(o[0].val).substring(0,200)}),(0,i.jsx)("br",{}),(0,i.jsx)("em",{children:"Inspect instance for the full value"})]}):"",l=t?(0,i.jsx)(r.default.Fragment,{children:(0,i.jsxs)("div",{children:["Queued values: ",(0,i.jsx)("strong",{children:t})]})}):"";return(0,i.jsxs)(r.default.Fragment,{children:[a,u,l]})}return"Loading session data.."};t.useHistoryHelpers=(e,t,n)=>{const o=(0,a.useRef)(),{onRequestHistory:i}=(0,u.useDebuggerContext)(),[s,l]=(0,a.useState)();return{history:s,refreshHistory:(0,a.useCallback)((()=>{clearInterval(o.current),i(e,t,n).then((e=>{l(e)})),o.current=setInterval((()=>{i(e,t,n).then((e=>{l(e)}))}),500)}),[e,i,t,n]),resetHistory:r.default.useCallback((()=>{clearInterval(o.current),l(void 0)}),[])}}},89440:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAddMenu=void 0;const r=n(35250),a=s(n(70079)),u=n(74762),l=n(50382),c=n(70457),d=n(9958),p=n(86125),f=c.Select.ofType(),m=e=>{switch(e.type){case"node":return`${e.node.id}`;case"value":return"Add inline value or function";case"import":return`Import ${e.importableNode.node.id} from ${e.importableNode.module}`}},h=(e,t)=>{let{handleClick:n,modifiers:o,query:i}=t;if(!o.matchesPredicate)return null;const s=m(e);return"value"===e.type?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(l.MenuDivider,{}),(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))]}):(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))},v=(e,t,n,o)=>{const i=m(t).toLocaleLowerCase(),s=e.toLowerCase();return o?i===s:i.includes(s)};t.QuickAddMenu=e=>{const{resolvedDependencies:t,targetNode:n}=e,o={left:e.pos.x,top:e.pos.y},{onRequestImportables:i}=(0,p.useDependenciesContext)(),[s,c]=a.useState();a.useEffect((()=>{i().then((e=>c(e.importables)))}),[i]);const d=(0,u.values)({...t,[n.id]:n}),m=d.map((e=>({type:"node",node:e}))),g=new Set(d.map((e=>e.id))),I=s?s.filter((e=>!g.has(e.node.id))).map((e=>({type:"import",importableNode:e}))):[],b=m.concat(I).concat({type:"value"});return(0,r.jsx)("div",{className:"quick-add-menu",style:o,children:(0,r.jsx)(f,{className:"quick-add-nodes-select",items:b,itemPredicate:v,itemRenderer:h,inputProps:{className:"quick-add-input"},noResults:(0,r.jsx)(l.MenuItem,{disabled:!0,text:"No results."}),onItemSelect:t=>e.onAdd(t),popoverProps:{isOpen:!0,onClose:()=>e.onClose()}})})}},71033:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89440),t)},73470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimePlayer=void 0;const o=n(74762),i=n(64955),s=(0,o.debugLogger)("runtime-player");t.createRuntimePlayer=()=>{let e=0,t=[];let n=!1,r=Date.now(),a=e;const u=()=>requestAnimationFrame((()=>{const l=Date.now();a=e,e+=l-r,r=l,((e,n)=>{const r=t;t=[],r.length&&s(`Playing ${r.length} events from`,e,n),r.forEach((e=>{s("Playing event",e),(0,i.playEvent)(e),e.insId===o.ROOT_INS_ID&&e.type===o.DebuggerEventType.PROCESSING_CHANGE&&!1===e.val&&(s("Main instance is done processing, clearing runtime UI",e),c())}))})(a,e),n&&u()})),l=()=>{n=!1},c=()=>{document.querySelectorAll("[data-runtime]").forEach((e=>{e.removeAttribute("data-runtime")})),document.querySelectorAll("[data-runtime-queue]").forEach((e=>{e.removeAttribute("data-runtime-queue")})),t=[]};return{stop:l,start:function(t){void 0===t&&(t=0),n=!0,e=t,r=Date.now(),u()},addEvents:e=>{t.push(...e)},destroy:()=>{l(),c()},clear:c,status:()=>({running:n,currDt:e,lastDt:a,queue:t,last:r})}}},64955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playEvent=t.cancelTimers=void 0;const o=n(74762),i=n(30994),s=5e3,r=(0,o.debugLogger)("runtime-player:play-event"),a=(e,t)=>e.type===o.DebuggerEventType.INPUT_CHANGE||e.type===o.DebuggerEventType.OUTPUT_CHANGE?`${(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds)}.${e.pinId}`:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds);t.cancelTimers=new Map;t.playEvent=e=>{switch(e.type){case o.DebuggerEventType.INPUT_CHANGE:case o.DebuggerEventType.OUTPUT_CHANGE:{const{pinId:n,insId:u,ancestorsInsIds:l}=e,c=e.type===o.DebuggerEventType.INPUT_CHANGE?"input":"output",d=[(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!0})];u!==o.ROOT_INS_ID&&d.push((0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!1})),d.forEach(((i,l)=>{const c=a(e);clearTimeout(t.cancelTimers.get(c));const d=document.getElementById(i),p=`${u}.${n}`,f=e.type===o.DebuggerEventType.OUTPUT_CHANGE?document.querySelectorAll(`[data-from-id="${p}"]`):[];if(d){clearTimeout(t.cancelTimers.get(c)),d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),setTimeout((()=>{d.setAttribute("data-runtime","active"),f.forEach((e=>{e.setAttribute("data-runtime","active")}))}),0);const n=setTimeout((()=>{d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),t.cancelTimers.delete(c)}),s);t.cancelTimers.set(a(e),n)}else console.warn(`No DOM element with Id [${i}] found to play event`),r(`No DOM element with Id [${i}] found to play event`,e)}));break}case o.DebuggerEventType.PROCESSING_CHANGE:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(l)if(!0===e.val)l.setAttribute("data-runtime","processing"),clearTimeout(t.cancelTimers.get(u));else{l.removeAttribute("data-runtime"),setTimeout((()=>{"error"!==l.getAttribute("data-runtime")&&l.setAttribute("data-runtime","done")}),0);const e=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,e)}else r(`No DOM element with Id [${n}] found to play event`,e)}));break}case o.DebuggerEventType.ERROR:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(!l)return void r(`No DOM element with Id [${n}] found to play event`,e);clearTimeout(t.cancelTimers.get(u)),l.removeAttribute("data-runtime"),setTimeout((()=>{l.setAttribute("data-runtime","error")}));const c=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,c)}));const c={...e,type:o.DebuggerEventType.OUTPUT_CHANGE,pinId:o.ERROR_PIN_ID};(0,t.playEvent)(c);break}case o.DebuggerEventType.INPUTS_STATE_CHANGE:(0,o.entries)(e.val).forEach((t=>{let[n,s]=t;const{insId:a,ancestorsInsIds:u}=e,l=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(a,u),pinId:n,pinType:"input",isMain:!1}),c=document.getElementById(l);c?s>0?c.setAttribute("data-runtime-queue",`${s}`):c.removeAttribute("data-runtime-queue"):r(`No DOM element with Id [${l}] found to play event`,e)}))}}},25804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounce=void 0;const o=n(70079);t.useDebounce=function(e,t){const[n,i]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}},7047:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.handleChangeNodeInputType=t.handleIoPinRename=t.handleInstanceDrag=t.getInstancesInRect=t.isJsxValue=t.getMiddleOfViewPort=t.fitViewPortToNode=t.centerBoardPosOnTarget=t.renderedPosToLogicalPos=t.logicalPosToRenderedPos=t.getEffectiveNodeDimensions=t.calcNodesPositions=t.calcSelectionBoxArea=t.animateViewPort=t.easeInOutNum=t.easeInOutPos=t.easeInOutQuad=t.center=t.distance=t.clamp=t.domToViewPort=t.roundNumber=t.createNewNodeInstance=t.createNewInlineNodeInstance=t.parseInputOutputTypes=t.parsePromptValue=t.getSelectionBoxRect=t.findClosestPin=t.changePinConfig=t.getInstancePinConfig=t.emptyList=t.emptyObj=void 0;const r=s(n(53865)),a=n(30721),u=n(63521),l=n(74762),c=n(18243),d=n(74762),p=n(53159),f=n(83782),m=n(60190),h=n(38259),v=n(83651),g=n(41032);t.emptyObj={},t.emptyList=[],t.getInstancePinConfig=function(e,n,o){var i;const s=e.instances.find((e=>e.id===n));if(!s)throw new Error(`Instance ${n} not found`);return null!==(i=(s.inputConfig||t.emptyObj)[o])&&void 0!==i?i:(0,l.queueInputPinConfig)()};t.changePinConfig=(e,t,n,o)=>r.produce(e,(e=>{var i;const{instances:s}=e,r=s.find((e=>e.id===t));if(!r)throw new Error("blah");const a=null!==(i=r.inputConfig)&&void 0!==i?i:{};a[n]=o,e.instances=s.map((e=>e===r?{...r,inputConfig:a}:e))}));t.findClosestPin=(e,t,n,o,i,s,r)=>{const a=(0,l.nodeInstance)(e.id,e.id),u=(0,d.okeys)(e.inputs).map((e=>({id:e,type:"input",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),p=(0,d.okeys)(e.outputs).map((e=>({id:e,type:"output",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),f=[...u,...e.instances.reduce(((n,a)=>{const u=(0,g.safelyGetNodeDef)(a,t),d=(0,v.getVisibleInputs)(a,u,e.connections),p=(0,v.getVisibleOutputs)(a,u,e.connections);return[...n,...d.map((e=>({ins:a,type:"input",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!1}),id:e}))),...p.map((e=>({ins:a,type:"output",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!1}),id:e})))]}),[]),...p];let m={dis:1e5,item:f[0]};return f.forEach((e=>{const t=e.pos.x-n.x,o=e.pos.y-n.y,i=Math.sqrt(t*t+o*o);i{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x,t.x)-n,h:Math.max(e.y,t.y)-o}};t.parsePromptValue=e=>{if(null===e)return;const t=parseInt(e,10);let n=e;return t.toString()!=e||isNaN(t)||(n=t),n};t.parseInputOutputTypes=e=>{const[,t,n]=e.match(/node\((.+)\|(.+)\)/)||[],o=(0,d.entries)(JSON.parse(t)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]})),i=(0,d.entries)(JSON.parse(n)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]}));return{inputs:(0,d.fromEntries)(o),outputs:(0,d.fromEntries)(i)}};t.createNewInlineNodeInstance=function(e,t,n){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const o=(0,l.inlineNodeInstance)(`${e.id}-${(0,d.randomInt)(999)}`,e,{},{x:0,y:0}),i=(0,p.calcNodeWidth)(o,e),{x:s,y:r}=n,a={x:s-i/2,y:r+t};return{...o,pos:a}};t.createNewNodeInstance=function(e,t,n,o){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const i="string"==typeof e?(0,g.safelyGetNodeDef)(e,o):e;if(!i)throw new Error(`${e} node not found in resolvedNodes`);const s=(0,d.entries)(i.inputs).reduce(((e,t)=>{let[n,o]=t;return o.defaultValue&&(e[n]=(0,l.staticInputPinConfig)(o.defaultValue)),e}),{}),r=(0,l.nodeInstance)((0,a.createId)(),i.id,s,{x:0,y:0}),c=(0,p.calcNodeWidth)(r,i),{x:f,y:m}=n,h={x:f-c/2,y:m+t};return{...r,pos:h}};t.roundNumber=e=>Math.round(100*e)/100;t.domToViewPort=(e,n,o)=>({x:(0,t.roundNumber)(n.pos.x+e.x/n.zoom/o.zoom),y:(0,t.roundNumber)(n.pos.y+e.y/n.zoom/o.zoom)});t.clamp=(e,t,n)=>Math.max(e,Math.min(t,n));t.distance=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)};t.center=(e,t,n)=>{let{zoom:o}=n;const i=e.x+e.w/2,s=e.y+e.h/2,{w:r,h:a}=t;return{x:i-r/o/2,y:s-a/o/2}};t.easeInOutQuad=e=>e<.5?2*e*e:(4-2*e)*e-1;t.easeInOutPos=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i),a=(0,t.easeInOutQuad)(r),u=n.x-e.x,l=n.y-e.y;return{x:e.x+u*a,y:e.y+l*a}};t.easeInOutNum=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i);return e+(n-e)*(0,t.easeInOutQuad)(r)};t.animateViewPort=(e,n,o,i)=>{const s=(0,t.distance)(e.pos,n.pos),r=Date.now(),a=o;if(0===s)return void i(e);const u=()=>{const o=Date.now(),s=(0,t.easeInOutPos)(e.pos,n.pos,r,a,o),l=(0,t.easeInOutNum)(e.zoom,n.zoom,r,a,o);o-r{const n=(0,t.getSelectionBoxRect)(e.from,e.to);return n.h*n.w};const I=(e,t,n,o)=>({left:n.x,right:n.x+e,top:n.y,bottom:n.y+t,tag:o,center:(0,l.calcCenter)({w:e,h:t,...n})});t.calcNodesPositions=(e,t)=>[...e.instances.map((e=>{const n=(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,t)),o=u.NODE_HEIGHT;return I(n,o,e.pos,e.id)})),...(0,d.okeys)(e.inputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.inputsPosition[t]||{x:0,y:0};return I(n,o,i,"input_"+t)})),...(0,d.okeys)(e.outputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.outputsPosition[t]||{x:0,y:0};return I(n,o,i,"output"+t)}))];t.getEffectiveNodeDimensions=(e,n)=>{const o=(0,t.calcNodesPositions)(e,n),i=o[0]||{left:0,right:0,top:0,bottom:0},s=o.reduce(((e,t)=>t.leftt.right>e?t.right:e),i.right),a=o.reduce(((e,t)=>t.topt.bottom>e?t.bottom:e),i.bottom)-a,d={x:s,y:a};return{size:{width:u,height:c},pos:d,center:(0,l.calcCenter)({w:u,h:c,...d})}};t.logicalPosToRenderedPos=(e,t)=>{const n=(0,m.vSub)(e,t.pos);return(0,m.vMul)(n,t.zoom)};t.renderedPosToLogicalPos=(e,t)=>{const n=(0,m.vDiv)(e,t.zoom);return(0,m.vAdd)(t.pos,n)};t.centerBoardPosOnTarget=(e,n,o,i)=>{const s=(0,t.logicalPosToRenderedPos)(e,i),r=(0,t.renderedPosToLogicalPos)(s,{...i,zoom:o}),a=Math.max(e.x,r.x)-Math.min(e.x,r.x),u=Math.max(e.y,r.y)-Math.min(e.y,r.y);return{x:o>i.zoom?i.pos.x+a:i.pos.x-a,y:o>i.zoom?i.pos.y+u:i.pos.y-u}};t.fitViewPortToNode=function(e,n,o,i){void 0===i&&(i=[20,150]);const{size:s,center:r}=(0,t.getEffectiveNodeDimensions)(e,n),a=i[0],u=i[1],l=s.width+a,c=s.height+u,d=o.width/l,p=o.height/c,f=Math.min(d,p)/1.15,m=(0,t.clamp)(.3,1.2,f);return{zoom:m,pos:{x:r.x-o.width/2/m,y:r.y-o.height/2/m+20}}};t.getMiddleOfViewPort=(e,n)=>{const o={x:n.width/2,y:n.height/2};return(0,t.renderedPosToLogicalPos)(o,e)};t.isJsxValue=e=>{const t=e=>(0,d.isDefined)(e.ref)&&(0,d.isDefined)(e.type)&&(0,d.isDefined)(e.props);try{const n=JSON.parse(e);return t(n)||Array.isArray(n)&&t(n[0])}catch(n){return!1}};t.getInstancesInRect=(e,n,o,i,s,r,a)=>{const{from:c,to:d}=e,f=(0,t.getSelectionBoxRect)(c,d);return s.filter((e=>{const{pos:t}=e,i={...t,w:(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,n))*o.zoom*a.zoom,h:u.NODE_HEIGHT*o.zoom*a.zoom};return(0,l.intersectRect)(f,i)||(0,l.intersectRect)(i,f)})).map((e=>e.id))};t.handleInstanceDrag=(e,t,n,o,i,s)=>{o.preventDefault(),o.stopPropagation();const a=(0,m.vSub)(n,t.pos);let u;const l=r.produce(e,(e=>{const r=e.instances.find((e=>e.id===t.id));if(!r)throw new Error("impossible state dragging instance that does not exist");!o.shiftKey&&s&&(u=[s]);const l=e.instances.filter((e=>i.includes(e.id)&&e!==r)),c=[r,...l],d=(0,h.getLeafInstancesOfSelection)(c,e.instances,e.connections);[...l,...d].forEach((e=>{e.pos=(0,m.vAdd)(e.pos,a)})),r.pos=n,!o.shiftKey&&s&&(u=[s])}));return{newValue:l,newSelected:u}};t.handleIoPinRename=(e,t,n,o)=>r.produce(e,(e=>{"input"===t?(e.inputs[o]=e.inputs[n],e.inputsPosition[o]=e.inputsPosition[n],delete e.inputs[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===n?{...e,from:{...e.from,pinId:o}}:e))):(e.outputs[o]=e.outputs[n],e.outputsPosition[o]=e.outputsPosition[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===n?{...e,to:{...e.to,pinId:o}}:e)),e.completionOutputs=(e.completionOutputs||[]).map((e=>e.split("+").map((e=>e===n?o:n)).join("+"))),delete e.outputs[n])}));t.handleChangeNodeInputType=(e,t,n)=>r.produce(e,(e=>{const o=e.inputs[t];if(!o)throw new Error("Wat");o.mode=n}))},42403:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorClient=void 0;const i=n(74762),s=o(n(18706)),r=n(32048),a=n(31758),u=(0,i.debugLogger)("remote-debugger:editor-client");t.createEditorClient=(e,t)=>{const n=new URL(e),o=(0,r.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/editor`,timeout:3e4});return o.emit("join-room-editor",t),{emitChange:e=>{o.emit(a.DebuggerServerEventType.CHANGE_EVENT_NAME,e)},emitBreakpointsChange:e=>{o.emit(a.DebuggerServerEventType.UPDATE_BREAKPOINTS,e)},interceptInput:e=>{o.emit(a.DebuggerServerEventType.INPUT_VALUE_OVERRIDE,e)},interceptOutput:e=>{o.emit(a.DebuggerServerEventType.OUTPUT_VALUE_OVERRIDE,e)},onRuntimeReady:e=>(o.on(a.DebuggerServerEventType.RUNTIME_READY,e),()=>o.off(a.DebuggerServerEventType.RUNTIME_READY,e)),onChangeAwk:e=>(o.on(a.DebuggerServerEventType.CHANGE_AWK,e),()=>o.off(a.DebuggerServerEventType.CHANGE_AWK,e)),onChangeError:e=>(o.on(a.DebuggerServerEventType.CHANGE_ERROR,e),()=>o.off(a.DebuggerServerEventType.CHANGE_ERROR,e)),onIsAlive:e=>(o.on(a.DebuggerServerEventType.IS_ALIVE,e),()=>o.off(a.DebuggerServerEventType.IS_ALIVE,e)),emitInputValue:(e,t)=>{u(`Emitting push input value to ${e} %o`,t),o.emit(a.DebuggerServerEventType.PUSH_INPUT_VALUE,{pinId:e,value:t})},destroy:()=>{o.disconnect(),(0,a.enumToArray)(a.DebuggerServerEventType).forEach((e=>o.off(e)))},onDisconnect:e=>(o.on("disconnect",e),()=>o.off("disconnect",e)),debugInfo:()=>`Remote debugger for ${e}`,onBatchedEvents:e=>(o.on(a.DebuggerServerEventType.EVENTS_BATCH,e),()=>o.off(a.DebuggerServerEventType.EVENTS_BATCH,e)),requestState:()=>s.default.get(`${e}/state`).then((e=>e.data.state)),getHistory:n=>s.default.get(`${e}/history`,{params:{insId:n.insId,pinId:n.pinId,limit:n.limit,executionId:t}}).then((e=>e.data)),clearHistory:()=>s.default.delete(`${e}/history`).then((()=>{})),triggerNode:(t,n)=>s.default.post(`${e}/trigger`,{nodeId:t,inputs:n}).then((e=>e.data))}}},58066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeData=void 0;const o=n(74762),i=n(36783),s=(0,o.debugLogger)("remote-debugger:normalize-data");t.normalizeData=e=>{if(e instanceof Error)return(0,i.serializeError)(e);if("object"==typeof e&&null!==e){e={...e};const t=new WeakSet,n=e=>{if("bigint"==typeof e)return e.toString();if("object"!=typeof e||Array.isArray(e))return e;if(null===e)return e;if(t.has(e))return"[Circular]";try{t.add(e)}catch(o){s("Error adding to WeakSet","data:",e,"type:",typeof e,"error:",o)}if(Array.isArray(e))return e.map(n);if("object"==typeof e){const t={};for(const o in e)t[o]=n(e[o]);return t}return e};return n(e)}return e}},39641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimeClient=t.DEFAULT_DT_SCALE=void 0;const o=n(74762),i=n(32048),s=n(31758),r=n(58066),a=(0,o.debugLogger)("remote-debugger:runtime-client");t.DEFAULT_DT_SCALE=1;t.createRuntimeClient=(e,t)=>{const n=new URL(e),u=(0,i.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/runtime`,timeout:1e3,reconnectionAttempts:3});u.emit("join-room-runtime",t),u.on("connection",(e=>{e.join(t)}));let l=new Set;u.on(s.DebuggerServerEventType.UPDATE_BREAKPOINTS,(e=>{l=new Set(e)}));const c=(0,o.cappedArrayDebounce)((e=>{a(`Emitting debounced batched events - ${e.length}`),u.emit(s.DebuggerServerEventType.EVENTS_BATCH,e)}),100,200);return{onChange:e=>(u.on(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e),()=>u.off(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e)),onInput:e=>(u.on(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e),()=>u.off(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e)),emitEvent:e=>{a(`Emitting event ${e.type} change event of ${e.insId}`),e.val=(0,r.normalizeData)(e.val),c.addItem({...e,time:Date.now()})},emitRuntimeReady:()=>{u.emit(s.DebuggerServerEventType.RUNTIME_READY,{})},emitChangeAwk:()=>{u.emit(s.DebuggerServerEventType.CHANGE_AWK,{})},emitChangeError:e=>{u.emit(s.DebuggerServerEventType.CHANGE_ERROR,{error:e})},emitIsAlive:e=>{u.emit(s.DebuggerServerEventType.IS_ALIVE,{time:e})},destroy:async()=>{c.pendingItems()&&(c.flush(),await(0,o.delay)(100)),(0,s.enumToArray)(s.DebuggerServerEventType).forEach((e=>u.off(e))),u.disconnect()},onDisconnect:e=>(u.on("disconnect",e),()=>u.off("disconnect",e)),waitForConnection:()=>new Promise(((e,t)=>{u.connected?e():(u.on("connect_error",(e=>{t(`Socket connect error: ${e}`)})),u.on("connect",(()=>{e()})))}))}}},31758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerServerEventType=t.enumToArray=t.isNumber=t.isSimpleType=t.valuePreview=t.toString=void 0;const o=n(36783);t.toString=e=>{if("object"===typeof e){if(e instanceof Error)return JSON.stringify((0,o.serializeError)(e));try{return JSON.stringify(e).substr(0,250)}catch(t){return"Object (cannot stringify)"}}return`${e}`.substr(0,250)};t.valuePreview=e=>(0,t.toString)(e).substr(0,100);t.isSimpleType=e=>["number","string","boolean"].includes(typeof e);t.isNumber=e=>!1===isNaN(Number(e)),t.enumToArray=function(e){return Object.keys(e).filter(t.isNumber).map((t=>e[t]))},function(e){e.RUNTIME_READY="runtime-ready",e.CHANGE_EVENT_NAME="change",e.PUSH_INPUT_VALUE="push-input-value",e.CHANGE_AWK="live-change-awk",e.CHANGE_ERROR="live-change-error",e.IS_ALIVE="is-alive",e.UPDATE_BREAKPOINTS="update-breakpoints",e.INPUT_VALUE_OVERRIDE="input-value-override",e.OUTPUT_VALUE_OVERRIDE="output-value-override",e.INPUT_VALUE_CHANGE="input-value-changed",e.OUTPUT_VALUE_CHANGE="output-value-changed",e.PROCESSING_CHANGE="processing-changed",e.INPUTS_STATE_CHANGE="inputs-state-changed",e.NODE_ERROR="node-error",e.EVENTS_BATCH="events-batch"}(t.DebuggerServerEventType||(t.DebuggerServerEventType={}))},96233:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31758),t),i(n(42403),t),i(n(39641),t)},43920:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Equals=t.EqualsBoolean=t.Throttle=t.ThrottleError=t.Debounce=t.Interval=t.Delay=t.Switch4=t.Switch2=t.Switch3=t.EmitOnTrigger=t.BooleanSplit=t.Subscribe=t.Publish=t.RoundRobin4=t.RoundRobin2=t.RoundRobin3=t.LimitTimes=void 0;const o=n(11253),i="Control Flow";t.LimitTimes={id:"Limit Times",namespace:i,description:"Item will be emitted until the limit is reached",inputs:{item:{mode:"required",description:"The item to emit"},times:{mode:"required",description:"The number of times to emit the item"},reset:{mode:"optional",description:"Reset the counter"}},outputs:{ok:{}},reactiveInputs:["item","reset"],completionOutputs:[],run:function(e,t,n){const{state:o}=n,{item:i,times:s,reset:r}=e,{ok:a}=t;if(void 0!==r)return void o.set("val",0);let u=o.get("val")||0;u++,o.set("val",u),u>=s?n.onError(new Error(`Limit of ${s} reached`)):a.next(i)}},t.RoundRobin3={id:"Round Robin 3",namespace:i,description:"Item will be emitted to one of the three outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r}=t,a=o.get("curr")||0,u=(a+1)%3;[i,s,r][a].next(e.item),o.set("curr",u)}},t.RoundRobin2={namespace:i,id:"Round Robin 2",description:"Item will be emitted to one of the 2 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s}=t,r=o.get("curr")||0,a=(r+1)%2;[i,s][r].next(e.item),o.set("curr",a)}},t.RoundRobin4={id:"Round Robin 4",namespace:i,description:"Item will be emitted to one of the 4 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves to "r4"\'s turn.'},r4:{description:'The fourth output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r,r4:a}=t,u=o.get("curr")||0,l=(u+1)%4;[i,s,r,a][u].next(e.item),o.set("curr",l)}},t.Publish={id:"Publish",namespace:i,description:"Publishes a value by a key to all listeners in the current flow. Use 'Subscribe' to listen to events.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},value:{mode:"required"}},outputs:{},run:function(e,t,n){const i=`${n.ancestorsInsIds}__${e.key}`;o.publish(i,e.value)}},t.Subscribe={id:"Subscribe",namespace:i,description:"Subscribes to a value published by a key. Use 'Publish' to publish values.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},initial:{mode:"required-if-connected",description:"If passed will be published has the first value"}},completionOutputs:[],outputs:{value:{description:"The value published by the key"}},run:function(e,t,n){const{value:i}=t,s=`${n.ancestorsInsIds}__${e.key}`,r=o.subscribe(s,((e,t)=>{i.next(t)}));void 0!==e.initial&&i.next(e.initial),n.onCleanup((()=>{o.unsubscribe(r)}))}},t.BooleanSplit={namespace:i,id:"Boolean Split",description:"Splits a boolean value into two outputs",inputs:{value:{mode:"required",description:"Boolean value"},trueValue:{mode:"required-if-connected",description:"Value to emit if the input is true. Defaults to true"},falseValue:{mode:"required-if-connected",description:"Value to emit if the input is false. Defaults to false"}},outputs:{true:{description:"The value is true"},false:{description:"The value is false"}},run:function(e,t){const{true:n,false:o}=t,{value:i,trueValue:s,falseValue:r}=e;i?n.next(null==s||s):o.next(null!=r&&r)}},t.EmitOnTrigger={namespace:i,id:"Emit on Trigger",description:"Emits the value when the trigger input receives any value",inputs:{value:{mode:"required",description:"The value to emit"},trigger:{mode:"required",description:"The trigger to emit the value"}},outputs:{result:{description:"The value emitted"}},run:function(e,t){const{result:n}=t,{value:o,trigger:i}=e;void 0!==i&&n.next(o)}},t.Switch3={namespace:i,id:"Switch 3",description:"Switches between 3 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,default:s,outputValue:r}=t,{value:a,firstCase:u,secondCase:l,thirdCase:c}=e;a===u?n.next(null!=r?r:a):a===l?o.next(null!=r?r:a):a===c?i.next(null!=r?r:a):s.next(null!=r?r:a)}},t.Switch2={id:"Switch 2",description:"Switches between 2 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,default:i,outputValue:s}=t,{value:r,firstCase:a,secondCase:u}=e;r===a?n.next(null!=s?s:r):r===u?o.next(null!=s?s:r):i.next(null!=s?s:r)}},t.Switch4={id:"Switch 4",description:"Switches between 4 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},fourthCase:{mode:"required",description:"The value to switch on for the fourth output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},fourth:{description:"The value emitted if the input value is equal to the fourth case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,fourth:s,default:r,outputValue:a}=t,{value:u,firstCase:l,secondCase:c,thirdCase:d,fourthCase:p}=e;u===l?n.next(null!=a?a:u):u===c?o.next(null!=a?a:u):u===d?i.next(null!=a?a:u):u===p?s.next(null!=a?a:u):r.next(null!=a?a:u)}},t.Delay={id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:i,description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:async(e,t)=>{let{value:n,delay:o}=e,{delayedValue:i}=t;await new Promise((e=>setTimeout(e,o))),i.next(n)}},t.Interval={id:"Interval",namespace:i,defaultStyle:{icon:"fa-clock"},description:"Emits a value every interval",inputs:{value:{description:"Value to emit"},interval:{description:"Interval in milliseconds"}},reactiveInputs:["value","interval"],outputs:{value:{description:"Emitted value"}},completionOutputs:[],run:(e,t,n)=>{n.state.get("timer")&&clearInterval(n.state.get("timer"));const o=setInterval((()=>{t.value.next(e.value)}),e.interval);n.state.set("timer",o),n.onCleanup((()=>{clearInterval(o)}))}},t.Debounce={id:"Debounce",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be debounced"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The debounced value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the last value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:s}=t,r=n.state.get("timer");r&&clearTimeout(r);const a=setTimeout((()=>{s.next(o)}),i);n.state.set("timer",a),n.onCleanup((()=>{clearTimeout(r)}))}};class s extends Error{constructor(e){super("Throttle: Value dropped"),this.value=e}}t.ThrottleError=s,t.Throttle={id:"Throttle",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be throttled"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The throttled value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the first value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:r}=t;if(n.state.get("timer"))n.onError(new s(o));else{r.next(o);const e=setTimeout((()=>{n.state.set("timer",null)}),i);n.state.set("timer",e)}}},t.EqualsBoolean={id:"Equals (Bool)",defaultStyle:{icon:"fa-equals"},namespace:i,description:"Emits true if two values are equal (=== equality). Otherwise emits false.",inputs:{a:{description:"First value"},b:{description:"Second value"}},outputs:{result:{description:"true if a is equal to b"}},run:(e,t)=>{let{a:n,b:o}=e,{result:i}=t;return i.next(n===o)}},t.Equals={id:"Equals",namespace:i,description:'Emits the value of "a" to output "true" if "a" is equal to "b". Otherwise emits the value of "a" to output "false".',inputs:{a:{mode:"required",description:"First value"},b:{mode:"required",description:"Second value"}},outputs:{true:{description:"Emits the value of a if a is equal to b"},false:{description:"Emits the value of a if a is not equal to b"}},run:(e,t)=>{const{a:n,b:o}=e,{true:i,false:s}=t;n===o?i.next(n):s.next(n)}}},45888:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SumList=t.LessThanOrEqual=t.LessThan=t.GreaterThanOrEqual=t.GreaterThan=t.ToPrecision=t.ToExponential=t.ToFixed=t.ParseFloat=t.ParseInt=t.Max=t.Min=t.Cos=t.Sin=t.Truncate=t.Round=t.Ceiling=t.Floor=t.AbsoluteValue=t.SquareRoot=t.Power=t.Modulo=t.Divide=t.Multiply=t.Subtract=t.Add=void 0;const n="Numbers";t.Add={id:"Add",defaultStyle:{icon:"fa-plus"},namespace:n,description:"Emits the sum of two numbers",inputs:{n1:{description:"First number to add"},n2:{description:"Second number to add"}},outputs:{sum:{description:"The sum of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{sum:i}=t;return i.next(n+o)}},t.Subtract={id:"Subtract",defaultStyle:{icon:"fa-minus"},namespace:n,description:"Emits the difference of two numbers",inputs:{n1:{description:"First number to subtract"},n2:{description:"Second number to subtract"}},outputs:{difference:{description:"The difference of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{difference:i}=t;return i.next(n-o)}},t.Multiply={id:"Multiply",defaultStyle:{icon:"fa-times"},namespace:n,description:"Emits the product of two numbers",inputs:{n1:{description:"First number to multiply"},n2:{description:"Second number to multiply"}},outputs:{product:{description:"The product of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{product:i}=t;return i.next(n*o)}},t.Divide={id:"Divide",defaultStyle:{icon:"fa-divide"},namespace:n,description:"Emits the quotient of two numbers",inputs:{n1:{description:"First number to divide"},n2:{description:"Second number to divide"}},outputs:{quotient:{description:"The quotient of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{quotient:i}=t;return i.next(n/o)}},t.Modulo={id:"Modulo",defaultStyle:{icon:"fa-percentage"},namespace:n,description:"Emits the remainder of two numbers",inputs:{n1:{description:"First number to divide"},n2:{description:"Second number to divide"}},outputs:{remainder:{description:"The remainder of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{remainder:i}=t;return i.next(n%o)}},t.Power={id:"Power",defaultStyle:{icon:"fa-superscript"},namespace:n,description:"Emits the power of two numbers",inputs:{n1:{description:"Base number"},n2:{description:"Exponent"}},outputs:{power:{description:"The power of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{power:i}=t;return i.next(Math.pow(n,o))}},t.SquareRoot={id:"Square Root",defaultStyle:{icon:"fa-square-root-alt"},namespace:n,description:"Emits the square root of a number",inputs:{n:{description:"Number to take the square root of"}},outputs:{root:{description:"The square root of n"}},run:(e,t)=>{let{n:n}=e,{root:o}=t;return o.next(Math.sqrt(n))}},t.AbsoluteValue={id:"Absolute Value",defaultStyle:{icon:"fa-abs"},namespace:n,description:"Emits the absolute value of a number",inputs:{n:{description:"Number to take the absolute value of"}},outputs:{absolute:{description:"The absolute value of n"}},run:(e,t)=>{let{n:n}=e,{absolute:o}=t;return o.next(Math.abs(n))}},t.Floor={id:"Floor",defaultStyle:{icon:"fa-floor"},namespace:n,description:"Emits the floor of a number",inputs:{n:{description:"Number to take the floor of"}},outputs:{floor:{description:"The floor of n"}},run:(e,t)=>{let{n:n}=e,{floor:o}=t;return o.next(Math.floor(n))}},t.Ceiling={id:"Ceiling",defaultStyle:{icon:"fa-ceiling"},namespace:n,description:"Emits the ceiling of a number",inputs:{n:{description:"Number to take the ceiling of"}},outputs:{ceiling:{description:"The ceiling of n"}},run:(e,t)=>{let{n:n}=e,{ceiling:o}=t;return o.next(Math.ceil(n))}},t.Round={id:"Round",defaultStyle:{icon:"fa-round"},namespace:n,description:"Emits the rounded value of a number",inputs:{n:{description:"Number to round"}},outputs:{rounded:{description:"The rounded value of n"}},run:(e,t)=>{let{n:n}=e,{rounded:o}=t;return o.next(Math.round(n))}},t.Truncate={id:"Truncate",defaultStyle:{icon:"fa-truncate"},namespace:n,description:"Emits the truncated value of a number",inputs:{n:{description:"Number to truncate"}},outputs:{truncated:{description:"The truncated value of n"}},run:(e,t)=>{let{n:n}=e,{truncated:o}=t;return o.next(Math.trunc(n))}},t.Sin={id:"Sin",defaultStyle:{icon:"fa-sin"},namespace:n,description:"Emits the sine of an angle",inputs:{angle:{description:"Angle in radians"}},outputs:{sine:{description:"The sine of angle"}},run:(e,t)=>{let{angle:n}=e,{sine:o}=t;return o.next(Math.sin(n))}},t.Cos={id:"Cos",defaultStyle:{icon:"fa-cos"},namespace:n,description:"Emits the cosine of an angle",inputs:{angle:{description:"Angle in radians"}},outputs:{cosine:{description:"The cosine of angle"}},run:(e,t)=>{let{angle:n}=e,{cosine:o}=t;return o.next(Math.cos(n))}},t.Min={id:"Min",namespace:n,description:"Emits the minimum of two numbers",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{min:{description:"The minimum of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{min:i}=t;return i.next(Math.min(n,o))}},t.Max={id:"Max",namespace:n,description:"Emits the maximum of two numbers",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{max:{description:"The maximum of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{max:i}=t;return i.next(Math.max(n,o))}},t.ParseInt={id:"Parse Int",namespace:n,description:"Emits the integer value of a string",inputs:{str:{description:"String to parse"}},outputs:{int:{description:"The integer value of str"}},run:(e,t)=>{let{str:n}=e,{int:o}=t;return o.next(parseInt(n))}},t.ParseFloat={id:"Parse Float",namespace:n,description:"Emits the float value of a string",inputs:{str:{description:"String to parse"}},outputs:{float:{description:"The float value of str"}},run:(e,t)=>{let{str:n}=e,{float:o}=t;return o.next(parseFloat(n))}},t.ToFixed={id:"To Fixed",namespace:n,description:"Emits the specified number of decimal places of a number",inputs:{number:{description:"Number to format"},places:{description:"Number of decimal places to format to"}},outputs:{fixed:{description:"The number with the specified number of decimal places"}},run:(e,t)=>{let{number:n,places:o}=e,{fixed:i}=t;return i.next(n.toFixed(o))}},t.ToExponential={id:"To Exponential",namespace:n,description:"Emits the specified number of decimal places of a number in exponential notation",inputs:{number:{description:"Number to format"},places:{description:"Number of decimal places to format to"}},outputs:{exponential:{description:"The number with the specified number of decimal places in exponential notation"}},run:(e,t)=>{let{number:n,places:o}=e,{exponential:i}=t;return i.next(n.toExponential(o))}},t.ToPrecision={id:"To Precision",namespace:n,description:"Emits the specified number of significant figures of a number",inputs:{number:{description:"Number to format"},places:{description:"Number of significant figures to format to"}},outputs:{precision:{description:"The number with the specified number of significant figures"}},run:(e,t)=>{let{number:n,places:o}=e,{precision:i}=t;return i.next(n.toPrecision(o))}},t.GreaterThan={id:"Greater Than",namespace:n,description:"Emits true if the first number is greater than the second",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{result:{description:"true if n1 is greater than n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{result:i}=t;return i.next(n>o)}},t.GreaterThanOrEqual={id:"Greater Than Or Equal",namespace:n,description:"Emits true if the first number is greater than or equal to the second",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{result:{description:"true if n1 is greater than or equal to n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{result:i}=t;return i.next(n>=o)}},t.LessThan={id:"Less Than",namespace:n,description:"Emits true if the first number is less than the second",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{result:{description:"true if n1 is less than n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{result:i}=t;return i.next(n{let{n1:n,n2:o}=e,{result:i}=t;return i.next(n<=o)}},t.SumList={id:"Sum List",defaultStyle:{icon:"fa-plus"},namespace:n,description:"Emits the sum of a list of numbers",inputs:{list:{description:"List of numbers"}},outputs:{sum:{description:"The sum of the numbers in list"}},run:(e,t)=>{let{list:n}=e,{sum:o}=t;return o.next(n.reduce(((e,t)=>e+t),0))}}},65645:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var o=n(70079),i=n(11253),s=n(74089),r=n(74762),a=n(21766);var u=n(10831),l=n(61997),c=n(77852);const d=(0,a.S)(),p=[0,20],f=e=>{let{flow:t,output:n,inputs:o,onError:s,debugDelay:a,onCompleted:u,dependencies:l,player:c}=e;const p=((e,t)=>{const n=new Set;return{onEvent:o=>{const i={...o,time:Date.now(),executionId:"n/a"};console.info("Got debugger event",o),t.addEvents([i]),e.addEvents([i]),n.forEach((e=>e([i])))},onBatchedEvents:e=>(n.add(e),()=>n.delete(e))}})(c,d);p.debugDelay=a;const f=(0,r.keys)(t.node.outputs)[0];return{executeResult:(0,r.execute)({node:t.node,inputs:o,outputs:{[f]:n},resolvedDeps:{...l,[t.node.id]:t.node},_debugger:p,onCompleted:u,onBubbleError:e=>{s(e)},extraContext:{PubSub:i}}),localDebugger:p}},m=e=>{const{debugDelay:t,onOutput:i,flowProps:a}=e,{flow:m,inputs:h,output:v}=a,g=(0,o.useRef)((0,s.createRuntimePlayer)()),[I,b]=(0,o.useState)(e.flowProps.dependencies),[y,C]=(0,o.useState)(),[_]=(0,s.useDebounce)(I,500),x=(0,c.useDarkMode)(),N=async(e,t)=>{const{node:o}=e,i=Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).find((e=>(0,r.isBaseNode)(e)&&e.id===o.id));let a;b((e=>({...e,[i.id]:{...i,source:{path:"@flyde/stdlib/dist/all-browser",export:i.id}}})));const l=(0,u.ZP)(m,(n=>{if(t){const o=(0,s.vAdd)({x:0,y:0},t.pos);if(a=(0,s.createNewNodeInstance)(e.node,0,o,I),n.node.instances.push(a),t.connectTo){const{insId:e,outputId:o}=t.connectTo;n.node.connections.push({from:{insId:e,pinId:o},to:{insId:a.id,pinId:r.TRIGGER_PIN_ID}})}}}));await new Promise((e=>setTimeout(e,10)));const c=(0,u.ZP)(j,(e=>{e.flow=l,t?.selectAfterAdding&&a&&(e.boardData.selected=[a?.id])}));return E(c),(0,s.toastMsg)(`Node ${o.id} successfully imported from ${e.module}`),I},w=async()=>({importables:Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).filter(r.isBaseNode).map((e=>({node:{...e,source:{path:"n/a",export:"n/a"}},module:"@flyde/stdlib"}))),errors:[]}),[j,E]=(0,o.useState)({flow:m,boardData:{viewPort:{pos:{x:0,y:0},zoom:1},lastMousePos:{x:0,y:0},selected:[]}});(0,o.useEffect)((()=>{E((e=>({...e,flow:m})))}),[m]),(0,o.useEffect)((()=>{b((e=>({...e,main:j.flow.node})))}),[j.flow.node]);const P={state:j,onChangeEditorState:E,hideTemplatingTips:!0,initialPadding:p,onExtractInlineNode:r.noop,disableScrolling:!0,darkMode:x.isDarkMode};(0,o.useEffect)((()=>{g.current.start()}),[]),(0,o.useEffect)((()=>{const{executeResult:n,localDebugger:o}=f({flow:j.flow,dependencies:I,output:v,inputs:h,onError:r.noop,debugDelay:t,player:g.current,onCompleted:e.onCompleted}),s=e.flowProps.output.subscribe((e=>i(e)));return C(o),()=>{n(),s.unsubscribe()}}),[t,_]);const O=(0,o.useMemo)((()=>({resolvedDependencies:I,onImportNode:N,onRequestImportables:w})),[]),S=(0,o.useMemo)((()=>({debuggerClient:y,onRequestHistory:d.requestHistory})),[y]);return o.createElement(l.Z,null,(()=>o.createElement(s.DependenciesContextProvider,{value:O},o.createElement(s.DebuggerContextProvider,{value:S},o.createElement(s.FlowEditor,P)))))}},21766:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var o=n(74762);const i=200,s=()=>{const e=new Map,t=new Map;return{requestHistory:async(n,s,r)=>{const a="input"===r?o.DebuggerEventType.INPUT_CHANGE:o.DebuggerEventType.OUTPUT_CHANGE;if(console.log({insId:n,pinId:s,type:a}),s){const t=`${n}.${s}.${a}`,o=e.get(t)||{total:0,lastSamples:[]},r=o.lastSamples.slice(0,i);return{...o,lastSamples:r}}{const e=t.get(n)||{total:0,lastSamples:[]},o=e.lastSamples.slice(0,i);return{...e,lastSamples:o}}},addEvents:n=>{n.forEach((n=>{if(n.type===o.DebuggerEventType.ERROR){const e=n;e.type=o.DebuggerEventType.OUTPUT_CHANGE,e.pinId=o.ERROR_PIN_ID}if(n.type===o.DebuggerEventType.INPUT_CHANGE||n.type===o.DebuggerEventType.OUTPUT_CHANGE){const{insId:o,type:s,pinId:r}=n;{const t=`${o}.${r}.${s}`,a=e.get(t)||{total:0,lastSamples:[]};a.lastSamples.unshift(n),a.lastSamples.length>i&&a.lastSamples.splice(i,a.lastSamples.length-i),a.total++,e.set(t,a)}{const s=t.get(o)||{total:0,lastSamples:[]};s.lastSamples.unshift(n),s.lastSamples.length>i&&s.lastSamples.splice(i,s.lastSamples.length-i),s.total++,e.set(o,s)}}}))}}}},4144:(e,t,n)=>{"use strict";n.d(t,{V:()=>r});var o=n(10328),i=n(70079);const s=e=>i.createElement("li",{className:"log-item"},i.createElement("main",{className:"content"},e.value),i.createElement("aside",null,new Date(e.time).toLocaleTimeString())),r=e=>{const[t,n]=i.useState([]);return i.useEffect((()=>{e.output.subscribe((e=>{const t="object"==typeof e&&i.isValidElement(e)?e:`${e}`;n((e=>[...e,{value:t,time:Date.now()}]))}))}),[]),i.createElement("div",{className:"output-log"},i.createElement("header",null,"Output Log"," ",i.createElement("button",{className:"clear-btn button button--outline button--secondary button--sm",onClick:()=>n([])},"Clear")),i.createElement("main",null,i.createElement("ul",null,t.map(((e,t)=>i.createElement(s,(0,o.Z)({},e,{key:t}))))),0===t.length?i.createElement("div",{className:"empty-state"},"Nothing to show. Interact with the example to emit some outputs!"):null))}},79256:(e,t,n)=>{"use strict";n.d(t,{I:()=>p});var o=n(70079),i=n(65092),s=n(19841),r=n(49794),a=n(21766),u=n(73949),l=n(81098),c=n(65645);(0,a.S)();const d=[{title:"Hello World",key:"hello-world"},{title:"React Counter",key:"react-counter"},{title:"BMI Calculator",key:"bmi"},{title:"REST API Usage",key:"apis"},{title:"Debounce vs. Throttling",key:"debounce-throttling"},{title:"Fibonacci Seq.",key:"fibonacci"}],p=e=>{const[t,n]=(0,o.useState)(e.initWidth||500),[a,p]=(0,o.useState)(e.defaultDelay||0),[f,m]=(0,o.useState)(!1),h=(0,o.useCallback)(((e,t)=>{let{size:o}=t;n(o.width)}),[]),v=o.createElement("div",{className:"delay-container"},o.createElement("input",{type:"range",id:"volume",name:"delay",value:a,step:"100",min:"0",max:"300",onChange:e=>p(Number(e.target.value))}),o.createElement("label",{htmlFor:"volume"},"Debug Delay: ",a,"ms")),g=d.findIndex((t=>t.key===e.meta.key)),I=d[g+1],b=d[g-1];return o.createElement(i.Z,{title:`${e.meta.title} | Playground`,description:`Flyde Playground - ${e.meta.title} example`},o.createElement("header",{className:(0,s.default)("hero hero--primary",u.Z.heroBanner,"playground-hero")},o.createElement("div",{className:"container"},o.createElement("h1",{className:"hero__title"},"Welcome to Flyde's Online Playground"),o.createElement("p",{className:"hero__subtitle"},"Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!"))),o.createElement("div",{className:"mobile-warning"},"Flyde is currently not optimized for mobile devices. Please"," ",o.createElement("strong",null,"use a desktop computer for the best experience"),"."),o.createElement("ul",{className:"examples__menu"},d.map((e=>o.createElement("li",{key:e.key},o.createElement(r.Z,{to:`/playground/${e.key}`,className:"button button--primary"},e.title))))),o.createElement("div",{className:"playground-container"},o.createElement("header",null,o.createElement("h2",{className:"playground-title"},e.meta.title),o.createElement("div",{className:"playground-description"},e.meta.description),f?o.createElement(o.Fragment,null,o.createElement("hr",null),o.createElement("div",{className:"playground-extra"},e.extraInfo||e.meta.extraInfo,o.createElement("div",{className:"star-hint"},o.createElement("span",null,"\xa0 PS: Did you like this example?"),"Please consider giving a \u2b50\ufe0f to the project"," ",o.createElement("span",{className:"star-wrapper"},o.createElement("iframe",{className:"gh-stars-frame",src:"https://ghbtns.com/github-btn.html?user=flydelabs&repo=flyde&type=star&count=true&size=small",width:100,height:20,title:"GitHub Stars"}))))):null,e.prefixComponent),o.createElement("div",{className:"playground"},o.createElement("div",{className:"flow-container"},!0!==e.hideDelay?v:null,o.createElement(c.Y,{flowProps:e.flowProps,debugDelay:a,onOutput:()=>m(!0)})),o.createElement(l.Resizable,{height:0,width:t,onResize:h,handle:o.createElement("div",{className:"handle"}),axis:"x",resizeHandles:["w"]},o.createElement("div",{className:"output-container",style:{flexBasis:t}},e.children))),o.createElement("nav",{className:"pagination-nav"},o.createElement("div",{className:"pagination-nav__item"},b?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${b.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Previous Example"),o.createElement("div",{className:"pagination-nav__label"},b.title)):null),o.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},I?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${I.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Next Example"),o.createElement("div",{className:"pagination-nav__label"},I.title)):null))))}},29863:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var o=n(70079),i=n(74762),s=n(79256);const r={dependencies:{Equals:{id:"Equals",namespace:"Control Flow",description:'Emits the value of "a" to output "true" if "a" is equal to "b". Otherwise emits the value of "a" to output "false".',inputs:{a:{mode:"required",description:"First value"},b:{mode:"required",description:"Second value"}},outputs:{true:{description:"Emits the value of a if a is equal to b"},false:{description:"Emits the value of a if a is not equal to b"}},run:n(43920).Equals.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Equals"}},Add:{id:"Add",defaultStyle:{icon:"fa-plus"},namespace:"Numbers",description:"Emits the sum of two numbers",inputs:{n1:{description:"First number to add"},n2:{description:"Second number to add"}},outputs:{sum:{description:"The sum of n1 and n2"}},run:n(45888).Add.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Numbers.flyde.js",export:"Add"}},Subtract:{id:"Subtract",defaultStyle:{icon:"fa-minus"},namespace:"Numbers",description:"Emits the difference of two numbers",inputs:{n1:{description:"First number to subtract"},n2:{description:"Second number to subtract"}},outputs:{difference:{description:"The difference of n1 and n2"}},run:n(45888).Subtract.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Numbers.flyde.js",export:"Subtract"}}},flow:{imports:{"@flyde/stdlib":["Equals","Subtract","Add"]},node:{instances:[{pos:{x:-104.50461669921879,y:-75.81374603271485},id:"Equals-364",inputConfig:{compare:{mode:"static",value:0},b:{mode:"static",value:0}},visibleInputs:["a","b"],nodeId:"Equals",style:{size:"small"}},{pos:{x:6.480124511718742,y:26.28670257568359},id:"Equals-364-d95",inputConfig:{compare:{mode:"static",value:1},b:{mode:"static",value:1}},visibleInputs:["a","b"],nodeId:"Equals",style:{size:"small"}},{pos:{x:124.14777221679688,y:360.9365419006348},id:"Add-539",inputConfig:{},nodeId:"Add",style:{size:"small",icon:"calculator",color:"#fee440"}},{pos:{x:51.170103759765624,y:141.94213226318357},id:"Subtract-210",inputConfig:{n2:{mode:"static",value:1}},visibleInputs:["n1"],nodeId:"Subtract",style:{size:"small",icon:"calculator",color:"#f15bb5"}},{pos:{x:205.81573364257815,y:141.28181961059568},id:"Subtract-210-d215",inputConfig:{n2:{mode:"static",value:2}},visibleInputs:["n1"],nodeId:"Subtract",style:{size:"small",icon:"calculator",color:"#f15bb5"}},{pos:{x:41.46757568359375,y:225.79922363281253},id:"Fibonacci-261",inputConfig:{},nodeId:"Fibonacci"},{pos:{x:192.5062255859375,y:225.06153114318846},id:"Fibonacci-379",inputConfig:{},nodeId:"Fibonacci"}],connections:[{from:{insId:"Fibonacci-261",pinId:"result"},to:{insId:"Add-539",pinId:"n1"}},{from:{insId:"Fibonacci-379",pinId:"result"},to:{insId:"Add-539",pinId:"n2"}},{from:{insId:"Add-539",pinId:"sum"},to:{insId:"__this",pinId:"result"}},{from:{insId:"Subtract-210",pinId:"difference"},to:{insId:"Fibonacci-261",pinId:"n"}},{from:{insId:"Subtract-210-d215",pinId:"difference"},to:{insId:"Fibonacci-379",pinId:"n"}},{from:{insId:"__this",pinId:"n"},to:{insId:"Equals-364",pinId:"a"}},{from:{insId:"Equals-364",pinId:"false"},to:{insId:"Equals-364-d95",pinId:"a"}},{from:{insId:"Equals-364",pinId:"true"},to:{insId:"__this",pinId:"result"}},{from:{insId:"Equals-364-d95",pinId:"true"},to:{insId:"__this",pinId:"result"}},{from:{insId:"Equals-364-d95",pinId:"false"},to:{insId:"Subtract-210",pinId:"n1"}},{from:{insId:"Equals-364-d95",pinId:"false"},to:{insId:"Subtract-210-d215",pinId:"n1"}}],id:"Fibonacci",inputs:{n:{mode:"required",type:"any"}},outputs:{result:{type:"any",optional:!1,delayed:!1}},inputsPosition:{n:{x:-104.99845545326623,y:-160.94874894405714}},outputsPosition:{result:{x:-27.155817068877212,y:518.2526309988291}},completionOutputs:["result"],defaultStyle:{size:"large",color:"#00bbf9"}}}};var a=n(4144);const u={title:"Fibonacci Sequence",description:'This example showcases a classical recursion - the Fibonacci sequence. On numbers higher than 1, the "Fibonacci" node calls itself recursively!',key:"fibonacci",extraInfo:"Cool right? everything is editable, so try changing the algorithm and see how it affects the end result!"},l=e=>{const t=(0,i.dynamicOutput)();return t.subscribe(e),t};function c(){const[e,t]=(0,o.useState)(4),[n,c]=(0,o.useState)(5),d=(0,o.useRef)(l((e=>c(e)))),p=(0,o.useRef)({n:(0,i.dynamicNodeInput)()}),[f,m]=(0,o.useState)({flow:r.flow,dependencies:r.dependencies,inputs:p.current,output:d.current}),h=(0,o.useCallback)((e=>()=>{-1===e&&(e=Number(prompt("N?")),isNaN(e)||e<0)?alert("Invalid input. Please try again using a positive integer"):(e<=8||confirm("This is an unoptimized Fib. calculator and larger numbers might take a long time to calculate. Are you sure?"))&&p.current.n.subject.next(e)}),[e]),v=o.createElement("div",null,o.createElement("button",{className:"fib-btn button button--outline button--primary button-sm",onClick:h(0)},"Calc Fib(0)"),o.createElement("button",{className:"fib-btn button button--outline button--primary button-sm",onClick:h(1)},"Calc Fib(1)"),o.createElement("button",{className:"fib-btn button button--outline button--primary button-sm",onClick:h(3)},"Calc Fib(3)"),o.createElement("button",{className:"fib-btn button button--outline button--primary button-sm",onClick:h(5)},"Calc Fib(5)"),o.createElement("button",{className:"fib-btn button button--outline button--primary button-sm",onClick:h(-1)},"Calc Fib(N)"));return o.createElement(s.I,{meta:u,flowProps:f,defaultDelay:100,prefixComponent:v},o.createElement(a.V,{output:d.current}))}},73949:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={"flyde-flow-editor":"flyde-flow-editor_AAD4",_hj_feedback_container:"_hj_feedback_container_Af03"}},85721:(e,t,n)=>{var o={"./af":47654,"./af.js":47654,"./ar":61325,"./ar-dz":98344,"./ar-dz.js":98344,"./ar-kw":26230,"./ar-kw.js":26230,"./ar-ly":42524,"./ar-ly.js":42524,"./ar-ma":44119,"./ar-ma.js":44119,"./ar-sa":82625,"./ar-sa.js":82625,"./ar-tn":42182,"./ar-tn.js":42182,"./ar.js":61325,"./az":37093,"./az.js":37093,"./be":32721,"./be.js":32721,"./bg":59919,"./bg.js":59919,"./bm":95594,"./bm.js":95594,"./bn":563,"./bn-bd":41757,"./bn-bd.js":41757,"./bn.js":563,"./bo":73211,"./bo.js":73211,"./br":87438,"./br.js":87438,"./bs":83662,"./bs.js":83662,"./ca":61196,"./ca.js":61196,"./cs":5841,"./cs.js":5841,"./cv":85251,"./cv.js":85251,"./cy":24512,"./cy.js":24512,"./da":37539,"./da.js":37539,"./de":5059,"./de-at":53853,"./de-at.js":53853,"./de-ch":99378,"./de-ch.js":99378,"./de.js":5059,"./dv":91454,"./dv.js":91454,"./el":39651,"./el.js":39651,"./en-au":87953,"./en-au.js":87953,"./en-ca":98193,"./en-ca.js":98193,"./en-gb":61980,"./en-gb.js":61980,"./en-ie":14050,"./en-ie.js":14050,"./en-il":6502,"./en-il.js":6502,"./en-in":555,"./en-in.js":555,"./en-nz":11372,"./en-nz.js":11372,"./en-sg":26568,"./en-sg.js":26568,"./eo":69533,"./eo.js":69533,"./es":68327,"./es-do":17620,"./es-do.js":17620,"./es-mx":96467,"./es-mx.js":96467,"./es-us":83272,"./es-us.js":83272,"./es.js":68327,"./et":68523,"./et.js":68523,"./eu":19066,"./eu.js":19066,"./fa":59087,"./fa.js":59087,"./fi":96443,"./fi.js":96443,"./fil":93979,"./fil.js":93979,"./fo":90383,"./fo.js":90383,"./fr":56327,"./fr-ca":25610,"./fr-ca.js":25610,"./fr-ch":97274,"./fr-ch.js":97274,"./fr.js":56327,"./fy":67442,"./fy.js":67442,"./ga":44291,"./ga.js":44291,"./gd":77342,"./gd.js":77342,"./gl":96248,"./gl.js":96248,"./gom-deva":21404,"./gom-deva.js":21404,"./gom-latn":20833,"./gom-latn.js":20833,"./gu":9122,"./gu.js":9122,"./he":74623,"./he.js":74623,"./hi":60364,"./hi.js":60364,"./hr":30860,"./hr.js":30860,"./hu":70441,"./hu.js":70441,"./hy-am":90425,"./hy-am.js":90425,"./id":29672,"./id.js":29672,"./is":96150,"./is.js":96150,"./it":27852,"./it-ch":55603,"./it-ch.js":55603,"./it.js":27852,"./ja":16465,"./ja.js":16465,"./jv":20120,"./jv.js":20120,"./ka":87245,"./ka.js":87245,"./kk":21479,"./kk.js":21479,"./km":65038,"./km.js":65038,"./kn":63060,"./kn.js":63060,"./ko":85020,"./ko.js":85020,"./ku":90582,"./ku.js":90582,"./ky":34950,"./ky.js":34950,"./lb":94201,"./lb.js":94201,"./lo":87894,"./lo.js":87894,"./lt":70120,"./lt.js":70120,"./lv":4265,"./lv.js":4265,"./me":14030,"./me.js":14030,"./mi":9463,"./mi.js":9463,"./mk":25898,"./mk.js":25898,"./ml":64233,"./ml.js":64233,"./mn":47156,"./mn.js":47156,"./mr":34479,"./mr.js":34479,"./ms":24691,"./ms-my":6456,"./ms-my.js":6456,"./ms.js":24691,"./mt":81789,"./mt.js":81789,"./my":37452,"./my.js":37452,"./nb":91170,"./nb.js":91170,"./ne":87529,"./ne.js":87529,"./nl":81776,"./nl-be":24455,"./nl-be.js":24455,"./nl.js":81776,"./nn":34705,"./nn.js":34705,"./oc-lnc":36139,"./oc-lnc.js":36139,"./pa-in":17960,"./pa-in.js":17960,"./pl":1899,"./pl.js":1899,"./pt":31670,"./pt-br":29159,"./pt-br.js":29159,"./pt.js":31670,"./ro":55115,"./ro.js":55115,"./ru":45149,"./ru.js":45149,"./sd":81231,"./sd.js":81231,"./se":35397,"./se.js":35397,"./si":99786,"./si.js":99786,"./sk":39383,"./sk.js":39383,"./sl":68691,"./sl.js":68691,"./sq":34826,"./sq.js":34826,"./sr":40080,"./sr-cyrl":75673,"./sr-cyrl.js":75673,"./sr.js":40080,"./ss":54309,"./ss.js":54309,"./sv":52245,"./sv.js":52245,"./sw":8967,"./sw.js":8967,"./ta":10454,"./ta.js":10454,"./te":35204,"./te.js":35204,"./tet":81571,"./tet.js":81571,"./tg":15737,"./tg.js":15737,"./th":41786,"./th.js":41786,"./tk":50511,"./tk.js":50511,"./tl-ph":14828,"./tl-ph.js":14828,"./tlh":62422,"./tlh.js":62422,"./tr":97047,"./tr.js":97047,"./tzl":90792,"./tzl.js":90792,"./tzm":67730,"./tzm-latn":59963,"./tzm-latn.js":59963,"./tzm.js":67730,"./ug-cn":42535,"./ug-cn.js":42535,"./uk":33151,"./uk.js":33151,"./ur":22750,"./ur.js":22750,"./uz":61914,"./uz-latn":60231,"./uz-latn.js":60231,"./uz.js":61914,"./vi":55517,"./vi.js":55517,"./x-pseudo":64078,"./x-pseudo.js":64078,"./yo":70046,"./yo.js":70046,"./zh-cn":81832,"./zh-cn.js":81832,"./zh-hk":90953,"./zh-hk.js":90953,"./zh-mo":38236,"./zh-mo.js":38236,"./zh-tw":71001,"./zh-tw.js":71001};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=s,e.exports=i,i.id=85721}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2710],{19121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cappedArrayDebounce=void 0;t.cappedArrayDebounce=function(e,t,n,o){void 0===o&&(o=500);let i=[],s=null,r=null;return{addItem:a=>{clearTimeout(s),i.push(a),r||(r=setTimeout((()=>{e(i),clearTimeout(s),r=null}),o)),i.length>=n?(e(i),clearTimeout(r),r=null,i=[]):s=setTimeout((()=>{e(i),clearTimeout(r),r=null,i=[]}),t)},flush:()=>{i.length&&(e(i),i=[],clearTimeout(r))},pendingItems:()=>i.length}}},59792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.dataShaper=t.DataShapeType=void 0,function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.ARRAY=3]="ARRAY",e[e.OBJECT=4]="OBJECT",e[e.NULL=5]="NULL",e[e.UNSUPPORTED=6]="UNSUPPORTED"}(n=t.DataShapeType||(t.DataShapeType={}));const o={string:n.STRING,number:n.NUMBER,boolean:n.BOOLEAN,object:n.OBJECT,array:n.ARRAY,null:n.NULL,symbol:n.UNSUPPORTED,undefined:n.UNSUPPORTED,function:n.UNSUPPORTED,bigint:n.UNSUPPORTED};t.dataShaper=function(e,n,i){void 0===n&&(n=5),void 0===i&&(i=5);const s=null===(r=e)?"null":typeof r;var r,a;if("object"===s){if(Array.isArray(e))return n>1?e.filter(((e,t)=>t(0,t.dataShaper)(e,n-1,i))):o.array;if(n>1){const o={};for(const s in e)o[s]=(0,t.dataShaper)(e[s],n-1,i);return a=o,Object.keys(a).sort().reduce(((e,t)=>(e[t]=a[t],e)),{})}return o.object}return o[s]}},23046:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.debugLogger=void 0;const i=(0,o(n(55899)).default)("flyde");t.debugLogger=e=>i.extend(e)},24331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullInsIdPath=void 0,t.fullInsIdPath=function(e,t){if(!e)throw new Error("insId is not defined");return t?`${t}.${e}`:e}},34459:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hashFlow=t.hashNode=void 0;const i=o(n(68805)),s=n(30292),r=e=>(0,i.default)(e);t.hashNode=function(e,t){var n;void 0===t&&(t=!0);const{id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l}=e,c={id:o,completionOutputs:i,reactiveInputs:a,inputs:u,outputs:l};if((0,s.isVisualNode)(e)){const{instances:n,connections:o,inputsPosition:i,outputsPosition:s}=e,a=n.map((e=>{const{pos:t,...n}=e;return n})),u=t?{}:{inputsPosition:i,outputsPosition:s},l=t?a:n;l.sort(((e,t)=>e.id.localeCompare(t.id)));const d=[...o];d.sort(((e,t)=>{const n=`${e.from.insId}.${e.from.pinId}`,o=`${t.from.insId}.${t.from.pinId}`;return n.localeCompare(o)}));const p=JSON.stringify({instancesToUse:l,conns:d,...c,maybeIoPos:u});return r(p)}if((0,s.isInlineValueNode)(e)){const{customViewCode:t}=e,o=null!==(n=e.fnCode)&&void 0!==n?n:e.runFnRawCode,i=JSON.stringify({fnCode:o,customViewCode:t,...c});return r(i)}throw new Error("Hashing code nodes unsupported")};t.hashFlow=e=>{const{node:n,imports:o}=e,i=(0,t.hashNode)(n,!1),s=Object.entries(null!=o?o:{}).sort(((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)})).map((e=>{let[t,n]=e;return[t,n.sort()]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{}),a=JSON.stringify(s);return r(i+a)}},86873:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DepGraph=void 0,i(n(3172),t),i(n(59962),t),i(n(23046),t),i(n(19121),t),i(n(59962),t),i(n(34459),t),i(n(39043),t),i(n(59792),t),i(n(24331),t),t.DepGraph=n(60359).DepGraph},3172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testDataCreator=void 0;t.testDataCreator=e=>function(t){void 0===t&&(t={});return{..."function"==typeof e?e():e,...t}}},59962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplePluralize=t.eventually=t.delay=t.noop=t.removeDupes=t.ensure=t.isOptionalType=t.callFnOrFnPromise=t.isPromise=t.isDefined=t.containsAll=t.shuffle=t.randomInts=t.repeat=t.pickRandom=t.randomPos=t.randomInt=t.pickSecond=t.pickFirst=t.fromEntries=t.entries=t.okeys=t.values=t.keys=t.filterOMap=t.mapOMap=t.middlePos=t.calcCenter=t.intersectRect=void 0;t.intersectRect=(e,t)=>{const n=e.x+e.w,o=t.x+t.w;return!(t.x>n||oe.y+e.h||t.y+t.h{let{w:t,h:n,x:o,y:i}=e;return{x:o+t/2,y:i+n/2}};t.middlePos=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});t.mapOMap=(e,n)=>(0,t.entries)(e).map((e=>{let[t,o]=e;return[t,n(t,o)]})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.filterOMap=(e,n)=>(0,t.entries)(e).filter((e=>{let[t,o]=e;return n(t,o)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.keys=e=>Object.keys(e);t.values=e=>Object.values(e),t.okeys=t.keys;t.entries=e=>(0,t.okeys)(e).map((t=>[t,e[t]]));t.fromEntries=e=>e.reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.pickFirst=e=>e[0];t.pickSecond=e=>e[1];t.randomInt=function(e,t){void 0===t&&(t=0);const n=Math.random();return t+Math.floor((e-t)*n)};t.randomPos=function(e,n){void 0===e&&(e=1e3),void 0===n&&(n=0);return{x:(0,t.randomInt)(e,n),y:(0,t.randomInt)(e,n)}};t.pickRandom=e=>e[(0,t.randomInt)(e.length)];t.repeat=(e,t)=>"x".repeat(e).split("").map(((e,n)=>t(n)));t.randomInts=function(e,n,o){return void 0===n&&(n=100),void 0===o&&(o=0),(0,t.repeat)(e,(()=>(0,t.randomInt)(n,o)))};t.shuffle=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t};t.containsAll=(e,t)=>t.every((t=>e.includes(t)));t.isDefined=e=>void 0!==e;t.isPromise=e=>e&&"function"==typeof e.then;t.callFnOrFnPromise=(e,n)=>{if(!(0,t.isDefined)(e))return;const o=e=>{try{e()}catch(t){console.error(n,t)}};"function"==typeof e?o(e):Promise.resolve(e).then((e=>{"function"==typeof e&&o(e)}))};t.isOptionalType=e=>/\?$/.test(e);t.ensure=(e,t)=>{if(void 0===e)throw new Error(t||"Undefined value passed");return e};t.removeDupes=e=>Array.from(new Set(e));t.noop=()=>{};t.delay=e=>new Promise((t=>setTimeout(t,e)));t.eventually=async function(e,n,o,i){if(void 0===n&&(n=1e3),void 0===o&&(o=100),void 0===i&&(i=new Set),n<0){const e=Array.from(i).reduce(((e,t,n)=>`${e}\n\t\t${n+1}. ${t}`),"");throw new Error(`[Eventually timeout exceeded after: timeout with error]: ${e}`)}try{await e()}catch(s){const r=Date.now();await(0,t.delay)(o);const a=Date.now()-r;return i.add(null==s?void 0:s.message),(0,t.eventually)(e,n-a,o,i)}},t.simplePluralize=function(e,t){return`${e} ${t}${1!==e?"s":""}`}},39043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileObjectTemplate=t.compileStringTemplate=void 0;t.compileStringTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=new RegExp("\\$\\{"+e+"\\}","g");n=n.replace(i,o)})),n};t.compileObjectTemplate=(e,t)=>{let n=decodeURIComponent(e);return Object.keys(t).forEach((e=>{const o=t[e],i=JSON.stringify(o),s=new RegExp('"\\$\\$\\{'+e+'\\}"',"g"),r=new RegExp("\\$\\{"+e+"\\}","g"),a="string"==typeof o?o.replace(/"/g,((e,t,n)=>"\\"!==n[t-1]?'\\"':n[t])):o;n=n.replace(s,i).replace(r,a).replace(/\n/g,"\\n")})),JSON.parse(n)}},69150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connection=t.connectionData=t.connectionDataEquals=t.connectionNodeEquals=t.connectionNode=t.externalConnectionNode=t.isInternalConnection=t.isExternalConnection=t.isInternalConnectionNode=t.isExternalConnectionNode=t.getNodeOutputs=t.getOutputName=t.getInputName=t.getNodeInputs=t.TRIGGER_PIN_ID=t.ERROR_PIN_ID=t.THIS_INS_ID=void 0;const o=n(30292);t.THIS_INS_ID="__this",t.ERROR_PIN_ID="__error",t.TRIGGER_PIN_ID="__trigger";t.getNodeInputs=e=>({...e.inputs,[t.TRIGGER_PIN_ID]:(0,o.nodeInput)()});t.getInputName=e=>e===t.TRIGGER_PIN_ID?"Trigger Node":e;t.getOutputName=e=>e===t.ERROR_PIN_ID?"Error":e;t.getNodeOutputs=e=>({...e.outputs,[t.ERROR_PIN_ID]:(0,o.nodeOutput)()});t.isExternalConnectionNode=e=>e&&e.insId===t.THIS_INS_ID;t.isInternalConnectionNode=e=>e.insId!==t.THIS_INS_ID;t.isExternalConnection=e=>{let{from:n,to:o}=e;return(0,t.isExternalConnectionNode)(n)||(0,t.isExternalConnectionNode)(o)};t.isInternalConnection=e=>!(0,t.isExternalConnection)(e);t.externalConnectionNode=e=>({insId:t.THIS_INS_ID,pinId:e});t.connectionNode=(e,t)=>({insId:e,pinId:t});t.connectionNodeEquals=(e,t)=>e.insId===t.insId&&e.pinId===t.pinId;t.connectionDataEquals=(e,n)=>!(!e||!n)&&((0,t.connectionNodeEquals)(e.from,n.from)&&(0,t.connectionNodeEquals)(e.to,n.to)),t.connectionData=function(e,n,o){const i="string"==typeof e?e.split("."):e,s="string"==typeof n?n.split("."):n;if(i.length>2||s.length>2)throw new Error(`invalid source or target to connection data - ${e} / ${n}`);return{from:2===i.length?(0,t.connectionNode)(i[0],i[1]):(0,t.externalConnectionNode)(i[0]),to:2===s.length?(0,t.connectionNode)(s[0],s[1]):(0,t.externalConnectionNode)(s[0]),delayed:o}};t.connection=function(e,t,n){return void 0===n&&(n=!1),{from:e,to:t,delayed:n}}},6775:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;const s=n(30292),r=n(47025),a=n(86873),u=n(69150);i(n(69150),t);t.connect=function(e,t,n,o,i,l,c,d){void 0===n&&(n={}),void 0===i&&(i={}),void 0===l&&(l=a.noop),void 0===c&&(c={}),void 0===d&&(d={});const{id:p,connections:f,instances:m}=e,h=p||"connected-node"+(0,a.randomInt)(999);return{inputs:e.inputs,outputs:e.outputs,id:h,completionOutputs:e.completionOutputs,reactiveInputs:e.reactiveInputs,run:(p,v)=>{let g=[];const I=new a.DepGraph({}),b=new Map,y=new Map,C=new Map,_=new Map,x=new Map,N=new Map;let w;const j=new Set;m.forEach((e=>{const n=(0,s.getNode)(e,t),o=e.id;b.set(e,o),y.set(o,e),I.addNode(o);const i=Object.keys(n.inputs),r=Object.keys(n.outputs),a={},l={};i.forEach((t=>{const n=(e.inputConfig||{})[t]||(0,s.queueInputPinConfig)();(0,s.isStaticInputPinConfig)(n)?a[t]=(0,s.staticNodeInput)(n.value):a[t]=(0,s.dynamicNodeInput)({config:n})})),a[u.TRIGGER_PIN_ID]=(0,s.dynamicNodeInput)({config:(0,s.queueInputPinConfig)()});if(f.some((t=>(0,u.isInternalConnectionNode)(t.to)&&t.to.insId===e.id&&t.to.pinId===u.TRIGGER_PIN_ID))&&e.inputConfig&&e.inputConfig[u.TRIGGER_PIN_ID])throw"Trigger connection can not be configured";r.forEach((e=>{const t=(0,s.dynamicOutput)();l[e]=t}));f.some((t=>(0,u.isInternalConnectionNode)(t.from)&&t.from.insId===e.id&&t.from.pinId===u.ERROR_PIN_ID))&&(l[u.ERROR_PIN_ID]=(0,s.dynamicOutput)()),C.set(o,a),_.set(o,l)}));const E=new Set;return f.forEach((n=>{const{from:o,to:i}=n,{insId:r,pinId:a}=o,{insId:l,pinId:c}=i,d=_.get(r),p=C.get(l);if((0,u.isInternalConnectionNode)(i)&&E.add(`${i.insId}.${i.pinId}`),(0,u.isExternalConnection)(n)){if((0,u.isExternalConnectionNode)(o)){const e=null==p?void 0:p[i.pinId];if(!e)throw new Error(`Input ${i.pinId} of instance ${l} not found`);const t=x.get(o.pinId)||[];t.push(e),x.set(o.pinId,t)}else{let e=null==d?void 0:d[o.pinId];if(!e)throw new Error(`Output ${o.pinId} of instance ${r} not found`);const t=N.get(i.pinId)||[];t.push(e),N.set(i.pinId,t)}return}if(!d)throw new Error(`No outputs found for instance [${r}]`);if(!p)throw y.has(l)?new Error(`No inputs found for instance [${l}]`):new Error(`Instance with id [${l}] does not exist!`);const f=d[a];if(!f)throw new Error(`Output source - [${a}] not found in node [${h}]`);const m=p[c],v=y.get(r);if(!v&&r!==u.THIS_INS_ID)throw new Error(`Instance [${r}] does not exist! failed to connect [${o}] -> [${i}]`);const b=(v?(0,s.getNode)(v,t):e).outputs[a];if(b&&b.delayed||n.delayed||r!==u.THIS_INS_ID&&l!==u.THIS_INS_ID&&I.addDependency(r,l),!m)throw new Error(`Target arg - [${i}] not found in node [${h}]`);const w=f.subscribe((async e=>{if(!(0,s.isDynamicInput)(m))throw console.info(m),new Error(`Impossible state listening to non dynamic input - ${l}.${c}`);m.subject.next(e)}));g.push((()=>w.unsubscribe()))})),(0,a.okeys)(v).forEach((e=>{(N.get(e)||[]).forEach((t=>{const n=t.subscribe((async t=>{if(!v[e])throw new Error(`Impossible state - output ${e} does not exist`);v[e].next(t)}));g.push((()=>n.unsubscribe()))}))})),I.overallOrder().map((e=>y.get(e))).forEach((e=>{const a=C.get(e.id),u=_.get(e.id),p=(0,s.getNode)(e,t);if(!a)throw new Error(`Unexpected error - args not found when running ${e}`);if(!u)throw new Error(`Unexpected error - outputs not found when running ${e}`);for(const t in a){const n=e.inputConfig[t];E.has(`${e.id}.${t}`)||(0,s.isStaticInputPinConfig)(n)||delete a[t]}const f=(0,r.execute)({node:p,inputs:a,outputs:u,resolvedDeps:t,_debugger:n,insId:e.id,extraContext:d,mainState:i,ancestorsInsIds:o,onBubbleError:l,onCompleted:()=>{return t=e.id,j.delete(t),void(0===j.size&&w&&w());var t},onStarted:()=>{return t=e.id,void j.add(t);var t},env:c});g.push(f)})),Object.keys(p).forEach((async e=>{(x.get(e)||[]).forEach((t=>{const n=p[e];if(!(0,s.isDynamicInput)(t))throw new Error(`Unsure what to do with key ${e}, input: ${t} of ins ${o}`);(0,a.isDefined)(n)&&t.subject.next(n)}))})),void 0===e.completionOutputs&&j.size>0?new Promise((e=>{w=e})):()=>g.forEach((e=>{try{e()}catch(t){console.error("error unsubscribing",t)}}))}}}},26488:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MINOR_DEBUGGER_EVENT_TYPES=t.MAJOR_DEBUGGER_EVENT_TYPES=t.DebuggerEventType=void 0,function(e){e.INPUT_CHANGE="i",e.OUTPUT_CHANGE="o",e.PROCESSING_CHANGE="pc",e.ERROR="err",e.INPUTS_STATE_CHANGE="isc"}(n=t.DebuggerEventType||(t.DebuggerEventType={})),t.MAJOR_DEBUGGER_EVENT_TYPES=[n.INPUT_CHANGE,n.OUTPUT_CHANGE,n.ERROR],t.MINOR_DEBUGGER_EVENT_TYPES=[n.PROCESSING_CHANGE,n.INPUTS_STATE_CHANGE]},43686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatEvent=void 0;const o=n(26488);t.formatEvent=function(e){var t,n,i;const s=[e.insId,...null!==(n=null===(t=e.ancestorsInsIds)||void 0===t?void 0:t.split("."))&&void 0!==n?n:[]];(null===(i=e.ancestorsInsIds)||void 0===i?void 0:i.length)>0&&e.ancestorsInsIds;const r=`Node <${e.nodeId}> `,a=`(${s.join(" -> ")})`;return`${r} - ${function(e){switch(e.type){case o.DebuggerEventType.PROCESSING_CHANGE:return e.val?"started processing":"stopped processing";case o.DebuggerEventType.INPUT_CHANGE:return`Input pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.OUTPUT_CHANGE:return`Output pin <${e.pinId}> changed to ${e.val}`;case o.DebuggerEventType.INPUTS_STATE_CHANGE:return`Inputs queue size changed to ${Object.entries(e.val).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join(", ")}`;case o.DebuggerEventType.ERROR:return`Error: ${e.val}`}}(e)} ${a}`}},99896:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26488),t),i(n(43686),t)},47025:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.GLOBAL_STATE_NS=t.ROOT_INS_ID=t.INPUTS_STATE_SUFFIX=t.INNER_STATE_SUFFIX=void 0;const s=n(62600),r=n(87794);i(n(99896),t);const a=n(30292),u=n(6775),l=n(84479),c=n(86873),d=n(23046),p=n(30292),f=n(99896),m=n(79804);t.INNER_STATE_SUFFIX="_inner",t.INPUTS_STATE_SUFFIX="_inputs";t.ROOT_INS_ID="__root",t.GLOBAL_STATE_NS="____global";t.execute=e=>{let{node:n,inputs:o,outputs:i,resolvedDeps:h,_debugger:v={},insId:g=t.ROOT_INS_ID,extraContext:I={},mainState:b={},ancestorsInsIds:y,onBubbleError:C=s.noop,env:_={},onCompleted:x=s.noop,onStarted:N=s.noop}=e;const w=[];b[t.GLOBAL_STATE_NS]||(b[t.GLOBAL_STATE_NS]=new Map);const j={...I,ENV:_},E=(0,m.customNodesToNodesCollection)(h,j),P=e=>{const t=e instanceof a.NodeInstanceError?e:new a.NodeInstanceError(e,(0,c.fullInsIdPath)(g,y),n.id);v.onEvent&&v.onEvent({type:f.DebuggerEventType.ERROR,val:t,insId:g,ancestorsInsIds:y,nodeId:n.id}),i[u.ERROR_PIN_ID]?i[u.ERROR_PIN_ID].next(t):C(t)},O=(e=>(0,a.isVisualNode)(e)?(0,u.connect)(e,E,v,(0,c.fullInsIdPath)(g,y),b,P,_,I):(0,a.isInlineValueNode)(e)?(0,m.inlineValueNodeToNode)(e,j):e)(n),S=v.onEvent||s.noop,D={},M={};(0,c.entries)(o).forEach((e=>{let[t,o]=e;if((0,a.isDynamicInput)(o)){const e=(0,a.dynamicNodeInput)({config:o.config}),i=o.subject.subscribe((async o=>{const i=S({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o,ancestorsInsIds:y,nodeId:n.id});if(i){const t=await i.valuePromise;e.subject.next(t)}else v.debugDelay&&await(0,c.delay)(v.debugDelay),e.subject.next(o)}));w.push((()=>i.unsubscribe())),M[t]=e}else{S({type:f.DebuggerEventType.INPUT_CHANGE,insId:g,pinId:t,val:o.config.value,ancestorsInsIds:y,nodeId:n.id});const e=(0,a.staticNodeInput)((0,a.getStaticValue)(o.config.value,E,g));M[t]=e}})),(0,c.entries)(i).forEach((e=>{let[t,o]=e;const i=(0,a.dynamicOutput)(),s=i.subscribe((async e=>{const i=S({type:f.DebuggerEventType.OUTPUT_CHANGE,insId:g,pinId:t,val:e,ancestorsInsIds:y,nodeId:n.id});if(i){const e=await i.valuePromise;o.next(e)}else o.next(e)}));w.push((()=>s.unsubscribe())),D[t]=i}));const T=(e=>{var n,o;const{node:i,inputs:u,outputs:m,resolvedDeps:h,_debugger:v,insId:g,ancestorsInsIds:I,mainState:b,onError:y,onStarted:C,onCompleted:_,env:x,extraContext:N}=e,{run:w,fn:j}=i,E=(0,d.debugLogger)("core"),P=[];let O;const S=(null==v?void 0:v.onEvent)||s.noop,D=(0,c.fullInsIdPath)(g,I),M=`${D}${t.INNER_STATE_SUFFIX}`,T=`${D}${t.INPUTS_STATE_SUFFIX}`,k=E.extend(D),R=b[t.GLOBAL_STATE_NS];b[M]||(b[M]=new Map),b[T]||(b[T]=new Map);let A=null!==(n=b[T])&&void 0!==n?n:new Map;const V=()=>{const e=Array.from(A.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:(0,a.isQueueInputPinConfig)(u[n].config)?null==o?void 0:o.length:1}}),{});S({type:f.DebuggerEventType.INPUTS_STATE_CHANGE,val:e,insId:g,ancestorsInsIds:I,nodeId:i.id})},$={execute:(e,n,o,i)=>(0,t.execute)({node:e,inputs:n,outputs:o,resolvedDeps:h,_debugger:v,insId:i,onCompleted:_,onStarted:C}),insId:g,state:null!==(o=b[M])&&void 0!==o?o:new Map,onCleanup:e=>{P.push(e)},onError:e=>{y(e)},context:null!=N?N:{},ancestorsInsIds:I,globalState:R};let z,H=!1;const F=(i.reactiveInputs||[]).filter((e=>{var t;return!(0,p.isStaticInputPinConfig)(null===(t=u[e])||void 0===t?void 0:t.config)})),L=()=>{var e;null===(e=b[M])||void 0===e||e.clear(),(0,c.keys)(b).filter((e=>e.startsWith(`${D}.`))).forEach((e=>{b[e]=new Map}))},q=e=>{const t=(null==e?void 0:e.key)&&F.includes(null==e?void 0:e.key);if(H&&!t);else{const o=H&&t;if((0,l.isNodeStateValid)(u,A,i)||o){let t;if(H){if(!e)throw new Error("Unexpected state, got reactive node while not processing and not valid");const n=(0,l.pullValueForExecution)(e.key,u[e.key],A,x);t={...z,[e.key]:n},V()}else t=(0,l.pullValuesForExecution)(u,A,x),z=t,V();let o=new Set,s={};if(H=!0,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),i.completionOutputs){const e=i.completionOutputs.map((e=>e.split("+"))).reduce(((e,t)=>(t.forEach((n=>{e.set(n,t)})),e)),new Map);(0,c.entries)(m).forEach((t=>{let[n,a]=t;a.pipe((0,r.first)()).subscribe((t=>{o.add(n),s[n]=t;let r=e.get(n);r&&(r.splice(r.indexOf(n),1),0===r.length&&(H=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_&&_(s),L(),(0,c.callFnOrFnPromise)(O,`Error with cleanup function of ${i.id}`),O=void 0,o.clear(),s={},(0,l.hasNewSignificantValues)(u,A,x,i.id)&&q()))}))}))}else(0,c.entries)(m).forEach((e=>{let[t,n]=e;n.subscribe((e=>{s[t]=e}))}));try{k("Running node %s with values %o",i.id,t),C&&C(),O=(null!=j?j:w)(t,m,$),(0,c.isPromise)(O)?O.then((()=>{void 0===i.completionOutputs&&_&&(H=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_(s),L(),(0,l.hasNewSignificantValues)(u,A,x,i.id)&&q())})).catch((e=>{y(e),H=!1,k("Error in node %s - value %e",i.id,e),S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id})})):void 0===i.completionOutputs&&_&&(H=!1,S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id}),_(s),L())}catch(n){y(n),H=!1,k("Error in node %s - value %e",i.id,n),S({type:f.DebuggerEventType.PROCESSING_CHANGE,val:H,insId:g,ancestorsInsIds:I,nodeId:i.id})}const d=F.find((e=>u[e]&&(0,l.peekValueForExecution)(e,u[e],A,x,i.id)));if(d){const e=(0,l.peekValueForExecution)(d,u[d],A,x,i.id);q({key:d,value:e})}else{const e=(0,c.entries)(u).find((e=>{let[t,n]=e;const o=(0,a.isQueueInputPinConfig)(n.config),s=(0,l.peekValueForExecution)(t,n,A,x,i.id);return!!o&&(0,c.isDefined)(s)}));if(e){const[t,n]=e,o=(0,l.peekValueForExecution)(t,n,A,x,i.id);q({key:t,value:o})}}}}};q();const G=(0,l.subscribeInputsToState)(u,A,((e,t)=>{E("Got input %s - value is [%o]",e,t),V();try{q({key:e,value:t})}catch(n){y(n)}}));return P.push(G),()=>{(0,c.callFnOrFnPromise)(O,`Error with cleanup function of ${i.id}`),P.forEach((e=>e()))}})({node:O,inputs:M,outputs:D,resolvedDeps:E,_debugger:v,insId:g,mainState:b,ancestorsInsIds:y,onError:P,onBubbleError:C,env:_,extraContext:I,onCompleted:x,onStarted:N});return()=>{w.forEach((e=>e())),T()}}},84479:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeInputsToState=t.isNodeStateValid=t.hasNewSignificantValues=t.peekValuesForExecution=t.pullValuesForExecution=t.pullValueForExecution=t.peekValueForExecution=void 0;const o=n(30292),i=n(86873),s=n(6775),r=(e,t)=>{const n=(0,o.extractStaticValue)(e);if((0,o.isEnvValue)(n)){return((e,t)=>{const n=e.split(".");let o={...t};for(let s of n){if(!o||!(0,i.isDefined)(o[s])||null===o[s])throw new Error(`Cannot find key ${e} inside obj ${t}`);o=o[s]}return o})((0,o.getEnvKeyFromValue)(n),t)}return n};t.peekValueForExecution=(e,t,n,i,s)=>{const a=n.get(e);let u;if(!t)throw new Error(`Trying to peek value of inexsting input in key "${e}" in node "${s}"`);return u=(0,o.isStaticInput)(t)?r(t,i):(0,o.isQueueInputPinConfig)(t.config)?a?[...a].shift():void 0:a,u};t.pullValueForExecution=(e,t,n,i)=>{const s=n.get(e);let a;return(0,o.isStaticInput)(t)?a=r(t,i):(0,o.isQueueInputPinConfig)(t.config)?(a=(s||[]).shift(),n.set(e,s)):(a=s,(0,o.isStickyInputPinConfig)(t.config)||n.delete(e)),a};t.pullValuesForExecution=(e,n,o)=>(0,i.entries)(e).reduce(((e,i)=>{let[s,r]=i;return e[s]=(0,t.pullValueForExecution)(s,r,n,o),e}),{});t.peekValuesForExecution=(e,n,o,s)=>(0,i.entries)(e).reduce(((e,i)=>{let[r,a]=i;return e[r]=(0,t.peekValueForExecution)(r,a,n,o,s),e}),{});t.hasNewSignificantValues=(e,n,s,r)=>(0,i.entries)(e).some((e=>{let[a,u]=e;const l=(0,o.isQueueInputPinConfig)(u.config),c=(0,t.peekValueForExecution)(a,u,n,s,r);return(0,i.isDefined)(c)&&l}));t.isNodeStateValid=(e,t,n)=>{const r=(0,i.keys)(e),a=(0,i.keys)(n.inputs).filter((e=>{var t;const o=null===(t=n.inputs[e])||void 0===t?void 0:t.mode;return!o||"required"===o}));r.includes(s.TRIGGER_PIN_ID)&&a.push(s.TRIGGER_PIN_ID);return!!(0,i.containsAll)(r,a)&&(0,i.entries)(e).filter((e=>{let[t]=e;return!!n.inputs[t]||t===s.TRIGGER_PIN_ID})).every((e=>{let[s,r]=e;var a;const u=t.get(s);return"optional"===((null===(a=n.inputs[s])||void 0===a?void 0:a.mode)||"required")||(!!(0,o.isStaticInput)(r)||((0,o.isQueueInputPinConfig)(r.config)?(0,i.isDefined)(u)&&u.length>0:(0,i.isDefined)(u)))}))};t.subscribeInputsToState=(e,t,n)=>{const s=[];return(0,i.entries)(e).forEach((e=>{let[i,r]=e;if(!r)return;if((0,o.isStaticInput)(r))return;const a=r.subject.subscribe((e=>{if((0,o.isQueueInputPinConfig)(r.config)){const o=t.get(i)||[];if(!Array.isArray(o))throw new Error(`impossible state - state of key ${i} is set but not an array`);o.push(e),t.set(i,o),n(i,e)}else t.set(i,e),n(i,e)}));s.push((()=>a.unsubscribe()))})),()=>s.forEach((e=>e()))}},5474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flydeFlowSchema=void 0;const o=n(29022),i=o.z.record(o.z.string(),o.z.string().or(o.z.array(o.z.string()))),s=o.z.strictObject({x:o.z.number(),y:o.z.number()}),r=o.z.discriminatedUnion("mode",[o.z.strictObject({mode:o.z.literal("static"),value:o.z.any()}),o.z.strictObject({mode:o.z.literal("queue")}),o.z.strictObject({mode:o.z.literal("sticky")})]),a=o.z.object({size:o.z.optional(o.z.enum(["small","regular","large"])),icon:o.z.optional(o.z.any()),color:o.z.optional(o.z.string()),cssOverride:o.z.optional(o.z.record(o.z.string()))}),u=o.z.object({pos:s.default({x:0,y:0}),id:o.z.string(),inputConfig:o.z.optional(o.z.record(o.z.string(),r)).default({}),visibleInputs:o.z.optional(o.z.array(o.z.string())),visibleOutputs:o.z.optional(o.z.array(o.z.string())),nodeId:o.z.optional(o.z.string()),node:o.z.optional(o.z.any()),style:o.z.optional(a)}).refine((e=>e.node||e.nodeId),{message:"Instance must have either an inline node or refer to a nodeId"}),l=o.z.union([o.z.string(),o.z.object({mode:o.z.enum(["required","optional","required-if-connected"]),type:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),defaultValue:o.z.optional(o.z.any())})]),c=o.z.object({type:o.z.optional(o.z.string()),optional:o.z.optional(o.z.boolean()),delayed:o.z.optional(o.z.boolean()),description:o.z.optional(o.z.string())}),d=o.z.object({id:o.z.optional(o.z.string()),inputs:o.z.record(o.z.string(),l),outputs:o.z.record(o.z.string(),c),inputsPosition:o.z.optional(o.z.record(o.z.string(),s)),outputsPosition:o.z.optional(o.z.record(o.z.string(),s)),customViewCode:o.z.optional(o.z.string()),dataBuilderSource:o.z.optional(o.z.string()),templateType:o.z.optional(o.z.string()),completionOutputs:o.z.optional(o.z.array(o.z.string())),reactiveInputs:o.z.optional(o.z.array(o.z.string())),defaultStyle:o.z.optional(a),description:o.z.optional(o.z.string()),searchKeywords:o.z.optional(o.z.array(o.z.string()))}),p=o.z.object({instances:o.z.array(u),connections:o.z.array(o.z.strictObject({from:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),to:o.z.strictObject({insId:o.z.string(),pinId:o.z.string()}),delayed:o.z.optional(o.z.boolean()),hidden:o.z.optional(o.z.boolean())}))}).and(d);t.flydeFlowSchema=o.z.strictObject({imports:o.z.optional(i).default({}),node:p})},74762:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticValueVisualNode=void 0,i(n(86873),t);const s=n(30292);i(n(6775),t),i(n(47025),t),i(n(10418),t),i(n(30292),t),i(n(3320),t),i(n(79804),t),i(n(5474),t);t.isStaticValueVisualNode=e=>!!e&&!!(0,s.maybeGetStaticValueNodeId)(`${e}`)},87093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fakeVm=t.VM=t.VMScript=void 0;const o=n(86873);class i{constructor(e){this.script=e}}t.VMScript=i;class s{constructor(e){this.context=e}run(e){const t=(0,o.okeys)(this.context.sandbox),n=Object.values(this.context.sandbox);Function(...t,e.script)(...n)}}t.VM=s,t.fakeVm={VMScript:i,VM:s}},28145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVM2Instance=void 0;const o=n(87093);t.getVM2Instance=()=>o.fakeVm},79804:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.customNodesToNodesCollection=t.inlineValueNodeToNode=void 0;const i=o(n(18706)),s=n(86873),r=n(30292),a=(0,n(28145).getVM2Instance)();t.inlineValueNodeToNode=function(e,t){void 0===t&&(t={});const{runFnRawCode:n,...o}=e,u=(0,s.debugLogger)(`code-node:${e.id}`),l=`\n try {\n ${n}\n } catch (e) {\n adv.onError(e);\n }\n `,c=new a.VMScript(l),d={...o,run:(n,o,l)=>{const d=new a.VM({sandbox:{inputs:n,outputs:o,setInterval:setInterval,clearInterval:clearInterval,setTimeout:setTimeout,clearTimeout:clearTimeout,encodeURIComponent:encodeURIComponent,adv:l,log:function(){for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeWithDependencies=void 0;const o=n(30292),i=n(74762),s=n(88270);t.getNodeWithDependencies=function(e,n,r){if(void 0===r&&(r=[]),(0,o.isInlineValueNode)(e))return[e];if(r.includes(e.id))return[];const a=(0,i.removeDupes)(e.instances.filter((e=>(0,s.isRefNodeInstance)(e))).map((e=>e.nodeId)).filter((e=>n[e])));return[e,...a.flatMap((e=>{var t;return null!==(t=n[e])&&void 0!==t?t:[]})).reduce(((e,o)=>[...e,...(0,t.getNodeWithDependencies)(o,n,[...r,...a])]),[])]}},30292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88270),t),i(n(43069),t),i(n(79426),t),i(n(44535),t),i(n(18063),t),i(n(20359),t)},18063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeInstanceError=void 0;class n extends Error{constructor(e,t,n){let o="Unknown error";o="string"==typeof e?e:e instanceof Error?e.message:null!==e&&"object"==typeof e?JSON.stringify(e):String(e),super(`${o} (insId: ${t}, nodeId: ${n})`),this.name=this.constructor.name,this.message=`${o} (insId: ${t}, nodeId: ${n})`,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.fullInsIdsPath=t,this.nodeId=n}}t.NodeInstanceError=n},88270:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInsId=t.NodeInstance=t.isRefNodeInstance=t.isInlineNodeInstance=t.inlineNodeInstance=t.nodeInstance=void 0;const o=n(36618);t.nodeInstance=(e,t,n,o)=>({id:e,nodeId:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.inlineNodeInstance=(e,t,n,o)=>({id:e,node:t,inputConfig:n||{},pos:o||{x:0,y:0}});t.isInlineNodeInstance=e=>!!e.node;t.isRefNodeInstance=e=>!(0,t.isInlineNodeInstance)(e);t.NodeInstance=(e,t,n,o)=>({id:e,nodeId:t.id,inputConfig:n||{},pos:o||{x:0,y:0}});t.createInsId=e=>`${e.id}-${(0,o.slug)()}`},43069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvKeyFromValue=t.toEnvValue=t.isEnvValue=t.extractStaticValue=t.isStaticInput=t.isDynamicInput=t.staticNodeInput=t.dynamicNodeInputs=t.dynamicNodeInput=t.dynamicOutput=t.nodeOutputs=t.nodeOutput=t.nodeInputs=t.isInputPinOptional=t.nodeInput=void 0;const o=n(62600),i=n(30292),s=n(86873),r=n(79426);t.nodeInput=function(e){return void 0===e&&(e="required"),{mode:e}};t.isInputPinOptional=e=>"optional"===e.mode;t.nodeInputs=(e,n)=>(0,s.repeat)(e,(e=>(0,t.nodeInput)((null==n?void 0:n[e])||"required")));t.nodeOutput=function(e){return void 0===e&&(e=!1),{delayed:e}};t.nodeOutputs=e=>(0,s.repeat)(e,(()=>(0,t.nodeOutput)()));t.dynamicOutput=()=>new o.Subject,t.dynamicNodeInput=(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})));t.dynamicNodeInputs=function(e){return void 0===e&&(e=10),(0,s.repeat)(e,(()=>(0,s.testDataCreator)((()=>({subject:new o.Subject,config:(0,r.queueInputPinConfig)()})))()))};t.staticNodeInput=e=>({config:(0,r.staticInputPinConfig)(e)});t.isDynamicInput=e=>{const t=e;return t&&t.subject&&!!t.subject.next};t.isStaticInput=e=>(0,i.isStaticInputPinConfig)(null==e?void 0:e.config);t.extractStaticValue=e=>{if((0,t.isStaticInput)(e))return e.config.value;throw new Error("Cannot extract static value from non static arg")};t.isEnvValue=e=>"string"==typeof e&&e.startsWith("$ENV.");t.toEnvValue=e=>`$ENV.${e}`;t.getEnvKeyFromValue=e=>"string"==typeof e?e.replace(/^\$ENV\./,""):e},20359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codeFromFunction=t.getNodeDef=t.getNode=t.getStaticValue=t.maybeGetStaticValueNodeId=t.fromSimplified=t.inlineValueNode=t.codeNode=t.visualNode=t.isInlineValueNode=t.isVisualNode=t.isCodeNode=t.isBaseNode=t.InlineValueNodeType=void 0;const o=n(86873),i=n(88270),s=n(43069);!function(e){e.VALUE="value",e.FUNCTION="function"}(t.InlineValueNodeType||(t.InlineValueNodeType={}));t.isBaseNode=e=>e&&e.id&&e.inputs&&e.outputs;t.isCodeNode=e=>(0,t.isBaseNode)(e)&&"function"==typeof e.run;t.isVisualNode=e=>!!e.instances;t.isInlineValueNode=e=>(0,o.isDefined)(e)&&(0,o.isDefined)(e.runFnRawCode),t.visualNode=(0,o.testDataCreator)({id:"visual-node",inputs:{},outputs:{},instances:[],connections:[],outputsPosition:{},inputsPosition:{}}),t.codeNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},run:o.noop}),t.inlineValueNode=(0,o.testDataCreator)({id:"node",inputs:{},outputs:{},runFnRawCode:""});t.fromSimplified=e=>{let{run:t,inputTypes:n,outputTypes:i,id:s}=e;return{id:s,inputs:(0,o.entries)(n).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),outputs:(0,o.entries)(i).reduce(((e,t)=>{let[n]=t;return{...e,[n]:{}}}),{}),run:t}};t.maybeGetStaticValueNodeId=e=>{const t="string"==typeof e&&e.match(/^__node\:(.*)/);if(t){return t[1]}return null};t.getStaticValue=(e,n,o)=>{const i=(0,t.maybeGetStaticValueNodeId)(e);if(i){const e=n[i];if(!e)throw new Error(`Instance ${o} referrer to a node reference ${i} that does not exist`);return e}return e};t.getNode=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw new Error(`Node with id ${n} not found`);return o};t.getNodeDef=(e,t)=>{if("string"!=typeof e&&(0,i.isInlineNodeInstance)(e))return e.node;const n="string"==typeof e?e:e.nodeId,o=t[n];if(!o)throw console.error(`Node with id ${n} not found`),new Error(`Node with id ${n} not found`);return o};t.codeFromFunction=e=>{let{id:t,fn:n,inputNames:o,outputName:i,defaultStyle:r}=e;return{id:t,inputs:o.reduce(((e,t)=>({...e,[t]:(0,s.nodeInput)()})),{}),outputs:{[i]:(0,s.nodeOutput)()},run:(e,t)=>{const s=o.map((t=>e[t])),r=t[i],a=n(...s);return Promise.resolve(a).then((e=>null==r?void 0:r.next(e)))},completionOutputs:[i],defaultStyle:r}}},44535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nodeFromSimpleFunction=void 0,t.nodeFromSimpleFunction=function(e){var t;return{...e,id:e.id,description:e.description,namespace:e.namespace,inputs:e.inputs?e.inputs.reduce(((e,t)=>{let{name:n,description:o,mode:i,defaultValue:s}=t;return{...e,[n]:{description:o,mode:null!=i?i:"required",defaultValue:s}}}),{}):{},outputs:e.output?{[e.output.name]:{description:e.output.description}}:{},defaultStyle:{icon:e.icon,size:e.size},run:null!==(t=e.fullRunFn)&&void 0!==t?t:async function(t,n,o){var i,s;const r=(null!==(i=e.inputs)&&void 0!==i?i:[]).map((e=>{let{name:n}=e;return t[n]}));try{const t=await Promise.resolve(e.run(...r));e.output&&(null===(s=n[e.output.name])||void 0===s||s.next(t))}catch(a){console.error("Error in node",a),o.onError(a)}},customViewCode:e.customViewCode}}},79426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStaticInputPinConfig=t.isStickyInputPinConfig=t.isQueueInputPinConfig=t.staticInputPinConfig=t.stickyInputPinConfig=t.queueInputPinConfig=t.INPUT_MODES=void 0,t.INPUT_MODES=["queue","sticky","static"];t.queueInputPinConfig=()=>({mode:"queue"});t.stickyInputPinConfig=()=>({mode:"sticky"});t.staticInputPinConfig=e=>({mode:"static",value:e});t.isQueueInputPinConfig=e=>"queue"===e.mode;t.isStickyInputPinConfig=e=>!!e&&"sticky"===e.mode,t.isStaticInputPinConfig=function(e){return!!e&&"static"===e.mode}},10418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifiedExecute=void 0;const o=n(74762),i=n(47025);t.simplifiedExecute=function(e,t,n,s,r){void 0===r&&(r={});const a=(0,o.keys)(e.outputs),u=Object.keys(n).reduce(((e,t)=>{const i=n[t];return{...e,[t]:(0,o.isDynamicInput)(i)?i:(0,o.staticNodeInput)(i)}}),{}),l=a.reduce(((e,t)=>{const n=(0,o.dynamicOutput)();return s&&n.subscribe((e=>{s(t,e)})),{...e,[t]:n}}),{});return(0,i.execute)({node:e,inputs:u,outputs:l,resolvedDeps:t,onBubbleError:e=>{throw e},...r})}},25779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodePreview=void 0;const o=n(35250),i=n(74762),s=n(86553);t.NodePreview=e=>{let{node:t}=e;const n={node:t,instance:(0,i.nodeInstance)("bob",t.id,{}),connections:[],viewPort:{pos:{x:0,y:0},zoom:1},resolvedDeps:{},connectionsPerInput:{},onUngroup:i.noop,onDblClick:i.noop,onDragEnd:i.noop,onDragMove:i.noop,onDragStart:i.noop,onPinClick:i.noop,onPinDblClick:i.noop,onSelect:i.noop,onTogglePinBreakpoint:i.noop,onTogglePinLog:i.noop,onToggleSticky:i.noop,displayMode:!0,onInspectPin:i.noop,onDetachConstValue:i.noop,onCopyConstValue:i.noop,onPasteConstValue:i.noop,ancestorsInsIds:"",onChangeVisibleInputs:i.noop,onChangeVisibleOutputs:i.noop,onConvertConstToEnv:i.noop,forceShowMinimized:"both",onExtractInlineNode:i.noop,onCloseInlineEditor:i.noop,isConnectedInstanceSelected:!1,inlineEditorPortalDomNode:null,onChangeStyle:i.noop,onDeleteInstance:i.noop,onGroupSelected:i.noop,onSetDisplayName:i.noop,hadError:!1,queuedInputsData:{},onPinMouseDown:i.noop,onPinMouseUp:i.noop};return(0,o.jsx)("div",{className:"node-preview",children:(0,o.jsx)(s.InstanceView,{...n})})}},30653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDarkMode=t.DarkModeProvider=void 0;const o=n(70079),i=(0,o.createContext)(!0);t.DarkModeProvider=i.Provider;t.useDarkMode=()=>(0,o.useContext)(i)},29183:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DataInspectionModal=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=n(74089),p=n(83938),f=n(17102),m=n(98158);t.DataInspectionModal=e=>{var t;const{onRequestHistory:n}=(0,m.useDebuggerContext)(),{item:o}=e,[i,s]=c.default.useState(),[r,h]=c.default.useState(0),[v,g]=c.default.useState(""),[I,b]=c.default.useState(),[y]=(0,d.useDebounce)(v,300);(0,c.useEffect)((()=>{b(null==i?void 0:i.lastSamples.filter((e=>"object"==typeof e.val?JSON.stringify(e.val).includes(y):e.val.toString().includes(y)))),h(0)}),[null==i?void 0:i.lastSamples,y]),c.default.useEffect((()=>{!async function(){var e,t;const i=await n(o.insId,null===(e=o.pin)||void 0===e?void 0:e.id,null===(t=o.pin)||void 0===t?void 0:t.type);s(i)}()}),[o,n]);const C=e=>{const t=e.val;return"object"==typeof t?(0,a.jsx)(p.BrowserOnlyReactJson,{src:t}):(0,a.jsx)(u.Code,{children:t.toString()})},_=`"${o.insId}" ${(null===(t=o.pin)||void 0===t?void 0:t.id)?`(${o.pin.id})`:""}`;return(0,a.jsx)(u.Dialog,{isOpen:!0,title:`Inspecting data for instance ${_}`,onClose:e.onClose,canEscapeKeyClose:!1,className:"data-inspection-modal",children:(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{children:[i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("em",{children:[_," called ",i.total," time(s)"]}),i.total>10&&(0,a.jsx)("span",{children:"Showing last 10 samples"})]}):null,(0,a.jsx)("input",{className:"bp5-input bp5-small bp5-fill",type:"search",placeholder:"Search for values",dir:"auto",onChange:e=>g(e.target.value),value:v}),y.length>0&&(0,a.jsxs)("span",{children:["Showing ",null==I?void 0:I.length," of ",i.lastSamples.length," ",'samples matching query "',y,'"']})]}),(0,a.jsx)("main",{className:"main-wrapper",children:(()=>{if(!i)return(0,a.jsx)(f.Loader,{});if(0===i.total)return(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",(0,a.jsx)("em",{children:o.insId})," ",o.pin?(0,a.jsxs)(c.default.Fragment,{children:["and pin ",(0,a.jsx)("em",{children:o.pin.id})]}):null,". Make sure debugger is running and your program was triggered."]});const e=null==I?void 0:I[r];return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Card,{className:"content-wrapper",children:[e?(0,a.jsxs)("div",{className:"info",children:[(0,a.jsxs)("div",{children:["Showing sample ",r," of event from"," ",(0,a.jsx)("strong",{children:(0,d.timeAgo)(e.time)})," (",new Date(e.time).toLocaleString(),")"]}),(0,a.jsxs)("div",{children:["Instance: ",(0,a.jsx)("strong",{children:e.insId}),", Pin id:"," ",(0,a.jsx)("strong",{children:e.pinId})," "]}),(0,a.jsx)("div",{children:"Value:"})]}):null,C(e)]}),(0,a.jsx)(u.Menu,{className:"samples-menu",children:I.map(((e,t)=>{const n=e.pinId,o=`${i.total-t}. from pin "${n}"`;return(0,a.jsx)(u.MenuItem,{text:o,onClick:()=>h(t)},t)}))})]}):i.lastSamples.length>0&&v.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",children:['No data found for search query "',v,'"']}):(0,a.jsxs)(u.Callout,{intent:"warning",children:["No events captured for instance ",o.insId," ",o.pin?`and ${o.pin.id}`:"",". Make sure a debugger is connected and your program was triggered."]})})()})]})})})}},40471:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29183),t)},98158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebuggerContext=t.DebuggerContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({onRequestHistory:()=>Promise.reject(new Error("Not implemented"))});t.DebuggerContextProvider=i.Provider;t.useDebuggerContext=()=>(0,o.useContext)(i)},86125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDependenciesContext=t.DependenciesContextProvider=void 0;const o=n(70079),i=(0,o.createContext)({resolvedDependencies:{},onImportNode:()=>Promise.reject(new Error("Not implemented")),onRequestImportables:()=>Promise.reject(new Error("Not implemented"))});t.DependenciesContextProvider=i.Provider;t.useDependenciesContext=()=>(0,o.useContext)(i)},97106:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FlowEditor=void 0;const u=n(35250),l=s(n(70079)),c=n(74762),d=n(63521),p=a(n(53865)),f=n(68120),m=n(7047),h=n(84472),v=n(82232),g=n(49283),I=n(43490),b=n(68840),y=n(78087),C=n(20079),_=n(60190),x=n(40471),N=n(98158),w=n(86125),j=n(30653),E=n(77852);r(n(43490),t),r(n(98158),t),r(n(86125),t),b.library.add(y.fab,C.fas);const P=["select","drag-move","order-step"];t.FlowEditor=l.memo(l.forwardRef(((e,t)=>{const{state:n,onChangeEditorState:o}=e,{resolvedDependencies:i,onImportNode:s}=(0,w.useDependenciesContext)(),[r,a]=l.useState([]),[b,y]=l.useState([]),{flow:C,boardData:O}=n,S=n.flow.node,[D,M]=l.useState({}),[T,k]=l.useState(new Set),{debuggerClient:R}=(0,N.useDebuggerContext)();l.useEffect((()=>{if(R)return R.onBatchedEvents((e=>{e.forEach((e=>{e.type===c.DebuggerEventType.INPUTS_STATE_CHANGE&&(console.log("INPUTS_STATE_CHANGE",e.insId,e.val),M((t=>({...t,[e.insId]:e.val})))),e.type===c.DebuggerEventType.ERROR&&k((t=>{const n=new Set(t);return n.add(e.insId),n}))}))}))}),[R]);const{openFile:A,reportEvent:V}=(0,I.usePorts)(),$=l.useCallback(((e,t)=>{console.info("onChangeFlow",t.type),"functional"===t.type&&(a([{flow:{...n.flow,...e}},...r.slice(0,50)]),y([])),o((t=>({...t,flow:{...t.flow,...e}})))}),[o,n.flow,r]),[z,H]=l.useState({instances:[],connections:[]}),[F,L]=l.useState(!1),q=l.useCallback((()=>L(!1)),[]),G=l.useCallback((()=>L(!0)),[]),B=l.useCallback((e=>{o((t=>({...t,boardData:{...t.boardData,...e}})))}),[o]);l.useEffect((()=>{B({selected:[],viewPort:d.defaultViewPort,from:void 0,to:void 0,lastMousePos:{x:0,y:0}})}),[S.id]),(0,f.useHotkeys)("cmd+z",(e=>{y([...b,n]);const[t,...i]=r;t&&(o((e=>({...e,...t}))),a(i)),e.preventDefault()}),{text:"Undo last change",group:"Editing"},[n,r,b]);const U=l.useCallback(((e,t)=>{P.some((e=>t.message.includes(e)))||y([]),$({node:e},t)}),[$]),W=l.useCallback((e=>{A({absPath:e.source.path})}),[A]),Z=l.useCallback((function(e,t){void 0===t&&(t=-1*d.NODE_HEIGHT*1.5);const n=(0,m.createNewNodeInstance)(e,t,O.lastMousePos,i);if(n){const e=(0,p.default)(C,(e=>{const t=e.node;if(!(0,c.isVisualNode)(t))throw new Error("Impossible state, adding node to non visual node");t.instances.push(n)}));return $(e,(0,v.functionalChange)("add-node")),q(),n}}),[O.lastMousePos,C,$,q,i]),J=l.useCallback((async e=>{switch(e.type){case g.OmniBarCmdType.ADD:return V("addNode",{nodeId:e.data,source:"omnibar"}),Z(e.data);case g.OmniBarCmdType.ADD_VALUE:{const e=t.current;null==e||e.requestNewInlineValue();break}case g.OmniBarCmdType.IMPORT:{await s(e.data,{pos:O.lastMousePos});const t=(0,_.vAdd)({x:0,y:0},O.lastMousePos),n=(0,m.createNewNodeInstance)(e.data.node,0,t,i),o=(0,p.default)(C,(e=>{e.node.instances.push(n)}));$(o,(0,v.functionalChange)("add-imported-node")),V("addNode",{nodeId:e.data.node.id,source:"omnibar"});break}default:h.AppToaster.show({intent:"warning",message:"Not supported yet"})}q()}),[q,V,Z,t,s,O.lastMousePos,i,C,$]),[Y,K]=l.useState(),Q=l.useCallback((()=>K(void 0)),[]),X=l.useCallback(((e,t)=>{K({insId:e,pin:t})}),[]),{isDarkMode:ee}=(0,E.useDarkMode)();return(0,u.jsx)("div",{className:"flyde-flow-editor",children:(()=>{var n;if((0,c.isInlineValueNode)(S))throw new Error("Impossible state");return(0,u.jsx)(j.DarkModeProvider,{value:null!==(n=e.darkMode)&&void 0!==n?n:ee,children:(0,u.jsxs)(l.Fragment,{children:[Y?(0,u.jsx)(x.DataInspectionModal,{item:Y,onClose:Q}):null,(0,u.jsx)(d.VisualNodeEditor,{currentInsId:c.ROOT_INS_ID,ref:t,boardData:O,onChangeBoardData:B,node:S,onGoToNodeDef:W,onChangeNode:U,resolvedDependencies:i,clipboardData:z,onCopy:H,nodeIoEditable:!S.id.startsWith("Trigger"),onInspectPin:X,onShowOmnibar:G,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:D,initialPadding:e.initialPadding,instancesWithErrors:T,disableScrolling:e.disableScrolling},S.id),F?(0,u.jsx)(g.Omnibar,{flow:C,resolvedNodes:i,onCommand:J,visible:F,onClose:q}):null]})})})()})})))},9001:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeEditor=t.renderCreateIOOption=void 0;const i=n(35250),s=o(n(70079)),r=n(74762),a=n(50382),u=o(n(53865)),l=n(70457),c=n(25779);t.renderCreateIOOption=(e,t,n)=>(0,i.jsx)(a.MenuItem,{icon:"add",text:`Create "${e}"`,active:t,onClick:n,shouldDismissPopover:!1});const d=l.MultiSelect.ofType();t.BaseNodeEditor=e=>{var n,o;const{node:l,onChange:p}=e,f=(0,r.entries)(l.inputs),m=f.filter((e=>{let[,t]=e;return"required"===t.mode})).map((e=>{let[t]=e;return t})),h=f.filter((e=>{let[,t]=e;return"optional"===t.mode})).map((e=>{let[t]=e;return t})),v=f.filter((e=>{let[,t]=e;return"required-if-connected"===t.mode})).map((e=>{let[t]=e;return t})),[g,I]=s.default.useState(!1),b=(0,r.okeys)(l.outputs),y=s.default.useCallback((e=>{p({...l,id:e})}),[l,p]),C=s.default.useCallback((e=>{let t=e?e.split(","):void 0;"[]"===e&&(t=[]),p({...l,completionOutputs:t})}),[l,p]),_=s.default.useCallback((e=>{let t=e?e.split(","):void 0;p({...l,reactiveInputs:t})}),[l,p]),x=s.default.useCallback(((e,t)=>{const n=(0,u.default)(l,(n=>{n.inputs[e]=(0,r.nodeInput)(t)}));p(n)}),[l,p]),N=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.inputs[e]}));p(t)}),[l,p]),w=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{t.outputs[e]=(0,r.nodeOutput)()}));p(t)}),[l,p]),j=s.default.useCallback((e=>{const t=(0,u.default)(l,(t=>{delete t.outputs[e]}));p(t)}),[l,p]);return(0,i.jsxs)("div",{className:"base-node-editor",children:[(0,i.jsx)("div",{className:"form-row",children:(0,i.jsx)(a.FormGroup,{label:"Node Name",labelFor:"text-input",labelInfo:"(required)",children:(0,i.jsx)(a.InputGroup,{id:"node-name",disabled:e.idDisabled,placeholder:"Node ID",value:l.id,onChange:e=>y(e.target.value)})})}),(0,i.jsx)(a.FormGroup,{label:"Required Inputs",children:(0,i.jsx)(d,{selectedItems:m,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),!0!==e.hiddenOutputs?(0,i.jsx)(a.FormGroup,{label:"Outputs",children:(0,i.jsx)(d,{selectedItems:b,placeholder:"Enter output names here",items:[],tagRenderer:e=>e,onItemSelect:w,onRemove:j,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}):null,(0,i.jsx)(a.Checkbox,{checked:g,onChange:e=>I(e.target.checked),children:"Show advanced options"}),(0,i.jsxs)(a.Collapse,{isOpen:g,children:[(0,i.jsx)(a.FormGroup,{label:"Optional Inputs",children:(0,i.jsx)(d,{selectedItems:h,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"optional"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Required-if-connected Inputs",children:(0,i.jsx)(d,{selectedItems:v,placeholder:"Enter input names here",items:[],tagRenderer:e=>e,onItemSelect:e=>x(e,"required-if-connected"),onRemove:N,resetOnSelect:!0,itemRenderer:e=>(0,i.jsx)("span",{children:e}),createNewItemFromQuery:e=>e,createNewItemRenderer:t.renderCreateIOOption,fill:!0})}),(0,i.jsx)(a.FormGroup,{label:"Completion Outputs",children:(0,i.jsx)(a.InputGroup,{id:"completion-outputs",placeholder:"completion outputs",value:(null===(n=l.completionOutputs)||void 0===n?void 0:n.join(","))||"",onChange:e=>C(e.target.value)})}),(0,i.jsx)(a.FormGroup,{label:"Reactive Inputs",children:(0,i.jsx)(a.InputGroup,{id:"reactive-inputs",placeholder:"Reactive inputs",value:(null===(o=l.reactiveInputs)||void 0===o?void 0:o.join(","))||"",onChange:e=>_(e.target.value)})})]}),(0,i.jsx)(a.FormGroup,{label:"Preview",children:(0,i.jsx)("div",{className:"preview-wrapper",children:(0,i.jsx)(c.NodePreview,{node:l})})})]})}},82232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metaChange=t.functionalChange=void 0;t.functionalChange=e=>({type:"functional",message:e});t.metaChange=function(e){return void 0===e&&(e="n/a"),{type:"meta",message:e}}},41032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safelyGetNodeDef=t.loadingDef=void 0;const o=n(74762);t.loadingDef={id:"Loading",inputs:{},outputs:{}};t.safelyGetNodeDef=(e,n)=>{try{return(0,o.getNodeDef)(e,n)}catch(i){const n="string"==typeof e?e:e.nodeId;return{...t.loadingDef,id:n}}}},72125:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCodeModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(68371),f=n(74762),m=n(31745),h="`Result is ${inputs.a + inputs.b}`";t.InlineCodeModal=u.memo((function(e){const{initialValue:t,initialType:n}=e,[o,i]=u.useState((0,f.isDefined)(t)?t:h),[s,r]=u.useState(n||f.InlineValueNodeType.VALUE),v=(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:['You can add variables to by referrencing the "inputs" object.',(0,a.jsx)("br",{})," For example:",(0,a.jsx)(c.Code,{children:"`Hello {inputs.name}`"}),' will expose an input pin named "name"']}),(0,a.jsxs)("p",{children:["You can also use ternery expressions, arithmetic operators and more!",(0,a.jsx)("br",{}),"For example:",(0,a.jsx)(c.Code,{children:"inputs.a > inputs.b ? inputs.a + 42 : Math.random() * inputs.b"})]})]}),g=(0,a.jsxs)("span",{children:["Type in any valid JS value, such as ",(0,a.jsx)(c.Code,{children:"true"}),", ",(0,a.jsx)(c.Code,{children:"42"}),","," ",(0,a.jsx)(c.Code,{children:'["bob", "alice", "dave"]'}),".",(0,a.jsx)("br",{})," Dynamic inputs may also be used"]}),I=(0,a.jsxs)("span",{children:["Write any JS code and return a value.",(0,a.jsx)("br",{})," The returned value will be the output.",(0,a.jsx)("br",{})," Example:",(0,a.jsx)(c.Code,{children:"const a = inputs.a; const b = inputs.b; return Math.floor(a/b);"})]}),b=(0,p.getVariables)(o);return u.useEffect((()=>{o===h&&s===f.InlineValueNodeType.FUNCTION&&i(`return ${h}`),o===`return ${h}`&&s===f.InlineValueNodeType.VALUE&&i(h)}),[o,s]),(0,a.jsxs)(c.Dialog,{isOpen:!0,title:"Inline Value / Code",onClose:e.onCancel,className:"inline-code-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:t=>{"Enter"===t.key&&t.metaKey&&e.onSubmit(s,o)},tabIndex:0,children:[(0,a.jsxs)(c.RadioGroup,{inline:!0,onChange:e=>r(e.target.value),selectedValue:s,children:[(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Value ",(0,a.jsx)(m.InfoTooltip,{content:g})]}),value:f.InlineValueNodeType.VALUE}),(0,a.jsx)(c.Radio,{labelElement:(0,a.jsxs)(u.Fragment,{children:["Function ",(0,a.jsx)(m.InfoTooltip,{content:I})]}),value:f.InlineValueNodeType.FUNCTION})]}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"javascript",value:o,onChange:e=>i(e||""),onMount:e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})}}),(()=>{const e=o.includes("return");return e&&s===f.InlineValueNodeType.VALUE?(0,a.jsx)(c.Callout,{intent:c.Intent.WARNING,children:'When using the "value" type you are not expected to return anything'}):e||s!==f.InlineValueNodeType.FUNCTION?null:(0,a.jsxs)(c.Callout,{intent:c.Intent.DANGER,children:['When using the "function" type you are expected to'," ",(0,a.jsx)(c.Code,{children:"return"})," a value.",(0,a.jsx)("br",{}),"Example: ",(0,a.jsx)(c.Code,{children:"return 42 + Date.now();"})]})})(),(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Input pins detected:"," ",b.length?b.map((e=>(0,a.jsx)(c.Code,{children:e},e))):"None",(0,a.jsx)(m.InfoTooltip,{content:v})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:e.onCancel,children:"Cancel"}),(0,a.jsx)(c.Button,{onClick:()=>e.onSubmit(s,o),intent:c.Intent.PRIMARY,className:"save-btn",children:"Save"})]})})]})}))},18594:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(72125),t)},68371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInlineValueNode=t.getVariables=void 0;const o=n(74762),i=n(74762);t.getVariables=e=>(e.match(/inputs\.([a-zA-Z]\w*)/g)||[]).map((e=>e.replace(/inputs\./,"")));t.createInlineValueNode=e=>{let{code:n,customView:s,nodeId:r,type:a}=e;const u=(0,t.getVariables)(n).reduce(((e,t)=>({...e,[t]:(0,o.nodeInput)()})),{}),l={value:(0,o.nodeOutput)()},c=a===o.InlineValueNodeType.FUNCTION?`const result = (function() { ${n}}());\n Promise.resolve(result).then(val => outputs.value.next(val))`:`const result = (${n}); Promise.resolve(result).then(val => outputs.value.next(val))`,d=btoa(n);return(0,i.inlineValueNode)({id:r||`Inline Code ${(0,o.randomInt)(99999)}`,inputs:u,outputs:l,runFnRawCode:c,customViewCode:s||n,dataBuilderSource:d,templateType:a,completionOutputs:["value"],defaultStyle:{size:"regular",icon:"code",cssOverride:{fontFamily:"monospace",fontWeight:"500"}},description:"Custom inline "+(a===o.InlineValueNodeType.VALUE?"value":"function")})}},49283:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Omnibar=t.OmniBarCmdType=void 0;const a=n(35250),u=s(n(70079)),l=n(70457),c=n(74762),d=n(50382),p=r(n(26372));var f;!function(e){e.ADD="add",e.ADD_VALUE="add-value",e.IMPORT="import"}(f=t.OmniBarCmdType||(t.OmniBarCmdType={}));const m=[];t.Omnibar=e=>{const{resolvedNodes:t}=e,[n,o]=u.useState(""),[i,s]=u.useState(null),[r,h]=u.useState([]);u.useEffect((()=>{const e=(0,c.keys)(t).map((e=>({title:`${t[e].id}`,cmd:{type:f.ADD,data:e},extra:"current flow"}))),n=r.map((e=>({title:`${e.node.id}`,description:e.node.description,cmd:{type:f.IMPORT,data:e},extra:`${e.module}`}))),o={title:"Add inline value or code",suggestOnEmpty:!0,cmd:{type:f.ADD_VALUE}},i=[...m,...n,o,...e];s(i)}),[t,r]),u.useEffect((()=>{e.onRequestImportables&&e.onRequestImportables(n).then((e=>{h(e)}))}),[e,n]);const v=u.useCallback(((e,t)=>{let{handleClick:n,modifiers:o,query:i,index:s}=t;if(!o.matchesPredicate)return null;const r=`${e.title}`;return(0,a.jsx)(d.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,a.jsxs)("div",{className:(0,p.default)("omnibar-item",{active:o.active}),children:[(0,a.jsxs)("div",{className:"title",children:[r," ",e.extra?(0,a.jsx)("span",{className:"extra",children:e.extra}):null]}),e.description?(0,a.jsx)("div",{className:"description",children:e.description}):null]})},s)}),[]),g=u.useCallback(((e,t)=>{const n=e.toLowerCase().split("").map((e=>{return`${t=e,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*`;var t})).join(""),o=new RegExp(n);return!!t.title.toLowerCase().match(o)}),[]),I=u.useCallback((t=>{e.onCommand(t.cmd),e.onClose()}),[e]);return i?(0,a.jsx)(l.Omnibar,{query:n,onQueryChange:o,onClose:e.onClose,noResults:(0,a.jsx)(d.MenuItem,{disabled:!0,text:"No results."}),itemPredicate:g,isOpen:e.visible,items:i,initialContent:void 0,onItemSelect:I,itemRenderer:v,inputProps:{placeholder:"Search for nodes or commands.."}}):null}},60698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43490:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31874),t)},31874:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.usePorts=t.useConfirm=t.usePrompt=t.PortsContext=t.defaultPorts=void 0;const s=n(70079),r=n(74762),a=n(84472);i(n(60698),t);const u=e=>async()=>{console.warn(`${e} Not implemented`),(0,a.toastMsg)("Feature not implemented in this context yet","warning")};t.defaultPorts={prompt:async e=>{let{text:t,defaultValue:n}=e;return prompt(`${t}`,n)},openFile:async e=>{},confirm:async e=>{let{text:t}=e;return confirm(t)},readFlow:u("readFlow"),setFlow:u("setFlow"),resolveDeps:u("resolveDeps"),getImportables:u("getImportables"),onExternalFlowChange:u("onExternalFlowChange"),onInstallRuntimeRequest:u("onInstallRuntimeRequest"),onRunFlow:u("onRunFlow"),onStopFlow:u("onStopFlow"),reportEvent:r.noop,generateNodeFromPrompt:u("generateNodeFromPrompt"),hasOpenAiToken:()=>Promise.resolve(!1)},t.PortsContext=(0,s.createContext)(t.defaultPorts);t.usePrompt=()=>{const e=(0,s.useContext)(t.PortsContext).prompt;return(t,n)=>e({text:t,defaultValue:n})};t.useConfirm=()=>{const e=(0,s.useContext)(t.PortsContext).confirm;return t=>e({text:t})};t.usePorts=()=>(0,s.useContext)(t.PortsContext)},65758:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelected=void 0;const i=n(74762),s=o(n(53865)),r=n(22513);t.groupSelected=async(e,t,n,o,a)=>{const{instances:u,connections:l}=t,c=u.filter((t=>e.includes(t.id))),d=l.filter((t=>{let{from:n,to:o}=t;return-1!==e.indexOf(n.insId)||-1!==e.indexOf(o.insId)}));if(!c.length)throw new Error("visual without selections");const{visualNode:p,renamedInputs:f,renamedOutputs:m}=await(0,r.createGroup)(c,d,n,a),h=c.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),u[0].pos),v="ref"===o?(0,i.nodeInstance)((0,i.createInsId)(p),p.id,{},h):(0,i.inlineNodeInstance)((0,i.createInsId)(p),p,{},h),g=u.filter((t=>-1===e.indexOf(t.id))),I=l.map((e=>{const t=`${e.from.insId}.${e.from.pinId}`,n=`${e.to.insId}.${e.to.pinId}`;return f[n]?{...e,to:{insId:v.id,pinId:f[n]}}:m[t]?{...e,from:{insId:v.id,pinId:m[t]}}:e})).filter((t=>-1===e.indexOf(t.from.insId)&&-1===e.indexOf(t.to.insId)));return{newNode:p,currentNode:(0,s.default)(t,(e=>{e.instances=[...g,v],e.connections=I}))}}},74089:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(97106),t),i(n(18420),t),i(n(90680),t),i(n(84472),t),i(n(17102),t),i(n(82232),t),i(n(25779),t),i(n(25804),t),i(n(9958),t),i(n(68120),t),i(n(94651),t),i(n(73470),t),i(n(94007),t),i(n(60190),t),i(n(9001),t),i(n(7047),t),i(n(23386),t)},31745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoTooltip=void 0;const o=n(35250),i=n(50382),s=n(50382),r=n(44470),a=n(50382);t.InfoTooltip=e=>{const{content:t}=e;return(0,o.jsx)(s.Tooltip,{content:t,placement:"top",className:"info-tooltip",children:(0,o.jsx)(i.Icon,{icon:(0,o.jsx)(r.InfoSign,{className:a.Classes.INTENT_PRIMARY}),intent:i.Intent.SUCCESS,className:"info-tooltip-icon"})})}},83938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserOnlyReactJson=void 0;const o=n(35250);t.BrowserOnlyReactJson=e=>{if("undefined"==typeof window)return null;const t=n(73541).Z;return(0,o.jsx)(t,{...e})}},94651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsValueRenderer=void 0;const o=n(35250),i=n(74762),s=n(83938);t.AnalyticsValueRenderer=e=>{let{val:t}=e;try{const e=JSON.parse(t),n="object"==typeof e?e:{value:e},r=e&&[e.type,e.key,e.props,e.ref].every(i.isDefined),a=r?{jsxValue:e}:n;return(0,o.jsx)(s.BrowserOnlyReactJson,{src:a,collapseStringsAfterLength:50,collapsed:r})}catch(n){return(0,o.jsx)(s.BrowserOnlyReactJson,{src:{value:t},collapseStringsAfterLength:50})}}},22513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=void 0;const o=n(74762),i=n(74762),s=n(60190),r=n(88593);t.createGroup=async(e,t,n,a)=>{if(0===e.length)throw new Error("cannot create group without instances");const u=e.map((e=>e.id)),l=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return!t&&n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.to,e.to)))===t)),c=t.filter((e=>{const t=u.includes(e.from.insId),n=u.includes(e.to.insId);return t&&!n})).filter(((e,t,n)=>n.findIndex((t=>(0,i.connectionNodeEquals)(t.from,e.from)))===t));let d={},p={},f={},m={};const h=[],v={};for(const o of l){const e=`${o.to.insId}.${o.to.pinId}`,t=`${o.from.insId}.${o.from.pinId}`,n=o.to.pinId;if(f[t]){h.push({from:(0,i.externalConnectionNode)(f[t]),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)});continue}const r=v[n]?await a(`Name this input (${n} of ${o.to.insId}) is already taken:`)||`i${(0,s.rnd)()}`:n;d[e]=r,f[t]=r,h.push({from:(0,i.externalConnectionNode)(r),to:(0,i.connectionNode)(o.to.insId,o.to.pinId)}),v[r]=(0,i.nodeInput)()}const g={};for(const r of c){const e=`${r.to.insId}.${r.to.pinId}`,t=`${r.from.insId}.${r.from.pinId}`,n=r.from.pinId;if(m[e]){h.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(m[e])});continue}const u=g[n]?await a(`Name this output (${n} of ${r.from.insId} is already taken:`)||`i${(0,s.rnd)()}`:n;p[t]=u,m[e]=u,h.push({from:(0,i.connectionNode)(r.from.insId,r.from.pinId),to:(0,i.externalConnectionNode)(u)}),g[u]=(0,o.nodeOutput)()}e.reduce(((e,t)=>(0,i.middlePos)(t.pos,e)),e[0].pos);const I=t.filter((e=>u.includes(e.from.insId)&&u.includes(e.to.insId)));return{visualNode:{id:n,inputs:v,outputs:g,instances:e,defaultStyle:{size:"large",color:(0,o.pickRandom)(r.nodeStylePresetColors.map((e=>e.color)))},inputsPosition:(0,o.okeys)(v).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:0}})),{}),outputsPosition:(0,o.okeys)(g).reduce(((e,t,n)=>({...e,[t]:{x:0+100*n,y:400}})),{}),connections:[...I,...h],completionOutputs:(0,o.okeys)(g)},renamedInputs:d,renamedOutputs:p}}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightText=void 0;const o=n(35250);function i(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}t.highlightText=(e,t)=>{let n=0;const s=t.split(/\s+/).filter((e=>e.length>0)).map(i);if(0===s.length)return[e];const r=new RegExp(s.join("|"),"gi"),a=[];for(;;){const t=r.exec(e);if(!t)break;const i=t[0].length,s=e.slice(n,r.lastIndex-i);s.length>0&&a.push(s),n=r.lastIndex,a.push((0,o.jsx)("strong",{children:t[0]},n))}const u=e.slice(n);return u.length>0&&a.push(u),a}},17102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Loader=void 0;const o=n(35250);t.Loader=()=>(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)("svg",{width:"38",height:"38",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:"#007ec6",children:(0,o.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,o.jsxs)("g",{transform:"translate(1 1)",strokeWidth:"2",children:[(0,o.jsx)("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),(0,o.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:(0,o.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})})})},23386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;const o=n(74762);t.logger=(0,o.debugLogger)("editor")},561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preloadMonaco=void 0;const o=n(51848),i=n(23386);let s=!1;t.preloadMonaco=()=>{s||o.loader.init().then((()=>{(0,i.logger)("monaco preloaded"),s=!0}))}},68120:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHotkeys=t.currentHotkeys=void 0;const i=o(n(45240)),s=n(70079);t.currentHotkeys=new Map,t.useHotkeys=function(e,n,o,r,a){void 0===r&&(r=[]);const u=(0,s.useCallback)((function(){a&&!a.current||n(...arguments)}),[...r,n]);(0,s.useEffect)((()=>((0,i.default)(e,{},u),t.currentHotkeys.set(e,o),()=>{t.currentHotkeys.delete(e),i.default.unbind(e,u)})),[e,u,o])}},94007:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeSessionStorage=t.safeLocalStorage=void 0,t.safeLocalStorage={getItem:function(){try{return localStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return localStorage.setItem(...arguments)}catch(e){return null}}},t.safeSessionStorage={getItem:function(){try{return sessionStorage.getItem(...arguments)}catch(e){return null}},setItem:function(){try{return sessionStorage.setItem(...arguments)}catch(e){return null}}}},90680:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocalStorage=t.useResizePref=t.userPreferences=t.useUserPref=void 0;const r=s(n(70079)),a=n(18420),u=n(94007);t.useUserPref=(e,n)=>{const[o,i]=r.useState((()=>{const o=t.userPreferences.getItem(e);return(0,a.isDefined)(o)?o:n}));r.useEffect((()=>{const o=t.userPreferences.getItem(e),s=(0,a.isDefined)(o)?o:n;i(s)}),[e]);return[o,n=>{t.userPreferences.setItem(e,n),i(n)}]},t.userPreferences=(()=>{const e=e=>`up.${e}`;return{getItem:t=>{const n=u.safeLocalStorage.getItem(e(t))||"",o=u.safeSessionStorage.getItem(e(t))||"";try{return JSON.parse(o||n).value}catch(i){return}},setItem:function(t,n,o){void 0===o&&(o=!1);const i=o?sessionStorage:u.safeLocalStorage;try{const o=JSON.stringify({value:n});return i.setItem(e(t),o),!0}catch(s){return console.error("Error saving user preference",s),!1}}}})();t.useResizePref=(e,n)=>{const o=`resize.${e}`;return(0,t.useUserPref)(o,n)};const l=e=>{const t=u.safeLocalStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch(n){return null}};t.useLocalStorage=(e,t)=>{const[n,o]=r.useState(l(e)||t),i=r.useCallback((t=>{u.safeLocalStorage.setItem(e,JSON.stringify({value:t})),o(t)}),[e]);return r.useEffect((()=>{l(e)||u.safeLocalStorage.setItem(e,JSON.stringify({value:t}))}),[e,t,i]),[n,i]}},60190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.totalEnergy=t.itrPhysics=t.hookes=t.coulombs=t.vToStr=t.vNorm=t.vLen=t.vSub=t.vAdd=t.vDiv=t.vMul=t.vZero=t.rnd=t.vec=t.size=void 0;t.size=(e,t)=>({width:e,height:t});t.vec=(e,t)=>({x:e,y:t});t.rnd=function(e,t){return void 0===e&&(e=100),void 0===t&&(t=0),Math.floor(Math.random()*(e-t))+t},t.vZero={x:0,y:0};t.vMul=(e,t)=>{let{x:n,y:o}=e;return{x:n*t,y:o*t}};t.vDiv=(e,n)=>{let{x:o,y:i}=e;return(0,t.vMul)({x:o,y:i},1/n)};t.vAdd=(e,t)=>({x:e.x+t.x,y:e.y+t.y});t.vSub=(e,n)=>(0,t.vAdd)(e,(0,t.vMul)(n,-1));t.vLen=e=>{let{x:t,y:n}=e;return Math.sqrt(t*t+n*n)};t.vNorm=e=>(0,t.vDiv)(e,(0,t.vLen)(e)||1);t.vToStr=e=>{let{x:t,y:n}=e;return`${t.toFixed(1)},${n.toFixed(1)}`};t.coulombs=(e,n,o)=>{const i=(0,t.vLen)((0,t.vSub)(e.p,n.p));if(0===i){const i=(0,t.vec)(2*Math.random()-1,2*Math.random()-1),s=e.m*n.m/Math.pow(10,2);return(0,t.vMul)(i,s*o)}{const s=(0,t.vNorm)((0,t.vSub)(n.p,e.p)),r=e.m*n.m/Math.pow(i+.1,2);return(0,t.vMul)(s,r*o)}};t.hookes=(e,n,o,i,s)=>{const r=(0,t.vLen)((0,t.vSub)(e.p,n.p)),a=(0,t.vNorm)((0,t.vSub)(e.p,n.p));let u=0;return ri&&(u=i-r),(0,t.vMul)(a,s*u)};t.itrPhysics=(e,n)=>{const{p:o,v:i,f:s,m:r}=n,a=(0,t.vDiv)(s,r),u=e/1e3,l=(0,t.vAdd)((0,t.vMul)(a,u),i),c=(0,t.vAdd)((0,t.vMul)(l,u),o);return{...n,p:c,v:l,f:(0,t.vec)(0,0)}};t.totalEnergy=e=>e.reduce(((e,n)=>{const o=(0,t.vLen)(n.v);return e+.5*n.m*o*o}),0)},84472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateToast=t.toastMsg=t.AppToaster=void 0;const o=n(50382);t.AppToaster=(()=>{try{return o.OverlayToaster.create({className:"app-toaster",position:o.Position.BOTTOM_RIGHT})}catch(e){return{}}})();t.toastMsg=(e,n,o)=>t.AppToaster.show({message:e,intent:n,timeout:o});t.updateToast=(e,n,o)=>t.AppToaster.show({message:n,intent:o},e)},18420:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultAnd=t.isLocal=t.fullTime=t.timeAgoFromDt=t.timeAgo=t.toString=t.isDefined=t.set=t.createOmap=t.toOmap=t.values=t.keys=t.entries=void 0;const i=n(7047),s=n(74762),r=o(n(73136));t.entries=e=>Object.keys(e).map((t=>[t,e[t]]));t.keys=e=>Object.keys(e);t.values=e=>Object.keys(e).map((t=>e[t]));t.toOmap=e=>Array.from(e.entries()).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});t.createOmap=function(e){return void 0===e&&(e=[]),e.reduce(((e,t)=>({...e,[t[0]]:t[1]})),{})};t.set=(e,t,n)=>{e[t]=n};t.isDefined=e=>void 0!==e;t.toString=e=>{const t=typeof e;if(""===e)return"(empty string)";if((0,i.isJsxValue)(e))return"JSX Value";if((0,s.isStaticValueVisualNode)(e))return"Embedded Node";if((0,s.isEnvValue)(e))return(0,s.getEnvKeyFromValue)(e);if("object"===t)try{const t=JSON.stringify(e);return"{}"===t?"Empty object":t}catch(n){return"Object (cannot stringify)"}return`${e}`};t.timeAgo=e=>(0,r.default)(new Date(e)).fromNow();t.timeAgoFromDt=e=>(0,r.default)(Date.now()-e).fromNow();t.fullTime=e=>(0,r.default)(new Date(e)).toString();t.isLocal=()=>location.href.includes(":300");t.preventDefaultAnd=e=>t=>{t.preventDefault(),e(t)}},67181:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ActionButton=t.ActionsMenu=t.ActionType=void 0;const r=n(35250),a=n(50382),u=n(50382),l=n(74762),c=s(n(70079)),d=n(86125),p=n(43490),f=n(68120),m=n(90680),h=n(84472),v=n(9971),g=n(47749),I=n(46334),b=n(47230),y=n(41032);var C;!function(e){e.AddNode="add-node",e.RemoveNode="remove-node",e.Group="group",e.UnGroup="un-group",e.AddInlineValue="add-inline-value",e.Inspect="inspect",e.Run="run",e.AI="ai"}(C=t.ActionType||(t.ActionType={}));t.ActionsMenu=e=>{const{onAction:n,selectedInstances:o,resolvedNodes:i,node:s,from:u,to:g,hotkeysEnabled:x,showRunFlowOptions:N}=e,{onRequestImportables:w}=(0,d.useDependenciesContext)(),[j,E]=c.default.useState(!1),[P,O]=c.default.useState(!1),[S,D]=c.default.useState(!1),[M,T]=c.default.useState(null),[k,R]=(0,m.useLocalStorage)("hideHotkeyHintMap",{}),A=(0,c.useCallback)((()=>{E(!1)}),[]),{onRunFlow:V,generateNodeFromPrompt:$,reportEvent:z}=(0,p.usePorts)(),H=(0,c.useCallback)(((e,t)=>(O(!1),V(e,t))),[V]),F=[];if(F.push(C.AddNode),F.push(C.AddInlineValue),1===o.length){const e=s.instances.find((e=>e.id===o[0]));if(e)try{const t=(0,y.safelyGetNodeDef)(e,i);(0,l.isVisualNode)(t)&&F.push(C.UnGroup)}catch(U){console.error(`Could not find node with id ${o[0]} - ${U}`)}else console.error(`Could not find instance with id ${o[0]}`)}N&&F.push(C.Run),o.length>0&&F.push(C.Group),(1===o.length||u||g)&&F.push(C.Inspect),o.length>0&&F.push(C.RemoveNode),F.push(C.AI);const L=(0,c.useCallback)(((e,t)=>{R({...k,[e]:!0}),h.AppToaster.dismiss(t)}),[k,R]),q=(0,c.useCallback)(((e,t)=>{const{hotkey:o}=_[e];if("click"===t.type&&o&&!k[o]){const t=(0,h.toastMsg)((0,r.jsxs)(r.Fragment,{children:["Did you know? you can also use the hotkey"," ",(0,r.jsx)("kbd",{className:"hotkey",children:o})," to"," ",_[e].text.replace(/^[A-Z]/,(e=>e.toLowerCase())),(0,r.jsxs)(a.Button,{minimal:!0,small:!0,onClick:()=>L(o,t),children:[" ","Don't show again"," "]})]}),"none",3e3)}switch(e){case C.AddNode:E(!0);break;case C.Run:!async function(){O(!0)}();break;case C.AI:D(!0);break;default:n({type:e,data:void 0})}}),[k,n,L,s.inputs]);Object.entries(_).forEach((e=>{let[t,n]=e;n.hotkey&&(0,f.useHotkeys)(n.hotkey,(e=>{e.preventDefault(),F.includes(t)&&(q(t,e),R({...k,[n.hotkey]:!0}))}),{text:n.text,group:"Action menu hotkeys"},[F],x)}));const G=(0,c.useCallback)((e=>{n({type:C.AddNode,data:{importableNode:e}})}),[n]),B=(0,c.useCallback)((async e=>{const t=Date.now();T(t);try{z("generateNodeFromPrompt:start",{promptLength:e.length});const o=await $({prompt:e}),{inputs:i,outputs:s}=o.importableNode.node,r=Date.now()-t;z("generateNodeFromPrompt:success",{totalTime:r,inputs:Object.keys(i),outputs:Object.keys(s)}),T(null),n({type:C.AI,data:o}),D(!1)}catch(U){T(null),h.AppToaster.show({message:"Failed to generate node",intent:"danger"}),z("generateNodeFromPrompt:failure",{error:U.message})}}),[$,n,z]);return(0,r.jsxs)("div",{className:"actions-menu",children:[F.map((e=>(0,r.jsx)(t.ActionButton,{type:e,onClick:q},e))),j?(0,r.jsx)(v.AddNodeMenu,{onRequestImportables:w,onAddNode:G,onClose:A}):null,P?(0,r.jsx)(b.RunFlowModal,{onClose:()=>O(!1),onRun:H,node:s}):null,S?(0,r.jsx)(I.PromptAIMenu,{onClose:()=>{D(!1),T(null)},onSubmit:B,submitting:null!==M,submitTime:M}):null]})};const _={[C.AddNode]:{icon:g.addNodeIcon,text:'Open the "add node" menu',hotkey:"a"},[C.RemoveNode]:{icon:g.removeNodeIcon,text:"Remove selected instances",hotkey:"backspace"},[C.Group]:{icon:g.groupIcon,text:"Group selection into a new node",hotkey:"g"},[C.UnGroup]:{icon:g.ungroupIcon,text:"Ungroup selected visual node"},[C.Inspect]:{icon:g.inspectIcon,text:"Inspect data",hotkey:"i"},[C.AddInlineValue]:{icon:g.pencilIcon,text:"Add value / inline function",hotkey:"v"},[C.Run]:{icon:g.playIcon,text:"Run flow",hotkey:"r"},[C.AI]:{icon:g.starIcon,text:"Generate new code node using AI \u2728"}},x={icon:"",text:"N/A",hotkey:void 0};t.ActionButton=e=>{var t;const{onClick:n,type:o}=e,i=(0,c.useCallback)((e=>n(o,e)),[n,o]),s=null!==(t=_[o])&&void 0!==t?t:x,a=s.hotkey?(0,r.jsxs)("span",{children:[s.text," ",(0,r.jsx)("kbd",{className:"hotkey",children:s.hotkey})]}):s.text;return(0,r.jsx)("div",{className:"action-button",onClick:i,"data-type":o,children:(0,r.jsx)(u.Tooltip,{hoverOpenDelay:100,content:a,className:"icon-wrapper",popoverClassName:"action-button-tooltip",children:(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:s.icon}})})})}},40149:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenu=t.AddNodeMenuFilterTree=void 0;const a=n(35250),u=n(50382),l=n(74762),c=r(n(26372)),d=s(n(70079)),p=n(43490),f=n(31745),m=n(17102),h=n(87935),v=n(74657),g=n(44470);t.AddNodeMenuFilterTree=u.Tree.ofType();function I(e,t,n){return[...e.external.map((e=>({id:e.module,label:e.module,hasCaret:!0,nodeData:{type:"external",module:e.module},isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module,isExpanded:n.has(e.module),childNodes:e.namespaces.map((o=>({id:`${e.module}/${o}`,label:o,hasCaret:!1,isSelected:"external"===(null==t?void 0:t.type)&&t.module===e.module&&t.namespace===o,isExpanded:n.has(`${e.module}/${o}`),nodeData:{type:"external",module:e.module,namespace:o}})))}))),{id:"internal",label:"Current Project",nodeData:{type:"internal"},isExpanded:n.has("internal"),hasCaret:!0,isSelected:"internal"===t.type,childNodes:e.internal.files.map((e=>({id:e,label:e,isSelected:"internal"===t.type&&t.file===e,hasCaret:!1,isExpanded:n.has(e),nodeData:{type:"internal",file:e}})))}]}function b(e){return/\.flyde(\.[jt]s)?$/.test(e.module)}t.AddNodeMenu=e=>{const{onRequestImportables:n,onAddNode:o,onClose:i}=e,[s,r]=d.default.useState(),[y,C]=d.default.useState([]),[_,x]=d.default.useState(new Set),[N,w]=d.default.useState(""),[j,E]=d.default.useState({type:"all"}),[P,O]=d.default.useState(null),[S,D]=d.default.useState(null),[M,T]=d.default.useState(null),k=(0,d.useCallback)((e=>{_.add(e.id),x(new Set(_))}),[_]),R=(0,d.useCallback)((e=>{_.delete(e.id),x(new Set(_))}),[_]),A=(0,d.useCallback)((e=>{o(e),i()}),[o,i]),{onInstallRuntimeRequest:V,reportEvent:$}=(0,p.usePorts)();(0,d.useEffect)((()=>{$("addNodeMenuOpen",{})}),[$]),(0,d.useEffect)((()=>{D(null==s?void 0:s.flatMap((e=>{var t,n,o;if(j)if("external"===j.type){if((e.module!==j.module||j.namespace)&&e.node.namespace!==j.namespace)return[]}else if("internal"===j.type&&(!b(e)||j.file&&e.module!==j.file))return[];if(N){const i=`${null!==(n=null===(t=e.node.searchKeywords)||void 0===t?void 0:t.join(" "))&&void 0!==n?n:[]} ${e.node.id} ${null!==(o=e.node.namespace)&&void 0!==o?o:""} ${e.node.description}`.toLowerCase().indexOf(N.toLowerCase());return-1===i?[]:[{importable:e,score:i}]}return[{importable:e,score:1}]})).sort(((e,t)=>e.score-t.score)).map((e=>{let{importable:t}=e;return t})))}),[s,j,N]),(0,d.useEffect)((()=>{n().then((e=>{let{importables:t,errors:n}=e;C(n);const o=t.filter((e=>!b(e))).reduce(((e,t)=>{var n,o,i;null!==(n=e[i=t.module])&&void 0!==n||(e[i]=[]);const s=null!==(o=t.node.namespace)&&void 0!==o?o:"";return e[t.module].includes(s)||e[t.module].push(s),e}),{}),i=t.filter(b).map((e=>e.module));O({external:Object.entries(o).map((e=>{let[t,n]=e;return{module:t,namespaces:n}})),internal:{files:i}}),r(t),x(new Set(["internal",...Object.keys(o)]))}))}),[n]);const z=(0,d.useCallback)((e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),S&&!M)return void T(S["ArrowDown"===e.key?0:S.length-1]);if(S&&M){const t=S.findIndex((e=>e===M));let n="ArrowDown"===e.key?t+1:t-1;n=n<0?S.length-1:n,n=n>=S.length?0:n,T(S[n])}break;case"Enter":M&&A(M)}}),[S,M,A]),H=(0,d.useCallback)((e=>{let{nodeData:t}=e;JSON.stringify(t)===JSON.stringify(j)?"external"===t.type?t.namespace?E({type:"external",module:t.module}):E({type:"all"}):"internal"===t.type&&(t.file?E({type:"internal"}):E({type:"all"})):E(t)}),[j]),F=!s||s.some((e=>e.module.includes("@flyde/stdlib"))),L=(0,d.useCallback)((()=>{V(),i()}),[i,V]);return(0,a.jsx)(u.Dialog,{isOpen:!0,title:"Add Node Menu",onClose:e.onClose,className:"add-node-menu",isCloseButtonShown:!0,children:(0,a.jsxs)("main",{className:(0,c.default)(u.Classes.DIALOG_BODY),children:[(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"bp5-input-group",children:[(0,a.jsx)(g.Search,{}),(0,a.jsx)("input",{className:"bp5-input",type:"search",placeholder:"Search input",dir:"auto",autoFocus:!0,onChange:e=>w(e.target.value),value:N,onKeyDown:z})]}),F?null:(0,a.jsxs)(u.Callout,{intent:u.Intent.NONE,style:{marginTop:10},children:["Using built-in @flyde/stdlib. It's recommended to explicitly install it instead."," ",(0,a.jsx)(u.Button,{minimal:!0,small:!0,intent:u.Intent.PRIMARY,onClick:L,children:"Click here to install it using npm/yarn"})]})]}),(0,a.jsx)("div",{className:"content-wrapper",children:s?(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsxs)("aside",{children:[(0,a.jsxs)("div",{className:"filter-header",children:["Filter by package"," ",(0,a.jsx)(u.Tooltip,{content:(0,a.jsxs)("span",{children:["Click to learn more about how packages work in Flyde"," "]}),hoverCloseDelay:1500,children:(0,a.jsx)("a",{target:"_blank",href:"https://www.flyde.dev/docs/packages",rel:"noreferrer",children:(0,a.jsx)(u.Icon,{icon:(0,a.jsx)(g.Help,{}),intent:"primary",iconSize:12})})})]}),(0,a.jsx)("div",{className:"tree-container",children:(0,a.jsx)(t.AddNodeMenuFilterTree,{contents:I(P,j,_),onNodeCollapse:R,onNodeExpand:k,onNodeClick:H,className:u.Classes.ELEVATION_0})})]}),(0,a.jsx)("main",{children:S?0===S.length?(0,a.jsxs)("div",{className:"no-results",children:[(0,a.jsx)(v.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:E,query:N,onChangeQuery:w,resultsCount:S.length}),(0,a.jsxs)(u.Callout,{className:"callout",intent:"primary",children:["Can't find a suitable node? Create one yourself!"," ",(0,a.jsx)("a",{href:"https://www.flyde.dev/docs/code-nodes",target:"_blank",rel:"noreferrer",children:"Learn more"})]})]}):(0,a.jsxs)(d.default.Fragment,{children:[(0,a.jsx)(v.AddNodeMenuResultsSummary,{filter:j,onChangeFilter:E,query:N,onChangeQuery:w,resultsCount:S.length}),(0,a.jsx)("div",{className:"results",children:S.map((e=>(0,a.jsx)(h.AddNodeMenuListItem,{importableNode:e,onAdd:A,selected:(null==M?void 0:M.node)===e.node,onSelect:T,onSetFilter:E},e.node.id+e.node.namespace+e.module)))})]}):(0,a.jsx)(m.Loader,{})})]}):(0,a.jsx)(m.Loader,{})}),y.length>0?(0,a.jsxs)(u.Callout,{intent:"warning",style:{marginTop:"10px"},children:["Found ",(0,l.simplePluralize)(y.length,"corrupt flow"),(0,a.jsx)(f.InfoTooltip,{content:y.map((e=>{let{path:t,message:n}=e;return`${t}: ${n}`})).join(", ")})," "]}):null]})})}},8470:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuListItem=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079));t.AddNodeMenuListItem=e=>{const{importableNode:t,onSetFilter:n,onAdd:o,onSelect:i}=e,{node:s,module:r}=t,{id:d,description:p}=s,f=c.default.useRef(null);c.default.useEffect((()=>{e.selected&&f.current&&f.current.scrollIntoView({block:"center"})}),[e.selected]);const m=(0,c.useCallback)((()=>{o(t)}),[o,t]),h=(0,c.useCallback)((()=>{i(t)}),[i,t]);return(0,a.jsxs)("div",{className:(0,l.default)("add-node-menu-list-item",{selected:e.selected}),ref:f,onClick:h,children:[(0,a.jsxs)("div",{className:"content",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("span",{className:"id",children:d}),(0,a.jsxs)(u.Tag,{interactive:!0,onClick:()=>n({type:"external",module:r,namespace:s.namespace}),className:"source",minimal:!0,children:[r,s.namespace?` / ${s.namespace}`:null]})]}),(0,a.jsx)("div",{className:"description",children:p||(0,a.jsx)("em",{children:"No description"})})]}),(0,a.jsx)("aside",{children:(0,a.jsx)(u.Button,{onClick:m,children:"Add"})})]})}},87935:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8470),t)},88671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddNodeMenuResultsSummary=void 0;const o=n(35250),i=n(50382);t.AddNodeMenuResultsSummary=e=>{const{resultsCount:t,query:n,filter:s,onChangeFilter:r,onChangeQuery:a}=e;return(0,o.jsxs)("div",{className:"add-node-menu-results-summary",children:[t?`Showing ${t} result${t>1?"s":""}`:"No results found","\xa0",n?(0,o.jsxs)(o.Fragment,{children:["matching query\xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>a(""),children:['"',n,'"']})]}):null,"all"===s.type?null:"external"===s.type?(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["package ",s.module,s.namespace?` / ${s.namespace}`:null]})]}):(0,o.jsxs)(o.Fragment,{children:["from \xa0",(0,o.jsxs)(i.Tag,{minimal:!0,interactive:!0,onRemove:()=>r({type:"all"}),children:["\xa0this project ",s.file?` / ${s.file}`:null]})]})]})}},74657:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88671),t)},9971:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40149),t)},83159:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PromptAIMenu=void 0;const a=n(35250),u=n(50382),l=r(n(26372)),c=s(n(70079)),d=1e4;t.PromptAIMenu=e=>{const{onClose:t}=e,[n,o]=c.default.useState(""),[i,s]=c.default.useState(0);return(0,c.useEffect)((()=>{s(0);const t=setInterval((()=>{s((t=>{const n=(Date.now()-e.submitTime)/d;return Math.min(n+.05*Math.random()/2,.95)}))}),500);return()=>clearInterval(t)}),[e.submitTime]),(0,a.jsxs)(u.Dialog,{isOpen:!0,onClose:t,className:"prompt-ai-menu",title:"\u2728 Generate Code Node using AI",children:[(0,a.jsx)("main",{className:(0,l.default)(u.Classes.DIALOG_BODY),tabIndex:0,children:(0,a.jsx)(u.TextArea,{value:n,disabled:e.submitting,onChange:e=>o(e.target.value),placeholder:"Describe your node in details",fill:!0})}),e.submitTime?(0,a.jsx)("div",{className:"progress-bar-container",children:(0,a.jsx)(u.ProgressBar,{value:i})}):null,(0,a.jsx)("div",{className:u.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:u.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(u.Button,{onClick:t,children:"Close"}),(0,a.jsx)(u.Button,{intent:u.Intent.PRIMARY,className:"run-btn",disabled:e.submitting||!n,loading:e.submitting,onClick:()=>{s(0),e.onSubmit(n)},children:"Create \u2728"})]})})]})}},46334:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(83159),t)},3152:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RunFlowModal=void 0;const a=n(35250),u=s(n(70079)),l=r(n(51848)),c=n(50382),d=r(n(26372)),p=n(90680),f=n(31745);t.RunFlowModal=u.memo((function(e){const{onRun:t,onClose:n,node:o}=e,[i,s]=u.useState(0),[r,m]=(0,p.useLocalStorage)(`run-inputs-${o.id}`,Object.keys(o.inputs).reduce(((e,t)=>(e[t]=`Enter a value for input ${t}`,e)),{})),[h,v]=u.useState(JSON.stringify(r,null,2)),g=e=>{e&&e.updateOptions({lineNumbers:"off",minimap:{enabled:!1}})},I=u.useCallback((()=>{const e=JSON.parse(h);m(e),t(e,i)}),[t,m,h,i]),b=Object.keys(o.inputs),y=b.filter((e=>"required"!==o.inputs[e].mode)),C=u.useMemo((()=>b.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:"This node receives external inputs. Enter values for each input below:"}),(0,a.jsx)(l.default,{height:"80px",theme:"vs-dark",defaultLanguage:"json",value:h,onChange:e=>v(null!=e?e:""),onMount:g}),y.length>0?(0,a.jsxs)(c.Callout,{intent:c.Intent.NONE,children:["Note: input(s) ",(0,a.jsx)("code",{children:y.join(", ")})," are optional"]}):null]}):(0,a.jsx)("strong",{children:"This node does not receive any external inputs."})),[b.length,y,h]);return(0,a.jsxs)(c.Dialog,{isOpen:!0,onClose:e.onClose,className:"run-flow-modal",children:[(0,a.jsxs)("main",{className:(0,d.default)(c.Classes.DIALOG_BODY),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&I()},tabIndex:0,children:[C,(0,a.jsxs)("div",{className:"execution-delay-wrapper",children:[(0,a.jsxs)("label",{children:["Execution delay:"," ",(0,a.jsx)(f.InfoTooltip,{content:"Delay between each node execution. Useful for debugging."})]}),(0,a.jsx)(c.Slider,{value:i,onChange:s,min:0,labelStepSize:500,stepSize:100,labelRenderer:e=>`${e}ms`,max:1e3})]})]}),(0,a.jsx)("div",{className:c.Classes.DIALOG_FOOTER,children:(0,a.jsxs)("div",{className:c.Classes.DIALOG_FOOTER_ACTIONS,children:[(0,a.jsx)(c.Button,{onClick:n,children:"Close"}),(0,a.jsx)(c.Button,{onClick:I,intent:c.Intent.PRIMARY,className:"run-btn",children:"Run"})]})})]})}))},47230:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3152),t)},47749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starIcon=t.stopIcon=t.playIcon=t.pencilIcon=t.ungroupIcon=t.groupIcon=t.inspectIcon=t.removeNodeIcon=t.addNodeIcon=void 0,t.addNodeIcon='\n\n',t.removeNodeIcon='\n\n',t.inspectIcon='\n\n\n',t.groupIcon='\n\n\n',t.ungroupIcon='\n\n\n',t.pencilIcon='\n\n',t.playIcon='\n\n\n',t.stopIcon='\n\n\n',t.starIcon='\n\n\n\n\n'},1237:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HelpBubble=void 0;const i=n(70079),s=n(35250),r=n(50382),a=n(99489),u=n(50382),l=o(n(70079)),c=n(68120),d=n(71644),p=n(43490),f={offset:{enabled:!0,options:{offset:[0,20]}},preventOverflow:{enabled:!0,options:{padding:10}}};const m=["Viewport Controls","Editing","Selection"];t.HelpBubble=()=>{const[e,t]=l.default.useState(!1),n=Array.from(c.currentHotkeys.entries()).map((e=>{let[t,n]=e;return{combo:(o={key:t,menuData:n}).key,label:o.menuData.text,group:o.menuData.group};var o})).reduce(((e,t)=>(e[t.group]||(e[t.group]=[]),e[t.group].push(t),e)),{}),o=Object.entries(n).sort(((e,t)=>m.indexOf(t[0])-m.indexOf(e[0]))),{reportEvent:h}=(0,p.usePorts)(),v=(0,s.jsx)(r.Dialog,{isOpen:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:r.Classes.DIALOG_BODY,children:o.map((e=>{let[t,n]=e;return(0,s.jsxs)(l.default.Fragment,{children:[(0,s.jsx)(r.H4,{children:t}),n.map((e=>(0,i.createElement)(a.Hotkey,{...e,key:e.combo})))]},t)}))})}),g=(0,s.jsxs)(r.Menu,{children:[(0,s.jsx)(r.MenuItem,{text:"Hotkeys",onClick:()=>{t(!0),h("helpMenuItem",{item:"hotkeys"})}}),(0,s.jsx)(r.MenuItem,{text:"Documentation",onClick:()=>h("helpMenuItem",{item:"documentation"}),href:"https://www.flyde.dev/docs",target:"_blank"}),(0,s.jsx)(r.MenuDivider,{}),(0,s.jsx)(r.MenuItem,{text:"Discord",onClick:()=>h("helpMenuItem",{item:"discord"}),href:"https://discord.gg/x7t4tjZQP8",target:"_blank"})]});return(0,s.jsxs)("div",{className:"help-bubble","data-tip":"Help",children:[(0,s.jsx)(u.Popover,{content:g,modifiers:f,onOpened:()=>h("helpMenuOpen",{}),children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:d.helpIcon}})}),v]})}},71644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpIcon=void 0,t.helpIcon='\n\n\n'},3354:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1237),t)},7011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainInstanceEventsIndicator=void 0;const o=n(35250),i=n(30994),s=n(66189),r=n(50382);t.MainInstanceEventsIndicator=e=>{const{currentInsId:t,ancestorsInsIds:n}=e,{history:a,refreshHistory:u,resetHistory:l}=(0,s.useHistoryHelpers)(t),c=`main-indicator-${t}}`;return(0,o.jsx)("div",{className:"main-instance-events-indicator",children:(0,o.jsx)(r.Tooltip,{content:(0,s.calcHistoryContent)(a),children:(0,o.jsx)("span",{onMouseEnter:u,onMouseOut:l,id:(0,i.getMainInstanceIndicatorDomId)(t,n),className:"status-text","data-tip":"","data-html":!0,"data-for":c})})})}},22714:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7011),t)},63521:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VisualNodeEditor=t.defaultBoardData=t.defaultViewPort=t.NODE_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=n(74762),c=n(86553),d=n(65082),p=n(18420),f=n(26701),m=n(7047),h=n(53865),v=n(70079),g=n(68120),I=r(n(27942)),b=n(50382),y=n(66005),C=n(60190),_=n(71033),x=n(74762),N=n(99942),w=n(44338),j=n(561),E=n(84472),P=n(82232),O=n(18594),S=n(68371),D=r(n(61888)),M=n(65758),T=n(43490),k=r(n(26372)),R=n(25044),A=n(80510),V=n(1788),$=n(2130),z=n(88593),H=n(97106),F=n(67181),L=n(22714),q=n(3354),G=n(41032),B=n(30653),U=u.memo(b.Slider),W=()=>null;t.NODE_HEIGHT=28;t.defaultViewPort={pos:{x:0,y:0},zoom:1},t.defaultBoardData={selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}},t.VisualNodeEditor=u.memo(u.forwardRef(((e,n)=>{const{onChangeNode:o,nodeIoEditable:i,onCopy:s,onGoToNodeDef:r,onInspectPin:J,boardData:Y,onChangeBoardData:K,currentInsId:Q,ancestorsInsIds:X,node:ee,onShowOmnibar:te,resolvedDependencies:ne,queuedInputsData:oe,initialPadding:ie,disableScrolling:se}=e,{onImportNode:re}=(0,H.useDependenciesContext)(),ae=(0,B.useDarkMode)(),{reportEvent:ue}=(0,T.usePorts)(),le=e.parentViewport||t.defaultViewPort,[ce,de]=(0,v.useState)({...ne,[ee.id]:ee});(0,v.useEffect)((()=>{de({...ne,[ee.id]:ee})}),[ne,ee]);const{selected:pe,from:fe,to:me}=Y,{instances:he,connections:ve,inputsPosition:ge,outputsPosition:Ie,inputs:be,outputs:ye}=ee,[Ce,_e]=(0,v.useState)(),[xe,Ne]=(0,v.useState)(),we=void 0===X,[je,Ee]=(0,v.useState)(0),[Pe,Oe]=(0,v.useState)(),[Se,De]=(0,v.useState)(!1),[Me,Te]=(0,v.useState)(),[ke,Re]=(0,v.useState)(),[Ae,Ve]=(0,v.useState)(),[$e,ze]=(0,v.useState)(),He=(0,v.useRef)();(0,f.useDidMount)((()=>{He.current=Xe.current.querySelector(".inline-editor-portal-root")}));const Fe=(0,T.useConfirm)(),Le=(0,T.usePrompt)(),qe=Y.viewPort,Ge=(0,v.useRef)(!0),[Be,Ue]=(0,v.useState)(null),We=u.useCallback((e=>{K({viewPort:e})}),[K]),Ze=u.useCallback(((e,t)=>J(e,t)),[J]),Je=u.useCallback(((e,t,n)=>{const i=(0,A.handleConnectionCloseEditorCommand)(ee,{from:e,to:t}),s=(0,l.isInternalConnectionNode)(t)?he.find((e=>e.id===t.insId)):null,r=(s?s.inputConfig:{})[t.pinId],a=(0,l.isStaticInputPinConfig)(r)?(0,V.handleDetachConstEditorCommand)(i,t.insId,t.pinId):i;o(a,(0,P.functionalChange)("close-connection")),K({from:void 0,to:void 0}),ue("createConnection",{source:n})}),[he,o,K,ee,ue]),Ye=u.useCallback((async()=>{const e=await Le("New visual node name?");if(!e)return;const{currentNode:t}=await(0,M.groupSelected)(Y.selected,ee,e,"inline",Le);o(t,(0,P.functionalChange)("group node")),(0,E.toastMsg)("Node grouped"),ue("groupSelected",{count:Y.selected.length})}),[Le,Y.selected,o,ee,ue]);(0,v.useEffect)((()=>{if(Pe){const e=setTimeout((()=>{Oe(void 0)}),350);return()=>clearTimeout(e)}}),[Pe]);const[Ke,Qe]=(0,v.useState)();(0,v.useEffect)((()=>{(0,j.preloadMonaco)()}),[]);const Xe=(0,v.useRef)(),et=(0,I.default)(Xe),tt=u.useRef({x:400,y:400}),nt=(0,f.useBoundingclientrect)(Xe)||C.vZero,ot=()=>{const e=(0,m.fitViewPortToNode)(ee,ce,et);(0,m.animateViewPort)(qe,e,500,(e=>{We(e)}))},it=u.useCallback(((e,t)=>{const{to:n,from:o}=Y,i="input"===t?o:n,s="input"===t?n:o,r={pinId:e,insId:l.THIS_INS_ID},a="input"===t?{from:r}:{to:r};i&&i.pinId===e?K({from:void 0,to:void 0}):s?"input"===t&&n?Je(r,n,"nodeIoClick"):o&&Je(o,r,"nodeIoClick"):K(a)}),[Y,K,Je]),st=u.useCallback(((e,t,n)=>{const i=(0,h.produce)(ee,(o=>{"input"===e?o.inputs[t].description=n:o.outputs[t].description=n}));o(i,(0,P.functionalChange)("Node io description"))}),[o,ee]),rt=u.useCallback(((e,t,n)=>{const{from:o,to:i}=Y;if(fe&&fe.insId===e.id||me&&me.insId===e.id)K({from:void 0,to:void 0});else if("input"===n){const n={insId:e.id,pinId:t};!i||i.pinId!==t||(0,l.isInternalConnectionNode)(i)&&i.insId!==e.id?fe?Je(fe,n,"pinClick"):K({to:n,selected:[]}):K({to:void 0})}else{const n={insId:e.id,pinId:t};!o||o.pinId!==t||(0,l.isInternalConnectionNode)(o)&&o.insId!==e.id?me?Je(n,me,"pinClick"):K({from:n,selected:[]}):K({from:void 0})}}),[Y,fe,K,Je,me]);(0,v.useEffect)((()=>{if(!Se&&et.width){const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);We(t);const n=setTimeout((()=>{const t=(0,m.fitViewPortToNode)(ee,ce,et,ie);e.thumbnailMode||We(t),De(!0)}),100);return()=>clearTimeout(n)}}),[ee,ie,et,e.thumbnailMode,Se,ce,We]);const at=u.useCallback((()=>{const{selected:e}=Y,t=ee.instances.filter((t=>e.includes(t.id))).map((e=>({...e,id:e.id+"-copy"}))),n=ee.connections.filter((t=>{let{from:n,to:o}=t;return e.includes(n.insId)&&e.includes(o.insId)}));s({instances:t,connections:n})}),[Y,s,ee]),ut=u.useCallback((()=>{const{newNode:t,newInstances:n}=(0,R.pasteInstancesCommand)(ee,tt.current,e.clipboardData);o(t,(0,P.functionalChange)("paste instances")),K({selected:n.map((e=>e.id))})}),[o,K,ee,e.clipboardData]),lt=u.useCallback((()=>{const e=ee.id;Ke?"input"===Ke.type?Ke.ins.id===e?it(Ke.pin,"input"):rt(Ke.ins,Ke.pin,"input"):Ke.ins.id===e?it(Ke.pin,"output"):rt(Ke.ins,Ke.pin,"output"):console.warn("tried selecting closest with no pin nearby")}),[ee.id,Ke,it,rt]),ct=u.useCallback(((e,t)=>{const n=Math.min(Math.max(e,.1),3),o="mouse"===t?tt.current:{x:qe.pos.x+et.width/2,y:qe.pos.y+et.height/2},i=(0,m.centerBoardPosOnTarget)(o,et,n,qe);We({...qe,zoom:n,pos:i})}),[We,qe,et]);(0,g.useHotkeys)("cmd+=",(e=>{ct(qe.zoom+.1,"hotkey"),e.preventDefault()}),{text:"Zoom in board",group:"Viewport Controls"},[qe,ct],Ge),(0,g.useHotkeys)("cmd+-",(e=>{ct(qe.zoom-.1,"hotkey"),e.preventDefault()}),{text:"Zoom out board",group:"Viewport Controls"},[ct,qe.zoom],Ge),(0,g.useHotkeys)("cmd+o",(e=>{e.preventDefault(),(0,E.toastMsg)("Ordering");const t=[];(0,N.orderVisualNode)(ee,ce,200,((e,n)=>{n%3==0&&t.push(e)})),(async()=>{for(;t.length;){const e=t.shift();(0,E.toastMsg)(`Step ${t.length}!`),await(0,l.delay)(200),o(e,(0,P.metaChange)("order-step")),(0,E.toastMsg)(`Step ${t.length}! done`)}})()}),{text:"Auto-layout (experimental)",group:"Misc."},[o,ee,ne],Ge),(0,g.useHotkeys)("cmd+0",(e=>{ct(1),e.preventDefault()}),{text:"Reset zoom",group:"Viewport Controls"},[qe,ct],Ge);const dt=()=>{K({from:void 0,to:void 0,selected:[]})},pt=u.useCallback(((e,t)=>{_e(e.id),o({...ee},(0,P.metaChange)("drag-start"))}),[o,ee]),ft=u.useCallback(((e,t,n)=>{const{newValue:i,newSelected:s}=(0,m.handleInstanceDrag)(ee,e,n,t,pe,Ce);o(i,(0,P.metaChange)("drag-move")),s&&K({selected:s})}),[Ce,o,K,pe,ee]),mt=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(void 0)}),[]),ht=u.useCallback(((e,t)=>{t.preventDefault(),t.stopPropagation(),_e(l.THIS_INS_ID)}),[]),vt=u.useCallback((async(t,n,o,i)=>{o.preventDefault(),o.stopPropagation();const{x:s,y:r}=i,a=(0,h.produce)(ee,(e=>{"input"===t?e.inputsPosition[n]={x:s,y:r}:e.outputsPosition[n]={x:s,y:r}}));e.onChangeNode(a,(0,P.metaChange)("node-io-drag-move"))}),[e,ee]),gt=u.useCallback((async(e,t,n,o)=>{n.preventDefault(),n.stopPropagation(),_e(void 0)}),[]),It=u.useCallback(((e,t)=>{let{id:n}=e;const o=t.shiftKey?pe.filter((e=>e!==n)):[],i=t.shiftKey?[...pe,n]:[n],s=pe.includes(n)?o:i;K({selected:s,from:void 0,to:void 0})}),[K,pe]),bt=u.useCallback((()=>{const e=ee.instances.map((e=>e.id));K({selected:e,from:void 0,to:void 0})}),[K,ee.instances]),yt=u.useCallback((e=>{const t=ve.filter((t=>{let{from:n,to:o}=t;return-1===e.indexOf(n.insId)&&-1===e.indexOf(o.insId)})),n=(0,h.produce)(ee,(n=>{n.connections=t,n.instances=n.instances.filter((t=>!e.includes(t.id)))}));K({selected:[]}),o(n,(0,P.functionalChange)("delete-ins"))}),[ve,o,K,ee]),Ct=u.useCallback((e=>{yt([e.id])}),[yt]),_t=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{"input"===e?(delete n.inputs[t],n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===t)))):(n.connections=n.connections.filter((e=>!((0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===t))),n.completionOutputs=(n.completionOutputs||[]).map((e=>e.split("+").filter((e=>e!==t)).join("+"))).filter((e=>!!e)),delete n.outputs[t])}));fe&&fe.insId===l.THIS_INS_ID&&fe.pinId===t?K({from:void 0}):me&&me.insId===l.THIS_INS_ID&&me.pinId===t&&K({to:void 0}),o(n,(0,P.functionalChange)("remove io pin"))}),[ee,fe,me,o,K]),xt=u.useCallback((async()=>{const{selected:e,from:t,to:n}=Y;0===e.length?t&&(0,l.isExternalConnectionNode)(t)?await Fe(`Are you sure you want to remove main input ${t.pinId}?`)&&_t("input",t.pinId):n&&(0,l.isExternalConnectionNode)(n)&&await Fe(`Are you sure you want to remove main output ${n.pinId}?`)&&_t("output",n.pinId):yt(e)}),[Fe,Y,yt,_t]),Nt=u.useCallback(((e,t,n)=>{const i=(0,m.getInstancePinConfig)(ee,e.id,t),s=(0,l.isStickyInputPinConfig)(i)?(0,x.queueInputPinConfig)():(0,l.stickyInputPinConfig)();o((0,m.changePinConfig)(ee,e.id,t,s),(0,P.functionalChange)("toggle-sticky")),ue("togglePinSticky",{isSticky:(0,l.isStickyInputPinConfig)(s)})}),[o,ee,ue]),wt=u.useCallback((()=>{const{newNode:e,newInstances:t}=(0,$.handleDuplicateSelectedEditorCommand)(ee,pe);o(e,(0,P.functionalChange)("duplicated instances")),K({selected:t.map((e=>e.id))})}),[o,K,ee,pe]),jt=u.useCallback((e=>{const t=e.nativeEvent.target;if(0===e.button&&Z(e.nativeEvent,ee.id)&&t&&"board-editor-inner"===t.className){if(Date.now()-je<300)return void te(e);Ee(Date.now());const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,nt),o=(0,m.domToViewPort)(n,qe,le);Ne({from:o,to:o})}}),[ee.id,qe,je,nt,le,te]),Et=u.useCallback((e=>{if(Ue(null),Z(e.nativeEvent,ee.id)&&xe){if((0,m.calcSelectionBoxArea)(xe)>50){const t=(0,m.getInstancesInRect)(xe,ce,qe,Kt.current,ee.instances,nt,le),n=e.shiftKey?[...pe,...t]:t;K({selected:n})}Ne(void 0)}}),[ee.id,ee.instances,xe,ce,qe,nt,le,pe,K]),Pt=u.useCallback((e=>{if(!Z(e.nativeEvent,ee.id))return void(Ge.current=!1);Ge.current=!0;const t={x:e.clientX,y:e.clientY},n=(0,C.vSub)(t,(0,C.vAdd)(nt,C.vZero)),o=(0,m.domToViewPort)(n,qe,le);xe&&Ne({...xe,to:o});const i=(0,m.findClosestPin)(ee,ce,n,nt,Q,X,qe),s=Ke;if(i){(!s||s.ins!==i.ins||s.ins===i.ins&&s.pin!==i.pin)&&Qe({ins:i.ins,type:i.type,pin:i.id})}tt.current=o,K({lastMousePos:tt.current})}),[ee,nt,qe,le,xe,ce,Q,X,Ke,K]),Ot=u.useCallback((e=>{var t;"bp5-menu"!==(null===(t=e.relatedTarget)||void 0===t?void 0:t.className)&&(Qe(void 0),Ge.current=!1)}),[]),St=u.useCallback(((e,t)=>{if(t){const t=(0,l.isInlineNodeInstance)(e)?e.node:(0,G.safelyGetNodeDef)(e.nodeId,ce);if(!t)throw new Error("Impossible state inspecting inexisting node");if(!(0,l.isVisualNode)(t))return void(0,E.toastMsg)("Cannot inspect a non visual node","warning");ze({insId:`${Q}.${e.id}`,node:t})}else if((0,l.isRefNodeInstance)(e)){const t=(0,G.safelyGetNodeDef)(e,ce);r(t)}else{const t=e.node;if(!(0,l.isInlineValueNode)(t))return void((0,l.isVisualNode)(t)?ze({insId:e.id,node:t}):(0,E.toastMsg)("Editing this type of node is not supported"));const n=atob(t.dataBuilderSource);Ve({insId:e.id,templateType:t.templateType,value:n,type:"existing"}),(0,E.toastMsg)("Editing inline visual node not supported yet")}}),[r,ce,Q]),Dt=u.useCallback((e=>{if((0,l.isInlineNodeInstance)(e)){const t=e.node;if(!(0,l.isVisualNode)(t))return void(0,E.toastMsg)("Not supported","warning");const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.filter((t=>t.id!==e.id)),n.connections=n.connections.filter((t=>{let{from:n,to:o}=t;return n.insId!==e.id&&o.insId!==e.id})),n.instances.push(...t.instances),n.connections.push(...t.connections.filter((e=>(0,l.isInternalConnectionNode)(e.from)&&(0,l.isInternalConnectionNode)(e.to))))}));o(n,{type:"functional",message:"ungroup"}),K({selected:[]})}else{const t=(0,G.safelyGetNodeDef)(e.nodeId,ce);if(!(0,l.isVisualNode)(t))return void(0,E.toastMsg)("Not supported","warning")}}),[ee,o,K,ce]),Mt=u.useCallback((async e=>{}),[]),Tt=u.useCallback(((e,t)=>{const n=(0,V.handleDetachConstEditorCommand)(ee,e.id,t);o(n,(0,P.functionalChange)("detach-const"))}),[o,ee]),kt=u.useCallback(((e,t)=>{const n=e.inputConfig[t]||(0,x.queueInputPinConfig)();(0,l.isStaticInputPinConfig)(n)&&(Re(n.value),E.AppToaster.show({message:"Value copied"}))}),[]),Rt=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{const o=n.instances.find((t=>t.id===e.id));if(!o)throw new Error("Impossible state");o.inputConfig[t]=(0,l.staticInputPinConfig)(ke),n.connections=n.connections.filter((n=>!(0,l.isInternalConnectionNode)(n.to)||!(n.to.insId===e.id&&n.to.pinId===t)))}));o(n,(0,P.functionalChange)("paste const value"))}),[ee,o,ke]),At=u.useCallback((async e=>{const t=await Le("New name?");if(!t)return;const n=(0,h.produce)(ee,(n=>{var o;"input"===e?(ee.inputs||(n.inputs={}),n.inputs[t]=(0,l.nodeInput)(),n.inputsPosition[t]=tt.current):(ee.outputs||(n.outputs={}),n.outputs[t]=(0,l.nodeOutput)(),n.outputsPosition[t]=tt.current,(null===(o=n.completionOutputs)||void 0===o?void 0:o.length)&&(0,E.toastMsg)("Note that this node has explicit completion outputs set. You may need to update them."))}));o(n,(0,P.functionalChange)("add new io pin")),ue("addIoPin",{type:e})}),[Le,ee,o,ue]),Vt=u.useCallback((async()=>{var e;const t=null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","),n=await Le("Edit completion outputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,h.produce)(ee,(e=>{e.completionOutputs=""===n?void 0:n.split(",")}));o(e,(0,P.functionalChange)("change node completions")),ue("editCompletionOutputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),$t=u.useCallback((async()=>{var e;const t=null===(e=ee.reactiveInputs)||void 0===e?void 0:e.join(","),n=await Le("Edit reactive inputs",t);if((0,p.isDefined)(n)&&null!==n){const e=(0,h.produce)(ee,(e=>{e.reactiveInputs=""===n?void 0:n.split(",")}));o(e,(0,P.functionalChange)("change reactive inputs")),ue("editReactiveInputs",{count:n?n.split(",").length:0})}}),[Le,o,ee,ue]),zt=u.useCallback((async()=>{const e=await Le("Description?",ee.description),t=(0,h.produce)(ee,(t=>{t.description=e}));o(t,(0,P.functionalChange)("Edit node description"))}),[Le,o,ee]),Ht=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{t.defaultStyle=e}));o(t,(0,P.functionalChange)("change default style")),ue("changeStyle",{isDefault:!0})}),[o,ee,ue]),Ft=u.useCallback((async(e,t)=>{const n=await Le("New name?",t)||t,i=(0,m.handleIoPinRename)(ee,e,t,n);o(i,(0,P.functionalChange)("rename io pin"))}),[ee,o,Le]),Lt=u.useCallback(((e,t)=>{const n=(0,m.handleChangeNodeInputType)(ee,e,t);o(n,(0,P.functionalChange)("toggle io pin optional"))}),[ee,o]),qt=u.useCallback((e=>{switch(e.type){case F.ActionType.RemoveNode:{const e=(0,h.produce)(ee,(e=>{if(!(0,l.isVisualNode)(ee))throw new Error("Impossible state, deleting instances opf non visual node");e.instances=e.instances.filter((e=>!pe.includes(e.id))),e.connections=e.connections.filter((e=>!pe.includes(e.from.insId)&&!pe.includes(e.to.insId)))}));K({selected:[]}),o(e,(0,P.functionalChange)("remove-instances")),(0,E.toastMsg)(`Removed ${pe.length} instances(s)`),ue("deleteInstances",{count:pe.length});break}case F.ActionType.Inspect:if(1===pe.length)J(pe[0]);else if(fe||me){const e=null!=fe?fe:me,t=(0,l.isExternalConnectionNode)(e)?l.ROOT_INS_ID:e.insId;J(t,{type:fe?"output":"input",id:e.pinId})}ue("openInspectMenu",{source:"actionMenu"});break;case F.ActionType.Group:(async()=>{await Ye()})();break;case F.ActionType.UnGroup:{const e=ee.instances.find((e=>e.id===pe[0]));Dt(e);const t=(0,G.safelyGetNodeDef)(e,ce);(0,E.toastMsg)(`Ungrouped inline node ${t.id}`),ue("unGroupNode",{instancesCount:t.instances.length});break}case F.ActionType.AddInlineValue:Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"actionMenu"});break;case F.ActionType.AddNode:!async function(){const t=(0,m.getMiddleOfViewPort)(qe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*qe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,h.produce)(ee,(e=>{e.instances.push(r)})),u=(0,h.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,P.functionalChange)("add new instance")),K(u),(0,E.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;case F.ActionType.AI:!async function(){const t=(0,m.getMiddleOfViewPort)(qe,et),{importableNode:n}=e.data,i=await re(n),s=(0,C.vSub)(t,{x:0,y:50*qe.zoom}),r=(0,m.createNewNodeInstance)(n.node.id,0,s,i),a=(0,h.produce)(ee,(e=>{e.instances.push(r)})),u=(0,h.produce)(Y,(e=>{e.selected=[r.id]}));o(a,(0,P.functionalChange)("add new instance")),K(u),(0,E.toastMsg)(`Node ${n.node.id} successfully imported from ${n.module}`),ue("addNode",{nodeId:n.node.id,source:"actionMenu"})}();break;default:(0,E.toastMsg)(`${e.type} not supported yet`)}}),[Y,fe,o,K,Ye,re,J,Dt,ee,ce,ue,pe,me,qe,et]),Gt=()=>{const t=Y.from;return(0,p.entries)(be).map((n=>{let[o,s]=n;return(0,a.jsx)(y.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"input",pos:ge[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Ft:void 0,onDblClick:Zt,closest:!(!Ke||"input"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,inputMode:s.mode,onChangeInputMode:Lt,viewPort:qe,onDragStart:ht,onDragEnd:gt,onDragMove:vt,onSelect:it,onSetDescription:st,selected:(null==t?void 0:t.pinId)===o,description:s.description,onMouseUp:Nn,onMouseDown:xn},o)}))},Bt=()=>{const{to:t}=Y;return(0,p.entries)(ye).map((n=>{let[o,s]=n;return(0,a.jsx)(y.NodeIoView,{currentInsId:Q,ancestorInsIds:e.ancestorsInsIds,type:"output",pos:Ie[o]||{x:0,y:0},id:o,onDelete:i?_t:void 0,onRename:i?Ft:void 0,closest:!(!Ke||"output"!==Ke.type||Ke.ins.id!==ee.id||Ke.pin!==o),connected:!1,viewPort:qe,onDragStart:ht,onDragEnd:gt,onDragMove:vt,onSelect:it,onSetDescription:st,description:s.description,selected:(null==t?void 0:t.pinId)===o,onMouseUp:Nn,onMouseDown:xn},o)}))},Ut=()=>{if(xe){const{from:e,to:t}=xe,n=(0,m.logicalPosToRenderedPos)(e,qe),o=(0,m.logicalPosToRenderedPos)(t,qe),{x:i,y:s,w:r,h:u}=(0,m.getSelectionBoxRect)(n,o);return(0,a.jsx)("div",{className:"selection-box",style:{top:s,left:i,width:r,height:u}})}return null},Wt=u.useCallback((async(e,t,n,o)=>{if("input"===n){const n=e.inputConfig[t],o=(0,l.isStaticInputPinConfig)(n)?JSON.stringify(n.value):void 0;Ve({type:"static-input",insId:e.id,pinId:t,value:null!=o?o:JSON.stringify("Some static value")}),ue("addValueModalOpen",{source:"dblClickPin"})}else{const i=(0,G.safelyGetNodeDef)(e,ce);if(!(0,l.getNodeOutputs)(i)[t])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:o.clientX,y:o.clientY},ins:e,targetNode:i,pinId:t,pinType:n})}}),[ce,ue]),Zt=u.useCallback((async(e,t)=>{if(!ee.inputs[e])throw new Error("Dbl clicked on un-existing pin");Te({pos:{x:t.clientX,y:t.clientY},pinId:e,pinType:"input",targetNode:ee})}),[ee]),Jt=u.useCallback((e=>{if(e.metaKey||e.ctrlKey){const t=-.005*e.deltaY;ct(qe.zoom+t,"mouse"),e.preventDefault(),e.stopPropagation()}else{if(se)return;const t=e.deltaX,n=e.deltaY,o=(0,h.produce)(qe,(e=>{e.pos.x=e.pos.x+t/e.zoom,e.pos.y=e.pos.y+n/e.zoom}));We(o),e.stopPropagation(),e.preventDefault()}}),[se,ct,We,qe]);(0,v.useEffect)((()=>{const{current:e}=Xe;if(e)return e.addEventListener("wheel",Jt),()=>{e.removeEventListener("wheel",Jt)}}),[Jt]);const Yt={backgroundPositionX:(0,m.roundNumber)(-qe.pos.x*qe.zoom),backgroundPositionY:(0,m.roundNumber)(-qe.pos.y*qe.zoom),backgroundSize:(0,m.roundNumber)(10*qe.zoom)+"px"},Kt=u.useRef(new Map);u.useEffect((()=>{const e=he.reduce(((e,t)=>{const n=(0,G.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeInputs)(n))),e}),new Map),t=he.reduce(((e,t)=>{const n=(0,G.safelyGetNodeDef)(t,ce);return n&&e.set(t.id,(0,l.keys)((0,l.getNodeOutputs)(n))),e}),new Map);e.set(l.THIS_INS_ID,(0,l.keys)(ee.outputs)),t.set(l.THIS_INS_ID,(0,l.keys)(ee.inputs));const n=ve.filter((n=>{const o=e.get(n.to.insId)&&e.get(n.to.insId).includes(n.to.pinId),i=t.get(n.from.insId)&&t.get(n.from.insId).includes(n.from.pinId);return!(o&&i)}));if(n.length>0){(0,E.toastMsg)(`${n.length} orphan connections removed`,"warning"),console.warn(`${n.length} orphan connections removed`,n);const e=(0,h.produce)(ee,(e=>{e.connections=ee.connections.filter((e=>!n.includes(e)))}));o(e,(0,P.functionalChange)("prune orphan connections"))}}),[he,o,ve,ee,ce]),u.useEffect((()=>{let e=[];const t=(0,h.produce)(ee,(t=>{t.instances=t.instances.map((t=>{const n=(0,G.safelyGetNodeDef)(t,ce);if(n){const o=(0,l.getNodeInputs)(n),i=(0,l.getNodeOutputs)(n);if(t.visibleInputs){const n=t.visibleInputs.filter((e=>!o[e]));n.length>0&&(t.visibleInputs=(0,l.keys)(o),e.push(...n))}if(t.visibleOutputs){const n=t.visibleOutputs.filter((e=>!i[e]));n.length>0&&(t.visibleOutputs=(0,l.keys)(i),e.push(...n))}}return t}))}));e.length>0&&((0,E.toastMsg)(`Found ${e.length} invalid visible inputs/outputs: ${e.join(", ")}. Reset them`,"warning"),o(t,(0,P.functionalChange)("reset corrupt visible inputs/outputs")))}),[he,o,ee,ce]),(0,v.useEffect)((()=>{const e=new Map(he.map((e=>[e.id,e])));Kt.current=ve.reduce(((t,n)=>{const o=t.get(n.to.insId)||{},i=o[n.to.pinId]||[],s={...o,[n.to.pinId]:[...i,e.get(n.from.insId)]};return t.set(n.to.insId,s),t}),new Map)}),[ve,he]);const Qt=u.useCallback((()=>{Te(void 0)}),[]),Xt=u.useCallback((async e=>{if(!Me)throw new Error("impossible state - quick add menu invoked but not available");const{ins:t,pinId:n}=Me;switch(e.type){case"import":case"node":{const i="import"===e.type?await re(e.importableNode):ce,s="import"===e.type?e.importableNode.node:e.node,r=(0,m.createNewNodeInstance)(s.id,100,tt.current,i);if(r){const e=(0,h.produce)(ee,(e=>{e.instances.push(r),e.connections.push({from:{insId:t?t.id:l.THIS_INS_ID,pinId:n},to:{insId:r.id,pinId:l.TRIGGER_PIN_ID}})}));o(e,(0,P.functionalChange)("add-item-quick-menu")),Qt()}ue("addNode",{nodeId:s.id,source:"quickAdd"});break}case"value":if(!t)return void(0,E.toastMsg)("Cannot add value to main input");Ve({type:"new-output",insId:t.id,pinId:n}),ue("addValueModalOpen",{source:"quickAdd"})}}),[Me,ce,ue,ee,o,Qt,re]),en=u.useCallback((async()=>{const e=JSON.stringify(ee);await navigator.clipboard.writeText(e),E.AppToaster.show({message:"Copied!"})}),[ee]),tn=u.useCallback((()=>{var e,t;const n=i?"":" (cannot edit main node, only visual)";return(0,a.jsxs)(b.Menu,{children:[(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"New Value",onClick:(0,p.preventDefaultAnd)((()=>{Ve({type:"new-floating",pos:tt.current}),ue("addValueModalOpen",{source:"contextMenu"})}))}),(0,a.jsx)(b.MenuItem,{text:`New input ${n}`,onMouseDown:e=>e.stopPropagation(),onClick:(0,p.preventDefaultAnd)((()=>At("input"))),disabled:!i}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`New output ${n}`,onClick:(0,p.preventDefaultAnd)((()=>At("output"))),disabled:!i}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Copy node to clipboard",onClick:(0,p.preventDefaultAnd)(en)}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Completion Outputs (${(null===(e=ee.completionOutputs)||void 0===e?void 0:e.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>Vt()))}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:`Edit Reactive inputs (${(null===(t=ee.reactiveInputs)||void 0===t?void 0:t.join(","))||"n/a"})`,onClick:(0,p.preventDefaultAnd)((()=>$t()))}),(0,a.jsx)(b.MenuItem,{onMouseDown:e=>e.stopPropagation(),text:"Edit description",onClick:(0,p.preventDefaultAnd)((()=>zt()))}),(0,a.jsx)(b.MenuDivider,{}),(0,a.jsx)(b.MenuItem,{text:"Default Style",children:(0,a.jsx)(z.NodeStyleMenu,{style:ee.defaultStyle,onChange:Ht,promptFn:Le})})]})}),[i,en,ee.completionOutputs,ee.reactiveInputs,ee.defaultStyle,Ht,Le,ue,At,Vt,$t,zt]);(0,g.useHotkeys)("shift+c",ot,{text:"Center viewport",group:"Viewport Controls"},[],Ge),(0,g.useHotkeys)("cmd+c",at,{text:"Copy instances",group:"Editing"},[],Ge),(0,g.useHotkeys)("cmd+v",ut,{text:"Paste instances",group:"Editing"},[],Ge),(0,g.useHotkeys)("esc",dt,{text:"Clear selections",group:"Selection"},[],Ge),(0,g.useHotkeys)("backspace",xt,{text:"Delete instances",group:"Editing"},[],Ge),(0,g.useHotkeys)("shift+d",wt,{text:"Duplicate selected instances",group:"Editing"},[],Ge),(0,g.useHotkeys)("cmd+a",bt,{text:"Select all",group:"Selection"},[],Ge),(0,g.useHotkeys)("s",lt,{text:"Select pin closest to mouse",group:"Selection"},[],Ge);const nn=u.useCallback(((e,t)=>{if(!$e)throw new Error("impossible state");const n=(0,h.produce)(ee,(t=>{const n=t.instances.find((e=>e.id===$e.insId));if(!n||!(0,l.isInlineNodeInstance)(n))throw new Error("impossible state");n.node=e}));o(n,(0,P.functionalChange)("Inner change: "+t.message)),ze((t=>({...t,node:e})))}),[o,$e,ee]),[on,sn]=(0,v.useState)({selected:[],viewPort:t.defaultViewPort,lastMousePos:{x:0,y:0}}),rn=u.useCallback((e=>sn((t=>({...t,...e})))),[]),an=n=>$e&&$e.insId===n.id?{currentInsId:$e.insId,ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),boardData:on,onChangeBoardData:rn,resolvedDependencies:ne,onCopy:s,clipboardData:e.clipboardData,onInspectPin:e.onInspectPin,onGoToNodeDef:e.onGoToNodeDef,nodeIoEditable:e.nodeIoEditable,node:$e.node,onChangeNode:nn,onShowOmnibar:te,parentViewport:t.defaultViewPort,parentBoardPos:nt,onExtractInlineNode:e.onExtractInlineNode,queuedInputsData:e.queuedInputsData}:void 0,un=()=>{if(fe&&("input"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"output"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(e)&&!(0,l.isInternalConnectionNode)(fe))return;return{from:fe,to:e}}if(me&&("output"===(null==Ke?void 0:Ke.type)&&(null==Ke?void 0:Ke.ins.id)!==ee.id||(null==Ke?void 0:Ke.ins.id)===ee.id&&"input"===(null==Ke?void 0:Ke.type))){const e=Ke.ins.id===ee.id?{pinId:Ke.pin,insId:l.THIS_INS_ID}:{insId:Ke.ins.id,pinId:Ke.pin};if(!(0,l.isInternalConnectionNode)(me)&&!(0,l.isInternalConnectionNode)(e))return;return{from:e,to:me}}},ln=()=>{const e=un();if(e){const{from:t,to:n}=e;return{connection:{from:t,to:n},type:ve.some((t=>(0,l.connectionDataEquals)(t,e)))?"future-remove":"future-add"}}},cn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleInputs:t}:n))}));o(n,(0,P.functionalChange)("change instance visible inputs"))}),[ee,o]),dn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,style:t}:n))}));o(n,(0,P.functionalChange)("change instance style")),ue("changeStyle",{isDefault:!1})}),[o,ee,ue]),pn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,visibleOutputs:t}:n))}));o(n,(0,P.functionalChange)("change instance visible outputs"))}),[ee,o]),fn=u.useCallback(((e,t)=>{const n=(0,h.produce)(ee,(n=>{n.instances=n.instances.map((n=>n.id===e.id?{...n,displayName:t}:n))}));o(n,(0,P.functionalChange)("change instance display name"))}),[ee,o]);u.useImperativeHandle(n,(()=>({centerInstance(e){const t=ee.instances.find((t=>t.id===e));if(t){const e=(0,C.vSub)(t.pos,(0,C.vec)(et.width/2,et.height/2));We({...qe,pos:e})}},centerViewPort(){ot()},getViewPort:()=>qe,clearSelection:()=>{dt()},requestNewInlineValue:()=>{Ve({type:"new-floating",pos:tt.current})}})));const[mn,hn]=u.useState([]),vn=u.useCallback(((e,t)=>{const n=t.trim().substr(0,100),i=`Inline-value-${n.substr(0,15).replace(/["'`]/g,"")}`,s=(0,S.createInlineValueNode)({code:t,customView:n,nodeId:i,type:e});switch(Ae.type){case"existing":{const[e]=ee.instances.filter((e=>e.id===Ae.insId)).filter((e=>(0,l.isInlineNodeInstance)(e))).map((e=>e.node));if(!e)throw new Error("Unable to find inline node to save to");const t=(0,l.keys)(e.inputs),n=(0,l.keys)(s.inputs),i=new Set(D.default.difference(t,n)),r=(0,h.produce)(ee,(e=>{e.instances=e.instances.map((e=>e.id===Ae.insId?(0,l.inlineNodeInstance)(e.id,s,e.inputConfig,e.pos):e)),e.connections=e.connections.filter((e=>!(e.to.insId===Ae.insId&&i.has(e.to.pinId))))}));o(r,(0,P.functionalChange)("change inline value")),Ve(void 0);break}case"static-input":{let e;try{const n=t.replace(/^['`]/,'"').replace(/['`]$/,'"');e=JSON.parse(n)}catch(r){return void(0,E.toastMsg)("Input values must not be formulas or code")}const n=(0,h.produce)(ee,(t=>{t.instances.find((e=>e.id===Ae.insId)).inputConfig[Ae.pinId]=(0,l.staticInputPinConfig)(e)}));o(n,(0,P.functionalChange)("set static input value")),Ve(void 0);break}case"new-floating":{const e=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},Ae.pos),t=(0,h.produce)(ee,(t=>{t.instances.push(e)}));o(t,(0,P.functionalChange)("new floating value")),Ve(void 0);break}case"new-output":{const{insId:e,pinId:t}=Ae,n=ee.instances.find((t=>t.id===e));if(!n)throw new Error("Impossible state");const i=(0,l.inlineNodeInstance)((0,l.createInsId)(s),s,{},(0,C.vAdd)(n.pos,{x:-50,y:150})),r=(0,h.produce)(ee,(n=>{n.instances.push(i),n.connections.push({from:(0,l.connectionNode)(e,t),to:(0,l.connectionNode)(i.id,l.TRIGGER_PIN_ID)})}));o(r,(0,P.functionalChange)("new value connected to output")),Ve(void 0)}}ue("addValue",{type:e,placeholdersCount:(0,l.keys)(s.inputs).length})}),[Ae,o,ee,ue]),gn=ve.filter((e=>{const t=un();return!t||!(0,l.connectionDataEquals)(t,e)})),In=u.useCallback((()=>{ze(void 0),sn(t.defaultBoardData)}),[]),bn=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{const n=t.connections.find((t=>(0,l.connectionDataEquals)(t,e)));n.hidden=!n.hidden}));o(t,(0,P.functionalChange)("toggle connection hidden"))}),[o,ee]),yn=u.useCallback((e=>{const t=(0,h.produce)(ee,(t=>{t.connections=t.connections.filter((t=>!(0,l.connectionDataEquals)(t,e)))}));o(t,(0,P.functionalChange)("remove connection"))}),[o,ee]),Cn=u.useCallback(((e,t,n)=>{Ue("input"===n?{to:(0,l.connectionNode)(e.id,t),from:void 0}:{from:(0,l.connectionNode)(e.id,t),to:void 0})}),[]),_n=u.useCallback(((e,t,n)=>{Be&&(Be.from&&"input"===n?Je(Be.from,(0,l.connectionNode)(e.id,t),"pinDrag"):Be.to&&"output"===n&&Je((0,l.connectionNode)(e.id,t),Be.to,"pinDrag")),Ue(null)}),[Be,Je]),xn=u.useCallback(((e,t)=>{}),[]),Nn=u.useCallback(((e,t)=>{Be&&(Be.from&&"output"===t?Je(Be.from,(0,l.externalConnectionNode)(e),"nodeIoPinDrag"):Be.to&&"input"===t&&Je((0,l.externalConnectionNode)(e),Be.to,"nodeIoPinDrag"))}),[Be,Je]);try{return(0,a.jsxs)(b.ContextMenu,{className:(0,k.default)("visual-node-editor",e.className,{dark:ae}),"data-id":ee.id,content:tn(),disabled:!Ge.current,children:[(0,a.jsxs)("main",{className:"board-editor-inner",onMouseDown:jt,onMouseUp:Et,onMouseMove:Pt,onMouseLeave:Ot,ref:Xe,style:Yt,children:[(0,a.jsx)(u.Fragment,{children:(0,a.jsx)(w.LayoutDebugger,{vp:qe,node:ee,extraDebug:m.emptyList,mousePos:tt.current})}),(0,a.jsx)(d.ConnectionView,{resolvedNodes:ce,currentInsId:Q,ancestorsInsIds:X,size:et,node:ee,boardPos:nt,instances:he,connections:gn,futureConnection:ln(),onDblClick:l.noop,viewPort:qe,parentVp:le,selectedInstances:pe,toggleHidden:bn,removeConnection:yn,lastMousePos:tt.current,draggedSource:Be}),Gt(),he.map((t=>{var n,o,i,s,r;return(0,a.jsx)(c.InstanceView,{onUngroup:Dt,onExtractInlineNode:Mt,onDetachConstValue:Tt,onCopyConstValue:kt,onPasteConstValue:Rt,copiedConstValue:ke,connectionsPerInput:Kt.current.get(t.id)||m.emptyObj,node:(0,G.safelyGetNodeDef)(t,ce),ancestorsInsIds:(0,l.fullInsIdPath)(Q,X),onPinClick:rt,onPinDblClick:Wt,onDragStart:pt,onDragEnd:mt,resolvedDeps:ce,onDragMove:ft,onDblClick:St,onSelect:It,onToggleSticky:Nt,selected:-1!==pe.indexOf(t.id),dragged:Ce===t.id,onInspectPin:Ze,selectedInput:me&&(0,l.isInternalConnectionNode)(me)&&me.insId===t.id?me.pinId:void 0,selectedOutput:fe&&(0,l.isInternalConnectionNode)(fe)&&fe.insId===t.id?fe.pinId:void 0,closestPin:Ke&&Ke.ins.id===t.id?Ke:void 0,queuedInputsData:null!==(n=oe[t.id])&&void 0!==n?n:m.emptyObj,instance:t,connections:ve,onTogglePinBreakpoint:l.noop,onTogglePinLog:l.noop,viewPort:qe,onChangeVisibleInputs:cn,onChangeVisibleOutputs:pn,onSetDisplayName:fn,onDeleteInstance:Ct,forceShowMinimized:fe||(null===(o=null==Be?void 0:Be.to)||void 0===o?void 0:o.insId)===t.id?"input":me||(null===(i=null==Be?void 0:Be.from)||void 0===i?void 0:i.insId)===t.id?"output":void 0,isConnectedInstanceSelected:pe.some((e=>ve.some((n=>{let{from:o,to:i}=n;return o.insId===t.id&&i.insId===e||o.insId===e&&i.insId===t.id})))),inlineGroupProps:an(t),onCloseInlineEditor:In,inlineEditorPortalDomNode:He.current,onChangeStyle:dn,onGroupSelected:Ye,onPinMouseDown:Cn,onPinMouseUp:_n,hadError:null!==(r=null===(s=e.instancesWithErrors)||void 0===s?void 0:s.has((0,l.fullInsIdPath)(t.id)))&&void 0!==r&&r},t.id)})),Ut(),Bt(),(0,a.jsx)(L.MainInstanceEventsIndicator,{currentInsId:Q,ancestorsInsIds:X,viewPort:qe}),Me?(0,a.jsx)(_.QuickAddMenu,{targetNode:Me.targetNode,pinId:Me.pinId,pinType:Me.pinType,pos:Me.pos,resolvedDependencies:ne,node:ee,onAdd:Xt,onClose:Qt}):null,(0,a.jsxs)("div",{className:"viewport-controls-and-help",children:[(0,a.jsx)(b.Button,{small:!0,onClick:ot,minimal:!0,intent:"primary",children:"Center"}),(0,a.jsx)(U,{min:.15,max:3,stepSize:.05,labelStepSize:10,labelRenderer:W,onChange:ct,value:qe.zoom}),we?(0,a.jsx)(q.HelpBubble,{}):null]}),Ae?(0,a.jsx)(O.InlineCodeModal,{env:m.emptyObj,initialValue:Ae.value,initialType:"existing"===Ae.type?Ae.templateType:void 0,onCancel:()=>Ve(void 0),onSubmit:vn}):null,(0,a.jsx)("div",{className:"inline-editor-portal-root"})]}),(0,a.jsx)(F.ActionsMenu,{showRunFlowOptions:we,onAction:qt,selectedInstances:pe,node:ee,resolvedNodes:ce,to:me,from:fe,hotkeysEnabled:Ge})]})}catch(wn){return console.error(wn),(0,a.jsxs)("div",{children:["Error rendering board - ",wn.toString()]})}})));const Z=(e,t)=>{const n=e.target.closest(".visual-node-editor");return n&&n.getAttribute("data-id")===t}},83234:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseNodeView=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=r(n(59349)),d=n(30653);t.BaseNodeView=function(e){const{dragged:t,viewPort:n,pos:o,onDragEnd:i,onDragMove:s,onDragStart:r,displayMode:p}=e,f=(0,d.useDarkMode)(),m=u.useCallback(((e,t)=>{r(e,t)}),[r]),h=u.useCallback(((e,t)=>{const s=o,r=(t.x-s.x)/n.zoom,a=(t.y-s.y)/n.zoom,u=s.x+r,l=s.y+a;i(e,{...t,x:u,y:l})}),[o,i,n]),v=u.useCallback(((e,t)=>{s(e,{x:t.x,y:t.y})}),[s]),g={transform:`scale(${n.zoom})`},I=(0,l.default)("base-node-view",e.className,{dragged:t,dark:f,"display-mode":p}),b=o.x*n.zoom-n.pos.x*n.zoom,y=o.y*n.zoom-n.pos.y*n.zoom,C={transform:`translate(${b-o.x}px, ${y-o.y}px)`},_=(0,l.default)("base-node-view-vp-fixer",{"display-mode":p}),x=(0,a.jsx)("span",{className:"base-node-view-wrapper",children:(0,a.jsx)("div",{className:I,style:g,id:e.domId,children:e.children})});return(0,a.jsx)("div",{className:_,style:C,children:(0,a.jsx)(c.default,{onStop:h,onStart:m,onDrag:v,position:o,cancel:".no-drag",children:x})})}},80510:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleConnectionCloseEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleConnectionCloseEditorCommand=(e,t)=>{let{from:n,to:o}=t;return(0,s.default)(e,(e=>{const t=e.connections.find((e=>{const t=(0,i.connectionNodeEquals)(n,e.from),s=(0,i.connectionNodeEquals)(o,e.to);return t&&s}));t?e.connections=e.connections.filter((e=>e!==t)):e.connections.push({from:n,to:o})}))}},1788:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDetachConstEditorCommand=void 0;const i=n(74762),s=o(n(53865)),r=n(68371);t.handleDetachConstEditorCommand=(e,t,n)=>(0,s.default)(e,(e=>{const{instances:o}=e,s=o.find((e=>e.id===t));if(!s)throw new Error("Impossible state ins id with no matching instance");const a=s.inputConfig[n];if(!a)throw new Error("impossible state detaching const from unexistent config");if(!(0,i.isStaticInputPinConfig)(a))throw new Error("impossible state detaching const with no value");const u=JSON.stringify(a.value),l=(0,r.createInlineValueNode)({code:`${u}`,type:i.InlineValueNodeType.VALUE}),c=(0,i.inlineNodeInstance)(`value-${(0,i.randomInt)(999)}`,l,{},{x:s.pos.x,y:s.pos.y-100});if(!e.instances.find((e=>e.id===s.id)))throw new Error("impossible state instance not found");s.inputConfig[n]=(0,i.queueInputPinConfig)(),e.instances.push(c),e.connections.push((0,i.connectionData)(`${c.id}.value`,`${s.id}.${n}`))}))},2130:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.handleDuplicateSelectedEditorCommand=void 0;const i=n(74762),s=o(n(53865));t.handleDuplicateSelectedEditorCommand=(e,t)=>{const n=[];return{newNode:(0,s.default)(e,(o=>{const s=o.instances;t.forEach((t=>{const o=s.find((e=>e.id===t));if(!o)throw new Error("impossible state duplicate selected no matching instance");if(o){const{pos:t}=o,r={...o,pos:{x:t.x+20,y:t.y+20},id:(0,i.createInsId)(e)};s.push(r),n.push(r.id)}}))})),newInstances:n}}},25044:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.pasteInstancesCommand=void 0;const i=n(74762),s=o(n(53865));t.pasteInstancesCommand=(e,t,n)=>{const o=n.instances.map((n=>({...n,pos:t,id:(0,i.createInsId)(e)}))),r=new Map(o.map(((e,t)=>[n.instances[t].id,e.id])));return{newNode:(0,s.default)(e,(e=>{e.instances.push(...o);const t=n.connections.map((e=>{let{from:t,to:n}=e;return{from:{...t,insId:r.get(t.insId)||t.insId},to:{...n,insId:r.get(n.insId)||n.insId}}}));e.connections.push(...t)})),newInstances:o}}},65082:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionView=t.SingleConnectionView=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=r(n(26372)),d=n(74762),p=n(18243),f=n(77852),m=n(74089),h=n(60190),v=n(50382),g=n(76064),I=n(41032);t.SingleConnectionView=e=>{const{isBrowser:t}=(0,f.useSsr)(),{connection:n,node:o,resolvedNodes:i,instances:s,type:r,viewPort:a,toggleHidden:l,parentSelected:m,removeConnection:b}=e,{from:y}=n,C=(0,d.isInternalConnectionNode)(y)&&s.find((e=>e.id===y.insId));if(!C&&(0,d.isInternalConnectionNode)(y))throw new Error(`impossible state - "from instance id - [${y.insId}] does not exist"`);const _=((0,d.isInternalConnectionNode)(y)&&C?(0,I.safelyGetNodeDef)(C,i):o).outputs[y.pinId],x=_&&_.delayed,N=t?(0,p.calcStartPos)({...e,connectionNode:y}):{x:0,y:0},w=t?(0,p.calcTargetPos)({...e,connectionNode:n.to}):{x:0,y:0},{x:j,y:E}=(0,h.vDiv)(N,e.parentVp.zoom),{x:P,y:O}=(0,h.vDiv)(w,e.parentVp.zoom),S=(0,c.default)({delayed:x,hidden:n.hidden,"parent-selected":m},r),D=(0,u.jsxs)(v.Menu,{children:[(0,u.jsx)(v.MenuItem,{text:n.hidden?"Show connection":"Hide connection",onClick:()=>l(n)}),(0,u.jsx)(v.MenuItem,{text:"Remove connection",onClick:()=>b(n)})]});return(0,u.jsx)(v.ContextMenu,{content:D,children:e=>(0,u.jsx)(g.ConnectionViewPath,{className:S,from:{x:j,y:E},to:{x:P,y:O},dashed:"regular"!==r,zoom:a.zoom,onContextMenu:e.onContextMenu})})};t.ConnectionView=e=>{var n;const{viewPort:o,futureConnection:i,toggleHidden:s,selectedInstances:r,draggedSource:c}=e,[d,f]=l.useState(0),h=l.useCallback((e=>requestAnimationFrame((()=>{f((e=>(e+1)%9)),e>0&&h(e-1)}))),[]);l.useEffect((()=>{const e=h(10);return()=>{cancelAnimationFrame(e)}}),[h]),l.useEffect((()=>{const e=()=>{h(3)};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[h,d]);const v=e.connections.map((n=>{const o=r.includes(n.from.insId)||r.includes(n.to.insId);return(0,a.createElement)(t.SingleConnectionView,{...e,connection:n,type:"regular",parentSelected:o,key:n.from.insId+n.from.pinId+n.to.insId+n.to.pinId})}));if(i&&v.push((0,a.createElement)(t.SingleConnectionView,{...e,connection:i.connection,type:i.type,toggleHidden:s,parentSelected:!1,key:"future"})),c){const t=(c.from?p.calcStartPos:p.calcTargetPos)({connectionNode:null!==(n=c.from)&&void 0!==n?n:c.to,viewPort:o,boardPos:e.boardPos,ancestorsInsIds:e.ancestorsInsIds,currentInsId:e.currentInsId});v.push((0,u.jsx)(g.ConnectionViewPath,{className:"dragged",from:t,to:(0,m.logicalPosToRenderedPos)(e.lastMousePos,o),zoom:o.zoom},"dragged"))}return(0,u.jsx)("svg",{className:"connections-view",children:v})}},76064:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionViewPath=void 0;const i=n(35250),s=o(n(26372)),r=n(70079),a=n(23381);t.ConnectionViewPath=(0,r.forwardRef)(((e,t)=>{const{from:n,to:o,className:r,onContextMenu:u,zoom:l,dashed:c}=e,{x:d,y:p}=n,{x:f,y:m}=o,h=(0,a.calcBezierPath)({sourceX:d,sourceY:p,targetX:f,targetY:m,curvature:.15}),v=2.5*l,g=c?6*l:void 0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:h,ref:t,className:(0,s.default)("connection",r),style:{strokeWidth:v,strokeDasharray:g},onContextMenu:u}),e.label?(0,i.jsx)("text",{className:"label",x:(d+f)/2,y:(p+m)/2,fontSize:"12px"}):null,(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%"}),(0,i.jsx)("stop",{offset:"100%"})]})]})}))},23381:(e,t)=>{"use strict";var n;function o(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i(e){let t,i,{pos:s,x1:r,y1:a,x2:u,y2:l,c:c}=e;switch(s){case n.Left:t=r-o(r-u,c),i=a;break;case n.Right:t=r+o(u-r,c),i=a;break;case n.Top:t=r,i=a-o(a-l,c);break;case n.Bottom:t=r,i=a+o(l-a,c)}return[t,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.getBezierCenter=t.calcBezierPath=t.Position=void 0,function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(n=t.Position||(t.Position={}));t.calcBezierPath=e=>{let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l});return`M${t},${o} C${c},${d} ${p},${f} ${r},${a}`},t.getBezierCenter=function(e){let{sourceX:t,sourceY:o,sourcePosition:s=n.Bottom,targetX:r,targetY:a,targetPosition:u=n.Top,curvature:l=.25}=e;const[c,d]=i({pos:s,x1:t,y1:o,x2:r,y2:a,c:l}),[p,f]=i({pos:u,x1:r,y1:a,x2:t,y2:o,c:l}),m=.125*t+.375*c+.375*p+.125*r,h=.125*o+.375*d+.375*f+.125*a;return[m,h,Math.abs(m-t),Math.abs(h-o)]}},18243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcTargetPos=t.calcStartPos=t.calcPinPosition=void 0;const o=n(74762),i=n(30994),s={x:99999,y:99999};function r(e){const t=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds),pinId:e.pinId,pinType:e.pinType,isMain:e.isMain});return((e,t,n,o)=>{if(!e)return console.warn(`Cannot find element ${n} to calculate position.`),s;const{x:i,y:r,width:a,height:u}=e.getBoundingClientRect(),l=r+u/2;return{x:i+a/2-t.x,y:l-t.y}})(document.getElementById(t),e.boardPos,t,e.viewPort)}t.calcPinPosition=r;t.calcStartPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"input",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"output",boardPos:n,viewPort:s})};t.calcTargetPos=e=>{const{connectionNode:t,boardPos:n,ancestorsInsIds:i,viewPort:s,currentInsId:a}=e;return(0,o.isExternalConnectionNode)(t)?r({pinId:t.pinId,insId:a,ancestorsInsIds:i,isMain:!0,pinType:"output",boardPos:n,viewPort:s}):r({pinId:t.pinId,insId:t.insId,ancestorsInsIds:(0,o.fullInsIdPath)(a,i),isMain:!1,pinType:"input",boardPos:n,viewPort:s})}},30994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPinDomId=t.getMainInstanceIndicatorDomId=t.getInstanceDomId=void 0;const o=n(74762);t.getInstanceDomId=(e,t)=>`ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getMainInstanceIndicatorDomId=(e,t)=>`main-ins:${(0,o.fullInsIdPath)(e,t)}`.replace(/\s+/g,"-");t.getPinDomId=e=>{let{pinType:t,fullInsIdPath:n,pinId:o,isMain:i}=e;return`${i?"main-":""}pin:${t}:${n}:${o}`.replace(/\s+/g,"-")}},86553:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceView=t.getVisibleOutputs=t.getVisibleInputs=t.INSTANCE_INFO_TOOLTIP_DELAY=t.MAX_INSTANCE_WIDTH=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0;const a=n(70079),u=n(35250),l=s(n(70079)),c=n(66074),d=n(74762),p=r(n(26372)),f=n(2036),m=n(74762),h=n(74762),v=n(53159),g=n(83234),I=n(74762),b=n(30994),y=n(63521),C=n(74089),_=n(50382),x=r(n(99581)),N=n(88593),w=n(30653);t.PIECE_HORIZONTAL_PADDING=25,t.PIECE_CHAR_WIDTH=11,t.MIN_WIDTH_PER_PIN=40,t.MAX_INSTANCE_WIDTH=400,t.INSTANCE_INFO_TOOLTIP_DELAY=400;t.getVisibleInputs=(e,t,n)=>{const{visibleInputs:o}=e;if(o)return o;const i=(0,d.keys)((0,h.getNodeInputs)(t)).filter(((o,i)=>{var s;const r=n.some((t=>t.to.insId===e.id&&t.to.pinId===o)),a=t.inputs[o]&&"optional"===(null===(s=t.inputs[o])||void 0===s?void 0:s.mode);return r||!a&&o!==m.TRIGGER_PIN_ID}));return 0===i.length?[m.TRIGGER_PIN_ID]:i};t.getVisibleOutputs=(e,t,n)=>{const{visibleOutputs:o}=e;if(o)return o;const i=Object.keys(t.outputs);return n.some((t=>t.from.insId===e.id&&t.from.pinId===m.ERROR_PIN_ID))?[...i,m.ERROR_PIN_ID]:i};t.InstanceView=function(e){const{selected:n,selectedInput:o,selectedOutput:i,closestPin:s,dragged:r,onTogglePinLog:j,onTogglePinBreakpoint:E,onDetachConstValue:P,onCopyConstValue:O,onPasteConstValue:S,displayMode:D,connections:M,instance:T,viewPort:k,node:R,onPinClick:A,onPinDblClick:V,onDragStart:$,onDragEnd:z,onDragMove:H,onToggleSticky:F,onSelect:L,onDblClick:q,onChangeVisibleInputs:G,onChangeVisibleOutputs:B,onConvertConstToEnv:U,inlineGroupProps:W,onUngroup:Z,onExtractInlineNode:J,onGroupSelected:Y,isConnectedInstanceSelected:K,inlineEditorPortalDomNode:Q,onChangeStyle:X,onDeleteInstance:ee,onSetDisplayName:te,onPinMouseUp:ne,onPinMouseDown:oe}=e,ie=(0,w.useDarkMode)(),{id:se}=T,re=l.useMemo((()=>{const e=(0,d.randomInt)(6,1);return{icon:(0,d.pickRandom)([["fab","discord"],["fab","slack"],"bug","cube"]),color:e,size:(0,d.randomInt)(3,1),variation:(0,d.randomInt)(5,1)}}),[]),ae=l.useRef(),ue=l.useMemo((()=>T.style||R.defaultStyle||{}),[R,T]),le=ue.size||"regular",ce=l.useMemo((()=>new Map(M.filter((e=>{let{to:t}=e;return t.insId===se})).map((e=>{let{to:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),de=l.useMemo((()=>new Map(M.filter((e=>{let{from:t}=e;return t.insId===se})).map((e=>{let{from:t,hidden:n}=e;return[t.pinId,n]})))),[M,se]),pe=(0,C.usePrompt)(),fe=l.useCallback((e=>A(T,e,"input")),[T,A]),me=l.useCallback(((e,t)=>V(T,e,"input",t)),[T,V]),he=l.useCallback(((e,t)=>V(T,e,"output",t)),[T,V]),ve=l.useCallback((e=>A(T,e,"output")),[T,A]),ge=l.useCallback(((e,t)=>{$(T,e,t)}),[T,$]),Ie=l.useCallback(((e,t)=>{const n=T.pos,o=(t.x-n.x)/k.zoom,i=(t.y-n.y)/k.zoom,s=n.x+o,r=n.y+i;z(T,e,{...t,x:s,y:r})}),[T,z,k.zoom]),be=l.useCallback(((e,t)=>{H(T,e,{x:t.x,y:t.y})}),[T,H]),ye=l.useCallback((e=>F(T,e)),[T,F]),Ce=l.useCallback((e=>P(T,e)),[T,P]),_e=l.useCallback((e=>O(T,e)),[T,O]),xe=l.useCallback((e=>S(T,e)),[T,S]),Ne=l.useCallback((e=>L(T,e)),[T,L]),we=l.useCallback((e=>q(T,e.shiftKey)),[T,q]),je=(0,d.entries)(R.inputs),{visibleInputs:Ee,visibleOutputs:Pe}=T;Ee&&je.sort(((e,t)=>Ee.indexOf(e[0])-Ee.indexOf(t[0])));const Oe=(0,d.entries)(R.outputs);Pe&&Oe.sort(((e,t)=>Pe.indexOf(e[0])-Pe.indexOf(t[0])));const Se=(0,t.getVisibleInputs)(T,R,M),De=(0,t.getVisibleOutputs)(T,R,M);je.push([m.TRIGGER_PIN_ID,{...(0,d.nodeInput)(),description:"Use this pin to manually trigger the node. If not connected, the node will be triggered automatically when all required inputs have data."}]),Oe.push([m.ERROR_PIN_ID,{...(0,m.nodeOutput)(),description:"Use this pin to catch errors that happen inside this node. If not connected, errors will bubble up to the parent node."}]);const Me=je.filter((e=>{let[t]=e;return Se.includes(t)||(n||K)&&ce.has(t)})),Te=Oe.filter((t=>{let[o]=t;return De.includes(o)||(n||K)&&de.has(o)||o===m.ERROR_PIN_ID&&e.hadError})),ke=M.some((e=>e.from.insId===se&&e.from.pinId===m.ERROR_PIN_ID)),Re=(0,p.default)("ins-view",{"no-inputs":0===je.length,"no-outputs":0===Oe.length,"display-mode":D,"force-minimized-input":"input"===e.forceShowMinimized||"both"===e.forceShowMinimized,"force-minimized-output":"output"===e.forceShowMinimized||"both"===e.forceShowMinimized,"inline-node-edited":!!W,"error-caught":ke}),Ae=(0,p.default)({selected:n,dragged:r,closest:s&&s.ins.id===T.id},`size-${le}`),Ve=new Set((0,d.entries)(R.inputs).filter((e=>{let[t,n]=e;return(0,m.isInputPinOptional)(n)})).map(d.pickFirst)),$e=(0,d.entries)(T.inputConfig).reduce(((e,t)=>{let[n,o]=t;return(0,m.isStickyInputPinConfig)(o)||o.sticky?{...e,[n]:!0}:e}),{}),ze=(0,v.calcNodeContent)(T,R),He=e=>{const t=T.inputConfig[e];if((0,I.isStaticInputPinConfig)(t))return t.value},Fe=l.useCallback((async()=>{const e=(0,d.okeys)(R.inputs),t=await pe("New order?",(T.visibleInputs||e).join(","));t&&G(T,t.split(","))}),[R.inputs,pe,T,G]),Le=l.useCallback((async()=>{const e=(0,d.okeys)(R.outputs),t=await pe("New order?",(T.visibleOutputs||e).join(","));t&&B(T,t.split(","))}),[R.outputs,pe,T,B]),qe=l.useCallback((()=>{ee(T)}),[ee,T]),Ge=l.useCallback((async()=>{const e=await pe("Set custom display name",T.displayName||R.id);te(T,e)}),[pe,T,te,R.id]),Be=Object.keys((0,h.getNodeInputs)(R)),Ue=Object.keys((0,d.getNodeOutputs)(R)),We=l.useCallback((e=>{U&&U(T,e)}),[T,U]),Ze=l.useCallback(((e,t)=>{ne&&ne(T,e,t)}),[T,ne]),Je=l.useCallback(((e,t)=>{oe&&oe(T,e,t)}),[T,oe]),Ye=()=>(0,u.jsx)("div",{className:"inputs no-drag",children:Me.map((t=>{let[i,r]=t;var a;return(0,u.jsx)(f.PinView,{type:"input",currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,id:i,optional:Ve.has(i),connected:ce.has(i),isSticky:$e[i],minimized:!n&&1===Me.length,onToggleSticky:ye,onDetachConstValue:Ce,onCopyConstValue:_e,onPasteConstValue:xe,copiedConstValue:e.copiedConstValue,selected:i===o,onClick:fe,onDoubleClick:me,isClosestToMouse:!!s&&"input"===s.type&&s.pin===i,onToggleLogged:j,onToggleBreakpoint:E,onInspect:e.onInspectPin,constValue:He(i),onConvertConstToEnv:e.onConvertConstToEnv?We:void 0,description:r.description,queuedValues:null!==(a=e.queuedInputsData[i])&&void 0!==a?a:0,onMouseUp:Ze,onMouseDown:Je},i)}))}),Ke=()=>(0,u.jsx)("div",{className:"outputs no-drag",children:Te.map((t=>{let[o,r]=t;return(0,u.jsx)(f.PinView,{currentInsId:T.id,ancestorsInsIds:e.ancestorsInsIds,connected:de.has(o),type:"output",id:o,minimized:!n&&1===Te.length,isClosestToMouse:!!s&&"output"===s.type&&s.pin===o,selected:o===i,onClick:ve,onDoubleClick:he,onToggleLogged:j,onToggleBreakpoint:E,onInspect:e.onInspectPin,description:r.description,onMouseUp:Ze,onMouseDown:Je},o)}))}),Qe=l.useCallback((e=>{X(T,e)}),[T,X]),Xe=l.useCallback((()=>{const e=[...Be.map((e=>{const t=Se.includes(e),n=ce.has(e)&&!0!==ce.get(e),o=(0,d.getInputName)(e);return{text:t?n?`Hide input "${o}" (disconnect first)`:`Hide input "${o}"`:`Show input "${o}"`,onClick:()=>G(T,t?Se.filter((t=>t!==e)):[...Se,e]),disabled:n&&t}})),...Ue.map((e=>{const t=De.includes(e),n=de.has(e),o=(0,d.getOutputName)(e);return{text:t?n?`Hide output "${o}" (disconnect first)`:`Hide output "${o}"`:`Show output "${o}"`,onClick:()=>B(T,t?De.filter((t=>t!==e)):[...De,e]),disabled:n&&t}})),...(0,d.isInlineNodeInstance)(T)&&(0,h.isVisualNode)(T.node)?[{text:"Ungroup inline node",onClick:()=>Z(T)}]:[],...(0,d.isInlineNodeInstance)(T)?[{text:"Extract inline node to file",onClick:()=>J(T)}]:[],{text:"Reorder inputs",onClick:Fe},{text:"Reorder outputs",onClick:Le},{text:"Set display name",onClick:Ge},{text:"Group selected instances",onClick:Y},{text:"Delete instance",intent:"danger",onClick:qe}];return(0,u.jsxs)(_.Menu,{children:[(0,u.jsx)(_.MenuItem,{text:"Style",children:(0,u.jsx)(N.NodeStyleMenu,{style:ue,onChange:Qe,promptFn:pe})}),e.map(((e,t)=>(0,a.createElement)(_.MenuItem,{...e,key:t})))]})}),[Be,Ue,T,Fe,Le,Ge,qe,ue,Qe,pe,Se,ce,G,De,de,B,Z,J,Y]),et={"--node-color":ue.color,...ue.cssOverride||{}},tt=(0,b.getInstanceDomId)(T.id,e.ancestorsInsIds);return(0,u.jsx)("div",{className:Re,children:(0,u.jsx)(g.BaseNodeView,{pos:T.pos,viewPort:k,onDragStart:ge,onDragMove:be,onDragEnd:Ie,upperRenderer:Ye,bottomRenderer:Ke,displayMode:D,domId:tt,children:(0,u.jsxs)(l.Fragment,{children:[Ye(),W?x.default.createPortal((0,u.jsxs)("div",{className:"inline-group-editor-container no-drag",children:[(0,u.jsxs)("header",{children:[ze," ",(0,u.jsx)("button",{onClick:e.onCloseInlineEditor,children:"close"})]}),(0,u.jsx)(y.VisualNodeEditor,{...e.inlineGroupProps,className:"no-drag",ref:ae})]}),Q):(0,u.jsx)(_.ContextMenu,{className:(0,p.default)("ins-view-inner",Ae,`size-${re.size}`,{dark:ie}),onClick:Ne,onDoubleClick:we,content:Xe(),style:et,children:(0,u.jsx)(_.Tooltip,{content:R.description,children:(0,u.jsxs)(l.Fragment,{children:[ue.icon?(0,u.jsx)(c.FontAwesomeIcon,{icon:ue.icon}):null," ",ze]})})}),Ke()]})})})}},53568:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStyleMenu=t.nodeStylePresetColors=void 0;const r=n(35250),a=n(50382),u=s(n(70079)),l=n(84472);t.nodeStylePresetColors=[{name:"Amethyst",color:"#9b5de5"},{name:"Magenta",color:"#f15bb5"},{name:"Yellow",color:"#fee440"},{name:"Capri",color:"#00bbf9"},{name:"Sea Green",color:"#00f5d4"},{name:"Orange",color:"#ff7f00"}];const c={size:"regular"};t.NodeStyleMenu=e=>{var n;const{onChange:o,style:i}=e,s=i||c,d=e.promptFn,p=u.default.useCallback(((e,t)=>{o({...s,[e]:t})}),[s,o]),f=u.default.useCallback((async()=>{const e=await d("Icon name? (Font Awesome conventions)","rocket"),t=e.includes(",")?e.split(","):e;p("icon",t)}),[d,p]),m=(0,u.useCallback)((async()=>{const e=await d("Enter a custom style (valid JSON representing a React CSS object)",s.cssOverride?JSON.stringify(s.cssOverride):"");try{const t=JSON.parse(e);p("cssOverride",t)}catch(t){console.error(t),(0,l.toastMsg)("Invalid object","danger")}}),[d,p,s.cssOverride]);return(0,r.jsxs)(u.default.Fragment,{children:[(0,r.jsxs)(a.MenuItem,{text:"Color",children:[t.nodeStylePresetColors.map((e=>(0,r.jsx)(a.MenuItem,{text:e.name,onClick:()=>p("color",e.color)},e.name))),(0,r.jsx)(a.MenuDivider,{}),(0,r.jsx)(a.MenuItem,{text:"Remove Color",onClick:()=>p("color",void 0)})]}),(0,r.jsxs)(a.MenuItem,{text:`Size (${null!==(n=s.size)&&void 0!==n?n:"regular"})`,children:[(0,r.jsx)(a.MenuItem,{text:"Small",onClick:()=>p("size","small")}),(0,r.jsx)(a.MenuItem,{text:"Regular",onClick:()=>p("size","regular")}),(0,r.jsx)(a.MenuItem,{text:"Large",onClick:()=>p("size","large")})]}),(0,r.jsxs)(a.MenuItem,{text:"Icon",children:[(0,r.jsx)(a.MenuItem,{text:"Choose Icon",onClick:f}),(0,r.jsx)(a.MenuItem,{text:"Remove Icon",onClick:()=>p("icon",void 0)})]}),(0,r.jsx)(a.MenuItem,{text:"Custom Styling",onClick:m})]})}},88593:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(53568),t)},83651:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86553),t)},53159:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.calcInstancePosition=t.calcNodeWidth=t.calcNodeContent=void 0;const i=n(74762),s=o(n(6576)),r=n(86553),a=n(61888),u=n(30994);t.calcNodeContent=(e,t)=>{if(e.displayName)return e.displayName;if(t.customViewCode)try{const n=Object.entries(e.inputConfig).filter((e=>{let[,t]=e;return(0,i.isStaticInputPinConfig)(t)})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o.value}}),{});return s.default.compile(t.customViewCode)({inputs:n}).trim()}catch(n){return console.error("Error with custom view",n),`Error in custom view [${t.id}]`}return t.id};t.calcNodeWidth=(e,n)=>{const o=(0,i.okeys)(n.inputs).length*r.MIN_WIDTH_PER_PIN,s=(0,t.calcNodeContent)(e,n),u=r.PIECE_CHAR_WIDTH;return(0,a.clamp)(s.length*u+2*r.PIECE_HORIZONTAL_PADDING,o,r.MAX_INSTANCE_WIDTH)};t.calcInstancePosition=(e,t,n)=>{const o=(0,u.getInstanceDomId)(e,t),i=document.getElementById(o);if(i){const{x:e,y:t,width:o,height:s}=i.getBoundingClientRect(),r=t+s/2;return{x:e+o/2-n.x,y:r-n.y}}return console.warn("Cannot find element to draw connection to",o),{x:99999,y:99999}}},17841:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutDebugger=t.LayoutDebuggerItem=t.PosDebugger=void 0;const i=n(70079),s=n(35250),r=n(74762),a=o(n(70079)),u=n(7047),l=e=>{let{pos:t}=e;return(0,s.jsxs)("span",{children:[t.x.toFixed(1),", ",t.y.toFixed(1)]})};t.PosDebugger=e=>(0,s.jsx)("span",{className:"pos-debugger",children:(0,s.jsx)(l,{pos:e.pos})});t.LayoutDebuggerItem=e=>{const{pos:n,viewPort:o,size:i,color:r}=e,a=o.zoom,u=n.x*a-o.pos.x*a,l=n.y*a-o.pos.y*a,c={transform:`translate(${u-n.x}px, ${l-n.y}px)`},d={transform:`scale(${o.zoom})`},p={transform:`translate(${n.x}px, ${n.y}px)`},f={width:`${i.width}px`,height:`${i.height}px`,backgroundColor:r};return(0,s.jsx)("div",{className:"layout-debugger",style:c,children:(0,s.jsxs)("span",{className:"drag-sim",style:p,children:[(0,s.jsx)(t.PosDebugger,{pos:n}),(0,s.jsx)("div",{className:"layout-debugger-zoom-wrapper",style:d,children:(0,s.jsx)("div",{className:"layout-debugger-inner",style:f})})]})})};const c=(()=>{try{return"true"===localStorage.getItem("pos-debugger")}catch(e){return!1}})();t.LayoutDebugger=e=>{const{extraDebug:n,vp:o,node:d,mousePos:p}=e;if(!c)return null;const f=n.map(((e,n)=>(0,i.createElement)(t.LayoutDebuggerItem,{...e,key:n}))),m=[...d.instances.map((e=>e.pos)),...(0,r.values)(d.inputsPosition),...(0,r.values)(d.outputsPosition)].map((e=>(0,s.jsx)(t.LayoutDebuggerItem,{pos:e,viewPort:o,size:{width:0,height:0},color:"red"}))),h=(0,u.logicalPosToRenderedPos)(p,o),v=(0,s.jsxs)("div",{className:"viewport-data",children:[(0,s.jsxs)("div",{children:["Pos: ",(0,s.jsx)(l,{pos:o.pos})]}),(0,s.jsxs)("div",{children:["Zoom: ",o.zoom.toFixed(2)," "]}),(0,s.jsxs)("div",{children:["Mouse (logical): ",(0,s.jsx)(l,{pos:p})]}),(0,s.jsxs)("div",{children:["Rendered (rendered): ",(0,s.jsx)(l,{pos:h})]})]});return(0,s.jsxs)(a.default.Fragment,{children:[v,f,m]})}},44338:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(17841),t)},38259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateInstancesWithSingleConstPinsMap=t.getLeafInstancesOfSelection=void 0;t.getLeafInstancesOfSelection=(e,t,n)=>e.reduce(((e,o)=>[...e,...n.filter((e=>e.to.insId===o.id)).map((e=>t.find((t=>t.id===e.from.insId)))).filter((e=>!!e))]),[]).filter((t=>1===n.filter((e=>e.from.insId===t.id||e.to.insId===t.id)).length&&!e.includes(t)));t.calculateInstancesWithSingleConstPinsMap=(e,t)=>{const{connections:n}=e;return n.filter((e=>t.has(e.from.insId))).reduce(((e,n)=>{const o=t.get(n.from.insId),i=n.to.insId,s=e.get(i)||new Map;return s.set(n.to.pinId,{val:o,insId:n.from.insId}),e.set(i,s),e}),new Map)}},37488:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeIoView=void 0;const a=n(35250),u=n(70079),l=s(n(70079)),c=n(74762),d=n(83234),p=r(n(26372)),f=n(50382),m=n(43490),h=n(66189),v=n(74762),g=n(30994),I=n(30653);t.NodeIoView=l.memo((function(e){const{viewPort:t,selected:n,pos:o,type:i,id:s,onDblClick:r,onRename:b,onDelete:y,onChangeInputMode:C,inputMode:_,onSelect:x,closest:N,onSetDescription:w,description:j,onMouseUp:E,onMouseDown:P,currentInsId:O}=e,{history:S,resetHistory:D,refreshHistory:M}=(0,h.useHistoryHelpers)(O,s,i),T=(0,m.usePrompt)(),k=l.useCallback((async()=>{const e=await T("Description?",j);w(i,s,e)}),[T,j,w,i,s]),R=l.useCallback((()=>{y&&y(i,s)}),[i,s,y]),A=l.useCallback((()=>{b&&b(i,s)}),[i,s,b]),V=l.useCallback((e=>{C&&C(s,e)}),[s,C]),$=l.useCallback((()=>[{text:`Current mode - ${_}`,onClick:c.noop},{text:"Make required",onClick:()=>V("required")},{text:"Make optional",onClick:()=>V("optional")},{text:"Make required-if-connected",onClick:()=>V("required-if-connected")},{text:"Set description",onClick:k},...e.onRename?[{text:"Rename",onClick:A}]:[],...e.onDelete?[{text:"Delete",onClick:R}]:[]]),[k,_,V,R,A,e.onDelete,e.onRename]),z=l.useCallback((t=>{r&&r(e.id,t)}),[r,e.id]),H=l.useCallback((()=>{x(s,i)}),[s,i,x]),F=l.useCallback((()=>(0,a.jsx)(f.Menu,{children:$().map(((e,t)=>(0,u.createElement)(f.MenuItem,{...e,key:t})))})),[$]),L="input"===i?(0,v.getInputName)(s):(0,c.getOutputName)(s),q=l.useCallback((e=>{E(s,i,e)}),[s,E,i]),G=l.useCallback((e=>{P(s,i,e)}),[s,P,i]),B=(0,I.useDarkMode)();return(0,a.jsx)(d.BaseNodeView,{className:(0,p.default)("node-io-view",i,{dark:B}),pos:o,onDragEnd:(n,o)=>{const r=e.pos,a=(o.x-r.x)/t.zoom,u=(o.y-r.y)/t.zoom,l=r.x+a,c=r.y+u;e.onDragEnd(i,s,n,{...o,x:l,y:c})},onDragStart:(t,n)=>{e.onDragStart(s,t,n)},onDragMove:(t,n)=>{e.onDragMove(i,s,t,{x:n.x,y:n.y})},viewPort:t,children:(0,a.jsx)(l.Fragment,{children:(0,a.jsx)(f.Tooltip,{content:(()=>{const t=(0,h.calcHistoryContent)(S),n=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:L})," (",i,")"," "]}),n,(0,a.jsx)("hr",{}),t]})})(),children:(0,a.jsx)(f.ContextMenu,{onMouseEnter:M,onMouseOut:D,onMouseUp:q,onMouseDown:G,"data-tip":"","data-html":!0,"data-for":s+e.currentInsId,className:(0,p.default)("node-io-view-inner",{closest:N,selected:n,dark:B}),id:(0,g.getPinDomId)({fullInsIdPath:(0,c.fullInsIdPath)(e.currentInsId,e.ancestorInsIds),pinId:s,pinType:i,isMain:!0}),onClick:H,onDoubleClick:z,content:F(),children:s})})})})}))},66005:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37488),t)},83782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcNodeIoWidth=t.MIN_WIDTH_PER_PIN=t.PIECE_CHAR_WIDTH=t.PIECE_HORIZONTAL_PADDING=void 0,t.PIECE_HORIZONTAL_PADDING=15,t.PIECE_CHAR_WIDTH=9,t.MIN_WIDTH_PER_PIN=40;t.calcNodeIoWidth=e=>Math.max(t.MIN_WIDTH_PER_PIN,e.length*t.PIECE_CHAR_WIDTH+2*t.PIECE_HORIZONTAL_PADDING)},99942:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderVisualNode=t.layoutToInstances=void 0;const i=n(63521),s=n(74762),r=n(90794),a=o(n(53865)),u=n(83782),l=n(60190),c=n(53159),d=n(41032);t.layoutToInstances=(e,t)=>(0,a.default)(t,(t=>{(0,s.entries)(e.nodes).forEach((e=>{let[n,o]=e;if(n.startsWith("ins-")){const e=n.replace("ins-",""),i=t.instances.find((t=>t.id===e));i?i.pos=o.p:console.warn("WAT")}if(n.startsWith("node-input-")){const e=n.replace("node-input-","");t.inputsPosition[e]=o.p}if(n.startsWith("node-output-")){const e=n.replace("node-output-","");t.outputsPosition[e]=o.p}}))}));t.orderVisualNode=(e,n,o,a)=>{const{instances:p,connections:f}=e,m={...p.reduce(((e,t)=>{const o=(0,l.size)((0,c.calcNodeWidth)(t,(0,d.safelyGetNodeDef)(t,n)),i.NODE_HEIGHT);return{...e,[`ins-${t.id}`]:{p:t.pos,s:o}}}),{}),...(0,s.okeys)(e.inputsPosition).reduce(((t,n)=>({...t,[`node-input-${n}`]:{p:e.inputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{}),...(0,s.okeys)(e.outputsPosition).reduce(((t,n)=>({...t,[`node-output-${n}`]:{p:e.outputsPosition[n],s:(0,l.size)((0,u.calcNodeIoWidth)(n),i.NODE_HEIGHT)}})),{})},h=f.map((e=>[(0,s.isExternalConnectionNode)(e.from)?`node-input-${e.from.pinId}`:`ins-${e.from.insId}`,(0,s.isExternalConnectionNode)(e.to)?`node-output-${e.to.pinId}`:`ins-${e.to.insId}`])),v=(0,r.orderLayout)({nodes:m,edges:h},o,((n,o)=>{a&&a((0,t.layoutToInstances)(n,e),o)}));return(0,t.layoutToInstances)(v,e)}},90794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderLayout=void 0;const o=n(60190),i=400,s=e=>e.reduce(((e,t)=>{const n=(0,o.vSub)(t.p,(0,o.vec)(t.s.width/2,t.s.height/2));return{...e,[t.id]:{p:n,s:t.s}}}),{});t.orderLayout=(e,t,n)=>{let{nodes:r,edges:a}=e,u=Object.entries(r).map((e=>{let[t,n]=e;return{id:t,p:(0,o.vAdd)(n.p,(0,o.vec)(n.s.width/2,n.s.height/2)),f:(0,o.vec)(0,0),v:(0,o.vec)(0,0),m:1,s:n.s}})),l=0;for(;l.01);){let e=u;for(let t=0;t{let n=e.find((e=>e.id===t[0])),i=e.find((e=>e.id===t[1]));if(!n||!i)return void console.warn("weoops",t[0],t[1]);const s=(0,o.vec)(0,-200),r=(0,o.vSub)(n.p,i.p),a=(0,o.vSub)(s,r),u=1e3*(0,o.vLen)(a),l=(0,o.vMul)((0,o.vNorm)(a),.5*u),c=(0,o.vMul)((0,o.vNorm)(a),-.5*u);n.f=(0,o.vAdd)(n.f,l),i.f=(0,o.vAdd)(i.f,c)})),e=e.map((e=>(0,o.itrPhysics)(15,e))),e=e.map((e=>{const t=(0,o.vMul)(e.v,.5),n=(0,o.vLen)(t)>100?(0,o.vMul)((0,o.vNorm)(t),100):t;return{...e,v:n}})),u=e,n&&n({nodes:s(e),edges:a},l),l++}return{nodes:s(u),edges:a,itrs:l,timeout:l>=t,total:(0,o.totalEnergy)(u)}}},2036:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PinView=t.PIN_HEIGHT=void 0;const a=n(35250),u=s(n(70079)),l=r(n(26372)),c=n(50382),d=n(18420),p=n(74762),f=n(30994),m=n(96233),h=n(66189),v=n(30653);t.PIN_HEIGHT=23;t.PinView=u.memo((function(e){const{selected:t,type:n,connected:o,optional:i,currentInsId:s,isClosestToMouse:r,id:g,onMouseDown:I,onMouseUp:b}=e,{history:y,resetHistory:C,refreshHistory:_}=(0,h.useHistoryHelpers)(s,g,n),x=(0,v.useDarkMode)(),N="input"===n?(0,p.getInputName)(g):(0,p.getOutputName)(g),w="input"===e.type&&(0,d.isDefined)(e.constValue)?e.constValue:void 0,j=u.useCallback((e=>{0===e.button&&I(g,n,e)}),[g,n,I]),E=u.useCallback((e=>{0===e.button&&b(g,n,e)}),[g,n,b]);return(0,a.jsxs)("div",{className:(()=>{if("input"===e.type){const{isSticky:s,constValue:a}=e;return(0,l.default)("pin",{sticky:s,selected:t,closest:r,optional:i,connected:o,"const-value":(0,d.isDefined)(a),"env-value":(0,d.isDefined)(a)&&(0,p.isEnvValue)(a),minimized:e.minimized,dark:x},n)}return(0,l.default)("pin",{selected:t,connected:o,closest:r,optional:i,minimized:e.minimized,"error-pin":g===p.ERROR_PIN_ID,dark:x},n)})(),"data-pin-id":g,children:[(0,a.jsx)(c.Tooltip,{className:"pin-info-tooltip",content:(()=>{const t=(0,h.calcHistoryContent)(y,"input"===n?e.queuedValues:void 0),o=e.description?(0,a.jsx)("em",{children:e.description}):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:N})," (",n,")"," "]}),o,(0,a.jsx)("hr",{}),(0,d.isDefined)(w)?(0,a.jsxs)("div",{children:["Static value:"," ",(0,a.jsx)("strong",{children:(0,m.valuePreview)(w).substring(0,200)})]}):t]})})(),children:(0,a.jsxs)(c.ContextMenu,{onMouseEnter:_,onMouseOut:C,onMouseDown:j,onMouseUp:E,"data-tip":"","data-html":!0,"data-for":g+e.currentInsId,id:(0,f.getPinDomId)({fullInsIdPath:(0,p.fullInsIdPath)(e.currentInsId,e.ancestorsInsIds),pinId:g,pinType:n,isMain:!1}),onDoubleClick:t=>e.onDoubleClick&&e.onDoubleClick(g,t),className:(0,l.default)("pin-inner",{dark:x}),onClick:t=>{const{onShiftClick:o,onClick:i,id:s}=e;t.shiftKey&&o?o(s,t):i(s,n,t)},content:(()=>{const t=(0,a.jsx)(c.MenuItem,{onClick:()=>e.onInspect(e.currentInsId,{id:e.id,type:e.type}),text:"Inspect"});if("input"===e.type){const{onConvertConstToEnv:n}=e;return(0,d.isDefined)(w)?(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onDetachConstValue(e.id),text:"Detach value"}),(0,a.jsx)(c.MenuItem,{onClick:()=>e.onCopyConstValue(e.id),text:"Copy value"}),(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null,n?(0,a.jsx)(c.MenuItem,{onClick:()=>n(e.id),text:"Convert to Env Var"}):null]}):(0,a.jsxs)(c.Menu,{children:[(0,a.jsx)(c.MenuItem,{onClick:()=>e.onToggleSticky(e.id),text:"Toggle sticky (square means sticky)"}),t,(0,d.isDefined)(e.copiedConstValue)?(0,a.jsx)(c.MenuItem,{onClick:()=>e.onPasteConstValue(e.id),text:"Paste value"}):null]})}return(0,a.jsx)(c.Menu,{children:t})})(),children:[N," ",(0,d.isDefined)(w)?(0,a.jsxs)(u.Fragment,{children:[":",(0,a.jsx)("span",{className:"value",children:(0,d.toString)(w)})]}):null,"input"===e.type&&e.isSticky?(0,a.jsx)("span",{className:"suffix",children:"s"}):null,"input"===e.type&&e.queueSize?(0,a.jsxs)("span",{className:"suffix",children:[e.queueSize," in Q"]}):null]})}),(0,a.jsx)("div",{className:"wire"})]})}))},66189:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useHistoryHelpers=t.calcHistoryContent=void 0;const i=n(35250),s=n(96233),r=o(n(70079)),a=n(70079),u=n(98158);t.calcHistoryContent=(e,t)=>{if(e){const{total:n,lastSamples:o}=e,a=(0,i.jsxs)("strong",{children:["Activated ",n," times this session"]}),u=o.length>0?(0,i.jsxs)("div",{children:["Last value:"," ",(0,i.jsx)("strong",{children:(0,s.valuePreview)(o[0].val).substring(0,200)}),(0,i.jsx)("br",{}),(0,i.jsx)("em",{children:"Inspect instance for the full value"})]}):"",l=t?(0,i.jsx)(r.default.Fragment,{children:(0,i.jsxs)("div",{children:["Queued values: ",(0,i.jsx)("strong",{children:t})]})}):"";return(0,i.jsxs)(r.default.Fragment,{children:[a,u,l]})}return"Loading session data.."};t.useHistoryHelpers=(e,t,n)=>{const o=(0,a.useRef)(),{onRequestHistory:i}=(0,u.useDebuggerContext)(),[s,l]=(0,a.useState)();return{history:s,refreshHistory:(0,a.useCallback)((()=>{clearInterval(o.current),i(e,t,n).then((e=>{l(e)})),o.current=setInterval((()=>{i(e,t,n).then((e=>{l(e)}))}),500)}),[e,i,t,n]),resetHistory:r.default.useCallback((()=>{clearInterval(o.current),l(void 0)}),[])}}},89440:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAddMenu=void 0;const r=n(35250),a=s(n(70079)),u=n(74762),l=n(50382),c=n(70457),d=n(9958),p=n(86125),f=c.Select.ofType(),m=e=>{switch(e.type){case"node":return`${e.node.id}`;case"value":return"Add inline value or function";case"import":return`Import ${e.importableNode.node.id} from ${e.importableNode.module}`}},h=(e,t)=>{let{handleClick:n,modifiers:o,query:i}=t;if(!o.matchesPredicate)return null;const s=m(e);return"value"===e.type?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(l.MenuDivider,{}),(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))]}):(0,r.jsx)(l.MenuItem,{active:o.active,disabled:o.disabled,onClick:n,text:(0,d.highlightText)(s,i)},m(e))},v=(e,t,n,o)=>{const i=m(t).toLocaleLowerCase(),s=e.toLowerCase();return o?i===s:i.includes(s)};t.QuickAddMenu=e=>{const{resolvedDependencies:t,targetNode:n}=e,o={left:e.pos.x,top:e.pos.y},{onRequestImportables:i}=(0,p.useDependenciesContext)(),[s,c]=a.useState();a.useEffect((()=>{i().then((e=>c(e.importables)))}),[i]);const d=(0,u.values)({...t,[n.id]:n}),m=d.map((e=>({type:"node",node:e}))),g=new Set(d.map((e=>e.id))),I=s?s.filter((e=>!g.has(e.node.id))).map((e=>({type:"import",importableNode:e}))):[],b=m.concat(I).concat({type:"value"});return(0,r.jsx)("div",{className:"quick-add-menu",style:o,children:(0,r.jsx)(f,{className:"quick-add-nodes-select",items:b,itemPredicate:v,itemRenderer:h,inputProps:{className:"quick-add-input"},noResults:(0,r.jsx)(l.MenuItem,{disabled:!0,text:"No results."}),onItemSelect:t=>e.onAdd(t),popoverProps:{isOpen:!0,onClose:()=>e.onClose()}})})}},71033:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89440),t)},73470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimePlayer=void 0;const o=n(74762),i=n(64955),s=(0,o.debugLogger)("runtime-player");t.createRuntimePlayer=()=>{let e=0,t=[];let n=!1,r=Date.now(),a=e;const u=()=>requestAnimationFrame((()=>{const l=Date.now();a=e,e+=l-r,r=l,((e,n)=>{const r=t;t=[],r.length&&s(`Playing ${r.length} events from`,e,n),r.forEach((e=>{s("Playing event",e),(0,i.playEvent)(e),e.insId===o.ROOT_INS_ID&&e.type===o.DebuggerEventType.PROCESSING_CHANGE&&!1===e.val&&(s("Main instance is done processing, clearing runtime UI",e),c())}))})(a,e),n&&u()})),l=()=>{n=!1},c=()=>{document.querySelectorAll("[data-runtime]").forEach((e=>{e.removeAttribute("data-runtime")})),document.querySelectorAll("[data-runtime-queue]").forEach((e=>{e.removeAttribute("data-runtime-queue")})),t=[]};return{stop:l,start:function(t){void 0===t&&(t=0),n=!0,e=t,r=Date.now(),u()},addEvents:e=>{t.push(...e)},destroy:()=>{l(),c()},clear:c,status:()=>({running:n,currDt:e,lastDt:a,queue:t,last:r})}}},64955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playEvent=t.cancelTimers=void 0;const o=n(74762),i=n(30994),s=5e3,r=(0,o.debugLogger)("runtime-player:play-event"),a=(e,t)=>e.type===o.DebuggerEventType.INPUT_CHANGE||e.type===o.DebuggerEventType.OUTPUT_CHANGE?`${(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds)}.${e.pinId}`:(0,o.fullInsIdPath)(e.insId,e.ancestorsInsIds);t.cancelTimers=new Map;t.playEvent=e=>{switch(e.type){case o.DebuggerEventType.INPUT_CHANGE:case o.DebuggerEventType.OUTPUT_CHANGE:{const{pinId:n,insId:u,ancestorsInsIds:l}=e,c=e.type===o.DebuggerEventType.INPUT_CHANGE?"input":"output",d=[(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!0})];u!==o.ROOT_INS_ID&&d.push((0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(u,l),pinId:n,pinType:c,isMain:!1})),d.forEach(((i,l)=>{const c=a(e);clearTimeout(t.cancelTimers.get(c));const d=document.getElementById(i),p=`${u}.${n}`,f=e.type===o.DebuggerEventType.OUTPUT_CHANGE?document.querySelectorAll(`[data-from-id="${p}"]`):[];if(d){clearTimeout(t.cancelTimers.get(c)),d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),setTimeout((()=>{d.setAttribute("data-runtime","active"),f.forEach((e=>{e.setAttribute("data-runtime","active")}))}),0);const n=setTimeout((()=>{d.removeAttribute("data-runtime"),f.forEach((e=>{e.removeAttribute("data-runtime")})),t.cancelTimers.delete(c)}),s);t.cancelTimers.set(a(e),n)}else console.warn(`No DOM element with Id [${i}] found to play event`),r(`No DOM element with Id [${i}] found to play event`,e)}));break}case o.DebuggerEventType.PROCESSING_CHANGE:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(l)if(!0===e.val)l.setAttribute("data-runtime","processing"),clearTimeout(t.cancelTimers.get(u));else{l.removeAttribute("data-runtime"),setTimeout((()=>{"error"!==l.getAttribute("data-runtime")&&l.setAttribute("data-runtime","done")}),0);const e=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,e)}else r(`No DOM element with Id [${n}] found to play event`,e)}));break}case o.DebuggerEventType.ERROR:{const{insId:n,ancestorsInsIds:u}=e,l=[(0,i.getMainInstanceIndicatorDomId)(n,u)];n!==o.ROOT_INS_ID&&l.push((0,i.getInstanceDomId)(n,u)),l.forEach(((n,o)=>{var i;const u=a(e),l=null===(i=document.getElementById(n))||void 0===i?void 0:i.parentElement;if(!l)return void r(`No DOM element with Id [${n}] found to play event`,e);clearTimeout(t.cancelTimers.get(u)),l.removeAttribute("data-runtime"),setTimeout((()=>{l.setAttribute("data-runtime","error")}));const c=setTimeout((()=>{l.removeAttribute("data-runtime"),t.cancelTimers.delete(u)}),s);t.cancelTimers.set(u,c)}));const c={...e,type:o.DebuggerEventType.OUTPUT_CHANGE,pinId:o.ERROR_PIN_ID};(0,t.playEvent)(c);break}case o.DebuggerEventType.INPUTS_STATE_CHANGE:(0,o.entries)(e.val).forEach((t=>{let[n,s]=t;const{insId:a,ancestorsInsIds:u}=e,l=(0,i.getPinDomId)({fullInsIdPath:(0,o.fullInsIdPath)(a,u),pinId:n,pinType:"input",isMain:!1}),c=document.getElementById(l);c?s>0?c.setAttribute("data-runtime-queue",`${s}`):c.removeAttribute("data-runtime-queue"):r(`No DOM element with Id [${l}] found to play event`,e)}))}}},25804:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounce=void 0;const o=n(70079);t.useDebounce=function(e,t){const[n,i]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,i]}},7047:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.handleChangeNodeInputType=t.handleIoPinRename=t.handleInstanceDrag=t.getInstancesInRect=t.isJsxValue=t.getMiddleOfViewPort=t.fitViewPortToNode=t.centerBoardPosOnTarget=t.renderedPosToLogicalPos=t.logicalPosToRenderedPos=t.getEffectiveNodeDimensions=t.calcNodesPositions=t.calcSelectionBoxArea=t.animateViewPort=t.easeInOutNum=t.easeInOutPos=t.easeInOutQuad=t.center=t.distance=t.clamp=t.domToViewPort=t.roundNumber=t.createNewNodeInstance=t.createNewInlineNodeInstance=t.parseInputOutputTypes=t.parsePromptValue=t.getSelectionBoxRect=t.findClosestPin=t.changePinConfig=t.getInstancePinConfig=t.emptyList=t.emptyObj=void 0;const r=s(n(53865)),a=n(30721),u=n(63521),l=n(74762),c=n(18243),d=n(74762),p=n(53159),f=n(83782),m=n(60190),h=n(38259),v=n(83651),g=n(41032);t.emptyObj={},t.emptyList=[],t.getInstancePinConfig=function(e,n,o){var i;const s=e.instances.find((e=>e.id===n));if(!s)throw new Error(`Instance ${n} not found`);return null!==(i=(s.inputConfig||t.emptyObj)[o])&&void 0!==i?i:(0,l.queueInputPinConfig)()};t.changePinConfig=(e,t,n,o)=>r.produce(e,(e=>{var i;const{instances:s}=e,r=s.find((e=>e.id===t));if(!r)throw new Error("blah");const a=null!==(i=r.inputConfig)&&void 0!==i?i:{};a[n]=o,e.instances=s.map((e=>e===r?{...r,inputConfig:a}:e))}));t.findClosestPin=(e,t,n,o,i,s,r)=>{const a=(0,l.nodeInstance)(e.id,e.id),u=(0,d.okeys)(e.inputs).map((e=>({id:e,type:"input",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),p=(0,d.okeys)(e.outputs).map((e=>({id:e,type:"output",pos:(0,c.calcPinPosition)({insId:i,ancestorsInsIds:s,pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!0}),ins:a}))),f=[...u,...e.instances.reduce(((n,a)=>{const u=(0,g.safelyGetNodeDef)(a,t),d=(0,v.getVisibleInputs)(a,u,e.connections),p=(0,v.getVisibleOutputs)(a,u,e.connections);return[...n,...d.map((e=>({ins:a,type:"input",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"input",boardPos:o,viewPort:r,isMain:!1}),id:e}))),...p.map((e=>({ins:a,type:"output",pos:(0,c.calcPinPosition)({insId:a.id,ancestorsInsIds:(0,l.fullInsIdPath)(i,s),pinId:e,pinType:"output",boardPos:o,viewPort:r,isMain:!1}),id:e})))]}),[]),...p];let m={dis:1e5,item:f[0]};return f.forEach((e=>{const t=e.pos.x-n.x,o=e.pos.y-n.y,i=Math.sqrt(t*t+o*o);i{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x,t.x)-n,h:Math.max(e.y,t.y)-o}};t.parsePromptValue=e=>{if(null===e)return;const t=parseInt(e,10);let n=e;return t.toString()!=e||isNaN(t)||(n=t),n};t.parseInputOutputTypes=e=>{const[,t,n]=e.match(/node\((.+)\|(.+)\)/)||[],o=(0,d.entries)(JSON.parse(t)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]})),i=(0,d.entries)(JSON.parse(n)).map((e=>{let[t,n]=e;const o={type:n,optional:(0,d.isOptionalType)(t)};return[t.replace(/\?$/,""),o]}));return{inputs:(0,d.fromEntries)(o),outputs:(0,d.fromEntries)(i)}};t.createNewInlineNodeInstance=function(e,t,n){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const o=(0,l.inlineNodeInstance)(`${e.id}-${(0,d.randomInt)(999)}`,e,{},{x:0,y:0}),i=(0,p.calcNodeWidth)(o,e),{x:s,y:r}=n,a={x:s-i/2,y:r+t};return{...o,pos:a}};t.createNewNodeInstance=function(e,t,n,o){void 0===t&&(t=-1*u.NODE_HEIGHT*1.5);const i="string"==typeof e?(0,g.safelyGetNodeDef)(e,o):e;if(!i)throw new Error(`${e} node not found in resolvedNodes`);const s=(0,d.entries)(i.inputs).reduce(((e,t)=>{let[n,o]=t;return o.defaultValue&&(e[n]=(0,l.staticInputPinConfig)(o.defaultValue)),e}),{}),r=(0,l.nodeInstance)((0,a.createId)(),i.id,s,{x:0,y:0}),c=(0,p.calcNodeWidth)(r,i),{x:f,y:m}=n,h={x:f-c/2,y:m+t};return{...r,pos:h}};t.roundNumber=e=>Math.round(100*e)/100;t.domToViewPort=(e,n,o)=>({x:(0,t.roundNumber)(n.pos.x+e.x/n.zoom/o.zoom),y:(0,t.roundNumber)(n.pos.y+e.y/n.zoom/o.zoom)});t.clamp=(e,t,n)=>Math.max(e,Math.min(t,n));t.distance=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)};t.center=(e,t,n)=>{let{zoom:o}=n;const i=e.x+e.w/2,s=e.y+e.h/2,{w:r,h:a}=t;return{x:i-r/o/2,y:s-a/o/2}};t.easeInOutQuad=e=>e<.5?2*e*e:(4-2*e)*e-1;t.easeInOutPos=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i),a=(0,t.easeInOutQuad)(r),u=n.x-e.x,l=n.y-e.y;return{x:e.x+u*a,y:e.y+l*a}};t.easeInOutNum=(e,n,o,i,s)=>{const r=(0,t.clamp)(0,1,(s-o)/i);return e+(n-e)*(0,t.easeInOutQuad)(r)};t.animateViewPort=(e,n,o,i)=>{const s=(0,t.distance)(e.pos,n.pos),r=Date.now(),a=o;if(0===s)return void i(e);const u=()=>{const o=Date.now(),s=(0,t.easeInOutPos)(e.pos,n.pos,r,a,o),l=(0,t.easeInOutNum)(e.zoom,n.zoom,r,a,o);o-r{const n=(0,t.getSelectionBoxRect)(e.from,e.to);return n.h*n.w};const I=(e,t,n,o)=>({left:n.x,right:n.x+e,top:n.y,bottom:n.y+t,tag:o,center:(0,l.calcCenter)({w:e,h:t,...n})});t.calcNodesPositions=(e,t)=>[...e.instances.map((e=>{const n=(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,t)),o=u.NODE_HEIGHT;return I(n,o,e.pos,e.id)})),...(0,d.okeys)(e.inputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.inputsPosition[t]||{x:0,y:0};return I(n,o,i,"input_"+t)})),...(0,d.okeys)(e.outputs).map((t=>{const n=(0,f.calcNodeIoWidth)(t),o=u.NODE_HEIGHT,i=e.outputsPosition[t]||{x:0,y:0};return I(n,o,i,"output"+t)}))];t.getEffectiveNodeDimensions=(e,n)=>{const o=(0,t.calcNodesPositions)(e,n),i=o[0]||{left:0,right:0,top:0,bottom:0},s=o.reduce(((e,t)=>t.leftt.right>e?t.right:e),i.right),a=o.reduce(((e,t)=>t.topt.bottom>e?t.bottom:e),i.bottom)-a,d={x:s,y:a};return{size:{width:u,height:c},pos:d,center:(0,l.calcCenter)({w:u,h:c,...d})}};t.logicalPosToRenderedPos=(e,t)=>{const n=(0,m.vSub)(e,t.pos);return(0,m.vMul)(n,t.zoom)};t.renderedPosToLogicalPos=(e,t)=>{const n=(0,m.vDiv)(e,t.zoom);return(0,m.vAdd)(t.pos,n)};t.centerBoardPosOnTarget=(e,n,o,i)=>{const s=(0,t.logicalPosToRenderedPos)(e,i),r=(0,t.renderedPosToLogicalPos)(s,{...i,zoom:o}),a=Math.max(e.x,r.x)-Math.min(e.x,r.x),u=Math.max(e.y,r.y)-Math.min(e.y,r.y);return{x:o>i.zoom?i.pos.x+a:i.pos.x-a,y:o>i.zoom?i.pos.y+u:i.pos.y-u}};t.fitViewPortToNode=function(e,n,o,i){void 0===i&&(i=[20,150]);const{size:s,center:r}=(0,t.getEffectiveNodeDimensions)(e,n),a=i[0],u=i[1],l=s.width+a,c=s.height+u,d=o.width/l,p=o.height/c,f=Math.min(d,p)/1.15,m=(0,t.clamp)(.3,1.2,f);return{zoom:m,pos:{x:r.x-o.width/2/m,y:r.y-o.height/2/m+20}}};t.getMiddleOfViewPort=(e,n)=>{const o={x:n.width/2,y:n.height/2};return(0,t.renderedPosToLogicalPos)(o,e)};t.isJsxValue=e=>{const t=e=>(0,d.isDefined)(e.ref)&&(0,d.isDefined)(e.type)&&(0,d.isDefined)(e.props);try{const n=JSON.parse(e);return t(n)||Array.isArray(n)&&t(n[0])}catch(n){return!1}};t.getInstancesInRect=(e,n,o,i,s,r,a)=>{const{from:c,to:d}=e,f=(0,t.getSelectionBoxRect)(c,d);return s.filter((e=>{const{pos:t}=e,i={...t,w:(0,p.calcNodeWidth)(e,(0,g.safelyGetNodeDef)(e,n))*o.zoom*a.zoom,h:u.NODE_HEIGHT*o.zoom*a.zoom};return(0,l.intersectRect)(f,i)||(0,l.intersectRect)(i,f)})).map((e=>e.id))};t.handleInstanceDrag=(e,t,n,o,i,s)=>{o.preventDefault(),o.stopPropagation();const a=(0,m.vSub)(n,t.pos);let u;const l=r.produce(e,(e=>{const r=e.instances.find((e=>e.id===t.id));if(!r)throw new Error("impossible state dragging instance that does not exist");!o.shiftKey&&s&&(u=[s]);const l=e.instances.filter((e=>i.includes(e.id)&&e!==r)),c=[r,...l],d=(0,h.getLeafInstancesOfSelection)(c,e.instances,e.connections);[...l,...d].forEach((e=>{e.pos=(0,m.vAdd)(e.pos,a)})),r.pos=n,!o.shiftKey&&s&&(u=[s])}));return{newValue:l,newSelected:u}};t.handleIoPinRename=(e,t,n,o)=>r.produce(e,(e=>{"input"===t?(e.inputs[o]=e.inputs[n],e.inputsPosition[o]=e.inputsPosition[n],delete e.inputs[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.from)&&e.from.pinId===n?{...e,from:{...e.from,pinId:o}}:e))):(e.outputs[o]=e.outputs[n],e.outputsPosition[o]=e.outputsPosition[n],e.connections=e.connections.map((e=>(0,l.isExternalConnectionNode)(e.to)&&e.to.pinId===n?{...e,to:{...e.to,pinId:o}}:e)),e.completionOutputs=(e.completionOutputs||[]).map((e=>e.split("+").map((e=>e===n?o:n)).join("+"))),delete e.outputs[n])}));t.handleChangeNodeInputType=(e,t,n)=>r.produce(e,(e=>{const o=e.inputs[t];if(!o)throw new Error("Wat");o.mode=n}))},42403:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorClient=void 0;const i=n(74762),s=o(n(18706)),r=n(32048),a=n(31758),u=(0,i.debugLogger)("remote-debugger:editor-client");t.createEditorClient=(e,t)=>{const n=new URL(e),o=(0,r.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/editor`,timeout:3e4});return o.emit("join-room-editor",t),{emitChange:e=>{o.emit(a.DebuggerServerEventType.CHANGE_EVENT_NAME,e)},emitBreakpointsChange:e=>{o.emit(a.DebuggerServerEventType.UPDATE_BREAKPOINTS,e)},interceptInput:e=>{o.emit(a.DebuggerServerEventType.INPUT_VALUE_OVERRIDE,e)},interceptOutput:e=>{o.emit(a.DebuggerServerEventType.OUTPUT_VALUE_OVERRIDE,e)},onRuntimeReady:e=>(o.on(a.DebuggerServerEventType.RUNTIME_READY,e),()=>o.off(a.DebuggerServerEventType.RUNTIME_READY,e)),onChangeAwk:e=>(o.on(a.DebuggerServerEventType.CHANGE_AWK,e),()=>o.off(a.DebuggerServerEventType.CHANGE_AWK,e)),onChangeError:e=>(o.on(a.DebuggerServerEventType.CHANGE_ERROR,e),()=>o.off(a.DebuggerServerEventType.CHANGE_ERROR,e)),onIsAlive:e=>(o.on(a.DebuggerServerEventType.IS_ALIVE,e),()=>o.off(a.DebuggerServerEventType.IS_ALIVE,e)),emitInputValue:(e,t)=>{u(`Emitting push input value to ${e} %o`,t),o.emit(a.DebuggerServerEventType.PUSH_INPUT_VALUE,{pinId:e,value:t})},destroy:()=>{o.disconnect(),(0,a.enumToArray)(a.DebuggerServerEventType).forEach((e=>o.off(e)))},onDisconnect:e=>(o.on("disconnect",e),()=>o.off("disconnect",e)),debugInfo:()=>`Remote debugger for ${e}`,onBatchedEvents:e=>(o.on(a.DebuggerServerEventType.EVENTS_BATCH,e),()=>o.off(a.DebuggerServerEventType.EVENTS_BATCH,e)),requestState:()=>s.default.get(`${e}/state`).then((e=>e.data.state)),getHistory:n=>s.default.get(`${e}/history`,{params:{insId:n.insId,pinId:n.pinId,limit:n.limit,executionId:t}}).then((e=>e.data)),clearHistory:()=>s.default.delete(`${e}/history`).then((()=>{})),triggerNode:(t,n)=>s.default.post(`${e}/trigger`,{nodeId:t,inputs:n}).then((e=>e.data))}}},58066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeData=void 0;const o=n(74762),i=n(36783),s=(0,o.debugLogger)("remote-debugger:normalize-data");t.normalizeData=e=>{if(e instanceof Error)return(0,i.serializeError)(e);if("object"==typeof e&&null!==e){e={...e};const t=new WeakSet,n=e=>{if("bigint"==typeof e)return e.toString();if("object"!=typeof e||Array.isArray(e))return e;if(null===e)return e;if(t.has(e))return"[Circular]";try{t.add(e)}catch(o){s("Error adding to WeakSet","data:",e,"type:",typeof e,"error:",o)}if(Array.isArray(e))return e.map(n);if("object"==typeof e){const t={};for(const o in e)t[o]=n(e[o]);return t}return e};return n(e)}return e}},39641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntimeClient=t.DEFAULT_DT_SCALE=void 0;const o=n(74762),i=n(32048),s=n(31758),r=n(58066),a=(0,o.debugLogger)("remote-debugger:runtime-client");t.DEFAULT_DT_SCALE=1;t.createRuntimeClient=(e,t)=>{const n=new URL(e),u=(0,i.io)(n.origin,{path:`${"/"===n.pathname?"":n.pathname}/socket.io/runtime`,timeout:1e3,reconnectionAttempts:3});u.emit("join-room-runtime",t),u.on("connection",(e=>{e.join(t)}));let l=new Set;u.on(s.DebuggerServerEventType.UPDATE_BREAKPOINTS,(e=>{l=new Set(e)}));const c=(0,o.cappedArrayDebounce)((e=>{a(`Emitting debounced batched events - ${e.length}`),u.emit(s.DebuggerServerEventType.EVENTS_BATCH,e)}),100,200);return{onChange:e=>(u.on(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e),()=>u.off(s.DebuggerServerEventType.CHANGE_EVENT_NAME,e)),onInput:e=>(u.on(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e),()=>u.off(s.DebuggerServerEventType.PUSH_INPUT_VALUE,e)),emitEvent:e=>{a(`Emitting event ${e.type} change event of ${e.insId}`),e.val=(0,r.normalizeData)(e.val),c.addItem({...e,time:Date.now()})},emitRuntimeReady:()=>{u.emit(s.DebuggerServerEventType.RUNTIME_READY,{})},emitChangeAwk:()=>{u.emit(s.DebuggerServerEventType.CHANGE_AWK,{})},emitChangeError:e=>{u.emit(s.DebuggerServerEventType.CHANGE_ERROR,{error:e})},emitIsAlive:e=>{u.emit(s.DebuggerServerEventType.IS_ALIVE,{time:e})},destroy:async()=>{c.pendingItems()&&(c.flush(),await(0,o.delay)(100)),(0,s.enumToArray)(s.DebuggerServerEventType).forEach((e=>u.off(e))),u.disconnect()},onDisconnect:e=>(u.on("disconnect",e),()=>u.off("disconnect",e)),waitForConnection:()=>new Promise(((e,t)=>{u.connected?e():(u.on("connect_error",(e=>{t(`Socket connect error: ${e}`)})),u.on("connect",(()=>{e()})))}))}}},31758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerServerEventType=t.enumToArray=t.isNumber=t.isSimpleType=t.valuePreview=t.toString=void 0;const o=n(36783);t.toString=e=>{if("object"===typeof e){if(e instanceof Error)return JSON.stringify((0,o.serializeError)(e));try{return JSON.stringify(e).substr(0,250)}catch(t){return"Object (cannot stringify)"}}return`${e}`.substr(0,250)};t.valuePreview=e=>(0,t.toString)(e).substr(0,100);t.isSimpleType=e=>["number","string","boolean"].includes(typeof e);t.isNumber=e=>!1===isNaN(Number(e)),t.enumToArray=function(e){return Object.keys(e).filter(t.isNumber).map((t=>e[t]))},function(e){e.RUNTIME_READY="runtime-ready",e.CHANGE_EVENT_NAME="change",e.PUSH_INPUT_VALUE="push-input-value",e.CHANGE_AWK="live-change-awk",e.CHANGE_ERROR="live-change-error",e.IS_ALIVE="is-alive",e.UPDATE_BREAKPOINTS="update-breakpoints",e.INPUT_VALUE_OVERRIDE="input-value-override",e.OUTPUT_VALUE_OVERRIDE="output-value-override",e.INPUT_VALUE_CHANGE="input-value-changed",e.OUTPUT_VALUE_CHANGE="output-value-changed",e.PROCESSING_CHANGE="processing-changed",e.INPUTS_STATE_CHANGE="inputs-state-changed",e.NODE_ERROR="node-error",e.EVENTS_BATCH="events-batch"}(t.DebuggerServerEventType||(t.DebuggerServerEventType={}))},96233:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31758),t),i(n(42403),t),i(n(39641),t)},43920:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Equals=t.EqualsBoolean=t.Throttle=t.ThrottleError=t.Debounce=t.Interval=t.Delay=t.Switch4=t.Switch2=t.Switch3=t.EmitOnTrigger=t.BooleanSplit=t.Subscribe=t.Publish=t.RoundRobin4=t.RoundRobin2=t.RoundRobin3=t.LimitTimes=void 0;const o=n(11253),i="Control Flow";t.LimitTimes={id:"Limit Times",namespace:i,description:"Item will be emitted until the limit is reached",inputs:{item:{mode:"required",description:"The item to emit"},times:{mode:"required",description:"The number of times to emit the item"},reset:{mode:"optional",description:"Reset the counter"}},outputs:{ok:{}},reactiveInputs:["item","reset"],completionOutputs:[],run:function(e,t,n){const{state:o}=n,{item:i,times:s,reset:r}=e,{ok:a}=t;if(void 0!==r)return void o.set("val",0);let u=o.get("val")||0;u++,o.set("val",u),u>=s?n.onError(new Error(`Limit of ${s} reached`)):a.next(i)}},t.RoundRobin3={id:"Round Robin 3",namespace:i,description:"Item will be emitted to one of the three outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r}=t,a=o.get("curr")||0,u=(a+1)%3;[i,s,r][a].next(e.item),o.set("curr",u)}},t.RoundRobin2={namespace:i,id:"Round Robin 2",description:"Item will be emitted to one of the 2 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s}=t,r=o.get("curr")||0,a=(r+1)%2;[i,s][r].next(e.item),o.set("curr",a)}},t.RoundRobin4={id:"Round Robin 4",namespace:i,description:"Item will be emitted to one of the 4 outputs in a round robin fashion",inputs:{value:{mode:"required",description:"The value to emit"}},outputs:{r1:{description:'The first output in order to emit the value received. After emitting a value, it moves to "r2"\'s turn.'},r2:{description:'The second output in order to emit the value received. After emitting a value, it moves to "r3"\'s turn.'},r3:{description:'The third output in order to emit the value received. After emitting a value, it moves to "r4"\'s turn.'},r4:{description:'The fourth output in order to emit the value received. After emitting a value, it moves back to "r1"\'s turn.'}},completionOutputs:[],reactiveInputs:["value"],run:function(e,t,n){const{state:o}=n,{r1:i,r2:s,r3:r,r4:a}=t,u=o.get("curr")||0,l=(u+1)%4;[i,s,r,a][u].next(e.item),o.set("curr",l)}},t.Publish={id:"Publish",namespace:i,description:"Publishes a value by a key to all listeners in the current flow. Use 'Subscribe' to listen to events.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},value:{mode:"required"}},outputs:{},run:function(e,t,n){const i=`${n.ancestorsInsIds}__${e.key}`;o.publish(i,e.value)}},t.Subscribe={id:"Subscribe",namespace:i,description:"Subscribes to a value published by a key. Use 'Publish' to publish values.",inputs:{key:{mode:"required",description:"A key to use to subscribe to values"},initial:{mode:"required-if-connected",description:"If passed will be published has the first value"}},completionOutputs:[],outputs:{value:{description:"The value published by the key"}},run:function(e,t,n){const{value:i}=t,s=`${n.ancestorsInsIds}__${e.key}`,r=o.subscribe(s,((e,t)=>{i.next(t)}));void 0!==e.initial&&i.next(e.initial),n.onCleanup((()=>{o.unsubscribe(r)}))}},t.BooleanSplit={namespace:i,id:"Boolean Split",description:"Splits a boolean value into two outputs",inputs:{value:{mode:"required",description:"Boolean value"},trueValue:{mode:"required-if-connected",description:"Value to emit if the input is true. Defaults to true"},falseValue:{mode:"required-if-connected",description:"Value to emit if the input is false. Defaults to false"}},outputs:{true:{description:"The value is true"},false:{description:"The value is false"}},run:function(e,t){const{true:n,false:o}=t,{value:i,trueValue:s,falseValue:r}=e;i?n.next(null==s||s):o.next(null!=r&&r)}},t.EmitOnTrigger={namespace:i,id:"Emit on Trigger",description:"Emits the value when the trigger input receives any value",inputs:{value:{mode:"required",description:"The value to emit"},trigger:{mode:"required",description:"The trigger to emit the value"}},outputs:{result:{description:"The value emitted"}},run:function(e,t){const{result:n}=t,{value:o,trigger:i}=e;void 0!==i&&n.next(o)}},t.Switch3={namespace:i,id:"Switch 3",description:"Switches between 3 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,default:s,outputValue:r}=t,{value:a,firstCase:u,secondCase:l,thirdCase:c}=e;a===u?n.next(null!=r?r:a):a===l?o.next(null!=r?r:a):a===c?i.next(null!=r?r:a):s.next(null!=r?r:a)}},t.Switch2={id:"Switch 2",description:"Switches between 2 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,default:i,outputValue:s}=t,{value:r,firstCase:a,secondCase:u}=e;r===a?n.next(null!=s?s:r):r===u?o.next(null!=s?s:r):i.next(null!=s?s:r)}},t.Switch4={id:"Switch 4",description:"Switches between 4 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.",namespace:i,inputs:{value:{mode:"required",description:"The value to switch on"},firstCase:{mode:"required",description:"The value to switch on for the first output"},secondCase:{mode:"required",description:"The value to switch on for the second output"},thirdCase:{mode:"required",description:"The value to switch on for the third output"},fourthCase:{mode:"required",description:"The value to switch on for the fourth output"},outputValue:{mode:"required-if-connected",description:"The value to emit on the output. Defaults to 'value'"}},outputs:{first:{description:"The value emitted if the input value is equal to the first case"},second:{description:"The value emitted if the input value is equal to the second case"},third:{description:"The value emitted if the input value is equal to the third case"},fourth:{description:"The value emitted if the input value is equal to the fourth case"},default:{description:"The value emitted if the input value is not equal to any of the cases"}},run:function(e,t){const{first:n,second:o,third:i,fourth:s,default:r,outputValue:a}=t,{value:u,firstCase:l,secondCase:c,thirdCase:d,fourthCase:p}=e;u===l?n.next(null!=a?a:u):u===c?o.next(null!=a?a:u):u===d?i.next(null!=a?a:u):u===p?s.next(null!=a?a:u):r.next(null!=a?a:u)}},t.Delay={id:"Delay",defaultStyle:{icon:"fa-clock"},searchKeywords:["timeout","wait","setTimeout"],namespace:i,description:"Delays a value",inputs:{value:{description:"Value to delay"},delay:{description:"Delay in milliseconds"}},outputs:{delayedValue:{description:"Delayed value"}},run:async(e,t)=>{let{value:n,delay:o}=e,{delayedValue:i}=t;await new Promise((e=>setTimeout(e,o))),i.next(n)}},t.Interval={id:"Interval",namespace:i,defaultStyle:{icon:"fa-clock"},description:"Emits a value every interval",inputs:{value:{description:"Value to emit"},interval:{description:"Interval in milliseconds"}},reactiveInputs:["value","interval"],outputs:{value:{description:"Emitted value"}},completionOutputs:[],run:(e,t,n)=>{n.state.get("timer")&&clearInterval(n.state.get("timer"));const o=setInterval((()=>{t.value.next(e.value)}),e.interval);n.state.set("timer",o),n.onCleanup((()=>{clearInterval(o)}))}},t.Debounce={id:"Debounce",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be debounced"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The debounced value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the last value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:s}=t,r=n.state.get("timer");r&&clearTimeout(r);const a=setTimeout((()=>{s.next(o)}),i);n.state.set("timer",a),n.onCleanup((()=>{clearTimeout(r)}))}};class s extends Error{constructor(e){super("Throttle: Value dropped"),this.value=e}}t.ThrottleError=s,t.Throttle={id:"Throttle",namespace:i,inputs:{value:{mode:"required",description:"The data that needs to be throttled"},wait:{mode:"required",defaultValue:250,description:"Time (in millis) to wait until 'value' is emitted"}},outputs:{result:{description:"The throttled value"}},completionOutputs:["result"],reactiveInputs:["value"],description:'Emits the first value received after being idle for "wait" amount of milliseconds',run:function(e,t,n){const{value:o,wait:i}=e,{result:r}=t;if(n.state.get("timer"))n.onError(new s(o));else{r.next(o);const e=setTimeout((()=>{n.state.set("timer",null)}),i);n.state.set("timer",e)}}},t.EqualsBoolean={id:"Equals (Bool)",defaultStyle:{icon:"fa-equals"},namespace:i,description:"Emits true if two values are equal (=== equality). Otherwise emits false.",inputs:{a:{description:"First value"},b:{description:"Second value"}},outputs:{result:{description:"true if a is equal to b"}},run:(e,t)=>{let{a:n,b:o}=e,{result:i}=t;return i.next(n===o)}},t.Equals={id:"Equals",namespace:i,description:'Emits the value of "a" to output "true" if "a" is equal to "b". Otherwise emits the value of "a" to output "false".',inputs:{a:{mode:"required",description:"First value"},b:{mode:"required",description:"Second value"}},outputs:{true:{description:"Emits the value of a if a is equal to b"},false:{description:"Emits the value of a if a is not equal to b"}},run:(e,t)=>{const{a:n,b:o}=e,{true:i,false:s}=t;n===o?i.next(n):s.next(n)}}},45888:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SumList=t.LessThanOrEqual=t.LessThan=t.GreaterThanOrEqual=t.GreaterThan=t.ToPrecision=t.ToExponential=t.ToFixed=t.ParseFloat=t.ParseInt=t.Max=t.Min=t.Cos=t.Sin=t.Truncate=t.Round=t.Ceiling=t.Floor=t.AbsoluteValue=t.SquareRoot=t.Power=t.Modulo=t.Divide=t.Multiply=t.Subtract=t.Add=void 0;const n="Numbers";t.Add={id:"Add",defaultStyle:{icon:"fa-plus"},namespace:n,description:"Emits the sum of two numbers",inputs:{n1:{description:"First number to add"},n2:{description:"Second number to add"}},outputs:{sum:{description:"The sum of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{sum:i}=t;return i.next(n+o)}},t.Subtract={id:"Subtract",defaultStyle:{icon:"fa-minus"},namespace:n,description:"Emits the difference of two numbers",inputs:{n1:{description:"First number to subtract"},n2:{description:"Second number to subtract"}},outputs:{difference:{description:"The difference of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{difference:i}=t;return i.next(n-o)}},t.Multiply={id:"Multiply",defaultStyle:{icon:"fa-times"},namespace:n,description:"Emits the product of two numbers",inputs:{n1:{description:"First number to multiply"},n2:{description:"Second number to multiply"}},outputs:{product:{description:"The product of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{product:i}=t;return i.next(n*o)}},t.Divide={id:"Divide",defaultStyle:{icon:"fa-divide"},namespace:n,description:"Emits the quotient of two numbers",inputs:{n1:{description:"First number to divide"},n2:{description:"Second number to divide"}},outputs:{quotient:{description:"The quotient of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{quotient:i}=t;return i.next(n/o)}},t.Modulo={id:"Modulo",defaultStyle:{icon:"fa-percentage"},namespace:n,description:"Emits the remainder of two numbers",inputs:{n1:{description:"First number to divide"},n2:{description:"Second number to divide"}},outputs:{remainder:{description:"The remainder of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{remainder:i}=t;return i.next(n%o)}},t.Power={id:"Power",defaultStyle:{icon:"fa-superscript"},namespace:n,description:"Emits the power of two numbers",inputs:{n1:{description:"Base number"},n2:{description:"Exponent"}},outputs:{power:{description:"The power of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{power:i}=t;return i.next(Math.pow(n,o))}},t.SquareRoot={id:"Square Root",defaultStyle:{icon:"fa-square-root-alt"},namespace:n,description:"Emits the square root of a number",inputs:{n:{description:"Number to take the square root of"}},outputs:{root:{description:"The square root of n"}},run:(e,t)=>{let{n:n}=e,{root:o}=t;return o.next(Math.sqrt(n))}},t.AbsoluteValue={id:"Absolute Value",defaultStyle:{icon:"fa-abs"},namespace:n,description:"Emits the absolute value of a number",inputs:{n:{description:"Number to take the absolute value of"}},outputs:{absolute:{description:"The absolute value of n"}},run:(e,t)=>{let{n:n}=e,{absolute:o}=t;return o.next(Math.abs(n))}},t.Floor={id:"Floor",defaultStyle:{icon:"fa-floor"},namespace:n,description:"Emits the floor of a number",inputs:{n:{description:"Number to take the floor of"}},outputs:{floor:{description:"The floor of n"}},run:(e,t)=>{let{n:n}=e,{floor:o}=t;return o.next(Math.floor(n))}},t.Ceiling={id:"Ceiling",defaultStyle:{icon:"fa-ceiling"},namespace:n,description:"Emits the ceiling of a number",inputs:{n:{description:"Number to take the ceiling of"}},outputs:{ceiling:{description:"The ceiling of n"}},run:(e,t)=>{let{n:n}=e,{ceiling:o}=t;return o.next(Math.ceil(n))}},t.Round={id:"Round",defaultStyle:{icon:"fa-round"},namespace:n,description:"Emits the rounded value of a number",inputs:{n:{description:"Number to round"}},outputs:{rounded:{description:"The rounded value of n"}},run:(e,t)=>{let{n:n}=e,{rounded:o}=t;return o.next(Math.round(n))}},t.Truncate={id:"Truncate",defaultStyle:{icon:"fa-truncate"},namespace:n,description:"Emits the truncated value of a number",inputs:{n:{description:"Number to truncate"}},outputs:{truncated:{description:"The truncated value of n"}},run:(e,t)=>{let{n:n}=e,{truncated:o}=t;return o.next(Math.trunc(n))}},t.Sin={id:"Sin",defaultStyle:{icon:"fa-sin"},namespace:n,description:"Emits the sine of an angle",inputs:{angle:{description:"Angle in radians"}},outputs:{sine:{description:"The sine of angle"}},run:(e,t)=>{let{angle:n}=e,{sine:o}=t;return o.next(Math.sin(n))}},t.Cos={id:"Cos",defaultStyle:{icon:"fa-cos"},namespace:n,description:"Emits the cosine of an angle",inputs:{angle:{description:"Angle in radians"}},outputs:{cosine:{description:"The cosine of angle"}},run:(e,t)=>{let{angle:n}=e,{cosine:o}=t;return o.next(Math.cos(n))}},t.Min={id:"Min",namespace:n,description:"Emits the minimum of two numbers",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{min:{description:"The minimum of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{min:i}=t;return i.next(Math.min(n,o))}},t.Max={id:"Max",namespace:n,description:"Emits the maximum of two numbers",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{max:{description:"The maximum of n1 and n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{max:i}=t;return i.next(Math.max(n,o))}},t.ParseInt={id:"Parse Int",namespace:n,description:"Emits the integer value of a string",inputs:{str:{description:"String to parse"}},outputs:{int:{description:"The integer value of str"}},run:(e,t)=>{let{str:n}=e,{int:o}=t;return o.next(parseInt(n))}},t.ParseFloat={id:"Parse Float",namespace:n,description:"Emits the float value of a string",inputs:{str:{description:"String to parse"}},outputs:{float:{description:"The float value of str"}},run:(e,t)=>{let{str:n}=e,{float:o}=t;return o.next(parseFloat(n))}},t.ToFixed={id:"To Fixed",namespace:n,description:"Emits the specified number of decimal places of a number",inputs:{number:{description:"Number to format"},places:{description:"Number of decimal places to format to"}},outputs:{fixed:{description:"The number with the specified number of decimal places"}},run:(e,t)=>{let{number:n,places:o}=e,{fixed:i}=t;return i.next(n.toFixed(o))}},t.ToExponential={id:"To Exponential",namespace:n,description:"Emits the specified number of decimal places of a number in exponential notation",inputs:{number:{description:"Number to format"},places:{description:"Number of decimal places to format to"}},outputs:{exponential:{description:"The number with the specified number of decimal places in exponential notation"}},run:(e,t)=>{let{number:n,places:o}=e,{exponential:i}=t;return i.next(n.toExponential(o))}},t.ToPrecision={id:"To Precision",namespace:n,description:"Emits the specified number of significant figures of a number",inputs:{number:{description:"Number to format"},places:{description:"Number of significant figures to format to"}},outputs:{precision:{description:"The number with the specified number of significant figures"}},run:(e,t)=>{let{number:n,places:o}=e,{precision:i}=t;return i.next(n.toPrecision(o))}},t.GreaterThan={id:"Greater Than",namespace:n,description:"Emits true if the first number is greater than the second",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{result:{description:"true if n1 is greater than n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{result:i}=t;return i.next(n>o)}},t.GreaterThanOrEqual={id:"Greater Than Or Equal",namespace:n,description:"Emits true if the first number is greater than or equal to the second",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{result:{description:"true if n1 is greater than or equal to n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{result:i}=t;return i.next(n>=o)}},t.LessThan={id:"Less Than",namespace:n,description:"Emits true if the first number is less than the second",inputs:{n1:{description:"First number"},n2:{description:"Second number"}},outputs:{result:{description:"true if n1 is less than n2"}},run:(e,t)=>{let{n1:n,n2:o}=e,{result:i}=t;return i.next(n{let{n1:n,n2:o}=e,{result:i}=t;return i.next(n<=o)}},t.SumList={id:"Sum List",defaultStyle:{icon:"fa-plus"},namespace:n,description:"Emits the sum of a list of numbers",inputs:{list:{description:"List of numbers"}},outputs:{sum:{description:"The sum of the numbers in list"}},run:(e,t)=>{let{list:n}=e,{sum:o}=t;return o.next(n.reduce(((e,t)=>e+t),0))}}},65645:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var o=n(70079),i=n(11253),s=n(74089),r=n(74762),a=n(21766);var u=n(10831),l=n(61997),c=n(77852);const d=(0,a.S)(),p=[0,20],f=e=>{let{flow:t,output:n,inputs:o,onError:s,debugDelay:a,onCompleted:u,dependencies:l,player:c}=e;const p=((e,t)=>{const n=new Set;return{onEvent:o=>{const i={...o,time:Date.now(),executionId:"n/a"};console.info("Got debugger event",o),t.addEvents([i]),e.addEvents([i]),n.forEach((e=>e([i])))},onBatchedEvents:e=>(n.add(e),()=>n.delete(e))}})(c,d);p.debugDelay=a;const f=(0,r.keys)(t.node.outputs)[0];return{executeResult:(0,r.execute)({node:t.node,inputs:o,outputs:{[f]:n},resolvedDeps:{...l,[t.node.id]:t.node},_debugger:p,onCompleted:u,onBubbleError:e=>{s(e)},extraContext:{PubSub:i}}),localDebugger:p}},m=e=>{const{debugDelay:t,onOutput:i,flowProps:a}=e,{flow:m,inputs:h,output:v}=a,g=(0,o.useRef)((0,s.createRuntimePlayer)()),[I,b]=(0,o.useState)(e.flowProps.dependencies),[y,C]=(0,o.useState)(),[_]=(0,s.useDebounce)(I,500),x=(0,c.useDarkMode)(),N=async(e,t)=>{const{node:o}=e,i=Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).find((e=>(0,r.isBaseNode)(e)&&e.id===o.id));let a;b((e=>({...e,[i.id]:{...i,source:{path:"@flyde/stdlib/dist/all-browser",export:i.id}}})));const l=(0,u.ZP)(m,(n=>{if(t){const o=(0,s.vAdd)({x:0,y:0},t.pos);if(a=(0,s.createNewNodeInstance)(e.node,0,o,I),n.node.instances.push(a),t.connectTo){const{insId:e,outputId:o}=t.connectTo;n.node.connections.push({from:{insId:e,pinId:o},to:{insId:a.id,pinId:r.TRIGGER_PIN_ID}})}}}));await new Promise((e=>setTimeout(e,10)));const c=(0,u.ZP)(j,(e=>{e.flow=l,t?.selectAfterAdding&&a&&(e.boardData.selected=[a?.id])}));return E(c),(0,s.toastMsg)(`Node ${o.id} successfully imported from ${e.module}`),I},w=async()=>({importables:Object.values(await n.e(1381).then(n.t.bind(n,81381,23))).filter(r.isBaseNode).map((e=>({node:{...e,source:{path:"n/a",export:"n/a"}},module:"@flyde/stdlib"}))),errors:[]}),[j,E]=(0,o.useState)({flow:m,boardData:{viewPort:{pos:{x:0,y:0},zoom:1},lastMousePos:{x:0,y:0},selected:[]}});(0,o.useEffect)((()=>{E((e=>({...e,flow:m})))}),[m]),(0,o.useEffect)((()=>{b((e=>({...e,main:j.flow.node})))}),[j.flow.node]);const P={state:j,onChangeEditorState:E,hideTemplatingTips:!0,initialPadding:p,onExtractInlineNode:r.noop,disableScrolling:!0,darkMode:x.isDarkMode};(0,o.useEffect)((()=>{g.current.start()}),[]),(0,o.useEffect)((()=>{const{executeResult:n,localDebugger:o}=f({flow:j.flow,dependencies:I,output:v,inputs:h,onError:r.noop,debugDelay:t,player:g.current,onCompleted:e.onCompleted}),s=e.flowProps.output.subscribe((e=>i(e)));return C(o),()=>{n(),s.unsubscribe()}}),[t,_]);const O=(0,o.useMemo)((()=>({resolvedDependencies:I,onImportNode:N,onRequestImportables:w})),[]),S=(0,o.useMemo)((()=>({debuggerClient:y,onRequestHistory:d.requestHistory})),[y]);return o.createElement(l.Z,null,(()=>o.createElement(s.DependenciesContextProvider,{value:O},o.createElement(s.DebuggerContextProvider,{value:S},o.createElement(s.FlowEditor,P)))))}},21766:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var o=n(74762);const i=200,s=()=>{const e=new Map,t=new Map;return{requestHistory:async(n,s,r)=>{const a="input"===r?o.DebuggerEventType.INPUT_CHANGE:o.DebuggerEventType.OUTPUT_CHANGE;if(console.log({insId:n,pinId:s,type:a}),s){const t=`${n}.${s}.${a}`,o=e.get(t)||{total:0,lastSamples:[]},r=o.lastSamples.slice(0,i);return{...o,lastSamples:r}}{const e=t.get(n)||{total:0,lastSamples:[]},o=e.lastSamples.slice(0,i);return{...e,lastSamples:o}}},addEvents:n=>{n.forEach((n=>{if(n.type===o.DebuggerEventType.ERROR){const e=n;e.type=o.DebuggerEventType.OUTPUT_CHANGE,e.pinId=o.ERROR_PIN_ID}if(n.type===o.DebuggerEventType.INPUT_CHANGE||n.type===o.DebuggerEventType.OUTPUT_CHANGE){const{insId:o,type:s,pinId:r}=n;{const t=`${o}.${r}.${s}`,a=e.get(t)||{total:0,lastSamples:[]};a.lastSamples.unshift(n),a.lastSamples.length>i&&a.lastSamples.splice(i,a.lastSamples.length-i),a.total++,e.set(t,a)}{const s=t.get(o)||{total:0,lastSamples:[]};s.lastSamples.unshift(n),s.lastSamples.length>i&&s.lastSamples.splice(i,s.lastSamples.length-i),s.total++,e.set(o,s)}}}))}}}},4144:(e,t,n)=>{"use strict";n.d(t,{V:()=>r});var o=n(10328),i=n(70079);const s=e=>i.createElement("li",{className:"log-item"},i.createElement("main",{className:"content"},e.value),i.createElement("aside",null,new Date(e.time).toLocaleTimeString())),r=e=>{const[t,n]=i.useState([]);return i.useEffect((()=>{e.output.subscribe((e=>{const t="object"==typeof e&&i.isValidElement(e)?e:`${e}`;n((e=>[...e,{value:t,time:Date.now()}]))}))}),[]),i.createElement("div",{className:"output-log"},i.createElement("header",null,"Output Log"," ",i.createElement("button",{className:"clear-btn button button--outline button--secondary button--sm",onClick:()=>n([])},"Clear")),i.createElement("main",null,i.createElement("ul",null,t.map(((e,t)=>i.createElement(s,(0,o.Z)({},e,{key:t}))))),0===t.length?i.createElement("div",{className:"empty-state"},"Nothing to show. Interact with the example to emit some outputs!"):null))}},79256:(e,t,n)=>{"use strict";n.d(t,{I:()=>p});var o=n(70079),i=n(65092),s=n(19841),r=n(49794),a=n(21766),u=n(73949),l=n(81098),c=n(65645);(0,a.S)();const d=[{title:"Hello World",key:"hello-world"},{title:"React Counter",key:"react-counter"},{title:"BMI Calculator",key:"bmi"},{title:"REST API Usage",key:"apis"},{title:"Debounce vs. Throttling",key:"debounce-throttling"},{title:"Fibonacci Seq.",key:"fibonacci"}],p=e=>{const[t,n]=(0,o.useState)(e.initWidth||500),[a,p]=(0,o.useState)(e.defaultDelay||0),[f,m]=(0,o.useState)(!1),h=(0,o.useCallback)(((e,t)=>{let{size:o}=t;n(o.width)}),[]),v=o.createElement("div",{className:"delay-container"},o.createElement("input",{type:"range",id:"volume",name:"delay",value:a,step:"100",min:"0",max:"300",onChange:e=>p(Number(e.target.value))}),o.createElement("label",{htmlFor:"volume"},"Debug Delay: ",a,"ms")),g=d.findIndex((t=>t.key===e.meta.key)),I=d[g+1],b=d[g-1];return o.createElement(i.Z,{title:`${e.meta.title} | Playground`,description:`Flyde Playground - ${e.meta.title} example`},o.createElement("header",{className:(0,s.default)("hero hero--primary",u.Z.heroBanner,"playground-hero")},o.createElement("div",{className:"container"},o.createElement("h1",{className:"hero__title"},"Welcome to Flyde's Online Playground"),o.createElement("p",{className:"hero__subtitle"},"Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!"))),o.createElement("div",{className:"mobile-warning"},"Flyde is currently not optimized for mobile devices. Please"," ",o.createElement("strong",null,"use a desktop computer for the best experience"),"."),o.createElement("ul",{className:"examples__menu"},d.map((e=>o.createElement("li",{key:e.key},o.createElement(r.Z,{to:`/playground/${e.key}`,className:"button button--primary"},e.title))))),o.createElement("div",{className:"playground-container"},o.createElement("header",null,o.createElement("h2",{className:"playground-title"},e.meta.title),o.createElement("div",{className:"playground-description"},e.meta.description),f?o.createElement(o.Fragment,null,o.createElement("hr",null),o.createElement("div",{className:"playground-extra"},e.extraInfo||e.meta.extraInfo,o.createElement("div",{className:"star-hint"},o.createElement("span",null,"\xa0 PS: Did you like this example?"),"Please consider giving a \u2b50\ufe0f to the project"," ",o.createElement("span",{className:"star-wrapper"},o.createElement("iframe",{className:"gh-stars-frame",src:"https://ghbtns.com/github-btn.html?user=flydelabs&repo=flyde&type=star&count=true&size=small",width:100,height:20,title:"GitHub Stars"}))))):null,e.prefixComponent),o.createElement("div",{className:"playground"},o.createElement("div",{className:"flow-container"},!0!==e.hideDelay?v:null,o.createElement(c.Y,{flowProps:e.flowProps,debugDelay:a,onOutput:()=>m(!0)})),o.createElement(l.Resizable,{height:0,width:t,onResize:h,handle:o.createElement("div",{className:"handle"}),axis:"x",resizeHandles:["w"]},o.createElement("div",{className:"output-container",style:{flexBasis:t}},e.children))),o.createElement("nav",{className:"pagination-nav"},o.createElement("div",{className:"pagination-nav__item"},b?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${b.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Previous Example"),o.createElement("div",{className:"pagination-nav__label"},b.title)):null),o.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},I?o.createElement("a",{className:"pagination-nav__link",href:`/playground/${I.key}`},o.createElement("div",{className:"pagination-nav__sublabel"},"Next Example"),o.createElement("div",{className:"pagination-nav__label"},I.title)):null))))}},29863:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var o=n(70079),i=n(74762),s=n(79256);const r={dependencies:{Equals:{id:"Equals",namespace:"Control Flow",description:'Emits the value of "a" to output "true" if "a" is equal to "b". Otherwise emits the value of "a" to output "false".',inputs:{a:{mode:"required",description:"First value"},b:{mode:"required",description:"Second value"}},outputs:{true:{description:"Emits the value of a if a is equal to b"},false:{description:"Emits the value of a if a is not equal to b"}},run:n(43920).Equals.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/ControlFlow.flyde.js",export:"Equals"}},Add:{id:"Add",defaultStyle:{icon:"fa-plus"},namespace:"Numbers",description:"Emits the sum of two numbers",inputs:{n1:{description:"First number to add"},n2:{description:"Second number to add"}},outputs:{sum:{description:"The sum of n1 and n2"}},run:n(45888).Add.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Numbers.flyde.js",export:"Add"}},Subtract:{id:"Subtract",defaultStyle:{icon:"fa-minus"},namespace:"Numbers",description:"Emits the difference of two numbers",inputs:{n1:{description:"First number to subtract"},n2:{description:"Second number to subtract"}},outputs:{difference:{description:"The difference of n1 and n2"}},run:n(45888).Subtract.run,source:{path:"/Users/gabrielgrinberg/projects/flyde/stdlib/dist/Numbers.flyde.js",export:"Subtract"}}},flow:{imports:{"@flyde/stdlib":["Equals","Subtract","Add"]},node:{instances:[{pos:{x:-104.50461669921879,y:-75.81374603271485},id:"Equals-364",inputConfig:{compare:{mode:"static",value:0},b:{mode:"static",value:0}},visibleInputs:["a","b"],nodeId:"Equals",style:{size:"small"}},{pos:{x:6.480124511718742,y:26.28670257568359},id:"Equals-364-d95",inputConfig:{compare:{mode:"static",value:1},b:{mode:"static",value:1}},visibleInputs:["a","b"],nodeId:"Equals",style:{size:"small"}},{pos:{x:124.14777221679688,y:360.9365419006348},id:"Add-539",inputConfig:{},nodeId:"Add",style:{size:"small",icon:"calculator",color:"#fee440"}},{pos:{x:51.170103759765624,y:141.94213226318357},id:"Subtract-210",inputConfig:{n2:{mode:"static",value:1}},visibleInputs:["n1"],nodeId:"Subtract",style:{size:"small",icon:"calculator",color:"#f15bb5"}},{pos:{x:205.81573364257815,y:141.28181961059568},id:"Subtract-210-d215",inputConfig:{n2:{mode:"static",value:2}},visibleInputs:["n1"],nodeId:"Subtract",style:{size:"small",icon:"calculator",color:"#f15bb5"}},{pos:{x:41.46757568359375,y:225.79922363281253},id:"Fibonacci-261",inputConfig:{},nodeId:"Fibonacci"},{pos:{x:192.5062255859375,y:225.06153114318846},id:"Fibonacci-379",inputConfig:{},nodeId:"Fibonacci"}],connections:[{from:{insId:"Fibonacci-261",pinId:"result"},to:{insId:"Add-539",pinId:"n1"}},{from:{insId:"Fibonacci-379",pinId:"result"},to:{insId:"Add-539",pinId:"n2"}},{from:{insId:"Add-539",pinId:"sum"},to:{insId:"__this",pinId:"result"}},{from:{insId:"Subtract-210",pinId:"difference"},to:{insId:"Fibonacci-261",pinId:"n"}},{from:{insId:"Subtract-210-d215",pinId:"difference"},to:{insId:"Fibonacci-379",pinId:"n"}},{from:{insId:"__this",pinId:"n"},to:{insId:"Equals-364",pinId:"a"}},{from:{insId:"Equals-364",pinId:"false"},to:{insId:"Equals-364-d95",pinId:"a"}},{from:{insId:"Equals-364",pinId:"true"},to:{insId:"__this",pinId:"result"}},{from:{insId:"Equals-364-d95",pinId:"true"},to:{insId:"__this",pinId:"result"}},{from:{insId:"Equals-364-d95",pinId:"false"},to:{insId:"Subtract-210",pinId:"n1"}},{from:{insId:"Equals-364-d95",pinId:"false"},to:{insId:"Subtract-210-d215",pinId:"n1"}}],id:"Fibonacci",inputs:{n:{mode:"required",type:"any"}},outputs:{result:{type:"any",optional:!1,delayed:!1}},inputsPosition:{n:{x:-104.99845545326623,y:-160.94874894405714}},outputsPosition:{result:{x:-27.155817068877212,y:518.2526309988291}},completionOutputs:["result"],defaultStyle:{size:"large",color:"#00bbf9"}}}};var a=n(4144);const u={title:"Fibonacci Sequence",description:'This example showcases a classical recursion - the Fibonacci sequence. On numbers higher than 1, the "Fibonacci" node calls itself recursively!',key:"fibonacci",extraInfo:"Cool right? everything is editable, so try changing the algorithm and see how it affects the end result!"},l=e=>{const t=(0,i.dynamicOutput)();return t.subscribe(e),t};function c(){const[e,t]=(0,o.useState)(4),[n,c]=(0,o.useState)(5),d=(0,o.useRef)(l((e=>c(e)))),p=(0,o.useRef)({n:(0,i.dynamicNodeInput)()}),[f,m]=(0,o.useState)({flow:r.flow,dependencies:r.dependencies,inputs:p.current,output:d.current}),h=(0,o.useCallback)((e=>()=>{-1===e&&(e=Number(prompt("N?")),isNaN(e)||e<0)?alert("Invalid input. Please try again using a positive integer"):(e<=8||confirm("This is an unoptimized Fib. calculator and larger numbers might take a long time to calculate. Are you sure?"))&&p.current.n.subject.next(e)}),[e]),v=o.createElement("div",null,o.createElement("button",{className:"fib-btn button button--outline button--primary button-sm",onClick:h(0)},"Calc Fib(0)"),o.createElement("button",{className:"fib-btn button button--outline button--primary button-sm",onClick:h(1)},"Calc Fib(1)"),o.createElement("button",{className:"fib-btn button button--outline button--primary button-sm",onClick:h(3)},"Calc Fib(3)"),o.createElement("button",{className:"fib-btn button button--outline button--primary button-sm",onClick:h(5)},"Calc Fib(5)"),o.createElement("button",{className:"fib-btn button button--outline button--primary button-sm",onClick:h(-1)},"Calc Fib(N)"));return o.createElement(s.I,{meta:u,flowProps:f,defaultDelay:100,prefixComponent:v},o.createElement(a.V,{output:d.current}))}},73949:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={"flyde-flow-editor":"flyde-flow-editor_AAD4",_hj_feedback_container:"_hj_feedback_container_Af03"}},85721:(e,t,n)=>{var o={"./af":47654,"./af.js":47654,"./ar":61325,"./ar-dz":98344,"./ar-dz.js":98344,"./ar-kw":26230,"./ar-kw.js":26230,"./ar-ly":42524,"./ar-ly.js":42524,"./ar-ma":44119,"./ar-ma.js":44119,"./ar-sa":82625,"./ar-sa.js":82625,"./ar-tn":42182,"./ar-tn.js":42182,"./ar.js":61325,"./az":37093,"./az.js":37093,"./be":32721,"./be.js":32721,"./bg":59919,"./bg.js":59919,"./bm":95594,"./bm.js":95594,"./bn":563,"./bn-bd":41757,"./bn-bd.js":41757,"./bn.js":563,"./bo":73211,"./bo.js":73211,"./br":87438,"./br.js":87438,"./bs":83662,"./bs.js":83662,"./ca":61196,"./ca.js":61196,"./cs":5841,"./cs.js":5841,"./cv":85251,"./cv.js":85251,"./cy":24512,"./cy.js":24512,"./da":37539,"./da.js":37539,"./de":5059,"./de-at":53853,"./de-at.js":53853,"./de-ch":99378,"./de-ch.js":99378,"./de.js":5059,"./dv":91454,"./dv.js":91454,"./el":39651,"./el.js":39651,"./en-au":87953,"./en-au.js":87953,"./en-ca":98193,"./en-ca.js":98193,"./en-gb":61980,"./en-gb.js":61980,"./en-ie":14050,"./en-ie.js":14050,"./en-il":6502,"./en-il.js":6502,"./en-in":555,"./en-in.js":555,"./en-nz":11372,"./en-nz.js":11372,"./en-sg":26568,"./en-sg.js":26568,"./eo":69533,"./eo.js":69533,"./es":68327,"./es-do":17620,"./es-do.js":17620,"./es-mx":96467,"./es-mx.js":96467,"./es-us":83272,"./es-us.js":83272,"./es.js":68327,"./et":68523,"./et.js":68523,"./eu":19066,"./eu.js":19066,"./fa":59087,"./fa.js":59087,"./fi":96443,"./fi.js":96443,"./fil":93979,"./fil.js":93979,"./fo":90383,"./fo.js":90383,"./fr":56327,"./fr-ca":25610,"./fr-ca.js":25610,"./fr-ch":97274,"./fr-ch.js":97274,"./fr.js":56327,"./fy":67442,"./fy.js":67442,"./ga":44291,"./ga.js":44291,"./gd":77342,"./gd.js":77342,"./gl":96248,"./gl.js":96248,"./gom-deva":21404,"./gom-deva.js":21404,"./gom-latn":20833,"./gom-latn.js":20833,"./gu":9122,"./gu.js":9122,"./he":74623,"./he.js":74623,"./hi":60364,"./hi.js":60364,"./hr":30860,"./hr.js":30860,"./hu":70441,"./hu.js":70441,"./hy-am":90425,"./hy-am.js":90425,"./id":29672,"./id.js":29672,"./is":96150,"./is.js":96150,"./it":27852,"./it-ch":55603,"./it-ch.js":55603,"./it.js":27852,"./ja":16465,"./ja.js":16465,"./jv":20120,"./jv.js":20120,"./ka":87245,"./ka.js":87245,"./kk":21479,"./kk.js":21479,"./km":65038,"./km.js":65038,"./kn":63060,"./kn.js":63060,"./ko":85020,"./ko.js":85020,"./ku":90582,"./ku.js":90582,"./ky":34950,"./ky.js":34950,"./lb":94201,"./lb.js":94201,"./lo":87894,"./lo.js":87894,"./lt":70120,"./lt.js":70120,"./lv":4265,"./lv.js":4265,"./me":14030,"./me.js":14030,"./mi":9463,"./mi.js":9463,"./mk":25898,"./mk.js":25898,"./ml":64233,"./ml.js":64233,"./mn":47156,"./mn.js":47156,"./mr":34479,"./mr.js":34479,"./ms":24691,"./ms-my":6456,"./ms-my.js":6456,"./ms.js":24691,"./mt":81789,"./mt.js":81789,"./my":37452,"./my.js":37452,"./nb":91170,"./nb.js":91170,"./ne":87529,"./ne.js":87529,"./nl":81776,"./nl-be":24455,"./nl-be.js":24455,"./nl.js":81776,"./nn":34705,"./nn.js":34705,"./oc-lnc":36139,"./oc-lnc.js":36139,"./pa-in":17960,"./pa-in.js":17960,"./pl":1899,"./pl.js":1899,"./pt":31670,"./pt-br":29159,"./pt-br.js":29159,"./pt.js":31670,"./ro":55115,"./ro.js":55115,"./ru":45149,"./ru.js":45149,"./sd":81231,"./sd.js":81231,"./se":35397,"./se.js":35397,"./si":99786,"./si.js":99786,"./sk":39383,"./sk.js":39383,"./sl":68691,"./sl.js":68691,"./sq":34826,"./sq.js":34826,"./sr":40080,"./sr-cyrl":75673,"./sr-cyrl.js":75673,"./sr.js":40080,"./ss":54309,"./ss.js":54309,"./sv":52245,"./sv.js":52245,"./sw":8967,"./sw.js":8967,"./ta":10454,"./ta.js":10454,"./te":35204,"./te.js":35204,"./tet":81571,"./tet.js":81571,"./tg":15737,"./tg.js":15737,"./th":41786,"./th.js":41786,"./tk":50511,"./tk.js":50511,"./tl-ph":14828,"./tl-ph.js":14828,"./tlh":62422,"./tlh.js":62422,"./tr":97047,"./tr.js":97047,"./tzl":90792,"./tzl.js":90792,"./tzm":67730,"./tzm-latn":59963,"./tzm-latn.js":59963,"./tzm.js":67730,"./ug-cn":42535,"./ug-cn.js":42535,"./uk":33151,"./uk.js":33151,"./ur":22750,"./ur.js":22750,"./uz":61914,"./uz-latn":60231,"./uz-latn.js":60231,"./uz.js":61914,"./vi":55517,"./vi.js":55517,"./x-pseudo":64078,"./x-pseudo.js":64078,"./yo":70046,"./yo.js":70046,"./zh-cn":81832,"./zh-cn.js":81832,"./zh-hk":90953,"./zh-hk.js":90953,"./zh-mo":38236,"./zh-mo.js":38236,"./zh-tw":71001,"./zh-tw.js":71001};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=s,e.exports=i,i.id=85721}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.d9fa0635.js b/assets/js/runtime~main.45d79ea0.js similarity index 98% rename from assets/js/runtime~main.d9fa0635.js rename to assets/js/runtime~main.45d79ea0.js index 18d3e526a..bddf9636b 100644 --- a/assets/js/runtime~main.d9fa0635.js +++ b/assets/js/runtime~main.45d79ea0.js @@ -1 +1 @@ -(()=>{"use strict";var a,r,e,t,g,h={},c={};function _(a){var r=c[a];if(void 0!==r)return r.exports;var e=c[a]={id:a,loaded:!1,exports:{}};return h[a].call(e.exports,e,e.exports,_),e.loaded=!0,e.exports}_.m=h,_.c=c,a=[],_.O=(r,e,t,g)=>{if(!e){var h=1/0;for(l=0;l=g)&&Object.keys(_.O).every((a=>_.O[a](e[i])))?e.splice(i--,1):(c=!1,g0&&a[l-1][2]>g;l--)a[l]=a[l-1];a[l]=[e,t,g]},_.n=a=>{var r=a&&a.__esModule?()=>a.default:()=>a;return _.d(r,{a:r}),r},e=Object.getPrototypeOf?a=>Object.getPrototypeOf(a):a=>a.__proto__,_.t=function(a,t){if(1&t&&(a=this(a)),8&t)return a;if("object"==typeof a&&a){if(4&t&&a.__esModule)return a;if(16&t&&"function"==typeof a.then)return a}var g=Object.create(null);_.r(g);var h={};r=r||[null,e({}),e([]),e(e)];for(var c=2&t&&a;"object"==typeof c&&!~r.indexOf(c);c=e(c))Object.getOwnPropertyNames(c).forEach((r=>h[r]=()=>a[r]));return h.default=()=>a,_.d(g,h),g},_.d=(a,r)=>{for(var e in r)_.o(r,e)&&!_.o(a,e)&&Object.defineProperty(a,e,{enumerable:!0,get:r[e]})},_.f={},_.e=a=>Promise.all(Object.keys(_.f).reduce(((r,e)=>(_.f[e](a,r),r)),[])),_.u=a=>"assets/js/"+({53:"935f2afb",81:"react-syntax-highlighter_languages_refractor_properties",131:"react-syntax-highlighter_languages_refractor_clike",138:"b7e3cb26",158:"react-syntax-highlighter_languages_refractor_glsl",206:"react-syntax-highlighter_languages_refractor_wasm",226:"react-syntax-highlighter_languages_refractor_mel",310:"288c469d",342:"react-syntax-highlighter_languages_refractor_powershell",369:"react-syntax-highlighter_languages_refractor_ruby",400:"react-syntax-highlighter_languages_refractor_batch",499:"c917bf2b",512:"f2beed36",533:"b2b675dd",672:"react-syntax-highlighter_languages_refractor_parser",673:"5f21ea84",741:"react-syntax-highlighter_languages_refractor_fsharp",764:"7a4a9b46",849:"react-syntax-highlighter_languages_refractor_smarty",948:"react-syntax-highlighter_languages_refractor_bison",979:"react-syntax-highlighter_languages_refractor_protobuf",981:"3569ab66",982:"react-syntax-highlighter_languages_refractor_xquery",988:"9bdeab26",1001:"react-syntax-highlighter_languages_refractor_rust",1007:"react-syntax-highlighter_languages_refractor_haskell",1130:"react-syntax-highlighter_languages_refractor_crystal",1167:"react-syntax-highlighter_languages_refractor_vhdl",1187:"24d72f0a",1253:"react-syntax-highlighter_languages_refractor_wiki",1323:"react-syntax-highlighter_languages_refractor_liquid",1378:"d77d076b",1423:"react-syntax-highlighter_languages_refractor_soy",1438:"react-syntax-highlighter_languages_refractor_arff",1477:"b2f554cd",1554:"react-syntax-highlighter_languages_refractor_asciidoc",1621:"react-syntax-highlighter_languages_refractor_stylus",1684:"bc9c1742",1713:"a7023ddc",1726:"c41ff80a",1751:"react-syntax-highlighter_languages_refractor_q",1768:"react-syntax-highlighter_languages_refractor_rip",1929:"react-syntax-highlighter_languages_refractor_vim",1988:"d5c55fab",1993:"b8066252",2013:"react-syntax-highlighter_languages_refractor_erlang",2031:"5496fe69",2044:"react-syntax-highlighter_languages_refractor_fortran",2051:"react-syntax-highlighter_languages_refractor_docker",2065:"react-syntax-highlighter_languages_refractor_autohotkey",2099:"db6878c4",2153:"545e0e9c",2182:"react-syntax-highlighter_languages_refractor_eiffel",2227:"react-syntax-highlighter_languages_refractor_php",2234:"e57fa941",2348:"react-syntax-highlighter_languages_refractor_rest",2413:"react-syntax-highlighter_languages_refractor_icon",2422:"c367bf37",2496:"react-syntax-highlighter_languages_refractor_markup",2509:"react-syntax-highlighter_languages_refractor_tsx",2535:"814f3328",2547:"react-syntax-highlighter_languages_refractor_qore",2564:"react-syntax-highlighter_languages_refractor_git",2567:"0297c59f",2572:"d02bd67e",2584:"react-syntax-highlighter_languages_refractor_erb",2710:"f989b58c",2822:"react-syntax-highlighter_languages_refractor_smalltalk",2891:"react-syntax-highlighter_languages_refractor_python",2905:"664ce118",2980:"react-syntax-highlighter_languages_refractor_velocity",2996:"react-syntax-highlighter_languages_refractor_inform7",3025:"react-syntax-highlighter_languages_refractor_nim",3047:"react-syntax-highlighter_languages_refractor_markupTemplating",3057:"9b79081a",3085:"1f391b9e",3089:"a6aa9e1f",3116:"react-syntax-highlighter_languages_refractor_xojo",3140:"react-syntax-highlighter_languages_refractor_hsts",3186:"992f23a0",3224:"react-syntax-highlighter_languages_refractor_haxe",3236:"react-syntax-highlighter_languages_refractor_roboconf",3237:"1df93b7f",3318:"react-syntax-highlighter_languages_refractor_csharp",3327:"react-syntax-highlighter_languages_refractor_swift",3384:"react-syntax-highlighter_languages_refractor_arduino",3412:"react-syntax-highlighter_languages_refractor_abap",3432:"f789302e",3444:"react-syntax-highlighter_languages_refractor_tt2",3502:"react-syntax-highlighter_languages_refractor_nsis",3520:"react-syntax-highlighter_languages_refractor_lisp",3608:"9e4087bc",3657:"react-syntax-highlighter_languages_refractor_json",3694:"react-syntax-highlighter_languages_refractor_bro",3717:"react-syntax-highlighter_languages_refractor_d",3818:"react-syntax-highlighter_languages_refractor_scala",3819:"react-syntax-highlighter_languages_refractor_keyman",3821:"react-syntax-highlighter_languages_refractor_nix",3846:"react-syntax-highlighter_languages_refractor_handlebars",3934:"f44e6046",3971:"react-syntax-highlighter_languages_refractor_actionscript",3980:"react-syntax-highlighter_languages_refractor_java",4013:"01a85c17",4045:"react-syntax-highlighter_languages_refractor_prolog",4052:"react-syntax-highlighter_languages_refractor_nginx",4069:"react-syntax-highlighter_languages_refractor_mizar",4098:"react-syntax-highlighter_languages_refractor_applescript",4155:"e8da6e74",4157:"react-syntax-highlighter_languages_refractor_perl",4268:"6b50e60a",4273:"f60e5cae",4281:"3d7dd6d6",4630:"react-syntax-highlighter_languages_refractor_kotlin",4657:"react-syntax-highlighter_languages_refractor_jsx",4698:"react-syntax-highlighter_languages_refractor_livescript",4701:"react-syntax-highlighter_languages_refractor_j",4732:"react-syntax-highlighter_languages_refractor_latex",4865:"f07bbfa7",5004:"bd8023de",5008:"react-syntax-highlighter_languages_refractor_css",5014:"react-syntax-highlighter_languages_refractor_n4js",5056:"react-syntax-highlighter_languages_refractor_ichigojam",5073:"c9d564ef",5082:"react-syntax-highlighter/refractor-core-import",5085:"react-syntax-highlighter_languages_refractor_scheme",5119:"b91a83ed",5165:"react-syntax-highlighter_languages_refractor_tcl",5259:"react-syntax-highlighter_languages_refractor_groovy",5299:"react-syntax-highlighter_languages_refractor_csp",5508:"react-syntax-highlighter_languages_refractor_julia",5524:"react-syntax-highlighter_languages_refractor_apacheconf",5539:"react-syntax-highlighter_languages_refractor_brainfuck",5696:"react-syntax-highlighter_languages_refractor_asm6502",5778:"68ef87ea",5793:"react-syntax-highlighter_languages_refractor_phpExtras",5867:"react-syntax-highlighter_languages_refractor_gedcom",5884:"0f8300a0",5896:"react-syntax-highlighter_languages_refractor_vbnet",5951:"react-syntax-highlighter_languages_refractor_less",5976:"5328e403",5979:"c144f25f",5983:"react-syntax-highlighter_languages_refractor_yaml",6007:"3f72396a",6051:"react-syntax-highlighter_languages_refractor_gherkin",6084:"react-syntax-highlighter_languages_refractor_ada",6103:"ccc49370",6118:"react-syntax-highlighter_languages_refractor_coffeescript",6247:"react-syntax-highlighter_languages_refractor_diff",6252:"d503c865",6343:"react-syntax-highlighter_languages_refractor_elixir",6487:"react-syntax-highlighter_languages_refractor_haml",6495:"react-syntax-highlighter_languages_refractor_ini",6508:"react-syntax-highlighter_languages_refractor_http",6558:"react-syntax-highlighter_languages_refractor_visualBasic",6574:"react-syntax-highlighter_languages_refractor_xeora",6626:"react-syntax-highlighter_languages_refractor_go",6670:"react-syntax-highlighter_languages_refractor_apl",6749:"react-syntax-highlighter_languages_refractor_hpkp",6861:"react-syntax-highlighter_languages_refractor_puppet",6971:"c377a04b",6975:"react-syntax-highlighter_languages_refractor_tap",7055:"react-syntax-highlighter_languages_refractor_sql",7097:"react-syntax-highlighter_languages_refractor_textile",7169:"4d9ae8a6",7239:"72e14192",7253:"react-syntax-highlighter_languages_refractor_nasm",7279:"react-syntax-highlighter_languages_refractor_javascript",7286:"react-syntax-highlighter_languages_refractor_scss",7381:"2b90ec83",7392:"50cff001",7414:"393be207",7475:"react-syntax-highlighter_languages_refractor_cssExtras",7504:"react-syntax-highlighter_languages_refractor_basic",7555:"5c28f3a1",7576:"react-syntax-highlighter_languages_refractor_makefile",7646:"95e8add9",7655:"f2da1fd8",7658:"react-syntax-highlighter_languages_refractor_oz",7719:"react-syntax-highlighter_languages_refractor_lolcode",7769:"react-syntax-highlighter_languages_refractor_dart",7801:"react-syntax-highlighter_languages_refractor_io",7830:"97e55e4f",7833:"react-syntax-highlighter_languages_refractor_pascal",7838:"react-syntax-highlighter_languages_refractor_elm",7869:"58207a97",7882:"react-syntax-highlighter_languages_refractor_r",7899:"react-syntax-highlighter_languages_refractor_django",7918:"17896441",7966:"react-syntax-highlighter_languages_refractor_clojure",7998:"8926b418",8e3:"react-syntax-highlighter_languages_refractor_opencl",8030:"react-syntax-highlighter_languages_refractor_aspnet",8050:"b213740e",8067:"react-syntax-highlighter_languages_refractor_sas",8119:"react-syntax-highlighter_languages_refractor_lua",8243:"e466611a",8333:"react-syntax-highlighter_languages_refractor_autoit",8336:"react-syntax-highlighter_languages_refractor_objectivec",8404:"react-syntax-highlighter_languages_refractor_matlab",8458:"react-syntax-highlighter_languages_refractor_jolie",8513:"react-syntax-highlighter_languages_refractor_monkey",8563:"64b33ec2",8603:"4521f656",8610:"6875c492",8751:"3d1d8d9e",8765:"react-syntax-highlighter_languages_refractor_bash",8811:"react-syntax-highlighter_languages_refractor_reason",8819:"react-syntax-highlighter_languages_refractor_verilog",8827:"react-syntax-highlighter_languages_refractor_twig",8840:"react-syntax-highlighter_languages_refractor_plsql",8921:"react-syntax-highlighter_languages_refractor_graphql",8950:"react-syntax-highlighter_languages_refractor_c",8992:"react-syntax-highlighter_languages_refractor_ocaml",9034:"5dd4edc6",9142:"09d762c9",9291:"react-syntax-highlighter_languages_refractor_renpy",9315:"react-syntax-highlighter_languages_refractor_pure",9461:"react-syntax-highlighter_languages_refractor_typescript",9514:"1be78505",9692:"react-syntax-highlighter_languages_refractor_cpp",9742:"react-syntax-highlighter_languages_refractor_flow",9770:"react-syntax-highlighter_languages_refractor_processing",9797:"react-syntax-highlighter_languages_refractor_sass",9835:"react-syntax-highlighter_languages_refractor_markdown",9842:"d7d5b0cb",9851:"react-syntax-highlighter_languages_refractor_pug",9949:"fa619255",9979:"react-syntax-highlighter_languages_refractor_parigp"}[a]||a)+"."+{53:"e3ee3e70",81:"6a9fb36b",131:"b1ad18d3",138:"bb9f57f7",158:"f7574ae1",206:"c72caadb",226:"26b04b79",310:"2458e118",342:"97407eff",369:"4bbf189c",400:"26dca5d4",499:"d6592ac9",512:"d8fa9a08",533:"37b72b08",672:"3f1a6262",673:"2e5a464a",741:"324cab40",764:"ecd791fe",849:"fad6e8da",948:"e29062d9",979:"1c398e7d",981:"64cb5791",982:"bc6e8aca",988:"d14365d9",1001:"61167cbd",1007:"01984854",1098:"c23afea0",1130:"7b6e1db0",1167:"8e09b94b",1187:"e3fc490f",1253:"63c121cd",1323:"6d51ddb3",1378:"d151f21a",1381:"00c96fbb",1423:"3d830e4c",1438:"bd8b7330",1477:"42160044",1554:"5c94a7c6",1621:"c2fe68fc",1684:"287e8a06",1713:"13ad2774",1726:"626479e2",1751:"7497e40f",1768:"c220b67d",1877:"9dd48875",1929:"b92418dd",1988:"cff3822e",1993:"bb9e001b",2013:"7f0c7067",2031:"cbfb9d29",2044:"451d86eb",2051:"3ffde9fb",2065:"b4857b84",2099:"cb887b09",2153:"a9eb0df4",2182:"12dd21a6",2227:"03268aeb",2234:"4c6cd158",2348:"3b4f25b8",2413:"9eed9730",2422:"72df1a61",2496:"acfb0823",2509:"f8a0b4b7",2535:"33c9a2ef",2547:"51541e80",2564:"276c2e5f",2567:"2e60acf4",2572:"bc802b80",2584:"e9c02433",2710:"8457b8a7",2822:"05f92e9d",2891:"cd4fdb7e",2905:"60a0fcd2",2974:"9910bec8",2980:"ca51ea33",2996:"db30e552",3025:"866077b8",3047:"cc96b7da",3057:"b664197d",3085:"6b9cc623",3089:"7fa392d1",3116:"d2acb877",3140:"9ff9af04",3186:"da6fbda6",3224:"6c8e2d12",3236:"435a3d53",3237:"1d72a79e",3318:"4e81f483",3327:"c6123915",3384:"f2c44880",3412:"4fb17d01",3432:"1ce9f0b7",3444:"c66852f6",3502:"0e0c8642",3520:"8f576c38",3608:"f3d7c6d9",3657:"8a9b4586",3694:"900f093f",3717:"ec4fb81d",3818:"917d6597",3819:"fc6ad07d",3821:"2a75eec7",3846:"fd1d5e51",3934:"fbe4f2cb",3971:"59b696bf",3980:"cdd75fcb",4013:"836cc165",4045:"79f3cd65",4052:"292a3b2b",4069:"07dbbcf7",4098:"323baf98",4155:"3291e220",4157:"c6d11d7f",4268:"897d805d",4273:"3912d218",4281:"27170d92",4630:"0a341cdc",4657:"7d2cb2d6",4698:"31285679",4701:"19374676",4732:"eaeba067",4865:"617230f7",5004:"0f087e3d",5008:"8356a694",5014:"320c5ed3",5056:"e331cab6",5073:"f012eea1",5082:"c0c4aa19",5085:"e7ae74a7",5119:"04a13f0c",5165:"ef54e8f4",5259:"eda42f27",5299:"43fe6f80",5508:"83423d4f",5524:"5985f0db",5539:"667a3c9d",5696:"646709af",5778:"f3a6bc20",5793:"0cf42765",5867:"b0794be8",5884:"368f7932",5896:"1898da97",5951:"c6665619",5976:"96ffad58",5979:"5adfdebd",5983:"41812f07",6007:"9bf60090",6051:"700d301a",6084:"61db04e2",6103:"9e0025fe",6118:"b3389610",6247:"572a7cb7",6252:"c166f237",6343:"5848750d",6487:"cd1ed56b",6495:"e17ddb07",6508:"a1404005",6558:"0da59e35",6574:"7f389ea4",6626:"6bf8c945",6670:"5884b0d7",6749:"d3295b01",6861:"9b6ec977",6971:"b6949fb3",6975:"7f01a7b2",7055:"17a20f47",7097:"0bd4c431",7169:"73e64701",7239:"7950776b",7253:"789e1083",7279:"08aa8d4c",7286:"d4a2c3f8",7381:"c4675167",7392:"114160e2",7414:"1f8e6cad",7475:"dff0fb18",7504:"f2923a12",7555:"35e47942",7576:"6fd376f9",7646:"9ea27e22",7655:"315b4d55",7658:"0dbba4fe",7719:"061bc5ea",7769:"7b39a8bf",7801:"f4f74766",7830:"638efb3b",7833:"77e67dea",7838:"91cc0aa7",7869:"b55a37e8",7882:"a981290a",7899:"eaf01f46",7918:"3e40ac19",7966:"bd91cb11",7998:"2c64d072",8e3:"fb07fe6b",8030:"7ea48cfe",8050:"733525c5",8067:"65e3e71c",8119:"812e9def",8243:"0cd9d8b2",8333:"22a2d8e7",8336:"c477b794",8404:"a3499721",8458:"ab531365",8513:"34ebdb16",8563:"2c705529",8603:"e978555a",8610:"0d3239f0",8648:"ca9baaf8",8666:"3f85f302",8751:"2f9f4186",8765:"c7092e97",8811:"3b0920b4",8819:"51eb69bc",8827:"227d2760",8840:"8e897c50",8921:"da29dcb9",8926:"d83e8a98",8950:"f03b6e10",8992:"32cadcfd",9034:"c4fe478a",9097:"66170fb4",9142:"d9092949",9291:"5f2e52f4",9315:"5469c8b4",9461:"93b3ab9a",9514:"ce37cc91",9692:"c2f1c765",9742:"a736e818",9770:"4d16d6f0",9791:"1fa31a4c",9797:"d24acefb",9835:"8cd69aef",9842:"55640297",9851:"5338e2fc",9949:"6c3283c4",9979:"092c939a"}[a]+".js",_.miniCssF=a=>{},_.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(a){if("object"==typeof window)return window}}(),_.o=(a,r)=>Object.prototype.hasOwnProperty.call(a,r),t={},g="website:",_.l=(a,r,e,h)=>{if(t[a])t[a].push(r);else{var c,i;if(void 0!==e)for(var s=document.getElementsByTagName("script"),l=0;l{c.onerror=c.onload=null,clearTimeout(o);var g=t[a];if(delete t[a],c.parentNode&&c.parentNode.removeChild(c),g&&g.forEach((a=>a(e))),r)return r(e)},o=setTimeout(f.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=f.bind(null,c.onerror),c.onload=f.bind(null,c.onload),i&&document.head.appendChild(c)}},_.r=a=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},_.nmd=a=>(a.paths=[],a.children||(a.children=[]),a),_.p="/",_.gca=function(a){return a={17896441:"7918","935f2afb":"53","react-syntax-highlighter_languages_refractor_properties":"81","react-syntax-highlighter_languages_refractor_clike":"131",b7e3cb26:"138","react-syntax-highlighter_languages_refractor_glsl":"158","react-syntax-highlighter_languages_refractor_wasm":"206","react-syntax-highlighter_languages_refractor_mel":"226","288c469d":"310","react-syntax-highlighter_languages_refractor_powershell":"342","react-syntax-highlighter_languages_refractor_ruby":"369","react-syntax-highlighter_languages_refractor_batch":"400",c917bf2b:"499",f2beed36:"512",b2b675dd:"533","react-syntax-highlighter_languages_refractor_parser":"672","5f21ea84":"673","react-syntax-highlighter_languages_refractor_fsharp":"741","7a4a9b46":"764","react-syntax-highlighter_languages_refractor_smarty":"849","react-syntax-highlighter_languages_refractor_bison":"948","react-syntax-highlighter_languages_refractor_protobuf":"979","3569ab66":"981","react-syntax-highlighter_languages_refractor_xquery":"982","9bdeab26":"988","react-syntax-highlighter_languages_refractor_rust":"1001","react-syntax-highlighter_languages_refractor_haskell":"1007","react-syntax-highlighter_languages_refractor_crystal":"1130","react-syntax-highlighter_languages_refractor_vhdl":"1167","24d72f0a":"1187","react-syntax-highlighter_languages_refractor_wiki":"1253","react-syntax-highlighter_languages_refractor_liquid":"1323",d77d076b:"1378","react-syntax-highlighter_languages_refractor_soy":"1423","react-syntax-highlighter_languages_refractor_arff":"1438",b2f554cd:"1477","react-syntax-highlighter_languages_refractor_asciidoc":"1554","react-syntax-highlighter_languages_refractor_stylus":"1621",bc9c1742:"1684",a7023ddc:"1713",c41ff80a:"1726","react-syntax-highlighter_languages_refractor_q":"1751","react-syntax-highlighter_languages_refractor_rip":"1768","react-syntax-highlighter_languages_refractor_vim":"1929",d5c55fab:"1988",b8066252:"1993","react-syntax-highlighter_languages_refractor_erlang":"2013","5496fe69":"2031","react-syntax-highlighter_languages_refractor_fortran":"2044","react-syntax-highlighter_languages_refractor_docker":"2051","react-syntax-highlighter_languages_refractor_autohotkey":"2065",db6878c4:"2099","545e0e9c":"2153","react-syntax-highlighter_languages_refractor_eiffel":"2182","react-syntax-highlighter_languages_refractor_php":"2227",e57fa941:"2234","react-syntax-highlighter_languages_refractor_rest":"2348","react-syntax-highlighter_languages_refractor_icon":"2413",c367bf37:"2422","react-syntax-highlighter_languages_refractor_markup":"2496","react-syntax-highlighter_languages_refractor_tsx":"2509","814f3328":"2535","react-syntax-highlighter_languages_refractor_qore":"2547","react-syntax-highlighter_languages_refractor_git":"2564","0297c59f":"2567",d02bd67e:"2572","react-syntax-highlighter_languages_refractor_erb":"2584",f989b58c:"2710","react-syntax-highlighter_languages_refractor_smalltalk":"2822","react-syntax-highlighter_languages_refractor_python":"2891","664ce118":"2905","react-syntax-highlighter_languages_refractor_velocity":"2980","react-syntax-highlighter_languages_refractor_inform7":"2996","react-syntax-highlighter_languages_refractor_nim":"3025","react-syntax-highlighter_languages_refractor_markupTemplating":"3047","9b79081a":"3057","1f391b9e":"3085",a6aa9e1f:"3089","react-syntax-highlighter_languages_refractor_xojo":"3116","react-syntax-highlighter_languages_refractor_hsts":"3140","992f23a0":"3186","react-syntax-highlighter_languages_refractor_haxe":"3224","react-syntax-highlighter_languages_refractor_roboconf":"3236","1df93b7f":"3237","react-syntax-highlighter_languages_refractor_csharp":"3318","react-syntax-highlighter_languages_refractor_swift":"3327","react-syntax-highlighter_languages_refractor_arduino":"3384","react-syntax-highlighter_languages_refractor_abap":"3412",f789302e:"3432","react-syntax-highlighter_languages_refractor_tt2":"3444","react-syntax-highlighter_languages_refractor_nsis":"3502","react-syntax-highlighter_languages_refractor_lisp":"3520","9e4087bc":"3608","react-syntax-highlighter_languages_refractor_json":"3657","react-syntax-highlighter_languages_refractor_bro":"3694","react-syntax-highlighter_languages_refractor_d":"3717","react-syntax-highlighter_languages_refractor_scala":"3818","react-syntax-highlighter_languages_refractor_keyman":"3819","react-syntax-highlighter_languages_refractor_nix":"3821","react-syntax-highlighter_languages_refractor_handlebars":"3846",f44e6046:"3934","react-syntax-highlighter_languages_refractor_actionscript":"3971","react-syntax-highlighter_languages_refractor_java":"3980","01a85c17":"4013","react-syntax-highlighter_languages_refractor_prolog":"4045","react-syntax-highlighter_languages_refractor_nginx":"4052","react-syntax-highlighter_languages_refractor_mizar":"4069","react-syntax-highlighter_languages_refractor_applescript":"4098",e8da6e74:"4155","react-syntax-highlighter_languages_refractor_perl":"4157","6b50e60a":"4268",f60e5cae:"4273","3d7dd6d6":"4281","react-syntax-highlighter_languages_refractor_kotlin":"4630","react-syntax-highlighter_languages_refractor_jsx":"4657","react-syntax-highlighter_languages_refractor_livescript":"4698","react-syntax-highlighter_languages_refractor_j":"4701","react-syntax-highlighter_languages_refractor_latex":"4732",f07bbfa7:"4865",bd8023de:"5004","react-syntax-highlighter_languages_refractor_css":"5008","react-syntax-highlighter_languages_refractor_n4js":"5014","react-syntax-highlighter_languages_refractor_ichigojam":"5056",c9d564ef:"5073","react-syntax-highlighter/refractor-core-import":"5082","react-syntax-highlighter_languages_refractor_scheme":"5085",b91a83ed:"5119","react-syntax-highlighter_languages_refractor_tcl":"5165","react-syntax-highlighter_languages_refractor_groovy":"5259","react-syntax-highlighter_languages_refractor_csp":"5299","react-syntax-highlighter_languages_refractor_julia":"5508","react-syntax-highlighter_languages_refractor_apacheconf":"5524","react-syntax-highlighter_languages_refractor_brainfuck":"5539","react-syntax-highlighter_languages_refractor_asm6502":"5696","68ef87ea":"5778","react-syntax-highlighter_languages_refractor_phpExtras":"5793","react-syntax-highlighter_languages_refractor_gedcom":"5867","0f8300a0":"5884","react-syntax-highlighter_languages_refractor_vbnet":"5896","react-syntax-highlighter_languages_refractor_less":"5951","5328e403":"5976",c144f25f:"5979","react-syntax-highlighter_languages_refractor_yaml":"5983","3f72396a":"6007","react-syntax-highlighter_languages_refractor_gherkin":"6051","react-syntax-highlighter_languages_refractor_ada":"6084",ccc49370:"6103","react-syntax-highlighter_languages_refractor_coffeescript":"6118","react-syntax-highlighter_languages_refractor_diff":"6247",d503c865:"6252","react-syntax-highlighter_languages_refractor_elixir":"6343","react-syntax-highlighter_languages_refractor_haml":"6487","react-syntax-highlighter_languages_refractor_ini":"6495","react-syntax-highlighter_languages_refractor_http":"6508","react-syntax-highlighter_languages_refractor_visualBasic":"6558","react-syntax-highlighter_languages_refractor_xeora":"6574","react-syntax-highlighter_languages_refractor_go":"6626","react-syntax-highlighter_languages_refractor_apl":"6670","react-syntax-highlighter_languages_refractor_hpkp":"6749","react-syntax-highlighter_languages_refractor_puppet":"6861",c377a04b:"6971","react-syntax-highlighter_languages_refractor_tap":"6975","react-syntax-highlighter_languages_refractor_sql":"7055","react-syntax-highlighter_languages_refractor_textile":"7097","4d9ae8a6":"7169","72e14192":"7239","react-syntax-highlighter_languages_refractor_nasm":"7253","react-syntax-highlighter_languages_refractor_javascript":"7279","react-syntax-highlighter_languages_refractor_scss":"7286","2b90ec83":"7381","50cff001":"7392","393be207":"7414","react-syntax-highlighter_languages_refractor_cssExtras":"7475","react-syntax-highlighter_languages_refractor_basic":"7504","5c28f3a1":"7555","react-syntax-highlighter_languages_refractor_makefile":"7576","95e8add9":"7646",f2da1fd8:"7655","react-syntax-highlighter_languages_refractor_oz":"7658","react-syntax-highlighter_languages_refractor_lolcode":"7719","react-syntax-highlighter_languages_refractor_dart":"7769","react-syntax-highlighter_languages_refractor_io":"7801","97e55e4f":"7830","react-syntax-highlighter_languages_refractor_pascal":"7833","react-syntax-highlighter_languages_refractor_elm":"7838","58207a97":"7869","react-syntax-highlighter_languages_refractor_r":"7882","react-syntax-highlighter_languages_refractor_django":"7899","react-syntax-highlighter_languages_refractor_clojure":"7966","8926b418":"7998","react-syntax-highlighter_languages_refractor_opencl":"8000","react-syntax-highlighter_languages_refractor_aspnet":"8030",b213740e:"8050","react-syntax-highlighter_languages_refractor_sas":"8067","react-syntax-highlighter_languages_refractor_lua":"8119",e466611a:"8243","react-syntax-highlighter_languages_refractor_autoit":"8333","react-syntax-highlighter_languages_refractor_objectivec":"8336","react-syntax-highlighter_languages_refractor_matlab":"8404","react-syntax-highlighter_languages_refractor_jolie":"8458","react-syntax-highlighter_languages_refractor_monkey":"8513","64b33ec2":"8563","4521f656":"8603","6875c492":"8610","3d1d8d9e":"8751","react-syntax-highlighter_languages_refractor_bash":"8765","react-syntax-highlighter_languages_refractor_reason":"8811","react-syntax-highlighter_languages_refractor_verilog":"8819","react-syntax-highlighter_languages_refractor_twig":"8827","react-syntax-highlighter_languages_refractor_plsql":"8840","react-syntax-highlighter_languages_refractor_graphql":"8921","react-syntax-highlighter_languages_refractor_c":"8950","react-syntax-highlighter_languages_refractor_ocaml":"8992","5dd4edc6":"9034","09d762c9":"9142","react-syntax-highlighter_languages_refractor_renpy":"9291","react-syntax-highlighter_languages_refractor_pure":"9315","react-syntax-highlighter_languages_refractor_typescript":"9461","1be78505":"9514","react-syntax-highlighter_languages_refractor_cpp":"9692","react-syntax-highlighter_languages_refractor_flow":"9742","react-syntax-highlighter_languages_refractor_processing":"9770","react-syntax-highlighter_languages_refractor_sass":"9797","react-syntax-highlighter_languages_refractor_markdown":"9835",d7d5b0cb:"9842","react-syntax-highlighter_languages_refractor_pug":"9851",fa619255:"9949","react-syntax-highlighter_languages_refractor_parigp":"9979"}[a]||a,_.p+_.u(a)},(()=>{var a={1303:0,532:0};_.f.j=(r,e)=>{var t=_.o(a,r)?a[r]:void 0;if(0!==t)if(t)e.push(t[2]);else if(/^(1303|532)$/.test(r))a[r]=0;else{var g=new Promise(((e,g)=>t=a[r]=[e,g]));e.push(t[2]=g);var h=_.p+_.u(r),c=new Error;_.l(h,(e=>{if(_.o(a,r)&&(0!==(t=a[r])&&(a[r]=void 0),t)){var g=e&&("load"===e.type?"missing":e.type),h=e&&e.target&&e.target.src;c.message="Loading chunk "+r+" failed.\n("+g+": "+h+")",c.name="ChunkLoadError",c.type=g,c.request=h,t[1](c)}}),"chunk-"+r,r)}},_.O.j=r=>0===a[r];var r=(r,e)=>{var t,g,h=e[0],c=e[1],i=e[2],s=0;if(h.some((r=>0!==a[r]))){for(t in c)_.o(c,t)&&(_.m[t]=c[t]);if(i)var l=i(_)}for(r&&r(e);s{"use strict";var a,r,e,t,g,h={},c={};function _(a){var r=c[a];if(void 0!==r)return r.exports;var e=c[a]={id:a,loaded:!1,exports:{}};return h[a].call(e.exports,e,e.exports,_),e.loaded=!0,e.exports}_.m=h,_.c=c,a=[],_.O=(r,e,t,g)=>{if(!e){var h=1/0;for(l=0;l=g)&&Object.keys(_.O).every((a=>_.O[a](e[i])))?e.splice(i--,1):(c=!1,g0&&a[l-1][2]>g;l--)a[l]=a[l-1];a[l]=[e,t,g]},_.n=a=>{var r=a&&a.__esModule?()=>a.default:()=>a;return _.d(r,{a:r}),r},e=Object.getPrototypeOf?a=>Object.getPrototypeOf(a):a=>a.__proto__,_.t=function(a,t){if(1&t&&(a=this(a)),8&t)return a;if("object"==typeof a&&a){if(4&t&&a.__esModule)return a;if(16&t&&"function"==typeof a.then)return a}var g=Object.create(null);_.r(g);var h={};r=r||[null,e({}),e([]),e(e)];for(var c=2&t&&a;"object"==typeof c&&!~r.indexOf(c);c=e(c))Object.getOwnPropertyNames(c).forEach((r=>h[r]=()=>a[r]));return h.default=()=>a,_.d(g,h),g},_.d=(a,r)=>{for(var e in r)_.o(r,e)&&!_.o(a,e)&&Object.defineProperty(a,e,{enumerable:!0,get:r[e]})},_.f={},_.e=a=>Promise.all(Object.keys(_.f).reduce(((r,e)=>(_.f[e](a,r),r)),[])),_.u=a=>"assets/js/"+({53:"935f2afb",81:"react-syntax-highlighter_languages_refractor_properties",131:"react-syntax-highlighter_languages_refractor_clike",138:"b7e3cb26",158:"react-syntax-highlighter_languages_refractor_glsl",206:"react-syntax-highlighter_languages_refractor_wasm",226:"react-syntax-highlighter_languages_refractor_mel",310:"288c469d",342:"react-syntax-highlighter_languages_refractor_powershell",369:"react-syntax-highlighter_languages_refractor_ruby",400:"react-syntax-highlighter_languages_refractor_batch",499:"c917bf2b",512:"f2beed36",533:"b2b675dd",672:"react-syntax-highlighter_languages_refractor_parser",673:"5f21ea84",741:"react-syntax-highlighter_languages_refractor_fsharp",764:"7a4a9b46",849:"react-syntax-highlighter_languages_refractor_smarty",948:"react-syntax-highlighter_languages_refractor_bison",979:"react-syntax-highlighter_languages_refractor_protobuf",981:"3569ab66",982:"react-syntax-highlighter_languages_refractor_xquery",988:"9bdeab26",1001:"react-syntax-highlighter_languages_refractor_rust",1007:"react-syntax-highlighter_languages_refractor_haskell",1130:"react-syntax-highlighter_languages_refractor_crystal",1167:"react-syntax-highlighter_languages_refractor_vhdl",1187:"24d72f0a",1253:"react-syntax-highlighter_languages_refractor_wiki",1323:"react-syntax-highlighter_languages_refractor_liquid",1378:"d77d076b",1423:"react-syntax-highlighter_languages_refractor_soy",1438:"react-syntax-highlighter_languages_refractor_arff",1477:"b2f554cd",1554:"react-syntax-highlighter_languages_refractor_asciidoc",1621:"react-syntax-highlighter_languages_refractor_stylus",1684:"bc9c1742",1713:"a7023ddc",1726:"c41ff80a",1751:"react-syntax-highlighter_languages_refractor_q",1768:"react-syntax-highlighter_languages_refractor_rip",1929:"react-syntax-highlighter_languages_refractor_vim",1988:"d5c55fab",1993:"b8066252",2013:"react-syntax-highlighter_languages_refractor_erlang",2031:"5496fe69",2044:"react-syntax-highlighter_languages_refractor_fortran",2051:"react-syntax-highlighter_languages_refractor_docker",2065:"react-syntax-highlighter_languages_refractor_autohotkey",2099:"db6878c4",2153:"545e0e9c",2182:"react-syntax-highlighter_languages_refractor_eiffel",2227:"react-syntax-highlighter_languages_refractor_php",2234:"e57fa941",2348:"react-syntax-highlighter_languages_refractor_rest",2413:"react-syntax-highlighter_languages_refractor_icon",2422:"c367bf37",2496:"react-syntax-highlighter_languages_refractor_markup",2509:"react-syntax-highlighter_languages_refractor_tsx",2535:"814f3328",2547:"react-syntax-highlighter_languages_refractor_qore",2564:"react-syntax-highlighter_languages_refractor_git",2567:"0297c59f",2572:"d02bd67e",2584:"react-syntax-highlighter_languages_refractor_erb",2710:"f989b58c",2822:"react-syntax-highlighter_languages_refractor_smalltalk",2891:"react-syntax-highlighter_languages_refractor_python",2905:"664ce118",2980:"react-syntax-highlighter_languages_refractor_velocity",2996:"react-syntax-highlighter_languages_refractor_inform7",3025:"react-syntax-highlighter_languages_refractor_nim",3047:"react-syntax-highlighter_languages_refractor_markupTemplating",3057:"9b79081a",3085:"1f391b9e",3089:"a6aa9e1f",3116:"react-syntax-highlighter_languages_refractor_xojo",3140:"react-syntax-highlighter_languages_refractor_hsts",3186:"992f23a0",3224:"react-syntax-highlighter_languages_refractor_haxe",3236:"react-syntax-highlighter_languages_refractor_roboconf",3237:"1df93b7f",3318:"react-syntax-highlighter_languages_refractor_csharp",3327:"react-syntax-highlighter_languages_refractor_swift",3384:"react-syntax-highlighter_languages_refractor_arduino",3412:"react-syntax-highlighter_languages_refractor_abap",3432:"f789302e",3444:"react-syntax-highlighter_languages_refractor_tt2",3502:"react-syntax-highlighter_languages_refractor_nsis",3520:"react-syntax-highlighter_languages_refractor_lisp",3608:"9e4087bc",3657:"react-syntax-highlighter_languages_refractor_json",3694:"react-syntax-highlighter_languages_refractor_bro",3717:"react-syntax-highlighter_languages_refractor_d",3818:"react-syntax-highlighter_languages_refractor_scala",3819:"react-syntax-highlighter_languages_refractor_keyman",3821:"react-syntax-highlighter_languages_refractor_nix",3846:"react-syntax-highlighter_languages_refractor_handlebars",3934:"f44e6046",3971:"react-syntax-highlighter_languages_refractor_actionscript",3980:"react-syntax-highlighter_languages_refractor_java",4013:"01a85c17",4045:"react-syntax-highlighter_languages_refractor_prolog",4052:"react-syntax-highlighter_languages_refractor_nginx",4069:"react-syntax-highlighter_languages_refractor_mizar",4098:"react-syntax-highlighter_languages_refractor_applescript",4155:"e8da6e74",4157:"react-syntax-highlighter_languages_refractor_perl",4268:"6b50e60a",4273:"f60e5cae",4281:"3d7dd6d6",4630:"react-syntax-highlighter_languages_refractor_kotlin",4657:"react-syntax-highlighter_languages_refractor_jsx",4698:"react-syntax-highlighter_languages_refractor_livescript",4701:"react-syntax-highlighter_languages_refractor_j",4732:"react-syntax-highlighter_languages_refractor_latex",4865:"f07bbfa7",5004:"bd8023de",5008:"react-syntax-highlighter_languages_refractor_css",5014:"react-syntax-highlighter_languages_refractor_n4js",5056:"react-syntax-highlighter_languages_refractor_ichigojam",5073:"c9d564ef",5082:"react-syntax-highlighter/refractor-core-import",5085:"react-syntax-highlighter_languages_refractor_scheme",5119:"b91a83ed",5165:"react-syntax-highlighter_languages_refractor_tcl",5259:"react-syntax-highlighter_languages_refractor_groovy",5299:"react-syntax-highlighter_languages_refractor_csp",5508:"react-syntax-highlighter_languages_refractor_julia",5524:"react-syntax-highlighter_languages_refractor_apacheconf",5539:"react-syntax-highlighter_languages_refractor_brainfuck",5696:"react-syntax-highlighter_languages_refractor_asm6502",5778:"68ef87ea",5793:"react-syntax-highlighter_languages_refractor_phpExtras",5867:"react-syntax-highlighter_languages_refractor_gedcom",5884:"0f8300a0",5896:"react-syntax-highlighter_languages_refractor_vbnet",5951:"react-syntax-highlighter_languages_refractor_less",5976:"5328e403",5979:"c144f25f",5983:"react-syntax-highlighter_languages_refractor_yaml",6007:"3f72396a",6051:"react-syntax-highlighter_languages_refractor_gherkin",6084:"react-syntax-highlighter_languages_refractor_ada",6103:"ccc49370",6118:"react-syntax-highlighter_languages_refractor_coffeescript",6247:"react-syntax-highlighter_languages_refractor_diff",6252:"d503c865",6343:"react-syntax-highlighter_languages_refractor_elixir",6487:"react-syntax-highlighter_languages_refractor_haml",6495:"react-syntax-highlighter_languages_refractor_ini",6508:"react-syntax-highlighter_languages_refractor_http",6558:"react-syntax-highlighter_languages_refractor_visualBasic",6574:"react-syntax-highlighter_languages_refractor_xeora",6626:"react-syntax-highlighter_languages_refractor_go",6670:"react-syntax-highlighter_languages_refractor_apl",6749:"react-syntax-highlighter_languages_refractor_hpkp",6861:"react-syntax-highlighter_languages_refractor_puppet",6971:"c377a04b",6975:"react-syntax-highlighter_languages_refractor_tap",7055:"react-syntax-highlighter_languages_refractor_sql",7097:"react-syntax-highlighter_languages_refractor_textile",7169:"4d9ae8a6",7239:"72e14192",7253:"react-syntax-highlighter_languages_refractor_nasm",7279:"react-syntax-highlighter_languages_refractor_javascript",7286:"react-syntax-highlighter_languages_refractor_scss",7381:"2b90ec83",7392:"50cff001",7414:"393be207",7475:"react-syntax-highlighter_languages_refractor_cssExtras",7504:"react-syntax-highlighter_languages_refractor_basic",7555:"5c28f3a1",7576:"react-syntax-highlighter_languages_refractor_makefile",7646:"95e8add9",7655:"f2da1fd8",7658:"react-syntax-highlighter_languages_refractor_oz",7719:"react-syntax-highlighter_languages_refractor_lolcode",7769:"react-syntax-highlighter_languages_refractor_dart",7801:"react-syntax-highlighter_languages_refractor_io",7830:"97e55e4f",7833:"react-syntax-highlighter_languages_refractor_pascal",7838:"react-syntax-highlighter_languages_refractor_elm",7869:"58207a97",7882:"react-syntax-highlighter_languages_refractor_r",7899:"react-syntax-highlighter_languages_refractor_django",7918:"17896441",7966:"react-syntax-highlighter_languages_refractor_clojure",7998:"8926b418",8e3:"react-syntax-highlighter_languages_refractor_opencl",8030:"react-syntax-highlighter_languages_refractor_aspnet",8050:"b213740e",8067:"react-syntax-highlighter_languages_refractor_sas",8119:"react-syntax-highlighter_languages_refractor_lua",8243:"e466611a",8333:"react-syntax-highlighter_languages_refractor_autoit",8336:"react-syntax-highlighter_languages_refractor_objectivec",8404:"react-syntax-highlighter_languages_refractor_matlab",8458:"react-syntax-highlighter_languages_refractor_jolie",8513:"react-syntax-highlighter_languages_refractor_monkey",8563:"64b33ec2",8603:"4521f656",8610:"6875c492",8751:"3d1d8d9e",8765:"react-syntax-highlighter_languages_refractor_bash",8811:"react-syntax-highlighter_languages_refractor_reason",8819:"react-syntax-highlighter_languages_refractor_verilog",8827:"react-syntax-highlighter_languages_refractor_twig",8840:"react-syntax-highlighter_languages_refractor_plsql",8921:"react-syntax-highlighter_languages_refractor_graphql",8950:"react-syntax-highlighter_languages_refractor_c",8992:"react-syntax-highlighter_languages_refractor_ocaml",9034:"5dd4edc6",9142:"09d762c9",9291:"react-syntax-highlighter_languages_refractor_renpy",9315:"react-syntax-highlighter_languages_refractor_pure",9461:"react-syntax-highlighter_languages_refractor_typescript",9514:"1be78505",9692:"react-syntax-highlighter_languages_refractor_cpp",9742:"react-syntax-highlighter_languages_refractor_flow",9770:"react-syntax-highlighter_languages_refractor_processing",9797:"react-syntax-highlighter_languages_refractor_sass",9835:"react-syntax-highlighter_languages_refractor_markdown",9842:"d7d5b0cb",9851:"react-syntax-highlighter_languages_refractor_pug",9949:"fa619255",9979:"react-syntax-highlighter_languages_refractor_parigp"}[a]||a)+"."+{53:"e3ee3e70",81:"6a9fb36b",131:"b1ad18d3",138:"bb9f57f7",158:"f7574ae1",206:"c72caadb",226:"26b04b79",310:"2458e118",342:"97407eff",369:"4bbf189c",400:"26dca5d4",499:"d6592ac9",512:"d8fa9a08",533:"37b72b08",672:"3f1a6262",673:"2e5a464a",741:"324cab40",764:"9fb3b1b2",849:"fad6e8da",948:"e29062d9",979:"1c398e7d",981:"64cb5791",982:"bc6e8aca",988:"d14365d9",1001:"61167cbd",1007:"01984854",1098:"c23afea0",1130:"7b6e1db0",1167:"8e09b94b",1187:"e3fc490f",1253:"63c121cd",1323:"6d51ddb3",1378:"d151f21a",1381:"00c96fbb",1423:"3d830e4c",1438:"bd8b7330",1477:"42160044",1554:"5c94a7c6",1621:"c2fe68fc",1684:"287e8a06",1713:"13ad2774",1726:"626479e2",1751:"7497e40f",1768:"c220b67d",1877:"9dd48875",1929:"b92418dd",1988:"0ab53de2",1993:"bb9e001b",2013:"7f0c7067",2031:"cbfb9d29",2044:"451d86eb",2051:"3ffde9fb",2065:"b4857b84",2099:"cb887b09",2153:"a9eb0df4",2182:"12dd21a6",2227:"03268aeb",2234:"4c6cd158",2348:"3b4f25b8",2413:"9eed9730",2422:"72df1a61",2496:"acfb0823",2509:"f8a0b4b7",2535:"33c9a2ef",2547:"51541e80",2564:"276c2e5f",2567:"2e60acf4",2572:"bc802b80",2584:"e9c02433",2710:"3ebfd358",2822:"05f92e9d",2891:"cd4fdb7e",2905:"60a0fcd2",2974:"9910bec8",2980:"ca51ea33",2996:"db30e552",3025:"866077b8",3047:"cc96b7da",3057:"b664197d",3085:"6b9cc623",3089:"7fa392d1",3116:"d2acb877",3140:"9ff9af04",3186:"da6fbda6",3224:"6c8e2d12",3236:"435a3d53",3237:"b5fbcbac",3318:"4e81f483",3327:"c6123915",3384:"f2c44880",3412:"4fb17d01",3432:"1ce9f0b7",3444:"c66852f6",3502:"0e0c8642",3520:"8f576c38",3608:"f3d7c6d9",3657:"8a9b4586",3694:"900f093f",3717:"ec4fb81d",3818:"917d6597",3819:"fc6ad07d",3821:"2a75eec7",3846:"fd1d5e51",3934:"fbe4f2cb",3971:"59b696bf",3980:"cdd75fcb",4013:"836cc165",4045:"79f3cd65",4052:"292a3b2b",4069:"07dbbcf7",4098:"323baf98",4155:"3291e220",4157:"c6d11d7f",4268:"897d805d",4273:"3912d218",4281:"27170d92",4630:"0a341cdc",4657:"7d2cb2d6",4698:"31285679",4701:"19374676",4732:"eaeba067",4865:"617230f7",5004:"0f087e3d",5008:"8356a694",5014:"320c5ed3",5056:"e331cab6",5073:"f012eea1",5082:"c0c4aa19",5085:"e7ae74a7",5119:"04a13f0c",5165:"ef54e8f4",5259:"eda42f27",5299:"43fe6f80",5508:"83423d4f",5524:"5985f0db",5539:"667a3c9d",5696:"646709af",5778:"f3a6bc20",5793:"0cf42765",5867:"b0794be8",5884:"40bf21f8",5896:"1898da97",5951:"c6665619",5976:"7d01d420",5979:"5adfdebd",5983:"41812f07",6007:"3b1372cf",6051:"700d301a",6084:"61db04e2",6103:"9e0025fe",6118:"b3389610",6247:"572a7cb7",6252:"c166f237",6343:"5848750d",6487:"cd1ed56b",6495:"e17ddb07",6508:"a1404005",6558:"0da59e35",6574:"7f389ea4",6626:"6bf8c945",6670:"5884b0d7",6749:"d3295b01",6861:"9b6ec977",6971:"b6949fb3",6975:"7f01a7b2",7055:"17a20f47",7097:"0bd4c431",7169:"73e64701",7239:"7950776b",7253:"789e1083",7279:"08aa8d4c",7286:"d4a2c3f8",7381:"c4675167",7392:"114160e2",7414:"1f8e6cad",7475:"dff0fb18",7504:"f2923a12",7555:"35e47942",7576:"6fd376f9",7646:"9ea27e22",7655:"315b4d55",7658:"0dbba4fe",7719:"061bc5ea",7769:"7b39a8bf",7801:"f4f74766",7830:"638efb3b",7833:"77e67dea",7838:"91cc0aa7",7869:"b55a37e8",7882:"a981290a",7899:"eaf01f46",7918:"3e40ac19",7966:"bd91cb11",7998:"e60006ca",8e3:"fb07fe6b",8030:"7ea48cfe",8050:"733525c5",8067:"65e3e71c",8119:"812e9def",8243:"0cd9d8b2",8333:"22a2d8e7",8336:"c477b794",8404:"a3499721",8458:"ab531365",8513:"34ebdb16",8563:"2c705529",8603:"e978555a",8610:"0d3239f0",8648:"ca9baaf8",8666:"3f85f302",8751:"2f9f4186",8765:"c7092e97",8811:"3b0920b4",8819:"51eb69bc",8827:"227d2760",8840:"8e897c50",8921:"da29dcb9",8926:"d83e8a98",8950:"f03b6e10",8992:"32cadcfd",9034:"c4fe478a",9097:"66170fb4",9142:"d9092949",9291:"5f2e52f4",9315:"5469c8b4",9461:"93b3ab9a",9514:"ce37cc91",9692:"c2f1c765",9742:"a736e818",9770:"4d16d6f0",9791:"1fa31a4c",9797:"d24acefb",9835:"8cd69aef",9842:"55640297",9851:"5338e2fc",9949:"6c3283c4",9979:"092c939a"}[a]+".js",_.miniCssF=a=>{},_.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(a){if("object"==typeof window)return window}}(),_.o=(a,r)=>Object.prototype.hasOwnProperty.call(a,r),t={},g="website:",_.l=(a,r,e,h)=>{if(t[a])t[a].push(r);else{var c,i;if(void 0!==e)for(var s=document.getElementsByTagName("script"),l=0;l{c.onerror=c.onload=null,clearTimeout(o);var g=t[a];if(delete t[a],c.parentNode&&c.parentNode.removeChild(c),g&&g.forEach((a=>a(e))),r)return r(e)},o=setTimeout(f.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=f.bind(null,c.onerror),c.onload=f.bind(null,c.onload),i&&document.head.appendChild(c)}},_.r=a=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},_.nmd=a=>(a.paths=[],a.children||(a.children=[]),a),_.p="/",_.gca=function(a){return a={17896441:"7918","935f2afb":"53","react-syntax-highlighter_languages_refractor_properties":"81","react-syntax-highlighter_languages_refractor_clike":"131",b7e3cb26:"138","react-syntax-highlighter_languages_refractor_glsl":"158","react-syntax-highlighter_languages_refractor_wasm":"206","react-syntax-highlighter_languages_refractor_mel":"226","288c469d":"310","react-syntax-highlighter_languages_refractor_powershell":"342","react-syntax-highlighter_languages_refractor_ruby":"369","react-syntax-highlighter_languages_refractor_batch":"400",c917bf2b:"499",f2beed36:"512",b2b675dd:"533","react-syntax-highlighter_languages_refractor_parser":"672","5f21ea84":"673","react-syntax-highlighter_languages_refractor_fsharp":"741","7a4a9b46":"764","react-syntax-highlighter_languages_refractor_smarty":"849","react-syntax-highlighter_languages_refractor_bison":"948","react-syntax-highlighter_languages_refractor_protobuf":"979","3569ab66":"981","react-syntax-highlighter_languages_refractor_xquery":"982","9bdeab26":"988","react-syntax-highlighter_languages_refractor_rust":"1001","react-syntax-highlighter_languages_refractor_haskell":"1007","react-syntax-highlighter_languages_refractor_crystal":"1130","react-syntax-highlighter_languages_refractor_vhdl":"1167","24d72f0a":"1187","react-syntax-highlighter_languages_refractor_wiki":"1253","react-syntax-highlighter_languages_refractor_liquid":"1323",d77d076b:"1378","react-syntax-highlighter_languages_refractor_soy":"1423","react-syntax-highlighter_languages_refractor_arff":"1438",b2f554cd:"1477","react-syntax-highlighter_languages_refractor_asciidoc":"1554","react-syntax-highlighter_languages_refractor_stylus":"1621",bc9c1742:"1684",a7023ddc:"1713",c41ff80a:"1726","react-syntax-highlighter_languages_refractor_q":"1751","react-syntax-highlighter_languages_refractor_rip":"1768","react-syntax-highlighter_languages_refractor_vim":"1929",d5c55fab:"1988",b8066252:"1993","react-syntax-highlighter_languages_refractor_erlang":"2013","5496fe69":"2031","react-syntax-highlighter_languages_refractor_fortran":"2044","react-syntax-highlighter_languages_refractor_docker":"2051","react-syntax-highlighter_languages_refractor_autohotkey":"2065",db6878c4:"2099","545e0e9c":"2153","react-syntax-highlighter_languages_refractor_eiffel":"2182","react-syntax-highlighter_languages_refractor_php":"2227",e57fa941:"2234","react-syntax-highlighter_languages_refractor_rest":"2348","react-syntax-highlighter_languages_refractor_icon":"2413",c367bf37:"2422","react-syntax-highlighter_languages_refractor_markup":"2496","react-syntax-highlighter_languages_refractor_tsx":"2509","814f3328":"2535","react-syntax-highlighter_languages_refractor_qore":"2547","react-syntax-highlighter_languages_refractor_git":"2564","0297c59f":"2567",d02bd67e:"2572","react-syntax-highlighter_languages_refractor_erb":"2584",f989b58c:"2710","react-syntax-highlighter_languages_refractor_smalltalk":"2822","react-syntax-highlighter_languages_refractor_python":"2891","664ce118":"2905","react-syntax-highlighter_languages_refractor_velocity":"2980","react-syntax-highlighter_languages_refractor_inform7":"2996","react-syntax-highlighter_languages_refractor_nim":"3025","react-syntax-highlighter_languages_refractor_markupTemplating":"3047","9b79081a":"3057","1f391b9e":"3085",a6aa9e1f:"3089","react-syntax-highlighter_languages_refractor_xojo":"3116","react-syntax-highlighter_languages_refractor_hsts":"3140","992f23a0":"3186","react-syntax-highlighter_languages_refractor_haxe":"3224","react-syntax-highlighter_languages_refractor_roboconf":"3236","1df93b7f":"3237","react-syntax-highlighter_languages_refractor_csharp":"3318","react-syntax-highlighter_languages_refractor_swift":"3327","react-syntax-highlighter_languages_refractor_arduino":"3384","react-syntax-highlighter_languages_refractor_abap":"3412",f789302e:"3432","react-syntax-highlighter_languages_refractor_tt2":"3444","react-syntax-highlighter_languages_refractor_nsis":"3502","react-syntax-highlighter_languages_refractor_lisp":"3520","9e4087bc":"3608","react-syntax-highlighter_languages_refractor_json":"3657","react-syntax-highlighter_languages_refractor_bro":"3694","react-syntax-highlighter_languages_refractor_d":"3717","react-syntax-highlighter_languages_refractor_scala":"3818","react-syntax-highlighter_languages_refractor_keyman":"3819","react-syntax-highlighter_languages_refractor_nix":"3821","react-syntax-highlighter_languages_refractor_handlebars":"3846",f44e6046:"3934","react-syntax-highlighter_languages_refractor_actionscript":"3971","react-syntax-highlighter_languages_refractor_java":"3980","01a85c17":"4013","react-syntax-highlighter_languages_refractor_prolog":"4045","react-syntax-highlighter_languages_refractor_nginx":"4052","react-syntax-highlighter_languages_refractor_mizar":"4069","react-syntax-highlighter_languages_refractor_applescript":"4098",e8da6e74:"4155","react-syntax-highlighter_languages_refractor_perl":"4157","6b50e60a":"4268",f60e5cae:"4273","3d7dd6d6":"4281","react-syntax-highlighter_languages_refractor_kotlin":"4630","react-syntax-highlighter_languages_refractor_jsx":"4657","react-syntax-highlighter_languages_refractor_livescript":"4698","react-syntax-highlighter_languages_refractor_j":"4701","react-syntax-highlighter_languages_refractor_latex":"4732",f07bbfa7:"4865",bd8023de:"5004","react-syntax-highlighter_languages_refractor_css":"5008","react-syntax-highlighter_languages_refractor_n4js":"5014","react-syntax-highlighter_languages_refractor_ichigojam":"5056",c9d564ef:"5073","react-syntax-highlighter/refractor-core-import":"5082","react-syntax-highlighter_languages_refractor_scheme":"5085",b91a83ed:"5119","react-syntax-highlighter_languages_refractor_tcl":"5165","react-syntax-highlighter_languages_refractor_groovy":"5259","react-syntax-highlighter_languages_refractor_csp":"5299","react-syntax-highlighter_languages_refractor_julia":"5508","react-syntax-highlighter_languages_refractor_apacheconf":"5524","react-syntax-highlighter_languages_refractor_brainfuck":"5539","react-syntax-highlighter_languages_refractor_asm6502":"5696","68ef87ea":"5778","react-syntax-highlighter_languages_refractor_phpExtras":"5793","react-syntax-highlighter_languages_refractor_gedcom":"5867","0f8300a0":"5884","react-syntax-highlighter_languages_refractor_vbnet":"5896","react-syntax-highlighter_languages_refractor_less":"5951","5328e403":"5976",c144f25f:"5979","react-syntax-highlighter_languages_refractor_yaml":"5983","3f72396a":"6007","react-syntax-highlighter_languages_refractor_gherkin":"6051","react-syntax-highlighter_languages_refractor_ada":"6084",ccc49370:"6103","react-syntax-highlighter_languages_refractor_coffeescript":"6118","react-syntax-highlighter_languages_refractor_diff":"6247",d503c865:"6252","react-syntax-highlighter_languages_refractor_elixir":"6343","react-syntax-highlighter_languages_refractor_haml":"6487","react-syntax-highlighter_languages_refractor_ini":"6495","react-syntax-highlighter_languages_refractor_http":"6508","react-syntax-highlighter_languages_refractor_visualBasic":"6558","react-syntax-highlighter_languages_refractor_xeora":"6574","react-syntax-highlighter_languages_refractor_go":"6626","react-syntax-highlighter_languages_refractor_apl":"6670","react-syntax-highlighter_languages_refractor_hpkp":"6749","react-syntax-highlighter_languages_refractor_puppet":"6861",c377a04b:"6971","react-syntax-highlighter_languages_refractor_tap":"6975","react-syntax-highlighter_languages_refractor_sql":"7055","react-syntax-highlighter_languages_refractor_textile":"7097","4d9ae8a6":"7169","72e14192":"7239","react-syntax-highlighter_languages_refractor_nasm":"7253","react-syntax-highlighter_languages_refractor_javascript":"7279","react-syntax-highlighter_languages_refractor_scss":"7286","2b90ec83":"7381","50cff001":"7392","393be207":"7414","react-syntax-highlighter_languages_refractor_cssExtras":"7475","react-syntax-highlighter_languages_refractor_basic":"7504","5c28f3a1":"7555","react-syntax-highlighter_languages_refractor_makefile":"7576","95e8add9":"7646",f2da1fd8:"7655","react-syntax-highlighter_languages_refractor_oz":"7658","react-syntax-highlighter_languages_refractor_lolcode":"7719","react-syntax-highlighter_languages_refractor_dart":"7769","react-syntax-highlighter_languages_refractor_io":"7801","97e55e4f":"7830","react-syntax-highlighter_languages_refractor_pascal":"7833","react-syntax-highlighter_languages_refractor_elm":"7838","58207a97":"7869","react-syntax-highlighter_languages_refractor_r":"7882","react-syntax-highlighter_languages_refractor_django":"7899","react-syntax-highlighter_languages_refractor_clojure":"7966","8926b418":"7998","react-syntax-highlighter_languages_refractor_opencl":"8000","react-syntax-highlighter_languages_refractor_aspnet":"8030",b213740e:"8050","react-syntax-highlighter_languages_refractor_sas":"8067","react-syntax-highlighter_languages_refractor_lua":"8119",e466611a:"8243","react-syntax-highlighter_languages_refractor_autoit":"8333","react-syntax-highlighter_languages_refractor_objectivec":"8336","react-syntax-highlighter_languages_refractor_matlab":"8404","react-syntax-highlighter_languages_refractor_jolie":"8458","react-syntax-highlighter_languages_refractor_monkey":"8513","64b33ec2":"8563","4521f656":"8603","6875c492":"8610","3d1d8d9e":"8751","react-syntax-highlighter_languages_refractor_bash":"8765","react-syntax-highlighter_languages_refractor_reason":"8811","react-syntax-highlighter_languages_refractor_verilog":"8819","react-syntax-highlighter_languages_refractor_twig":"8827","react-syntax-highlighter_languages_refractor_plsql":"8840","react-syntax-highlighter_languages_refractor_graphql":"8921","react-syntax-highlighter_languages_refractor_c":"8950","react-syntax-highlighter_languages_refractor_ocaml":"8992","5dd4edc6":"9034","09d762c9":"9142","react-syntax-highlighter_languages_refractor_renpy":"9291","react-syntax-highlighter_languages_refractor_pure":"9315","react-syntax-highlighter_languages_refractor_typescript":"9461","1be78505":"9514","react-syntax-highlighter_languages_refractor_cpp":"9692","react-syntax-highlighter_languages_refractor_flow":"9742","react-syntax-highlighter_languages_refractor_processing":"9770","react-syntax-highlighter_languages_refractor_sass":"9797","react-syntax-highlighter_languages_refractor_markdown":"9835",d7d5b0cb:"9842","react-syntax-highlighter_languages_refractor_pug":"9851",fa619255:"9949","react-syntax-highlighter_languages_refractor_parigp":"9979"}[a]||a,_.p+_.u(a)},(()=>{var a={1303:0,532:0};_.f.j=(r,e)=>{var t=_.o(a,r)?a[r]:void 0;if(0!==t)if(t)e.push(t[2]);else if(/^(1303|532)$/.test(r))a[r]=0;else{var g=new Promise(((e,g)=>t=a[r]=[e,g]));e.push(t[2]=g);var h=_.p+_.u(r),c=new Error;_.l(h,(e=>{if(_.o(a,r)&&(0!==(t=a[r])&&(a[r]=void 0),t)){var g=e&&("load"===e.type?"missing":e.type),h=e&&e.target&&e.target.src;c.message="Loading chunk "+r+" failed.\n("+g+": "+h+")",c.name="ChunkLoadError",c.type=g,c.request=h,t[1](c)}}),"chunk-"+r,r)}},_.O.j=r=>0===a[r];var r=(r,e)=>{var t,g,h=e[0],c=e[1],i=e[2],s=0;if(h.some((r=>0!==a[r]))){for(t in c)_.o(c,t)&&(_.m[t]=c[t]);if(i)var l=i(_)}for(r&&r(e);s!function(t,h,e,j,s,n){t.hj=t.hj||function(){(t.hj.q=t.hj.q||[]).push(arguments)},t._hjSettings={hjid:3245180,hjsv:6},s=h.getElementsByTagName("head")[0],(n=h.createElement("script")).async=1,n.src="https://static.hotjar.com/c/hotjar-"+t._hjSettings.hjid+".js?sv="+t._hjSettings.hjsv,s.appendChild(n)}(window,document) - + + - + \ No newline at end of file diff --git a/blog/index.html b/blog/index.html index 64b53f5c3..533c15d14 100644 --- a/blog/index.html +++ b/blog/index.html @@ -14,8 +14,8 @@ - - + + @@ -27,7 +27,7 @@ Flyde takes a functional-reactive approach, embracing the style of modern applications. And while Flyde can be a great education tool, it is built with the full intent of becoming a production tool used by professional software teams.

Node-RED

Node-RED is a great tool. It helped exposed many engineers to the benefits of visual programming tools.
It has shown itself a great tool for building standalone home automation, and other IoT projects, but never became a tool developers use for more traditional and professional projects. Flyde is built to co-exist with current code bases, making it easier to cater to a wider audience of developers and projects.

NoFlo

NoFlo is perhaps the most similar project to Flyde available. It started 10 years ago and I think its main reason for not becoming popular was that it was ahead of its time. One main difference is the fact that NoFlo is decoupled from its visual editor - FlowHub which came years later via a highly covered Kickstarter campaign. I believe the decision to split the UI from the actual runtime comes from 2 reasons:

  1. NoFlo is heavily inspired by J. Paul Morrison's flow-based programming, which sees the value of looking at software as if it were nodes connected by wires even without a visual editor. While Flyde takes inspiration from the original FBP movement, it takes a more pragmatic and simple stance. The topic of Flow-Based Programming and Flyde deserves a blog post on its own, stay tuned :)
  2. Building rich browser applications a decade ago was much harder than today. The lack of libraries available, problematic browser support, and an immature ecosystem made it hard to build a browser-based editor that users will love.

Getting Started With Flyde

to get a feeling of how Flyde works, the best place to start is to visit the Flyde Playground!
It has some simple examples that showcase the visual editor, and what building a Flyde flow looks like.

The next step is to the checkout the tutorials section of this site to learn how to integrate Flyde into real-world projects

If you've read so far I'd appreciate showing support by starring the project and sending any feedback or comment via a GitHub issue or Flyde's Discord channel

Thanks and stay tuned for more blog posts!

Yours, Gabriel

- + \ No newline at end of file diff --git a/blog/introducing-flyde/index.html b/blog/introducing-flyde/index.html index a53d73020..482bb82cb 100644 --- a/blog/introducing-flyde/index.html +++ b/blog/introducing-flyde/index.html @@ -14,8 +14,8 @@ - - + + @@ -27,7 +27,7 @@ Flyde takes a functional-reactive approach, embracing the style of modern applications. And while Flyde can be a great education tool, it is built with the full intent of becoming a production tool used by professional software teams.

Node-RED

Node-RED is a great tool. It helped exposed many engineers to the benefits of visual programming tools.
It has shown itself a great tool for building standalone home automation, and other IoT projects, but never became a tool developers use for more traditional and professional projects. Flyde is built to co-exist with current code bases, making it easier to cater to a wider audience of developers and projects.

NoFlo

NoFlo is perhaps the most similar project to Flyde available. It started 10 years ago and I think its main reason for not becoming popular was that it was ahead of its time. One main difference is the fact that NoFlo is decoupled from its visual editor - FlowHub which came years later via a highly covered Kickstarter campaign. I believe the decision to split the UI from the actual runtime comes from 2 reasons:

  1. NoFlo is heavily inspired by J. Paul Morrison's flow-based programming, which sees the value of looking at software as if it were nodes connected by wires even without a visual editor. While Flyde takes inspiration from the original FBP movement, it takes a more pragmatic and simple stance. The topic of Flow-Based Programming and Flyde deserves a blog post on its own, stay tuned :)
  2. Building rich browser applications a decade ago was much harder than today. The lack of libraries available, problematic browser support, and an immature ecosystem made it hard to build a browser-based editor that users will love.

Getting Started With Flyde

to get a feeling of how Flyde works, the best place to start is to visit the Flyde Playground!
It has some simple examples that showcase the visual editor, and what building a Flyde flow looks like.

The next step is to the checkout the tutorials section of this site to learn how to integrate Flyde into real-world projects

If you've read so far I'd appreciate showing support by starring the project and sending any feedback or comment via a GitHub issue or Flyde's Discord channel

Thanks and stay tuned for more blog posts!

Yours, Gabriel

- + \ No newline at end of file diff --git a/blog/tags/flyde/index.html b/blog/tags/flyde/index.html index 9626d87c1..38fdffefc 100644 --- a/blog/tags/flyde/index.html +++ b/blog/tags/flyde/index.html @@ -14,8 +14,8 @@ - - + + @@ -27,7 +27,7 @@ Flyde takes a functional-reactive approach, embracing the style of modern applications. And while Flyde can be a great education tool, it is built with the full intent of becoming a production tool used by professional software teams.

Node-RED

Node-RED is a great tool. It helped exposed many engineers to the benefits of visual programming tools.
It has shown itself a great tool for building standalone home automation, and other IoT projects, but never became a tool developers use for more traditional and professional projects. Flyde is built to co-exist with current code bases, making it easier to cater to a wider audience of developers and projects.

NoFlo

NoFlo is perhaps the most similar project to Flyde available. It started 10 years ago and I think its main reason for not becoming popular was that it was ahead of its time. One main difference is the fact that NoFlo is decoupled from its visual editor - FlowHub which came years later via a highly covered Kickstarter campaign. I believe the decision to split the UI from the actual runtime comes from 2 reasons:

  1. NoFlo is heavily inspired by J. Paul Morrison's flow-based programming, which sees the value of looking at software as if it were nodes connected by wires even without a visual editor. While Flyde takes inspiration from the original FBP movement, it takes a more pragmatic and simple stance. The topic of Flow-Based Programming and Flyde deserves a blog post on its own, stay tuned :)
  2. Building rich browser applications a decade ago was much harder than today. The lack of libraries available, problematic browser support, and an immature ecosystem made it hard to build a browser-based editor that users will love.

Getting Started With Flyde

to get a feeling of how Flyde works, the best place to start is to visit the Flyde Playground!
It has some simple examples that showcase the visual editor, and what building a Flyde flow looks like.

The next step is to the checkout the tutorials section of this site to learn how to integrate Flyde into real-world projects

If you've read so far I'd appreciate showing support by starring the project and sending any feedback or comment via a GitHub issue or Flyde's Discord channel

Thanks and stay tuned for more blog posts!

Yours, Gabriel

- + \ No newline at end of file diff --git a/blog/tags/index.html b/blog/tags/index.html index 173964127..ae07c18da 100644 --- a/blog/tags/index.html +++ b/blog/tags/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/blog/tags/intro/index.html b/blog/tags/intro/index.html index 10f4e770a..14a591dad 100644 --- a/blog/tags/intro/index.html +++ b/blog/tags/intro/index.html @@ -14,8 +14,8 @@ - - + + @@ -27,7 +27,7 @@ Flyde takes a functional-reactive approach, embracing the style of modern applications. And while Flyde can be a great education tool, it is built with the full intent of becoming a production tool used by professional software teams.

Node-RED

Node-RED is a great tool. It helped exposed many engineers to the benefits of visual programming tools.
It has shown itself a great tool for building standalone home automation, and other IoT projects, but never became a tool developers use for more traditional and professional projects. Flyde is built to co-exist with current code bases, making it easier to cater to a wider audience of developers and projects.

NoFlo

NoFlo is perhaps the most similar project to Flyde available. It started 10 years ago and I think its main reason for not becoming popular was that it was ahead of its time. One main difference is the fact that NoFlo is decoupled from its visual editor - FlowHub which came years later via a highly covered Kickstarter campaign. I believe the decision to split the UI from the actual runtime comes from 2 reasons:

  1. NoFlo is heavily inspired by J. Paul Morrison's flow-based programming, which sees the value of looking at software as if it were nodes connected by wires even without a visual editor. While Flyde takes inspiration from the original FBP movement, it takes a more pragmatic and simple stance. The topic of Flow-Based Programming and Flyde deserves a blog post on its own, stay tuned :)
  2. Building rich browser applications a decade ago was much harder than today. The lack of libraries available, problematic browser support, and an immature ecosystem made it hard to build a browser-based editor that users will love.

Getting Started With Flyde

to get a feeling of how Flyde works, the best place to start is to visit the Flyde Playground!
It has some simple examples that showcase the visual editor, and what building a Flyde flow looks like.

The next step is to the checkout the tutorials section of this site to learn how to integrate Flyde into real-world projects

If you've read so far I'd appreciate showing support by starring the project and sending any feedback or comment via a GitHub issue or Flyde's Discord channel

Thanks and stay tuned for more blog posts!

Yours, Gabriel

- + \ No newline at end of file diff --git a/docs/StdLib/index.html b/docs/StdLib/index.html index 233f1199d..a0c202fb3 100644 --- a/docs/StdLib/index.html +++ b/docs/StdLib/index.html @@ -14,15 +14,15 @@ - - + +

Flyde Nodes Library

This is the documentation for the Flyde Nodes Library. It contains all the parts that are available in the @flyde/stdlib (which is copied to @flyde/runtime for convenience).

For simplicity, all parts of Flyde's standard library reside in the same package, and is organized into namespaces.

Available sections:

HTTP

IdDescriptionInputsOutputs
GET RequestPerforms a HTTP GET request to a URL and emits the response data
url: URL to fetch data from (required)
headers: Headers to send with the request (required-if-connected)
params: Query parameters to send with the request (required-if-connected)
data: The response data
POST RequestPerforms a HTTP POST request to a URL and emits the response data
url: URL to fetch data from (required)
headers: Headers to send with the request (required-if-connected)
params: Query parameters to send with the request (required-if-connected)
data: Data to send with the request (required-if-connected)
data: The response data
PUT RequestPerforms a HTTP PUT request to a URL and emits the response data
url: URL to fetch data from (required)
headers: Headers to send with the request (required-if-connected)
params: Query parameters to send with the request (required-if-connected)
data: Data to send with the request (required-if-connected)
data: The response data
RequestPerforms a HTTP request to a URL and emits the response data
url: URL to fetch data from (required)
method: HTTP method to use (required)
headers: Headers to send with the request (required-if-connected)
params: Query parameters to send with the request (required-if-connected)
data: Data to send with the request (required-if-connected)
data: The response data

Objects

IdDescriptionInputsOutputs
JSON ParseParses a JSON string into an object
json: JSON string to parse (required)
object: The parsed object
JSON StringifyStringifies an object into a JSON string
object: Object to stringify (required)
json: The stringified JSON
KeysEmits the keys of an object
object: Object to get keys of (required)
keys: The keys of object
Has own propertyChecks if object has property
object: Object to get keys of (required)
property: the property to search for (required)
true: The value is true
false: The value is false
ValuesEmits the values of an object
object: Object to get values of (required)
values: The values of object
EntriesEmits the entries of an object
object: Object to get entries of (required)
entries: The entries of object
From EntriesCreates an object from an array of entries
entries: Array of entries to create object from (required)
object: The created object
AssignAssigns properties from one or more objects to a target object
target: Target object to assign properties to (required)
sources: One or more objects to assign properties from (required)
object: The target object
Get AttributeGets an attribute from an object
object: Object to get attribute from (required)
attribute: Attribute to get (required)
value: The value of the attribute
Set AttributeSets an attribute on an object
object: Object to set attribute on (required)
attribute: Attribute to set (required)
value: Value to set attribute to (required)
object: The object with the attribute set
Delete AttributeDeletes an attribute from an object
object: Object to delete attribute from (required)
attribute: Attribute to delete (required)
object: The object with the attribute deleted
Property EqualsEmits the object to the "true" output if an object's property equals a value, otherwise emits to the "false" output
object: Object to check property of (required)
attribute: Attribute to check (required)
value: Value to check attribute against (required)
true: Emitted if the attribute equals the value
false: Emitted if the attribute does not equal the value

Numbers

IdDescriptionInputsOutputs
AddEmits the sum of two numbers
n1: First number to add (required)
n2: Second number to add (required)
sum: The sum of n1 and n2
SubtractEmits the difference of two numbers
n1: First number to subtract (required)
n2: Second number to subtract (required)
difference: The difference of n1 and n2
MultiplyEmits the product of two numbers
n1: First number to multiply (required)
n2: Second number to multiply (required)
product: The product of n1 and n2
DivideEmits the quotient of two numbers
n1: First number to divide (required)
n2: Second number to divide (required)
quotient: The quotient of n1 and n2
ModuloEmits the remainder of two numbers
n1: First number to divide (required)
n2: Second number to divide (required)
remainder: The remainder of n1 and n2
PowerEmits the power of two numbers
n1: Base number (required)
n2: Exponent (required)
power: The power of n1 and n2
Square RootEmits the square root of a number
n: Number to take the square root of (required)
root: The square root of n
Absolute ValueEmits the absolute value of a number
n: Number to take the absolute value of (required)
absolute: The absolute value of n
FloorEmits the floor of a number
n: Number to take the floor of (required)
floor: The floor of n
CeilingEmits the ceiling of a number
n: Number to take the ceiling of (required)
ceiling: The ceiling of n
RoundEmits the rounded value of a number
n: Number to round (required)
rounded: The rounded value of n
TruncateEmits the truncated value of a number
n: Number to truncate (required)
truncated: The truncated value of n
SinEmits the sine of an angle
angle: Angle in radians (required)
sine: The sine of angle
CosEmits the cosine of an angle
angle: Angle in radians (required)
cosine: The cosine of angle
MinEmits the minimum of two numbers
n1: First number (required)
n2: Second number (required)
min: The minimum of n1 and n2
MaxEmits the maximum of two numbers
n1: First number (required)
n2: Second number (required)
max: The maximum of n1 and n2
Parse IntEmits the integer value of a string
str: String to parse (required)
int: The integer value of str
Parse FloatEmits the float value of a string
str: String to parse (required)
float: The float value of str
To FixedEmits the specified number of decimal places of a number
number: Number to format (required)
places: Number of decimal places to format to (required)
fixed: The number with the specified number of decimal places
To ExponentialEmits the specified number of decimal places of a number in exponential notation
number: Number to format (required)
places: Number of decimal places to format to (required)
exponential: The number with the specified number of decimal places in exponential notation
To PrecisionEmits the specified number of significant figures of a number
number: Number to format (required)
places: Number of significant figures to format to (required)
precision: The number with the specified number of significant figures
Greater ThanEmits true if the first number is greater than the second
n1: First number (required)
n2: Second number (required)
result: true if n1 is greater than n2
Greater Than Or EqualEmits true if the first number is greater than or equal to the second
n1: First number (required)
n2: Second number (required)
result: true if n1 is greater than or equal to n2
Less ThanEmits true if the first number is less than the second
n1: First number (required)
n2: Second number (required)
result: true if n1 is less than n2
Less Than Or EqualEmits true if the first number is less than or equal to the second
n1: First number (required)
n2: Second number (required)
result: true if n1 is less than or equal to n2
Sum ListEmits the sum of a list of numbers
list: List of numbers (required)
sum: The sum of the numbers in list

Strings

IdDescriptionInputsOutputs
ConcatConcatenates two strings
a: String a (required)
b: String b (required)
value: Concatenated value
SplitSplits a string
string: String to split (required)
separator: Separator (required)
value: Splitted value
JoinJoins an array of strings
array: Array to join (required)
separator: Separator (required)
value: Joined value
ReplaceReplaces a string
string: String to replace (required)
searchValue: Value to search for (required)
replaceValue: Value to replace with (required)
value: Replaced value
TrimTrims a string
string: String to trim (required)
value: Trimmed value
To Lower CaseConverts a string to lower case
string: String to convert to lower case (required)
value: Converted value
To Upper CaseConverts a string to upper case
string: String to convert to upper case (required)
value: Converted value
SubstringReturns the node of the string between the start and end indexes
string: String to get substring from (required)
start: Start index (required)
end: End index (required)
value: Substring
LengthReturns the length of a string
string: String to get length from (required)
value: Length
Index OfReturns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex
string: String to search in (required)
searchValue: Value to search for (required)
fromIndex: Index to start searching from (required)
value: Index
Last Index OfReturns the index within the calling String object of the last occurrence of the specified value, or -1 if not found. The calling string is searched backward, starting at fromIndex
string: String to search in (required)
searchValue: Value to search for (required)
fromIndex: Index to start searching from (required)
value: Index
Char AtReturns the character at the specified index
string: String to get character from (required)
index: Index to get character from (required)
value: Character
To Kebab CaseConverts a string to kebab case
string: String to convert to kebab case (required)
value: Converted value
To Camel CaseConverts a string to camel case
string: String to convert to camel case (required)
value: Converted value
To Pascal CaseConverts a string to pascal case
string: String to convert to pascal case (required)
value: Converted value
To Snake CaseConverts a string to snake case
string: String to convert to snake case (required)
value: Converted value
To Title CaseConverts a string to title case
string: String to convert to title case (required)
value: Converted value
IncludesDetermines whether one string may be found within another string, returning true or false as appropriate
string: String to search in (required)
searchValue: Value to search for (required)
fromIndex: Index to start searching from (required)
value: Result
Starts WithDetermines whether a string begins with the characters of another string, returning true or false as appropriate
string: String to search in (required)
searchValue: Value to search for (required)
fromIndex: Index to start searching from (required)
value: Result
Ends WithDetermines whether a string ends with the characters of another string, returning true or false as appropriate
string: String to search in (required)
searchValue: Value to search for (required)
fromIndex: Index to start searching from (required)
value: Result
Is EmptyDetermines whether a string is empty
string: String to check (required)
value: Result
Match RegexDetermines whether a string matches a regular expression
string: String to check (required)
regex: Regular expression to match (required)
value: Result
Empty StringCreates an empty stringNone
string: The empty string

Control Flow

IdDescriptionInputsOutputs
Limit TimesItem will be emitted until the limit is reached
item: The item to emit (required)
times: The number of times to emit the item (required)
reset: Reset the counter (optional)
ok: undefined
Round Robin 3Item will be emitted to one of the three outputs in a round robin fashion
value: The value to emit (required)
r1: The first output in order to emit the value received. After emitting a value, it moves to "r2"'s turn.
r2: The second output in order to emit the value received. After emitting a value, it moves to "r3"'s turn.
r3: The third output in order to emit the value received. After emitting a value, it moves back to "r1"'s turn.
Round Robin 2Item will be emitted to one of the 2 outputs in a round robin fashion
value: The value to emit (required)
r1: The first output in order to emit the value received. After emitting a value, it moves to "r2"'s turn.
r2: The second output in order to emit the value received. After emitting a value, it moves to "r3"'s turn.
Round Robin 4Item will be emitted to one of the 4 outputs in a round robin fashion
value: The value to emit (required)
r1: The first output in order to emit the value received. After emitting a value, it moves to "r2"'s turn.
r2: The second output in order to emit the value received. After emitting a value, it moves to "r3"'s turn.
r3: The third output in order to emit the value received. After emitting a value, it moves to "r4"'s turn.
r4: The fourth output in order to emit the value received. After emitting a value, it moves back to "r1"'s turn.
PublishPublishes a value by a key to all listeners in the current flow. Use 'Subscribe' to listen to events.
key: A key to use to subscribe to values (required)
value: undefined (required)
None
SubscribeSubscribes to a value published by a key. Use 'Publish' to publish values.
key: A key to use to subscribe to values (required)
initial: If passed will be published has the first value (required-if-connected)
value: The value published by the key
Boolean SplitSplits a boolean value into two outputs
value: Boolean value (required)
trueValue: Value to emit if the input is true. Defaults to true (required-if-connected)
falseValue: Value to emit if the input is false. Defaults to false (required-if-connected)
true: The value is true
false: The value is false
Emit on TriggerEmits the value when the trigger input receives any value
value: The value to emit (required)
trigger: The trigger to emit the value (required)
result: The value emitted
Switch 3Switches between 3 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.
value: The value to switch on (required)
firstCase: The value to switch on for the first output (required)
secondCase: The value to switch on for the second output (required)
thirdCase: The value to switch on for the third output (required)
outputValue: The value to emit on the output. Defaults to 'value' (required-if-connected)
first: The value emitted if the input value is equal to the first case
second: The value emitted if the input value is equal to the second case
third: The value emitted if the input value is equal to the third case
default: The value emitted if the input value is not equal to any of the cases
Switch 2Switches between 2 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.
value: The value to switch on (required)
firstCase: The value to switch on for the first output (required)
secondCase: The value to switch on for the second output (required)
outputValue: The value to emit on the output. Defaults to 'value' (required-if-connected)
first: The value emitted if the input value is equal to the first case
second: The value emitted if the input value is equal to the second case
default: The value emitted if the input value is not equal to any of the cases
Switch 4Switches between 4 outputs based on the input value. If the value is not equal to any of the cases, the default output is used.
value: The value to switch on (required)
firstCase: The value to switch on for the first output (required)
secondCase: The value to switch on for the second output (required)
thirdCase: The value to switch on for the third output (required)
fourthCase: The value to switch on for the fourth output (required)
outputValue: The value to emit on the output. Defaults to 'value' (required-if-connected)
first: The value emitted if the input value is equal to the first case
second: The value emitted if the input value is equal to the second case
third: The value emitted if the input value is equal to the third case
fourth: The value emitted if the input value is equal to the fourth case
default: The value emitted if the input value is not equal to any of the cases
DelayDelays a value
value: Value to delay (required)
delay: Delay in milliseconds (required)
delayedValue: Delayed value
IntervalEmits a value every interval
value: Value to emit (required)
interval: Interval in milliseconds (required)
value: Emitted value
DebounceEmits the last value received after being idle for "wait" amount of milliseconds
value: The data that needs to be debounced (required)
wait: Time (in millis) to wait until 'value' is emitted (required) Default value - 250
result: The debounced value
ThrottleEmits the first value received after being idle for "wait" amount of milliseconds
value: The data that needs to be throttled (required)
wait: Time (in millis) to wait until 'value' is emitted (required) Default value - 250
result: The throttled value
Equals (Bool)Emits true if two values are equal (=== equality). Otherwise emits false.
a: First value (required)
b: Second value (required)
result: true if a is equal to b
EqualsEmits the value of "a" to output "true" if "a" is equal to "b". Otherwise emits the value of "a" to output "false".
a: First value (required)
b: Second value (required)
true: Emits the value of a if a is equal to b
false: Emits the value of a if a is not equal to b

Lists

IdDescriptionInputsOutputs
List LengthReturns the length of a list
list: List (required)
length: Length
List Is EmptyReturns true if the list is empty
list: List (required)
isEmpty: Is empty
Get List ElementReturns the element at the specified index
list: List (required)
index: Index (required)
element: Element
RepeatRepeats a value a number of times
value: Value to repeat (required)
times: How many times will the value be repeated (required)
list: List
List From 2Creates a list from two values
value1: First value (required)
value2: Second value (required)
list: List containing the 2 values
List From 3Creates a list from three values
value1: First value (required)
value2: Second value (required)
value3: Third value (required)
list: List containing all 3 values
List From 4Creates a list from four values
value1: First value (required)
value2: Second value (required)
value3: Third value (required)
value4: Fourth value (required)
list: List containing all 4 values
List From 5Creates a list from five values
value1: First value (required)
value2: Second value (required)
value3: Third value (required)
value4: Fourth value (required)
value5: Fifth value (required)
list: List containing all 5 values
Concat ListsConcatenates two lists
list1: First list (required)
list2: Second list (required)
list: Concatenated list
ReverseReverses a list
list: List (required)
reversed: Reversed list
Loop ListEmits all values in a list
list: The list to loop (required)
item: Will emit a value for each item in the list
index: Will emit the index of the item
length: Will emit the length of the list
Head and restReceives a list and emits two outputs: the first item and the rest of the list
list: The list (required)
head: The first item in the list
rest: The rest of the list
Split PairReceives a list with 2 items and emits two outputs: the first item and the second item
pair: The pair to split (required)
item1: The first item in the pair
item2: The second item in the pair
Split TripleReceives a list with 3 items and emits three outputs: the first item, the second item and the third item
triple: The triple (required)
item1: The first item in the triple
item2: The second item in the triple
item3: The third item in the triple
Split QuadrupleReceives a list with 4 items and emits four outputs: the first item, the second item, the third item and the fourth item
quadruple: The quadruple (required)
item1: The first item in the quadruple
item2: The second item in the quadruple
item3: The third item in the quadruple
item4: The fourth item in the quadruple
Accumulate Values by TriggerAccumulates values sent to the "value" input, until the "reset" input is triggered. Then it emits the accumulated values and resets the accumulator.
value: The value to accumulate (required)
reset: Resets the accumulator (required)
accumulated: The accumulated values
Accumulate Values by TimeAccumulates values sent to the "value" input. After the specified time it emits the accumulated values and resets the accumulator.
value: The value to accumulate (required)
time: Time to wait before emitting the accumulated values. Default is 200ms (required-if-connected) Default value - 200
accumulated: The accumulated values
Accumulate Values by CountAccumulates values sent to the "value" input. After the specified count it emits the accumulated values and resets the accumulator.
value: The value to accumulate (required)
count: Number of values to accumulate before emitting them (required)
accumulated: The accumulated values
Accumulate Some Values by CountAccumulates values sent to the "accept" input. Emits the list after the total items passed to both "accept" and "ignore" inputs reach the specified count.
accept: Values to accumulate (required)
ignore: Values to ignore (required)
count: Number of values to accumulate before emitting them (required)
accumulated: The accumulated accepted values
ignored: The accumulated ignored values
AppendAppends an item to a list
list: The list (required)
item: The item to append (required)
list: The resulting list
PrependPrepends an item to a list
list: The list (required)
item: The item to prepend (required)
list: The resulting list
RemoveRemoves an item from a list
list: The list (required)
item: The item to remove (required)
list: The resulting list
Remove AtRemoves an item from a list at the specified index
list: The list (required)
index: The index of the item to remove (required)
list: The resulting list
SliceReturns a slice of a list from the specified start index to the specified end index
list: The list (required)
start: The index to start slicing from (required)
end: The index to end slicing at (required)
list: The resulting list
FlattenFlattens a list of lists into a single list
list: The list of lists (required)
list: The resulting list

Console

IdDescriptionInputsOutputs
LogLogs a value to the console
value: Value to log (required)
None
ErrorLogs an error to the console
value: Value to log (required)
None

Dates

IdDescriptionInputsOutputs
NowReturns the current date and timeNone
now: Current date and time
Now StringReturns the current date and time as a stringNone
now: Current date and time
Now ISO StringReturns the current date and time as a string in ISO formatNone
now: Current date and time
Now Unix TimeReturns the current date and time as a Unix timeNone
now: Current date and time
Date From Unix TimeCreates a date from a Unix time
time: Unix time (required)
date: Date
Date From StringCreates a date from a string
string: String (required)
date: Date
Date From ISO StringCreates a date from an ISO string
string: String (required)
date: Date
Date To StringConverts a date to a string
date: Date (required)
string: String
Date To ISO StringConverts a date to an ISO string
date: Date (required)
string: String
Date To Unix TimeConverts a date to a Unix time
date: Date (required)
time: Unix time
Date To YearConverts a date to a year
date: Date (required)
year: Year
Month To DateConverts a date to a month
date: Date (required)
month: Month
Date To DayConverts a date to a day
date: Date (required)
day: Day
Date To HoursConverts a date to hours
date: Date (required)
hours: Hours
Date To MinutesConverts a date to minutes
date: Date (required)
minutes: Minutes
Date To SecondsConverts a date to seconds
date: Date (required)
seconds: Seconds
Date To MillisecondsConverts a date to milliseconds
date: Date (required)
milliseconds: Milliseconds
Date To Day Of WeekConverts a date to a day of the week
date: Date (required)
day: Day
Date To Timezone OffsetConverts a date to a timezone offset
date: Date (required)
offset: Offset

State

IdDescriptionInputsOutputs
Set Global StateSets a value in the global state
key: Key to set (required)
value: Value to set (required)
setValue: Value that was set
Get Global StateGets a value from the global state
key: Key to get (required)
defaultValue: Default value if key is not set (required-if-connected)
value: Value of the key

MongoDB

IdDescriptionInputsOutputs
ConnectConnects to a Mongo database and returns a client. Uses the "mongodb" package.
url: URL (required)
options: A Valid MongoClientOptions object (required)
connection: Mongo connected client
FindQueries a Mongo database. Find receives a valid "mongodb" FindOptions object.
connection: Mongo connection (required)
collection: Collection (required)
query: Query (required)
options: Options (required)
result:
FindOneQueries a Mongo database. FindOne receives a valid "mongodb" FindOneOptions object.
connection: Mongo connection (required)
collection: Collection (required)
query: Query (required)
options: Options (required)
result:
DisconnectDisconnects from a Mongo database
connection: Mongo connection (required)
None
InsertOneInserts one document into a Mongo database. InsertOne receives a valid "mongodb" InsertOneOptions object.
connection: Mongo connection (required)
collection: Collection (required)
document: Document (required)
options: Options (required)
result:
InsertManyInserts many documents into a Mongo database. InsertMany receives a valid "mongodb" InsertManyOptions object.
connection: Mongo connection (required)
collection: Collection (required)
documents: Documents (required)
options: Options (required)
result:
UpdateOneUpdates one document in a Mongo database. UpdateOne receives a valid "mongodb" UpdateOneOptions object.
connection: Mongo connection (required)
collection: Collection (required)
filter: Filter (required)
update: Update (required)
options: Options (required)
result:
UpdateManyUpdates many documents in a Mongo database. UpdateMany receives a valid "mongodb" UpdateManyOptions object.
connection: Mongo connection (required)
collection: Collection (required)
filter: Filter (required)
update: Update (required)
options: Options (required)
result:
DeleteOneDeletes one document in a Mongo database. DeleteOne receives a valid "mongodb" DeleteOneOptions object.
connection: Mongo connection (required)
collection: Collection (required)
filter: Filter (required)
options: Options (required)
result:
DeleteManyDeletes many documents in a Mongo database. DeleteMany receives a valid "mongodb" DeleteManyOptions object.
connection: Mongo connection (required)
collection: Collection name (required)
filter: Filter query (required)
options: Query options (required)
result:
CountDocumentsCounts documents in a Mongo database. CountDocuments receives a valid "mongodb" CountDocumentsOptions object.
connection: Mongo connection (required)
collection: Collection (required)
query: Query (required)
options: Options (required)
result:
CreateIndexCreates an index in a Mongo database. CreateIndex receives a valid "mongodb" CreateIndexesOptions object.
connection: Mongo connection (required)
collection: Collection (required)
fieldOrSpec: Field or spec (required)
options: Options (required)
result:
CreateIndexesCreates indexes in a Mongo database. CreateIndexes receives a valid "mongodb" CreateIndexesOptions object.
connection: Mongo connection (required)
collection: Collection (required)
indexes: Indexes (required)
options: Options (required)
result:

File System

IdDescriptionInputsOutputs
Read FileReads a file from the file system
path: Path to the file (required)
encoding: Encoding of the file (optional) Default value - utf8
contents: Contents of the file
Write FileWrites a file to the file system
path: Path to the file (required)
contents: Contents of the file (required)
encoding: Encoding of the file (optional) Default value - utf8
None
Append FileAppends a file to the file system
path: Path to the file (required)
contents: Contents of the file (required)
encoding: Encoding of the file (optional) Default value - utf8
None
Delete FileDeletes a file from the file system
path: Path to the file (required)
None
ExistsChecks if a file exists
path: Path to the file (required)
exists: Whether the file exists

Postgres

IdDescriptionInputsOutputs
ConnectConnects to a Postgres database and returns a client. Uses the "pg" package.
host: Host (required)
port: Port (required)
database: Database (required)
user: User (required)
password: Password (required)
connection: Postgres connected client
DisconnectDisconnects from a Postgres database
connection: Postgres connection (required)
None
QueryQueries a Postgres database. Query receives a valid "pg" QueryConfig object.
connection: Postgres connection (required)
query: Query (required)
result: valid "pg" QueryConfig object
- + \ No newline at end of file diff --git a/docs/Tutorials/code-parts/index.html b/docs/Tutorials/code-parts/index.html index ffb27903f..d9e84ce6e 100644 --- a/docs/Tutorials/code-parts/index.html +++ b/docs/Tutorials/code-parts/index.html @@ -14,8 +14,8 @@ - - + + @@ -23,7 +23,7 @@

[ WIP ] Creating Custom Code Nodes with Flyde

In this tutorial, we'll guide you step-by-step through creating a custom code node using Flyde.
We'll wrap the validator npm package into a Flyde code node that validates email addresses, and use it in a visual flow by running it with the Flyde extension.

Prerequisites

  • Visual Studio Code installed.
  • Flyde extension installed in Visual Studio Code.

Step 1: Set up a new project

Create a new directory for your project and open it in Visual Studio Code. Initialize a new npm project by running npm init -y in the terminal.

Step 2: Install the needed packages

  1. Install the validator package by running npm install validator in the terminal. This package will be used to validate the email address.
  2. Install the @flyde/core package by running npm install @flyde/core in the terminal (for the code node interface).

Step 3: Create a new Flyde flow

  1. Right click on the VSCode's sidebar -> "Flyde: New Visual Flow"
  2. Name your flow "Validator Example" and choose the "Blank" template
  3. You should now see a Flyde flow editor tab inside your IDE

[ Screenshot of the Flyde panel with a new flow ]

Step 4: Create a custom code node

Create a new file, call it "EmailValidator.flyde.ts" and add the following code:

import { CodeNode } from '@flyde/core';

export const validatorNode: CodeNode = {
id: 'Email Validator',
description: 'Validates an email address',
inputs: {
email: {
description: 'Email address to validate',
},
},
outputs: {
isValid: {
description: 'Whether the email is valid',
},
},
fn: async (inputs, outputs) => {
// logic will go here
},
};

Important: Flyde will auto-detect valid code nodes by searching for ".flyde.ts" or ".flyde.js" files in your project, so make sure to name your file accordingly.

[ Screenshot of the custom code node file ]

Step 5: Add the validator package to the custom code node

  1. In the generated code node file (EmailValidator.flyde.ts), import the validator package by adding the following line at the top: import validator from 'validator';
  2. Change the implementation of the fn function to the following:
fn: (inputs, outputs) => {
const isValid = validator.isEmail(inputs.email);
outputs.isValid.next(isValid);
},

Flyde will make all inputs available as properties on the inputs object, and all outputs available as properties on the outputs object. The next function on the output will emit the value to the next node in the flow.

[ Screenshot of the custom code node file with the changes ]

Step 6: Add the custom code node to the flow

  1. Open the flow you've created earlier.
  2. Open the "add node" menu by clicking on the "+" button in the right actions menu of the flow editor.
  3. Search for "Email Validator" and click on the "Add" button.

[ Screenshot of the flow editor with the custom code node added ]

Step 7: Create the email validation flow

  1. Add a main input to the flow by right-clicking the flow editor, and choosing "New input"
  2. Name the input "value"
  3. Connect that main input to the "Email Validator" node

[ Screenshot of the completed flow with all nodes connected ]

Step 8: Run the flow

  1. Click on the "Run flow" button in the actions menu.
  2. Enter a test email address in the "value" input node and click "Run".
  3. Hover over the "isValid" output node to see the result. You can also see it in the VSCode "Flyde" output channel.

[ Gif of the flow running with the test email address ]

That's it! You've successfully created a custom code node using the validator npm package and used it in a Flyde flow. Experiment with other npm packages and build more complex flows using Flyde's visual flow-based programming interface.

Next steps

Before moving on to the next tutorial, I highly recommend you to try tinkering with this example:

  • allow passing a second, optional parameter to the code node to specify the validation options that the validator package supports.
  • explore the "defaultStyle" property of the CodeNode interface and try making your node pop-out.
  • Try adding a list of email addresses, a loop node and a delay and see how you can validate a list of email addresses.
  • package that node into a separate npm package and publish it to npm! See [/packages] for more info.

If you have any feedback or issue please open a Github issue or ping us on Discord.

- + \ No newline at end of file diff --git a/docs/Tutorials/hello-world-with-flyde/index.html b/docs/Tutorials/hello-world-with-flyde/index.html index dd9f00680..5b843c89e 100644 --- a/docs/Tutorials/hello-world-with-flyde/index.html +++ b/docs/Tutorials/hello-world-with-flyde/index.html @@ -14,8 +14,8 @@ - - + + @@ -30,7 +30,7 @@ A connection - a connection connects a component's output pin to another's input pin, creating our control flow and logic
Main flow input/output pin - just like each component has it's inputs and outputs, so does the flow itself. Actually, a flow is just like any another component! Main inputs and outputs are the flow's API to the external world, while the components inside are it's implementation detail

board overview

Step 4: Working with the flow editor

Now it's time to do some changes! We're gonna remove the default placeholder content and replace it with an component that emits a string.

  1. click on the "Your logic here!" node and press delete to remove it from the board
  2. right click the board and select "New value"
  3. Type in "Hello, Flyde!" (make sure it's surrounded by quotes so it's a valid string) and click the "save" button
  4. Now connect the "r" output pin to the "result" flow's output pin by first clicking on the "r" pin and then on the result (or vice-versa)
  5. Don't forget to save (using regular VSCode controls)

image

Step 5: Running your flow from the code

Now we're going to connect the Flyde flow you just built to the JS code in index.js. Using the loadFlow function from @flyde/runtime, we'll transform our visual flow into a regular function that will trigger it and log the result back to the console.

  1. Open index.js
  2. Paste the following code:
const { loadFlow } = require("@flyde/runtime");
const executeFlow = loadFlow("HelloFlyde.flyde");

const { result } = executeFlow(); // executeFlow can also receive inputs, and other advanced configuration, more on that in the next steps
result.then(({ message }) => console.log(message));
  1. using your terminal (VSCode's embedded one works perfect for this case) run node index.js
  2. You should see "Hello, Flyde!" in your console!

Did you notice the visual feedback when it ran? Flyde's runtime connects to a socket-based debugger in the IDE to allow new ways of debugging and troubleshooting programs! You can also inspect the inputs and outputs to learn about the data that passed through them.

Step 6: Passing arguments from code to the flow

Now we're gonna tweak our example to receive input from the JS code, as an example of how flows can not only integrate to the output but also the input. Also, you'll see how "inline value" components can expose arguments that will turn into visual inputs.

  1. Double click the "Hello, Flyde!" component to open up the inline value editor
  2. Type in `Hello, ${inputs.name}!`. Node we're using the backtick to allow for JS template literals.
  3. You should now see a new input pin exposed, named "name". Any usage of the special inputs object will expose new input pins that serve as arguments to our component. Cool, right?
  4. Now right click the board and click on "New input", call it name. This creates a new input for the flow we're editing
  5. connect the new input created to the "name" input of the our inline value component
  6. In index.js, Add your name to the executeFlow function as following:
executeFlow({name: 'Your awesome name here'})
.result.then(({message}) => console.log(message))
  1. In your terminal, run node index.js to see the changes live!

image

Congratulations! You've just finished the first Flyde tutorial ✨

Before moving on to the next tutorial, I highly recommend you to try tinkering with this example:

  • Add another input to your message
  • rename the "message" main output pin to say "greeting"
  • add another output and the same value to it
  • Mega bonus points: create a second flow and use it in your first one 🤯 adding new nodes is possible by double clicking the board and searching for a flow

If you have any feedback or issue please open a Github issue or ping us on Discord.

- + \ No newline at end of file diff --git a/docs/api-reference/classes/NodeInstanceError/index.html b/docs/api-reference/classes/NodeInstanceError/index.html index ab1c145c6..3092dee9a 100644 --- a/docs/api-reference/classes/NodeInstanceError/index.html +++ b/docs/api-reference/classes/NodeInstanceError/index.html @@ -14,14 +14,14 @@ - - + +

Class: NodeInstanceError

Hierarchy

  • Error

    NodeInstanceError

Constructors

constructor

new NodeInstanceError(error, fullInsIdsPath, nodeId)

Parameters

NameType
errorunknown
fullInsIdsPathstring
nodeIdstring

Overrides

Error.constructor

Defined in

core/src/node/node-instance-error.ts:5

Properties

fullInsIdsPath

fullInsIdsPath: string

Defined in

core/src/node/node-instance-error.ts:2


message

message: string

Inherited from

Error.message

Defined in

node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es5.d.ts:1054


name

name: string

Inherited from

Error.name

Defined in

node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es5.d.ts:1053


nodeId

nodeId: string

Defined in

core/src/node/node-instance-error.ts:3


stack

Optional stack: string

Inherited from

Error.stack

Defined in

node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es5.d.ts:1055

node_modules/.pnpm/@types+node@10.17.60/node_modules/@types/node/globals.d.ts:127


prepareStackTrace

Static Optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any

Type declaration

▸ (err, stackTraces): any

Optional override for formatting stack traces

Parameters
NameType
errError
stackTracesCallSite[]
Returns

any

See

https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces

Inherited from

Error.prepareStackTrace

Defined in

node_modules/.pnpm/@types+node@10.17.60/node_modules/@types/node/globals.d.ts:140


stackTraceLimit

Static stackTraceLimit: number

Inherited from

Error.stackTraceLimit

Defined in

node_modules/.pnpm/@types+node@10.17.60/node_modules/@types/node/globals.d.ts:142

Methods

captureStackTrace

Static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

NameType
targetObjectObject
constructorOpt?Function

Returns

void

Inherited from

Error.captureStackTrace

Defined in

node_modules/.pnpm/@types+node@10.17.60/node_modules/@types/node/globals.d.ts:133

- + \ No newline at end of file diff --git a/docs/api-reference/classes/PartError/index.html b/docs/api-reference/classes/PartError/index.html index 4ac61afa8..3756c1a2e 100644 --- a/docs/api-reference/classes/PartError/index.html +++ b/docs/api-reference/classes/PartError/index.html @@ -14,14 +14,14 @@ - - + +

Class: PartError

Hierarchy

  • Error

    PartError

Constructors

constructor

new PartError(message?)

Parameters

NameType
message?string

Inherited from

Error.constructor

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1059

Properties

fullInsIdPath

fullInsIdPath: string

Defined in

core/src/execute/index.ts:477


message

message: string

Inherited from

Error.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1054


name

name: string

Inherited from

Error.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1053


partId

partId: string

Defined in

core/src/execute/index.ts:478


stack

Optional stack: string

Inherited from

Error.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1055

core/node_modules/@types/node/globals.d.ts:127


prepareStackTrace

Static Optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any

Type declaration

▸ (err, stackTraces): any

Optional override for formatting stack traces

See

https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces

Parameters
NameType
errError
stackTracesCallSite[]
Returns

any

Inherited from

Error.prepareStackTrace

Defined in

core/node_modules/@types/node/globals.d.ts:140


stackTraceLimit

Static stackTraceLimit: number

Inherited from

Error.stackTraceLimit

Defined in

core/node_modules/@types/node/globals.d.ts:142

Methods

captureStackTrace

Static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

NameType
targetObjectObject
constructorOpt?Function

Returns

void

Inherited from

Error.captureStackTrace

Defined in

core/node_modules/@types/node/globals.d.ts:133

- + \ No newline at end of file diff --git a/docs/api-reference/classes/PartInstanceError/index.html b/docs/api-reference/classes/PartInstanceError/index.html index 333449899..1083e9d1c 100644 --- a/docs/api-reference/classes/PartInstanceError/index.html +++ b/docs/api-reference/classes/PartInstanceError/index.html @@ -14,14 +14,14 @@ - - + +

Class: PartInstanceError

Hierarchy

  • Error

    PartInstanceError

Constructors

constructor

new PartInstanceError(error, fullInsIdsPath, partId)

Parameters

NameType
errorunknown
fullInsIdsPathstring
partIdstring

Overrides

Error.constructor

Defined in

core/src/part/part-instance-error.ts:5

Properties

fullInsIdsPath

fullInsIdsPath: string

Defined in

core/src/part/part-instance-error.ts:2


message

message: string

Inherited from

Error.message

Defined in

node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/lib/lib.es5.d.ts:1054


name

name: string

Inherited from

Error.name

Defined in

node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/lib/lib.es5.d.ts:1053


partId

partId: string

Defined in

core/src/part/part-instance-error.ts:3


stack

Optional stack: string

Inherited from

Error.stack

Defined in

node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/lib/lib.es5.d.ts:1055

node_modules/.pnpm/@types+node@10.17.58/node_modules/@types/node/globals.d.ts:127


prepareStackTrace

Static Optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any

Type declaration

▸ (err, stackTraces): any

Optional override for formatting stack traces

See

https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces

Parameters
NameType
errError
stackTracesCallSite[]
Returns

any

Inherited from

Error.prepareStackTrace

Defined in

node_modules/.pnpm/@types+node@10.17.58/node_modules/@types/node/globals.d.ts:140


stackTraceLimit

Static stackTraceLimit: number

Inherited from

Error.stackTraceLimit

Defined in

node_modules/.pnpm/@types+node@10.17.58/node_modules/@types/node/globals.d.ts:142

Methods

captureStackTrace

Static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

NameType
targetObjectObject
constructorOpt?Function

Returns

void

Inherited from

Error.captureStackTrace

Defined in

node_modules/.pnpm/@types+node@10.17.58/node_modules/@types/node/globals.d.ts:133

- + \ No newline at end of file diff --git a/docs/api-reference/enums/DataShapeType/index.html b/docs/api-reference/enums/DataShapeType/index.html index e1b6f1d98..2100ec25c 100644 --- a/docs/api-reference/enums/DataShapeType/index.html +++ b/docs/api-reference/enums/DataShapeType/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/enums/DebuggerEventType/index.html b/docs/api-reference/enums/DebuggerEventType/index.html index 933ca92d4..54e65bc85 100644 --- a/docs/api-reference/enums/DebuggerEventType/index.html +++ b/docs/api-reference/enums/DebuggerEventType/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/enums/InlineValueNodeType/index.html b/docs/api-reference/enums/InlineValueNodeType/index.html index 0fd4a87e4..18b29bef4 100644 --- a/docs/api-reference/enums/InlineValueNodeType/index.html +++ b/docs/api-reference/enums/InlineValueNodeType/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/enums/InlineValuePartType/index.html b/docs/api-reference/enums/InlineValuePartType/index.html index df447aa0f..0a996b018 100644 --- a/docs/api-reference/enums/InlineValuePartType/index.html +++ b/docs/api-reference/enums/InlineValuePartType/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/index.html b/docs/api-reference/index.html index 0f69ef6d7..0ca83d99c 100644 --- a/docs/api-reference/index.html +++ b/docs/api-reference/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/interfaces/BaseDebuggerData/index.html b/docs/api-reference/interfaces/BaseDebuggerData/index.html index bf11c0206..003010640 100644 --- a/docs/api-reference/interfaces/BaseDebuggerData/index.html +++ b/docs/api-reference/interfaces/BaseDebuggerData/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/interfaces/BaseNode/index.html b/docs/api-reference/interfaces/BaseNode/index.html index f938bfcc1..428796f03 100644 --- a/docs/api-reference/interfaces/BaseNode/index.html +++ b/docs/api-reference/interfaces/BaseNode/index.html @@ -14,8 +14,8 @@ - - + + @@ -26,7 +26,7 @@ It can be convenient to show the time input in the instance itself so it shows "Delay 500ms" instead of "Delay" (in the case 500 is the static value of time)

{
...,
customViewCode: `{{#if inputs.time}}
Delay {{inputs.time}} ms
{{else}}
Delay
{{/if}}`
}

Defined in

core/src/node/node.ts:155


defaultStyle

Optional defaultStyle: NodeStyle

All instances of this node will inherit the default style if it is supplied. See NodeStyle for the full options supported

Defined in

core/src/node/node.ts:160


description

Optional description: string

Is displayed in the visual editor and used to search for nodes.

Defined in

core/src/node/node.ts:84


id

id: string

Node's unique id. instances refer use this to refer to the correct node

Defined in

core/src/node/node.ts:80


inputs

inputs: Record<string, InputPin>

A pin on a node that receives data. Each node can have zero or more input pins.

Example for the inputs of a mathematical multiplier node:

{
multiplicand: { description: "The number to be multiplied" },
multiplier: { description: "The number with which we multiply" },
}

Defined in

core/src/node/node.ts:100


namespace

Optional namespace: string

TBD

Defined in

core/src/node/node.ts:117


outputs

outputs: Record<string, OutputPin>

A pin on a node that sends data. Each node can have zero or more output pins. For example, a "Split array" node might have one input pin for an array and two output pins for the first and second halves of the array:

Example

{
'first half': { description: "The first half of the array" },
'second half': { description: "The second half of the array" },
}

Defined in

core/src/node/node.ts:113


reactiveInputs

Optional reactiveInputs: string[]

Deprecated

  • TBD

Defined in

core/src/node/node.ts:135


searchKeywords

Optional searchKeywords: string[]

A list of keywords that can be used to search for the node. Useful for node that users might search using different words.

Defined in

core/src/node/node.ts:88

- + \ No newline at end of file diff --git a/docs/api-reference/interfaces/BasePart/index.html b/docs/api-reference/interfaces/BasePart/index.html index 0bec05e1b..ee871c197 100644 --- a/docs/api-reference/interfaces/BasePart/index.html +++ b/docs/api-reference/interfaces/BasePart/index.html @@ -14,8 +14,8 @@ - - + + @@ -26,7 +26,7 @@ It can be convenient to show the time input in the instance itself so it shows "Delay 500ms" instead of "Delay" (in the case 500 is the static value of time)

{
...,
customViewCode: "<% if (inputs.time) { %> Delay <%- inputs.time %> ms <% } else { %> Delay <% } %>",
}

Defined in

core/src/part/part.ts:151


defaultStyle

Optional defaultStyle: PartStyle

All instances of this part will inherit the default style if it is supplied. See PartStyle for the full options supported

Defined in

core/src/part/part.ts:156


description

Optional description: string

Is displayed in the visual editor and used to search for parts.

Defined in

core/src/part/part.ts:84


id

id: string

Part's unique id. instances refer use this to refer to the correct part

Defined in

core/src/part/part.ts:80


inputs

inputs: Record<string, InputPin>

A pin on a part that receives data. Each part can have zero or more input pins.

Example for the inputs of a mathematical multiplier part:

{
multiplicand: { description: "The number to be multiplied" },
multiplier: { description: "The number with which we multiply" },
}

Defined in

core/src/part/part.ts:100


namespace

Optional namespace: string

TBD

Defined in

core/src/part/part.ts:117


outputs

outputs: Record<string, OutputPin>

A pin on a part that sends data. Each part can have zero or more output pins. For example, a "Split array" part might have one input pin for an array and two output pins for the first and second halves of the array:

Example

{
'first half': { description: "The first half of the array" },
'second half': { description: "The second half of the array" },
}

Defined in

core/src/part/part.ts:113


reactiveInputs

Optional reactiveInputs: string[]

Deprecated

  • TBD

Defined in

core/src/part/part.ts:135


searchKeywords

Optional searchKeywords: string[]

A list of keywords that can be used to search for the part. Useful for parts that users might search using different words.

Defined in

core/src/part/part.ts:88

- + \ No newline at end of file diff --git a/docs/api-reference/interfaces/BasePinData/index.html b/docs/api-reference/interfaces/BasePinData/index.html index 734e1259d..3f7cdb2bb 100644 --- a/docs/api-reference/interfaces/BasePinData/index.html +++ b/docs/api-reference/interfaces/BasePinData/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/interfaces/CodeNode/index.html b/docs/api-reference/interfaces/CodeNode/index.html index 28be9017f..59d56e18d 100644 --- a/docs/api-reference/interfaces/CodeNode/index.html +++ b/docs/api-reference/interfaces/CodeNode/index.html @@ -14,8 +14,8 @@ - - + + @@ -27,7 +27,7 @@ See NodeStyle for the full options supported

Inherited from

BaseNode.defaultStyle

Defined in

core/src/node/node.ts:160


description

Optional description: string

Is displayed in the visual editor and used to search for nodes.

Inherited from

BaseNode.description

Defined in

core/src/node/node.ts:84


fn

Optional fn: RunNodeFunction

Deprecated

use ['run'] instead

Defined in

core/src/node/node.ts:173


id

id: string

Node's unique id. instances refer use this to refer to the correct node

Inherited from

BaseNode.id

Defined in

core/src/node/node.ts:80


inputs

inputs: Record<string, InputPin>

A pin on a node that receives data. Each node can have zero or more input pins.

Example for the inputs of a mathematical multiplier node:

{
multiplicand: { description: "The number to be multiplied" },
multiplier: { description: "The number with which we multiply" },
}

Inherited from

BaseNode.inputs

Defined in

core/src/node/node.ts:100


namespace

Optional namespace: string

TBD

Inherited from

BaseNode.namespace

Defined in

core/src/node/node.ts:117


outputs

outputs: Record<string, OutputPin>

A pin on a node that sends data. Each node can have zero or more output pins. For example, a "Split array" node might have one input pin for an array and two output pins for the first and second halves of the array:

Example

{
'first half': { description: "The first half of the array" },
'second half': { description: "The second half of the array" },
}

Inherited from

BaseNode.outputs

Defined in

core/src/node/node.ts:113


reactiveInputs

Optional reactiveInputs: string[]

Deprecated

  • TBD

Inherited from

BaseNode.reactiveInputs

Defined in

core/src/node/node.ts:135


run

run: RunNodeFunction

This function will run as soon as the node's inputs are satisfied. It has access to the nodes inputs values, and output pins. See RunNodeFunction for more information.

Defined in

core/src/node/node.ts:169


searchKeywords

Optional searchKeywords: string[]

A list of keywords that can be used to search for the node. Useful for node that users might search using different words.

Inherited from

BaseNode.searchKeywords

Defined in

core/src/node/node.ts:88

- + \ No newline at end of file diff --git a/docs/api-reference/interfaces/CodePart/index.html b/docs/api-reference/interfaces/CodePart/index.html index 01b76b70c..b8d6a8abc 100644 --- a/docs/api-reference/interfaces/CodePart/index.html +++ b/docs/api-reference/interfaces/CodePart/index.html @@ -14,8 +14,8 @@ - - + + @@ -27,7 +27,7 @@ See PartStyle for the full options supported

Inherited from

BasePart.defaultStyle

Defined in

core/src/part/part.ts:156


description

Optional description: string

Is displayed in the visual editor and used to search for parts.

Inherited from

BasePart.description

Defined in

core/src/part/part.ts:84


fn

Optional fn: RunPartFunction

Deprecated

use ['run'] instead

Defined in

core/src/part/part.ts:169


id

id: string

Part's unique id. instances refer use this to refer to the correct part

Inherited from

BasePart.id

Defined in

core/src/part/part.ts:80


inputs

inputs: Record<string, InputPin>

A pin on a part that receives data. Each part can have zero or more input pins.

Example for the inputs of a mathematical multiplier part:

{
multiplicand: { description: "The number to be multiplied" },
multiplier: { description: "The number with which we multiply" },
}

Inherited from

BasePart.inputs

Defined in

core/src/part/part.ts:100


namespace

Optional namespace: string

TBD

Inherited from

BasePart.namespace

Defined in

core/src/part/part.ts:117


outputs

outputs: Record<string, OutputPin>

A pin on a part that sends data. Each part can have zero or more output pins. For example, a "Split array" part might have one input pin for an array and two output pins for the first and second halves of the array:

Example

{
'first half': { description: "The first half of the array" },
'second half': { description: "The second half of the array" },
}

Inherited from

BasePart.outputs

Defined in

core/src/part/part.ts:113


reactiveInputs

Optional reactiveInputs: string[]

Deprecated

  • TBD

Inherited from

BasePart.reactiveInputs

Defined in

core/src/part/part.ts:135


run

run: RunPartFunction

This function will run as soon as the part's inputs are satisfied. It has access to the parts inputs values, and output pins. See RunPartFunction for more information.

Defined in

core/src/part/part.ts:165


searchKeywords

Optional searchKeywords: string[]

A list of keywords that can be used to search for the part. Useful for parts that users might search using different words.

Inherited from

BasePart.searchKeywords

Defined in

core/src/part/part.ts:88

- + \ No newline at end of file diff --git a/docs/api-reference/interfaces/DynamicOutput/index.html b/docs/api-reference/interfaces/DynamicOutput/index.html index 4fd4346ed..0a74eaed8 100644 --- a/docs/api-reference/interfaces/DynamicOutput/index.html +++ b/docs/api-reference/interfaces/DynamicOutput/index.html @@ -14,8 +14,8 @@ - - + + @@ -24,7 +24,7 @@ to create customize Observer-side logic of the Subject and conceal it from code that uses the Observable.

Returns

Observable<any>

Observable that the Subject casts to

Inherited from

Subject.asObservable

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Subject.d.ts:48


complete

complete(): void

Returns

void

Inherited from

Subject.complete

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Subject.d.ts:36


error

error(err): void

Parameters

NameType
errany

Returns

void

Inherited from

Subject.error

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Subject.d.ts:35


forEach

forEach(next, promiseCtor?): Promise<void>

Parameters

NameTypeDescription
next(value: any) => voida handler for each value emitted by the observable
promiseCtor?PromiseConstructorLikea constructor function used to instantiate the Promise

Returns

Promise<void>

a promise that either resolves on observable completion or rejects with the handled error

Method

forEach

Inherited from

Subject.forEach

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:64


lift

lift<R>(operator): Observable<R>

Type parameters

Name
R

Parameters

NameType
operatorOperator<any, R>

Returns

Observable<R>

Inherited from

Subject.lift

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Subject.d.ts:33


next

next(value?): void

Parameters

NameType
value?any

Returns

void

Inherited from

Subject.next

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Subject.d.ts:34


pipe

pipe(): Observable<any>

Returns

Observable<any>

Inherited from

Subject.pipe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:77

pipe<A>(op1): Observable<A>

Type parameters

Name
A

Parameters

NameType
op1OperatorFunction<any, A>

Returns

Observable<A>

Inherited from

Subject.pipe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:78

pipe<A, B>(op1, op2): Observable<B>

Type parameters

Name
A
B

Parameters

NameType
op1OperatorFunction<any, A>
op2OperatorFunction<A, B>

Returns

Observable<B>

Inherited from

Subject.pipe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:79

pipe<A, B, C>(op1, op2, op3): Observable<C>

Type parameters

Name
A
B
C

Parameters

NameType
op1OperatorFunction<any, A>
op2OperatorFunction<A, B>
op3OperatorFunction<B, C>

Returns

Observable<C>

Inherited from

Subject.pipe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:80

pipe<A, B, C, D>(op1, op2, op3, op4): Observable<D>

Type parameters

Name
A
B
C
D

Parameters

NameType
op1OperatorFunction<any, A>
op2OperatorFunction<A, B>
op3OperatorFunction<B, C>
op4OperatorFunction<C, D>

Returns

Observable<D>

Inherited from

Subject.pipe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:81

pipe<A, B, C, D, E>(op1, op2, op3, op4, op5): Observable<E>

Type parameters

Name
A
B
C
D
E

Parameters

NameType
op1OperatorFunction<any, A>
op2OperatorFunction<A, B>
op3OperatorFunction<B, C>
op4OperatorFunction<C, D>
op5OperatorFunction<D, E>

Returns

Observable<E>

Inherited from

Subject.pipe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:82

pipe<A, B, C, D, E, F>(op1, op2, op3, op4, op5, op6): Observable<F>

Type parameters

Name
A
B
C
D
E
F

Parameters

NameType
op1OperatorFunction<any, A>
op2OperatorFunction<A, B>
op3OperatorFunction<B, C>
op4OperatorFunction<C, D>
op5OperatorFunction<D, E>
op6OperatorFunction<E, F>

Returns

Observable<F>

Inherited from

Subject.pipe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:83

pipe<A, B, C, D, E, F, G>(op1, op2, op3, op4, op5, op6, op7): Observable<G>

Type parameters

Name
A
B
C
D
E
F
G

Parameters

NameType
op1OperatorFunction<any, A>
op2OperatorFunction<A, B>
op3OperatorFunction<B, C>
op4OperatorFunction<C, D>
op5OperatorFunction<D, E>
op6OperatorFunction<E, F>
op7OperatorFunction<F, G>

Returns

Observable<G>

Inherited from

Subject.pipe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:84

pipe<A, B, C, D, E, F, G, H>(op1, op2, op3, op4, op5, op6, op7, op8): Observable<H>

Type parameters

Name
A
B
C
D
E
F
G
H

Parameters

NameType
op1OperatorFunction<any, A>
op2OperatorFunction<A, B>
op3OperatorFunction<B, C>
op4OperatorFunction<C, D>
op5OperatorFunction<D, E>
op6OperatorFunction<E, F>
op7OperatorFunction<F, G>
op8OperatorFunction<G, H>

Returns

Observable<H>

Inherited from

Subject.pipe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:85

pipe<A, B, C, D, E, F, G, H, I>(op1, op2, op3, op4, op5, op6, op7, op8, op9): Observable<I>

Type parameters

Name
A
B
C
D
E
F
G
H
I

Parameters

NameType
op1OperatorFunction<any, A>
op2OperatorFunction<A, B>
op3OperatorFunction<B, C>
op4OperatorFunction<C, D>
op5OperatorFunction<D, E>
op6OperatorFunction<E, F>
op7OperatorFunction<F, G>
op8OperatorFunction<G, H>
op9OperatorFunction<H, I>

Returns

Observable<I>

Inherited from

Subject.pipe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:86

pipe<A, B, C, D, E, F, G, H, I>(op1, op2, op3, op4, op5, op6, op7, op8, op9, ...operations): Observable<{}>

Type parameters

Name
A
B
C
D
E
F
G
H
I

Parameters

NameType
op1OperatorFunction<any, A>
op2OperatorFunction<A, B>
op3OperatorFunction<B, C>
op4OperatorFunction<C, D>
op5OperatorFunction<D, E>
op6OperatorFunction<E, F>
op7OperatorFunction<F, G>
op8OperatorFunction<G, H>
op9OperatorFunction<H, I>
...operationsOperatorFunction<any, any>[]

Returns

Observable<{}>

Inherited from

Subject.pipe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:87


subscribe

subscribe(observer?): Subscription

Parameters

NameType
observer?PartialObserver<any>

Returns

Subscription

Inherited from

Subject.subscribe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:47

subscribe(next, error, complete): Subscription

Parameters

NameType
nextnull
errornull
complete() => void

Returns

Subscription

Deprecated

Use an observer instead of a complete callback

Inherited from

Subject.subscribe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:49

subscribe(next, error, complete?): Subscription

Parameters

NameType
nextnull
error(error: any) => void
complete?() => void

Returns

Subscription

Deprecated

Use an observer instead of an error callback

Inherited from

Subject.subscribe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:51

subscribe(next, error, complete): Subscription

Parameters

NameType
next(value: any) => void
errornull
complete() => void

Returns

Subscription

Deprecated

Use an observer instead of a complete callback

Inherited from

Subject.subscribe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:53

subscribe(next?, error?, complete?): Subscription

Parameters

NameType
next?(value: any) => void
error?(error: any) => void
complete?() => void

Returns

Subscription

Inherited from

Subject.subscribe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:54


toPromise

toPromise<T>(this): Promise<T>

Type parameters

Name
T

Parameters

NameType
thisObservable<T>

Returns

Promise<T>

Inherited from

Subject.toPromise

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:88

toPromise<T>(this, PromiseCtor): Promise<T>

Type parameters

Name
T

Parameters

NameType
thisObservable<T>
PromiseCtorPromiseConstructor

Returns

Promise<T>

Inherited from

Subject.toPromise

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:89

toPromise<T>(this, PromiseCtor): Promise<T>

Type parameters

Name
T

Parameters

NameType
thisObservable<T>
PromiseCtorPromiseConstructorLike

Returns

Promise<T>

Inherited from

Subject.toPromise

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Observable.d.ts:90


unsubscribe

unsubscribe(): void

Returns

void

Inherited from

Subject.unsubscribe

Defined in

node_modules/.pnpm/rxjs@6.6.7/node_modules/rxjs/internal/Subject.d.ts:37

- + \ No newline at end of file diff --git a/docs/api-reference/interfaces/ImportSource/index.html b/docs/api-reference/interfaces/ImportSource/index.html index 90b52286e..532481e28 100644 --- a/docs/api-reference/interfaces/ImportSource/index.html +++ b/docs/api-reference/interfaces/ImportSource/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/interfaces/InlineNodeInstance/index.html b/docs/api-reference/interfaces/InlineNodeInstance/index.html index 429567403..4489aa9e8 100644 --- a/docs/api-reference/interfaces/InlineNodeInstance/index.html +++ b/docs/api-reference/interfaces/InlineNodeInstance/index.html @@ -14,14 +14,14 @@ - - + +

Interface: InlineNodeInstance

Hierarchy

Properties

displayName

Optional displayName: string

Inherited from

NodeInstanceConfig.displayName

Defined in

core/src/node/node-instance.ts:8


id

id: string

Defined in

core/src/node/node-instance.ts:19


inputConfig

inputConfig: InputPinsConfig

Inherited from

NodeInstanceConfig.inputConfig

Defined in

core/src/node/node-instance.ts:5


node

node: Node

Defined in

core/src/node/node-instance.ts:20


pos

pos: Pos

Defined in

core/src/node/node-instance.ts:21


style

Optional style: NodeStyle

Inherited from

NodeInstanceConfig.style

Defined in

core/src/node/node-instance.ts:9


visibleInputs

Optional visibleInputs: string[]

Inherited from

NodeInstanceConfig.visibleInputs

Defined in

core/src/node/node-instance.ts:6


visibleOutputs

Optional visibleOutputs: string[]

Inherited from

NodeInstanceConfig.visibleOutputs

Defined in

core/src/node/node-instance.ts:7

- + \ No newline at end of file diff --git a/docs/api-reference/interfaces/InlinePartInstance/index.html b/docs/api-reference/interfaces/InlinePartInstance/index.html index 58d8f97ed..6da76232d 100644 --- a/docs/api-reference/interfaces/InlinePartInstance/index.html +++ b/docs/api-reference/interfaces/InlinePartInstance/index.html @@ -14,14 +14,14 @@ - - + +

Interface: InlinePartInstance

Hierarchy

Properties

displayName

Optional displayName: string

Inherited from

PartInstanceConfig.displayName

Defined in

core/src/part/part-instance.ts:8


id

id: string

Defined in

core/src/part/part-instance.ts:19


inputConfig

inputConfig: InputPinsConfig

Inherited from

PartInstanceConfig.inputConfig

Defined in

core/src/part/part-instance.ts:5


part

part: Part

Defined in

core/src/part/part-instance.ts:20


pos

pos: Pos

Defined in

core/src/part/part-instance.ts:21


style

Optional style: PartStyle

Inherited from

PartInstanceConfig.style

Defined in

core/src/part/part-instance.ts:9


visibleInputs

Optional visibleInputs: string[]

Inherited from

PartInstanceConfig.visibleInputs

Defined in

core/src/part/part-instance.ts:6


visibleOutputs

Optional visibleOutputs: string[]

Inherited from

PartInstanceConfig.visibleOutputs

Defined in

core/src/part/part-instance.ts:7

- + \ No newline at end of file diff --git a/docs/api-reference/interfaces/InlineValueNode/index.html b/docs/api-reference/interfaces/InlineValueNode/index.html index 39480953f..de7337ac3 100644 --- a/docs/api-reference/interfaces/InlineValueNode/index.html +++ b/docs/api-reference/interfaces/InlineValueNode/index.html @@ -14,8 +14,8 @@ - - + + @@ -26,7 +26,7 @@ It can be convenient to show the time input in the instance itself so it shows "Delay 500ms" instead of "Delay" (in the case 500 is the static value of time)

{
...,
customViewCode: `{{#if inputs.time}}
Delay {{inputs.time}} ms
{{else}}
Delay
{{/if}}`
}

Inherited from

BaseNode.customViewCode

Defined in

core/src/node/node.ts:155


dataBuilderSource

Optional dataBuilderSource: string

Defined in

core/src/node/node.ts:190


defaultStyle

Optional defaultStyle: NodeStyle

All instances of this node will inherit the default style if it is supplied. See NodeStyle for the full options supported

Inherited from

BaseNode.defaultStyle

Defined in

core/src/node/node.ts:160


description

Optional description: string

Is displayed in the visual editor and used to search for nodes.

Inherited from

BaseNode.description

Defined in

core/src/node/node.ts:84


fnCode

Optional fnCode: string

Defined in

core/src/node/node.ts:189


id

id: string

Node's unique id. instances refer use this to refer to the correct node

Inherited from

BaseNode.id

Defined in

core/src/node/node.ts:80


inputs

inputs: Record<string, InputPin>

A pin on a node that receives data. Each node can have zero or more input pins.

Example for the inputs of a mathematical multiplier node:

{
multiplicand: { description: "The number to be multiplied" },
multiplier: { description: "The number with which we multiply" },
}

Inherited from

BaseNode.inputs

Defined in

core/src/node/node.ts:100


namespace

Optional namespace: string

TBD

Inherited from

BaseNode.namespace

Defined in

core/src/node/node.ts:117


outputs

outputs: Record<string, OutputPin>

A pin on a node that sends data. Each node can have zero or more output pins. For example, a "Split array" node might have one input pin for an array and two output pins for the first and second halves of the array:

Example

{
'first half': { description: "The first half of the array" },
'second half': { description: "The second half of the array" },
}

Inherited from

BaseNode.outputs

Defined in

core/src/node/node.ts:113


reactiveInputs

Optional reactiveInputs: string[]

Deprecated

  • TBD

Inherited from

BaseNode.reactiveInputs

Defined in

core/src/node/node.ts:135


runFnRawCode

runFnRawCode: string

Defined in

core/src/node/node.ts:188


searchKeywords

Optional searchKeywords: string[]

A list of keywords that can be used to search for the node. Useful for node that users might search using different words.

Inherited from

BaseNode.searchKeywords

Defined in

core/src/node/node.ts:88


templateType

Optional templateType: InlineValueNodeType

Defined in

core/src/node/node.ts:191

- + \ No newline at end of file diff --git a/docs/api-reference/interfaces/InlineValuePart/index.html b/docs/api-reference/interfaces/InlineValuePart/index.html index 43f14c1cd..11b0f7953 100644 --- a/docs/api-reference/interfaces/InlineValuePart/index.html +++ b/docs/api-reference/interfaces/InlineValuePart/index.html @@ -14,8 +14,8 @@ - - + + @@ -26,7 +26,7 @@ It can be convenient to show the time input in the instance itself so it shows "Delay 500ms" instead of "Delay" (in the case 500 is the static value of time)

{
...,
customViewCode: "<% if (inputs.time) { %> Delay <%- inputs.time %> ms <% } else { %> Delay <% } %>",
}

Inherited from

BasePart.customViewCode

Defined in

core/src/part/part.ts:151


dataBuilderSource

Optional dataBuilderSource: string

Defined in

core/src/part/part.ts:186


defaultStyle

Optional defaultStyle: PartStyle

All instances of this part will inherit the default style if it is supplied. See PartStyle for the full options supported

Inherited from

BasePart.defaultStyle

Defined in

core/src/part/part.ts:156


description

Optional description: string

Is displayed in the visual editor and used to search for parts.

Inherited from

BasePart.description

Defined in

core/src/part/part.ts:84


fnCode

Optional fnCode: string

Defined in

core/src/part/part.ts:185


id

id: string

Part's unique id. instances refer use this to refer to the correct part

Inherited from

BasePart.id

Defined in

core/src/part/part.ts:80


inputs

inputs: Record<string, InputPin>

A pin on a part that receives data. Each part can have zero or more input pins.

Example for the inputs of a mathematical multiplier part:

{
multiplicand: { description: "The number to be multiplied" },
multiplier: { description: "The number with which we multiply" },
}

Inherited from

BasePart.inputs

Defined in

core/src/part/part.ts:100


namespace

Optional namespace: string

TBD

Inherited from

BasePart.namespace

Defined in

core/src/part/part.ts:117


outputs

outputs: Record<string, OutputPin>

A pin on a part that sends data. Each part can have zero or more output pins. For example, a "Split array" part might have one input pin for an array and two output pins for the first and second halves of the array:

Example

{
'first half': { description: "The first half of the array" },
'second half': { description: "The second half of the array" },
}

Inherited from

BasePart.outputs

Defined in

core/src/part/part.ts:113


reactiveInputs

Optional reactiveInputs: string[]

Deprecated

  • TBD

Inherited from

BasePart.reactiveInputs

Defined in

core/src/part/part.ts:135


runFnRawCode

runFnRawCode: string

Defined in

core/src/part/part.ts:184


searchKeywords

Optional searchKeywords: string[]

A list of keywords that can be used to search for the part. Useful for parts that users might search using different words.

Inherited from

BasePart.searchKeywords

Defined in

core/src/part/part.ts:88


templateType

Optional templateType: InlineValuePartType

Defined in

core/src/part/part.ts:187

- + \ No newline at end of file diff --git a/docs/api-reference/interfaces/InputPin/index.html b/docs/api-reference/interfaces/InputPin/index.html index b6f0d175a..1cd53d2ae 100644 --- a/docs/api-reference/interfaces/InputPin/index.html +++ b/docs/api-reference/interfaces/InputPin/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/interfaces/InstanceViewData/index.html b/docs/api-reference/interfaces/InstanceViewData/index.html index 8babed8b3..7dcc713e1 100644 --- a/docs/api-reference/interfaces/InstanceViewData/index.html +++ b/docs/api-reference/interfaces/InstanceViewData/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/interfaces/NodeInstanceConfig/index.html b/docs/api-reference/interfaces/NodeInstanceConfig/index.html index 774baac8a..20dba5503 100644 --- a/docs/api-reference/interfaces/NodeInstanceConfig/index.html +++ b/docs/api-reference/interfaces/NodeInstanceConfig/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/interfaces/NodeStyle/index.html b/docs/api-reference/interfaces/NodeStyle/index.html index b08d87432..6f9171d01 100644 --- a/docs/api-reference/interfaces/NodeStyle/index.html +++ b/docs/api-reference/interfaces/NodeStyle/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/interfaces/OMap/index.html b/docs/api-reference/interfaces/OMap/index.html index a64d6f996..ecc1021aa 100644 --- a/docs/api-reference/interfaces/OMap/index.html +++ b/docs/api-reference/interfaces/OMap/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/interfaces/OMapF/index.html b/docs/api-reference/interfaces/OMapF/index.html index 0c5e8b046..79deac47b 100644 --- a/docs/api-reference/interfaces/OMapF/index.html +++ b/docs/api-reference/interfaces/OMapF/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/interfaces/OutputPin/index.html b/docs/api-reference/interfaces/OutputPin/index.html index 8a61b4a7f..70cb40eda 100644 --- a/docs/api-reference/interfaces/OutputPin/index.html +++ b/docs/api-reference/interfaces/OutputPin/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/interfaces/PartError/index.html b/docs/api-reference/interfaces/PartError/index.html index ce022f8b5..fd5162687 100644 --- a/docs/api-reference/interfaces/PartError/index.html +++ b/docs/api-reference/interfaces/PartError/index.html @@ -14,14 +14,14 @@ - - + +

Interface: PartError

Hierarchy

  • Error

    PartError

Properties

fullInsIdPath

fullInsIdPath: string

Defined in

core/src/execute/index.ts:477


message

message: string

Inherited from

Error.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1054


name

name: string

Inherited from

Error.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1053


partId

partId: string

Defined in

core/src/execute/index.ts:478


stack

Optional stack: string

Inherited from

Error.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1055

core/node_modules/@types/node/globals.d.ts:127

- + \ No newline at end of file diff --git a/docs/api-reference/interfaces/PartInstanceConfig/index.html b/docs/api-reference/interfaces/PartInstanceConfig/index.html index 284fdad49..a8a40c01d 100644 --- a/docs/api-reference/interfaces/PartInstanceConfig/index.html +++ b/docs/api-reference/interfaces/PartInstanceConfig/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/interfaces/PartStyle/index.html b/docs/api-reference/interfaces/PartStyle/index.html index a39a8e156..acbbdf3ce 100644 --- a/docs/api-reference/interfaces/PartStyle/index.html +++ b/docs/api-reference/interfaces/PartStyle/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/docs/api-reference/interfaces/RefNodeInstance/index.html b/docs/api-reference/interfaces/RefNodeInstance/index.html index c27badf8a..eeaba7020 100644 --- a/docs/api-reference/interfaces/RefNodeInstance/index.html +++ b/docs/api-reference/interfaces/RefNodeInstance/index.html @@ -14,14 +14,14 @@ - - + +

Interface: RefNodeInstance

Hierarchy

Properties

displayName

Optional displayName: string

Inherited from

NodeInstanceConfig.displayName

Defined in

core/src/node/node-instance.ts:8


id

id: string

Defined in

core/src/node/node-instance.ts:13


inputConfig

inputConfig: InputPinsConfig

Inherited from

NodeInstanceConfig.inputConfig

Defined in

core/src/node/node-instance.ts:5


nodeId

nodeId: string

Defined in

core/src/node/node-instance.ts:14


pos

pos: Pos

Defined in

core/src/node/node-instance.ts:15


style

Optional style: NodeStyle

Inherited from

NodeInstanceConfig.style

Defined in

core/src/node/node-instance.ts:9


visibleInputs

Optional visibleInputs: string[]

Inherited from

NodeInstanceConfig.visibleInputs

Defined in

core/src/node/node-instance.ts:6


visibleOutputs

Optional visibleOutputs: string[]

Inherited from

NodeInstanceConfig.visibleOutputs

Defined in

core/src/node/node-instance.ts:7

- + \ No newline at end of file diff --git a/docs/api-reference/interfaces/RefPartInstance/index.html b/docs/api-reference/interfaces/RefPartInstance/index.html index e9d675d26..04afe61d5 100644 --- a/docs/api-reference/interfaces/RefPartInstance/index.html +++ b/docs/api-reference/interfaces/RefPartInstance/index.html @@ -14,14 +14,14 @@ - - + +

Interface: RefPartInstance

Hierarchy

Properties

displayName

Optional displayName: string

Inherited from

PartInstanceConfig.displayName

Defined in

core/src/part/part-instance.ts:8


id

id: string

Defined in

core/src/part/part-instance.ts:13


inputConfig

inputConfig: InputPinsConfig

Inherited from

PartInstanceConfig.inputConfig

Defined in

core/src/part/part-instance.ts:5


partId

partId: string

Defined in

core/src/part/part-instance.ts:14


pos

pos: Pos

Defined in

core/src/part/part-instance.ts:15


style

Optional style: PartStyle

Inherited from

PartInstanceConfig.style

Defined in

core/src/part/part-instance.ts:9


visibleInputs

Optional visibleInputs: string[]

Inherited from

PartInstanceConfig.visibleInputs

Defined in

core/src/part/part-instance.ts:6


visibleOutputs

Optional visibleOutputs: string[]

Inherited from

PartInstanceConfig.visibleOutputs

Defined in

core/src/part/part-instance.ts:7

- + \ No newline at end of file diff --git a/docs/api-reference/interfaces/SimpleFnData/index.html b/docs/api-reference/interfaces/SimpleFnData/index.html index d0e7f029e..edfa7ccc4 100644 --- a/docs/api-reference/interfaces/SimpleFnData/index.html +++ b/docs/api-reference/interfaces/SimpleFnData/index.html @@ -14,14 +14,14 @@ - - + +

Interface: SimpleFnData

Properties

description

description: string

Defined in

core/src/part/partFromSimpleFunction.ts:6


fn

fn: (...args: any[]) => any

Type declaration

▸ (...args): any

Parameters
NameType
...argsany[]
Returns

any

Defined in

core/src/part/partFromSimpleFunction.ts:10


icon

Optional icon: string

Defined in

core/src/part/partFromSimpleFunction.ts:12


id

id: string

Defined in

core/src/part/partFromSimpleFunction.ts:5


inputs

Optional inputs: { description: string ; mode?: InputMode ; name: string }[]

Defined in

core/src/part/partFromSimpleFunction.ts:8


namespace

namespace: string

Defined in

core/src/part/partFromSimpleFunction.ts:7


output

Optional output: Object

Type declaration

NameType
descriptionstring
namestring

Defined in

core/src/part/partFromSimpleFunction.ts:9


symbol

Optional symbol: string

Defined in

core/src/part/partFromSimpleFunction.ts:11

- + \ No newline at end of file diff --git a/docs/api-reference/interfaces/VisualNode/index.html b/docs/api-reference/interfaces/VisualNode/index.html index 0b57a0a01..fb6eb60a4 100644 --- a/docs/api-reference/interfaces/VisualNode/index.html +++ b/docs/api-reference/interfaces/VisualNode/index.html @@ -14,8 +14,8 @@ - - + + @@ -29,7 +29,7 @@ It can be convenient to show the time input in the instance itself so it shows "Delay 500ms" instead of "Delay" (in the case 500 is the static value of time)

{
...,
customViewCode: `{{#if inputs.time}}
Delay {{inputs.time}} ms
{{else}}
Delay
{{/if}}`
}

Inherited from

BaseNode.customViewCode

Defined in

core/src/node/node.ts:155


defaultStyle

Optional defaultStyle: NodeStyle

All instances of this node will inherit the default style if it is supplied. See NodeStyle for the full options supported

Inherited from

BaseNode.defaultStyle

Defined in

core/src/node/node.ts:160


description

Optional description: string

Is displayed in the visual editor and used to search for nodes.

Inherited from

BaseNode.description

Defined in

core/src/node/node.ts:84


id

id: string

Node's unique id. instances refer use this to refer to the correct node

Inherited from

BaseNode.id

Defined in

core/src/node/node.ts:80


inputs

inputs: Record<string, InputPin>

A pin on a node that receives data. Each node can have zero or more input pins.

Example for the inputs of a mathematical multiplier node:

{
multiplicand: { description: "The number to be multiplied" },
multiplier: { description: "The number with which we multiply" },
}

Inherited from

BaseNode.inputs

Defined in

core/src/node/node.ts:100


inputsPosition

inputsPosition: OMap<Pos>

a map holding the position for each main input. Used in the editor only.

Defined in

core/src/node/node.ts:203


instances

instances: NodeInstance[]

the visual nodes internal node instances, either referring to other nodes by id or by value (inline)

Defined in

core/src/node/node.ts:207


namespace

Optional namespace: string

TBD

Inherited from

BaseNode.namespace

Defined in

core/src/node/node.ts:117


outputs

outputs: Record<string, OutputPin>

A pin on a node that sends data. Each node can have zero or more output pins. For example, a "Split array" node might have one input pin for an array and two output pins for the first and second halves of the array:

Example

{
'first half': { description: "The first half of the array" },
'second half': { description: "The second half of the array" },
}

Inherited from

BaseNode.outputs

Defined in

core/src/node/node.ts:113


outputsPosition

outputsPosition: OMap<Pos>

a map holding the position for each main output. Used in the editor only.

Defined in

core/src/node/node.ts:205


reactiveInputs

Optional reactiveInputs: string[]

Deprecated

  • TBD

Inherited from

BaseNode.reactiveInputs

Defined in

core/src/node/node.ts:135


searchKeywords

Optional searchKeywords: string[]

A list of keywords that can be used to search for the node. Useful for node that users might search using different words.

Inherited from

BaseNode.searchKeywords

Defined in

core/src/node/node.ts:88

- + \ No newline at end of file diff --git a/docs/api-reference/interfaces/VisualPart/index.html b/docs/api-reference/interfaces/VisualPart/index.html index 2f3fa99c6..df63c02dd 100644 --- a/docs/api-reference/interfaces/VisualPart/index.html +++ b/docs/api-reference/interfaces/VisualPart/index.html @@ -14,8 +14,8 @@ - - + + @@ -29,7 +29,7 @@ It can be convenient to show the time input in the instance itself so it shows "Delay 500ms" instead of "Delay" (in the case 500 is the static value of time)

{
...,
customViewCode: "<% if (inputs.time) { %> Delay <%- inputs.time %> ms <% } else { %> Delay <% } %>",
}

Inherited from

BasePart.customViewCode

Defined in

core/src/part/part.ts:151


defaultStyle

Optional defaultStyle: PartStyle

All instances of this part will inherit the default style if it is supplied. See PartStyle for the full options supported

Inherited from

BasePart.defaultStyle

Defined in

core/src/part/part.ts:156


description

Optional description: string

Is displayed in the visual editor and used to search for parts.

Inherited from

BasePart.description

Defined in

core/src/part/part.ts:84


id

id: string

Part's unique id. instances refer use this to refer to the correct part

Inherited from

BasePart.id

Defined in

core/src/part/part.ts:80


inputs

inputs: Record<string, InputPin>

A pin on a part that receives data. Each part can have zero or more input pins.

Example for the inputs of a mathematical multiplier part:

{
multiplicand: { description: "The number to be multiplied" },
multiplier: { description: "The number with which we multiply" },
}

Inherited from

BasePart.inputs

Defined in

core/src/part/part.ts:100


inputsPosition

inputsPosition: OMap<Pos>

a map holding the position for each main input. Used in the editor only.

Defined in

core/src/part/part.ts:199


instances

instances: PartInstance[]

the visual parts internal part instances, either referring to other parts by id or by value (inline)

Defined in

core/src/part/part.ts:203


namespace

Optional namespace: string

TBD

Inherited from

BasePart.namespace

Defined in

core/src/part/part.ts:117


outputs

outputs: Record<string, OutputPin>

A pin on a part that sends data. Each part can have zero or more output pins. For example, a "Split array" part might have one input pin for an array and two output pins for the first and second halves of the array:

Example

{
'first half': { description: "The first half of the array" },
'second half': { description: "The second half of the array" },
}

Inherited from

BasePart.outputs

Defined in

core/src/part/part.ts:113


outputsPosition

outputsPosition: OMap<Pos>

a map holding the position for each main output. Used in the editor only.

Defined in

core/src/part/part.ts:201


reactiveInputs

Optional reactiveInputs: string[]

Deprecated

  • TBD

Inherited from

BasePart.reactiveInputs

Defined in

core/src/part/part.ts:135


searchKeywords

Optional searchKeywords: string[]

A list of keywords that can be used to search for the part. Useful for parts that users might search using different words.

Inherited from

BasePart.searchKeywords

Defined in

core/src/part/part.ts:88

- + \ No newline at end of file diff --git a/docs/api-reference/modules/index.html b/docs/api-reference/modules/index.html index 8e4a2e689..e3be8bccd 100644 --- a/docs/api-reference/modules/index.html +++ b/docs/api-reference/modules/index.html @@ -14,14 +14,14 @@ - - + +

@flyde/core

Enumerations

Classes

Interfaces

Type Aliases

BaseDebuggerEvent

Ƭ BaseDebuggerEvent<T>: Object

Type parameters

NameType
Textends DebuggerEventType

Type declaration

NameType
ancestorsInsIds?string
executionIdstring
insIdstring
nodeIdstring
timenumber
typeT
valDebuggerEventTypeData[T]

Defined in

core/src/execute/debugger/events.ts:22


CancelFn

Ƭ CancelFn: () => void

Type declaration

▸ (): void

Returns

void

Defined in

core/src/execute/index.ts:59


CodeExecutionData

Ƭ CodeExecutionData: Object

Type declaration

NameTypeDescription
_debugger?Debugger-
ancestorsInsIds?stringA full path of ancestor insIds, separated by dots. Used for debugger events and state namespacing
envExecuteEnv-
extraContext?Record<string, any>-
inputsNodeInputs-
insIdstringIf the node is an instance of another node, this is the id of the instance. If the node is the root node, this is "__root". Used for debugger events and state namespacing
mainStateOMap<NodeState>-
nodeCodeNode-
onBubbleError(err: any) => void-
onCompleted?(data: any) => void-
onError(err: any) => void-
onStarted?() => void-
outputsNodeOutputs-
resolvedDepsNodesCollection-

Defined in

core/src/execute/index.ts:70


CodeNodeDefinition

Ƭ CodeNodeDefinition: Omit<CodeNode, "run">

Defined in

core/src/node/node.ts:224


ConnectionData

Ƭ ConnectionData: Object

Type declaration

NameType
delayed?boolean
fromConnectionNode
hidden?boolean
toConnectionNode

Defined in

core/src/connect/index.ts:33


ConnectionNode

Ƭ ConnectionNode: ExternalConnectionNode | InternalConnectionNode

Defined in

core/src/connect/index.ts:50


CustomNode

Ƭ CustomNode: VisualNode | InlineValueNode

Defined in

core/src/node/node.ts:222


CustomNodeCollection

Ƭ CustomNodeCollection: OMap<CustomNode>

Defined in

core/src/node/node.ts:29


CustomNodeViewFn

Ƭ CustomNodeViewFn: (instance: NodeInstance, inputs: OMap<NodeInstance[]>, outputs: OMap<NodeInstance[]>, resolvedDeps: NodesDefCollection) => { hiddenInputs?: string[] ; hiddenOutputs?: string[] ; label: string } | false

Type declaration

▸ (instance, inputs, outputs, resolvedDeps): { hiddenInputs?: string[] ; hiddenOutputs?: string[] ; label: string } | false

Parameters
NameType
instanceNodeInstance
inputsOMap<NodeInstance[]>
outputsOMap<NodeInstance[]>
resolvedDepsNodesDefCollection
Returns

{ hiddenInputs?: string[] ; hiddenOutputs?: string[] ; label: string } | false

Defined in

core/src/node/node.ts:50


CustomNodesCollection

Ƭ CustomNodesCollection: OMap<CustomNode>

Defined in

core/src/index.ts:43


DataShape

Ƭ DataShape: DataShapeType | DataShape[] | { [key: string]: DataShape; }

Defined in

core/src/common/data-shaper/index.tsx:38


DataShaperOptions

Ƭ DataShaperOptions: Object

Type declaration

NameType
maxArrayCheckIdxnumber
maxDepthnumber

Defined in

core/src/common/data-shaper/index.tsx:28


DebugLogger

Ƭ DebugLogger: _Debugger

Defined in

core/src/common/debug-logger.ts:9


Debugger

Ƭ Debugger: Object

Type declaration

NameType
debugDelay?number
destroy?() => void
onEvent?<T>(event: Omit<T, "time" | "executionId">) => DebuggerCommand

Defined in

core/src/execute/debugger/index.ts:13


DebuggerCommand

Ƭ DebuggerCommand: DebuggerInterceptCommand | void

Defined in

core/src/execute/debugger/index.ts:11


DebuggerEvent

Ƭ DebuggerEvent: MajorDebuggerEvent | MinorDebuggerEvent

Defined in

core/src/execute/debugger/events.ts:53


DebuggerEventTypeData

Ƭ DebuggerEventTypeData: Object

Type declaration

NameType
errany
istring
iscOMap<number>
ostring
pcboolean

Defined in

core/src/execute/debugger/events.ts:36


DebuggerInterceptCommand

Ƭ DebuggerInterceptCommand: Object

Type declaration

NameType
cmd"intercept"
valuePromisePromise<any>

Defined in

core/src/execute/debugger/index.ts:6


DynamicNodeInput

Ƭ DynamicNodeInput: Object

Type declaration

NameType
configStickyInputPinConfig | QueueInputPinConfig
subjectSubject<any>

Defined in

core/src/node/node-pins.ts:56


ExecuteEnv

Ƭ ExecuteEnv: OMap<any>

Defined in

core/src/execute/index.ts:61


ExecuteFn

Ƭ ExecuteFn: (params: ExecuteParams) => CancelFn

Type declaration

▸ (params): CancelFn

Parameters
NameType
paramsExecuteParams
Returns

CancelFn

Defined in

core/src/execute/index.ts:486


ExecuteParams

Ƭ ExecuteParams: Object

Type declaration

NameType
_debugger?Debugger
ancestorsInsIds?string
env?ExecuteEnv
extraContext?Record<string, any>
inputsNodeInputs
insId?string
mainState?OMap<NodeState>
nodeNode
onBubbleError?(err: NodeInstanceError) => void
onCompleted?(data: any) => void
onStarted?() => void
outputsNodeOutputs
resolvedDepsNodesCollection

Defined in

core/src/execute/index.ts:488


ExecutionState

Ƭ ExecutionState: Map<string, any>

Defined in

core/src/execute/index.ts:57


ExternalConnectionNode

Ƭ ExternalConnectionNode: Object

Type declaration

NameType
insIdtypeof THIS_INS_ID
pinIdstring

Defined in

core/src/connect/index.ts:40


FlydeFlow

Ƭ FlydeFlow: Object

Type declaration

NameType
imports?Record<string, String[]>
nodeVisualNode

Defined in

core/src/flow-schema.ts:91


ImportableSource

Ƭ ImportableSource: Object

Type declaration

NameType
implicit?boolean
modulestring
nodeImportedNode

Defined in

core/src/node/node.ts:216


ImportedNode

Ƭ ImportedNode: Node & { source: ImportSource }

Defined in

core/src/flow-schema.ts:105


ImportedNodeDef

Ƭ ImportedNodeDef: NodeDefinition & { source: ImportSource }

Defined in

core/src/flow-schema.ts:109


ImportedNodeDefinition

Ƭ ImportedNodeDefinition: NodeDefinition & { source: ImportSource }

Defined in

core/src/flow-schema.ts:101


InnerExecuteFn

Ƭ InnerExecuteFn: (node: Node, args: NodeInputs, outputs: NodeOutputs, insId: string) => CancelFn

Type declaration

▸ (node, args, outputs, insId): CancelFn

Parameters
NameType
nodeNode
argsNodeInputs
outputsNodeOutputs
insIdstring
Returns

CancelFn

Defined in

core/src/execute/index.ts:63


InputMode

Ƭ InputMode: "optional" | "required" | "required-if-connected"

Defined in

core/src/node/node-pins.ts:15


InputPinConfig

Ƭ InputPinConfig: QueueInputPinConfig | StickyInputPinConfig | StaticInputPinConfig

Defined in

core/src/node/pin-config.ts:20


InputPinMap

Ƭ InputPinMap: Record<string, InputPin>

Defined in

core/src/node/node-pins.ts:26


InputPinMode

Ƭ InputPinMode: "queue" | "sticky" | "static"

Defined in

core/src/node/pin-config.ts:5


InputPinsConfig

Ƭ InputPinsConfig: OMap<InputPinConfig>

Defined in

core/src/node/pin-config.ts:25


InputStaticValue

Ƭ InputStaticValue: string | number | object | VisualNode

Defined in

core/src/index.ts:25


InternalConnectionNode

Ƭ InternalConnectionNode: Object

Type declaration

NameType
insIdstring
pinIdstring

Defined in

core/src/connect/index.ts:45


MajorDebuggerEvent

Ƭ MajorDebuggerEvent: PinDebuggerEvent<OUTPUT_CHANGE> | PinDebuggerEvent<INPUT_CHANGE> | BaseDebuggerEvent<ERROR>

Defined in

core/src/execute/debugger/events.ts:44


MinorDebuggerEvent

Ƭ MinorDebuggerEvent: BaseDebuggerEvent<INPUTS_STATE_CHANGE> | BaseDebuggerEvent<PROCESSING_CHANGE>

Defined in

core/src/execute/debugger/events.ts:49


Node

Ƭ Node: CodeNode | CustomNode

Defined in

core/src/node/node.ts:214


NodeAdvancedContext

Ƭ NodeAdvancedContext: Object

Type declaration

NameType
ancestorsInsIds?string
contextRecord<string, any>
executeInnerExecuteFn
globalStateNodeState
insIdstring
onCleanup(cb: Function) => void
onError(e: any) => void
stateNodeState

Defined in

core/src/node/node.ts:33


NodeDefinition

Ƭ NodeDefinition: CustomNode | CodeNodeDefinition

Defined in

core/src/node/node.ts:226


NodeDefinitionWithModuleMetaData

Ƭ NodeDefinitionWithModuleMetaData: NodeDefinition & NodeModuleMetaData

Defined in

core/src/node/node.ts:232


NodeInput

Ƭ NodeInput: DynamicNodeInput | StaticNodeInput

Defined in

core/src/node/node-pins.ts:65


NodeInputs

Ƭ NodeInputs: OMapF<NodeInput>

Defined in

core/src/node/node-pins.ts:71


NodeInstance

Ƭ NodeInstance: RefNodeInstance | InlineNodeInstance

Defined in

core/src/node/node-instance.ts:23

core/src/node/node-instance.ts:57


NodeModuleMetaData

Ƭ NodeModuleMetaData: Object

Type declaration

NameType
imported?boolean

Defined in

core/src/node/node.ts:228


NodeOutput

Ƭ NodeOutput: Subject<any>

Defined in

core/src/node/node-pins.ts:67


NodeOutputs

Ƭ NodeOutputs: OMapF<NodeOutput>

Defined in

core/src/node/node-pins.ts:69


NodeState

Ƭ NodeState: Map<string, any>

Defined in

core/src/node/node.ts:31


NodeStyleSize

Ƭ NodeStyleSize: "small" | "regular" | "large"

Defined in

core/src/node/node.ts:63


NodeTypeIcon

Ƭ NodeTypeIcon: string | [string, string]

Defined in

core/src/node/node.ts:64


NodesCollection

Ƭ NodesCollection: OMap<Node>

Defined in

core/src/index.ts:39


NodesDefCollection

Ƭ NodesDefCollection: OMap<NodeDefinition>

Defined in

core/src/index.ts:41


ObjOrObjCreator

Ƭ ObjOrObjCreator<T>: T | () => T

Type parameters

Name
T

Defined in

core/src/common/test-data-creator/index.ts:3


OutputPinMap

Ƭ OutputPinMap: Record<string, OutputPin>

Defined in

core/src/node/node-pins.ts:28


PinDebuggerEvent

Ƭ PinDebuggerEvent<T>: { pinId: string } & BaseDebuggerEvent<T>

Type parameters

NameType
Textends DebuggerEventType

Defined in

core/src/execute/debugger/events.ts:32


PinList

Ƭ PinList: { insId: string ; pinId: string }[]

Defined in

core/src/connect/index.ts:52


PinType

Ƭ PinType: "input" | "output"

Defined in

core/src/node/node-pins.ts:14


Pos

Ƭ Pos: Object

Type declaration

NameType
xnumber
ynumber

Defined in

core/src/common/utils.ts:1


QueueInputPinConfig

Ƭ QueueInputPinConfig: Object

Type declaration

NameType
mode"queue"

Defined in

core/src/node/pin-config.ts:7


RandomFunction

Ƭ RandomFunction: (max: number) => number(max: number, min: number) => number

Type declaration

▸ (max): number

Parameters
NameType
maxnumber
Returns

number

▸ (max, min): number

Parameters
NameType
maxnumber
minnumber
Returns

number

Defined in

core/src/common/utils.ts:81


Rect

Ƭ Rect: Pos & { h: number ; w: number }

Defined in

core/src/common/utils.ts:14


ResolvedDependencies

Ƭ ResolvedDependencies: Record<string, ImportedNode>

Defined in

core/src/flow-schema.ts:123


ResolvedDependenciesDefinitions

Ƭ ResolvedDependenciesDefinitions: Record<string, ImportedNodeDefinition>

Defined in

core/src/flow-schema.ts:113


ResolvedFlydeFlow

Ƭ ResolvedFlydeFlow: ResolvedFlydeFlowDefinition | ResolvedFlydeRuntimeFlow

Defined in

core/src/flow-schema.ts:130


ResolvedFlydeFlowDefinition

Ƭ ResolvedFlydeFlowDefinition: Object

Type declaration

NameType
dependenciesResolvedDependenciesDefinitions
mainVisualNode

Defined in

core/src/flow-schema.ts:118


ResolvedFlydeRuntimeFlow

Ƭ ResolvedFlydeRuntimeFlow: Object

Type declaration

NameType
dependenciesResolvedDependencies
mainVisualNode

Defined in

core/src/flow-schema.ts:125


RunNodeFunction

Ƭ RunNodeFunction: (args: OMapF<any>, o: OMapF<Subject<any>>, adv: NodeAdvancedContext) => void | CancelFn | Promise<void | CancelFn>

Type declaration

▸ (args, o, adv): void | CancelFn | Promise<void | CancelFn>

Parameters
NameType
argsOMapF<any>
oOMapF<Subject<any>>
advNodeAdvancedContext
Returns

void | CancelFn | Promise<void | CancelFn>

Defined in

core/src/node/node.ts:44


SimpleFnData

Ƭ SimpleFnData: Omit<BaseNode, "inputs" | "outputs" | "run"> & { customViewCode?: string ; description: string ; fullRunFn?: RunNodeFunction ; icon?: string ; id: string ; inputs?: { defaultValue?: any ; description: string ; mode?: InputMode ; name: string }[] ; namespace: string ; output?: { description: string ; name: string } ; run?: (...args: any[]) => any ; size?: NodeStyleSize ; symbol?: string }

Defined in

core/src/node/nodeFromSimpleFunction.ts:4


SimplifiedNodeParams

Ƭ SimplifiedNodeParams: Object

Type declaration

NameType
idstring
inputTypesOMap<string>
outputTypesOMap<string>
runRunNodeFunction

Defined in

core/src/node/node.ts:277


StaticInputPinConfig

Ƭ StaticInputPinConfig: Object

Type declaration

NameType
mode"static"
valueany

Defined in

core/src/node/pin-config.ts:15


StaticNodeInput

Ƭ StaticNodeInput: Object

Type declaration

NameType
configStaticInputPinConfig

Defined in

core/src/node/node-pins.ts:61


StickyInputPinConfig

Ƭ StickyInputPinConfig: Object

Type declaration

NameType
mode"sticky"

Defined in

core/src/node/pin-config.ts:11


SubjectMap

Ƭ SubjectMap: OMapF<Subject<any>>

Defined in

core/src/execute/index.ts:55


TestDataCreator

Ƭ TestDataCreator<T>: (partial?: Partial<T>) => T

Type parameters

Name
T

Type declaration

▸ (partial?): T

Parameters
NameType
partial?Partial<T>
Returns

T

Defined in

core/src/common/test-data-creator/index.ts:1


codeFromFunctionParams

Ƭ codeFromFunctionParams: Object

Type declaration

NameType
defaultStyle?NodeStyle
fnFunction
idstring
inputNamesstring[]
outputNamestring

Defined in

core/src/node/node.ts:365

Variables

DepGraph

Const DepGraph: any

Defined in

core/src/common/index.ts:18


ERROR_PIN_ID

Const ERROR_PIN_ID: "__error"

Defined in

core/src/connect/helpers.ts:10


GLOBAL_STATE_NS

Const GLOBAL_STATE_NS: "____global"

Defined in

core/src/execute/index.ts:507


INNER_STATE_SUFFIX

Const INNER_STATE_SUFFIX: "_inner"

Defined in

core/src/execute/index.ts:97


INPUTS_STATE_SUFFIX

Const INPUTS_STATE_SUFFIX: "_inputs"

Defined in

core/src/execute/index.ts:98


INPUT_MODES

Const INPUT_MODES: InputPinMode[]

Defined in

core/src/node/pin-config.ts:3


MAJOR_DEBUGGER_EVENT_TYPES

Const MAJOR_DEBUGGER_EVENT_TYPES: DebuggerEventType[]

Defined in

core/src/execute/debugger/events.ts:11


MINOR_DEBUGGER_EVENT_TYPES

Const MINOR_DEBUGGER_EVENT_TYPES: DebuggerEventType[]

Defined in

core/src/execute/debugger/events.ts:17


ROOT_INS_ID

Const ROOT_INS_ID: "__root"

Defined in

core/src/execute/index.ts:505


THIS_INS_ID

Const THIS_INS_ID: "__this"

Defined in

core/src/connect/helpers.ts:9


TRIGGER_PIN_ID

Const TRIGGER_PIN_ID: "__trigger"

Defined in

core/src/connect/helpers.ts:11


flydeFlowSchema

Const flydeFlowSchema: ZodObject<{ imports: ZodDefault<ZodOptional<ZodRecord<ZodString, ZodUnion<[ZodString, ZodArray<ZodString, "many">]>>>> ; node: ZodIntersection<ZodObject<{ connections: ZodArray<ZodObject<{ delayed: ZodOptional<ZodBoolean> ; from: ZodObject<{ insId: ZodString ; pinId: ZodString }, "strict", ZodTypeAny, { insId?: string ; pinId?: string }, { insId?: string ; pinId?: string }> ; hidden: ZodOptional<ZodBoolean> ; to: ZodObject<{ insId: ZodString ; pinId: ZodString }, "strict", ZodTypeAny, { insId?: string ; pinId?: string }, { insId?: string ; pinId?: string }> }, "strict", ZodTypeAny, { delayed?: boolean ; from?: { insId?: string; pinId?: string; } ; hidden?: boolean ; to?: { insId?: string; pinId?: string; } }, { delayed?: boolean ; from?: { insId?: string; pinId?: string; } ; hidden?: boolean ; to?: { insId?: string; pinId?: string; } }>, "many"> ; instances: ZodArray<ZodEffects<ZodObject<{ id: ZodString ; inputConfig: ZodDefault<ZodOptional<ZodRecord<ZodString, ZodDiscriminatedUnion<"mode", [ZodObject<{ mode: ZodLiteral<"static"> ; value: ZodAny }, "strict", ZodTypeAny, { mode?: "static" ; value?: any }, { mode?: "static" ; value?: any }>, ZodObject<{ mode: ZodLiteral<"queue"> }, "strict", ZodTypeAny, { mode?: "queue" }, { mode?: "queue" }>, ZodObject<{ mode: ZodLiteral<"sticky"> }, "strict", ZodTypeAny, { mode?: "sticky" }, { mode?: "sticky" }>]>>>> ; node: ZodOptional<ZodAny> ; nodeId: ZodOptional<ZodString> ; pos: ZodDefault<ZodObject<{ x: ZodNumber ; y: ZodNumber }, "strict", ZodTypeAny, { x?: number ; y?: number }, { x?: number ; y?: number }>> ; style: ZodOptional<ZodObject<{ color: ZodOptional<ZodString> ; cssOverride: ZodOptional<ZodRecord<ZodString, ZodString>> ; icon: ZodOptional<ZodAny> ; size: ZodOptional<ZodEnum<["small", "regular", "large"]>> }, "strip", ZodTypeAny, { color?: string ; cssOverride?: Record<string, string> ; icon?: any ; size?: "small" | "regular" | "large" }, { color?: string ; cssOverride?: Record<string, string> ; icon?: any ; size?: "small" | "regular" | "large" }>> ; visibleInputs: ZodOptional<ZodArray<ZodString, "many">> ; visibleOutputs: ZodOptional<ZodArray<ZodString, "many">> }, "strip", ZodTypeAny, { id?: string ; inputConfig?: Record<string, { mode?: "static" ; value?: any } | { mode?: "queue" } | { mode?: "sticky" }> ; node?: any ; nodeId?: string ; pos?: { x?: number ; y?: number } ; style?: { size?: "small" | "regular" | "large"; icon?: any; color?: string; cssOverride?: Record<string, string>; } ; visibleInputs?: string[] ; visibleOutputs?: string[] }, { id?: string ; inputConfig?: Record<string, { mode?: "static" ; value?: any } | { mode?: "queue" } | { mode?: "sticky" }> ; node?: any ; nodeId?: string ; pos?: { x?: number ; y?: number } ; style?: { size?: "small" | "regular" | "large"; icon?: any; color?: string; cssOverride?: Record<string, string>; } ; visibleInputs?: string[] ; visibleOutputs?: string[] }>, { id?: string ; inputConfig?: Record<string, { mode?: "static" ; value?: any } | { mode?: "queue" } | { mode?: "sticky" }> ; node?: any ; nodeId?: string ; pos?: { x?: number ; y?: number } ; style?: { size?: "small" | "regular" | "large"; icon?: any; color?: string; cssOverride?: Record<string, string>; } ; visibleInputs?: string[] ; visibleOutputs?: string[] }, { id?: string ; inputConfig?: Record<string, { mode?: "static" ; value?: any } | { mode?: "queue" } | { mode?: "sticky" }> ; node?: any ; nodeId?: string ; pos?: { x?: number ; y?: number } ; style?: { size?: "small" | "regular" | "large"; icon?: any; color?: string; cssOverride?: Record<string, string>; } ; visibleInputs?: string[] ; visibleOutputs?: string[] }>, "many"> }, "strip", ZodTypeAny, { connections?: { delayed?: boolean ; from?: { insId?: string; pinId?: string; } ; hidden?: boolean ; to?: { insId?: string; pinId?: string; } }[] ; instances?: { pos?: { x?: number; y?: number; }; id?: string; inputConfig?: Record<string, { mode?: "static"; value?: any; } | { mode?: "queue"; } | { mode?: "sticky"; }>; visibleInputs?: string[]; visibleOutputs?: string[]; nodeId?: string; node?: any; style?: { ...; }; }[] }, { connections?: { delayed?: boolean ; from?: { insId?: string; pinId?: string; } ; hidden?: boolean ; to?: { insId?: string; pinId?: string; } }[] ; instances?: { pos?: { x?: number; y?: number; }; id?: string; inputConfig?: Record<string, { mode?: "static"; value?: any; } | { mode?: "queue"; } | { mode?: "sticky"; }>; visibleInputs?: string[]; visibleOutputs?: string[]; nodeId?: string; node?: any; style?: { ...; }; }[] }>, ZodObject<{ completionOutputs: ZodOptional<ZodArray<ZodString, "many">> ; customViewCode: ZodOptional<ZodString> ; dataBuilderSource: ZodOptional<ZodString> ; defaultStyle: ZodOptional<ZodObject<{ color: ZodOptional<ZodString> ; cssOverride: ZodOptional<ZodRecord<ZodString, ZodString>> ; icon: ZodOptional<ZodAny> ; size: ZodOptional<ZodEnum<["small", "regular", "large"]>> }, "strip", ZodTypeAny, { color?: string ; cssOverride?: Record<string, string> ; icon?: any ; size?: "small" | "regular" | "large" }, { color?: string ; cssOverride?: Record<string, string> ; icon?: any ; size?: "small" | "regular" | "large" }>> ; description: ZodOptional<ZodString> ; id: ZodOptional<ZodString> ; inputs: ZodRecord<ZodString, ZodUnion<[ZodString, ZodObject<{ defaultValue: ZodOptional<ZodAny> ; description: ZodOptional<ZodString> ; mode: ZodEnum<["required", "optional", "required-if-connected"]> ; type: ZodOptional<ZodString> }, "strip", ZodTypeAny, { defaultValue?: any ; description?: string ; mode?: "required" | "optional" | "required-if-connected" ; type?: string }, { defaultValue?: any ; description?: string ; mode?: "required" | "optional" | "required-if-connected" ; type?: string }>]>> ; inputsPosition: ZodOptional<ZodRecord<ZodString, ZodObject<{ x: ZodNumber ; y: ZodNumber }, "strict", ZodTypeAny, { x?: number ; y?: number }, { x?: number ; y?: number }>>> ; outputs: ZodRecord<ZodString, ZodObject<{ delayed: ZodOptional<ZodBoolean> ; description: ZodOptional<ZodString> ; optional: ZodOptional<ZodBoolean> ; type: ZodOptional<ZodString> }, "strip", ZodTypeAny, { delayed?: boolean ; description?: string ; optional?: boolean ; type?: string }, { delayed?: boolean ; description?: string ; optional?: boolean ; type?: string }>> ; outputsPosition: ZodOptional<ZodRecord<ZodString, ZodObject<{ x: ZodNumber ; y: ZodNumber }, "strict", ZodTypeAny, { x?: number ; y?: number }, { x?: number ; y?: number }>>> ; reactiveInputs: ZodOptional<ZodArray<ZodString, "many">> ; searchKeywords: ZodOptional<ZodArray<ZodString, "many">> ; templateType: ZodOptional<ZodString> }, "strip", ZodTypeAny, { completionOutputs?: string[] ; customViewCode?: string ; dataBuilderSource?: string ; defaultStyle?: { size?: "small" | "regular" | "large"; icon?: any; color?: string; cssOverride?: Record<string, string>; } ; description?: string ; id?: string ; inputs?: Record<string, string | { mode?: "required" | "optional" | "required-if-connected"; type?: string; description?: string; defaultValue?: any; }> ; inputsPosition?: Record<string, { x?: number ; y?: number }> ; outputs?: Record<string, { type?: string; optional?: boolean; delayed?: boolean; description?: string; }> ; outputsPosition?: Record<string, { x?: number ; y?: number }> ; reactiveInputs?: string[] ; searchKeywords?: string[] ; templateType?: string }, { completionOutputs?: string[] ; customViewCode?: string ; dataBuilderSource?: string ; defaultStyle?: { size?: "small" | "regular" | "large"; icon?: any; color?: string; cssOverride?: Record<string, string>; } ; description?: string ; id?: string ; inputs?: Record<string, string | { mode?: "required" | "optional" | "required-if-connected"; type?: string; description?: string; defaultValue?: any; }> ; inputsPosition?: Record<string, { x?: number ; y?: number }> ; outputs?: Record<string, { type?: string; optional?: boolean; delayed?: boolean; description?: string; }> ; outputsPosition?: Record<string, { x?: number ; y?: number }> ; reactiveInputs?: string[] ; searchKeywords?: string[] ; templateType?: string }>> = visualNode }, "strict", ZodTypeAny, { imports?: Record<string, string | string[]> ; node?: { connections?: { from?: { insId?: string; pinId?: string; }; to?: { insId?: string; pinId?: string; }; delayed?: boolean; hidden?: boolean; }[] ; instances?: { pos?: { x?: number; y?: number; }; id?: string; inputConfig?: Record<string, { mode?: "static"; value?: any; } | { mode?: "queue"; } | { mode?: "sticky"; }>; visibleInputs?: string[]; visibleOutputs?: string[]; nodeId?: string; node?: any; style?: { ...; }; }[] } & { completionOutputs?: string[] ; customViewCode?: string ; dataBuilderSource?: string ; defaultStyle?: { size?: "small" | "regular" | "large"; icon?: any; color?: string; cssOverride?: Record<string, string>; } ; description?: string ; id?: string ; inputs?: Record<string, string | { mode?: "required" | "optional" | "required-if-connected"; type?: string; description?: string; defaultValue?: any; }> ; inputsPosition?: Record<string, { x?: number; y?: number; }> ; outputs?: Record<string, { type?: string; optional?: boolean; delayed?: boolean; description?: string; }> ; outputsPosition?: Record<string, { x?: number; y?: number; }> ; reactiveInputs?: string[] ; searchKeywords?: string[] ; templateType?: string } = visualNode }, { imports?: Record<string, string | string[]> ; node?: { connections?: { from?: { insId?: string; pinId?: string; }; to?: { insId?: string; pinId?: string; }; delayed?: boolean; hidden?: boolean; }[] ; instances?: { pos?: { x?: number; y?: number; }; id?: string; inputConfig?: Record<string, { mode?: "static"; value?: any; } | { mode?: "queue"; } | { mode?: "sticky"; }>; visibleInputs?: string[]; visibleOutputs?: string[]; nodeId?: string; node?: any; style?: { ...; }; }[] } & { completionOutputs?: string[] ; customViewCode?: string ; dataBuilderSource?: string ; defaultStyle?: { size?: "small" | "regular" | "large"; icon?: any; color?: string; cssOverride?: Record<string, string>; } ; description?: string ; id?: string ; inputs?: Record<string, string | { mode?: "required" | "optional" | "required-if-connected"; type?: string; description?: string; defaultValue?: any; }> ; inputsPosition?: Record<string, { x?: number; y?: number; }> ; outputs?: Record<string, { type?: string; optional?: boolean; delayed?: boolean; description?: string; }> ; outputsPosition?: Record<string, { x?: number; y?: number; }> ; reactiveInputs?: string[] ; searchKeywords?: string[] ; templateType?: string } = visualNode }>

Defined in

core/src/flow-schema.ts:134

Functions

NodeInstance

NodeInstance(id, node, config?, pos?): NodeInstance

Parameters

NameType
idstring
nodeNodeDefinition
config?InputPinsConfig
pos?Pos

Returns

NodeInstance

Defined in

core/src/node/node-instance.ts:57


calcCenter

calcCenter(«destructured»): Pos

Parameters

NameType
«destructured»Rect

Returns

Pos

Defined in

core/src/common/utils.ts:27


callFnOrFnPromise

callFnOrFnPromise(maybeFnOrFnPromise, errorMsg): void

Parameters

NameType
maybeFnOrFnPromisevoid | Function | Promise<void | Function>
errorMsgstring

Returns

void

Defined in

core/src/common/utils.ts:132


cappedArrayDebounce

cappedArrayDebounce<T>(cb, timeout, maxItems, maxTimeWaiting?): Object

Type parameters

Name
T

Parameters

NameTypeDefault value
cb(items: T[]) => voidundefined
timeoutnumberundefined
maxItemsnumberundefined
maxTimeWaitingnumber500

Returns

Object

NameType
addItem(item: T) => void
flush() => void
pendingItems() => number

Defined in

core/src/common/capped-array-debounce.ts:1


codeFromFunction

codeFromFunction(«destructured»): CodeNode

Parameters

NameType
«destructured»codeFromFunctionParams

Returns

CodeNode

Defined in

core/src/node/node.ts:373


codeNode

codeNode(partial?): CodeNode

Parameters

NameType
partial?Partial<CodeNode>

Returns

CodeNode

Defined in

core/src/common/test-data-creator/index.ts:1


compileObjectTemplate

compileObjectTemplate(template, inputs): any

Parameters

NameType
templatestring
inputsOMap<any>

Returns

any

Defined in

core/src/common/value-builders/index.ts:19


compileStringTemplate

compileStringTemplate(template, inputs): string

Parameters

NameType
templatestring
inputsOMap<any>

Returns

string

Defined in

core/src/common/value-builders/index.ts:3


connect

connect(node, resolvedDeps, _debugger?, ancestorsInsIds?, mainState?, onBubbleError?, env?, extraContext?): CodeNode

Parameters

NameTypeDefault value
nodePositionlessVisualNodeundefined
resolvedDepsNodesCollectionundefined
_debuggerDebugger{}
ancestorsInsIds?stringundefined
mainStateOMap<NodeState>{}
onBubbleError(err: any) => voidnoop
envExecuteEnv{}
extraContextRecord<string, any>{}

Returns

CodeNode

Defined in

core/src/connect/index.ts:59


connection

connection(from, to, delayed?): ConnectionData

Parameters

NameTypeDefault value
fromConnectionNodeundefined
toConnectionNodeundefined
delayedbooleanfalse

Returns

ConnectionData

Defined in

core/src/connect/helpers.ts:134


connectionData

connectionData(from, to, delayed?): ConnectionData

Parameters

NameType
fromstring
tostring
delayed?boolean

Returns

ConnectionData

Defined in

core/src/connect/helpers.ts:91

connectionData(from, to, delayed?): ConnectionData

Parameters

NameType
from[string, string]
to[string, string]
delayed?boolean

Returns

ConnectionData

Defined in

core/src/connect/helpers.ts:96

connectionData(from, to, delayed?): ConnectionData

Parameters

NameType
from[string, string]
to[string]
delayed?boolean

Returns

ConnectionData

Defined in

core/src/connect/helpers.ts:101

connectionData(from, to, delayed?): ConnectionData

Parameters

NameType
from[string]
to[string, string]
delayed?boolean

Returns

ConnectionData

Defined in

core/src/connect/helpers.ts:106


connectionDataEquals

connectionDataEquals(cd1?, cd2?): boolean

Parameters

NameType
cd1?ConnectionData
cd2?ConnectionData

Returns

boolean

Defined in

core/src/connect/helpers.ts:78


connectionNode

connectionNode(insId, pinId): ConnectionNode

Parameters

NameType
insIdstring
pinIdstring

Returns

ConnectionNode

Defined in

core/src/connect/helpers.ts:64


connectionNodeEquals

connectionNodeEquals(conn1, conn2): boolean

Parameters

NameType
conn1ConnectionNode
conn2ConnectionNode

Returns

boolean

Defined in

core/src/connect/helpers.ts:71


containsAll

containsAll<T>(arr, items): boolean

Type parameters

Name
T

Parameters

NameType
arrT[]
itemsT[]

Returns

boolean

Defined in

core/src/common/utils.ts:119


createInsId

createInsId(node): string

Parameters

NameType
nodeNodeDefinition

Returns

string

Defined in

core/src/node/node-instance.ts:69


customNodesToNodesCollection

customNodesToNodesCollection(customNodes, extraContext?): NodesCollection

Parameters

NameType
customNodesNodesCollection
extraContextRecord<string, any>

Returns

NodesCollection

Defined in

core/src/inline-value-to-code-node/index.ts:81


dataShaper

dataShaper(data, maxDepth?, maxArrayCheckIdx?): DataShape

Parameters

NameTypeDefault value
dataanyundefined
maxDepthnumber5
maxArrayCheckIdxnumber5

Returns

DataShape

Defined in

core/src/common/data-shaper/index.tsx:43


debugLogger

debugLogger(subNs): Debugger

Parameters

NameType
subNsstring

Returns

Debugger

Defined in

core/src/common/debug-logger.ts:11


delay

delay(ms): Promise<unknown>

Parameters

NameType
msnumber

Returns

Promise<unknown>

Defined in

core/src/common/utils.ts:178


dynamicNodeInput

dynamicNodeInput(partial?): DynamicNodeInput

Parameters

NameType
partial?Partial<DynamicNodeInput>

Returns

DynamicNodeInput

Defined in

core/src/common/test-data-creator/index.ts:1


dynamicNodeInputs

dynamicNodeInputs(count?): DynamicNodeInput[]

Parameters

NameTypeDefault value
countnumber10

Returns

DynamicNodeInput[]

Defined in

core/src/node/node-pins.ts:84


dynamicOutput

dynamicOutput(): DynamicOutput

Returns

DynamicOutput

Defined in

core/src/node/node-pins.ts:75


ensure

ensure<T>(v, msg?): NonNullable<T>

Type parameters

Name
T

Parameters

NameType
vT
msg?string

Returns

NonNullable<T>

Defined in

core/src/common/utils.ts:162


entries

entries<V>(map): [string, V][]

Type parameters

Name
V

Parameters

NameType
mapOMap<V>

Returns

[string, V][]

Defined in

core/src/common/utils.ts:68


eventually

eventually(callback, timeout?, retryDelay?, errorSet?): Promise<void>

Parameters

NameTypeDefault value
callback() => voidundefined
timeoutnumber1000
retryDelaynumber100
errorSetSet<string>undefined

Returns

Promise<void>

Defined in

core/src/common/utils.ts:182


execute

execute(params): CancelFn

Parameters

NameType
paramsExecuteParams

Returns

CancelFn

Defined in

core/src/execute/index.ts:486


externalConnectionNode

externalConnectionNode(pinId): ExternalConnectionNode

Parameters

NameType
pinIdstring

Returns

ExternalConnectionNode

Defined in

core/src/connect/helpers.ts:58


extractStaticValue

extractStaticValue(arg): any

Parameters

NameType
argNodeInput

Returns

any

Defined in

core/src/node/node-pins.ts:111


filterOMap

filterOMap<T>(map, cb): OMap<T>

Type parameters

Name
T

Parameters

NameType
mapOMap<T>
cb(key: string, item: T) => boolean

Returns

OMap<T>

Defined in

core/src/common/utils.ts:47


formatEvent

formatEvent(event): string

Parameters

NameType
eventDebuggerEvent

Returns

string

Defined in

core/src/execute/debugger/format-event.ts:20


fromEntries

fromEntries<V>(entries): OMap<V>

Type parameters

Name
V

Parameters

NameType
entries[string, V][]

Returns

OMap<V>

Defined in

core/src/common/utils.ts:72


fromSimplified

fromSimplified(«destructured»): CodeNode

Parameters

NameType
«destructured»SimplifiedNodeParams

Returns

CodeNode

Defined in

core/src/node/node.ts:284


fullInsIdPath

fullInsIdPath(insId, ancestorsInsIds?): string

Parameters

NameType
insIdstring
ancestorsInsIds?string

Returns

string

Defined in

core/src/common/full-ins-id-path.ts:1


getEnvKeyFromValue

getEnvKeyFromValue(value): string

Parameters

NameType
valuestring

Returns

string

Defined in

core/src/node/node-pins.ts:127


getInputName

getInputName(pinId): string

Parameters

NameType
pinIdstring

Returns

string

Defined in

core/src/connect/helpers.ts:17


getNode

getNode(idOrIns, resolvedNodes): Node

Parameters

NameType
idOrInsstring | NodeInstance
resolvedNodesNodesCollection

Returns

Node

Defined in

core/src/node/node.ts:334


getNodeDef

getNodeDef(idOrIns, resolvedNodes): NodeDefinition

Parameters

NameType
idOrInsstring | NodeInstance
resolvedNodesNodesDefCollection

Returns

NodeDefinition

Defined in

core/src/node/node.ts:349


getNodeInputs

getNodeInputs(node): Object

Parameters

NameType
nodeNodeDefinition

Returns

Object

NameType
__triggerInputPin

Defined in

core/src/connect/helpers.ts:13


getNodeOutputs

getNodeOutputs(node): Object

Parameters

NameType
nodeNodeDefinition

Returns

Object

NameType
__errorOutputPin

Defined in

core/src/connect/helpers.ts:35


getNodeWithDependencies

getNodeWithDependencies(node, resolvedDeps, existingIds?): CustomNode[]

Parameters

NameTypeDefault value
nodeCustomNodeundefined
resolvedDepsCustomNodeCollectionundefined
existingIdsstring[][]

Returns

CustomNode[]

Defined in

core/src/node/get-node-with-dependencies.ts:5


getOutputName

getOutputName(pinId): string

Parameters

NameType
pinIdstring

Returns

string

Defined in

core/src/connect/helpers.ts:26


getStaticValue

getStaticValue(value, resolvedDeps, calleeId): any

Parameters

NameType
valueany
resolvedDepsNodesDefCollection
calleeIdstring

Returns

any

Defined in

core/src/node/node.ts:315


hashFlow

hashFlow(flow): string

Parameters

NameType
flowFlydeFlow

Returns

string

Defined in

core/src/common/hasher/index.ts:55


hashNode

hashNode(node, ignorePos?): string

Parameters

NameTypeDefault value
nodeNodeundefined
ignorePosbooleantrue

Returns

string

Defined in

core/src/common/hasher/index.ts:9


inlineNodeInstance

inlineNodeInstance(id, node, config?, pos?): NodeInstance

Parameters

NameType
idstring
nodeNode
config?InputPinsConfig
pos?Pos

Returns

NodeInstance

Defined in

core/src/node/node-instance.ts:37


inlineValueNode

inlineValueNode(partial?): InlineValueNode

Parameters

NameType
partial?Partial<InlineValueNode>

Returns

InlineValueNode

Defined in

core/src/common/test-data-creator/index.ts:1


inlineValueNodeToNode

inlineValueNodeToNode(inlineValueNode, extraContext?): CodeNode

Parameters

NameType
inlineValueNodeInlineValueNode
extraContextRecord<string, any>

Returns

CodeNode

Defined in

core/src/inline-value-to-code-node/index.ts:22


intersectRect

intersectRect(r1, r2): boolean

Parameters

NameType
r1Rect
r2Rect

Returns

boolean

Defined in

core/src/common/utils.ts:16


isBaseNode

isBaseNode(p): p is BaseNode

Parameters

NameType
pany

Returns

p is BaseNode

Defined in

core/src/node/node.ts:235


isCodeNode

isCodeNode(p): p is CodeNode

Parameters

NameType
pany

Returns

p is CodeNode

Defined in

core/src/node/node.ts:239


isDefined

isDefined<T>(o): o is NonNullable<T>

Type parameters

Name
T

Parameters

NameType
oT

Returns

o is NonNullable<T>

Defined in

core/src/common/utils.ts:123


isDynamicInput

isDynamicInput(arg): arg is DynamicNodeInput

Parameters

NameType
argNodeInput

Returns

arg is DynamicNodeInput

Defined in

core/src/node/node-pins.ts:98


isEnvValue

isEnvValue(value): boolean

Parameters

NameType
valueany

Returns

boolean

Defined in

core/src/node/node-pins.ts:119


isExternalConnection

isExternalConnection(«destructured»): boolean

Parameters

NameType
«destructured»ConnectionData

Returns

boolean

Defined in

core/src/connect/helpers.ts:51


isExternalConnectionNode

isExternalConnectionNode(node): node is ExternalConnectionNode

Parameters

NameType
nodeConnectionNode

Returns

node is ExternalConnectionNode

Defined in

core/src/connect/helpers.ts:39


isInlineNodeInstance

isInlineNodeInstance(ins): ins is InlineNodeInstance

Parameters

NameType
insNodeInstance

Returns

ins is InlineNodeInstance

Defined in

core/src/node/node-instance.ts:49


isInlineValueNode

isInlineValueNode(p): p is InlineValueNode

Parameters

NameType
pVisualNode | InlineValueNode | CodeNode | CodeNodeDefinition

Returns

p is InlineValueNode

Defined in

core/src/node/node.ts:247


isInputPinOptional

isInputPinOptional(input): boolean

Parameters

NameType
inputInputPin

Returns

boolean

Defined in

core/src/node/node-pins.ts:38


isInternalConnection

isInternalConnection(conn): boolean

Parameters

NameType
connConnectionData

Returns

boolean

Defined in

core/src/connect/helpers.ts:55


isInternalConnectionNode

isInternalConnectionNode(node): node is InternalConnectionNode

Parameters

NameType
nodeConnectionNode

Returns

node is InternalConnectionNode

Defined in

core/src/connect/helpers.ts:45


isOptionalType

isOptionalType(type): boolean

Parameters

NameType
typestring

Returns

boolean

Defined in

core/src/common/utils.ts:158


isPromise

isPromise<T>(o): o is Promise<T>

Type parameters

Name
T

Parameters

NameType
oany

Returns

o is Promise<T>

Defined in

core/src/common/utils.ts:127


isQueueInputPinConfig

isQueueInputPinConfig(config): config is QueueInputPinConfig

Parameters

NameType
configInputPinConfig

Returns

config is QueueInputPinConfig

Defined in

core/src/node/pin-config.ts:40


isRefNodeInstance

isRefNodeInstance(ins): ins is RefNodeInstance

Parameters

NameType
insNodeInstance

Returns

ins is RefNodeInstance

Defined in

core/src/node/node-instance.ts:54


isStaticInput

isStaticInput(arg): arg is StaticNodeInput

Parameters

NameType
argNodeInput

Returns

arg is StaticNodeInput

Defined in

core/src/node/node-pins.ts:105


isStaticInputPinConfig

isStaticInputPinConfig(config): config is StaticInputPinConfig

Parameters

NameType
configInputPinConfig

Returns

config is StaticInputPinConfig

Defined in

core/src/node/pin-config.ts:52


isStaticValueVisualNode

isStaticValueVisualNode(val): boolean

Parameters

NameType
valInputStaticValue

Returns

boolean

Defined in

core/src/index.ts:27


isStickyInputPinConfig

isStickyInputPinConfig(config): config is StickyInputPinConfig

Parameters

NameType
configInputPinConfig

Returns

config is StickyInputPinConfig

Defined in

core/src/node/pin-config.ts:46


isVisualNode

isVisualNode(p): p is VisualNode

Parameters

NameType
pVisualNode | InlineValueNode | CodeNode | CodeNodeDefinition

Returns

p is VisualNode

Defined in

core/src/node/node.ts:243


keys

keys<V>(map): string[]

Type parameters

Name
V

Parameters

NameType
mapOMap<V>

Returns

string[]

Defined in

core/src/common/utils.ts:58


mapOMap

mapOMap<T>(map, cb): OMap<T>

Type parameters

Name
T

Parameters

NameType
mapOMap<T>
cb(key: string, item: T) => T

Returns

OMap<T>

Defined in

core/src/common/utils.ts:39


maybeGetStaticValueNodeId

maybeGetStaticValueNodeId(value): string

Parameters

NameType
valuestring

Returns

string

Defined in

core/src/node/node.ts:306


middlePos

middlePos(p1, p2): Pos

Parameters

NameType
p1Pos
p2Pos

Returns

Pos

Defined in

core/src/common/utils.ts:33


nodeFromSimpleFunction

nodeFromSimpleFunction(data): CodeNode

Parameters

NameType
dataSimpleFnData

Returns

CodeNode

Defined in

core/src/node/nodeFromSimpleFunction.ts:23


nodeInput

nodeInput(mode?): InputPin

Parameters

NameTypeDefault value
modeInputMode"required"

Returns

InputPin

Defined in

core/src/node/node-pins.ts:34


nodeInputs

nodeInputs(count, modes?): InputPin[]

Parameters

NameType
countnumber
modes?InputMode[]

Returns

InputPin[]

Defined in

core/src/node/node-pins.ts:42


nodeInstance

nodeInstance(id, nodeOrId, config?, pos?): NodeInstance

Parameters

NameType
idstring
nodeOrIdstring
config?InputPinsConfig
pos?Pos

Returns

NodeInstance

Defined in

core/src/node/node-instance.ts:25


nodeOutput

nodeOutput(delayed?): OutputPin

Parameters

NameTypeDefault value
delayedbooleanfalse

Returns

OutputPin

Defined in

core/src/node/node-pins.ts:47


nodeOutputs

nodeOutputs(count): OutputPin[]

Parameters

NameType
countnumber

Returns

OutputPin[]

Defined in

core/src/node/node-pins.ts:51


noop

noop(): void

Returns

void

Defined in

core/src/common/utils.ts:174


okeys

okeys<V>(map): string[]

Type parameters

Name
V

Parameters

NameType
mapOMap<V>

Returns

string[]

Defined in

core/src/common/utils.ts:58


pickFirst

pickFirst<K>(v): K

Type parameters

Name
K

Parameters

NameType
v[K, any]

Returns

K

Defined in

core/src/common/utils.ts:78


pickRandom

pickRandom<K>(v): K

Type parameters

Name
K

Parameters

NameType
vK[]

Returns

K

Defined in

core/src/common/utils.ts:97


pickSecond

pickSecond<K>(v): K

Type parameters

Name
K

Parameters

NameType
v[any, K]

Returns

K

Defined in

core/src/common/utils.ts:79


queueInputPinConfig

queueInputPinConfig(): QueueInputPinConfig

Returns

QueueInputPinConfig

Defined in

core/src/node/pin-config.ts:27


randomInt

randomInt(max): number

Parameters

NameType
maxnumber

Returns

number

Defined in

core/src/common/utils.ts:82

randomInt(max, min): number

Parameters

NameType
maxnumber
minnumber

Returns

number

Defined in

core/src/common/utils.ts:83


randomInts

randomInts(count, to?, from?): number[]

Parameters

NameTypeDefault value
countnumberundefined
tonumber100
fromnumber0

Returns

number[]

Defined in

core/src/common/utils.ts:106


randomPos

randomPos(to?, from?): Pos

Parameters

NameTypeDefault value
tonumber1000
fromnumber0

Returns

Pos

Defined in

core/src/common/utils.ts:91


removeDupes

removeDupes(list): string[]

Parameters

NameType
liststring[]

Returns

string[]

Defined in

core/src/common/utils.ts:170


repeat

repeat<T>(count, run): T[]

Type parameters

Name
T

Parameters

NameType
countnumber
run(idx: number) => T

Returns

T[]

Defined in

core/src/common/utils.ts:99


shuffle

shuffle(arr): any[]

Parameters

NameType
arrany[]

Returns

any[]

Defined in

core/src/common/utils.ts:110


simplePluralize

simplePluralize(count, noun): string

Parameters

NameType
countnumber
nounstring

Returns

string

Defined in

core/src/common/utils.ts:209


simplifiedExecute

simplifiedExecute(nodeToRun, resolvedDependencies, inputs, onOutput?, otherParams?): CancelFn

Parameters

NameType
nodeToRunNode
resolvedDependenciesNodesCollection
inputsRecord<string, any>
onOutput?(key: string, data: any) => void
otherParamsPartial<ExecuteParams>

Returns

CancelFn

Defined in

core/src/simplified-execute.ts:11


staticInputPinConfig

staticInputPinConfig(value): StaticInputPinConfig

Parameters

NameType
valueany

Returns

StaticInputPinConfig

Defined in

core/src/node/pin-config.ts:35


staticNodeInput

staticNodeInput(value): StaticNodeInput

Parameters

NameType
valueany

Returns

StaticNodeInput

Defined in

core/src/node/node-pins.ts:94


stickyInputPinConfig

stickyInputPinConfig(): StickyInputPinConfig

Returns

StickyInputPinConfig

Defined in

core/src/node/pin-config.ts:31


testDataCreator

testDataCreator<T>(defaults): TestDataCreator<T>

Type parameters

NameType
Textends object

Parameters

NameType
defaultsObjOrObjCreator<T>

Returns

TestDataCreator<T>

Defined in

core/src/common/test-data-creator/index.ts:5


toEnvValue

toEnvValue(name): string

Parameters

NameType
nameany

Returns

string

Defined in

core/src/node/node-pins.ts:123


values

values<V>(map): V[]

Type parameters

Name
V

Parameters

NameType
mapOMap<V>

Returns

V[]

Defined in

core/src/common/utils.ts:62


visualNode

visualNode(partial?): VisualNode

Parameters

NameType
partial?Partial<VisualNode>

Returns

VisualNode

Defined in

core/src/common/test-data-creator/index.ts:1

- + \ No newline at end of file diff --git a/docs/code-nodes/index.html b/docs/code-nodes/index.html index 1e8657134..d4f242809 100644 --- a/docs/code-nodes/index.html +++ b/docs/code-nodes/index.html @@ -14,15 +14,15 @@ - - + +

Creating New Code Nodes

While Flyde is a great tool for creating flows, sometimes you need to do something that is not possible with the built-in components. Code nodes allow you to create custom components using TypeScript or JavaScript. Inside Code nodes you can use any library you want.

To create a new code node, you need to:

  1. Create a new file ending with .flyde.ts (or .flyde.js if you prefer JavaScript)
  2. Export an object that adheres to the CodeNode interface. Actually, you can return as many code nodes as you want from a single file

The .flyde.[j|t]s ending hints the Flyde editor to look for code nodes in this file, and suggest them inside the "add node" menu.

Example

Let's say we want create a scraping node that uses Scrape-it. We can create a new file called scrape-it.flyde.ts and add the following code:

import { CodeNode } from "@flyde/core";
import scrapeIt from "scrape-it";

export const scrapeItNode: CodeNode = {
name: "Scrape It",
description: "Scrapes a website",
inputs: {
url: {
type: "string",
description: "The URL to scrape",
},
options: {
type: "object",
description: "The options to pass to scrape-it",
},
},
outputs: {
data: {
type: "object",
description: "The scraped data",
},
},
async fn(inputs) {
const data = await scrapeIt(inputs.url, inputs.options);

return {
data,
};
},
};

Then, you should be able to use it in your flows!

- + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index ade889a8e..995e2ca05 100644 --- a/docs/index.html +++ b/docs/index.html @@ -14,14 +14,14 @@ - - + +

Welcome to Flyde!

Flyde is a powerful visual programming tool that allows you to build applications using a simple "nodes and wires" style. With Flyde, you can create visual flows that represent the logic and control flow of your application, using a variety of pre-built components or by building your own.

Flyde is designed to be intuitive and easy to use, even for those with little or no programming experience. It allows you to build complex applications quickly and easily, without getting bogged down in the technical details of how to do it. Whether you're a seasoned developer or just starting out, Flyde has something to offer.

Next steps

- + \ No newline at end of file diff --git a/docs/lifecycle/index.html b/docs/lifecycle/index.html index 1325c8dc2..8449beb0a 100644 --- a/docs/lifecycle/index.html +++ b/docs/lifecycle/index.html @@ -14,14 +14,14 @@ - - + +

Lifecycle of a Node

A node in Flyde is a self-contained unit of functionality that can be connected to other nodes to form a flow. The lifecycle of a node consists of two states: waiting for inputs, and processing.

When a node is waiting for inputs, it is waiting for data to be passed to it through its input pins. Once all required input pins have received data, the node will start processing.

By default, input pins are "sticky", meaning that each new input will replace the previous one. However, input pins can also be configured to queue up different values in a first-in-first-out (FIFO) manner.

A code node's processing is determined by the logic implemented in its fn function. If the fn function returns a promise, the node will be considered "processing" until the promise is either resolved or rejected.

A visual node, on the other hand, is a group of other nodes connected together in a "nodes and wires" style. The processing of a visual node is determined by the processing of its child nodes.

Once a node has finished processing, it is considered completed. For code nodes, completion is determined by the end of the fn function. For visual nodes, completion is determined by the completion of all its child nodes.

In addition to these states, nodes can also have completion outputs and reactive inputs. Completion outputs are output pins that, when triggered, signify that the node has completed. If a node does not have any completion outputs, it will be considered completed as soon as no other nodes are "processing".

Reactive inputs are input pins that, when triggered, will cause the node to start processing again, even if it is already processing. This can be useful for implementing reactive behavior in a flow.

While a node is processing, it can access its internal state through the adv.state object. This state is cleared once the node is completed.

It is also possible for a node to report errors by calling the adv.onError function. This can be used to handle unexpected behavior or invalid input in a flow.

Finally, a node can specify cleanup logic to be executed when it is completed by calling the adv.onCleanup function. This

- + \ No newline at end of file diff --git a/docs/packages/index.html b/docs/packages/index.html index 06c4ff84f..4496a6fb0 100644 --- a/docs/packages/index.html +++ b/docs/packages/index.html @@ -14,14 +14,14 @@ - - + +

Installing/Publishing Packages

Installing Flyde packages

Flyde packages are published to npm, and can be installed using the standard npm install command. To install a Flyde package, run the following command: npm install flyde-mypackage or yarn add flyde-mypackage.

Publishing Flyde packages

Flyde leverages the existing npm ecosystem to manage packages. To publish Flyde nodes to npm, you need to add a "flyde.exposes" property to your package.json - an array of globs that will contain Flyde nodes (either code nodes or visual nodes). Additionally, you should make sure that the package name starts with "flyde-", and includes the "flyde" and "flyde-package" keywords in the package.json.

Step 1: Prepare your package

Create a new npm package or use an existing one. Make sure that the package contains the Flyde nodes that you want to publish in a folder called "nodes" or any other folder of your choice. The nodes should be either .flyde, .flyde.js or .flyde.ts files.

{
"name": "flyde-mypackage",
"version": "1.0.0",
"description": "My Flyde package",
"dependencies": {
"@flyde/core": "^0.1.0"
},
"flyde": {
"exposes": [
"nodes/**/*.flyde",
"nodes/**/*.flyde.js",
"nodes/**/*.flyde.ts"
]
},
"keywords": ["flyde", "flyde-package"]
}

Please note that the above example is using @flyde/core as a dependency, this is mandatory for all Flyde packages, but you can add other dependencies as you see fit.

Step 2: Publish your package

To publish your package, run npm publish or yarn publish. You can also use the --dry-run flag to test your package before publishing it.

Step 3: Install your package

To install your package, run npm install flyde-mypackage or yarn add flyde-mypackage. You can now use the nodes in your Flyde projects.

That's it! You can now publish Flyde packages to npm and install them in your Flyde projects.

If you've built a cool package and would like to be featured on the Flyde website, please let us know here.

- + \ No newline at end of file diff --git a/docs/quick-start/index.html b/docs/quick-start/index.html index 5f14c17d2..539b975a1 100644 --- a/docs/quick-start/index.html +++ b/docs/quick-start/index.html @@ -14,15 +14,15 @@ - - + +

Quick Start Guide

Welcome to Flyde! This quick start guide will help you get up and running with Flyde in no time.

Note: this guide is meant to cater to the impatient! Checking out the in-depth hello world guide is highly recommended.

Prerequisites

  • VS Code with the Flyde extension installed
  • Node.js and npm (comes with Node)

Step 1: Create a new Flyde project

Open Visual Studio Code and create a new empty directory for your Flyde project.

Step 2: Install the Flyde runtime

In the terminal, navigate to your project directory and run the following command:

npm install @flyde/runtime

This will install the Flyde runtime, which is needed to execute Flyde flows.

Step 3: Create a new Flyde flow

  1. In Visual Studio, open the command palette (cmd+k or ctrl+k)
  2. type in Flyde and selected "Flyde: New Visual Flow"

Step 4: Build your flow

Double click (or press A) to open Flyde's command palette. Add some nodes and connect them together by selecting inputs and outputs

Step 5: Run your flow from code

To run your Flyde flow from code, you can use the loadFlow function from the Flyde runtime. This function takes the name of your Flyde flow file as an argument and returns a function that can be used to execute the flow.

Here's an example of how to use loadFlow:

const { loadFlow } = require("@flyde/runtime");
const executeFlow = loadFlow("MyFlow.flyde");

executeFlow().then(({ message }) => console.log(message));

You can also pass input values to your flow by passing an object to the executeFlow function. The object keys should match the input pin names of your flow.

executeFlow({ input1: "Hello", input2: "World" }).then(({ output1, output2 }) =>
console.log(output1, output2)
);

That's it! You're now ready to start building powerful applications with Flyde. Happy ~coding~ building!

- + \ No newline at end of file diff --git a/docs/terminology/index.html b/docs/terminology/index.html index 085b58031..a150e5e83 100644 --- a/docs/terminology/index.html +++ b/docs/terminology/index.html @@ -14,14 +14,14 @@ - - + +

Terminology Reference

TermDefinition
NodeA unit of functionality that can be connected to other nodes in a flow. Nodes can becode (with functionality written in JavaScript or TypeScript) or a visual node, which is a group of other nodes (visual or code) arranged in a "nodes and wires" style.
Grouped nodeA node that is made up of other nodes arranged in a "nodes and wires" style.
Code nodeA node with functionality written in JavaScript or TypeScript.
Input pinA pin on a node that receives data. Each node can have zero or more input pins.
Output pinA pin on a node that sends data. Each node can have zero or more output pins. For example, a "Split array" node might have one input pin for an array and two output pins for the first and second halves of the array.
Main flow input/output pinSpecial input/output pins that are used to pass data into or out of the main flow. These are typically used to pass data between the main flow and external code (e.g. a user interface).
ConnectionA link between two pins that allows data to flow from one node to another.
Reactive inputsInput pins that trigger the node to execute whenever their value changes.
Completion outputsOutput pins that indicate when the node has finished executing. These are typically used to coordinate the flow of data between nodes
- + \ No newline at end of file diff --git a/index.html b/index.html index 23c0f852b..8fbd32cb5 100644 --- a/index.html +++ b/index.html @@ -14,14 +14,14 @@ - - + +
Star us on GitHub

Visual Programming.
For Developers

Open source, runs in VS Code, integrates with existing TypeScript code, browser and Node.js.

Example.flyde
index.ts
Terminal
Waiting for the example to run..
Double click on nodes to jump to their implementation

Open Source and Transparent

In Flyde, nothing is hidden. From node implementation, to runtime code. Easily access the code behind each node in Flyde’s standard library.

Everything needed to run Flyde flows is open-source and MIT licensed.

Flyde flows and TypeScript code live side by side

Integrates With Existing Workflows. Doesn’t Replace them.

Create Flyde flows right from your IDE. Wrap existing TypeScript code in a Flyde node and use it in your flows. Run flows from existing TypeScript code, from arbitrary CLI scripts, to HTTP request handlers, and even front-end code.

Flows can be version-controlled, and be part CI/CD pipelines, just like regular text-based code.

Visualize data flow and view data passing through nodes

Reason About Programs in New Ways

Unlock new ways to think about, and debug your programs. Have an always-correct diagram of your program.

Flyde’s flow-based, visual approach makes asynchronous and concurrent tasks simpler and intuitive.

Fibonacci sequence in Flyde - a recursive flow example

Flexible and Powerful

Built on a functional-reactive foundation, Flyde enables more than simple input/output flows. It supports everything you'd expect from a textual-based language; recursions, loops and conditionals.

- + \ No newline at end of file diff --git a/markdown-page/index.html b/markdown-page/index.html index 82cf62bfb..2b3e85dae 100644 --- a/markdown-page/index.html +++ b/markdown-page/index.html @@ -14,14 +14,14 @@ - - + +

Markdown page example

You don't need React to write simple standalone pages.

- + \ No newline at end of file diff --git a/playground/apis/index.html b/playground/apis/index.html index 50088523b..2517a7b60 100644 --- a/playground/apis/index.html +++ b/playground/apis/index.html @@ -14,14 +14,14 @@ - - + +

Welcome to Flyde's Online Playground

Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!

Flyde is currently not optimized for mobile devices. Please use a desktop computer for the best experience.

HTTP Requests

Flyde works great for heavy asynchronous & concurrent tasks, like combining several REST APIs together. This example shows exactly that, by combining 3 different REST APIs, the population of the capital of the country your IP is assigned with is retrieved
Output Log
    Nothing to show. Interact with the example to emit some outputs!
    - + \ No newline at end of file diff --git a/playground/bmi/index.html b/playground/bmi/index.html index 4963408ef..31f537140 100644 --- a/playground/bmi/index.html +++ b/playground/bmi/index.html @@ -14,14 +14,14 @@ - - + +

    Welcome to Flyde's Online Playground

    Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!

    Flyde is currently not optimized for mobile devices. Please use a desktop computer for the best experience.

    BMI Calculator

    Simple BMI calculator with a decision tree. There are many things that make sense done visually, and even more that don't. This example showcases Flyde's support for inline code. The BMI calculation uses a simple inline formula, and the final string uses a textual switch case. Flyde exposes dynamic arguments to your inline code automatically if you use the special "inputs." object!
    Output Log
      Nothing to show. Interact with the example to emit some outputs!
      - + \ No newline at end of file diff --git a/playground/debounce-throttling/index.html b/playground/debounce-throttling/index.html index 7ce39eae5..795dc306f 100644 --- a/playground/debounce-throttling/index.html +++ b/playground/debounce-throttling/index.html @@ -14,14 +14,14 @@ - - + +

      Welcome to Flyde's Online Playground

      Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!

      Flyde is currently not optimized for mobile devices. Please use a desktop computer for the best experience.

      Debounce vs. Throttling

      This example takes Flyde's visual feedback to the next level by showing the difference between debouncing and throttling. Click on the buttons below to emit some Emojis.
      Output Log
        Nothing to show. Interact with the example to emit some outputs!
        - + \ No newline at end of file diff --git a/playground/fibonacci/index.html b/playground/fibonacci/index.html index c7819fc26..ec0c74b1e 100644 --- a/playground/fibonacci/index.html +++ b/playground/fibonacci/index.html @@ -14,14 +14,14 @@ - - + +

        Welcome to Flyde's Online Playground

        Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!

        Flyde is currently not optimized for mobile devices. Please use a desktop computer for the best experience.

        Fibonacci Sequence

        This example showcases a classical recursion - the Fibonacci sequence. On numbers higher than 1, the "Fibonacci" node calls itself recursively!
        Output Log
          Nothing to show. Interact with the example to emit some outputs!
          - + \ No newline at end of file diff --git a/playground/hello-world/index.html b/playground/hello-world/index.html index 489be7c7a..0c38dc974 100644 --- a/playground/hello-world/index.html +++ b/playground/hello-world/index.html @@ -14,14 +14,14 @@ - - + +

          Welcome to Flyde's Online Playground

          Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!

          Flyde is currently not optimized for mobile devices. Please use a desktop computer for the best experience.

          Hello World

          This is the "Hello, World!" example for Flyde. When you run this flow, it will output "Hello", wait for 3 seconds, and then output "World!". Click the "Run" button below to see it in action. This example highlights one of the key strengths of Flyde: the ability to view your program running in real-time. Note that the delay in the flow is intentional and added to make the example longer.
          Output Log
            Nothing to show. Interact with the example to emit some outputs!
            - + \ No newline at end of file diff --git a/playground/index.html b/playground/index.html index 3be1d3fd9..b506c18d5 100644 --- a/playground/index.html +++ b/playground/index.html @@ -14,14 +14,14 @@ - - + +

            Welcome to Flyde's Online Playground

            Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!

            Flyde is currently not optimized for mobile devices. Please use a desktop computer for the best experience.

            Hello World

            This is the "Hello, World!" example for Flyde. When you run this flow, it will output "Hello", wait for 3 seconds, and then output "World!". Click the "Run" button below to see it in action. This example highlights one of the key strengths of Flyde: the ability to view your program running in real-time. Note that the delay in the flow is intentional and added to make the example longer.
            Output Log
              Nothing to show. Interact with the example to emit some outputs!
              - + \ No newline at end of file diff --git a/playground/react-counter/index.html b/playground/react-counter/index.html index 0957effb3..c46d442a9 100644 --- a/playground/react-counter/index.html +++ b/playground/react-counter/index.html @@ -14,14 +14,14 @@ - - + +

              Welcome to Flyde's Online Playground

              Choose one of the examples below to get started. Feel free to play around with the canvas and see how your changes affect the result!

              Flyde is currently not optimized for mobile devices. Please use a desktop computer for the best experience.

              React Counter Example

              This examples how Flyde can be used to build functional reactive UIs using React! Each time the "jsx" output receives a new value, it is rendered to the output pane.
              Output JSX
              Loading
              - + \ No newline at end of file