@kong-ui-public/entities-plugins 10.2.1 → 10.2.2-pr.3988.ef7ce04b3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1509,7 +1509,7 @@ const Mo = "{key}", Mi = {
1509
1509
  writable: !1,
1510
1510
  readable: !0
1511
1511
  },
1512
- "kong.client.get_identity_realm_source": {
1512
+ "kong.client.identity_realm_source": {
1513
1513
  dataType: "object",
1514
1514
  writable: !1,
1515
1515
  readable: !0
@@ -1629,7 +1629,7 @@ const Mo = "{key}", Mi = {
1629
1629
  writable: !0,
1630
1630
  readable: !1
1631
1631
  },
1632
- "kong.service.request_scheme": {
1632
+ "kong.service.request.scheme": {
1633
1633
  dataType: "string ({scheme})",
1634
1634
  writable: !0,
1635
1635
  readable: !1
@@ -2255,7 +2255,7 @@ function Km(e, t, n, i, o) {
2255
2255
  }
2256
2256
  function fS(e, t, n, i, o) {
2257
2257
  const a = { ...e.config, nodes: t };
2258
- i !== void 0 && (a.resources = i);
2258
+ i !== void 0 ? a.resources = i : a.resources && (a.resources = null);
2259
2259
  const r = {
2260
2260
  ...e.__ui_data,
2261
2261
  ...n
@@ -1,6 +1,6 @@
1
1
  (function(Ve,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@kong/icons"),require("@kong/kongponents"),require("@vue-flow/background"),require("@vue-flow/controls"),require("@vue-flow/core"),require("@vueuse/core"),require("@kong-ui-public/i18n"),require("@kong-ui-public/freeform"),require("@vue-flow/controls/dist/style.css"),require("@vue-flow/core/dist/style.css"),require("@vue-flow/core/dist/theme-default.css"),require("@kong-ui-public/entities-shared"),require("@kong-ui-public/entities-plugins-icon"),require("@kong-ui-public/entities-plugins-metadata"),require("@kong-ui-public/forms"),require("@kong-ui-public/monaco-editor"),require("monaco-editor"),require("vue-router"),require("@kong-ui-public/monaco-editor/dist/runtime/style.css"),require("@kong-ui-public/freeform/style.css"),require("@kong-ui-public/entities-redis-configurations"),require("@kong-ui-public/entities-redis-configurations/dist/style.css"),require("@kong-ui-public/entities-vaults"),require("shiki"),require("zod"),require("@kong-ui-public/misc-widgets"),require("@kong-ui-public/misc-widgets/dist/style.css"),require("axios"),require("dompurify"),require("marked"),require("@kong-ui-public/entities-vaults/dist/style.css"),require("@kong-ui-public/forms/dist/style.css")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/icons","@kong/kongponents","@vue-flow/background","@vue-flow/controls","@vue-flow/core","@vueuse/core","@kong-ui-public/i18n","@kong-ui-public/freeform","@vue-flow/controls/dist/style.css","@vue-flow/core/dist/style.css","@vue-flow/core/dist/theme-default.css","@kong-ui-public/entities-shared","@kong-ui-public/entities-plugins-icon","@kong-ui-public/entities-plugins-metadata","@kong-ui-public/forms","@kong-ui-public/monaco-editor","monaco-editor","vue-router","@kong-ui-public/monaco-editor/dist/runtime/style.css","@kong-ui-public/freeform/style.css","@kong-ui-public/entities-redis-configurations","@kong-ui-public/entities-redis-configurations/dist/style.css","@kong-ui-public/entities-vaults","shiki","zod","@kong-ui-public/misc-widgets","@kong-ui-public/misc-widgets/dist/style.css","axios","dompurify","marked","@kong-ui-public/entities-vaults/dist/style.css","@kong-ui-public/forms/dist/style.css"],t):(Ve=typeof globalThis<"u"?globalThis:Ve||self,t(Ve["kong-ui-public-entities-plugins"]={},Ve.Vue,Ve.KongIcons,Ve.Kongponents,Ve.background,Ve.controls,Ve.core$1,Ve.core,Ve["kong-ui-public-i18n"],Ve.utils,null,null,null,Ve["kong-ui-public-entities-shared"],Ve.entitiesPluginsIcon,Ve.entitiesPluginsMetadata,Ve.forms,Ve.monacoEditor,Ve.monaco,Ve.VueRouter,null,null,Ve.entitiesRedisConfigurations,null,Ve.entitiesVaults,Ve.shiki,Ve.zod,Ve["kong-ui-public-misc-widgets"],null,Ve.axios,Ve.DOMPurify,Ve.marked))})(this,(function(Ve,t,Se,be,yN,Th,kt,At,Vt,N,nW,rW,oW,pe,pr,W,We,ma,ro,mr,iW,aW,wu,sW,ga,_N,$,Oh,lW,Go,Qs,ku){"use strict";function Bh(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}function bN(e,n){for(var r=0;r<n.length;r++){const o=n[r];if(typeof o!="string"&&!Array.isArray(o)){for(const i in o)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(o,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>o[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const Ph=Bh(N),el=Bh(ro),Lt={actions:{cancel:"Cancel",view_configuration:"View configuration",create:"New plugin",create_custom:"Create",configure:"Configure",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",enable:"Enable",enabled:"Enabled",disable:"Disable",delete:"Delete",disabled:"Disabled",confirm_delete:"Yes, delete",view:"View details",configure_dynamic_ordering:"Configure dynamic ordering",go_to_plugins:"Go to plugins",save:"Save",add_entity:"Add {entity}",remove_entity:"Remove {entity}",loading_spinner:"Loading..."},view_configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML, JSON, or Terraform. This allows for straightforward importing into APIOps tools like decK with YAML, Insomnia and cURL with JSON, or Terraform products with Terraform.",yaml:"YAML",terraform:"Terraform",json:"JSON",deck:"decK"},delete:{title:"Delete a plugin",custom_title:"Delete {name}",custom_plugin:"Custom plugin",description:"This action cannot be reversed.",description_custom:"Please ensure this plugin is not in use. This action cannot be reversed.",plugin_schema_in_use_title:"Unable to delete custom plugin",plugin_schema_in_use_message:"This custom plugin is currently in use in this control plane. Please delete any existing instances before removing this schema.",confirmModalText1:"Are you sure you want to delete",confirmModalText2:"Please ensure this plugin is not in use. This delete action cannot be reversed.",confirm_text:"Type {name} to confirm your action",success_message:"Successfully deleted custom plugin {name}"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard",tooltip:"Copy {label}",success_tooltip:"Copied!"},errors:{general:"Plugins could not be retrieved",delete:"The plugin could not be deleted at this time.",copy:"Failed to copy to clipboard",load_results:"Error loading available plugins",load_schema:"Error loading plugin schema"},search:{placeholder:{konnect:"Filter by name",exact:"Filter by exact instance name or ID",kongManager:"Filter by exact instance name or ID",select:"Filter plugins",search_plugins:"Search plugins",search:"Search",tags_filter:"Type part of a tag and press Enter",scope_filter:"Select scopes"},filter:{field:{enabled:"Enabled"},tags_invalid:"Tags can't contain commas, slashes, or leading/trailing spaces"},no_results:'No results found for "{filter}"'},labels:{new:"New"},onboarding:{steps:{consumer:{step:"Consumer",title:"Create a consumer",description:"Consumers represent the users or applications calling your API. Add a name or tags to help you identify and manage this consumer later.",note:"A consumer can have both unique username and unique custom ID or one of them."},credential:{step:"Credential",title:"Add a credential"}},consumer_fields:{username_label:"Username",username_placeholder:"Enter a unique username",custom_id_label:"Custom ID",custom_id_placeholder:"Enter a unique custom ID"},choose_consumer:{title:"Choose a consumer",description:"Choose a consumer to add a credential",select_label:"Select an existing consumer",select_placeholder:"Search consumers"},create_consumer:{title:"Create a consumer"},add_credential:{title:"Add a credential"},create_principal:{title:"Create a principal",description:"Create a principal with authentication to test your plugin configuration."},add_principal_credential:{title:"Add authentication to a principal",description:"Add authentication credentials to an existing principal."},actions:{save_and_next:"Save and next",skip:"Skip",exit_setup:"Exit setup"},errors:{create_consumer:"The consumer could not be created at this time.",create_credential:"The credential could not be created at this time.",load_consumers:"Consumers could not be retrieved"},"basic-auth":{title:"Next steps for basic authentication plugins",subtitle:"Consumers represent the users or applications calling your API. Create a consumer to assign username and password for authentication.",create_consumer:{description:"Create a new consumer with a basic auth credential to test your plugin configuration."},add_credential:{title:"Add a basic authentication credential",description:"Add a basic auth credential to an existing consumer."},credential_action:"Create credential"},"key-auth":{title:"Next steps for key authentication plugins",subtitle:"Consumers represent the users or applications calling your API. Create a consumer to assign API keys for authentication.",create_consumer:{description:"Create a new consumer with a key auth credential to test your plugin configuration."},add_credential:{title:"Add a key authentication credential",description:"Add key authentication credentials to an existing consumer."},credential_action:"Create key"},"key-auth-enc":{title:"Next steps for key authentication plugins",subtitle:"Consumers represent the users or applications calling your API. Create a consumer to assign API keys for authentication.",create_consumer:{description:"Create a new consumer with a key auth credential to test your plugin configuration."},add_credential:{title:"Add a key authentication credential",description:"Add key authentication credentials to an existing consumer."},credential_action:"Create key"},oauth2:{title:"Next steps for OAuth 2.0 authentication plugins",subtitle:"Consumers represent the users or applications calling your API. Create a consumer to register an OAuth 2.0 application for authentication.",create_consumer:{description:"Create a new consumer with an OAuth 2.0 credential to test your plugin configuration."},add_credential:{title:"Add an OAuth 2.0 credential",description:"Add an OAuth 2.0 credential to an existing consumer."},credential_action:"Create credential"},"hmac-auth":{title:"Next steps for HMAC authentication plugins",subtitle:"Consumers represent the users or applications calling your API. Create a consumer to add usernames and secrets for authentication.",create_consumer:{description:"Create a new consumer with a HMAC auth credential to test your plugin configuration."},add_credential:{title:"Add a HMAC authentication credential",description:"Add a HMAC auth credential to an existing consumer."},credential_action:"Create credential"},jwt:{title:"Next steps for JWT plugins",subtitle:"Consumers represent the users or applications calling your API. Create a consumer to assign JWT credentials (public and secret keys) for authentication.",create_consumer:{description:"Create a new consumer with a JWT credential to test your plugin configuration."},add_credential:{title:"Add a JWT credential",description:"Add a JWT credential to an existing consumer."},credential_action:"Create credential"},acl:{title:"Next steps for ACL plugins",subtitle:"Consumers represent the users or applications calling your API. You do this by configuring either an allow list or a deny list with certain consumers or consumer groups.",create_consumer:{description:"Create a new consumer with an ACL credential to test your plugin configuration."},add_credential:{title:"Add an ACL credential",description:"Add an ACL credential to an existing consumer to test your new plugin configuration."},credential_action:"Add group to consumer"}},plugins:JSON.parse(`{"title":"Plugins","list":{"toolbar_actions":{"new_plugin":"New plugin"},"table_headers":{"applied_to":"Applied to","applied_to_badges":{"consumer":"Consumer","global":"Global","route":"Route","service":"Service","consumer_group":"Consumer group"},"id":"ID","plugin":"Plugin","name":"Name","instance_name":"Instance name","scope":"Scope","status":"Status","ordering":"Ordering","ordering_badge":{"dynamic":"Dynamic","static":"Static"},"enabled":"Enabled","tags":"Tags","updated_at":"Last modified"},"empty_state":{"title":"Configure a new plugin","description":"Plugins are used to extend Kong functionality."},"empty_state_v2":{"title":"Configure your first plugin","description":"Plugins extend gateways functionalities, offering features like authentication, rate limiting, and request transformations to enhance security and performance.","create_cta":"New plugin","group":"Plugins created in gateways within this group will automatically appear here.","learn_more":"Learn more"}},"meta":{"basic-auth":{"name":"Basic Authentication","credential_name":"Basic Auth Credential","description":"Add Basic Authentication to your services"},"hmac-auth":{"name":"HMAC Authentication","credential_name":"HMAC Credential","description":"Add HMAC Authentication to your services"},"jwt-signer":{"name":"JWT Signer","description":"Verify and (re-)sign one or two tokens in a request"},"jwt":{"name":"JWT","credential_name":"JWT Credential","description":"Verify and authenticate JSON Web Tokens"},"key-auth":{"name":"Key Authentication","credential_name":"Key Auth Credential","description":"Add key authentication to your services"},"key-auth-enc":{"name":"Key Authentication Encrypted","credential_name":"Key Auth Encrypted","description":"Add key authentication to your services with an encrypted token"},"ldap-auth-advanced":{"name":"LDAP Authentication Advanced","description":"Integrate Kong with a LDAP server"},"ldap-auth":{"name":"LDAP Authentication","description":"Integrate Kong with a LDAP server"},"oauth2-introspection":{"name":"OAuth 2.0 Introspection","description":"Integrate Kong with a third-party OAuth 2.0 Authorization Server"},"oauth2":{"name":"OAuth 2.0 Authentication","credential_name":"OAuth 2.0 Application","description":"Add OAuth 2.0 authentication to your services"},"openid-connect":{"name":"OpenID Connect","description":"Integrate Kong with a third-party OpenID Connect 1.0 provider"},"mtls-auth":{"name":"Mutual TLS Authentication","description":"Secure routes and services with client certificate and mutual TLS authentication"},"vault-auth":{"name":"Vault Authentication","description":"Secure routes and services with an access token and secret token, stored securely via Vault"},"bot-detection":{"name":"Bot Detection","description":"Detect and clock bots or custom clients"},"cors":{"name":"CORS","description":"Allow developers to make requests from the browser"},"ip-restriction":{"name":"IP Restriction","description":"Whitelist or blacklist IPs that can make requests"},"opa":{"name":"OPA","description":"Authorize requests against Open Policy Agent"},"kubernetes-sidecar-injector":{"name":"Kubernetes Sidecar Injector","description":"This plugin will inject Kong dataplane nodes and form a service mesh on top of Kubernetes"},"request-validator":{"name":"Request Validator","description":"Validate requests before they reach their upstream service."},"acl":{"name":"ACL","credential_name":"Access Control Group","description":"Control which consumers can access services"},"canary":{"name":"Canary Release","description":"Methodically roll out software changes to a subset of users"},"forward-proxy":{"name":"Forward Proxy","description":"Allow Kong to connect to intermediary transparent HTTP proxies"},"proxy-cache":{"name":"Proxy Caching","description":"Cache and serve commonly requested responses in Kong"},"proxy-cache-advanced":{"name":"Proxy Caching Advanced","description":"Cache and serve commonly requested responses in Kong"},"graphql-proxy-cache-advanced":{"name":"GraphQL Proxy Caching Advanced","description":"Cache and serve commonly requested responses in Kong"},"rate-limiting-advanced":{"name":"Rate Limiting Advanced","description":"Rate-limit how many HTTP requests a developer can make"},"rate-limiting":{"name":"Rate Limiting","description":"Rate-limit how many HTTP requests a developer can make"},"graphql-rate-limiting-advanced":{"name":"GraphQL Rate Limiting Advanced","description":"Rate-limit how many HTTP requests a developer can make"},"mocking":{"name":"Mocking","description":"Provide mock endpoints to test your APIs in development against your services"},"request-size-limiting":{"name":"Request Size Limiting","description":"Block requests with bodies greater than a specific size"},"request-termination":{"name":"Request Termination","description":"Terminate all requests with a specific response"},"response-ratelimiting":{"name":"Response Rate Limiting","description":"Rate-Limiting based on a custom response header value"},"route-by-header":{"name":"Route by Header","description":"Route requests based on request headers"},"ai-proxy":{"name":"AI Proxy","description":"Directly call a configured LLM, with mediated security and tuning parameters, and using standardised Kong request and response formats."},"ai-prompt-decorator":{"name":"AI Prompt Decorator","description":"Prepend and append chat prompts to AI Proxy plugin LLM requests."},"ai-prompt-template":{"name":"AI Prompt Template","description":"Define a set of templates, containing string variable placeholders, that can be consumed by users when used with the AI Proxy plugin."},"ai-prompt-guard":{"name":"AI Prompt Guard","description":"Define a set of valid, and a set of invalid, regular expression patterns when calling LLM models with the AI Proxy plugin."},"ai-request-transformer":{"name":"AI Request Transformer","description":"Use an LLM to transform API request from a user, before sending to the upstream service."},"ai-response-transformer":{"name":"AI Response Transformer","description":"Use an LLM to transform API responses from the upstream service, before returning to the user."},"ai-rate-limiting-advanced":{"name":"AI Rate Limiting Advanced","description":"Provides rate limiting for the providers used by any AI plugins."},"ai-azure-content-safety":{"name":"AI Azure Content Safety","description":"Allows checking and auditing of AI-Proxy plugin messages, using Azure Cognitive Services, before proxying to upstream large-language model."},"aws-lambda":{"name":"AWS Lambda","description":"Invoke and manage AWS Lambda functions from Kong"},"azure-functions":{"name":"Azure Functions","description":"Invoke Azure functions"},"openwhisk":{"name":"OpenWhisk","description":"Invoke and manage OpenWhisk actions from Kong"},"pre-function":{"name":"Kong Functions (Pre-Plugins)","description":"Add and manage custom lua functions to run before other plugins"},"post-function":{"name":"Kong Functions (Post-Plugins)","description":"Add and manage custom lua functions to run after other plugins"},"datadog":{"name":"Datadog","description":"Visualize metrics on Datadog"},"prometheus":{"name":"Prometheus","description":"Export performance metrics to Prometheus"},"zipkin":{"name":"Zipkin","description":"Propagate zipkin spans and report spans to a zipkin server"},"collector":{"name":"Collector","description":"Automate spec-driven development & anomaly detection (Early Access)"},"response-transformer-advanced":{"name":"Response Transformer Advanced","description":"Transform the response sent by the upstream server on the fly on Kong, before returning the response to the client."},"correlation-id":{"name":"Correlation ID","description":"Correlate requests and responses using a unique ID"},"request-transformer-advanced":{"name":"Request Transformer Advanced","description":"Use powerful regular expressions, variables and templates to transform API requests"},"request-transformer":{"name":"Request Transformer","description":"Modify the request before hitting the upstream server"},"response-transformer":{"name":"Response Transformer","description":"Modify the upstream response before returning it to the client"},"route-transformer-advanced":{"name":"Route Transformer Advanced","description":"Transforms the routing on the fly in Kong, changing the upstream server/port/path to hit"},"kafka-upstream":{"name":"Kafka Upstream","description":"Transform requests into Kafka messages in a topic"},"degraphql":{"name":"DeGraphQL","description":"Transform a GraphQL upstream into a REST API"},"exit-transformer":{"name":"Exit Transformer","description":"Customize Kong exit responses sent downstream"},"jq":{"name":"jq","description":"Transform JSON objects included in API requests or responses using jq programs"},"file-log":{"name":"File Log","description":"Append request and response data to a log file on disk"},"http-log":{"name":"HTTP Log","description":"Send request and response logs to an HTTP server"},"loggly":{"name":"Loggly","description":"Send request and response logs to Loggly"},"statsd-advanced":{"name":"StatsD Advanced","description":"Send traffic and Kong performance metrics to StatsD"},"statsd":{"name":"StatsD","description":"Send request and response logs to StatsD"},"syslog":{"name":"Syslog","description":"Send request and response logs to Syslog"},"tcp-log":{"name":"TCP Log","description":"Send request and response logs to a TCP server"},"udp-log":{"name":"UDP Log","description":"Send request and response logs to a UDP server"},"kafka-log":{"name":"Kafka Log","description":"Publish request and response logs to a Kafka topic"},"session":{"name":"Session","description":"Sessions for Kong authentication"},"upstream-tls":{"name":"Upstream TLS","description":"Enable TLS on upstream traffic by providing Kong with a list of trusted certificates."},"application-registration":{"name":"Portal Application Registration","description":"Allow portal developers to register applications against services"},"konnect-application-auth":{"name":"Konnect Application Auth","description":"Allow Konnect portal developers to register applications against services"},"acme":{"name":"ACME","description":"Let's Encrypt and ACMEv2 integration with Kong"},"grpc-gateway":{"name":"gRPC Gateway","description":"Access gRPC services through HTTP REST"},"grpc-web":{"name":"gRPC Web","description":"Allow browser clients to call gRPC services"},"upstream-timeout":{"name":"Upstream Timeout","description":"Configure read, send and connect timeouts to an upstream"},"opentelemetry":{"name":"OpenTelemetry","description":"Propagate distributed tracing spans and report low-level spans to a OTLP-compatible server"},"websocket-validator":{"name":"WebSocket Validator","description":"Validate individual WebSocket messages against to a user-specified schema before proxying them"},"websocket-size-limit":{"name":"WebSocket Size Limit","description":"Allows operators to specify a maximum size for incoming WebSocket messages"},"tls-metadata-headers":{"name":"TLS Metadata Headers","description":"Detects client certificates in requests, retrieves the TLS metadata, and proxies this metadata via HTTP headers"},"tls-handshake-modifier":{"name":"TLS Handshake Modifier","description":"Requests the client certificate and if it exists, makes it available to other plugins acting on the request"},"oas-validation":{"name":"OAS Validation","description":"Validate HTTP requests and responses based on an API specification."},"jwe-decrypt":{"name":"Kong JWE Decrypt","description":"The Kong JWE Decrypt plugin makes it possible to decrypt an inbound token(JWE) in a request."},"xml-threat-protection":{"name":"XML Threat Protection","description":"Reduce the risk of XML attacks by checking the structure of XML payloads."},"saml":{"name":"SAML","description":"Security Assertion Markup Language (SAML) is an open standard for exchanging authentication and authorization data between an identity provider and a service provider."},"app-dynamics":{"name":"AppDynamics","description":"This plugin integrates Kong with the AppDynamics APM platform so that proxy requests handled by Kong can be identified and analyzed in AppDynamics."},"json-threat-protection":{"name":"JSON Threat Protection","description":"Apply size checks on JSON payload and minimize risk of content-level attacks"},"standard-webhooks":{"name":"Standard Webhooks","description":"Validate incoming webhooks adhere to the Standard Webhooks specification, to which Kong is a contributor"},"ai-proxy-advanced":{"name":"AI Proxy Advanced","description":"Route across different LLMs and models using advanced load balancing algorithms, including semantic routing."},"ai-semantic-cache":{"name":"AI Semantic Cache","description":"Semantically cache AI requests to any LLM to reduce latency, improve end-user experiences and optimize GenAI costs."},"ai-semantic-prompt-guard":{"name":"AI Semantic Prompt Guard","description":"Semantically and intelligently create allow and deny lists of topics that can be requested across every LLM."},"header-cert-auth":{"name":"Header Certificate Authentication","description":"Authenticate clients with MTLS certificate passed in header by a WAF or load balancer"},"upstream-oauth":{"name":"Upstream OAuth","description":"Configure Kong to obtain a OAuth2 token to consume an upstream API"},"confluent":{"name":"Confluent","description":"Streamlines integration with Confluent Cloud and transforms requests into messages published to a Confluent topic."},"service-protection":{"name":"Service Protection","description":"Prevent abuse and protect services with absolute limits on the number of requests reaching the service."},"injection-protection":{"name":"Injection Protection","description":"Protect against injection attacks by rejecting requests that match common injections patterns."},"redirect":{"name":"Redirect","description":"Redirect incoming requests to a new URL"},"kafka-consume":{"name":"Kafka Consume","description":"Consume messages from Kafka topics over HTTP protocols."},"confluent-consume":{"name":"Confluent Consume","description":"Consume messages from Confluent Kafka topics over HTTP protocols"},"request-callout":{"name":"Request Callout","description":"Callout to third party APIs as part of request processing."},"ai-sanitizer":{"name":"AI Sanitizer","description":"Sanitize personal or sensitive information from prompts before sending to LLM."},"ai-rag-injector":{"name":"AI RAG Injector","description":"Attach contextual knowledge from vector databases with flexible template to LLM prompts."},"datakit":{"name":"Datakit","description":"Datakit is a workflow engine for working with external APIs."},"ai-prompt-compressor":{"name":"AI Prompt Compressor","description":"The AI Prompt Compressor reduces costs associated with LLMs by compressing prompts."},"solace-upstream":{"name":"Solace Upstream","description":"Transform requests into Solace messages in a Solace queue or topic."},"ai-aws-guardrails":{"name":"AI AWS GuardRails","description":"The AI AWS GuardRails enables enforcement of introspection with the AWS GuardRails service for all requests processed by the AI Proxy plugin."},"ace":{"name":"Konnect Access Control Enforcement","description":"Enable Developer Self-Service for Konnect Dev Portals."},"solace-consume":{"name":"Solace Consume","description":"Consume messages from Solace and make them available through HTTP endpoints."},"solace-log":{"name":"Solace Log","description":"Publish request and response logs to a Solace topic."},"ai-llm-as-judge":{"name":"AI LLM Judge","description":"Evaluate LLM responses with an external LLM service and use accuracy scores to drive dynamic load balancing for \`llm/v1/chat\` requests."},"ai-mcp-proxy":{"name":"AI MCP Proxy","description":"Convert APIs into MCP tools, proxy MCP servers, expose multiple MCP tools, and observe MCP traffic in real time."},"ai-gcp-model-armor":{"name":"AI GCP Model Armor","description":"Audit and validate AI Proxy messages with Google Cloud Model Armor before forwarding them to an upstream LLM."},"ai-mcp-oauth2":{"name":"AI MCP OAuth2","description":"Secure MCP server access with OAuth2 authentication."},"ai-semantic-response-guard":{"name":"AI Semantic Response Guard","description":"Permit or block prompts based on semantic similarity to known LLM responses, preventing misuse of \`llm/v1/chat\` or \`llm/v1/completions\` requests."},"ai-lakera-guard":{"name":"AI Lakera Guard","description":"Audit and enforce safety policies on LLM requests and responses using the AI AWS Lakera plugin before they reach upstream LLMs."},"ai-a2a-proxy":{"name":"AI A2A Proxy","description":"Securely proxy A2A agents, with real-time RPC tracing and monitoring."},"ai-custom-guardrail":{"name":"AI Custom Guardrail","description":"Integrate with any 3rd-party Guardrail service, with customizable enforcement modes — choose whether violations block, log, or allow traffic to proceed."},"metering-and-billing":{"name":"Metering & Billing","description":"Meter API requests and AI token usage for usage-based billing. Supports flexible customer identification, custom pricing dimensions, and fine-grained traffic filtering. Integrates natively with Konnect Metering & Billing."},"entitlement-enforcement":{"name":"Entitlement Enforcement","description":"Allow or deny API requests based on customer entitlements. Checks feature access, usage limits, and credit balance against Metering & Billing before routing traffic."}},"fields":{"service":"Service","route":"Route","consumer":"Consumer","consumer_group":"Consumer group","service_id":"Service ID","route_id":"Route ID","consumer_id":"Consumer ID","consumer_group_id":"Consumer group ID"},"select":{"custom_badge_text":"This plugin is data plane node specific","cloned_from_badge":"Cloned from {link}","installed_custom_badge":"Installed custom","streamed_custom_badge":"Streamed custom","unavailable_tooltip":"This plugin is not available","already_exists":"This plugin is already applied to this resource","misc_plugins":"Other plugins","show_all":"Show all","view_more":"View more","view_less":"View less","filter":{"title":"Filter plugins","featured":"Featured","type":"Type","clear":"Clear"},"list":{"table_headers":{"name":"Plugin","description":"Description"}},"tabs":{"kong":{"title":"Kong plugins","description":"Kong plugins are bundled by default with Kong Gateway and are available across all control planes.","empty_title":"No plugins","empty_description":"No plugins are available."},"custom":{"title":"Custom plugins","description":"Custom plugins will be available in this control plane only.","disabled_tooltip":"Custom plugins are not available with this gateway. Create a hybrid or dedicated cloud gateway to leverage custom plugins.","fetch_error":"Unable to load some custom plugins. Bundled plugins are still available.","license_required":"Plugin cloning requires a license to be used.","empty_title":"No custom plugins","empty_description":"No custom plugins have been added to this control plane.","create":{"name":"Custom plugin","description":"Upload schema file to create custom plugin"}}},"highlighted_plugins":{"title":"Highlighted plugins"}},"form":{"button_deck_customize":"Customize before copying to CLI","disable_data_retrieving":"You do not have permission to select {scope}","disable_source_scope_change":"Changing the {scope} is not allowed when configuring a plugin under it","no_selection":"No selection...","fields":{"enabled":{"label":"Enabled","on_text":"This plugin is enabled","off_text":"This plugin is disabled"},"plugin_status":{"label":"Plugin status","text_on":"Enabled","text_off":"Disabled"},"instance_name":{"label":"Name","placeholder":"Enter a unique name","help":"A custom name for this plugin instance to help with identifying from the list view."},"condition":{"label":"Execution condition","placeholder":"Enter an expression","tooltip":"An expression used for conditional control over plugin execution. If the expression evaluates to true during the request flow, the plugin is executed; otherwise, it is skipped.","help":{"learn":"Learn more","about":"{link} about plugin conditions."}},"protocols":{"label":"Protocols","placeholder":"Select valid protocols for the plugin","placeholderWithDefaultValues":"Select valid protocols for the plugin. Default protocols: {protocols}","help":"A list of the request protocols that will trigger this plugin. The default value, as well as the possible values allowed on this field, may change depending on the plugin type."},"tags":{"label":"Tags","help":"An optional set of strings for grouping and filtering, separated by commas.","placeholder":"Tag1, Tag2, Tag3"},"secret":{"generateLabel":"Generate secret"}},"scoping":{"label":"Scoped","placeholder":"Search by name or UUID","disable_global_radio":"The plugin is set to 'scoped' by default. To apply a plugin globally, please navigate to the global plugin list page.","global":{"label":"Global","help":"All services, routes, and consumers"},"gateway_service":{"label":"Select a gateway service","help":"The gateway service to which this plugin configuration will apply","placeholder":"Select a gateway service","plural":"Gateway services"},"route":{"label":"Select a route","help":"The route that this plugin configuration will target","placeholder":"Select a route","plural":"Routes"},"consumer":{"label":"Select a consumer","help":"The consumer that this plugin configuration will target","placeholder":"Select a consumer","plural":"Consumers"},"consumer_group":{"label":"Select a consumer group","help":"The consumer group that this plugin configuration will target","placeholder":"Select a consumer group","plural":"Consumer groups"}},"grouping":{"plugin_configuration":{"title":"Plugin configuration","description":"Configuration parameters for this plugin. View advanced parameters for extended configuration.","empty":"This plugin does not have required parameters."},"advanced_parameters":{"view":"Show additional settings","hide":"Hide additional settings"}},"field_rules":{"at_least_one_of":"At least one of the following values is required: {parameters}.","only_one_of":"Exactly one of these parameters is required: {parameters}","mutually_required":"These values must be used together: {parameters}.","mutually_exclusive":"Only one of these values can be used: {parameters}.","only_one_of_mutually_required":"Exactly one of the following parameter combinations is required (all parameters within a chosen combination are required):"},"sections":{"plugin_scope":{"title":"Plugin scope","description":"Choose whether this plugin applies to all traffic (global) or is scoped to a specific service, route, or consumer."},"general_info":{"title":"General information","description":"Add details to help identify and manage your plugin."},"plugin_config":{"title":"Plugin configuration","description":"Set the plugin's behavior by defining its configuration settings."},"plugin_general_info":{"description":"Add a name or tags to help you identify and manage this plugin later."},"code_mode":{"title":"Code editor","description":"Configure this plugin by using YAML configuration."}}},"free-form":{"editor_mode":{"visual":"Visual editor","code":"Code editor"},"code-lens":{"entity":{"service":"Service","route":"Route","consumer":"Consumer","consumer_group":"Consumer group","certificate":"Certificate"},"field":{"name":"{entity} \\"{value}\\"","username":"Username \\"{value}\\"","custom_id":"Custom ID \\"{value}\\"","subject":"Subject \\"{value}\\"","expires_after":"Expires after \\"{value}\\""},"action":{"view_entity":"View {title}","copy_certificate":"Copy certificate","copy_uuid":"Copy UUID","retry_fetch":"Retry fetch (Hover for details)"},"unknown_error":"Unknown error"},"acl":{"mode":{"title":{"label":"Access policy","description":"Select how requests are authorized. Choose one access policy: allow or deny by ACL group, or define a CEL expression. Only one policy type can be configured at a time."},"allow":{"label":"Allow list","description":"Allow requests from the specified ACL groups."},"deny":{"label":"Deny list","description":"Deny requests from the specified ACL groups."},"allow_when":{"label":"Allow expression","description":"Allow requests when the CEL expression evaluates to true."},"deny_when":{"label":"Deny expression","description":"Deny requests when the CEL expression evaluates to true."}},"field":{"allow":{"label":"Allowed list","placeholder":"Enter group names","add":"Add allow"},"deny":{"label":"Denied list","placeholder":"Enter group names","add":"Add deny"},"allow_when":{"label":"Kong plug-in conditional expression","description":"A Kong plug-in conditional expression is a CEL expression that determines whether the plugin runs for a request. If the expression evaluates to true, the plugin executes. If it evaluates to false, the plugin is skipped.","placeholder":"eg: 'consumer.username == \\"alice\\"'","add":"Add expression","help":{"learn":"Learn more","text":"Define a Kong plug-in conditional expression to evaluate each request. The expression must return a boolean value (true or false). {link}"}},"deny_when":{"label":"Kong plug-in conditional expression","description":"A Kong plug-in conditional expression is a CEL expression that determines whether the plugin runs for a request. If the expression evaluates to true, the plugin executes. If it evaluates to false, the plugin is skipped.","placeholder":"eg: 'consumer.username == \\"alice\\"'","add":"Add expression","help":{"learn":"Learn more","text":"Define a Kong plug-in conditional expression to evaluate each request. The expression must return a boolean value (true or false). {link}"}}}},"ai-mcp-proxy":{"default_acl_item_label":"Default ACL #{index}","tool_item_label":"Tool #{index}"},"openid-connect":{"tabs":{"common":{"title":"Common Configuration Settings","description":"Parameters for enabling the OpenID Connect plugin. Set these parameters before adding authorization, authentication, or other advanced configuration details."},"authorization":{"title":"Authorization Configuration Settings","description":"Parameters for setting up claims-based authorization."},"advanced":{"title":"Advanced Configuration Settings","description":"Advanced parameters for manually configuring the OpenID Connect plugin."}},"auth_methods":{"label":"Authentication methods","placeholder":"Select authentication methods","hint":"Configure which OAuth and OpenID Connect features are supported.","km_label":"Auth methods","methods":{"authorization_code":"Authorization code flow","bearer":"Bearer access token","client_credentials":"Client credentials grant","password":"Passwords grant","introspection":"Introspection","userinfo":"UserInfo","kong_oauth2":"Kong OAuth","refresh_token":"Refresh token"},"session":{"label":"Session management","switch_label":"Enable Session Management","use_label":"Use sessions","use_description":"Issue a session cookie after successful authentication. Subsequent requests use the session instead of re-authenticating with the identity provider.","no_use_label":"Do not use sessions","no_use_description":"Authenticate each request using the configured authentication flow."}},"principals":{"header":"Who should manage authentication and credentials?","description":"Use External auth server to continue using your existing OAuth provider and authentication workflows. Use Kong Identity to adopt a newer principal-based model that centralizes and simplifies identity and authentication management.","learn_more":"Learn more.","kong_identity_label":"Kong Identity","kong_identity_description":"Use Kong Identity to authenticate OpenID Connect tokens. If all data plane nodes are running version 3.15 or later, you can also map requests to Kong Identity principals for advanced policies and integrations.","kong_identity_description_ai_manager":"Use Kong Identity to authenticate OpenID Connect tokens. If all AI Gateway nodes are running version 2.0 or later, you can also map requests to Kong Identity principals for advanced policies and integrations.","external_label":"External auth server","external_description":"Connect to your existing identity provider to manage authentication outside of Kong.","guide":{"title":"Add principals","description":"Get more value from OAuth 2.0 integration by creating principals in Kong Identity. Associate principals with this authorization server and its clients to enable principal-based authentication across Kong products.","description_external":"Get more value from OAuth 2.0 integration by creating principals in Kong Identity. Associate principals with this authorization server and its clients to enable principal-based authentication across Kong products. Requires data plane nodes to be running version 3.15 or later.","create":"Create principal","learn_more":"Learn more"},"auth_server":{"label":"Authorization Server","info":"The Kong Identity auth server that will act as the OpenID Connect provider for this plugin.","placeholder":"Select an Authorization Server","create":"Create authorization server","create_hint":"You'll need to return here after creating an authorization server. Your progress won't be saved.","no_access_help":"You don't have access to browse authorization servers. Enter the issuer URL of your Kong Identity authorization server directly.","issuer_placeholder":"e.g., https://your-auth-server.identity.konghq.com"},"client":{"label":"Client","id_label":"Client id","secret_label":"Client secret","placeholder":"Select a client","id_placeholder":"e.g., kong-gateway-client","secret_placeholder":"e.g., your-client-secret","create":"Create client","create_hint":"You'll need to return here after creating a client. Your progress won't be saved.","add":"Add client","remove":"Remove client"},"leave_prompt":{"title":"Leave this page?","message":"Your unsaved changes will be lost if you continue.","action":"Leave page"},"dp_version_alert":"We detected that one or more data plane nodes are running a version earlier than 3.15. If principal lookup is enabled, requests handled by those data plane nodes will fail."},"lookup":{"collapse_label":"Show additional settings","toggle_label":"Use principal lookup","toggle_info":"Look up the authenticated principal in Kong Identity after token validation. Enable this when the validated token doesn't contain all of the identity data required for authorization or activity logging.","method":{"label":"Principal lookup method","placeholder":"Select a lookup method","help":"Principal lookup queries Kong Identity for the principal that matches the identity in a verified access token. This enables principal-aware policies and integrations. Requires all data plane nodes to be running version 3.15 or later.","kong_identity_label":"Kong Identity client","kong_identity_description":"Match principals using a token claim, defaulting to the subject (sub) claim.","custom_identity_label":"Custom claim","custom_identity_description":"Match principals using a custom JWT claim."},"custom_identity_name":{"label":"Custom identity name","help":"Enter the custom identity name used to look up the principal. Kong matches the value from the token claim to a principal with the same custom identity name and value.","placeholder":"e.g., Customer_ID"},"token_claim":{"label":"Token claim","placeholder":"e.g., user.employee_id","help":"Defaults to the subject (sub) claim, but you can specify a different token claim if needed. Use dot notation for nested claims (for example, workload.id); escape literal periods with \\\\ (for example, workload\\\\.id).","help_custom":"The token claim whose value is matched against the Custom identity name. Defaults to the subject (sub) claim, but you can specify a different claim if needed. Use dot notation for nested claims (for example, workload.id); escape literal periods with \\\\ (for example, workload\\\\.id)."},"error_on_miss":{"label":"If principal lookup fails","reject_label":"Reject the request","reject_description":"Treat the request as unauthenticated if Kong Identity cannot resolve the principal.","continue_label":"Continue without a principal","continue_description":"Allow the request to continue without resolving a principal."},"match_consumer":{"label":"Use linked consumers","description":"Use the consumer linked to the authenticated principal so existing consumer-based plugins and policies continue to work.","link":"Learn how to link a consumer."},"match_consumer_groups":{"label":"Use linked consumer groups","description":"Use consumer groups linked to the authenticated principal so existing consumer group policies and plugins continue to work. Consumer groups can be linked through principal metadata.","link":"Learn how to link a consumer group."}},"advanced_fields":{"client_jwk_link_label":"Client JWK","verify_signature_description":"JSON Web Keys are automatically fetched from the issuer's well-known endpoint. Enter a JWKS URI below to override this."}},"request-callout":{"entity_name":"Request callout","by_lua_placeholder":"Enter Lua script here..."},"jwt-signer":{"keyset_url_required":"Provide a valid HTTP/HTTPS URL to ensure signing works correctly when \\"{signingField}\\" is enabled and \\"{headerField}\\" is set."},"metering-and-billing":{"sections":{"plugin_config":{"title":"Plugin configuration","description":"Configure the Metering & Billing plugin."},"metering":{"title":"What to meter"},"subject":{"title":"Who to bill (subject)","description":"Define how billing subjects are identified."},"ingestion":{"title":"Connection","description":"Configure how metered data is delivered to the billing service."},"queue":{"title":"Queue","description":"Configure internal event queue settings."}},"fields":{"meter_api_requests":{"label":"Meter API requests","description":"Emit a usage event for each API Gateway request."},"meter_ai_token_usage":{"label":"Meter AI token usage","description":"Emit events for LLM input and output tokens on AI Gateway requests. Each request produces separate input/output events so they can be priced independently."},"ingest_endpoint":{"description":"The URL of the metering data ingest endpoint.","help":"For Konnect Metering & Billing, use the regional endpoint from your Metering & Billing settings. For self-hosted OpenMeter, use your ingest URL."},"api_token":{"description":"Bearer token for authenticating requests to the ingest endpoint."},"look_up_value_in":{"label":"Look up subject in","help":"Where to find the customer identifier in the request."},"subject_field":{"label":"Subject field name","placeholder":"e.g., x-customer-id","help":"e.g. x-customer-id, x-api-key, x-tenant"},"queue":{"max_coalescing_delay":{"label":"Max coalescing delay (s)"},"initial_retry_delay":{"label":"Initial retry delay (s)"},"max_retry_delay":{"label":"Max retry delay (s)"},"max_retry_time":{"label":"Max retry time (s)"}},"attributes":{"title":"Event attributes","description":"Attach custom dimensions to metered events.","look_up_value_in":{"placeholder":"e.g., x-priority-id"},"event_property_name":{"placeholder":"e.g., priority"}},"ssl_verify":{"label":"Verify TLS certificate","description":"Disable only for local development with self-signed certificates."},"timeout":{"label":"Request timeout (ms)"},"keepalive":{"label":"Connection keep-alive (ms)"}}},"governance":{"unavailable_kong_manager":"The Entitlement Enforcement plugin can't be configured in Kong Manager yet.","sections":{"configuration":{"title":"Plugin configuration","description":"Configure the Entitlement Enforcement plugin subject, feature, and connection settings."},"governance":{"title":"Entitlement Enforcement settings","description":"Configure access control behavior and response codes."},"subject":{"title":"Whose access to enforce (subject)"},"feature":{"title":"Feature"},"connection":{"title":"Connection","description":"Configure how the plugin connects to the entitlement access endpoint."},"redis":{"title":"Redis"},"cache_sync":{"title":"Cache and sync"}},"fields":{"look_up_value_in":{"label":"Whose access to enforce (Look up subject in)","help":"Where to find the customer identifier in the request."},"subject_field":{"label":"Subject field name","placeholder":"e.g., x-customer-id","help":"Name of the header or query parameter that carries the customer identifier."},"feature_key":{"label":"Feature to enforce access","help":"Feature that will control access to the scope where the plugin is applied.","create_feature":"+ Create new feature","unavailable":"You don't have access to metering features. Enable Metering & Billing in your Konnect organization to configure the feature to enforce.","load_error":"Could not load features from the entitlement enforcement service."},"governance_endpoint":{"help":"For Konnect Metering & Billing, use the regional endpoint for Metering & Billing entitlement access. For self-hosted OpenMeter, use the entitlement access endpoint of your self-hosted instance."},"ssl_verify":{"label":"Verify TLS certificate","description":"Disable only for local development with self-signed certificates."},"timeout":{"label":"Request timeout (ms)"},"keepalive":{"label":"Connection keep-alive (ms)"},"sync_rate":{"label":"Sync rate (s)"},"refresh_interval":{"label":"Refresh interval (s)"},"max_stale_seconds":{"label":"Max stale seconds"},"l1_ttl":{"label":"L1 TTL (s)"},"l2_ttl":{"label":"L2 TTL (s)"},"credit_balance_required":{"label":"Credit balance lookup","yes_label":"Yes","yes_description":"Customers must have a positive credit balance to access this feature.","no_label":"No","no_description":"Customers can access this feature regardless of their credit balance."},"fail_policy":{"label":"Plugin failure mode","allow_label":"Allow access","allow_description":"If the plugin fails, customers can still access this feature.","block_label":"Block access","block_description":"If the plugin fails, customers cannot access this feature."},"deny_unknown_customers":{"label":"Unknown customer access","allow_label":"Allow access","allow_description":"The gateway will allow access for unknown customers.","deny_label":"Deny access","deny_description":"The gateway will deny access for unknown customers."},"response":{"label":"Response mapping","columns":{"code":"Response code","status":"Status code","message":"Message"},"defaults":{"NO_CREDIT_AVAILABLE":"Customer has no credit available.","USAGE_LIMIT_REACHED":"Customer has reached usage limit for feature.","FEATURE_UNAVAILABLE":"Feature is not available for the customer.","FEATURE_NOT_FOUND":"Feature not found.","CUSTOMER_NOT_FOUND":"Customer is not found by subject."}}}},"datakit":{"plugin_config":{"title":"Flow editor"},"advanced_configuration":{"title":"Advanced configuration","show_label":"Show advanced configuration","hide_label":"Hide advanced configuration"},"description_code":"Configure this plugin by using YAML configuration. If you are copy/pasting in examples from the documentation - paste from below the <code>config</code> block.","description_flow":"Build flows visually with a drag-and-drop editor for Datakit. Visualize node connections, inputs, and outputs as you design.","description_example":"Start with a use case:","detected_config_format":"Detected {format} configuration. Do you want to convert it to Datakit configuration?","detected_config_format_title":"Convert configuration","detected_config_format_confirm":"Convert","examples":{"authenticateThirdPartyWithDynamicUrl":"Authenticate Kong to a third-party service resolved at runtime","authenticateThirdParty":"Authenticate Kong to a third-party service","authenticateWithVaultSecret":"Authenticate to a third-party service using Vault secrets","clearHeaders":"Clear request headers","combineTwoApisIntoOneResponse":"Combine multiple API responses","conditionallyStoreCachedItems":"Conditionally fetch or store cache data","convertJsonIntoXml":"Transform JSON into XML","convertJsonToXmlAndBack":"Transform JSON into XML and back","convertXmlIntoJson":"Transform XML into JSON","manipulateRequestHeaders":"Manipulate request headers"},"flow_editor":{"mode":"Flow editor","name":"Datakit flow editor","cta":"Go to flow editor","disabled_tooltip":"The flow editor is unavailable due to critical configuration errors or features not supported in the flow editor:<br/><code>{reason}</code>","expand_panel":"Expand panel","collapse_panel":"Collapse panel","return_to_config":"Return to plugin configuration","canvas_panel":{"request":"Request","response":"Response","node_count_plural":"{count} nodes","node_count_singular":"1 node"},"panel_segments":{"nodes":"Nodes","resources":{"title":"Resources","vault":{"title":"Vault secrets","add_button":"Add vault resource","name_exists_error":"Vault name already exists","name_required_error":"Vault name is required","edit":"Edit","delete":"Delete"},"cache":{"title":"Cache configuration","add_button":"Add cache configuration","strategy_options":{"memory":"Memory","redis":"Redis"},"select_redis_configuration":"Select a shared Redis configuration","inline_config":"Inline config","inline_config_preview":"You are using a dedicated Redis configuration, This is a preview of your current setup, please edit it in code editor"}}},"vault_secret_picker":{"title":"Add secret to Datakit","proceed_button_text":"Add secret","secret_name":{"label":"Secret name","placeholder":"Enter a name","help":"A unique identifier for this secret in your Datakit configuration"}},"node_panel":{"title":"Node types","description":"Drag a node onto the canvas to add it to your data flow.","groups":{"external_interaction":"External interaction","control_flow":"Control flow","data_transformation":"Data transformation","data_value":"Data value","authentication":"Authentication"}},"examples":"Examples","debug":{"label":"Debug","description":"Enables detailed error messages in client responses, making debugging easier. <a href=\\"https://developer.konghq.com/plugins/datakit/#debugging\\" target=\\"_blank\\">See the docs</a> for details."},"actions":{"zoom_in":"Zoom in","zoom_out":"Zoom out","fit_view":"Zoom to fit","auto_layout":"Auto layout","undo":"Undo","redo":"Redo","duplicate":"Duplicate","remove_from_branch":"Remove from branch","delete":"Delete","view_docs":"View docs","done":"Done"},"node_types":{"call":{"summary":"Call a third-party API","description":"Send an HTTP request and retrieve the response."},"jq":{"summary":"Transform data and cast variables with jq","description":"The <code>jq</code> node executes a jq script for processing JSON. See the official <a href=\\"https://jqlang.org\\" target=\\"_blank\\">jq docs</a> for more details."},"exit":{"summary":"Return directly to the client","description":"Trigger an early exit that produces a direct response, rather than forwarding a proxied response."},"property":{"summary":"Get and set Kong Gateway-specific data","description":"Get and set Kong Gateway host and request properties."},"static":{"summary":"Configure static input values ahead of time","description":"Emits static values to be used as inputs for other nodes. The <code>static</code> node can help you with hardcoding some known value for an input."},"branch":{"summary":"Execute nodes based on matching input conditions","description":"Execute different nodes based on matching input conditions, such as a cache hit or miss."},"cache":{"summary":"Store and fetch cached data","description":"Store data into cache and fetch cached data from cache."},"xml_to_json":{"summary":"Transform XML to JSON","description":"Transform XML to JSON."},"json_to_xml":{"summary":"Transform JSON to XML","description":"Transform JSON to XML."},"jwt_decode":{"summary":"Decode JWT headers and claims","description":"Parse a JWT without verifying its signature."},"jwt_sign":{"summary":"Create and sign JWTs","description":"Generate a signed JWT from configured claims and a signing key."},"jwt_verify":{"summary":"Verify JWT signature and claims","description":"Verify a JWT signature and validate claims such as exp, nbf, iss, and aud."},"request":{"name":"request","description":"Reads incoming client request properties. You cannot specify request node input."},"response":{"name":"response","description":"Updates properties of the outgoing client response."},"service_request":{"name":"service request","description":"Updates properties of the request sent to the service being proxied to."},"service_response":{"name":"service response","description":"Reads response properties from the service being proxied to."},"vault":{"name":"Vault","description":"Vault is a tool for securely accessing secrets."}},"node_properties":{"name":"Name","configuration":"Configuration","input":{"label":"Inputs configuration","placeholder":"Select a source","add_button":"Add an input","or":"or","input":"Input","fields":"Fields","source":"Source","tooltip":"Fields are part of the node input. A source can connect to either the fields or the input, but not both."},"input_name":{"label":"Input name","placeholder":"Enter an input name"},"jq":{"label":"jq script","help":"Refer to {link} for full documentation."},"output_value":{"label":"Output value","value_name":"Value name","value":"Value","add_button":"Add a value"},"property":{"get":"get","set":"set"},"branch":{"placeholder":"Select nodes"},"xml_to_json":{"force_array_paths":{"placeholder":"e.g. store/product"}},"jwt":{"static_claims":{"label":"Static claims","help":"Enter a JSON object. It will be stored as the node's static claims map.","errors":{"invalid_json_object":"Static claims must be a valid JSON object"}}},"errors":{"invalid_identifier_format":"{fieldName} must start with a letter or underscore and contain only letters, numbers, underscores, or hyphens","invalid_url_format":"Not a valid URL format","not_empty":"{fieldName} is required","not_float":"{fieldName} must be a float","not_integer":"{fieldName} must be an integer","not_number":"{fieldName} must be a number","not_unique":"{fieldName} must be unique","number_range":"{fieldName} must be between {min} and {max}","string_len_range":"{fieldName} must be between {minLength} and {maxLength} characters","reserved_node_name":"\\"{nodeName}\\" is a reserved node name","attributes_required":"Provide at least one of attributes_block_name or attributes_name_prefix","invalid_force_array_path":"Must be a plain '/'-separated element path, for example 'store/product'"}},"error":{"invalid_connection":"Invalid connection","branch_cycle":"Cannot create a circular branch relationship"},"confirm":{"title":"Connection conflict","message":{"confirm":"Are you sure you want to make this change?","switch":"You can connect an output source to either all inputs of a node or to individual inputs.","override":"Each input can connect to only one output, but one output can connect to many inputs.","branch_replace":"This node already belongs to another branch. Move it to the new branch?"},"proceed":"Yes, update"},"leave_confirm":"Leave current page? Changes you made may not be saved."},"code_editor":{"mode":"Code editor"}},"vault_picker":{"component_error":"The vault secret picker is not available"},"tag_helper":"Use comma to separate values. eg: value1, value2","foreign_placeholder":"Enter a UUID of {entity}"}}`),redis:{title:"Redis configuration",managed_ui:{title:"Redis",shared_configuration:{label:"Use shared configuration",description:"Select an existing shared Redis configuration or create a new one. Any updates to this configuration will automatically apply to all associated plugins.",badge:"Recommended"},dedicated_configuration:{label:"Use locally-scoped configuration",description:"Create and use a Redis configuration specifically for this plugin."},selector:{placeholder:"Filter Redis configurations...",create_new:"New Redis"}},shared_configuration:{label:"Shared configuration",description:"Select an existing shared Redis configuration or create a new one. Changes to this configuration automatically apply to all associated plugins.",title:"Shared Redis configuration",error:"Fetching shared Redis configurations failed."},dedicated_configuration:{label:"Dedicated configuration",description:"Create a Redis configuration that is used only by this plugin. Changes won’t affect other plugins."},config_card:{common_fields:{created_at_label:"Created at",updated_at_label:"Last updated at",type_label:"Redis type"}}},glossary:{plugin:"plugin"},custom_field:{key_auth_identity_realms:{cp_label:"Current control plane",cp_group_label:"Control plane",realm_group_label:"Realms (can only select one)"},kong_identity:{title:"Who should manage authentication and credentials?",description_with_realms:"Use Consumers or centrally managed consumers for Consumer-based authentication. Use Kong Identity for principal-based authentication and advanced integrations.",description_without_realms:"Use Consumers for Consumer-based authentication. Use Kong Identity for principal-based authentication and advanced integrations.",learn_more:"Learn more.",incompatible_data_plane_alert:"We detected that one or more data plane nodes are running a version earlier than 3.15. Requests handled by those data plane nodes will use consumers instead of Kong Identity principals.",kong_identity_label:"Kong Identity",kong_identity_description_key_auth:"Use Kong Identity to authenticate API keys and map requests to Kong Identity principals for advanced integrations. Data plane nodes running versions earlier than 3.15 continue using consumers.",kong_identity_description_basic_auth:"Use Kong Identity to authenticate Basic Auth credentials and map requests to Kong Identity principals for advanced integrations. Data plane nodes running versions earlier than 3.15 continue using consumers.",consumers_label:"Consumers",consumers_description_key_auth:"Use consumer-managed API keys. Consumers provide their API key in a request header, query parameter, or request body to authenticate requests.",consumers_description_basic_auth:"Use consumer-managed Basic Auth credentials. Consumers authenticate requests using a username and password.",centrally_managed_label:"Centrally managed consumers",centrally_managed_description:"Authenticate centrally managed consumers in Konnect using identity realms. Identity realms are scoped to the control plane by default.",identity_realms_required:"To use centrally managed consumers, you must select at least one Centrally managed consumer realm.",error_on_miss_label:"If principal lookup fails",error_on_miss_reject_label:"Reject the request",error_on_miss_reject_description:"Treat the request as unauthenticated if Kong Identity cannot resolve the principal.",error_on_miss_continue_label:"Continue without a principal",error_on_miss_continue_description:"Allow the request to continue without resolving a principal.",configure_title:"Configure Kong Identity",configure_description:"Kong Identity uses principals to represent authenticated services or applications. Create your first principal in Kong Identity to start using principal-based authentication. On data plane nodes running versions earlier than 3.15, authentication continues using consumers.",create_principal:"Create principal",configure_learn_more:"Learn more",leave_prompt_title:"Leave this page?",leave_prompt_message:"Your unsaved changes will be lost if you continue.",leave_prompt_action:"Leave page"}},sp:{window_type:{label:"Rate limit window type",help:"Sets the time window type to either <code>sliding</code> (default) or <code>fixed</code>.<br><ul><li>Sliding windows apply the rate limiting logic while taking into account previous hit rates (from the window that immediately precedes the current) using a dynamic weight.</li><li>Fixed windows consist of buckets that are statically assigned to a definitive time range, each request is mapped to only one fixed window based on its timestamp and will affect only that window&#39;s counters.</li></ul>",options:{fixed:"Fixed",sliding:"Sliding"},descriptions:{fixed:"Each request counts against one static time bucket, and only that bucket's counter.",sliding:"Each request counts against a rolling window, weighted by the rate of the window before it."}},request_limits:{title:"Request limits",subtitle:"Set one or more limits on the number of API requests allowed within a defined timeframe.",label:"Limit",label_index:"Limit {index}",request_number:"Request number",time_interval:"Time interval",interval_determiner:"Every",seconds:"Seconds",custom:"Custom",add_limit:"Add limit",remove_limit:"Remove limit {index}",expression_placeholder:"Define an expression for the limit. eg: ‘principal.metadata.limit * 2’"},error_message:{label:"Error message",code_placeholder:"Code message",message_placeholder:"Error message",help:"Set a custom error code and message to be returned when the rate limit is exceeded."},start_with_a_use_case:"Start with a use case:",use_cases:{fixed:{hourly_500:{label:"500 requests every hour",description:"A fixed limit of 500 requests per hour resetting sharply on the hour, ensuring no user can exceed this limit."},half_hourly_200:{label:"200 requests every 30 minutes",description:"Users are allowed 200 requests per 30 minutes, resetting exactly on the 30 minute mark with no carryover of unused limits."},daily_500:{label:"500 requests every day",description:"A strict limit of 5000 requests per day resetting promptly at midnight, preventing any burst traffic or inconsistent user experiences."}},sliding:{hourly_100:{label:"100 requests every hour",description:"Maximum of 100 requests every rolling hour, continuously adjusting the count over the course of the hour. No hard limit or known reset."},half_hourly_300:{label:"300 requests every 30 minutes",description:"Each user can make up to 300 requests in any rolling 30 minute period, with older requests dropping off as new requests are made."},hourly_500:{label:"500 requests every hour",description:`Each user is allowed 500 requests per hour.
2
2
  If the limit is exceeded and the user receives a 429 error, each additional request within the sliding window (hour)
3
- will extend the wait time by about 12 minutes, continuously adjusting as new requests are made.`}}},custom_key:{expression_placeholder:"e.g. principal.metadata.ff_id ? principal.metadata.ff_id : principal.id",expression_help:{text:"Define a Kong plug-in dynamic expression to determine the counter key for each request. The expression must return a string. {link}",learn:"Learn more"}}},custom_plugin_form:{step1:{title:"Custom plugin type",types:{installed:{label:"Installed custom plugin",description:"Install and manage plugins with full control over deployment and runtime. Requires restarting data planes."},streamed:{label:"Streamed custom plugin",description:"Deploy and update plugins on running data planes without requiring gateway access."},cloned:{label:"Cloned plugin",description:"Duplicate an existing plugin to run multiple instances within a single request."}},compare_trigger:"Compare deployment options",compare_table:{columns:{installed:"Installed custom plugin",streamed:"Streamed custom plugin",cloned:"Cloned plugin"},rows:{main_use_case:{header:"Main use case",installed:"Extend Kong functionality with custom plugins and control who can modify and roll out changes.",streamed:"Extend Kong functionality with plugins without requiring sysadmin access to data plane instances.",cloned:"Modify an existing plugin to run multiple instances with different names or priorities."},file_supplied:{header:"File supplied",installed:{handler:"handler.lua",schema:"schema.lua",additional:"Any additional files or libraries needed"},streamed:{handler:"handler.lua",schema:"schema.lua"}},how_installed:{header:"How it's installed",installed:"Install directly on the data plane",streamed:"Through gateway configuration changes",cloned:"Through gateway configuration changes"},sandboxing:{header:"Sandboxing",streamed:"Follows the standard sandboxing settings. {link}",streamed_link:"Link to docs",cloned:"Inherit the same sandboxing as the original plugins"},data_plane_reload:{header:"Data plane reload"}}}},step2_files:{title:"Custom plugin files",schema_file:{label:"Upload schema file",placeholder:"No file selected",placeholder_edit:"File not changed",button_text:"Select File",help:{text:"Only Lua based schemas are supported by Konnect. Other plugin modules can be in any language as desired. {link}",link:"Learn more"}},handler_file:{label:"Upload handler file",placeholder:"No file selected",placeholder_edit:"File not changed",button_text:"Select File",help:"Upload plugin handler to the data plane."},plugin_modules:{label:"Plugin modules",alert:"Upload all plugin modules to the data plane: schema.lua, handler.lua"},streaming_enabled:{alert:"Each data plane node must run with KONG_CUSTOM_PLUGIN_STREAMING_ENABLED=true. Otherwise, Kong Gateway removes this plugin from the node's configuration. {link}",alert_link:"Learn more"}},step2_clone:{title:"Clone plugin",select_plugin:{label:"Select a plugin",placeholder:"Type to search"}},step3:{title:"General information",description:"Enter a custom name for this custom plugin",name:{label:"Name",placeholder:"Enter a unique name",help:"The name must be identical to the name of the plugin in the schema file."},alias_name:{label:"Alias name",placeholder:"Enter a unique name",help:"Format: ^[a-z][a-z0-9-]*[a-z0-9]$. The name must be unique enough to avoid future conflicts with bundled plugins."},priority:{label:"Priority",tooltip:"Set the execution priority for this cloned plugin",help:{text:"Optional. Use a number to set the absolute execution priority. If priority isn't set, plugins run in alphabetical order. {link} in the docs.",link:"Learn more"}}},errors:{file_read_error:"Failed to read file content. Please try again.",file_too_large:"File size exceeds the maximum limit of 1 MB.",plugin_not_found:"The selected plugin could not be found. Please refresh the list and try again.",no_supported_types:"No supported custom plugin types are available in this context.",unsupported_plugin_type:"Unsupported plugin type {type}."}}};function Ye(){const e=Vt.createI18n("en-us",Lt);return{i18n:e,i18nT:Vt.i18nTComponent(e)}}const wN=["undo","redo","duplicate","cut","copy","paste"],Vh=()=>{};function kN(e){const n=e;return n?!!n.closest('input, textarea, [contenteditable]:not([contenteditable="false"])'):!1}function CN(e){if(!(e.metaKey||e.ctrlKey))return;switch(e.key.toLowerCase()){case"z":return e.shiftKey?"redo":"undo";case"y":return"redo";case"d":return"duplicate";case"x":return"cut";case"c":return"copy";case"v":return"paste"}}const EN=At.createSharedComposable(()=>{const e=new Set;At.useEventListener("keydown",r=>{if(kN(r.target))return;const o=CN(r);if(o)for(const i of e){if(!t.toValue(i.enabled))continue;const a=i[o];if(a){if(r.defaultPrevented){t.warn(`[useHotkeys] event for "${o}" was already defaultPrevented. Hotkey ignored.`);return}r.preventDefault(),a();return}}},{passive:!1});function n(r){if(!wN.some(i=>typeof r[i]=="function"))return Vh;const o={enabled:r.enabled??!0,...r};return e.add(o),()=>e.delete(o)}return{subscribe:n}});function $h(e={}){if(typeof window>"u")return Vh;const n=EN().subscribe(e);return t.onScopeDispose(n),n}const NN="#ecfcff",SN="#f1f0ff",xN="#52596e",AN="#e0e4ea",IN="#007d60",vN="#fffce0",TN="#6c7489",ON="#0044f4",BN="#5f9aff",Cu="#0d0e14",Rh="#d60027",PN="#00abd2",Lh="#6f28ff",Fh="#afb7c5",Wn="#6c7489",VN="#0044f4",$N="#eefaff",Dh="#007d60",RN="#ecfffb",LN="#995c00",FN="#306fff",zo="12px",Cn="16px",oo="20px",Eu="24px",DN="2px",Mh="8px",MN="32px",Uh=44,UN=220,jh=366,jN=1e3,KN=Uh+parseFloat(Mh),tl=1,qN=0,GN=1,zN=2,HN=3,Ho=parseInt(MN,10),ha="application/x-datakit+json",nl={delete:["Delete"],undo:["Mod","Z"],redo:{mac:["Mod","Shift","Z"],windows:["Mod","Y"],linux:["Mod","Shift","Z"]},copy:["Mod","C"],paste:["Mod","V"],duplicate:["Mod","D"]},Mr={padding:80,gaps:{nodes:60,edges:80,ranks:60}},WN=1600,YN=1.2,JN=0,XN=200,Kh=Symbol("confirm-modal");var qh=typeof global=="object"&&global&&global.Object===Object&&global,ZN=typeof self=="object"&&self&&self.Object===Object&&self,Yn=qh||ZN||Function("return this")(),En=Yn.Symbol,Gh=Object.prototype,QN=Gh.hasOwnProperty,eS=Gh.toString,ya=En?En.toStringTag:void 0;function tS(e){var n=QN.call(e,ya),r=e[ya];try{e[ya]=void 0;var o=!0}catch{}var i=eS.call(e);return o&&(n?e[ya]=r:delete e[ya]),i}var nS=Object.prototype,rS=nS.toString;function oS(e){return rS.call(e)}var iS="[object Null]",aS="[object Undefined]",zh=En?En.toStringTag:void 0;function io(e){return e==null?e===void 0?aS:iS:zh&&zh in Object(e)?tS(e):oS(e)}function Jn(e){return e!=null&&typeof e=="object"}var sS="[object Symbol]";function Nu(e){return typeof e=="symbol"||Jn(e)&&io(e)==sS}function Su(e,n){for(var r=-1,o=e==null?0:e.length,i=Array(o);++r<o;)i[r]=n(e[r],r,e);return i}var Rn=Array.isArray,Hh=En?En.prototype:void 0,Wh=Hh?Hh.toString:void 0;function Yh(e){if(typeof e=="string")return e;if(Rn(e))return Su(e,Yh)+"";if(Nu(e))return Wh?Wh.call(e):"";var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function ao(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}function Jh(e){return e}var lS="[object AsyncFunction]",cS="[object Function]",dS="[object GeneratorFunction]",uS="[object Proxy]";function Xh(e){if(!ao(e))return!1;var n=io(e);return n==cS||n==dS||n==lS||n==uS}var xu=Yn["__core-js_shared__"],Zh=(function(){var e=/[^.]+$/.exec(xu&&xu.keys&&xu.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function fS(e){return!!Zh&&Zh in e}var pS=Function.prototype,mS=pS.toString;function so(e){if(e!=null){try{return mS.call(e)}catch{}try{return e+""}catch{}}return""}var gS=/[\\^$.*+?()[\]{}|]/g,hS=/^\[object .+?Constructor\]$/,yS=Function.prototype,_S=Object.prototype,bS=yS.toString,wS=_S.hasOwnProperty,kS=RegExp("^"+bS.call(wS).replace(gS,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function CS(e){if(!ao(e)||fS(e))return!1;var n=Xh(e)?kS:hS;return n.test(so(e))}function ES(e,n){return e?.[n]}function lo(e,n){var r=ES(e,n);return CS(r)?r:void 0}var Au=lo(Yn,"WeakMap"),Qh=Object.create,NS=(function(){function e(){}return function(n){if(!ao(n))return{};if(Qh)return Qh(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}})();function SS(e,n,r){switch(r.length){case 0:return e.call(n);case 1:return e.call(n,r[0]);case 2:return e.call(n,r[0],r[1]);case 3:return e.call(n,r[0],r[1],r[2])}return e.apply(n,r)}function xS(e,n){var r=-1,o=e.length;for(n||(n=Array(o));++r<o;)n[r]=e[r];return n}var AS=800,IS=16,vS=Date.now;function TS(e){var n=0,r=0;return function(){var o=vS(),i=IS-(o-r);if(r=o,i>0){if(++n>=AS)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}function OS(e){return function(){return e}}var rl=(function(){try{var e=lo(Object,"defineProperty");return e({},"",{}),e}catch{}})(),BS=rl?function(e,n){return rl(e,"toString",{configurable:!0,enumerable:!1,value:OS(n),writable:!0})}:Jh,ey=TS(BS);function PS(e,n){for(var r=-1,o=e==null?0:e.length;++r<o&&n(e[r],r,e)!==!1;);return e}function VS(e,n,r,o){for(var i=e.length,a=r+-1;++a<i;)if(n(e[a],a,e))return a;return-1}function $S(e){return e!==e}function RS(e,n,r){for(var o=r-1,i=e.length;++o<i;)if(e[o]===n)return o;return-1}function LS(e,n,r){return n===n?RS(e,n,r):VS(e,$S,r)}function FS(e,n){var r=e==null?0:e.length;return!!r&&LS(e,n,0)>-1}var DS=9007199254740991,MS=/^(?:0|[1-9]\d*)$/;function Iu(e,n){var r=typeof e;return n=n??DS,!!n&&(r=="number"||r!="symbol"&&MS.test(e))&&e>-1&&e%1==0&&e<n}function ty(e,n,r){n=="__proto__"&&rl?rl(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r}function vu(e,n){return e===n||e!==e&&n!==n}var US=Object.prototype,jS=US.hasOwnProperty;function Tu(e,n,r){var o=e[n];(!(jS.call(e,n)&&vu(o,r))||r===void 0&&!(n in e))&&ty(e,n,r)}function _a(e,n,r,o){var i=!r;r||(r={});for(var a=-1,s=n.length;++a<s;){var l=n[a],c=void 0;c===void 0&&(c=e[l]),i?ty(r,l,c):Tu(r,l,c)}return r}var ny=Math.max;function ry(e,n,r){return n=ny(n===void 0?e.length-1:n,0),function(){for(var o=arguments,i=-1,a=ny(o.length-n,0),s=Array(a);++i<a;)s[i]=o[n+i];i=-1;for(var l=Array(n+1);++i<n;)l[i]=o[i];return l[n]=r(s),SS(e,this,l)}}function KS(e,n){return ey(ry(e,n,Jh),e+"")}var qS=9007199254740991;function Ou(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=qS}function ol(e){return e!=null&&Ou(e.length)&&!Xh(e)}var GS=Object.prototype;function il(e){var n=e&&e.constructor,r=typeof n=="function"&&n.prototype||GS;return e===r}function zS(e,n){for(var r=-1,o=Array(e);++r<e;)o[r]=n(r);return o}var HS="[object Arguments]";function oy(e){return Jn(e)&&io(e)==HS}var iy=Object.prototype,WS=iy.hasOwnProperty,YS=iy.propertyIsEnumerable,al=oy((function(){return arguments})())?oy:function(e){return Jn(e)&&WS.call(e,"callee")&&!YS.call(e,"callee")};function JS(){return!1}var ay=typeof Ve=="object"&&Ve&&!Ve.nodeType&&Ve,sy=ay&&typeof module=="object"&&module&&!module.nodeType&&module,XS=sy&&sy.exports===ay,ly=XS?Yn.Buffer:void 0,ZS=ly?ly.isBuffer:void 0,ba=ZS||JS,QS="[object Arguments]",ex="[object Array]",tx="[object Boolean]",nx="[object Date]",rx="[object Error]",ox="[object Function]",ix="[object Map]",ax="[object Number]",sx="[object Object]",lx="[object RegExp]",cx="[object Set]",dx="[object String]",ux="[object WeakMap]",fx="[object ArrayBuffer]",px="[object DataView]",mx="[object Float32Array]",gx="[object Float64Array]",hx="[object Int8Array]",yx="[object Int16Array]",_x="[object Int32Array]",bx="[object Uint8Array]",wx="[object Uint8ClampedArray]",kx="[object Uint16Array]",Cx="[object Uint32Array]",Et={};Et[mx]=Et[gx]=Et[hx]=Et[yx]=Et[_x]=Et[bx]=Et[wx]=Et[kx]=Et[Cx]=!0,Et[QS]=Et[ex]=Et[fx]=Et[tx]=Et[px]=Et[nx]=Et[rx]=Et[ox]=Et[ix]=Et[ax]=Et[sx]=Et[lx]=Et[cx]=Et[dx]=Et[ux]=!1;function Ex(e){return Jn(e)&&Ou(e.length)&&!!Et[io(e)]}function Bu(e){return function(n){return e(n)}}var cy=typeof Ve=="object"&&Ve&&!Ve.nodeType&&Ve,wa=cy&&typeof module=="object"&&module&&!module.nodeType&&module,Nx=wa&&wa.exports===cy,Pu=Nx&&qh.process,Wo=(function(){try{var e=wa&&wa.require&&wa.require("util").types;return e||Pu&&Pu.binding&&Pu.binding("util")}catch{}})(),dy=Wo&&Wo.isTypedArray,Vu=dy?Bu(dy):Ex,Sx=Object.prototype,xx=Sx.hasOwnProperty;function uy(e,n){var r=Rn(e),o=!r&&al(e),i=!r&&!o&&ba(e),a=!r&&!o&&!i&&Vu(e),s=r||o||i||a,l=s?zS(e.length,String):[],c=l.length;for(var d in e)(n||xx.call(e,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Iu(d,c)))&&l.push(d);return l}function fy(e,n){return function(r){return e(n(r))}}var Ax=fy(Object.keys,Object),Ix=Object.prototype,vx=Ix.hasOwnProperty;function py(e){if(!il(e))return Ax(e);var n=[];for(var r in Object(e))vx.call(e,r)&&r!="constructor"&&n.push(r);return n}function $u(e){return ol(e)?uy(e):py(e)}function Tx(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}var Ox=Object.prototype,Bx=Ox.hasOwnProperty;function Px(e){if(!ao(e))return Tx(e);var n=il(e),r=[];for(var o in e)o=="constructor"&&(n||!Bx.call(e,o))||r.push(o);return r}function Ru(e){return ol(e)?uy(e,!0):Px(e)}var Vx=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$x=/^\w*$/;function Rx(e,n){if(Rn(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Nu(e)?!0:$x.test(e)||!Vx.test(e)||n!=null&&e in Object(n)}var ka=lo(Object,"create");function Lx(){this.__data__=ka?ka(null):{},this.size=0}function Fx(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var Dx="__lodash_hash_undefined__",Mx=Object.prototype,Ux=Mx.hasOwnProperty;function jx(e){var n=this.__data__;if(ka){var r=n[e];return r===Dx?void 0:r}return Ux.call(n,e)?n[e]:void 0}var Kx=Object.prototype,qx=Kx.hasOwnProperty;function Gx(e){var n=this.__data__;return ka?n[e]!==void 0:qx.call(n,e)}var zx="__lodash_hash_undefined__";function Hx(e,n){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ka&&n===void 0?zx:n,this}function co(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n<r;){var o=e[n];this.set(o[0],o[1])}}co.prototype.clear=Lx,co.prototype.delete=Fx,co.prototype.get=jx,co.prototype.has=Gx,co.prototype.set=Hx;function Wx(){this.__data__=[],this.size=0}function sl(e,n){for(var r=e.length;r--;)if(vu(e[r][0],n))return r;return-1}var Yx=Array.prototype,Jx=Yx.splice;function Xx(e){var n=this.__data__,r=sl(n,e);if(r<0)return!1;var o=n.length-1;return r==o?n.pop():Jx.call(n,r,1),--this.size,!0}function Zx(e){var n=this.__data__,r=sl(n,e);return r<0?void 0:n[r][1]}function Qx(e){return sl(this.__data__,e)>-1}function eA(e,n){var r=this.__data__,o=sl(r,e);return o<0?(++this.size,r.push([e,n])):r[o][1]=n,this}function gr(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n<r;){var o=e[n];this.set(o[0],o[1])}}gr.prototype.clear=Wx,gr.prototype.delete=Xx,gr.prototype.get=Zx,gr.prototype.has=Qx,gr.prototype.set=eA;var Ca=lo(Yn,"Map");function tA(){this.size=0,this.__data__={hash:new co,map:new(Ca||gr),string:new co}}function nA(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function ll(e,n){var r=e.__data__;return nA(n)?r[typeof n=="string"?"string":"hash"]:r.map}function rA(e){var n=ll(this,e).delete(e);return this.size-=n?1:0,n}function oA(e){return ll(this,e).get(e)}function iA(e){return ll(this,e).has(e)}function aA(e,n){var r=ll(this,e),o=r.size;return r.set(e,n),this.size+=r.size==o?0:1,this}function hr(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n<r;){var o=e[n];this.set(o[0],o[1])}}hr.prototype.clear=tA,hr.prototype.delete=rA,hr.prototype.get=oA,hr.prototype.has=iA,hr.prototype.set=aA;var sA="Expected a function";function Lu(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError(sA);var r=function(){var o=arguments,i=n?n.apply(this,o):o[0],a=r.cache;if(a.has(i))return a.get(i);var s=e.apply(this,o);return r.cache=a.set(i,s)||a,s};return r.cache=new(Lu.Cache||hr),r}Lu.Cache=hr;var lA=500;function cA(e){var n=Lu(e,function(o){return r.size===lA&&r.clear(),o}),r=n.cache;return n}var dA=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,uA=/\\(\\)?/g,fA=cA(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(dA,function(r,o,i,a){n.push(i?a.replace(uA,"$1"):o||r)}),n});function uo(e){return e==null?"":Yh(e)}function Yo(e,n){return Rn(e)?e:Rx(e,n)?[e]:fA(uo(e))}function Ea(e){if(typeof e=="string"||Nu(e))return e;var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function Fu(e,n){n=Yo(n,e);for(var r=0,o=n.length;e!=null&&r<o;)e=e[Ea(n[r++])];return r&&r==o?e:void 0}function Na(e,n,r){var o=e==null?void 0:Fu(e,n);return o===void 0?r:o}function Du(e,n){for(var r=-1,o=n.length,i=e.length;++r<o;)e[i+r]=n[r];return e}var my=En?En.isConcatSpreadable:void 0;function pA(e){return Rn(e)||al(e)||!!(my&&e&&e[my])}function mA(e,n,r,o,i){var a=-1,s=e.length;for(r||(r=pA),i||(i=[]);++a<s;){var l=e[a];r(l)?Du(i,l):i[i.length]=l}return i}function gA(e){var n=e==null?0:e.length;return n?mA(e):[]}function gy(e){return ey(ry(e,void 0,gA),e+"")}var Mu=fy(Object.getPrototypeOf,Object),hA="[object Object]",yA=Function.prototype,_A=Object.prototype,hy=yA.toString,bA=_A.hasOwnProperty,wA=hy.call(Object);function kA(e){if(!Jn(e)||io(e)!=hA)return!1;var n=Mu(e);if(n===null)return!0;var r=bA.call(n,"constructor")&&n.constructor;return typeof r=="function"&&r instanceof r&&hy.call(r)==wA}function yy(e,n,r){var o=-1,i=e.length;n<0&&(n=-n>i?0:i+n),r=r>i?i:r,r<0&&(r+=i),i=n>r?0:r-n>>>0,n>>>=0;for(var a=Array(i);++o<i;)a[o]=e[o+n];return a}function CA(e,n,r){var o=e.length;return r=r===void 0?o:r,!n&&r>=o?e:yy(e,n,r)}var EA="\\ud800-\\udfff",NA="\\u0300-\\u036f",SA="\\ufe20-\\ufe2f",xA="\\u20d0-\\u20ff",AA=NA+SA+xA,IA="\\ufe0e\\ufe0f",vA="\\u200d",TA=RegExp("["+vA+EA+AA+IA+"]");function _y(e){return TA.test(e)}function OA(e){return e.split("")}var by="\\ud800-\\udfff",BA="\\u0300-\\u036f",PA="\\ufe20-\\ufe2f",VA="\\u20d0-\\u20ff",$A=BA+PA+VA,RA="\\ufe0e\\ufe0f",LA="["+by+"]",Uu="["+$A+"]",ju="\\ud83c[\\udffb-\\udfff]",FA="(?:"+Uu+"|"+ju+")",wy="[^"+by+"]",ky="(?:\\ud83c[\\udde6-\\uddff]){2}",Cy="[\\ud800-\\udbff][\\udc00-\\udfff]",DA="\\u200d",Ey=FA+"?",Ny="["+RA+"]?",MA="(?:"+DA+"(?:"+[wy,ky,Cy].join("|")+")"+Ny+Ey+")*",UA=Ny+Ey+MA,jA="(?:"+[wy+Uu+"?",Uu,ky,Cy,LA].join("|")+")",KA=RegExp(ju+"(?="+ju+")|"+jA+UA,"g");function qA(e){return e.match(KA)||[]}function GA(e){return _y(e)?qA(e):OA(e)}function zA(e){return function(n){n=uo(n);var r=_y(n)?GA(n):void 0,o=r?r[0]:n.charAt(0),i=r?CA(r,1).join(""):n.slice(1);return o[e]()+i}}var HA=zA("toUpperCase");function WA(e){return HA(uo(e).toLowerCase())}function YA(e,n,r,o){for(var i=-1,a=e==null?0:e.length;++i<a;)r=n(r,e[i],i,e);return r}function Sy(e){return function(n){return e?.[n]}}var JA={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},XA=Sy(JA),ZA=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,QA="\\u0300-\\u036f",eI="\\ufe20-\\ufe2f",tI="\\u20d0-\\u20ff",nI=QA+eI+tI,rI="["+nI+"]",oI=RegExp(rI,"g");function iI(e){return e=uo(e),e&&e.replace(ZA,XA).replace(oI,"")}var aI=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function sI(e){return e.match(aI)||[]}var lI=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function cI(e){return lI.test(e)}var xy="\\ud800-\\udfff",dI="\\u0300-\\u036f",uI="\\ufe20-\\ufe2f",fI="\\u20d0-\\u20ff",pI=dI+uI+fI,Ay="\\u2700-\\u27bf",Iy="a-z\\xdf-\\xf6\\xf8-\\xff",mI="\\xac\\xb1\\xd7\\xf7",gI="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",hI="\\u2000-\\u206f",yI=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",vy="A-Z\\xc0-\\xd6\\xd8-\\xde",_I="\\ufe0e\\ufe0f",Ty=mI+gI+hI+yI,Oy="['’]",By="["+Ty+"]",bI="["+pI+"]",Py="\\d+",wI="["+Ay+"]",Vy="["+Iy+"]",$y="[^"+xy+Ty+Py+Ay+Iy+vy+"]",kI="\\ud83c[\\udffb-\\udfff]",CI="(?:"+bI+"|"+kI+")",EI="[^"+xy+"]",Ry="(?:\\ud83c[\\udde6-\\uddff]){2}",Ly="[\\ud800-\\udbff][\\udc00-\\udfff]",Jo="["+vy+"]",NI="\\u200d",Fy="(?:"+Vy+"|"+$y+")",SI="(?:"+Jo+"|"+$y+")",Dy="(?:"+Oy+"(?:d|ll|m|re|s|t|ve))?",My="(?:"+Oy+"(?:D|LL|M|RE|S|T|VE))?",Uy=CI+"?",jy="["+_I+"]?",xI="(?:"+NI+"(?:"+[EI,Ry,Ly].join("|")+")"+jy+Uy+")*",AI="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",II="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",vI=jy+Uy+xI,TI="(?:"+[wI,Ry,Ly].join("|")+")"+vI,OI=RegExp([Jo+"?"+Vy+"+"+Dy+"(?="+[By,Jo,"$"].join("|")+")",SI+"+"+My+"(?="+[By,Jo+Fy,"$"].join("|")+")",Jo+"?"+Fy+"+"+Dy,Jo+"+"+My,II,AI,Py,TI].join("|"),"g");function BI(e){return e.match(OI)||[]}function PI(e,n,r){return e=uo(e),n=n,n===void 0?cI(e)?BI(e):sI(e):e.match(n)||[]}var VI="['’]",$I=RegExp(VI,"g");function RI(e){return function(n){return YA(PI(iI(n).replace($I,"")),e,"")}}var LI=RI(function(e,n,r){return n=n.toLowerCase(),e+(r?WA(n):n)});function FI(){this.__data__=new gr,this.size=0}function DI(e){var n=this.__data__,r=n.delete(e);return this.size=n.size,r}function MI(e){return this.__data__.get(e)}function UI(e){return this.__data__.has(e)}var jI=200;function KI(e,n){var r=this.__data__;if(r instanceof gr){var o=r.__data__;if(!Ca||o.length<jI-1)return o.push([e,n]),this.size=++r.size,this;r=this.__data__=new hr(o)}return r.set(e,n),this.size=r.size,this}function yr(e){var n=this.__data__=new gr(e);this.size=n.size}yr.prototype.clear=FI,yr.prototype.delete=DI,yr.prototype.get=MI,yr.prototype.has=UI,yr.prototype.set=KI;function qI(e,n){return e&&_a(n,$u(n),e)}function GI(e,n){return e&&_a(n,Ru(n),e)}var Ky=typeof Ve=="object"&&Ve&&!Ve.nodeType&&Ve,qy=Ky&&typeof module=="object"&&module&&!module.nodeType&&module,zI=qy&&qy.exports===Ky,Gy=zI?Yn.Buffer:void 0,zy=Gy?Gy.allocUnsafe:void 0;function HI(e,n){if(n)return e.slice();var r=e.length,o=zy?zy(r):new e.constructor(r);return e.copy(o),o}function WI(e,n){for(var r=-1,o=e==null?0:e.length,i=0,a=[];++r<o;){var s=e[r];n(s,r,e)&&(a[i++]=s)}return a}function Hy(){return[]}var YI=Object.prototype,JI=YI.propertyIsEnumerable,Wy=Object.getOwnPropertySymbols,Ku=Wy?function(e){return e==null?[]:(e=Object(e),WI(Wy(e),function(n){return JI.call(e,n)}))}:Hy;function XI(e,n){return _a(e,Ku(e),n)}var ZI=Object.getOwnPropertySymbols,Yy=ZI?function(e){for(var n=[];e;)Du(n,Ku(e)),e=Mu(e);return n}:Hy;function QI(e,n){return _a(e,Yy(e),n)}function Jy(e,n,r){var o=n(e);return Rn(e)?o:Du(o,r(e))}function qu(e){return Jy(e,$u,Ku)}function Xy(e){return Jy(e,Ru,Yy)}var Gu=lo(Yn,"DataView"),zu=lo(Yn,"Promise"),Hu=lo(Yn,"Set"),Zy="[object Map]",ev="[object Object]",Qy="[object Promise]",e_="[object Set]",t_="[object WeakMap]",n_="[object DataView]",tv=so(Gu),nv=so(Ca),rv=so(zu),ov=so(Hu),iv=so(Au),Nn=io;(Gu&&Nn(new Gu(new ArrayBuffer(1)))!=n_||Ca&&Nn(new Ca)!=Zy||zu&&Nn(zu.resolve())!=Qy||Hu&&Nn(new Hu)!=e_||Au&&Nn(new Au)!=t_)&&(Nn=function(e){var n=io(e),r=n==ev?e.constructor:void 0,o=r?so(r):"";if(o)switch(o){case tv:return n_;case nv:return Zy;case rv:return Qy;case ov:return e_;case iv:return t_}return n});var av=Object.prototype,sv=av.hasOwnProperty;function lv(e){var n=e.length,r=new e.constructor(n);return n&&typeof e[0]=="string"&&sv.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var cl=Yn.Uint8Array;function Wu(e){var n=new e.constructor(e.byteLength);return new cl(n).set(new cl(e)),n}function cv(e,n){var r=n?Wu(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var dv=/\w*$/;function uv(e){var n=new e.constructor(e.source,dv.exec(e));return n.lastIndex=e.lastIndex,n}var r_=En?En.prototype:void 0,o_=r_?r_.valueOf:void 0;function fv(e){return o_?Object(o_.call(e)):{}}function pv(e,n){var r=n?Wu(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var mv="[object Boolean]",gv="[object Date]",hv="[object Map]",yv="[object Number]",_v="[object RegExp]",bv="[object Set]",wv="[object String]",kv="[object Symbol]",Cv="[object ArrayBuffer]",Ev="[object DataView]",Nv="[object Float32Array]",Sv="[object Float64Array]",xv="[object Int8Array]",Av="[object Int16Array]",Iv="[object Int32Array]",vv="[object Uint8Array]",Tv="[object Uint8ClampedArray]",Ov="[object Uint16Array]",Bv="[object Uint32Array]";function Pv(e,n,r){var o=e.constructor;switch(n){case Cv:return Wu(e);case mv:case gv:return new o(+e);case Ev:return cv(e,r);case Nv:case Sv:case xv:case Av:case Iv:case vv:case Tv:case Ov:case Bv:return pv(e,r);case hv:return new o;case yv:case wv:return new o(e);case _v:return uv(e);case bv:return new o;case kv:return fv(e)}}function Vv(e){return typeof e.constructor=="function"&&!il(e)?NS(Mu(e)):{}}var $v="[object Map]";function Rv(e){return Jn(e)&&Nn(e)==$v}var i_=Wo&&Wo.isMap,Lv=i_?Bu(i_):Rv,Fv="[object Set]";function Dv(e){return Jn(e)&&Nn(e)==Fv}var a_=Wo&&Wo.isSet,Mv=a_?Bu(a_):Dv,Uv=1,jv=2,Kv=4,s_="[object Arguments]",qv="[object Array]",Gv="[object Boolean]",zv="[object Date]",Hv="[object Error]",l_="[object Function]",Wv="[object GeneratorFunction]",Yv="[object Map]",Jv="[object Number]",c_="[object Object]",Xv="[object RegExp]",Zv="[object Set]",Qv="[object String]",eT="[object Symbol]",tT="[object WeakMap]",nT="[object ArrayBuffer]",rT="[object DataView]",oT="[object Float32Array]",iT="[object Float64Array]",aT="[object Int8Array]",sT="[object Int16Array]",lT="[object Int32Array]",cT="[object Uint8Array]",dT="[object Uint8ClampedArray]",uT="[object Uint16Array]",fT="[object Uint32Array]",Ct={};Ct[s_]=Ct[qv]=Ct[nT]=Ct[rT]=Ct[Gv]=Ct[zv]=Ct[oT]=Ct[iT]=Ct[aT]=Ct[sT]=Ct[lT]=Ct[Yv]=Ct[Jv]=Ct[c_]=Ct[Xv]=Ct[Zv]=Ct[Qv]=Ct[eT]=Ct[cT]=Ct[dT]=Ct[uT]=Ct[fT]=!0,Ct[Hv]=Ct[l_]=Ct[tT]=!1;function Sa(e,n,r,o,i,a){var s,l=n&Uv,c=n&jv,d=n&Kv;if(r&&(s=i?r(e,o,i,a):r(e)),s!==void 0)return s;if(!ao(e))return e;var f=Rn(e);if(f){if(s=lv(e),!l)return xS(e,s)}else{var u=Nn(e),p=u==l_||u==Wv;if(ba(e))return HI(e,l);if(u==c_||u==s_||p&&!i){if(s=c||p?{}:Vv(e),!l)return c?QI(e,GI(s,e)):XI(e,qI(s,e))}else{if(!Ct[u])return i?e:{};s=Pv(e,u,l)}}a||(a=new yr);var g=a.get(e);if(g)return g;a.set(e,s),Mv(e)?e.forEach(function(m){s.add(Sa(m,n,r,m,e,a))}):Lv(e)&&e.forEach(function(m,_){s.set(_,Sa(m,n,r,_,e,a))});var h=d?c?Xy:qu:c?Ru:$u,y=f?void 0:h(e);return PS(y||e,function(m,_){y&&(_=m,m=e[_]),Tu(s,_,Sa(m,n,r,_,e,a))}),s}var pT=1,mT=4;function Yu(e){return Sa(e,pT|mT)}var gT="__lodash_hash_undefined__";function hT(e){return this.__data__.set(e,gT),this}function yT(e){return this.__data__.has(e)}function xa(e){var n=-1,r=e==null?0:e.length;for(this.__data__=new hr;++n<r;)this.add(e[n])}xa.prototype.add=xa.prototype.push=hT,xa.prototype.has=yT;function _T(e,n){for(var r=-1,o=e==null?0:e.length;++r<o;)if(n(e[r],r,e))return!0;return!1}function Ju(e,n){return e.has(n)}var bT=1,wT=2;function d_(e,n,r,o,i,a){var s=r&bT,l=e.length,c=n.length;if(l!=c&&!(s&&c>l))return!1;var d=a.get(e),f=a.get(n);if(d&&f)return d==n&&f==e;var u=-1,p=!0,g=r&wT?new xa:void 0;for(a.set(e,n),a.set(n,e);++u<l;){var h=e[u],y=n[u];if(o)var m=s?o(y,h,u,n,e,a):o(h,y,u,e,n,a);if(m!==void 0){if(m)continue;p=!1;break}if(g){if(!_T(n,function(_,b){if(!Ju(g,b)&&(h===_||i(h,_,r,o,a)))return g.push(b)})){p=!1;break}}else if(!(h===y||i(h,y,r,o,a))){p=!1;break}}return a.delete(e),a.delete(n),p}function kT(e){var n=-1,r=Array(e.size);return e.forEach(function(o,i){r[++n]=[i,o]}),r}function CT(e){var n=-1,r=Array(e.size);return e.forEach(function(o){r[++n]=o}),r}var ET=1,NT=2,ST="[object Boolean]",xT="[object Date]",AT="[object Error]",IT="[object Map]",vT="[object Number]",TT="[object RegExp]",OT="[object Set]",BT="[object String]",PT="[object Symbol]",VT="[object ArrayBuffer]",$T="[object DataView]",u_=En?En.prototype:void 0,Xu=u_?u_.valueOf:void 0;function RT(e,n,r,o,i,a,s){switch(r){case $T:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case VT:return!(e.byteLength!=n.byteLength||!a(new cl(e),new cl(n)));case ST:case xT:case vT:return vu(+e,+n);case AT:return e.name==n.name&&e.message==n.message;case TT:case BT:return e==n+"";case IT:var l=kT;case OT:var c=o&ET;if(l||(l=CT),e.size!=n.size&&!c)return!1;var d=s.get(e);if(d)return d==n;o|=NT,s.set(e,n);var f=d_(l(e),l(n),o,i,a,s);return s.delete(e),f;case PT:if(Xu)return Xu.call(e)==Xu.call(n)}return!1}var LT=1,FT=Object.prototype,DT=FT.hasOwnProperty;function MT(e,n,r,o,i,a){var s=r&LT,l=qu(e),c=l.length,d=qu(n),f=d.length;if(c!=f&&!s)return!1;for(var u=c;u--;){var p=l[u];if(!(s?p in n:DT.call(n,p)))return!1}var g=a.get(e),h=a.get(n);if(g&&h)return g==n&&h==e;var y=!0;a.set(e,n),a.set(n,e);for(var m=s;++u<c;){p=l[u];var _=e[p],b=n[p];if(o)var k=s?o(b,_,p,n,e,a):o(_,b,p,e,n,a);if(!(k===void 0?_===b||i(_,b,r,o,a):k)){y=!1;break}m||(m=p=="constructor")}if(y&&!m){var A=e.constructor,C=n.constructor;A!=C&&"constructor"in e&&"constructor"in n&&!(typeof A=="function"&&A instanceof A&&typeof C=="function"&&C instanceof C)&&(y=!1)}return a.delete(e),a.delete(n),y}var UT=1,f_="[object Arguments]",p_="[object Array]",dl="[object Object]",jT=Object.prototype,m_=jT.hasOwnProperty;function KT(e,n,r,o,i,a){var s=Rn(e),l=Rn(n),c=s?p_:Nn(e),d=l?p_:Nn(n);c=c==f_?dl:c,d=d==f_?dl:d;var f=c==dl,u=d==dl,p=c==d;if(p&&ba(e)){if(!ba(n))return!1;s=!0,f=!1}if(p&&!f)return a||(a=new yr),s||Vu(e)?d_(e,n,r,o,i,a):RT(e,n,c,r,o,i,a);if(!(r&UT)){var g=f&&m_.call(e,"__wrapped__"),h=u&&m_.call(n,"__wrapped__");if(g||h){var y=g?e.value():e,m=h?n.value():n;return a||(a=new yr),i(y,m,r,o,a)}}return p?(a||(a=new yr),MT(e,n,r,o,i,a)):!1}function g_(e,n,r,o,i){return e===n?!0:e==null||n==null||!Jn(e)&&!Jn(n)?e!==e&&n!==n:KT(e,n,r,o,g_,i)}function qT(e,n){return e!=null&&n in Object(e)}function h_(e,n,r){n=Yo(n,e);for(var o=-1,i=n.length,a=!1;++o<i;){var s=Ea(n[o]);if(!(a=e!=null&&r(e,s)))break;e=e[s]}return a||++o!=i?a:(i=e==null?0:e.length,!!i&&Ou(i)&&Iu(s,i)&&(Rn(e)||al(e)))}function GT(e,n){return e!=null&&h_(e,n,qT)}function zT(e){return Jn(e)&&ol(e)}function HT(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}var WT={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},YT=Sy(WT),y_=/[&<>"']/g,JT=RegExp(y_.source);function XT(e){return e=uo(e),e&&JT.test(e)?e.replace(y_,YT):e}var ZT=Object.prototype,QT=ZT.hasOwnProperty;function eO(e,n){return e!=null&&QT.call(e,n)}function ul(e,n){return e!=null&&h_(e,n,eO)}var tO=Math.min;function nO(e,n,r){for(var o=FS,i=e[0].length,a=e.length,s=a,l=Array(a),c=1/0,d=[];s--;){var f=e[s];c=tO(f.length,c),l[s]=i>=120&&f.length>=120?new xa(s&&f):void 0}f=e[0];var u=-1,p=l[0];e:for(;++u<i&&d.length<c;){var g=f[u],h=g;if(g=g!==0?g:0,!(p?Ju(p,h):o(d,h))){for(s=a;--s;){var y=l[s];if(!(y?Ju(y,h):o(e[s],h)))continue e}p&&p.push(h),d.push(g)}}return d}function rO(e){return zT(e)?e:[]}var oO=KS(function(e){var n=Su(e,rO);return n.length&&n[0]===e[0]?nO(n):[]});function iO(e,n){return n.length<2?e:Fu(e,yy(n,0,-1))}var aO="[object Map]",sO="[object Set]",lO=Object.prototype,cO=lO.hasOwnProperty;function Zu(e){if(e==null)return!0;if(ol(e)&&(Rn(e)||typeof e=="string"||typeof e.splice=="function"||ba(e)||Vu(e)||al(e)))return!e.length;var n=Nn(e);if(n==aO||n==sO)return!e.size;if(il(e))return!py(e).length;for(var r in e)if(cO.call(e,r))return!1;return!0}function yn(e,n){return g_(e,n)}var dO=Object.prototype,uO=dO.hasOwnProperty;function __(e,n){n=Yo(n,e);var r=-1,o=n.length;if(!o)return!0;for(;++r<o;){var i=Ea(n[r]);if(i==="__proto__"&&!uO.call(e,"__proto__")||(i==="constructor"||i==="prototype")&&r<o-1)return!1}var a=iO(e,n);return a==null||delete a[Ea(HT(n))]}function fO(e){return kA(e)?void 0:e}var pO=1,mO=2,gO=4,fo=gy(function(e,n){var r={};if(e==null)return r;var o=!1;n=Su(n,function(a){return a=Yo(a,e),o||(o=a.length>1),a}),_a(e,Xy(e),r),o&&(r=Sa(r,pO|mO|gO,fO));for(var i=n.length;i--;)__(r,n[i]);return r});function b_(e,n,r,o){if(!ao(e))return e;n=Yo(n,e);for(var i=-1,a=n.length,s=a-1,l=e;l!=null&&++i<a;){var c=Ea(n[i]),d=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(i!=s){var f=l[c];d=void 0,d===void 0&&(d=ao(f)?f:Iu(n[i+1])?[]:{})}Tu(l,c,d),l=l[c]}return e}function hO(e,n,r){for(var o=-1,i=n.length,a={};++o<i;){var s=n[o],l=Fu(e,s);r(l,s)&&b_(a,Yo(s,e),l)}return a}function yO(e,n){return hO(e,n,function(r,o){return GT(e,o)})}var Qu=gy(function(e,n){return e==null?{}:yO(e,n)});function w_(e,n,r){return e==null?e:b_(e,n,r)}var _O=0;function ef(e){var n=++_O;return uo(e)+n}function k_(e,n){return e==null?!0:__(e,n)}const Xo="{key}",po={"kong.client.consumer":{dataType:"object",writable:!1,readable:!0},"kong.client.consumer_groups":{dataType:"array",writable:!1,readable:!0},"kong.client.credential":{dataType:"object",writable:!1,readable:!0},"kong.client.get_identity_realm_source":{dataType:"object",writable:!1,readable:!0},"kong.client.forwarded_ip":{dataType:"string",writable:!1,readable:!0},"kong.client.forwarded_port":{dataType:"number",writable:!1,readable:!0},"kong.client.ip":{dataType:"string",writable:!1,readable:!0},"kong.client.port":{dataType:"number",writable:!1,readable:!0},"kong.client.protocol":{dataType:"string",writable:!1,readable:!0},"kong.client.principal":{dataType:"object",writable:!1,readable:!0},"kong.client.principal.{key}":{dataType:"any",writable:!1,readable:!0},"kong.request.forwarded_host":{dataType:"string",writable:!1,readable:!0},"kong.request.forwarded_port":{dataType:"number",writable:!1,readable:!0},"kong.request.forwarded_scheme":{dataType:"string",writable:!1,readable:!0},"kong.request.port":{dataType:"number",writable:!1,readable:!0},"kong.response.source":{dataType:"string",writable:!1,readable:!0},"kong.router.route":{dataType:"object",writable:!1,readable:!0},"kong.route_id":{dataType:"string",writable:!1,readable:!0},"kong.route_name":{dataType:"string",writable:!1,readable:!0},"kong.router.service":{dataType:"object",writable:!1,readable:!0},"kong.service_name":{dataType:"string",writable:!1,readable:!0},"kong.service_id":{dataType:"string",writable:!1,readable:!0},"kong.service.response.status":{dataType:"number",writable:!1,readable:!0},"kong.version":{dataType:"string",writable:!1,readable:!0},"kong.node.id":{dataType:"string",writable:!1,readable:!0},"kong.configuration.{key}":{dataType:"any",writable:!1,readable:!0},"kong.service.target":{dataType:"string ({host}:{port})",writable:!0,readable:!1},"kong.service.request_scheme":{dataType:"string ({scheme})",writable:!0,readable:!1},"kong.ctx.plugin.{key}":{dataType:"any",writable:!0,readable:!0},"kong.ctx.shared.{key}":{dataType:"any",writable:!0,readable:!0}},fl=Object.keys(po).filter(e=>e.includes(Xo)).map(e=>e.replace(Xo,""));function tf(e){if(!e||!Ia(e))return;const n=fl.find(r=>e.startsWith(r));if(n)return e.slice(n.length).replace(Xo,"")}function Aa(e){if(!e)return null;const n=fl.find(r=>e.startsWith(r));return n||e}function Ia(e){return e?fl.some(n=>e.startsWith(n)):!1}function C_(e){return e?Ia(e)?Aa(e)+Xo:e:null}function nf(e){if(!e)return!1;const n=C_(e);return n?po[n]?.readable??!1:!1}function rf(e){if(!e)return!1;const n=C_(e);return n?po[n]?.writable??!1:!1}const of=Symbol("EXPERIMENTAL_FREE_FORM_PROVIDER"),nn={KM_2262_CODE_MODE:"KM-2262-code-mode",KM_2306_CONDITION_FIELD_314:"KM-2306-condition-field-314",KM_2446_DATAKIT_JWT_NODES:"KM-2446-Datakit-JWT-nodes",KM_2503_CUSTOM_PLUGIN_FREEFORM:"KM-2503-custom-plugin-freeform",KM_2485_CLONED_PLUGINS:"KM-2485-cloned-plugins",KHCP_20393_IDENTITY_PRINCIPALS_UI:"khcp-20393-identity-principals-ui",KM_3444_GATEWAY_317:"KM-3444-gateway-317"},E_=Symbol("TOASTER_PROVIDER");function pl(){const e=(...r)=>{console.warn("TOASTER_PROVIDER is not provided",...r)},n=t.inject(E_,e);return r=>n(r)}const N_=["request","service_request","service_response","response","vault"],Zo=N_,S_=["call","jq","exit","property","static","branch","cache","xml_to_json","json_to_xml","jwt_decode","jwt_sign","jwt_verify"],x_=["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS","TRACE","CONNECT"],af=["EdDSA","ES256","ES384","ES512","HS256","HS384","HS512","PS256","PS384","PS512","RS256","RS384","RS512"],Pe=(e,n)=>{const r=e.__vccOpts||e;for(const[o,i]of n)r[o]=i;return r},bO={},wO={height:"16",viewBox:"0 -960 960 960",width:"16",xmlns:"http://www.w3.org/2000/svg"};function kO(e,n){return t.openBlock(),t.createElementBlock("svg",wO,[...n[0]||(n[0]=[t.createElementVNode("path",{d:"M240-160h480v-400H240v400Zm296.5-143.5Q560-327 560-360t-23.5-56.5Q513-440 480-440t-56.5 23.5Q400-393 400-360t23.5 56.5Q447-280 480-280t56.5-23.5ZM240-160v-400 400Zm0 80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h280v-80q0-83 58.5-141.5T720-920q83 0 141.5 58.5T920-720h-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80h120q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Z",fill:"currentColor"},null,-1)])])}const CO=Pe(bO,[["render",kO]]),EO={},NO={height:"16",viewBox:"0 -960 960 960",width:"16",xmlns:"http://www.w3.org/2000/svg"};function SO(e,n){return t.openBlock(),t.createElementBlock("svg",NO,[...n[0]||(n[0]=[t.createElementVNode("path",{d:"M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q65 0 123 19t107 53l-58 59q-38-24-81-37.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133 0 226.5-93.5T800-480q0-18-2-36t-6-35l65-65q11 32 17 66t6 70q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm-56-216L254-466l56-56 114 114 400-401 56 56-456 457Z",fill:"currentColor"},null,-1)])])}const xO=Pe(EO,[["render",SO]]),va=[{id:"external_interaction",colors:{foreground:LN,background:vN},nodes:[{type:"call",icon:Se.NetworkIcon},{type:"cache",icon:Se.CachedIcon}]},{id:"control_flow",colors:{foreground:PN,background:NN},nodes:[{type:"branch",icon:Se.ArrowSplitIcon},{type:"exit",icon:Se.GatewayIcon}]},{id:"data_transformation",colors:{foreground:Lh,background:SN},nodes:[{type:"jq",icon:Se.CodeblockIcon},{type:"xml_to_json",icon:Se.DataObjectIcon},{type:"json_to_xml",icon:Se.CodeIcon}]},{id:"data_value",colors:{foreground:Dh,background:RN},nodes:[{type:"property",icon:Se.StackIcon},{type:"static",icon:Se.DeployIcon}]},{id:"authentication",colors:{foreground:VN,background:$N},nodes:[{type:"jwt_sign",icon:Se.EditSquareIcon},{type:"jwt_decode",icon:CO},{type:"jwt_verify",icon:xO}]}],AO=va.reduce((e,n)=>{for(const r of n.nodes)e[r.type]={icon:r.icon,colors:n.colors};return e},{}),Qo={vault:{icon:Se.KeyIcon},request:{icon:Se.CloudIcon},service_request:{icon:Se.CloudIcon},service_response:{icon:Se.CloudIcon},response:{icon:Se.CloudIcon}};function IO(e){return va.find(({id:n})=>n===e).colors}function sf(e){return AO[e]??Qo[e]}const{t:lf}=Vt.createI18n("en-us",Lt);function ei(e){return lf(`plugins.free-form.datakit.flow_editor.node_types.${e}.description`)}function vO(e){return lf(`plugins.free-form.datakit.flow_editor.node_types.${e}.summary`)}function TO(e){return lf(`plugins.free-form.datakit.flow_editor.node_panel.groups.${e}`)}const OO={call:{io:{input:{fields:[{name:"headers"},{name:"body"},{name:"query"}]},output:{fields:[{name:"headers"},{name:"body"},{name:"status"}]}}},jq:{io:{input:{fields:[],configurable:!0},output:{fields:[]}}},exit:{io:{input:{fields:[{name:"headers"},{name:"body"}]}}},property:{io:{input:{fields:[],configurable:!0},output:{fields:[]}}},static:{io:{output:{fields:[],configurable:!0}}},branch:{io:{input:{fields:[]},next:{branches:[{name:"then"},{name:"else"}]}}},cache:{io:{input:{fields:[{name:"data"},{name:"key"},{name:"ttl"}]},output:{fields:[{name:"data"},{name:"hit"},{name:"miss"},{name:"stored"}]}}},xml_to_json:{io:{input:{fields:[]},output:{fields:[]}}},json_to_xml:{io:{input:{fields:[],configurable:!0},output:{fields:[]}}},jwt_decode:{io:{input:{fields:[]},output:{fields:[{name:"header"},{name:"payload"},{name:"signature"}]}}},jwt_sign:{io:{input:{fields:[{name:"claims"},{name:"key"}]},output:{fields:[{name:"claims"},{name:"header"},{name:"token"}]}}},jwt_verify:{io:{input:{fields:[{name:"key"},{name:"token"}]},output:{fields:[{name:"claims"},{name:"header"}]}}}};function BO(e){return{id:e.id,title:TO(e.id),colors:IO(e.id),nodeTypes:e.nodes.map(({type:n})=>n)}}function PO(e,n){return{...OO[n.type],type:n.type,icon:n.icon,group:e.id,summary:vO(n.type),description:ei(n.type)}}const A_=va.reduce((e,n)=>(e[n.id]=BO(n),e),{}),ml=va.reduce((e,n)=>{for(const r of n.nodes)e[r.type]=PO(n,r);return e},{}),I_=va.map(e=>({...A_[e.id],nodes:e.nodes.map(({type:n})=>ml[n])}));function VO(e){return A_[e]}const gl={request:{type:"request",description:ei("request"),io:{output:{fields:[{name:"headers"},{name:"body"},{name:"query"}]}},...Qo.request},service_request:{type:"service_request",description:ei("service_request"),io:{input:{fields:[{name:"headers"},{name:"body"},{name:"query"}]}},...Qo.service_request},service_response:{type:"service_response",description:ei("service_response"),io:{output:{fields:[{name:"headers"},{name:"body"}]}},...Qo.service_response},response:{type:"response",description:ei("response"),io:{input:{fields:[{name:"headers"},{name:"body"}]}},...Qo.response},vault:{type:"vault",io:{output:{fields:[],configurable:!0}},...Qo.vault,hidden:!0}},cf=Object.keys(gl),df=e=>cf.includes(e),$O=e=>[...cf,...S_].includes(e),rn=e=>cf.includes(e),hl=e=>rn(e.type),uf=e=>!!e?.startsWith("node:"),Ta=e=>Object.prototype.hasOwnProperty.call(e,"ownerId");function _r(e){return Yu(e)}function ff(e,n){if(e.length!==n.length)return!1;if(e.length===0)return!0;const r=new Set(n);return e.every(o=>r.has(o))}function ti(e){return`${e}:${ef()}`}function yl(e){const[n,r]=e.split(".");return{nodeName:n,fieldName:r}}function v_(e){const[n,r]=e.split(".");return{nodeId:n,fieldId:r}}function ni(e){return rn(e)?gl[e]:ml[e]}function T_(e){const n=ni(e),r=n.io?.input?.fields.map(({name:i})=>i)??[],o=n.io?.output?.fields.map(({name:i})=>i)??[];return{input:r,output:o}}function Oa(e){return ni(e).io?.next?.branches?.map(({name:r})=>r)??[]}function O_(e){return(e??[]).map(n=>({id:ti("field"),name:n}))}function Ur(e,n,r){if(r)return e.fields[n].find(o=>o.name===r)}function jr(e,n,r){if(r)return e.fields[n].find(o=>o.id===r)}function pf(e,n){return n?e.fields.output.some(r=>r.id===n):!0}function B_(e,n){return n?e.fields.input.some(r=>r.id===n):!0}function RO(e){const n=["request","service_request","vault"].includes(e)?"request":"response",r=gl[e];return{name:e,phase:n,position:{x:0,y:0},fields:T_(r.type),expanded:{},hidden:r.hidden}}function P_(e,n){const o=(typeof e=="string"&&$O(e)?e.toUpperCase():e).replace(/_\d+$/,"");for(let i=1;;i++){const a=`${o}_${i}`;if(!n.has(a))return a}}function mf(e,n){return`${e}:${n}`}function LO(e){const n=e.lastIndexOf(":");if(n===-1)throw new Error(`Invalid group ID format: ${e}`);const r=e.slice(0,n),o=e.slice(n+1);return{nodeId:r,branch:o}}function _l(e,n){return`${e}:${n}`}function V_(e,n,r,o,i){return{id:mf(e,n),ownerId:e,branch:n,phase:r,memberIds:[...o],position:i?.position?{...i.position}:void 0,dimensions:i?.dimensions?{...i.dimensions}:void 0}}function FO(e,n,r,o,i){const a={...e.config,nodes:n};o!==void 0&&(a.resources=o);const s={...e.__ui_data,...r},l={...e,config:a,__ui_data:s};return i!=null?l.partials=[{id:i}]:l.partials&&(l.partials=null),l}function bl(e,n,r){const o=n?jr(e,r,n):void 0;return`${e.name}${o?`.${o.name}`:""}`}function Ba(e,n){const r=n(e.source),o=n(e.target);return[bl(r,e.sourceField,"output"),bl(o,e.targetField,"input")]}function gf(e,n,r,o,i){const a=i(e),s=i(r);return[bl(a,n,"output"),bl(s,o,"input")]}function $_(e){if(e.length===0)throw new Error("getBoundingRect requires at least one rect");let n=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(const{x:a,y:s,width:l,height:c}of e){if(![a,s,l,c].every(Number.isFinite))throw new Error("Rect values must be finite numbers");if(l<0||c<0)throw new RangeError("Rect width and height must be non-negative");const d=a+l,f=s+c;if(!Number.isFinite(d)||!Number.isFinite(f))throw new RangeError("Rect boundaries must be finite numbers");a<n&&(n=a),s<r&&(r=s),d>o&&(o=d),f>i&&(i=f)}return{x:n,y:r,width:o-n,height:i-r}}var R_=Object.defineProperty,DO=(e,n,r)=>n in e?R_(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,MO=(e,n)=>{for(var r in n)R_(e,r,{get:n[r],enumerable:!0})},UO=(e,n,r)=>DO(e,n+"",r),L_={};MO(L_,{Graph:()=>Xn,alg:()=>_f});var jO=Object.defineProperty,F_=(e,n)=>{for(var r in n)jO(e,r,{get:n[r],enumerable:!0})},hf=class{constructor(n){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},n&&(this._isDirected="directed"in n?n.directed:!0,this._isMultigraph="multigraph"in n?n.multigraph:!1,this._isCompound="compound"in n?n.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(n){return this._label=n,this}graph(){return this._label}setDefaultNodeLabel(n){return typeof n!="function"?this._defaultNodeLabelFn=()=>n:this._defaultNodeLabelFn=n,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(n=>Object.keys(this._in[n]).length===0)}sinks(){return this.nodes().filter(n=>Object.keys(this._out[n]).length===0)}setNodes(n,r){return n.forEach(o=>{r!==void 0?this.setNode(o,r):this.setNode(o)}),this}setNode(n,r){return n in this._nodes?(arguments.length>1&&(this._nodes[n]=r),this):(this._nodes[n]=arguments.length>1?r:this._defaultNodeLabelFn(n),this._isCompound&&(this._parent[n]="\0",this._children[n]={},this._children["\0"][n]=!0),this._in[n]={},this._preds[n]={},this._out[n]={},this._sucs[n]={},++this._nodeCount,this)}node(n){return this._nodes[n]}hasNode(n){return n in this._nodes}removeNode(n){if(n in this._nodes){let r=o=>this.removeEdge(this._edgeObjs[o]);delete this._nodes[n],this._isCompound&&(this._removeFromParentsChildList(n),delete this._parent[n],this.children(n).forEach(o=>{this.setParent(o)}),delete this._children[n]),Object.keys(this._in[n]).forEach(r),delete this._in[n],delete this._preds[n],Object.keys(this._out[n]).forEach(r),delete this._out[n],delete this._sucs[n],--this._nodeCount}return this}setParent(n,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r===void 0)r="\0";else{r+="";for(let o=r;o!==void 0;o=this.parent(o))if(o===n)throw new Error("Setting "+r+" as parent of "+n+" would create a cycle");this.setNode(r)}return this.setNode(n),this._removeFromParentsChildList(n),this._parent[n]=r,this._children[r][n]=!0,this}parent(n){if(this._isCompound){let r=this._parent[n];if(r!=="\0")return r}}children(n="\0"){if(this._isCompound){let r=this._children[n];if(r)return Object.keys(r)}else{if(n==="\0")return this.nodes();if(this.hasNode(n))return[]}return[]}predecessors(n){let r=this._preds[n];if(r)return Object.keys(r)}successors(n){let r=this._sucs[n];if(r)return Object.keys(r)}neighbors(n){let r=this.predecessors(n);if(r){let o=new Set(r),i=this.successors(n);if(i)for(let a of i)o.add(a);return Array.from(o.values())}}isLeaf(n){var r;let o;return this.isDirected()?o=this.successors(n):o=this.neighbors(n),((r=o?.length)!=null?r:0)===0}filterNodes(n){let r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph()),Object.entries(this._nodes).forEach(([a,s])=>{n(a)&&r.setNode(a,s)}),Object.values(this._edgeObjs).forEach(a=>{r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,this.edge(a))});let o={},i=a=>{let s=this.parent(a);return!s||r.hasNode(s)?(o[a]=s,s):s in o?o[s]:i(s)};return this._isCompound&&r.nodes().forEach(a=>r.setParent(a,i(a))),r}setDefaultEdgeLabel(n){return typeof n!="function"?this._defaultEdgeLabelFn=()=>n:this._defaultEdgeLabelFn=n,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(n,r){return n.reduce((o,i)=>(r!==void 0?this.setEdge(o,i,r):this.setEdge(o,i),i)),this}setEdge(n,r,o,i){let a,s,l,c,d=!1;typeof n=="object"&&n!==null&&"v"in n?(a=n.v,s=n.w,l=n.name,arguments.length===2&&(c=r,d=!0)):(a=n,s=r,l=i,arguments.length>2&&(c=o,d=!0)),a=""+a,s=""+s,l!==void 0&&(l=""+l);let f=Pa(this._isDirected,a,s,l);if(f in this._edgeLabels)return d&&(this._edgeLabels[f]=c),this;if(l!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(a),this.setNode(s),this._edgeLabels[f]=d?c:this._defaultEdgeLabelFn(a,s,l);let u=KO(this._isDirected,a,s,l);return a=u.v,s=u.w,Object.freeze(u),this._edgeObjs[f]=u,D_(this._preds[s],a),D_(this._sucs[a],s),this._in[s][f]=u,this._out[a][f]=u,this._edgeCount++,this}edge(n,r,o){let i=arguments.length===1?yf(this._isDirected,n):Pa(this._isDirected,n,r,o);return this._edgeLabels[i]}edgeAsObj(n,r,o){let i=arguments.length===1?this.edge(n):this.edge(n,r,o);return typeof i!="object"||i===null?{label:i}:i}hasEdge(n,r,o){return(arguments.length===1?yf(this._isDirected,n):Pa(this._isDirected,n,r,o))in this._edgeLabels}removeEdge(n,r,o){let i=arguments.length===1?yf(this._isDirected,n):Pa(this._isDirected,n,r,o),a=this._edgeObjs[i];if(a){let s=a.v,l=a.w;delete this._edgeLabels[i],delete this._edgeObjs[i],M_(this._preds[l],s),M_(this._sucs[s],l),delete this._in[l][i],delete this._out[s][i],this._edgeCount--}return this}inEdges(n,r){return this.isDirected()?this.filterEdges(this._in[n],n,r):this.nodeEdges(n,r)}outEdges(n,r){return this.isDirected()?this.filterEdges(this._out[n],n,r):this.nodeEdges(n,r)}nodeEdges(n,r){if(n in this._nodes)return this.filterEdges({...this._in[n],...this._out[n]},n,r)}_removeFromParentsChildList(n){delete this._children[this._parent[n]][n]}filterEdges(n,r,o){if(!n)return;let i=Object.values(n);return o?i.filter(a=>a.v===r&&a.w===o||a.v===o&&a.w===r):i}};function D_(e,n){e[n]?e[n]++:e[n]=1}function M_(e,n){e[n]!==void 0&&!--e[n]&&delete e[n]}function Pa(e,n,r,o){let i=""+n,a=""+r;if(!e&&i>a){let s=i;i=a,a=s}return i+""+a+""+(o===void 0?"\0":o)}function KO(e,n,r,o){let i=""+n,a=""+r;if(!e&&i>a){let l=i;i=a,a=l}let s={v:i,w:a};return o&&(s.name=o),s}function yf(e,n){return Pa(e,n.v,n.w,n.name)}var qO={};F_(qO,{read:()=>WO,write:()=>GO});function GO(e){let n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:zO(e),edges:HO(e)},r=e.graph();return r!==void 0&&(n.value=structuredClone(r)),n}function zO(e){return e.nodes().map(n=>{let r=e.node(n),o=e.parent(n),i={v:n};return r!==void 0&&(i.value=r),o!==void 0&&(i.parent=o),i})}function HO(e){return e.edges().map(n=>{let r=e.edge(n),o={v:n.v,w:n.w};return n.name!==void 0&&(o.name=n.name),r!==void 0&&(o.value=r),o})}function WO(e){let n=new hf(e.options);return e.value!==void 0&&n.setGraph(e.value),e.nodes.forEach(r=>{n.setNode(r.v,r.value),r.parent&&n.setParent(r.v,r.parent)}),e.edges.forEach(r=>{n.setEdge({v:r.v,w:r.w,name:r.name},r.value)}),n}var _f={};F_(_f,{CycleException:()=>kl,bellmanFord:()=>U_,components:()=>XO,dijkstra:()=>wl,dijkstraAll:()=>eB,findCycles:()=>tB,floydWarshall:()=>rB,isAcyclic:()=>iB,postorder:()=>sB,preorder:()=>lB,prim:()=>cB,shortestPaths:()=>dB,tarjan:()=>K_,topsort:()=>q_});var YO=()=>1;function U_(e,n,r,o){return JO(e,String(n),r||YO,o||function(i){var a;return(a=e.outEdges(i))!=null?a:[]})}function JO(e,n,r,o){let i={},a,s=0,l=e.nodes(),c=function(u){let p=i[u.v],g=i[u.w];if(!p||!g)return;let h=r(u);p.distance+h<g.distance&&(i[u.w]={distance:p.distance+h,predecessor:u.v},a=!0)},d=function(){l.forEach(function(u){o(u).forEach(function(p){let g=p.v===u?p.v:p.w,h=g===p.v?p.w:p.v;c({v:g,w:h})})})};l.forEach(function(u){let p=u===n?0:Number.POSITIVE_INFINITY;i[u]={distance:p,predecessor:""}});let f=l.length;for(let u=1;u<f&&(a=!1,s++,d(),!!a);u++);if(s===f-1&&(a=!1,d(),a))throw new Error("The graph contains a negative weight cycle");return i}function XO(e){let n={},r=[],o;function i(a){var s,l;a in n||(n[a]=!0,o.push(a),(s=e.successors(a))==null||s.forEach(i),(l=e.predecessors(a))==null||l.forEach(i))}return e.nodes().forEach(function(a){o=[],i(a),o.length&&r.push(o)}),r}var j_=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(n=>n.key)}has(n){return n in this._keyIndices}priority(n){let r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,r){let o=this._keyIndices,i=String(n);if(!(i in o)){let a=this._arr,s=a.length;return o[i]=s,a.push({key:i,priority:r}),this._decrease(s),!0}return!1}removeMin(){if(this.size()===0)throw new Error("Queue underflow");this._swap(0,this._arr.length-1);let n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,r){let o=this._keyIndices[n];if(o===void 0)throw new Error(`Key not found: ${n}`);let i=this._arr[o].priority;if(r>i)throw new Error(`New priority is greater than current priority. Key: ${n} Old: ${i} New: ${r}`);this._arr[o].priority=r,this._decrease(o)}_heapify(n){let r=this._arr,o=2*n,i=o+1,a=n;o<r.length&&(a=r[o].priority<r[a].priority?o:a,i<r.length&&(a=r[i].priority<r[a].priority?i:a),a!==n&&(this._swap(n,a),this._heapify(a)))}_decrease(n){let r=this._arr,o=r[n].priority,i;for(;n!==0&&(i=n>>1,!(r[i].priority<o));)this._swap(n,i),n=i}_swap(n,r){let o=this._arr,i=this._keyIndices,a=o[n],s=o[r];o[n]=s,o[r]=a,i[s.key]=n,i[a.key]=r}},ZO=()=>1;function wl(e,n,r,o){let i=function(a){var s;return(s=e.outEdges(a))!=null?s:[]};return QO(e,String(n),r||ZO,o||i)}function QO(e,n,r,o){let i={},a=new j_,s,l,c=function(d){let f=d.v!==s?d.v:d.w,u=i[f];if(!u)return;let p=r(d),g=l.distance+p;if(p<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+d+" Weight: "+p);g<u.distance&&(u.distance=g,u.predecessor=s,a.decrease(f,g))};for(e.nodes().forEach(function(d){let f=d===n?0:Number.POSITIVE_INFINITY;i[d]={distance:f,predecessor:""},a.add(d,f)});a.size()>0;){s=a.removeMin();let d=i[s];if(!d||d.distance===Number.POSITIVE_INFINITY)break;l=d,o(s).forEach(c)}return i}function eB(e,n,r){return e.nodes().reduce(function(o,i){return o[i]=wl(e,i,n,r),o},{})}function K_(e){let n=0,r=[],o={},i=[];function a(s){var l;let c=o[s]={onStack:!0,lowlink:n,index:n++};if(r.push(s),(l=e.successors(s))==null||l.forEach(function(d){if(d in o){let f=o[d];f!=null&&f.onStack&&(c.lowlink=Math.min(c.lowlink,f.index))}else{a(d);let f=o[d];f&&(c.lowlink=Math.min(c.lowlink,f.lowlink))}}),c.lowlink===c.index){let d=[],f;do{f=r.pop();let u=o[f];u&&(u.onStack=!1),d.push(f)}while(s!==f);i.push(d)}}return e.nodes().forEach(function(s){s in o||a(s)}),i}function tB(e){return K_(e).filter(function(n){var r;let o=n[0];return o?n.length>1||n.length===1&&((r=e.outEdges(o,o))!=null?r:[]).length>0:!1})}var nB=()=>1;function rB(e,n,r){return oB(e,n||nB,r||function(o){var i;return(i=e.outEdges(o))!=null?i:[]})}function oB(e,n,r){let o={},i=e.nodes();return i.forEach(function(a){let s={};o[a]=s,s[a]={distance:0,predecessor:""},i.forEach(function(l){a!==l&&(s[l]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),r(a).forEach(function(l){let c=l.v===a?l.w:l.v,d=n(l);s[c]={distance:d,predecessor:a}})}),i.forEach(function(a){let s=o[a];s&&i.forEach(function(l){let c=o[l];c&&i.forEach(function(d){let f=c[a],u=s[d],p=c[d];if(f&&u&&p){let g=f.distance+u.distance;g<p.distance&&(p.distance=g,p.predecessor=u.predecessor)}})})}),o}var kl=class extends Error{constructor(n){super(n),this.name="CycleException"}};function q_(e){let n={},r={},o=[];function i(a){var s;if(a in r)throw new kl;a in n||(r[a]=!0,n[a]=!0,(s=e.predecessors(a))==null||s.forEach(i),delete r[a],o.push(a))}if(e.sinks().forEach(i),Object.keys(n).length!==e.nodeCount())throw new kl;return o}function iB(e){try{q_(e)}catch(n){if(n instanceof kl)return!1;throw n}return!0}function aB(e,n,r,o,i){Array.isArray(n)||(n=[n]);let a=(l=>{var c;return(c=e.isDirected()?e.successors(l):e.neighbors(l))!=null?c:[]}),s={};return n.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);i=G_(e,l,r==="post",s,a,o,i)}),i}function G_(e,n,r,o,i,a,s){return n in o||(o[n]=!0,r||(s=a(s,n)),i(n).forEach(function(l){s=G_(e,l,r,o,i,a,s)}),r&&(s=a(s,n))),s}function z_(e,n,r){return aB(e,n,r,function(o,i){return o.push(i),o},[])}function sB(e,n){return z_(e,n,"post")}function lB(e,n){return z_(e,n,"pre")}function cB(e,n){var r;let o=new hf,i={},a=new j_,s;function l(f){let u=f.v===s?f.w:f.v,p=a.priority(u);if(p!==void 0){let g=n(f);g<p&&(i[u]=s,a.decrease(u,g))}}if(e.nodeCount()===0)return o;e.nodes().forEach(function(f){a.add(f,Number.POSITIVE_INFINITY),o.setNode(f)});let c=e.nodes()[0];c!==void 0&&a.decrease(c,0);let d=!1;for(;a.size()>0;){if(s=a.removeMin(),s in i)o.setEdge(s,i[s]);else{if(d)throw new Error("Input graph is not connected: "+e);d=!0}(r=e.nodeEdges(s))==null||r.forEach(l)}return o}function dB(e,n,r,o){return uB(e,n,r,o??(i=>{var a;return(a=e.outEdges(i))!=null?a:[]}))}function uB(e,n,r,o){if(r===void 0)return wl(e,n,r,o);let i=!1,a=e.nodes();for(let s=0;s<a.length;s++){let l=a[s];if(l===void 0)continue;let c=o(l);for(let d=0;d<c.length;d++){let f=c[d];if(!f)continue;let u=f.v===l?f.v:f.w,p=u===f.v?f.w:f.v;r({v:u,w:p})<0&&(i=!0)}if(i)return U_(e,n,r,o)}return wl(e,n,r,o)}var Xn=hf;function ri(e,n,r,o){let i=o;for(;e.hasNode(i);)i=bf(o);return r.dummy=n,e.setNode(i,r),i}function fB(e){let n=new Xn().setGraph(e.graph());return e.nodes().forEach(r=>n.setNode(r,e.node(r))),e.edges().forEach(r=>{let o=n.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);n.setEdge(r.v,r.w,{weight:o.weight+i.weight,minlen:Math.max(o.minlen,i.minlen)})}),n}function H_(e){let n=new Xn({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(r=>{e.children(r).length||n.setNode(r,e.node(r))}),e.edges().forEach(r=>{n.setEdge(r,e.edge(r))}),n}function W_(e,n){let r=e.x,o=e.y,i=n.x-r,a=n.y-o,s=e.width/2,l=e.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");let c,d;return Math.abs(a)*s>Math.abs(i)*l?(a<0&&(l=-l),c=l*i/a,d=l):(i<0&&(s=-s),c=s,d=s*a/i),{x:r+c,y:o+d}}function Cl(e){let n=Va(X_(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let o=e.node(r),i=o.rank;i!==void 0&&(n[i]||(n[i]=[]),n[i][o.order]=r)}),n}function pB(e){let n=e.nodes().map(o=>{let i=e.node(o).rank;return i===void 0?Number.MAX_VALUE:i}),r=Zn(Math.min,n);e.nodes().forEach(o=>{let i=e.node(o);Object.hasOwn(i,"rank")&&(i.rank-=r)})}function mB(e){let n=e.nodes().map(s=>e.node(s).rank).filter(s=>s!==void 0),r=Zn(Math.min,n),o=[];e.nodes().forEach(s=>{let l=e.node(s).rank-r;o[l]||(o[l]=[]),o[l].push(s)});let i=0,a=e.graph().nodeRankFactor;Array.from(o).forEach((s,l)=>{s===void 0&&l%a!==0?--i:s!==void 0&&i&&s.forEach(c=>e.node(c).rank+=i)})}function Y_(e,n,r,o){let i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=o),ri(e,"border",i,n)}function gB(e,n=J_){let r=[];for(let o=0;o<e.length;o+=n){let i=e.slice(o,o+n);r.push(i)}return r}var J_=65535;function Zn(e,n){if(n.length>J_){let r=gB(n);return e(...r.map(o=>e(...o)))}else return e(...n)}function X_(e){let n=e.nodes().map(r=>{let o=e.node(r).rank;return o===void 0?Number.MIN_VALUE:o});return Zn(Math.max,n)}function hB(e,n){let r={lhs:[],rhs:[]};return e.forEach(o=>{n(o)?r.lhs.push(o):r.rhs.push(o)}),r}function yB(e,n){return n()}var _B=0;function bf(e){let n=++_B;return e+(""+n)}function Va(e,n,r=1){n==null&&(n=e,e=0);let o=a=>a<n;r<0&&(o=a=>n<a);let i=[];for(let a=e;o(a);a+=r)i.push(a);return i}function El(e,n){let r={};for(let o of n)e[o]!==void 0&&(r[o]=e[o]);return r}function Nl(e,n){let r;return typeof n=="string"?r=o=>o[n]:r=n,Object.entries(e).reduce((o,[i,a])=>(o[i]=r(a,i),o),{})}function bB(e,n){return e.reduce((r,o,i)=>(r[o]=n[i],r),{})}var Sl="\0";function Z_(e,n,r){var o,i,a,s,l,c;if(!(e&&n&&r&&n.dummy==="edge"&&r.dummy==="edge"&&n.edgeObj&&r.edgeObj&&e[n.edgeObj.v]&&e[r.edgeObj.v]&&e[n.edgeObj.w]&&e[r.edgeObj.w]))return 0;let d=!0;n.edgeObj.w===r.edgeObj.w&&(d=!1);let f=d?(i=(o=e[n.edgeObj.v])==null?void 0:o.rank)!=null?i:NaN+1:(s=(a=e[n.edgeObj.w])==null?void 0:a.rank)!=null?s:NaN-1,u=Object.entries(e).find(y=>{var m,_;return((m=y[1].edgeObj)==null?void 0:m.v)===n.edgeObj.v&&((_=y[1].edgeObj)==null?void 0:_.w)===n.edgeObj.w&&y[1].rank===f}),p=Object.entries(e).find(y=>{var m,_;return((m=y[1].edgeObj)==null?void 0:m.v)===r.edgeObj.v&&((_=y[1].edgeObj)==null?void 0:_.w)===r.edgeObj.w&&y[1].rank===f});if(!u||!p)return 0;let g=(l=u[1].order)!=null?l:NaN,h=(c=p[1].order)!=null?c:NaN;return isNaN(g-h)?0:g-h}var wB=class{constructor(){UO(this,"_sentinel");let n={};n._next=n._prev=n,this._sentinel=n}dequeue(){let n=this._sentinel,r=n._prev;if(r!==n)return Q_(r),r}enqueue(n){let r=this._sentinel;n._prev&&n._next&&Q_(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){let n=[],r=this._sentinel,o=r._prev;for(;o!==r;)n.push(JSON.stringify(o,kB)),o=o._prev;return"["+n.join(", ")+"]"}};function Q_(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function kB(e,n){if(e!=="_next"&&e!=="_prev")return n}var CB=wB,EB=()=>1;function NB(e,n){if(e.nodeCount()<=1)return[];let r=xB(e,n||EB);return SB(r.graph,r.buckets,r.zeroIdx).flatMap(o=>e.outEdges(o.v,o.w)||[])}function SB(e,n,r){var o;let i=[],a=n[n.length-1],s=n[0],l;for(;e.nodeCount();){for(;l=s.dequeue();)wf(e,n,r,l);for(;l=a.dequeue();)wf(e,n,r,l);if(e.nodeCount()){for(let c=n.length-2;c>0;--c)if(l=(o=n[c])==null?void 0:o.dequeue(),l){i=i.concat(wf(e,n,r,l,!0)||[]);break}}}return i}function wf(e,n,r,o,i){let a=[],s=i?a:void 0;return(e.inEdges(o.v)||[]).forEach(l=>{let c=e.edge(l),d=e.node(l.v);i&&a.push({v:l.v,w:l.w}),d.out-=c,kf(n,r,d)}),(e.outEdges(o.v)||[]).forEach(l=>{let c=e.edge(l),d=l.w,f=e.node(d);f.in-=c,kf(n,r,f)}),e.removeNode(o.v),s}function xB(e,n){let r=new Xn,o=0,i=0;e.nodes().forEach(l=>{r.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=r.edge(l.v,l.w)||0,d=n(l),f=c+d;r.setEdge(l.v,l.w,f);let u=r.node(l.v),p=r.node(l.w);i=Math.max(i,u.out+=d),o=Math.max(o,p.in+=d)});let a=AB(i+o+3).map(()=>new CB),s=o+1;return r.nodes().forEach(l=>{kf(a,s,r.node(l))}),{graph:r,buckets:a,zeroIdx:s}}function kf(e,n,r){var o,i,a;r.out?r.in?(a=e[r.out-r.in+n])==null||a.enqueue(r):(i=e[e.length-1])==null||i.enqueue(r):(o=e[0])==null||o.enqueue(r)}function AB(e){let n=[];for(let r=0;r<e;r++)n.push(r);return n}function IB(e,n){(e.graph().acyclicer==="greedy"?NB(e,r(e)):vB(e,n??null)).forEach(o=>{let i=e.edge(o);e.removeEdge(o),i.forwardName=o.name,i.reversed=!0,e.setEdge(o.w,o.v,i,bf("rev"))});function r(o){return i=>o.edge(i).weight}}function vB(e,n){let r=[],o={},i={};function a(c){Object.hasOwn(i,c)||(i[c]=!0,o[c]=!0,e.outEdges(c).forEach(d=>{Object.hasOwn(o,d.w)?r.push(d):a(d.w)}),delete o[c])}function s(c){var d;Object.hasOwn(i,c)||(i[c]=!0,o[c]=!0,(d=e.outEdges(c))==null||d.forEach(f=>{var u,p;Object.hasOwn(o,f.w)||((u=n.node(c))==null?void 0:u.rank)>((p=n.node(f.w))==null?void 0:p.rank)&&OB(e,f.w,f)?r.push(f):s(f.w)}),delete o[c])}let l=a;return n&&typeof n.node=="function"&&(l=s),e.sources().forEach(l),e.nodes().forEach(l),r}function TB(e){e.edges().forEach(n=>{let r=e.edge(n);if(r.reversed){e.removeEdge(n);let o=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,o)}})}function OB(e,n,r){let o=new Set;function i(a){var s;if(e.sources().includes(a))return!0;o.add(a);for(let l of(s=e.inEdges(a))!=null?s:[])if(!(l.v===r.v&&l.w===r.w)&&!o.has(l.v)&&i(l.v))return!0;return!1}return i(n)}function BB(e){e.graph().dummyChains=[],e.edges().forEach(n=>PB(e,n))}function PB(e,n){let r=n.v,o=e.node(r).rank,i=n.w,a=e.node(i).rank,s=n.name,l=e.edge(n),c=l.labelRank;if(a===o+1)return;e.removeEdge(n);let d,f,u;for(u=0,++o;o<a;++u,++o)l.points=[],f={width:0,height:0,edgeLabel:l,edgeObj:n,rank:o},d=ri(e,"edge",f,"_d"),o===c&&(f.width=l.width,f.height=l.height,f.dummy="edge-label",f.labelpos=l.labelpos),e.setEdge(r,d,{weight:l.weight},s),u===0&&e.graph().dummyChains.push(d),r=d;e.setEdge(r,i,{weight:l.weight},s)}function VB(e){e.graph().dummyChains.forEach(n=>{let r=e.node(n),o=r.edgeLabel,i;for(e.setEdge(r.edgeObj,o);r.dummy;)i=e.successors(n)[0],e.removeNode(n),o.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),n=i,r=e.node(n)})}function Cf(e){let n={};function r(o){let i=e.node(o);if(Object.hasOwn(n,o))return i.rank;n[o]=!0;let a=e.outEdges(o),s=a?a.map(c=>c==null?Number.POSITIVE_INFINITY:r(c.w)-e.edge(c).minlen):[],l=Zn(Math.min,s);return l===Number.POSITIVE_INFINITY&&(l=0),i.rank=l}e.sources().forEach(r)}function oi(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}var eb=$B;function $B(e){let n=new Xn({directed:!1}),r=e.nodes();if(r.length===0)throw new Error("Graph must have at least one node");let o=r[0],i=e.nodeCount();n.setNode(o,{});let a,s;for(;RB(n,e)<i&&(a=LB(n,e),!!a);)s=n.hasNode(a.v)?oi(e,a):-oi(e,a),FB(n,e,s);return n}function RB(e,n){function r(o){let i=n.nodeEdges(o);i&&i.forEach(a=>{let s=a.v,l=o===s?a.w:s;!e.hasNode(l)&&!oi(n,a)&&(e.setNode(l,{}),e.setEdge(o,l,{}),r(l))})}return e.nodes().forEach(r),e.nodeCount()}function LB(e,n){return n.edges().reduce((r,o)=>{let i=Number.POSITIVE_INFINITY;return e.hasNode(o.v)!==e.hasNode(o.w)&&(i=oi(n,o)),i<r[0]?[i,o]:r},[Number.POSITIVE_INFINITY,null])[1]}function FB(e,n,r){e.nodes().forEach(o=>n.node(o).rank+=r)}var{preorder:DB,postorder:MB}=_f,UB=mo;mo.initLowLimValues=Nf,mo.initCutValues=Ef,mo.calcCutValue=tb,mo.leaveEdge=rb,mo.enterEdge=ob,mo.exchangeEdges=ib;function mo(e){e=fB(e),Cf(e);let n=eb(e);Nf(n),Ef(n,e);let r,o;for(;r=rb(n);)o=ob(n,e,r),ib(n,e,r,o)}function Ef(e,n){let r=MB(e,e.nodes());r=r.slice(0,r.length-1),r.forEach(o=>jB(e,n,o))}function jB(e,n,r){let o=e.node(r).parent,i=e.edge(r,o);i.cutvalue=tb(e,n,r)}function tb(e,n,r){let o=e.node(r).parent,i=!0,a=n.edge(r,o),s=0;a||(i=!1,a=n.edge(o,r)),s=a.weight;let l=n.nodeEdges(r);return l&&l.forEach(c=>{let d=c.v===r,f=d?c.w:c.v;if(f!==o){let u=d===i,p=n.edge(c).weight;if(s+=u?p:-p,qB(e,r,f)){let g=e.edge(r,f).cutvalue;s+=u?-g:g}}}),s}function Nf(e,n){arguments.length<2&&(n=e.nodes()[0]),nb(e,{},1,n)}function nb(e,n,r,o,i){let a=r,s=e.node(o);n[o]=!0;let l=e.neighbors(o);return l&&l.forEach(c=>{Object.hasOwn(n,c)||(r=nb(e,n,r,c,o))}),s.low=a,s.lim=r++,i?s.parent=i:delete s.parent,r}function rb(e){return e.edges().find(n=>e.edge(n).cutvalue<0)}function ob(e,n,r){let o=r.v,i=r.w;n.hasEdge(o,i)||(o=r.w,i=r.v);let a=e.node(o),s=e.node(i),l=a,c=!1;return a.lim>s.lim&&(l=s,c=!0),n.edges().filter(d=>c===ab(e,e.node(d.v),l)&&c!==ab(e,e.node(d.w),l)).reduce((d,f)=>oi(n,f)<oi(n,d)?f:d)}function ib(e,n,r,o){let i=r.v,a=r.w;e.removeEdge(i,a),e.setEdge(o.v,o.w,{}),Nf(e),Ef(e,n),KB(e,n)}function KB(e,n){let r=e.nodes().find(i=>!e.node(i).parent);if(!r)return;let o=DB(e,[r]);o=o.slice(1),o.forEach(i=>{let a=e.node(i).parent,s=n.edge(i,a),l=!1;s||(s=n.edge(a,i),l=!0),n.node(i).rank=n.node(a).rank+(l?s.minlen:-s.minlen)})}function qB(e,n,r){return e.hasEdge(n,r)}function ab(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}var GB=zB;function zB(e){let n=e.graph().ranker;if(typeof n=="function")return n(e);switch(n){case"network-simplex":sb(e);break;case"tight-tree":WB(e);break;case"longest-path":HB(e);break;case"none":break;default:sb(e)}}var HB=Cf;function WB(e){Cf(e),eb(e)}function sb(e){UB(e)}var YB=JB;function JB(e){let n=ZB(e),r=e.graph();Array.isArray(r.dummyChains)&&r.dummyChains.forEach(o=>{let i=e.node(o),a=i.edgeObj,s=XB(e,n,a.v,a.w),l=s.path,c=s.lca,d=0,f=l[d],u=!0;for(;o!==a.w;){if(i=e.node(o),u){for(;(f=l[d])!==c&&e.node(f).maxRank<i.rank;)d++;f===c&&(u=!1)}if(!u){for(;d<l.length-1&&e.node(l[d+1]).minRank<=i.rank;)d++;f=l[d]}f!==void 0&&e.setParent(o,f),o=e.successors(o)[0]}})}function XB(e,n,r,o){let i=[],a=[],s=Math.min(n[r].low,n[o].low),l=Math.max(n[r].lim,n[o].lim),c;c=r;do c=e.parent(c),i.push(c);while(c&&(n[c].low>s||l>n[c].lim));let d=c,f=o;for(;(f=e.parent(f))!==d;)a.push(f);return{path:i.concat(a.reverse()),lca:d}}function ZB(e){let n={},r=0;function o(i){let a=r;e.children(i).forEach(o),n[i]={low:a,lim:r++}}return e.children(Sl).forEach(o),n}function QB(e){let n=ri(e,"root",{},"_root"),r=eP(e),o=Object.values(r),i=Zn(Math.max,o)-1,a=2*i+1;e.graph().nestingRoot=n,e.edges().forEach(l=>e.edge(l).minlen*=a);let s=tP(e)+1;e.children(Sl).forEach(l=>{lb(e,n,a,s,i,r,l)}),e.graph().nodeRankFactor=a}function lb(e,n,r,o,i,a,s){var l;let c=e.children(s);if(!c.length){s!==n&&e.setEdge(n,s,{weight:0,minlen:r});return}let d=Y_(e,"_bt"),f=Y_(e,"_bb"),u=e.node(s);e.setParent(d,s),u.borderTop=d,e.setParent(f,s),u.borderBottom=f,c.forEach(p=>{var g;lb(e,n,r,o,i,a,p);let h=e.node(p),y=h.borderTop?h.borderTop:p,m=h.borderBottom?h.borderBottom:p,_=h.borderTop?o:2*o,b=y!==m?1:i-((g=a[s])!=null?g:0)+1;e.setEdge(d,y,{weight:_,minlen:b,nestingEdge:!0}),e.setEdge(m,f,{weight:_,minlen:b,nestingEdge:!0})}),e.parent(s)||e.setEdge(n,d,{weight:0,minlen:i+((l=a[s])!=null?l:0)})}function eP(e){let n={};function r(o,i){let a=e.children(o);a&&a.length&&a.forEach(s=>r(s,i+1)),n[o]=i}return e.children(Sl).forEach(o=>r(o,1)),n}function tP(e){return e.edges().reduce((n,r)=>n+e.edge(r).weight,0)}function nP(e){let n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,e.edges().forEach(r=>{e.edge(r).nestingEdge&&e.removeEdge(r)})}var rP=oP;function oP(e){function n(r){let o=e.children(r),i=e.node(r);if(o.length&&o.forEach(n),i&&Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let a=i.minRank,s=i.maxRank+1;a<s;++a)cb(e,"borderLeft","_bl",r,i,a),cb(e,"borderRight","_br",r,i,a)}}e.children(Sl).forEach(n)}function cb(e,n,r,o,i,a){let s={width:0,height:0,rank:a,borderType:n},l=i[n][a-1],c=ri(e,"border",s,r);i[n][a]=c,e.setParent(c,o),l&&e.setEdge(l,c,{weight:1})}function iP(e){var n;let r=(n=e.graph().rankdir)==null?void 0:n.toLowerCase();(r==="lr"||r==="rl")&&db(e)}function aP(e){var n;let r=(n=e.graph().rankdir)==null?void 0:n.toLowerCase();(r==="bt"||r==="rl")&&sP(e),(r==="lr"||r==="rl")&&(lP(e),db(e))}function db(e){e.nodes().forEach(n=>ub(e.node(n))),e.edges().forEach(n=>ub(e.edge(n)))}function ub(e){let n=e.width;e.width=e.height,e.height=n}function sP(e){e.nodes().forEach(n=>Sf(e.node(n))),e.edges().forEach(n=>{var r;let o=e.edge(n);(r=o.points)==null||r.forEach(Sf),Object.hasOwn(o,"y")&&Sf(o)})}function Sf(e){e.y=-e.y}function lP(e){e.nodes().forEach(n=>xf(e.node(n))),e.edges().forEach(n=>{var r;let o=e.edge(n);(r=o.points)==null||r.forEach(xf),Object.hasOwn(o,"x")&&xf(o)})}function xf(e){let n=e.x;e.x=e.y,e.y=n}function cP(e,n=null){let r={},o=e.nodes().filter(d=>!e.children(d).length),i=o.map(d=>e.node(d).rank),a=Zn(Math.max,i),s=Va(a+1).map(()=>[]);function l(d){if(r[d])return;r[d]=!0;let f=e.node(d);s[f.rank].push(d);let u=e.successors(d);u&&[...u].sort((p,g)=>c(p,g)).forEach(l)}o.sort((d,f)=>e.node(d).rank-e.node(f).rank).forEach(l);function c(d,f){let u=e.node(d),p=e.node(f);return Z_(n,u,p)}return s}function dP(e,n){let r=0;for(let o=1;o<n.length;++o)r+=uP(e,n[o-1],n[o]);return r}function uP(e,n,r){let o=bB(r,r.map((d,f)=>f)),i=n.flatMap(d=>{let f=e.outEdges(d);return f?f.map(u=>({pos:o[u.w],weight:e.edge(u).weight})).sort((u,p)=>u.pos-p.pos):[]}),a=1;for(;a<r.length;)a<<=1;let s=2*a-1;a-=1;let l=new Array(s).fill(0),c=0;return i.forEach(d=>{let f=d.pos+a;l[f]+=d.weight;let u=0;for(;f>0;)f%2&&(u+=l[f+1]),f=f-1>>1,l[f]+=d.weight;c+=d.weight*u}),c}function fP(e,n=[]){return n.map(r=>{let o=e.inEdges(r);if(!o||!o.length)return{v:r};{let i=o.reduce((a,s)=>{let l=e.edge(s),c=e.node(s.v);return{sum:a.sum+l.weight*c.order,weight:a.weight+l.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}})}function pP(e,n){let r={};e.forEach((i,a)=>{let s={indegree:0,in:[],out:[],vs:[i.v],i:a};i.barycenter!==void 0&&(s.barycenter=i.barycenter,s.weight=i.weight),r[i.v]=s}),n.edges().forEach(i=>{let a=r[i.v],s=r[i.w];a!==void 0&&s!==void 0&&(s.indegree++,a.out.push(s))});let o=Object.values(r).filter(i=>!i.indegree);return mP(o)}function mP(e){let n=[];function r(i){return a=>{a.merged||(a.barycenter===void 0||i.barycenter===void 0||a.barycenter>=i.barycenter)&&gP(i,a)}}function o(i){return a=>{a.in.push(i),--a.indegree===0&&e.push(a)}}for(;e.length;){let i=e.pop();n.push(i),i.in.reverse().forEach(r(i)),i.out.forEach(o(i))}return n.filter(i=>!i.merged).map(i=>El(i,["vs","i","barycenter","weight"]))}function gP(e,n){let r=0,o=0;e.weight&&(r+=e.barycenter*e.weight,o+=e.weight),n.weight&&(r+=n.barycenter*n.weight,o+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/o,e.weight=o,e.i=Math.min(n.i,e.i),n.merged=!0}function hP(e,n,r,o,i){let a={},s=null,l=null,c=i;typeof n=="boolean"?(c=n,a={}):n&&(a=n,s=r??null,l=o??null);let d=hB(e,_=>Object.hasOwn(_,"barycenter")),f=d.lhs,u=d.rhs.sort((_,b)=>b.i-_.i),p=[],g=0,h=0,y=0;f.sort(yP(l,s,!!c));for(let[_,b]of Object.entries(a)){let k=f.findIndex(A=>A.vs[0]===_);f.splice(k+1,0,b)}y=fb(p,u,y),f.forEach(_=>{y+=_.vs.length,p.push(_.vs),g+=_.barycenter*_.weight,h+=_.weight,y=fb(p,u,y)});let m={vs:p.flat(1)};return h&&(m.barycenter=g/h,m.weight=h),m}function fb(e,n,r){let o;for(;n.length&&(o=n[n.length-1]).i<=r;)n.pop(),e.push(o.vs),r++;return r}function yP(e,n,r){return(o,i)=>{if(o.barycenter<i.barycenter)return-1;if(o.barycenter>i.barycenter)return 1;if(e&&(typeof o.vs[0]=="string"||typeof i.vs[0]=="string")){let a=e.node(o.vs[0]),s=e.node(i.vs[0]),l=Z_(n,a,s);if(l!==0)return l}return r?i.i-o.i:o.i-i.i}}function pb(e,n,r,o,i){var a,s,l,c,d,f,u,p,g,h,y;let m=null,_=i;typeof o=="boolean"?(_=o,m=null):o!==void 0&&(m=o);let b=e.children(n),k=e.node(n),A=k?k.borderLeft:void 0,C=k?k.borderRight:void 0,w={};A&&(b=b.filter(B=>B!==A&&B!==C));let x=fP(e,b);x.forEach(B=>{if(e.children(B.v).length){let{result:P}=pb(e,B.v,r,m,_);w[B.v]=P,Object.hasOwn(P,"barycenter")&&bP(B,P)}});let I=pP(x,r);_P(I,w);let T={},v=!1;for(let B=0;B<I.length;B++)for(let P=B+1;P<I.length;P++)if(!(!I[B]||!I[P]||!((a=I[B])!=null&&a.barycenter)||!((s=I[P])!=null&&s.barycenter))&&((l=I[B])==null?void 0:l.barycenter)===I[P].barycenter){let R=(d=(c=I[B])==null?void 0:c.vs[0])!=null?d:"",F=(u=(f=I[P])==null?void 0:f.vs[0])!=null?u:"",X=e.node(R),Z=e.node(F);if(X.dummy==="edge"&&Z.dummy==="edge"&&((p=X.edgeObj)==null?void 0:p.v)===((g=Z.edgeObj)==null?void 0:g.v)&&((h=X.edgeObj)==null?void 0:h.w)===((y=Z.edgeObj)==null?void 0:y.w))if(X.edgeLabel.reversed){T[F]=I[B],I.splice(B,1),B--;break}else T[R]=I[P],I.splice(P,1),P--;else v=!0}let S=hP(I,T,m,e,_);if(A&&C){S.vs=[A,S.vs,C].flat(1);let B=e.predecessors(A);if(B&&B.length){let P=e.node(B[0]),R=e.predecessors(C),F=e.node(R[0]);Object.hasOwn(S,"barycenter")||(S.barycenter=0,S.weight=0),S.barycenter=(S.barycenter*S.weight+P.order+F.order)/(S.weight+2),S.weight+=2}}return Object.defineProperty(S,"result",{value:S,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(S,"usedBias",{value:v,enumerable:!1,configurable:!0,writable:!0}),S}function _P(e,n){e.forEach(r=>{r.vs=r.vs.flatMap(o=>n[o]?n[o].vs:o)})}function bP(e,n){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight):(e.barycenter=n.barycenter,e.weight=n.weight)}function wP(e,n,r,o){o||(o=e.nodes());let i=kP(e),a=new Xn({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(s=>e.node(s));return o.forEach(s=>{let l=e.node(s),c=e.parent(s);if(l.rank===n||l.minRank<=n&&n<=l.maxRank){a.setNode(s),a.setParent(s,c||i);let d=e[r](s);d&&d.forEach(f=>{let u=f.v===s?f.w:f.v,p=a.edge(u,s),g=p!==void 0?p.weight:0;a.setEdge(u,s,{weight:e.edge(f).weight+g})}),Object.hasOwn(l,"minRank")&&a.setNode(s,{borderLeft:l.borderLeft[n],borderRight:l.borderRight[n]})}}),a}function kP(e){let n;for(;e.hasNode(n=bf("_root")););return n}function CP(e,n,r){let o={},i;r.forEach(a=>{let s=e.parent(a),l,c;for(;s;){if(l=e.parent(s),l?(c=o[l],o[l]=s):(c=i,i=s),c&&c!==s){n.setEdge(c,s);return}s=l}})}function mb(e,n={},r=null){if(typeof n.customOrder=="function"){n.customOrder(e,mb);return}let o=X_(e),i=gb(e,Va(1,o+1),"inEdges"),a=gb(e,Va(o-1,-1,-1),"outEdges"),s=cP(e,r);if(hb(e,s),n.disableOptimalOrderHeuristic)return;let l=Number.POSITIVE_INFINITY,c,d=n.constraints||[];for(let f=0,u=0;u<4;++f,++u){EP(f%2?i:a,f%4>=2,d,r),s=Cl(e);let p=dP(e,s);p<l?(u=0,c=Object.assign({},s),l=p):p===l&&(c=structuredClone(s))}hb(e,c)}function gb(e,n,r){let o=new Map,i=(a,s)=>{o.has(a)||o.set(a,[]),o.get(a).push(s)};for(let a of e.nodes()){let s=e.node(a);if(typeof s.rank=="number"&&i(s.rank,a),typeof s.minRank=="number"&&typeof s.maxRank=="number")for(let l=s.minRank;l<=s.maxRank;l++)l!==s.rank&&i(l,a)}return n.map(function(a){return wP(e,a,r,o.get(a)||[])})}function EP(e,n,r,o){let i=!0,a=new Xn;e.forEach(function(s){r.forEach(f=>a.setEdge(f.left,f.right));let l=s.graph().root,{result:c,usedBias:d}=pb(s,l,a,o,i);n&&d&&(i=!i),c.vs.forEach((f,u)=>s.node(f).order=u),CP(s,a,c.vs)})}function hb(e,n){Object.values(n).forEach(r=>r.forEach((o,i)=>e.node(o).order=i))}function NP(e,n){let r={};function o(i,a){let s=0,l=0,c=i.length,d=a[a.length-1];return a.forEach((f,u)=>{let p=xP(e,f),g=p?e.node(p).order:c;(p||f===d)&&(a.slice(l,u+1).forEach(h=>{let y=e.predecessors(h);y&&y.forEach(m=>{let _=e.node(m),b=_.order;(b<s||g<b)&&!(_.dummy&&e.node(h).dummy)&&yb(r,m,h)})}),l=u+1,s=g)}),a}return n.length&&n.reduce(o),r}function SP(e,n){let r={};function o(a,s,l,c,d){Va(s,l).forEach(f=>{let u=a[f];if(u!==void 0&&e.node(u).dummy){let p=e.predecessors(u);p&&p.forEach(g=>{if(g===void 0)return;let h=e.node(g);h.dummy&&(h.order<c||h.order>d)&&yb(r,g,u)})}})}function i(a,s){let l=-1,c=-1,d=0;return s.forEach((f,u)=>{if(e.node(f).dummy==="border"){let p=e.predecessors(f);if(p&&p.length){let g=p[0];if(g===void 0)return;c=e.node(g).order,o(s,d,u,l,c),d=u,l=c}}o(s,d,s.length,c,a.length)}),s}return n.length&&n.reduce(i),r}function xP(e,n){if(e.node(n).dummy){let r=e.predecessors(n);if(r)return r.find(o=>e.node(o).dummy)}}function yb(e,n,r){if(n>r){let i=n;n=r,r=i}let o=e[n];o||(e[n]=o={}),o[r]=!0}function AP(e,n,r){if(n>r){let i=n;n=r,r=i}let o=e[n];return o!==void 0&&Object.hasOwn(o,r)}function IP(e,n,r,o,i){let a={},s={},l={};return n.forEach(c=>{c.forEach((d,f)=>{a[d]=d,s[d]=d,l[d]=f})}),n.forEach(c=>{let d=-1,f=-1,u=!1,p=c,g=c.findIndex(h=>i?.includes(h)||_b(h,e,i));g>0&&(p=[c[g],...c.slice(0,g),...c.slice(g+1)],u=!0),p.forEach(h=>{var y;let m=o(h);if(m&&m.length){i!=null&&i.includes(h)&&(m=m.filter(k=>_b(k,e,i)));let _=m.sort((k,A)=>{let C=l[k],w=l[A];return(C!==void 0?C:0)-(w!==void 0?w:0)}),b=(_.length-1)/2;for(let k=Math.floor(b),A=Math.ceil(b);k<=A;++k){let C=_[k];if(C===void 0)continue;let w=l[C];if(w!==void 0&&s[h]===h&&d<w&&l[C]!==f&&!AP(r,h,C)){let x=a[C];x!==void 0&&(s[C]=h,s[h]=a[h]=x,d=w,u&&(d=-1,f=(y=l[C])!=null?y:-1,u=!1))}}}})}),{root:a,align:s}}function vP(e,n,r,o,i=!1){let a={},s=TP(e,n,r,i),l=i?"borderLeft":"borderRight";function c(g,h){let y=s.nodes().slice(),m={},_=y.pop();for(;_;){if(m[_])g(_);else{m[_]=!0,y.push(_);for(let b of h(_))y.push(b)}_=y.pop()}}function d(g){let h=s.inEdges(g);h?a[g]=h.reduce((y,m)=>{var _;let b=(_=a[m.v])!=null?_:0,k=s.edge(m);return Math.max(y,b+(k!==void 0?k:0))},0):a[g]=0}function f(g){let h=s.outEdges(g),y=Number.POSITIVE_INFINITY;h&&(y=h.reduce((_,b)=>{let k=a[b.w],A=s.edge(b);return Math.min(_,(k!==void 0?k:0)-(A!==void 0?A:0))},Number.POSITIVE_INFINITY));let m=e.node(g);y!==Number.POSITIVE_INFINITY&&m.borderType!==l&&(a[g]=Math.max(a[g]!==void 0?a[g]:0,y))}function u(g){return s.predecessors(g)||[]}function p(g){return s.successors(g)||[]}return c(d,u),c(f,p),Object.keys(o).forEach(g=>{var h;let y=r[g];y!==void 0&&(a[g]=(h=a[y])!=null?h:0)}),a}function TP(e,n,r,o){let i=new Xn,a=e.graph(),s=$P(a.nodesep,a.edgesep,o);return n.forEach(l=>{let c;l.forEach(d=>{let f=r[d];if(f!==void 0){if(i.setNode(f),c!==void 0){let u=r[c];if(u!==void 0){let p=i.edge(u,f);i.setEdge(u,f,Math.max(s(e,d,c),p||0))}}c=d}})}),i}function OP(e,n){return Object.values(n).reduce((r,o)=>{let i=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;Object.entries(o).forEach(([l,c])=>{let d=RP(e,l)/2;i=Math.max(c+d,i),a=Math.min(c-d,a)});let s=i-a;return s<r[0]&&(r=[s,o]),r},[Number.POSITIVE_INFINITY,null])[1]}function BP(e,n){let r=Object.values(n),o=Zn(Math.min,r),i=Zn(Math.max,r);["u","d"].forEach(a=>{["l","r"].forEach(s=>{let l=a+s,c=e[l];if(!c||c===n)return;let d=Object.values(c),f=o-Zn(Math.min,d);s!=="l"&&(f=i-Zn(Math.max,d)),f&&(e[l]=Nl(c,u=>u+f))})})}function PP(e,n=void 0){let r=e.ul;return r?Nl(r,(o,i)=>{var a,s;if(n){let c=n.toLowerCase(),d=e[c];if(d&&d[i]!==void 0)return d[i]}let l=Object.values(e).map(c=>{let d=c[i];return d!==void 0?d:0}).sort((c,d)=>c-d);return(((a=l[1])!=null?a:0)+((s=l[2])!=null?s:0))/2}):{}}function VP(e,n){let r=Cl(e),o=Object.assign(NP(e,r),SP(e,r)),i={},a;["u","d"].forEach(l=>{a=l==="u"?r:Object.values(r).reverse(),["l","r"].forEach(c=>{c==="r"&&(a=a.map(u=>Object.values(u).reverse()));let d=IP(e,a,o,u=>(l==="u"?e.predecessors(u):e.successors(u))||[],n),f=vP(e,a,d.root,d.align,c==="r");c==="r"&&(f=Nl(f,u=>-u)),i[l+c]=f})});let s=OP(e,i);return BP(i,s),PP(i,e.graph().align)}function $P(e,n,r){return(o,i,a)=>{let s=o.node(i),l=o.node(a),c=0,d;if(c+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":d=-s.width/2;break;case"r":d=s.width/2;break}if(d&&(c+=r?d:-d),d=void 0,c+=(s.dummy?n:e)/2,c+=(l.dummy?n:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":d=l.width/2;break;case"r":d=-l.width/2;break}return d&&(c+=r?d:-d),c}}function RP(e,n){return e.node(n).width}function _b(e,n,r){var o;if(!r)return!1;let i=(o=n.node(e))==null?void 0:o.edgeObj;if(!i||n.node(e).edgeLabel.reversed)return!1;let a=r.indexOf(i?.v),s=r.indexOf(i?.w);return a!==-1&&s!==-1&&a===(s+1)%r.length||a===(s-1)%r.length}function LP(e,n){e=H_(e),FP(e),Object.entries(VP(e,n)).forEach(([r,o])=>e.node(r).x=o)}function FP(e){let n=Cl(e),r=e.graph(),o=r.ranksep,i=r.rankalign,a=0;n.forEach(s=>{let l=s.reduce((c,d)=>{var f;let u=(f=e.node(d).height)!=null?f:0;return c>u?c:u},0);s.forEach(c=>{let d=e.node(c);i==="top"?d.y=a+d.height/2:i==="bottom"?d.y=a+l-d.height/2:d.y=a+l/2}),a+=l+o})}var bb=new WeakMap;function DP(e,n={}){return kb(e,yB,n),e}function wb(e,n,r){let o=n;for(;o!==void 0;){let i=e.parent(o);if(i===r)return o;o=i}}function kb(e,n,r){var o;let i=e.nodes().filter(b=>e.children(b).length),a={};i.forEach(b=>{let k=e.node(b);if(k&&k.rankdir){let A=new Xn({multigraph:!0,compound:!0});A.setGraph({rankdir:k.rankdir});let C=e.children(b);C.forEach(R=>{let F={...e.node(R)};A.setNode(R,F);let X=e.parent(R);X&&X!==b&&C.includes(X)&&A.setParent(R,X)});let w=new Set;e.edges().forEach(R=>{let F=wb(e,R.v,b),X=wb(e,R.w,b);if(F&&X&&F!==X){let Z=`${F}\0${X}`;w.has(Z)||(w.add(Z),A.setEdge(F,X,{...e.edge(R)}))}}),kb(A,n,r);let x=Sb(A);Cb(x,n,r,null),Eb(A,x);let I=1/0,T=1/0,v=-1/0,S=-1/0;A.nodes().forEach(R=>{if(R===b)return;let F=A.node(R);F&&typeof F.x=="number"&&typeof F.y=="number"&&typeof F.width=="number"&&typeof F.height=="number"&&(I=Math.min(I,F.x-F.width/2),v=Math.max(v,F.x+F.width/2),T=Math.min(T,F.y-F.height/2),S=Math.max(S,F.y+F.height/2))}),(!isFinite(I)||!isFinite(T)||!isFinite(v)||!isFinite(S))&&(I=T=0,v=S=0);let B=v-I,P=S-T;a[b]={minX:I,minY:T,maxX:v,maxY:S,width:B,height:P,offsetX:I,offsetY:T},k._dagreClusterSubgraph=A}});let s=[],l=b=>{let k=[],A=(e.children(b)||[]).filter(C=>C!==b);for(;A.length>0;){let C=A.shift();k.push(C),(e.children(C)||[]).filter(w=>w!==C).forEach(w=>A.push(w))}return k},c=new Map;i.forEach(b=>{let k=e.node(b);k&&k.rankdir&&a[b]&&c.set(b,(e.children(b)||[]).filter(A=>A!==b))});let d=new Set([...c.values()].flat()),f=new Map;c.forEach((b,k)=>{d.has(k)||f.set(k,l(k))});let u=new Set([...f.values()].flat()),p=b=>{for(let[k,A]of f)if(A.includes(b))return k;return b},g=[];e.edges().forEach(b=>{(u.has(b.v)||u.has(b.w))&&g.push({edge:b,label:e.edge(b)})});let h=new Map;u.forEach(b=>{let k=e.parent(b);h.set(b,typeof k=="string"?k:void 0)}),f.forEach((b,k)=>{let A=e.node(k),C=[];b.forEach(I=>{let T=e.node(I);T&&(C.push({id:I,node:T,parent:h.get(I)}),e.removeNode(I))});let w=g.filter(({edge:I})=>b.includes(I.v)||b.includes(I.w)),x=a[k];A&&(s.push({clusterId:k,subgraph:A._dagreClusterSubgraph,bounds:x,children:b,removedNodes:C,removedEdges:w}),A.width=x.width,A.height=x.height)});let y=new Set;g.forEach(({edge:b,label:k})=>{let A=p(b.v),C=p(b.w);if(A!==C&&e.hasNode(A)&&e.hasNode(C)){let w=`${A}\0${C}`;y.has(w)||(y.add(w),e.setEdge(A,C,{...k,width:0,height:0}))}});let m=Sb(e),_=Cb(m,n,r,(o=bb.get(e))!=null?o:null);bb.set(e,_),Eb(e,m),y.forEach(b=>{let k=b.indexOf("\0"),A=b.slice(0,k),C=b.slice(k+1);e.hasEdge(A,C)&&e.removeEdge(A,C)}),s.forEach(({clusterId:b,subgraph:k,bounds:A,removedNodes:C,removedEdges:w})=>{var x,I;let T=e.node(b),v=(x=T?.x)!=null?x:0,S=(I=T?.y)!=null?I:0,B=(A.minX+A.maxX)/2,P=(A.minY+A.maxY)/2;C.forEach(({id:R,node:F,parent:X})=>{e.setNode(R,F),X!==void 0&&e.setParent(R,X)}),w.forEach(({edge:R,label:F})=>{e.setEdge(R,F)}),k.nodes().forEach(R=>{if(R===b)return;let F=k.node(R),X=e.node(R);X&&F&&typeof F.x=="number"&&typeof F.y=="number"&&(X.x=v+(F.x-B),X.y=S+(F.y-P))}),delete T._dagreClusterSubgraph}),i.forEach(b=>{var k,A;let C=e.node(b),w=a[b];if(C&&C.rankdir&&C._dagreClusterSubgraph&&w){let x=C._dagreClusterSubgraph,I=(k=C.x)!=null?k:0,T=(A=C.y)!=null?A:0,v=(w.minX+w.maxX)/2,S=(w.minY+w.maxY)/2;x.nodes().forEach(B=>{if(B===b)return;let P=x.node(B),R=e.node(B);if(R&&P&&typeof P.x=="number"&&typeof P.y=="number"){let F=P.x-v,X=P.y-S;R.x=I+F,R.y=T+X}}),delete C._dagreClusterSubgraph}})}function Cb(e,n,r,o=null){var i,a;let s=r?.useDynamic!==!1,l=s&&(i=o?.graph)!=null?i:null,c=s&&(a=o?.rawNodes)!=null?a:null;n(" makeSpaceForEdgeLabels",()=>HP(e)),n(" removeSelfEdges",()=>nV(e)),n(" acyclic",()=>IB(e,l)),n(" nestingGraph.run",()=>QB(e)),n(" rank",()=>GB(H_(e))),n(" injectEdgeLabelProxies",()=>WP(e)),n(" removeEmptyRanks",()=>mB(e)),n(" nestingGraph.cleanup",()=>nP(e)),n(" normalizeRanks",()=>pB(e)),n(" assignRankMinMax",()=>YP(e)),n(" removeEdgeLabelProxies",()=>JP(e)),n(" normalize.run",()=>BB(e)),n(" parentDummyChains",()=>YB(e)),n(" addBorderSegments",()=>rP(e)),n(" order",()=>mb(e,r,c)),n(" insertSelfEdges",()=>rV(e)),n(" adjustCoordinateSystem",()=>iP(e)),n(" position",()=>LP(e,r.corePath)),n(" positionSelfEdges",()=>oV(e));let d=JSON.parse(JSON.stringify(e._nodes));return n(" removeBorderNodes",()=>tV(e)),n(" normalize.undo",()=>VB(e)),n(" fixupEdgeLabelCoords",()=>QP(e)),n(" undoCoordinateSystem",()=>aP(e)),n(" translateGraph",()=>XP(e)),n(" assignNodeIntersects",()=>ZP(e)),n(" reversePoints",()=>eV(e)),n(" acyclic.undo",()=>TB(e)),{graph:e,rawNodes:d}}function Eb(e,n){e.nodes().forEach(r=>{let o=e.node(r),i=n.node(r);o&&(o.x=i.x,o.y=i.y,o.order=i.order,o.rank=i.rank,n.children(r).length&&(o.width=i.width,o.height=i.height))}),e.edges().forEach(r=>{let o=e.edge(r),i=n.edge(r);o.points=i.points,Object.hasOwn(i,"x")&&(o.x=i.x,o.y=i.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var MP=["nodesep","edgesep","ranksep","marginx","marginy"],UP={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},jP=["acyclicer","ranker","rankdir","align","rankalign"],KP=["width","height","rank"],Nb={width:0,height:0},qP=["minlen","weight","width","height","labeloffset"],GP={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},zP=["labelpos"];function Sb(e){let n=new Xn({multigraph:!0,compound:!0}),r=If(e.graph());return n.setGraph(Object.assign({},UP,Af(r,MP),El(r,jP))),e.nodes().forEach(o=>{let i=If(e.node(o)),a=Af(i,KP);Object.keys(Nb).forEach(l=>{a[l]===void 0&&(a[l]=Nb[l])}),n.setNode(o,a);let s=e.parent(o);s!==void 0&&n.setParent(o,s)}),e.edges().forEach(o=>{let i=If(e.edge(o));n.setEdge(o,Object.assign({},GP,Af(i,qP),El(i,zP)))}),n}function HP(e){let n=e.graph();n.ranksep/=2,e.edges().forEach(r=>{var o;let i=e.edge(r);i.minlen*=2,((o=i.labelpos)!=null?o:"r").toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})}function WP(e){e.edges().forEach(n=>{let r=e.edge(n);if(r.width&&r.height){let o=e.node(n.v),i={rank:(e.node(n.w).rank-o.rank)/2+o.rank,e:n};ri(e,"edge-proxy",i,"_ep")}})}function YP(e){let n=0;e.nodes().forEach(r=>{let o=e.node(r);o.borderTop&&(o.minRank=e.node(o.borderTop).rank,o.maxRank=e.node(o.borderBottom).rank,n=Math.max(n,o.maxRank))}),e.graph().maxRank=n}function JP(e){e.nodes().forEach(n=>{let r=e.node(n);if(r.dummy==="edge-proxy"){let o=r;e.edge(o.e).labelRank=r.rank,e.removeNode(n)}})}function XP(e){let n=Number.POSITIVE_INFINITY,r=0,o=Number.POSITIVE_INFINITY,i=0,a=e.graph(),s=a.marginx||0,l=a.marginy||0;function c(d){let f=d.x,u=d.y,p=d.width,g=d.height;n=Math.min(n,f-p/2),r=Math.max(r,f+p/2),o=Math.min(o,u-g/2),i=Math.max(i,u+g/2)}e.nodes().forEach(d=>c(e.node(d))),e.edges().forEach(d=>{let f=e.edge(d);Object.hasOwn(f,"x")&&c(f)}),n-=s,o-=l,e.nodes().forEach(d=>{let f=e.node(d);f.x-=n,f.y-=o}),e.edges().forEach(d=>{let f=e.edge(d);f.points.forEach(u=>{u.x-=n,u.y-=o}),Object.hasOwn(f,"x")&&(f.x-=n),Object.hasOwn(f,"y")&&(f.y-=o)}),a.width=r-n+s,a.height=i-o+l}function ZP(e){e.edges().forEach(n=>{if(n.v===n.w)return;let r=e.edge(n),o=e.node(n.v),i=e.node(n.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=i,s=o),r.points.unshift(W_(o,a)),r.points.push(W_(i,s))})}function QP(e){e.edges().forEach(n=>{let r=e.edge(n);if(Object.hasOwn(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function eV(e){e.edges().forEach(n=>{let r=e.edge(n);r.reversed&&r.points.reverse()})}function tV(e){e.nodes().forEach(n=>{if(e.children(n).length){let r=e.node(n),o=e.node(r.borderTop),i=e.node(r.borderBottom),a=e.node(r.borderLeft[r.borderLeft.length-1]),s=e.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-o.y),r.x=a.x+r.width/2,r.y=o.y+r.height/2}}),e.nodes().forEach(n=>{e.node(n).dummy==="border"&&e.removeNode(n)})}function nV(e){e.edges().forEach(n=>{if(n.v===n.w){let r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function rV(e){Cl(e).forEach(n=>{let r=0;n.forEach((o,i)=>{let a=e.node(o);typeof a.rank!="number"&&(a.rank=0),a.order=i+r,(a.selfEdges||[]).forEach(s=>{ri(e,"selfedge",{width:s.label.width,height:s.label.height,rank:a.rank,order:i+ ++r,e:s.e,edgeLabel:s.label},"_se"),(!Array.isArray(s.label.points)||s.label.points.length!==7)&&(s.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete a.selfEdges})})}function oV(e){e.nodes().forEach(n=>{let r=e.node(n),o=i=>typeof i=="number"&&isFinite(i);if(r.dummy==="selfedge"){let i=r,a=e.node(i.e.v),s=o(a?.x)?a.x:0,l=o(a?.y)?a.y:0,c=o(a?.width)?a.width:0,d=o(a?.height)?a.height:0,f=o(r.x)?r.x:s,u=o(r.y)?r.y:l,p=c/2,g=d/2;i.edgeLabel.points=[{x:f+p,y:u-g},{x:f+p,y:u-g},{x:f,y:u},{x:f-p,y:u+g},{x:f-p,y:u+g},{x:f,y:u},{x:f,y:u}],i.edgeLabel.x=f,i.edgeLabel.y=u,e.setEdge(i.e,i.edgeLabel),e.removeNode(n)}else r&&Array.isArray(r.selfEdges)&&r.selfEdges.forEach(i=>{if(!Array.isArray(i.label.points)||i.label.points.length!==7){let a=o(r.x)?r.x:0,s=o(r.y)?r.y:0,l=o(r.width)?r.width:0,c=o(r.height)?r.height:0,d=l/2,f=c/2;i.label.points=[{x:a+d,y:s-f},{x:a+d,y:s-f},{x:a,y:s},{x:a-d,y:s+f},{x:a-d,y:s+f},{x:a,y:s},{x:a,y:s}]}})})}function Af(e,n){return Nl(El(e,n),Number)}function If(e){let n={};return e&&Object.entries(e).forEach(([r,o])=>{typeof r=="string"&&(r=r.toLowerCase()),n[r]=o}),n}function iV(e){return e.map(({source:n,target:r})=>({source:n,target:r}))}function aV(e){const n=[];for(const r of e)for(const o of r.memberIds)n.push({source:r.ownerId,target:o});return n}function xb(e,n){return[...iV(e),...aV(n)]}function xl(e,n){const r=new Map;for(const{source:o,target:i}of e)r.has(o)||r.set(o,[]),r.get(o).push(i),r.has(i)||r.set(i,[]);return n&&(r.has(n.source)||r.set(n.source,[]),r.get(n.source).push(n.target),r.has(n.target)||r.set(n.target,[])),r}function vf(e){const n=new Set,r=new Set;function o(i){if(r.has(i))return!0;if(n.has(i))return!1;n.add(i),r.add(i);for(const a of e.get(i)??[])if(o(a))return!0;return r.delete(i),!1}for(const i of e.keys())if(o(i))return!0;return!1}function Tf(e,n){const r=e.config;if(!r)return[];const o=r[n];return Array.isArray(o)?o.filter(i=>typeof i=="string"&&uf(i)):[]}function sV({state:e,groupMapById:n,getNodeById:r,history:o}){const i=t.computed(()=>{const S=new Map;for(const B of e.value.groups)for(const P of B.memberIds)S.set(P,{ownerId:B.ownerId,branch:B.branch});return S}),a=t.computed(()=>{const S=new Map;for(const B of e.value.groups)for(const P of B.memberIds)S.set(P,B);return S}),s=t.computed(()=>{const S=new Map;for(const B of e.value.groups)S.has(B.ownerId)||S.set(B.ownerId,[]),S.get(B.ownerId).push(B);return S}),l=t.computed(()=>xb(e.value.edges,e.value.groups)),c=t.computed(()=>xl(l.value));function d(S,B){return S?Oa(S.type).includes(B):!1}function f(S,B){if(B===S.id)return!1;const P=r(B);return!(!P||rn(P.type)||P.phase!==S.phase)}function u(S,B){const P=[],R=new Set;for(const F of B)R.has(F)||(R.add(F),f(S,F)&&P.push(F));return P}function p(S,B,P){const R=r(S);return d(R,B)?u(R,P):[]}function g(S,B,P){const R=mf(S.id,B),F=n.value.get(R);P.length>0?F?(F.phase!==S.phase&&(F.phase=S.phase),ff(F.memberIds,P)||(F.position=void 0,F.dimensions=void 0,F.memberIds=[...P])):e.value.groups.push(V_(S.id,B,S.phase,P)):F&&(e.value.groups=e.value.groups.filter(X=>X.id!==R))}function h(S,B,P,R={}){const F=r(S);if(!d(F,B))return!1;const X=u(F,P),Z=Tf(F,B);if(ff(Z,X))return!1;const U=F.config??={};return X.length>0?U[B]=[...X]:(delete U[B],Object.keys(U).length===0&&delete F.config),g(F,B,X),(R.commit??!0)&&o.commit(R.tag),!0}function y(S,B={}){const P=e.value.groups.filter(R=>R.ownerId!==S);return P.length===e.value.groups.length?!1:(e.value.groups=P,(B.commit??!0)&&o.commit(B.tag),!0)}function m(S,B){const P=n.value.get(mf(S,B));if(P)return[...P.memberIds];const R=r(S);return R?Tf(R,B):[]}function _(S){return i.value.get(S)}function b(S){const B=[];let P=a.value.get(S);for(;P;)B.push(P.id),P=a.value.get(P.ownerId);return B}function k(S,B){const P=b(B);if(P.length===0)return!1;const R=new Set(b(S));return R.size===0?!0:P.some(F=>!R.has(F))}function A(S,B){if(S===B)return!0;const P=new Set,R=[B];for(;R.length>0;){const F=R.pop();if(P.has(F))continue;if(P.add(F),F===S)return!0;const X=c.value.get(F);if(X)for(const Z of X)P.has(Z)||R.push(Z)}return!1}function C(S,B,P){const R=r(S);return!(!d(R,B)||!f(R,P)||A(S,P))}function w(S,B,P,R={}){const F=r(S);if(!F||!C(S,B,P))return!1;const X=Tf(F,B);if(X.includes(P))return!1;x(P,{commit:!1});const Z=[...X,P];return h(S,B,Z,{commit:!1})?((R.commit??!0)&&o.commit(R.tag),!0):!1}function x(S,B={}){const P=_(S);if(!P)return!1;const R=m(P.ownerId,P.branch),F=R.filter(X=>X!==S);return F.length===R.length?!1:h(P.ownerId,P.branch,F,B)}function I(S){let B=0;const P=new Set;let R=a.value.get(S);for(;R&&!P.has(R.id);)B+=1,P.add(R.id),R=a.value.get(R.ownerId);return B}function T(S){const B=n.value.get(S);return B?I(B.ownerId):0}function v(S){return S?n.value.has(S):!1}return{memberGroupMap:a,groupsByOwner:s,findMembership:_,getMembers:m,wouldCreateCycle:A,setMembers:h,prepareMembers:p,addMember:w,removeMember:x,clear:y,getNodeDepth:I,getGroupDepth:T,isGroupId:v,isEdgeEnteringGroup:k,canAddMember:C}}function lV(e,n){const{commit:r,undo:o,redo:i,canUndo:a,canRedo:s,clear:l,reset:c,undoStack:d,redoStack:f}=At.useManualRefHistory(e,{capacity:n?.capacity,clone:n?.clone});let u;function p(k){n?.onHistoryChange?.(k,e.value)}function g(k){if(!k){u=void 0,r(),p("commit");return}if(k!=="*"&&u!==k){u=k,r(),p("commit");return}r(),d.value.shift(),p("commit")}function h(){o(),u=void 0,p("undo")}function y(){i(),u=void 0,p("redo")}function m(){l(),u=void 0,p("clear")}function _(){c(),u=void 0,p("reset")}function b(){o(),f.value.shift(),u=void 0,p("revert")}return{canUndo:a,canRedo:s,commit:g,undo:h,redo:y,clear:m,reset:_,revert:b}}function cV(e){return e.config?.resources?.vault||{}}function dV(e){const{resources:n}=e.config||{};return n?.vault?Object.keys(n.vault):[]}function uV(e){const n=Object.entries(e);if(n.length===0)return;const r={};for(const[o,i]of n)r[o]=i;return r}function Ab(e,n){const r=e.config?.nodes??[],o=e.__ui_data?.nodes??[],i=e.__ui_data?.groups??[],a=new Map(o.map(m=>[m.name,m])),s=new Map(i.map(m=>[m.name,m])),l=[],c=[],d=new Map,f=[],u=[],p=new Map,g=m=>{const _=new Set,b=[...m];for(;b.length>0;){const k=b.shift();if(!_.has(k)&&(_.add(k),df(k)||(d.get(k).phase="request"),!!p.has(k)))for(const A of p.get(k))_.has(A)||b.push(A)}};let h=!1;for(const m of r){const _=a.get(m.name);!_&&!h&&(h=!0);const b=vb({type:m.type,configNode:m,uiNode:_,pluginData:e});l.push(b),d.set(b.name,b)}for(const m of l){const _=Oa(m.type);if(!_.length)continue;const b=m.config;if(b)for(const k of _){const A=b[k];if(!Array.isArray(A)){s.has(_l(m.name,k))&&(h=!0);continue}const C=[];for(const w of A){if(typeof w!="string")continue;const x=d.get(w);x&&!rn(x.type)&&C.push(x.id)}if(C.length){b[k]=C;const w=_l(m.name,k),x=s.get(w),I=x?{position:_r(x.position)}:void 0,T=V_(m.id,k,m.phase,C,I);f.push(T),!x&&!h&&(h=!0)}else delete b[k],s.has(_l(m.name,k))&&(h=!0)}}for(const m of Zo)if(!d.has(m)){let _=a.get(m);_||(h||(h=!0),_=RO(m));const b=vb({type:m,uiNode:_,pluginData:e});l.push(b),d.set(b.name,b)}for(const m of r)mV(m,u);for(const m of u){const _=d.get(m.source),b=d.get(m.target);if(!_||!b){_||console.warn(`[initEditorState] skip: source "${m.source}" not found`),b||console.warn(`[initEditorState] skip: target "${m.target}" not found`);continue}p.has(m.source)||p.set(m.source,new Set),p.get(m.source).add(m.target),p.has(m.target)||p.set(m.target,new Set),p.get(m.target).add(m.source),c.push({id:ti("edge"),source:_.id,sourceField:Ur(_,"output",m.sourceField)?.id,target:b.id,targetField:Ur(b,"input",m.targetField)?.id})}g(["request","service_request"]);let y=null;return e.config?.resources?.cache&&(y={...e.config.resources.cache},e.partials&&(y.partial_id=e.partials[0].id)),{nodes:l,edges:c,groups:f,pendingLayout:h?n?"keepHistory":"clearHistory":!1,pendingFitView:!0,...y?{cacheConfig:y}:{}}}function Ib(e){const{type:n,name:r,phase:o,position:i,fields:a,config:s}=e,l=T_(n),c=ni(n);return{id:ti("node"),type:n,name:r??n,phase:o??"request",position:i??{x:0,y:0},expanded:{},fields:{input:O_(a?.input??l.input),output:O_(a?.output??l.output)},hidden:e.hidden||c.hidden,config:s?_r(s):{}}}function fV(e){return rn(e)?e==="request"||e==="service_request"?"request":"response":"request"}function vb({type:e,configNode:n,uiNode:r,pluginData:o}){return Ib({type:e,name:n?.name,phase:r?.phase??fV(e),position:r?.position,fields:gV({type:e,uiNode:r,configNode:n,pluginData:o}),hidden:r?.hidden,config:hV({type:e,configNode:n,pluginData:o})})}function pV(e){const{type:n,name:r,input:o,inputs:i,output:a,outputs:s,...l}=e;return _r(l)}function mV(e,n){const r=e.name;if(e.input){const{nodeName:o,fieldName:i}=yl(e.input);o&&n.push({source:o,sourceField:i,target:r})}if(e.inputs)for(const[o,i]of Object.entries(e.inputs)){if(!i)continue;const{nodeName:a,fieldName:s}=yl(i);a&&n.push({source:a,sourceField:s,target:r,targetField:o})}if(e.output){const{nodeName:o,fieldName:i}=yl(e.output);o&&n.push({source:r,target:o,targetField:i})}if(e.outputs)for(const[o,i]of Object.entries(e.outputs)){if(!i)continue;const{nodeName:a,fieldName:s}=yl(i);a&&n.push({source:r,sourceField:o,target:a,targetField:s})}}function gV({type:e,uiNode:n,configNode:r,pluginData:o}){const a=ni(e)?.io;if(!a)return;const s={};if(a.input?.configurable&&(n?s.input=n.fields?.input??[]:r?.inputs&&(s.input=Object.keys(r.inputs))),a.output?.configurable){if(n)s.output=n.fields?.output??[];else{const l=new Set;r?.outputs&&Object.keys(r.outputs).forEach(c=>l.add(c)),r?.type==="static"&&r.values&&Object.keys(r.values).forEach(c=>l.add(c)),l.size&&(s.output=Array.from(l))}e==="vault"&&(s.output=dV(o))}return Object.keys(s).length?s:void 0}function hV({type:e,configNode:n,pluginData:r}){return e==="vault"?cV(r):n?pV(n):void 0}function yV(e){const n=t.computed(()=>{const u=new Map;return e.value.nodes.forEach(p=>u.set(p.id,p)),u}),r=t.computed(()=>e.value.edges),o=t.computed(()=>e.value.groups),i=t.computed(()=>xb(r.value,o.value));function a(u){return xl(i.value,u?{source:u.source,target:u.target}:void 0)}function s(u){const p=n.value.get(u.source),g=n.value.get(u.target);if(!p||!g)return u;const h=B_(p,u.sourceField)&&!pf(p,u.sourceField),y=pf(g,u.targetField);return h&&y?{source:u.target,sourceField:u.targetField,target:u.source,targetField:u.sourceField}:u}function l(u){const p=s(u),g=[],h=n.value.get(p.source),y=n.value.get(p.target);if(h||g.push("source node not found"),y||g.push("target node not found"),!h||!y)return{ok:!1,errors:g};pf(h,p.sourceField)||g.push("source handle is not an output field"),B_(y,p.targetField)||g.push("target handle is not an input field"),y.name==="request"&&g.push('cannot target "request"'),h.name==="response"&&g.push('cannot source from "response"');const m=r.value.some(k=>k.target===p.target&&!k.targetField),_=r.value.some(k=>k.target===p.target&&!!k.targetField);(m&&p.targetField||_&&!p.targetField)&&g.push("cannot mix whole-node and field-level inputs on same target"),p.targetField&&r.value.some(k=>k.target===p.target&&k.targetField===p.targetField)&&g.push("target field already connected"),!p.targetField&&r.value.some(k=>k.target===p.target&&!k.targetField)&&g.push("target input already taken"),p.source===p.target&&g.push("self-loop not allowed");const b=a({source:p.source,target:p.target});return vf(b)&&g.push("connection introduces a cycle"),g.length?{ok:!1,errors:g}:{ok:!0}}function c(){const u=[];for(const p of Zo)[...n.value.values()].some(g=>g.name===p)||u.push(`missing implicit node "${p}"`);for(const p of r.value){const g=n.value.get(p.source);n.value.get(p.target).name==="request"&&u.push(`edge "${p.id}" targets "request"`),g.name==="response"&&u.push(`edge "${p.id}" sources from "response"`)}return vf(a())&&u.push("graph contains cycle"),u.length?{ok:!1,errors:u}:{ok:!0}}function d(u){return l(u).ok}function f(u){return!u.source||!u.target?!1:d({source:u.source,sourceField:u.sourceHandle,target:u.target,targetField:u.targetHandle})}return{canonicalizeConnection:s,validateConnection:l,validateGraph:c,isValidConnection:d,isValidVueFlowConnection:f,buildAdjacency:xl}}const[Of,_V]=At.createInjectionState(function(n,r={}){const o=t.ref(Ab(n)),i=t.ref(),a=t.ref(),s=t.ref(!1),l=t.ref(!1),c=lV(o,{capacity:200,clone:_r,onHistoryChange:H=>{H!=="clear"&&r.onChange?.(Ae(),z(),ne(),o.value.cacheConfig?.partial_id)}}),d=t.ref(!1),f=t.ref(new Set);function u(){o.value.pendingLayout=!1,c.commit("*")}function p(H=!0){o.value.pendingFitView!==H&&(o.value.pendingFitView=H,c.commit("*"))}const g=t.computed(()=>{const H={request:0,response:0};return o.value.nodes.forEach(D=>{rn(D.type)||H[D.phase]++}),H}),h=t.computed(()=>new Map(o.value.nodes.map(H=>[H.id,H]))),y=t.computed(()=>new Map(o.value.nodes.map(H=>[H.name,H]))),m=t.computed(()=>{const H=new Map,D=new Map;for(const q of o.value.edges)H.set(q.id,q),D.has(q.source)||D.set(q.source,new Set),D.get(q.source).add(q.id),D.has(q.target)||D.set(q.target,new Set),D.get(q.target).add(q.id);return{edgeMapById:H,edgeIdMapByNodeId:D}}),_=t.computed(()=>m.value.edgeMapById),b=t.computed(()=>m.value.edgeIdMapByNodeId),k=t.computed(()=>new Map(o.value.groups.map(H=>[H.id,H]))),A=t.computed(()=>new Set(o.value.nodes.map(H=>H.name))),C=sV({state:o,groupMapById:k,getNodeById:S,history:c}),{canonicalizeConnection:w,validateConnection:x,validateGraph:I,isValidConnection:T,isValidVueFlowConnection:v}=yV(o);function S(H){return h.value.get(H)}function B(H){return y.value.get(H)}function P(H){return _.value.get(H)}function R(H){if(!b.value.has(H))return[];const D=[];return b.value.get(H).forEach(q=>{const ie=P(q);ie&&D.push(ie)}),D}function F(H){return R(H).filter((D=>D.target===H))}function X(H){return R(H).filter((D=>D.source===H))}const Z=t.computed(()=>i.value?S(i.value):void 0);function U(H){i.value=H}function K(H){a.value=H}function L(H){if(rn(H.type))throw new Error("[createNode] implicit nodes are fixed.");return Ib({type:H.type,name:H.name||(rn(H.type)?void 0:P_(H.type,A.value)),phase:H.phase,position:H.position,fields:H.fields,config:H.config})}function oe(H,D=!0){const q=L(H);if(q)return o.value.nodes.push(q),D&&c.commit(),d.value=!0,q.id}function se(H,D,q=!0){const ie=S(H);if(!ie||rn(ie.type))return;const he={..._r(ie),id:ti("node"),name:P_(ie.name,A.value),position:D??{x:ie.position.x+20,y:ie.position.y+20}},xe=Oa(he.type);if(xe.length&&he.config){for(const Ke of xe)delete he.config[Ke];Object.keys(he.config).length===0&&delete he.config}return o.value.nodes.push(he),q&&c.commit(),d.value=!0,he.id}function M(H,D=!0){if(!S(H))return;o.value.edges=o.value.edges.filter(he=>he.source!==H&&he.target!==H),C.clear(H,{commit:!1}),C.removeMember(H,{commit:!1}),o.value.nodes=o.value.nodes.filter(he=>he.id!==H),i.value===H&&(i.value=void 0);const ie=I();ie.ok||console.warn("[removeNode] topology invalid:",ie.errors.join("; ")),D&&c.commit()}function le(H,D,q=!0,ie){const he=S(H);if(!he)return;if(df(he.name)){console.warn("[renameNode] implicit node name is reserved.");return}he.name!==D&&(he.name=D,q&&c.commit(ie))}function Y(H,D,q=!0){const ie=S(H);ie&&(ie.position={...D},q&&c.commit())}function ae(H,D,q=!0){const ie=k.value.get(H);if(!ie)return;const he=ie.position;he&&he.x===D.x&&he.y===D.y||(ie.position={...D},q&&c.commit())}function Me(H,D,q=!0){const ie=k.value.get(H);if(!ie)return!1;const he={...D.position},xe={...D.dimensions},Ke=ie.position&&ie.position.x===he.x&&ie.position.y===he.y,tt=ie.dimensions&&ie.dimensions.width===xe.width&&ie.dimensions.height===xe.height;return Ke&&tt?!1:(ie.position=he,ie.dimensions=xe,q&&c.commit(),!0)}function Ee(H,D,q,ie=!0,he){const xe=S(H);if(!xe)return;const Ke=q??!xe.expanded[D];Ke!==!!xe.expanded[D]&&(xe.expanded[D]=Ke,ie&&c.commit(he??`toggle:${H}:${D}`))}function Ue(H,D,q=!0,ie){const he=S(H);he&&(he.config=_r(D),q&&c.commit(ie))}function Ie(H,D,q,ie=!0){const he=S(H);if(!he)return;const xe=he.fields[D];if(xe.some(Ke=>Ke.name===q)){console.warn(`[addField] field "${q}" already exists on ${D}.`);return}xe.push({id:ti("field"),name:q}),D==="input"?he.fields.input=xe:he.fields.output=xe,ie&&c.commit()}function ce(H,D,q,ie=!0){const he=S(H);if(!he)return;const xe=he.fields.input,Ke=he.fields.output,tt=xe.find(j=>j.id===D)??Ke.find(j=>j.id===D);tt&&(tt.name=q,ie&&c.commit())}function re(H,D,q=!0,ie=!0){const he=S(H);if(!he)return;const xe=he.fields.input,Ke=he.fields.output,tt=xe.findIndex(fe=>fe.id===D);tt>=0&&xe.splice(tt,1);const j=Ke.findIndex(fe=>fe.id===D);j>=0&&Ke.splice(j,1),he.fields.input=xe,he.fields.output=Ke,q&&(o.value.edges=o.value.edges.filter(fe=>fe.sourceField!==D&&fe.targetField!==D));const te=I();te.ok||console.warn("[removeField] topology invalid:",te.errors.join("; ")),ie&&c.commit()}function Oe(H,D=!0){const q=w(H),ie=x(q);if(!ie.ok){console.warn("[connectEdge] invalid connection:",ie.errors.join("; "));return}const he={id:ti("edge"),...q};o.value.edges.push(he);const xe=I();if(!xe.ok){o.value.edges.pop(),console.warn("[connectEdge] topology invalid:",xe.errors.join("; "));return}return D&&c.commit(),he.id}function ve(H,D,q=!0){je(H,!1),Oe(D,!1),q&&c.commit()}function je(H,D=!0){const q=o.value.edges.findIndex(xe=>xe.id===H);if(q<0)return;const ie=o.value.edges[q];o.value.edges.splice(q,1);const he=I();if(!he.ok){o.value.edges.splice(q,0,ie),console.warn("[disconnectEdge] topology invalid:",he.errors.join("; "));return}D&&c.commit()}function st(H,D=!0){const q=F(H);for(const ie of q)je(ie.id,!1);D&&c.commit()}function ct(H,D=!0){const q=X(H);for(const ie of q)je(ie.id,!1);D&&c.commit()}function Ae(){const H=[];for(const D of o.value.nodes){if(rn(D.type))continue;let q;const ie={};let he;const xe={};for(const fe of o.value.edges.filter(ee=>ee.target===D.id)){const ee=S(fe.source);if(!ee)continue;const ke=jr(ee,"output",fe.sourceField)?.name,Je=ke?`${ee.name}.${ke}`:ee.name,ge=jr(D,"input",fe.targetField)?.name;ge?ie[ge]=Je:q===void 0&&(q=Je)}for(const fe of o.value.edges.filter(ee=>ee.source===D.id)){const ee=S(fe.target);if(!ee)continue;const ke=ee.type;if(!rn(ke)||!gl[ke].io?.input)continue;const Je=jr(ee,"input",fe.targetField)?.name,ge=Je?`${ee.name}.${Je}`:ee.name,we=jr(D,"output",fe.sourceField)?.name;we?xe[we]=ge:he===void 0&&(he=ge)}const Ke={..._r(D.config),name:D.name,type:D.type},tt=Oa(D.type);if(tt.length)for(const fe of tt){const ee=Ke[fe];if(!Array.isArray(ee))continue;const ke=[];for(const Je of ee){const ge=S(Je);ge&&ke.push(ge.name)}ke.length?Ke[fe]=Array.from(new Set(ke)):delete Ke[fe]}Object.keys(ie).length>0?Ke.inputs=ie:q!==void 0&&(Ke.input=q),Object.keys(xe).length>0?Ke.outputs=xe:he!==void 0&&(Ke.output=he),H.push(Ke)}return H}function $e(){return o.value.nodes.map(H=>_r({name:H.name,phase:H.phase,position:{...H.position},expanded:{...H.expanded},fields:{input:H.fields.input.map(D=>D.name),output:H.fields.output.map(D=>D.name)}}))}function ne(){const H={},D=B("vault");if(D){const q=uV(D.config);q&&Object.keys(q).length>0&&(H.vault=q)}if(o.value.cacheConfig){const{strategy:q,redis:ie,memory:he}=o.value.cacheConfig;H.cache={strategy:q,redis:ie,memory:he}}if(Object.keys(H).length!==0)return H}function G(){const H=[];for(const D of o.value.groups){const q=S(D.ownerId);if(!q)continue;const ie=D.position;ie&&H.push({name:_l(q.name,D.branch),position:{...ie}})}return H}function z(){return{nodes:$e(),groups:G()}}function Q(H,D){D&&c.commit(),o.value=Ab(H,D),D||c.clear()}return{state:o,selection:i,portalSelection:a,modalOpen:s,skipValidation:d,invalidConfigNodeIds:f,propertiesPanelOpen:l,configNodeCounts:g,nodeMapById:h,nodeMapByName:y,edgeMapById:_,edgeIdMapByNodeId:b,groupMapById:k,getNodeById:S,getNodeByName:B,getEdgeById:P,getEdgesByNodeId:R,getInEdgesByNodeId:F,getOutEdgesByNodeId:X,selectedNode:Z,selectNode:U,selectPortalEdge:K,createNode:L,addNode:oe,duplicateNode:se,removeNode:M,renameNode:le,moveNode:Y,moveGroup:ae,setGroupLayout:Me,toggleExpanded:Ee,replaceConfig:Ue,branchGroups:C,addField:Ie,renameField:ce,removeField:re,connectEdge:Oe,replaceConnection:ve,disconnectEdge:je,disconnectInEdges:st,disconnectOutEdges:ct,toConfigNodes:Ae,toUINodes:$e,toUIGroups:G,toUIData:z,toResources:ne,load:Q,commit:c.commit,undo:c.undo,redo:c.redo,canUndo:c.canUndo,canRedo:c.canRedo,clear:c.clear,reset:c.reset,revert:c.revert,isValidConnection:T,isValidVueFlowConnection:v,validateGraph:()=>I(),clearPendingLayout:u,setPendingFitView:p}});function It(){const e=_V();if(!e)throw new Error("Editor state is not provided. Ensure you are using provideEditorStore in a parent component.");return e}function bV(e){const{branchLayout:n,phase:r,layoutOptions:o,nodes:i,edges:a}=e,{findNode:s}=kt.useVueFlow(),{state:l,branchGroups:c,getNodeById:d,moveNode:f,commit:u}=It(),{getNodeDepth:p,isGroupId:g,groupsByOwner:h}=c,{isBranchEdgeId:y,updateGroupLayout:m,translateGroupTree:_,waitForLayoutFlush:b}=n,{viewport:k,padding:A=Mr.padding,gaps:C=Mr.gaps}=o,{nodes:w=Mr.gaps.nodes,edges:x=Mr.gaps.edges,ranks:I=Mr.gaps.ranks}=C;async function T(B=!0){const P=new Map(i.value.map(Y=>[Y.id,Y.data])),R=new Map,F=new Map,X=Y=>{if(!Y)return;let ae=F.get(Y);return ae||(ae=s(Y),ae&&F.set(Y,ae),ae)},Z=new Map,U=Y=>{let ae=Z.get(Y);return ae!==void 0||(ae=p(Y),Z.set(Y,ae)),ae},K=Y=>{if(!Ta(Y.data))return Y.parentNode;const ae=X(Y.data.ownerId);if(!ae)throw new Error(`Cannot find owner node '${Y.data.ownerId}' for group node '${Y.id}' via findNode`);return ae.parentNode};for(const Y of a.value){if(y(Y.id))continue;const ae=Y.source,Me=Y.target;if(g(ae)||g(Me))continue;const Ee=X(ae),Ue=X(Me);if(Ee){if(!Ue)throw new Error(`Cannot find target node '${Me}' for edge '${Y.id}' via findNode`)}else throw new Error(`Cannot find source node '${ae}' for edge '${Y.id}' via findNode`);if(K(Ee)===K(Ue))continue;let Ie=Ee,ce=Ue,re=U(Ie.id),Oe=U(ce.id);for(;re!==Oe;)if(re>Oe){const ve=K(Ie);if(!ve)throw new Error(`Expected node '${Ie.id}' to have parent, but it does not`);const je=X(ve);if(!je)throw new Error(`Cannot find parent node '${ve}' for node '${Ie.id}' via findNode`);Ie=je,re--}else if(Oe>re){const ve=K(ce);if(!ve)throw new Error(`Expected node '${ce.id}' to have parent, but it does not`);const je=X(ve);if(!je)throw new Error(`Cannot find parent node '${ve}' for node '${ce.id}' via findNode`);ce=je,Oe--}for(;re>=0;){const ve=K(Ie),je=K(ce);if(ve===je){R.has(re)||R.set(re,[]),R.get(re).push({v:Ie.id,w:ce.id});break}if(ve){if(!je){const Ae=`Expected node '${ce.id}' to have parent, but it does not`;throw console.error(Ae,ce),new Error(Ae)}}else{const Ae=`Expected node '${Ie.id}' to have parent, but it does not`;throw console.error(Ae,Ie),new Error(Ae)}const st=X(ve),ct=X(je);if(st){if(!ct)throw new Error(`Cannot find parent node '${je}' for node '${ce.id}' via findNode`)}else throw new Error(`Cannot find parent node '${ve}' for node '${Ie.id}' via findNode`);Ie=st,ce=ct,re--,Oe--}}const L=l.value.groups.toSorted((Y,ae)=>U(ae.ownerId)-U(Y.ownerId));for(const Y of L)v(Y.memberIds.reduce((ae,Me)=>{const Ee=d(Me);if(!Ee)return console.warn(`Cannot find node '${Me}' of group '${Y.id}' by getNodeById`),ae;if(Ee.phase!==r)return ae;if(Ee.type==="branch"){const Ue=h.value.get(Ee.id);Ue&&ae.push(...Ue)}return P.delete(Ee.id),ae.push(Ee),ae},[]),{virtualEdges:R.get(U(Y.ownerId)),cachedFindNode:X}),await t.nextTick(),m(Y.id,!1),await b();const oe=P.values().toArray();for(const Y of oe){if(Ta(Y)||Y.type!=="branch")continue;const ae=h.value.get(Y.id);ae&&oe.push(...ae)}const{autoNodes:se,leftNode:M,rightNode:le}=S(oe);v(se,{leftNode:M,rightNode:le,virtualEdges:R.get(0),cachedFindNode:X}),B&&u()}function v(B,P){const{leftNode:R,rightNode:F,virtualEdges:X,cachedFindNode:Z}=P||{},U=R?(Z??s)(R.id):void 0,K=F?(Z??s)(F.id):void 0;let L;if(B.length>0){L=new L_.Graph({multigraph:!0}),L.setGraph({rankdir:r==="request"?"LR":"RL",nodesep:w,edgesep:x,ranksep:I});const Ie=new Set;for(const ce of B){const re=(Z??s)(ce.id);if(!re){console.warn(`Cannot find graph node '${ce.id}' in ${r} phase`);continue}Ie.add(ce.id),Ta(ce)?L.setNode(ce.id,{...ce.dimensions??re.dimensions}):L.setNode(ce.id,{...re.dimensions})}for(const ce of a.value)!Ie.has(ce.source)||!Ie.has(ce.target)||L.setEdge(ce.source,ce.target,{points:[]});X?.forEach(ce=>L.setEdge(ce,{points:[]})),DP(L)}const oe=[],se=Ie=>({x:Ie.x-Ie.width/2,y:Ie.y-Ie.height/2,width:Ie.width,height:Ie.height});if(B.length>0){if(!L)throw new Error("Expected dagreGraph to be initialized");for(const Ie of B){const ce=L.node(Ie.id),re=se(ce);oe.push(re),Ta(Ie)?_(Ie.id,re,re.x+Ho,re.y+Ho):f(Ie.id,{x:re.x,y:re.y},!1)}}const M=oe.length>0?$_(oe):{x:0,y:0,width:0,height:0},le=M.width,Y=M.height,ae=M.x,Me=M.x+M.width,Ee=Math.max(0,Math.min(t.toValue(k?.width)??Number.POSITIVE_INFINITY,WN)-le-2*w-(U?.dimensions?.width??0)-(K?.dimensions?.width??0)-2*A),Ue=M.y+Y/2;R&&f(R.id,{x:ae-w-Ee/2-(U?.dimensions?.width??0),y:Ue-(U?.dimensions?.height??0)/2},!1),F&&f(F.id,{x:Me+w+Ee/2,y:Ue-(K?.dimensions?.height??0)/2},!1)}function S(B){let P,R;const F=[];for(const X of B){if(Ta(X)){F.push(X);continue}switch(X.name){case"request":{if(r!=="request")throw new Error(`Unexpected request node in ${r} phase`);if(P)throw new Error("Duplicated request node in request phase");P=X;break}case"service_request":{if(r!=="request")throw new Error(`Unexpected service_request node in ${r} phase`);if(R)throw new Error("Duplicated service_request node in request phase");R=X;break}case"service_response":{if(r!=="response")throw new Error(`Unexpected service_response node in ${r} phase`);if(R)throw new Error("Duplicated service_response node in response phase");R=X;break}case"response":{if(r!=="response")throw new Error(`Unexpected response node in ${r} phase`);if(P)throw new Error("Duplicated response node in response phase");P=X;break}default:{F.push(X);break}}}return{autoNodes:F,leftNode:P,rightNode:R}}return{autoLayout:T}}function wV({phase:e,groupMapById:n,getNodeDepth:r,canAddMember:o,draggingId:i}){const a=t.shallowRef(),s=t.shallowRef();function l(u){a.value=u,s.value=void 0}function c(){a.value&&(a.value=void 0,s.value=void 0)}function d(u){let p;const g=i?.value;return n.value.forEach(h=>{if(h.phase!==e||g&&uf(g)&&!o(h.ownerId,h.branch,g))return;const y=h.position,m=h.dimensions;if(!y||!m||!(u.x>=y.x&&u.x<=y.x+m.width&&u.y>=y.y&&u.y<=y.y+m.height))return;const b=r(h.ownerId);(!p||b>p.depth)&&(p={depth:b,id:h.id})}),p?.id}function f(u){if(!a.value){s.value=void 0;return}if(!u){s.value=void 0;return}s.value=d(u)}return{activeGroupId:s,start:l,updateActiveGroup:f,end:c}}function kV({phase:e,readonly:n,flowId:r,draggingId:o}){const{findNode:i}=kt.useVueFlow(r),a=It(),{state:s,groupMapById:l,getNodeById:c,moveNode:d,moveGroup:f,setGroupLayout:u,commit:p,branchGroups:g}=a,{memberGroupMap:h,groupsByOwner:y,getNodeDepth:m,getGroupDepth:_}=g,b=K=>!!K&&K.startsWith("branch:");function k(K){const L=[];for(const oe of K.memberIds){const se=c(oe);se&&L.push(se)}return L}const A=t.computed(()=>{const K=new Map;return h.value.forEach((L,oe)=>{if(L.phase!==e||!L.position)return;const se=c(oe);se&&(se.phase!==e||se.hidden||K.set(oe,L))}),K}),C=t.computed(()=>{const K=new Map;return y.value.forEach((L,oe)=>{const se=L.filter(M=>M.phase===e);se.length>0&&K.set(oe,se)}),K}),w=t.computed(()=>{const K=[];for(const L of s.value.groups){const oe=c(L.ownerId);if(!oe||oe.phase!==e)continue;const se=L.position,M=L.dimensions;if(!se||!M)continue;const le=k(L).filter(ae=>ae.phase===e&&!ae.hidden),Y=_(L.id);K.push({id:L.id,type:"group",position:se,width:M.width,height:M.height,data:{...L,memberIds:le.map(ae=>ae.id)},draggable:!n,selectable:!1,zIndex:Y*tl+qN})}return K}),x=t.computed(()=>{let K=0;for(const L of s.value.groups){if(L.phase!==e)continue;const oe=_(L.id);oe>K&&(K=oe)}return K}),I=t.computed(()=>{const K=[];for(const L of s.value.groups){if(L.phase!==e||!L.position||!L.dimensions)continue;const oe=c(L.ownerId);if(!oe||oe.phase!==e||oe.hidden||!k(L).filter(Y=>Y.phase===e&&!Y.hidden).length)continue;const M=Math.max(m(oe.id),_(L.id))+x.value+1,le={id:`branch:${L.id}`,source:oe.id,target:L.id,sourceHandle:`branch@${L.branch}`,targetHandle:"input",markerEnd:kt.MarkerType.ArrowClosed,selectable:!1,focusable:!1,updatable:!1,data:{type:"branch",ownerId:oe.id,branch:L.branch,groupId:L.id},zIndex:M*tl+zN};K.push(le)}return K}),T=new Map,v=new Map;let S;function B(K,L=!0){if(K.phase!==e)return;const oe=k(K).filter(ae=>ae.phase===e&&!ae.hidden);if(!oe.length)return;const se=[];for(const ae of oe){const Ee=i(ae.id)?.dimensions,Ue=Ee?.width??0,Ie=Ee?.height??0;if(Ue<=0||Ie<=0)return;se.push({...ae.position,width:Ue,height:Ie});const ce=y.value.get(ae.id)??[];for(const re of ce){if(re.phase!==e)continue;const Oe=T.get(re.id),ve=Oe?.position??re.position,je=Oe?.dimensions??re.dimensions;!ve||!je||se.push({x:ve.x,y:ve.y,width:je.width,height:je.height})}}const M=$_(se),le=M.width+Ho*2,Y=M.height+Ho*2;return{position:{x:Math.round(M.x-Ho),y:Math.round(M.y-Ho)},dimensions:{width:Math.round(le),height:Math.round(Y)},commit:L}}function P(){if(T.size===0){S=void 0;return}const K=[];let L=!1;T.forEach((oe,se)=>{const M=u(se,oe,!1);K.push({id:se,changed:M,commit:oe.commit}),oe.commit&&M&&!L&&(L=!0)}),T.clear(),S=void 0;for(const{id:oe,changed:se,commit:M}of K){if(!se)continue;const le=l.value.get(oe);if(!le)continue;const Y=A.value.get(le.ownerId);Y&&v.set(Y.id,{commit:M})}if(v.size>0){const oe=Array.from(v);v.clear();for(const[se,{commit:M}]of oe)F(se,M)}L&&p("*")}function R(){T.size!==0&&(S||(S=t.nextTick().then(P)))}function F(K,L=!0){const oe=l.value.get(K);if(!oe)return;const se=B(oe,L);se&&(T.set(K,se),R())}function X(K,L,oe,se){const M=l.value.get(K);if(!M)return;if(!M.position){f(K,L,!1),F(K);return}if(oe===0&&se===0){f(K,L,!1);return}f(K,L,!1);const le=[K],Y=new Set([K]),ae=new Set;for(;le.length;){const Me=le.shift(),Ee=l.value.get(Me);if(!Ee)continue;const Ue=k(Ee).filter(Ie=>Ie.phase===e&&!Ie.hidden);for(const Ie of Ue){ae.has(Ie.id)||(d(Ie.id,{x:Ie.position.x+oe,y:Ie.position.y+se},!1),ae.add(Ie.id));const ce=C.value.get(Ie.id)??[];for(const re of ce){if(Y.has(re.id))continue;const Oe=l.value.get(re.id);Oe?.position&&f(re.id,{x:Oe.position.x+oe,y:Oe.position.y+se},!1),Y.add(re.id),le.push(re.id)}}}}function Z(K,L){const oe=o?.value;if(!oe)return!1;if(oe===K||L.some(se=>oe===se))return!0;for(const se of L)if((C.value.get(se)??[])?.some(le=>le.id===oe))return!0;return!1}const U=new Map;return t.watch(()=>s.value.groups.filter(L=>L.phase===e).map(L=>{const oe=L.memberIds.map(se=>{const M=i(se),le=Math.round(M?.dimensions?.width??0),Y=Math.round(M?.dimensions?.height??0);return`${se}:${le}x${Y}`});return{id:L.id,memberIds:L.memberIds,signature:oe.join(",")}}),K=>{const L=new Set(K.map(oe=>oe.id));for(const oe of U.keys())L.has(oe)||U.delete(oe);for(const oe of K)Z(oe.id,oe.memberIds)||U.get(oe.id)===oe.signature||(U.set(oe.id,oe.signature),F(oe.id))},{deep:!0,flush:"post"}),{groupsByOwner:C,memberGroupMap:A,groupNodes:w,branchEdges:I,isBranchEdgeId:b,updateGroupLayout:F,translateGroupTree:X,getNodeDepth:m,maxGroupDepth:x,waitForLayoutFlush:()=>S??Promise.resolve()}}function CV(e){t.provide(Kh,e)}function Tb(){return t.inject(Kh,void 0)}function Ob(){const e=Tb();if(!e)throw new Error("Confirm modal not provided");return e}function EV(e){const{readonly:n,flowId:r}=e,o=kt.useVueFlow(r),{onNodesChange:i,onEdgesChange:a,onPaneClick:s,findEdge:l}=o,{disconnectEdge:c,commit:d,portalSelection:f,selectPortalEdge:u}=It();i(p=>{p.some(g=>g.type==="select"&&"selected"in g&&g.selected)&&u(void 0)}),a(p=>{const g=p.some(y=>y.type==="select"&&"selected"in y&&y.selected),h=f.value?p.some(y=>y.type==="remove"&&y.id===f.value):!1;(g||h)&&u(void 0)}),s(()=>u(void 0)),At.useEventListener("keydown",p=>{if(n||p.key!=="Delete"&&p.key!=="Backspace")return;const g=f.value;!g||l(g)||(p.preventDefault(),c(g,!1),u(void 0),d())})}function Bb(e){const n=e.match(/^(input|output)(?:s@(.*))?$/);if(n)return{io:n[1],field:n[2]}}const NV={default:TN,hover:BN,selected:ON};let Pb,Bf;function Al(e){const n=e.id===Pb?"selected":e.id===Bf?"hover":"default",r=NV[n],{markerEnd:o}=e,i=typeof o=="object"?{...o,color:r}:{type:o,color:r},a=e.zIndex??0,s=n==="selected"?a+2:n==="hover"?a+1:a;return{...e,style:{...e.style,stroke:r,strokeWidth:n==="selected"?1.5:void 0},markerEnd:i,zIndex:s}}const[SV,xV]=At.createInjectionState(function(e){const{phase:n,flowId:r,layoutOptions:o,readonly:i}=e,{viewport:a,padding:s=Mr.padding,gaps:l=Mr.gaps}=o,{nodes:c=Mr.gaps.nodes}=l,d=kt.useVueFlow(r),f=It(),u=Tb(),p=pl(),{i18n:{t:g}}=Ye(),{findNode:h,fitView:y,deleteKeyCode:m,onNodeDrag:_,onNodeDragStop:b,onConnect:k,onNodesChange:A,onEdgesChange:C,onEdgeUpdate:w,onEdgeMouseEnter:x,onEdgeMouseLeave:I,getNodes:T,setNodes:v,setEdges:S,addSelectedNodes:B,screenToFlowCoordinate:P}=d;m.value=["Delete","Backspace"];const{state:R,commit:F,moveNode:X,selectNode:Z,removeNode:U,getNodeById:K,connectEdge:L,disconnectEdge:oe,getInEdgesByNodeId:se,branchGroups:M,commit:le,reset:Y,groupMapById:ae}=f,{isGroupId:Me,canAddMember:Ee}=M,Ue=t.shallowRef(),Ie=V=>{Ue.value=V},ce=t.readonly(Ue);function re(V,me){const de=K(V.source),ue=K(V.target);return!!(de&&ue&&de.phase===me&&ue.phase===me)}const Oe=kV({phase:n,readonly:i,flowId:r,draggingId:ce}),{memberGroupMap:ve,groupNodes:je,branchEdges:st,isBranchEdgeId:ct,updateGroupLayout:Ae,translateGroupTree:$e,getNodeDepth:ne,maxGroupDepth:G}=Oe,{activeGroupId:z,start:Q,updateActiveGroup:H,end:D}=wV({phase:n,groupMapById:ae,getNodeDepth:ne,canAddMember:Ee,draggingId:ce}),q=t.computed(()=>R.value.nodes.filter(V=>V.phase===n&&!V.hidden).map(V=>{const me=ve.value.get(V.id),de=me?.position,ue=me?.dimensions,Re=me&&de&&ue?{x:V.position.x-de.x,y:V.position.y-de.y}:V.position,Be=ne(V.id),ye=!!(me&&de&&ue),_e=(ye?Be:0)+G.value+1;return{id:V.id,type:"flow",position:Re,data:V,deletable:!i&&!hl(V),parentNode:ye?me.id:void 0,zIndex:_e*tl+HN}})),ie=t.computed(()=>R.value.edges.filter(V=>re(V,n)).filter(V=>!M.isEdgeEnteringGroup(V.source,V.target)).filter(V=>{const me=K(V.source),de=K(V.target);return!me?.hidden&&!de?.hidden}).map(V=>{const me=K(V.source),de=K(V.target);if(!me||!de){const Re=[];throw me||Re.push(`source node "${V.source}"`),de||Re.push(`target node "${V.target}"`),new Error(`Missing ${Re.join(" and ")} for edge "${V.id}" in phase "${n}"`)}const ue=Math.max(ne(V.source),ne(V.target))+G.value+1;return Al({id:V.id,source:V.source,target:V.target,sourceHandle:V.sourceField?`outputs@${V.sourceField}`:"output",targetHandle:V.targetField?`inputs@${V.targetField}`:"input",markerEnd:kt.MarkerType.ArrowClosed,data:V,updatable:!i,zIndex:ue*tl+GN})})),he=t.computed(()=>[...st.value,...ie.value]),{autoLayout:xe}=bV({phase:n,layoutOptions:o,branchLayout:Oe,nodes:q,edges:he});EV({readonly:i,flowId:r}),t.watch([q,je,he],([V,me,de])=>{v([...me,...V]),S(de)},{immediate:!0});const Ke=t.computed(()=>({padding:s/Math.max(t.toValue(a?.width)??0,t.toValue(a?.height)??0)}));async function tt({source:V,sourceHandle:me,target:de,targetHandle:ue}){if(!me||!ue)return;const Re=Bb(me),Be=Bb(ue);if(Re?.io==="input"||Be?.io==="output"||me==="output"&&ue==="output")return;const ye=se(de);let _e=!1,_t=!1;const et=[],Xe=[],Ge=Be?.io==="input"?ye.filter(ut=>!ut.targetField):ye.filter(ut=>!!ut.targetField);Ge.length>0&&(_e=!0,Ge.forEach(ut=>{Xe.push(Ba(ut,K)),oe(ut.id,!1)}));const He=Be?.io==="input"?Be?.field?ye.filter(ut=>ut.targetField===Be.field):ye.filter(ut=>!!ut.targetField):ye.filter(ut=>!ut.targetField);if(He.length>0){if(He.some(Pt=>Pt.source===V&&Pt.target===de&&Pt.targetField===Be?.field&&Pt.sourceField===Re?.field))return;_t=!0,He.forEach(Pt=>{Xe.push(Ba(Pt,K)),oe(Pt.id,!1)})}if(!L({source:V,sourceField:Re?.field,target:de,targetField:Be?.field},!1)){Y(),p({message:g("plugins.free-form.datakit.flow_editor.error.invalid_connection"),appearance:"danger"});return}if(et.push(gf(V,Re?.field,de,Be?.field,K)),_e||_t){if(!u)throw Y(),new Error("Expected confirm modal to be provided here when reachable");if(!await u(g(_e?"plugins.free-form.datakit.flow_editor.confirm.message.switch":"plugins.free-form.datakit.flow_editor.confirm.message.override"),et,Xe)){Y();return}}le()}k(tt);let j=!1;const te=()=>{j&&(j=!1,le())};A(V=>{V.filter(ue=>ue.type==="select").filter(ue=>!Me(ue.id)).sort((ue,Re)=>ue.selected===Re.selected?0:ue.selected?1:-1).forEach(ue=>{Z(ue.selected?ue.id:void 0)});let de=!1;V.forEach(ue=>{if(ue.type==="remove"){if(Me(ue.id))return;de=!0,U(ue.id,!1)}}),de&&!j&&(j=!0,queueMicrotask(te))}),_(({node:V,event:me})=>{if(!V)return;if(Me(V.id)){const ye=V.id;Ie(ye),H(void 0);const _e=ae.value.get(ye);if(!_e)return;const _t=_e.position??{...V.position},et=V.position.x-_t.x,Xe=V.position.y-_t.y;$e(ye,V.position,et,Xe);const Ge=ve.value.get(_e.ownerId);Ge&&Ae(Ge.id,!1);return}const de=V.id;Q("canvas"),Ie(de);const ue=V.parentNode;let Re={...V.position};if(ue&&Me(ue)){const ye=ae.value.get(ue);ye?.position&&(Re={x:ye.position.x+V.position.x,y:ye.position.y+V.position.y})}if(X(de,Re,!1),!hl(K(de))){const ye={x:Re.x,y:Re.y,width:V.dimensions?.width??0,height:V.dimensions?.height??0},_e=me&&"clientX"in me?P({x:me.clientX,y:me.clientY}):void 0,_t={x:ye.x+ye.width/2,y:ye.y+ye.height/2};H(_e??_t)}const Be=ue&&Me(ue)?ue:ve.value.get(de)?.id;Be&&Ae(Be,!1)}),b(({node:V})=>{if(!V)return;if(Ie(void 0),Me(V.id)){F();return}const me=V.id,de=V.parentNode;let ue={...V.position};if(de&&Me(de)){const Be=ae.value.get(de);Be?.position&&(ue={x:Be.position.x+V.position.x,y:Be.position.y+V.position.y})}X(me,ue,!1);const Re=de&&Me(de)?de:ve.value.get(me)?.id;Re&&Ae(Re,!1),ge(me),D(),F()}),C(V=>{V.filter(ue=>ue.type==="select").sort((ue,Re)=>ue.selected===Re.selected?0:ue.selected?1:-1).forEach(ue=>{ct(ue.id)||(Pb=ue.selected?ue.id:void 0,S(Re=>Re.map(Be=>Be.id!==ue.id||!Be.markerEnd?Be:Al({...Be,zIndex:ue.selected?1:void 0}))))});let de=!1;V.forEach(ue=>{if(ue.type==="remove"){if(ct(ue.id))return;de=!0,oe(ue.id,!1)}}),de&&!j&&(j=!0,queueMicrotask(te))}),x(({edge:V})=>{ct(V.id)||(Bf=V.id,S(me=>me.map(de=>de.id!==V.id?de:Al(de))))}),I(({edge:V})=>{ct(V.id)||(Bf=void 0,S(me=>me.map(de=>de.id!==V.id?de:Al(de))))}),w(({edge:V,connection:me})=>{ct(V.id)||(oe(V.id,!1),tt(me))});function fe(V){y({...Ke.value,...V})}async function ee(V){return Z(V),new Promise(me=>setTimeout(()=>{const de=h(V);B(de?[de]:[]),me()},0))}function ke(V){const me=T.value.filter(({type:Ge})=>Ge!=="group"),de=me.find(({id:Ge})=>Ge===V);if(!de)throw new Error(`Node ${V} not found`);const{x:ue,y:Re}=de.data.position,{width:Be,height:ye}=de.dimensions,_e=Re,_t=Re+ye,et=me.filter(({id:Ge})=>Ge!==V).filter(({data:{position:{y:Ge}},dimensions:{height:He}})=>Ge<_t&&Ge+He>_e).map(({data:{position:{x:Ge}},dimensions:{width:He}})=>({left:Ge,right:Ge+He})).sort((Ge,He)=>Ge.left-He.left);let Xe=ue+Be+c;for(const{left:Ge,right:He}of et)if(!(He<=Xe)){if(Xe+Be<=Ge)return{x:Xe,y:_e};Xe=Math.max(Xe,He)+c}return{x:Xe,y:_e}}function Je(V){if(!V)return;const me=h(V);if(!me)throw new Error(`Node ${V} not found`);const{position:{x:de},dimensions:{width:ue}}=me,Re=de+ue,{viewport:Be,dimensions:ye,setViewport:_e}=d,{x:_t,y:et,zoom:Xe}=Be.value,{width:Ge}=ye.value,He=de*Xe+_t,St=Re*Xe+_t,ut=Ge-jh-c;if(St<=ut)return;let Pt=ut-St;He+Pt<0&&(Pt=-He),Pt!==0&&_e({x:_t+Pt,y:et,zoom:Xe},{duration:XN})}function ge(V){if(!z.value)return!1;const{nodeId:me,branch:de}=LO(z.value),ue=M.addMember(me,de,V,{commit:!1});return H(void 0),ue}return{vueFlowStore:d,editorStore:f,readonly:i,nodes:q,edges:he,selectNode:ee,autoLayout:xe,placeToRight:ke,scrollRightToReveal:Je,fitViewParams:Ke,fitView:fe,groupDrop:{activeGroupId:z,startPanelDrag:()=>Q("panel"),endPanelDrag:D,updateActiveGroup:H,attachNodeToActiveGroup:ge}}});let ii=null;function AV(){if(ii)return ii;if(typeof navigator>"u")return ii="windows";const e=navigator.userAgentData?.platform||navigator.platform||navigator.userAgent;return/Mac|iPhone|iPad|iPod/i.test(e)?ii="mac":/Linux/i.test(e)&&!/Android/i.test(e)?ii="linux":ii="windows"}const IV={Shift:"⇧",Alt:"⌥",Ctrl:"⌃",Meta:"⌘",Mod:"⌘",Enter:"↩",ArrowUp:"↑",ArrowDown:"↓",ArrowLeft:"←",ArrowRight:"→",Tab:"⇥",Esc:"⎋",Space:"Space",Delete:"⌫"},vV={Shift:"Shift",Alt:"Alt",Ctrl:"Ctrl",Meta:"Win",Mod:"Ctrl",Enter:"Enter",ArrowUp:"Up",ArrowDown:"Down",ArrowLeft:"Left",ArrowRight:"Right",Tab:"Tab",Esc:"Esc",Space:"Spacebar",Delete:"Delete"},TV={Shift:"Shift",Alt:"Alt",Ctrl:"Ctrl",Meta:"Super",Mod:"Ctrl",Enter:"Enter",ArrowUp:"Up",ArrowDown:"Down",ArrowLeft:"Left",ArrowRight:"Right",Tab:"Tab",Esc:"Esc",Space:"Space",Delete:"Delete"};function OV(e,n={}){const r=n.platform??AV(),o=n.joiner??(r==="mac"?"":" + "),i=r==="mac"?IV:r==="linux"?TV:vV;return(Array.isArray(e)?e:e[r]).map(s=>s in i?i[s]:s).join(o)}const BV={key:0,class:"label"},PV={class:"keys"},Il=Pe(t.defineComponent({__name:"HotkeyLabel",props:{label:{},keys:{},reverse:{type:Boolean}},setup(e){const n=OV(e.keys);return(r,o)=>(t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["dk-hotkey-label",{reverse:e.reverse}])},[e.label?(t.openBlock(),t.createElementBlock("span",BV,t.toDisplayString(e.label),1)):t.createCommentVNode("",!0),t.createElementVNode("kbd",PV,t.toDisplayString(t.unref(n)),1)],2))}}),[["__scopeId","data-v-7ca86b0d"]]),VV=["onClick"],$V={key:0,class:"additional-count"},Vb=24,RV=16,vl=Pe(t.defineComponent({__name:"NodePortal",props:{expanded:{type:Boolean,default:()=>{}},reversed:{type:Boolean},targets:{}},setup(e){const n=Number.parseFloat(DN)||0,r={target:"body"},{portalSelection:o,selectPortalEdge:i}=It(),a=t.ref(!1),s=t.computed(()=>{const h=o.value;return h?e.targets.some(y=>y.edgeId===h):!1}),l=t.computed(()=>e.expanded!==void 0?e.expanded||s.value:a.value||s.value),c=()=>Vb*e.targets.length+n*(e.targets.length-1),d=t.computed(()=>({width:l.value?`${c()}px`:"fit-content"})),f=h=>{i(h)},u=h=>o.value===h,p=t.computed(()=>e.targets.map((h,y)=>{const m=(Vb+n)*y;return{edgeId:h.edgeId,key:`${h.node.id}-${h.fieldName??"node"}-${y}`,icon:sf(h.node.type).icon,tooltip:h.fieldName?`${h.node.name}.${h.fieldName}`:h.node.name,highlighted:u(h.edgeId),tooltipEl:null,style:y===0?{width:"fit-content",zIndex:e.targets.length}:{position:"absolute",...e.reversed?{left:`${m}px`,transform:l.value?"translateX(0)":`translateX(-${m}px)`}:{right:0,transform:l.value?`translateX(-${m}px)`:"translateX(0)"},zIndex:e.targets.length-y}}})),g=t.computed(()=>Math.max(e.targets.length-1,0));return(h,y)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["dk-node-portal",{expanded:l.value,reversed:e.reversed}]),onClick:y[0]||(y[0]=t.withModifiers(()=>{},["stop"])),onDragstart:y[1]||(y[1]=t.withModifiers(()=>{},["stop"])),onMousedown:y[2]||(y[2]=t.withModifiers(()=>{},["stop"])),onMouseenter:y[3]||(y[3]=m=>a.value=!0),onMouseleave:y[4]||(y[4]=m=>a.value=!1)},[t.createElementVNode("div",{class:"target-boxes",style:t.normalizeStyle(d.value)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p.value,(m,_)=>(t.openBlock(),t.createBlock(t.unref(be.KTooltip),{key:m.key,class:"target-box-wrapper","kpop-attributes":r,placement:"top",style:t.normalizeStyle(m.style),text:m.tooltip},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["target-box",{highlighted:m.highlighted}]),onClick:t.withModifiers(b=>f(m.edgeId),["stop"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(m.icon),{color:`var(--kui-color-text-neutral, ${t.unref(Wn)})`,size:RV},null,8,["color"])),_===0&&g.value>0?(t.openBlock(),t.createElementBlock("span",$V," +"+t.toDisplayString(g.value),1)):t.createCommentVNode("",!0)],10,VV)]),_:2},1032,["style","text"]))),128))],4)],34))}}),[["__scopeId","data-v-45ce7484"]]),Tl=Pe(t.defineComponent({__name:"HandleTwig",props:{color:{},position:{default:()=>kt.Position.Left},size:{default:()=>Number.parseFloat(Mh)},type:{}},setup(e){t.useCssVars(r=>({v64bbaf90:r.color}));const n=t.computed(()=>({width:`${e.size}px`,minWidth:`${e.size}px`}));return(r,o)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["handle-twig",[e.type,e.position===t.unref(kt.Position).Left?"left":"right"]]),style:t.normalizeStyle(n.value)},null,6))}}),[["__scopeId","data-v-74b600f2"]]),Pf=Pe(t.defineComponent({__name:"NodeBadge",props:{type:{},size:{},iconOnly:{type:Boolean}},setup(e){t.useCssVars(r=>({v3b4ea967:n.value.colors?.background,v00febd7c:n.value.colors?.foreground}));const n=t.computed(()=>sf(e.type));return(r,o)=>{const i=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(i,{appearance:"neutral",class:t.normalizeClass(["dk-node-badge",{"icon-only":e.iconOnly,"has-colors":!!n.value.colors}]),size:e.size},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(e.type),1)]),_:2},[n.value?.icon?{name:"icon",fn:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.value.icon)))]),key:"0"}:void 0]),1032,["class","size"])}}}),[["__scopeId","data-v-409d29e5"]]),LV={class:"body"},FV={class:"name"},DV={class:"handle"},MV={class:"handle-label-wrapper"},UV={class:"handle-label-wrapper"},jV={class:"handle-label text"},KV={class:"handle"},qV={class:"handle-label-wrapper"},GV={class:"handle-label-wrapper"},zV={class:"handle-label text"},HV={key:2,class:"branch-handles"},WV={class:"handle-label-wrapper"},YV={class:"handle-label text"},$b=Pe(t.defineComponent({__name:"FlowNode",props:{data:{},error:{type:Boolean},readonly:{type:Boolean}},setup(e){const n=t.useSlots(),{t:r}=Vt.createI18n("en-us",Lt),o=xV(),{getInEdgesByNodeId:i,getOutEdgesByNodeId:a,getNodeById:s,toggleExpanded:l,duplicateNode:c,removeNode:d,propertiesPanelOpen:f,branchGroups:u}=It(),p=t.computed(()=>ni(e.data.type)),g=t.computed(()=>e.data.fields.input.length>0),h=t.computed(()=>e.data.fields.output.length>0),y=t.computed(()=>g.value&&i(e.data.id).every(se=>se.targetField===void 0)),m=t.computed(()=>h.value&&a(e.data.id).every(se=>se.sourceField===void 0)),_=t.computed(()=>e.data.expanded.input??!1),b=t.computed(()=>e.data.expanded.output??!1),k=t.computed(()=>p.value.io?.next?.branches?.map(({name:se})=>se)??[]),A=t.computed(()=>k.value.length>0),C=t.computed(()=>u.findMembership(e.data.id)),w=t.computed(()=>{if(e.data.type==="property"){const se=e.data.config?.property;return rf(se)}return p.value.io?.input}),x=t.computed(()=>{if(e.data.type==="property"){const se=e.data.config?.property;return nf(se)}return p.value.io?.output}),I=t.computed(()=>hl(e.data)),T=t.computed(()=>e.data.phase==="response"),v=t.computed(()=>e.data.phase==="request"?kt.Position.Left:kt.Position.Right),S=t.computed(()=>e.data.phase==="request"?kt.Position.Right:kt.Position.Left),B=t.computed(()=>e.data.phase==="request"?kt.Position.Right:kt.Position.Left),P=t.computed(()=>hl(e.data)?r(`plugins.free-form.datakit.flow_editor.node_types.${e.data.type}.name`):e.data.name),R=t.computed(()=>I.value?xN:AN);function F(se){return se==="input"?T.value:!T.value}function X(se){const M=new Map,le=se==="input"?i(e.data.id):a(e.data.id);for(const Y of le){const ae=s(se==="input"?Y.source:Y.target);if(!ae)continue;if(se==="input"){const ce=ae.type==="vault",re=ae.phase!==e.data.phase,Oe=u.isEdgeEnteringGroup(ae.id,e.data.id);if(!(ce||re||Oe))continue}else{const ce=ae.phase!==e.data.phase,re=u.isEdgeEnteringGroup(e.data.id,ae.id);if(!(ce||re))continue}const Me=se==="input"?Y.targetField||"input":Y.sourceField||"output";let Ee;se==="input"&&Y.sourceField?Ee=ae.fields.output.find(re=>re.id===Y.sourceField)?.name:se==="output"&&Y.targetField&&(Ee=ae.fields.input.find(re=>re.id===Y.targetField)?.name);const Ue={edgeId:Y.id,node:ae,fieldName:Ee},Ie=M.get(Me);Ie?Ie.push(Ue):M.set(Me,[Ue])}return M}const Z=t.computed(()=>X("input")),U=t.computed(()=>X("output"));function K(se){!o||o.readonly||se==="input"&&!y.value||se==="output"&&!m.value||l(e.data.id,se)}async function L(){if(!o||o.readonly)return;const se=c(e.data.id,o.placeToRight(e.data.id));await o.selectNode(se),o.scrollRightToReveal(se),f.value=!0}function oe(){u.removeMember(e.data.id)}return t.watch(y,se=>{se||l(e.data.id,"input",!0,!0,"*")},{immediate:!0}),t.watch(m,se=>{se||l(e.data.id,"output",!0,!0,"*")},{immediate:!0}),t.watch(()=>e.data.fields.input,(se,M)=>{yn(se,M)||l(e.data.id,"input",se.length>0,!0,"*")},{deep:!0}),t.watch(()=>e.data.fields.output,(se,M)=>{yn(se,M)||l(e.data.id,"output",se.length>0,!0,"*")},{deep:!0}),(se,M)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["dk-flow-node",{reversed:T.value,implicit:I.value,readonly:e.readonly}])},[t.createElementVNode("div",LV,[I.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(be.KTooltip),{key:0,class:"badge",placement:"top",text:e.data.type},{default:t.withCtx(()=>[t.createVNode(Pf,{"icon-only":"",size:"small",type:e.data.type},null,8,["type"])]),_:1},8,["text"])),t.createElementVNode("div",FV,t.toDisplayString(P.value),1),e.error?(t.openBlock(),t.createBlock(t.unref(Se.WarningIcon),{key:1,class:"error-icon",color:`var(--kui-color-text-danger, ${t.unref(Rh)})`,size:16},null,8,["color"])):t.createCommentVNode("",!0),n.actions?t.renderSlot(se.$slots,"actions",{data:e.data},void 0,!0,2):I.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(be.KDropdown),{key:3,class:"menu",disabled:e.readonly,"kpop-attributes":{offset:"4px",target:"body",popoverClasses:"dk-flow-node-menu"},width:"160",onClick:M[1]||(M[1]=t.withModifiers(()=>{},["stop"]))},{items:t.withCtx(()=>[t.createVNode(t.unref(be.KDropdownItem),{onClick:L},{default:t.withCtx(()=>[t.createVNode(Il,{keys:t.unref(nl).duplicate,label:t.unref(r)("plugins.free-form.datakit.flow_editor.actions.duplicate")},null,8,["keys","label"])]),_:1}),C.value?(t.openBlock(),t.createBlock(t.unref(be.KDropdownItem),{key:0,onClick:oe},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("plugins.free-form.datakit.flow_editor.actions.remove_from_branch")),1)]),_:1})):t.createCommentVNode("",!0),t.createVNode(t.unref(be.KDropdownItem),{danger:"",onClick:M[0]||(M[0]=le=>t.unref(d)(e.data.id))},{default:t.withCtx(()=>[t.createVNode(Il,{keys:t.unref(nl).delete,label:t.unref(r)("plugins.free-form.datakit.flow_editor.actions.delete")},null,8,["keys","label"])]),_:1})]),default:t.withCtx(()=>[t.createVNode(t.unref(be.KButton),{appearance:"tertiary",class:"menu-trigger",icon:"",size:"small"},{default:t.withCtx(()=>[t.createVNode(t.unref(Se.MoreIcon),{color:`var(--kui-color-text, ${t.unref(Cu)})`},null,8,["color"])]),_:1})]),_:1},8,["disabled"]))]),n["before-handles"]?t.renderSlot(se.$slots,"before-handles",{data:e.data},void 0,!0,0):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["handles",{reversed:T.value}])},[w.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["input-handles",{"has-fields":g.value}])},[t.createElementVNode("div",DV,[t.createVNode(t.unref(kt.Handle),{id:"input",position:v.value,type:"target"},null,8,["position"]),Z.value.has("input")?(t.openBlock(),t.createBlock(vl,{key:0,mode:"input",reversed:F("input"),targets:Z.value.get("input")},null,8,["reversed","targets"])):t.createCommentVNode("",!0),t.createElementVNode("div",MV,[t.createElementVNode("div",{class:t.normalizeClass(["handle-label trigger",{collapsible:y.value}]),onClick:M[2]||(M[2]=t.withModifiers(le=>K("input"),["stop"]))},[M[4]||(M[4]=t.createElementVNode("div",{class:"text"}," inputs ",-1)),g.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[_.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(Se.UnfoldMoreIcon),{key:0,size:`var(--kui-icon-size-20, ${t.unref(zo)})`},null,8,["size"])),_.value?(t.openBlock(),t.createBlock(t.unref(Se.UnfoldLessIcon),{key:1,color:y.value?void 0:`var(--kui-color-text-disabled, ${t.unref(Fh)})`,size:`var(--kui-icon-size-20, ${t.unref(zo)})`},null,8,["color","size"])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0)],2),g.value&&_.value?(t.openBlock(),t.createBlock(Tl,{key:0,color:R.value,position:v.value,type:"bar"},null,8,["color","position"])):t.createCommentVNode("",!0)])]),g.value&&_.value?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(e.data.fields.input,(le,Y)=>(t.openBlock(),t.createElementBlock("div",{key:`inputs-${le.id}`,class:"handle indented"},[t.createVNode(t.unref(kt.Handle),{id:`inputs@${le.id}`,position:v.value,type:"target"},null,8,["id","position"]),Z.value.has(le.id)?(t.openBlock(),t.createBlock(vl,{key:0,mode:"input",reversed:F("input"),targets:Z.value.get(le.id)},null,8,["reversed","targets"])):t.createCommentVNode("",!0),t.createElementVNode("div",UV,[t.createElementVNode("div",jV,t.toDisplayString(le.name),1),t.createVNode(Tl,{color:R.value,position:v.value,type:Y<e.data.fields.input.length-1?"trident":"corner"},null,8,["color","position","type"])])]))),128)):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0),x.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["output-handles",{"has-fields":h.value}])},[t.createElementVNode("div",KV,[t.createElementVNode("div",qV,[t.createElementVNode("div",{class:t.normalizeClass(["handle-label trigger",{collapsible:m.value}]),onClick:M[3]||(M[3]=t.withModifiers(le=>K("output"),["stop"]))},[M[5]||(M[5]=t.createElementVNode("div",{class:"text"}," outputs ",-1)),h.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[b.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(Se.UnfoldMoreIcon),{key:0,size:`var(--kui-icon-size-20, ${t.unref(zo)})`},null,8,["size"])),b.value?(t.openBlock(),t.createBlock(t.unref(Se.UnfoldLessIcon),{key:1,color:m.value?void 0:`var(--kui-color-text-disabled, ${t.unref(Fh)})`,size:`var(--kui-icon-size-20, ${t.unref(zo)})`},null,8,["color","size"])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0)],2),h.value&&b.value?(t.openBlock(),t.createBlock(Tl,{key:0,color:R.value,position:S.value,type:"bar"},null,8,["color","position"])):t.createCommentVNode("",!0)]),t.createVNode(t.unref(kt.Handle),{id:"output",position:S.value,type:"source"},null,8,["position"]),U.value.has("output")?(t.openBlock(),t.createBlock(vl,{key:0,mode:"output",reversed:F("output"),targets:U.value.get("output")},null,8,["reversed","targets"])):t.createCommentVNode("",!0)]),h.value&&b.value?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(e.data.fields.output,(le,Y)=>(t.openBlock(),t.createElementBlock("div",{key:`outputs-${le.id}`,class:"handle indented"},[t.createElementVNode("div",GV,[t.createElementVNode("div",zV,t.toDisplayString(le.name),1),t.createVNode(Tl,{color:R.value,position:S.value,type:Y<e.data.fields.output.length-1?"trident":"corner"},null,8,["color","position","type"])]),t.createVNode(t.unref(kt.Handle),{id:`outputs@${le.id}`,position:S.value,type:"source"},null,8,["id","position"]),U.value.has(le.id)?(t.openBlock(),t.createBlock(vl,{key:0,mode:"output",reversed:F("output"),targets:U.value.get(le.id)},null,8,["reversed","targets"])):t.createCommentVNode("",!0)]))),128)):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0),A.value?(t.openBlock(),t.createElementBlock("div",HV,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(k.value,le=>(t.openBlock(),t.createElementBlock("div",{key:`branch-${le}`,class:"handle"},[t.createElementVNode("div",WV,[t.createElementVNode("div",YV,t.toDisplayString(le),1)]),t.createVNode(t.unref(kt.Handle),{id:`branch@${le}`,connectable:!1,position:B.value,type:"source"},null,8,["id","position"])]))),128))])):t.createCommentVNode("",!0)],2),n["after-handles"]?t.renderSlot(se.$slots,"after-handles",{data:e.data},void 0,!0,1):t.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-1de3b7cb"]]),JV=Pe(t.defineComponent({__name:"GroupNode",props:{data:{},active:{type:Boolean}},setup(e){const n=e,r=t.computed(()=>n.data.phase==="response"),o=t.computed(()=>r.value?kt.Position.Right:kt.Position.Left);return(i,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["dk-branch-group-node",{reversed:r.value,"drop-target":e.active}])},[t.createVNode(t.unref(kt.Handle),{id:"input",connectable:!1,position:o.value,type:"target"},null,8,["position"])],2))}}),[["__scopeId","data-v-cf30ffea"]]),Vf=Pe(t.defineComponent({__name:"FlowCanvas",props:{flowId:{},phase:{},mode:{}},emits:["initialized","nodes-change","node-click"],setup(e,{expose:n,emit:r}){const o=t.useSlots(),i=r,a=t.useTemplateRef("flowCanvas"),s=At.useElementBounding(a),{i18n:{t:l}}=Ye(),c=t.computed(()=>{const Ee=e.mode==="edit"||e.mode==="inspect";return{panOnDrag:Ee?void 0:!1,panOnScroll:Ee?void 0:!1,zoomOnDoubleClick:Ee?void 0:!1,zoomOnPinch:Ee?void 0:!1,zoomOnScroll:Ee?void 0:!1}}),{vueFlowStore:d,editorStore:f,autoLayout:u,fitViewParams:p,fitView:g,selectNode:h,placeToRight:y,scrollRightToReveal:m,groupDrop:_}=SV({phase:e.phase,flowId:e.flowId,layoutOptions:{viewport:{width:s.width,height:s.height}},readonly:e.mode!=="edit"}),{addNode:b,propertiesPanelOpen:k,invalidConfigNodeIds:A,selectedNode:C,duplicateNode:w,commit:x,selectPortalEdge:I}=f,{screenToFlowCoordinate:T,zoomIn:v,zoomOut:S,viewport:B,maxZoom:P,minZoom:R}=d,{activeGroupId:F,startPanelDrag:X,endPanelDrag:Z,updateActiveGroup:U,attachNodeToActiveGroup:K}=_;function L(Ee){const Ue=Ee.dataTransfer?.types.find(Ie=>Ie.startsWith(`${ha}/`));if(Ue)return Ue.replace(`${ha}/`,"")}function oe(Ee){if(e.mode==="inspect"){if(Ee?.node?.type==="group")return;i("node-click",Ee.node.data);return}if(e.mode==="edit"){if(Ee?.node?.type==="group"){h(void 0),I(void 0);return}k.value=!0}}function se(Ee){e.mode==="edit"&&(Ee.preventDefault(),U(T({x:Ee.clientX,y:Ee.clientY})))}function M(Ee){if(e.mode!=="edit")return;const Ue=Ee.dataTransfer?.getData(ha);if(!Ue)return;Ee.preventDefault();const Ie=JSON.parse(Ue);if(Ie.action!=="create-node")return;const ce=T({x:Ee.clientX,y:Ee.clientY}),{type:re,anchor:Oe}=Ie.data,ve={type:re,phase:e.phase,position:{x:ce.x-Oe.offsetX,y:ce.y-Oe.offsetY}},je=b(ve,!1);if(!je){Z();return}K(je),x(),h(je),k.value=!0,Z()}async function le(){i("initialized"),e.mode==="inspect"&&setTimeout(async()=>{await u(!1),setTimeout(()=>g(),0)},0)}async function Y(){await u(),setTimeout(()=>g(),0)}const ae=t.computed(()=>{if(e.mode==="preview")return[];const Ee=[{name:"zoom_in",icon:Se.AddIcon,action:v,disabled:B.value.zoom>=P.value},{name:"zoom_out",icon:Se.RemoveIcon,action:S,disabled:B.value.zoom<=R.value},{name:"fit_view",icon:Se.FullscreenIcon,action:g}];return e.mode==="edit"&&Ee.push({name:"auto_layout",icon:Se.AutoLayoutIcon,action:Y}),Ee});e.mode==="edit"&&(At.useEventListener("dragstart",Ee=>{L(Ee)&&X()}),At.useEventListener("dragend",()=>{Z()}));async function Me(){const Ee=C.value;if(e.mode!=="edit"||!Ee||Ee.phase!==e.phase)return;const Ue=w(Ee.id,y(Ee.id));Ue&&(await h(Ue),k.value=!0,m(Ue))}return $h({enabled:t.computed(()=>!!C.value&&e.mode==="edit"&&C.value.phase===e.phase),duplicate:Me}),n({autoLayout:u,fitView:g}),(Ee,Ue)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"flowCanvas",ref:a,class:"dk-flow-canvas"},[t.createVNode(t.unref(kt.VueFlow),t.mergeProps({id:e.flowId,class:["flow",{readonly:e.mode!=="edit",inspect:e.mode==="inspect"}]},c.value,{"connect-on-click":!1,"elements-selectable":e.mode==="edit"||e.mode==="inspect","max-zoom":t.unref(YN),"min-zoom":t.unref(JN),"multi-selection-key-code":null,"nodes-connectable":e.mode==="edit","nodes-draggable":e.mode==="edit",onDragover:se,onDrop:M,onNodeClick:oe,onNodesChange:Ue[0]||(Ue[0]=Ie=>i("nodes-change")),onNodesInitialized:le}),{"node-flow":t.withCtx(({data:Ie})=>[t.createVNode($b,{data:Ie,error:t.unref(A).has(Ie.id),readonly:e.mode!=="edit"},t.createSlots({_:2},[o["node-before-handles"]?{name:"before-handles",fn:t.withCtx(()=>[t.renderSlot(Ee.$slots,"node-before-handles",{data:Ie},void 0,!0)]),key:"0"}:void 0,o["node-actions"]?{name:"actions",fn:t.withCtx(()=>[t.renderSlot(Ee.$slots,"node-actions",{data:Ie},void 0,!0)]),key:"1"}:void 0,o["node-after-handles"]?{name:"after-handles",fn:t.withCtx(()=>[t.renderSlot(Ee.$slots,"node-after-handles",{data:Ie},void 0,!0)]),key:"2"}:void 0]),1032,["data","error","readonly"])]),"node-group":t.withCtx(({data:Ie})=>[t.createVNode(JV,{active:t.unref(F)===Ie.id,data:Ie},null,8,["active","data"])]),default:t.withCtx(()=>[t.createVNode(t.unref(yN.Background)),t.createVNode(t.unref(Th.Controls),{"fit-view-params":t.unref(p),position:"bottom-left","show-fit-view":!1,"show-interactive":!1,"show-zoom":!1},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ae.value,Ie=>(t.openBlock(),t.createBlock(t.unref(be.KTooltip),{key:Ie.name,placement:"right",text:t.unref(l)(`plugins.free-form.datakit.flow_editor.actions.${Ie.name}`)},{default:t.withCtx(()=>[t.createVNode(t.unref(Th.ControlButton),{disabled:Ie.disabled,onClick:t.withModifiers(Ie.action,["stop"])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(Ie.icon),{size:18}))]),_:2},1032,["disabled","onClick"])]),_:2},1032,["text"]))),128))]),_:1},8,["fit-view-params"])]),_:3},16,["id","class","elements-selectable","max-zoom","min-zoom","nodes-connectable","nodes-draggable"])],512))}}),[["__scopeId","data-v-11561a7e"]]);function Rb(){const e=["methods","logout_methods"];return{setFieldType:(f,u,p)=>{if(!(!f||!u||!p))switch(p.type){case"boolean":f[u]={type:pe.ConfigurationSchemaType.BadgeStatus,...f[u]};break;case"string":p.encrypted?f[u]={type:pe.ConfigurationSchemaType.Redacted,...f[u]}:f[u]={type:pe.ConfigurationSchemaType.Text,...f[u]};break;case"set":p.elements?.type==="string"&&(f[u]={type:pe.ConfigurationSchemaType.BadgeTag,...f[u]});break;case"array":e.includes(u)?f[u]={type:pe.ConfigurationSchemaType.BadgeMethod,...f[u]}:p.elements?.type==="string"?p.encrypted?f[u]={type:pe.ConfigurationSchemaType.RedactedArray,...f[u]}:f[u]={type:pe.ConfigurationSchemaType.BadgeTag,...f[u]}:p.elements?.type==="record"&&(f[u]={type:pe.ConfigurationSchemaType.Json,...f[u]});break;case"record":f[u]={type:pe.ConfigurationSchemaType.Json,...f[u]};break;default:f[u]={type:pe.ConfigurationSchemaType.Text,...f[u]};break}},convertToDotNotation:f=>f.replace(/-/g,"."),unFlattenObject:f=>{const u={};for(const p in f){const g=p.split(".");g.reduce((h,y,m)=>h[y]||(h[y]=isNaN(g[m+1])?g.length-1===m?f[p]:{}:[]),u)}return u},dismissField:(f,u,p="redis",g=!1)=>{const h=new RegExp("(?<=-redis-).*");if(typeof f!="object"||f===null)return f;p==="redis"?Object.keys(f).forEach(y=>{y.match(h)&&delete f[y]}):g?f[p]=null:delete f[p],Object.assign(f,u)},isObjectEmpty:f=>Object.keys(f).length===0,unsetNullForeignKey:(f,u)=>{["service.id","route.id","consumer.id","consumer_group.id"].indexOf(f)>-1&&u[f]===null&&(delete u[f],u[f.replace(".id","")]=null)},formatPluginFieldLabel:f=>f.replace(/_/g," ").split("-").map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("-"),getTallestPluginCardHeight:f=>{let u=0;if(f.length)for(let p=0;p<f.length;p++){const g=f[p].$el;u=g.offsetHeight>u?g.offsetHeight:u}return u},getToggleVisibility:(f,u)=>{if(f&&u){const p=window?.getComputedStyle(f)?.getPropertyValue("grid-template-columns")?.split(" ").length;return u>p}return!0}}}const XV=["basic-auth","key-auth","key-auth-enc","oauth2","hmac-auth","jwt","acl"];var Ol=(e=>(e.REDIS_CE="redis-ce",e.REDIS_EE="redis-ee",e))(Ol||{});const Bl=["Featured"],$f=[W.PluginGroup.AUTHENTICATION,W.PluginGroup.AI,W.PluginGroup.SECURITY,W.PluginGroup.TRAFFIC_CONTROL,W.PluginGroup.SERVERLESS,W.PluginGroup.ANALYTICS_AND_MONITORING,W.PluginGroup.TRANSFORMATIONS,W.PluginGroup.LOGGING,W.PluginGroup.DEPLOYMENT,W.PluginGroup.WEBSOCKET,W.PluginGroup.MONETIZATION,W.PluginGroup.CUSTOM_PLUGINS],Pl=[W.PluginGroup.AI,W.PluginGroup.ANALYTICS_AND_MONITORING,W.PluginGroup.AUTHENTICATION,W.PluginGroup.LOGGING,W.PluginGroup.MONETIZATION,W.PluginGroup.SECURITY,W.PluginGroup.SERVERLESS,W.PluginGroup.TRAFFIC_CONTROL,W.PluginGroup.TRANSFORMATIONS,W.PluginGroup.CUSTOM_PLUGINS];var go=(e=>(e.SERVICE="service_id",e.ROUTE="route_id",e.CONSUMER="consumer_id",e.CONSUMER_GROUP="consumer_group_id",e))(go||{});const ho=e=>{const n=Object.fromEntries(e.fields.map(r=>Object.entries(r)[0]));return"id"in n||(n.id={}),n},yo={label:"Tags",name:"tags",type:"input",inputType:"text",valueType:"array",valueArrayType:"string",placeholder:"Enter list of tags",help:"An optional set of strings for grouping and filtering, separated by commas.",hint:"e.g. tag1, tag2, tag3"},ai={getColumnFields:ho,tags:yo,id:{label:"ID"},enabled:{label:"Enabled",indexed:!0,type:"boolean"},created_at:{label:"Created"},updated_at:{label:"Last updated"},fields:{arrayItems(e){const n=e.inputAttributes||{};return delete e.inputAttributes,{type:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"kong-form-array-field",fieldItemsClasses:"kong-form-array-field-item",newElementButtonLabelClasses:"kong-form-new-element-button-label",inputAttributes:{class:"form-control",style:{minWidth:"200px"},...n},removeElementButtonLabel:"remove",styleClasses:"kong-form-field-wrapper",inputType:"text",valueType:"array",valueArrayType:"string",...e}}}},Lb={fields:[{group:{hint:"The arbitrary group name to associate to the consumer."}},{tags:yo}]},ZV={fields:[{id:{uuid:!0,type:"string",auto:!0}},{created_at:{auto:!0,timestamp:!0,type:"integer"}},{consumer:{reference:"consumers",type:"foreign",on_delete:"cascade",required:!0}},{group:{required:!0,type:"string",hint:"The arbitrary group name to associate to the consumer."}},{tags:{elements:{type:"string",required:!0},type:"set"}}]},Fb={fields:[{username:{}},{password:{inputType:"password"}},{tags:yo}]},QV={fields:[{id:{uuid:!0,type:"string",auto:!0}},{created_at:{auto:!0,timestamp:!0,type:"integer"}},{consumer:{reference:"consumers",type:"foreign",on_delete:"cascade",required:!0}},{username:{required:!0,type:"string",unique:!0}},{password:{type:"string",required:!0,encrypted:!0}},{tags:{elements:{type:"string",required:!0},type:"set"}}]},Db=t.defineComponent({name:"KeyAuthIdentityRealmsBase",__name:"Base",props:t.mergeModels({realms:{}},{modelValue:{default:()=>[{scope:"cp",id:null,region:null}]},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const n=e,r=t.useModel(e,"modelValue"),{i18n:o}=rt.useI18n(),{t:i}=o,a={value:"current-cp",label:i("custom_field.key_auth_identity_realms.cp_label"),group:i("custom_field.key_auth_identity_realms.cp_group_label")},s=t.inject(We.FORMS_CONFIG),{axiosInstance:l}=pe.useAxios(s?.axiosRequestConfig),c=()=>{if(s?.app==="konnect"){const h=/\b(us|eu|au|me|in|sg)\b/.exec(s?.apiBaseUrl||"");if(h)return{region:h[1]}}return{}},d=t.ref(!0),f=t.ref([a]),u=async()=>{if(s?.app==="konnect")try{d.value=!0;let h=`${s?.apiBaseUrl}/v1/realms`;const y=[];do{const m=await l.get(h);m&&m.data&&m.data.data&&y.push(...m.data.data.map(_=>({value:_.id,label:_.name,group:i("custom_field.key_auth_identity_realms.realm_group_label")}))),h=m.data.meta.next?`${s?.apiBaseUrl}${m.data.meta.next}`:null}while(h);f.value=[a,...y]}catch(h){console.error("Failed to fetch Konnect realms",h)}finally{d.value=!1}},p=t.computed(()=>r.value.map(h=>h.id||"current-cp")),g=h=>{const y=h.includes("current-cp")?[{scope:"cp",id:null,region:null}]:[],m=r.value.filter(({scope:C})=>C!=="cp").map(({id:C})=>C),_=h.filter(C=>C!=="current-cp"),A=(m.length!==_.length||m.some(C=>!_.includes(C))?_.filter(C=>!m.includes(C)):_).map(C=>({...c(),scope:"realm",id:C}));r.value=[...y,...A]};return t.onMounted(()=>{n.realms===void 0&&u()}),t.watch(()=>n.realms,h=>{h&&(f.value=[a,...h.map(y=>({...y,group:i("custom_field.key_auth_identity_realms.realm_group_label")}))],d.value=!1)},{immediate:!0}),(h,y)=>{const m=t.resolveComponent("KMultiselect");return t.openBlock(),t.createBlock(m,{items:f.value,loading:d.value,"model-value":p.value,"onUpdate:modelValue":g},null,8,["items","loading","model-value"])}}}),e$={class:"field-wrapper"},t$=Pe(t.defineComponent({__name:"VfgAdapter",props:{disabled:{type:Boolean},formOptions:{},model:{},schema:{},vfg:{},errors:{},hint:{}},emits:["modelUpdated"],setup(e,{expose:n,emit:r}){const o=e,i=r,{clearValidationErrors:a,value:s}=We.composables.useAbstractFields({model:t.toRef(()=>o.model),schema:o.schema,formOptions:o.formOptions,emitModelUpdated:l=>{i("modelUpdated",l.value,l.model)}});return n({clearValidationErrors:a}),(l,c)=>(t.openBlock(),t.createElementBlock("div",e$,[t.createVNode(Db,{modelValue:t.unref(s),"onUpdate:modelValue":c[0]||(c[0]=d=>t.isRef(s)?s.value=d:null)},null,8,["modelValue"])]))}}),[["__scopeId","data-v-269e85ed"]]),Mb={fields:[{key:{submitWhenNull:!1,hint:`You can optionally set your own unique key to authenticate the
3
+ will extend the wait time by about 12 minutes, continuously adjusting as new requests are made.`}}},custom_key:{expression_placeholder:"e.g. principal.metadata.ff_id ? principal.metadata.ff_id : principal.id",expression_help:{text:"Define a Kong plug-in dynamic expression to determine the counter key for each request. The expression must return a string. {link}",learn:"Learn more"}}},custom_plugin_form:{step1:{title:"Custom plugin type",types:{installed:{label:"Installed custom plugin",description:"Install and manage plugins with full control over deployment and runtime. Requires restarting data planes."},streamed:{label:"Streamed custom plugin",description:"Deploy and update plugins on running data planes without requiring gateway access."},cloned:{label:"Cloned plugin",description:"Duplicate an existing plugin to run multiple instances within a single request."}},compare_trigger:"Compare deployment options",compare_table:{columns:{installed:"Installed custom plugin",streamed:"Streamed custom plugin",cloned:"Cloned plugin"},rows:{main_use_case:{header:"Main use case",installed:"Extend Kong functionality with custom plugins and control who can modify and roll out changes.",streamed:"Extend Kong functionality with plugins without requiring sysadmin access to data plane instances.",cloned:"Modify an existing plugin to run multiple instances with different names or priorities."},file_supplied:{header:"File supplied",installed:{handler:"handler.lua",schema:"schema.lua",additional:"Any additional files or libraries needed"},streamed:{handler:"handler.lua",schema:"schema.lua"}},how_installed:{header:"How it's installed",installed:"Install directly on the data plane",streamed:"Through gateway configuration changes",cloned:"Through gateway configuration changes"},sandboxing:{header:"Sandboxing",streamed:"Follows the standard sandboxing settings. {link}",streamed_link:"Link to docs",cloned:"Inherit the same sandboxing as the original plugins"},data_plane_reload:{header:"Data plane reload"}}}},step2_files:{title:"Custom plugin files",schema_file:{label:"Upload schema file",placeholder:"No file selected",placeholder_edit:"File not changed",button_text:"Select File",help:{text:"Only Lua based schemas are supported by Konnect. Other plugin modules can be in any language as desired. {link}",link:"Learn more"}},handler_file:{label:"Upload handler file",placeholder:"No file selected",placeholder_edit:"File not changed",button_text:"Select File",help:"Upload plugin handler to the data plane."},plugin_modules:{label:"Plugin modules",alert:"Upload all plugin modules to the data plane: schema.lua, handler.lua"},streaming_enabled:{alert:"Each data plane node must run with KONG_CUSTOM_PLUGIN_STREAMING_ENABLED=true. Otherwise, Kong Gateway removes this plugin from the node's configuration. {link}",alert_link:"Learn more"}},step2_clone:{title:"Clone plugin",select_plugin:{label:"Select a plugin",placeholder:"Type to search"}},step3:{title:"General information",description:"Enter a custom name for this custom plugin",name:{label:"Name",placeholder:"Enter a unique name",help:"The name must be identical to the name of the plugin in the schema file."},alias_name:{label:"Alias name",placeholder:"Enter a unique name",help:"Format: ^[a-z][a-z0-9-]*[a-z0-9]$. The name must be unique enough to avoid future conflicts with bundled plugins."},priority:{label:"Priority",tooltip:"Set the execution priority for this cloned plugin",help:{text:"Optional. Use a number to set the absolute execution priority. If priority isn't set, plugins run in alphabetical order. {link} in the docs.",link:"Learn more"}}},errors:{file_read_error:"Failed to read file content. Please try again.",file_too_large:"File size exceeds the maximum limit of 1 MB.",plugin_not_found:"The selected plugin could not be found. Please refresh the list and try again.",no_supported_types:"No supported custom plugin types are available in this context.",unsupported_plugin_type:"Unsupported plugin type {type}."}}};function Ye(){const e=Vt.createI18n("en-us",Lt);return{i18n:e,i18nT:Vt.i18nTComponent(e)}}const wN=["undo","redo","duplicate","cut","copy","paste"],Vh=()=>{};function kN(e){const n=e;return n?!!n.closest('input, textarea, [contenteditable]:not([contenteditable="false"])'):!1}function CN(e){if(!(e.metaKey||e.ctrlKey))return;switch(e.key.toLowerCase()){case"z":return e.shiftKey?"redo":"undo";case"y":return"redo";case"d":return"duplicate";case"x":return"cut";case"c":return"copy";case"v":return"paste"}}const EN=At.createSharedComposable(()=>{const e=new Set;At.useEventListener("keydown",r=>{if(kN(r.target))return;const o=CN(r);if(o)for(const i of e){if(!t.toValue(i.enabled))continue;const a=i[o];if(a){if(r.defaultPrevented){t.warn(`[useHotkeys] event for "${o}" was already defaultPrevented. Hotkey ignored.`);return}r.preventDefault(),a();return}}},{passive:!1});function n(r){if(!wN.some(i=>typeof r[i]=="function"))return Vh;const o={enabled:r.enabled??!0,...r};return e.add(o),()=>e.delete(o)}return{subscribe:n}});function $h(e={}){if(typeof window>"u")return Vh;const n=EN().subscribe(e);return t.onScopeDispose(n),n}const NN="#ecfcff",SN="#f1f0ff",xN="#52596e",AN="#e0e4ea",IN="#007d60",vN="#fffce0",TN="#6c7489",ON="#0044f4",BN="#5f9aff",Cu="#0d0e14",Rh="#d60027",PN="#00abd2",Lh="#6f28ff",Fh="#afb7c5",Wn="#6c7489",VN="#0044f4",$N="#eefaff",Dh="#007d60",RN="#ecfffb",LN="#995c00",FN="#306fff",zo="12px",Cn="16px",oo="20px",Eu="24px",DN="2px",Mh="8px",MN="32px",Uh=44,UN=220,jh=366,jN=1e3,KN=Uh+parseFloat(Mh),tl=1,qN=0,GN=1,zN=2,HN=3,Ho=parseInt(MN,10),ha="application/x-datakit+json",nl={delete:["Delete"],undo:["Mod","Z"],redo:{mac:["Mod","Shift","Z"],windows:["Mod","Y"],linux:["Mod","Shift","Z"]},copy:["Mod","C"],paste:["Mod","V"],duplicate:["Mod","D"]},Mr={padding:80,gaps:{nodes:60,edges:80,ranks:60}},WN=1600,YN=1.2,JN=0,XN=200,Kh=Symbol("confirm-modal");var qh=typeof global=="object"&&global&&global.Object===Object&&global,ZN=typeof self=="object"&&self&&self.Object===Object&&self,Yn=qh||ZN||Function("return this")(),En=Yn.Symbol,Gh=Object.prototype,QN=Gh.hasOwnProperty,eS=Gh.toString,ya=En?En.toStringTag:void 0;function tS(e){var n=QN.call(e,ya),r=e[ya];try{e[ya]=void 0;var o=!0}catch{}var i=eS.call(e);return o&&(n?e[ya]=r:delete e[ya]),i}var nS=Object.prototype,rS=nS.toString;function oS(e){return rS.call(e)}var iS="[object Null]",aS="[object Undefined]",zh=En?En.toStringTag:void 0;function io(e){return e==null?e===void 0?aS:iS:zh&&zh in Object(e)?tS(e):oS(e)}function Jn(e){return e!=null&&typeof e=="object"}var sS="[object Symbol]";function Nu(e){return typeof e=="symbol"||Jn(e)&&io(e)==sS}function Su(e,n){for(var r=-1,o=e==null?0:e.length,i=Array(o);++r<o;)i[r]=n(e[r],r,e);return i}var Rn=Array.isArray,Hh=En?En.prototype:void 0,Wh=Hh?Hh.toString:void 0;function Yh(e){if(typeof e=="string")return e;if(Rn(e))return Su(e,Yh)+"";if(Nu(e))return Wh?Wh.call(e):"";var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function ao(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}function Jh(e){return e}var lS="[object AsyncFunction]",cS="[object Function]",dS="[object GeneratorFunction]",uS="[object Proxy]";function Xh(e){if(!ao(e))return!1;var n=io(e);return n==cS||n==dS||n==lS||n==uS}var xu=Yn["__core-js_shared__"],Zh=(function(){var e=/[^.]+$/.exec(xu&&xu.keys&&xu.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function fS(e){return!!Zh&&Zh in e}var pS=Function.prototype,mS=pS.toString;function so(e){if(e!=null){try{return mS.call(e)}catch{}try{return e+""}catch{}}return""}var gS=/[\\^$.*+?()[\]{}|]/g,hS=/^\[object .+?Constructor\]$/,yS=Function.prototype,_S=Object.prototype,bS=yS.toString,wS=_S.hasOwnProperty,kS=RegExp("^"+bS.call(wS).replace(gS,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function CS(e){if(!ao(e)||fS(e))return!1;var n=Xh(e)?kS:hS;return n.test(so(e))}function ES(e,n){return e?.[n]}function lo(e,n){var r=ES(e,n);return CS(r)?r:void 0}var Au=lo(Yn,"WeakMap"),Qh=Object.create,NS=(function(){function e(){}return function(n){if(!ao(n))return{};if(Qh)return Qh(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}})();function SS(e,n,r){switch(r.length){case 0:return e.call(n);case 1:return e.call(n,r[0]);case 2:return e.call(n,r[0],r[1]);case 3:return e.call(n,r[0],r[1],r[2])}return e.apply(n,r)}function xS(e,n){var r=-1,o=e.length;for(n||(n=Array(o));++r<o;)n[r]=e[r];return n}var AS=800,IS=16,vS=Date.now;function TS(e){var n=0,r=0;return function(){var o=vS(),i=IS-(o-r);if(r=o,i>0){if(++n>=AS)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}function OS(e){return function(){return e}}var rl=(function(){try{var e=lo(Object,"defineProperty");return e({},"",{}),e}catch{}})(),BS=rl?function(e,n){return rl(e,"toString",{configurable:!0,enumerable:!1,value:OS(n),writable:!0})}:Jh,ey=TS(BS);function PS(e,n){for(var r=-1,o=e==null?0:e.length;++r<o&&n(e[r],r,e)!==!1;);return e}function VS(e,n,r,o){for(var i=e.length,a=r+-1;++a<i;)if(n(e[a],a,e))return a;return-1}function $S(e){return e!==e}function RS(e,n,r){for(var o=r-1,i=e.length;++o<i;)if(e[o]===n)return o;return-1}function LS(e,n,r){return n===n?RS(e,n,r):VS(e,$S,r)}function FS(e,n){var r=e==null?0:e.length;return!!r&&LS(e,n,0)>-1}var DS=9007199254740991,MS=/^(?:0|[1-9]\d*)$/;function Iu(e,n){var r=typeof e;return n=n??DS,!!n&&(r=="number"||r!="symbol"&&MS.test(e))&&e>-1&&e%1==0&&e<n}function ty(e,n,r){n=="__proto__"&&rl?rl(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r}function vu(e,n){return e===n||e!==e&&n!==n}var US=Object.prototype,jS=US.hasOwnProperty;function Tu(e,n,r){var o=e[n];(!(jS.call(e,n)&&vu(o,r))||r===void 0&&!(n in e))&&ty(e,n,r)}function _a(e,n,r,o){var i=!r;r||(r={});for(var a=-1,s=n.length;++a<s;){var l=n[a],c=void 0;c===void 0&&(c=e[l]),i?ty(r,l,c):Tu(r,l,c)}return r}var ny=Math.max;function ry(e,n,r){return n=ny(n===void 0?e.length-1:n,0),function(){for(var o=arguments,i=-1,a=ny(o.length-n,0),s=Array(a);++i<a;)s[i]=o[n+i];i=-1;for(var l=Array(n+1);++i<n;)l[i]=o[i];return l[n]=r(s),SS(e,this,l)}}function KS(e,n){return ey(ry(e,n,Jh),e+"")}var qS=9007199254740991;function Ou(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=qS}function ol(e){return e!=null&&Ou(e.length)&&!Xh(e)}var GS=Object.prototype;function il(e){var n=e&&e.constructor,r=typeof n=="function"&&n.prototype||GS;return e===r}function zS(e,n){for(var r=-1,o=Array(e);++r<e;)o[r]=n(r);return o}var HS="[object Arguments]";function oy(e){return Jn(e)&&io(e)==HS}var iy=Object.prototype,WS=iy.hasOwnProperty,YS=iy.propertyIsEnumerable,al=oy((function(){return arguments})())?oy:function(e){return Jn(e)&&WS.call(e,"callee")&&!YS.call(e,"callee")};function JS(){return!1}var ay=typeof Ve=="object"&&Ve&&!Ve.nodeType&&Ve,sy=ay&&typeof module=="object"&&module&&!module.nodeType&&module,XS=sy&&sy.exports===ay,ly=XS?Yn.Buffer:void 0,ZS=ly?ly.isBuffer:void 0,ba=ZS||JS,QS="[object Arguments]",ex="[object Array]",tx="[object Boolean]",nx="[object Date]",rx="[object Error]",ox="[object Function]",ix="[object Map]",ax="[object Number]",sx="[object Object]",lx="[object RegExp]",cx="[object Set]",dx="[object String]",ux="[object WeakMap]",fx="[object ArrayBuffer]",px="[object DataView]",mx="[object Float32Array]",gx="[object Float64Array]",hx="[object Int8Array]",yx="[object Int16Array]",_x="[object Int32Array]",bx="[object Uint8Array]",wx="[object Uint8ClampedArray]",kx="[object Uint16Array]",Cx="[object Uint32Array]",Et={};Et[mx]=Et[gx]=Et[hx]=Et[yx]=Et[_x]=Et[bx]=Et[wx]=Et[kx]=Et[Cx]=!0,Et[QS]=Et[ex]=Et[fx]=Et[tx]=Et[px]=Et[nx]=Et[rx]=Et[ox]=Et[ix]=Et[ax]=Et[sx]=Et[lx]=Et[cx]=Et[dx]=Et[ux]=!1;function Ex(e){return Jn(e)&&Ou(e.length)&&!!Et[io(e)]}function Bu(e){return function(n){return e(n)}}var cy=typeof Ve=="object"&&Ve&&!Ve.nodeType&&Ve,wa=cy&&typeof module=="object"&&module&&!module.nodeType&&module,Nx=wa&&wa.exports===cy,Pu=Nx&&qh.process,Wo=(function(){try{var e=wa&&wa.require&&wa.require("util").types;return e||Pu&&Pu.binding&&Pu.binding("util")}catch{}})(),dy=Wo&&Wo.isTypedArray,Vu=dy?Bu(dy):Ex,Sx=Object.prototype,xx=Sx.hasOwnProperty;function uy(e,n){var r=Rn(e),o=!r&&al(e),i=!r&&!o&&ba(e),a=!r&&!o&&!i&&Vu(e),s=r||o||i||a,l=s?zS(e.length,String):[],c=l.length;for(var d in e)(n||xx.call(e,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Iu(d,c)))&&l.push(d);return l}function fy(e,n){return function(r){return e(n(r))}}var Ax=fy(Object.keys,Object),Ix=Object.prototype,vx=Ix.hasOwnProperty;function py(e){if(!il(e))return Ax(e);var n=[];for(var r in Object(e))vx.call(e,r)&&r!="constructor"&&n.push(r);return n}function $u(e){return ol(e)?uy(e):py(e)}function Tx(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}var Ox=Object.prototype,Bx=Ox.hasOwnProperty;function Px(e){if(!ao(e))return Tx(e);var n=il(e),r=[];for(var o in e)o=="constructor"&&(n||!Bx.call(e,o))||r.push(o);return r}function Ru(e){return ol(e)?uy(e,!0):Px(e)}var Vx=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$x=/^\w*$/;function Rx(e,n){if(Rn(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Nu(e)?!0:$x.test(e)||!Vx.test(e)||n!=null&&e in Object(n)}var ka=lo(Object,"create");function Lx(){this.__data__=ka?ka(null):{},this.size=0}function Fx(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var Dx="__lodash_hash_undefined__",Mx=Object.prototype,Ux=Mx.hasOwnProperty;function jx(e){var n=this.__data__;if(ka){var r=n[e];return r===Dx?void 0:r}return Ux.call(n,e)?n[e]:void 0}var Kx=Object.prototype,qx=Kx.hasOwnProperty;function Gx(e){var n=this.__data__;return ka?n[e]!==void 0:qx.call(n,e)}var zx="__lodash_hash_undefined__";function Hx(e,n){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ka&&n===void 0?zx:n,this}function co(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n<r;){var o=e[n];this.set(o[0],o[1])}}co.prototype.clear=Lx,co.prototype.delete=Fx,co.prototype.get=jx,co.prototype.has=Gx,co.prototype.set=Hx;function Wx(){this.__data__=[],this.size=0}function sl(e,n){for(var r=e.length;r--;)if(vu(e[r][0],n))return r;return-1}var Yx=Array.prototype,Jx=Yx.splice;function Xx(e){var n=this.__data__,r=sl(n,e);if(r<0)return!1;var o=n.length-1;return r==o?n.pop():Jx.call(n,r,1),--this.size,!0}function Zx(e){var n=this.__data__,r=sl(n,e);return r<0?void 0:n[r][1]}function Qx(e){return sl(this.__data__,e)>-1}function eA(e,n){var r=this.__data__,o=sl(r,e);return o<0?(++this.size,r.push([e,n])):r[o][1]=n,this}function gr(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n<r;){var o=e[n];this.set(o[0],o[1])}}gr.prototype.clear=Wx,gr.prototype.delete=Xx,gr.prototype.get=Zx,gr.prototype.has=Qx,gr.prototype.set=eA;var Ca=lo(Yn,"Map");function tA(){this.size=0,this.__data__={hash:new co,map:new(Ca||gr),string:new co}}function nA(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function ll(e,n){var r=e.__data__;return nA(n)?r[typeof n=="string"?"string":"hash"]:r.map}function rA(e){var n=ll(this,e).delete(e);return this.size-=n?1:0,n}function oA(e){return ll(this,e).get(e)}function iA(e){return ll(this,e).has(e)}function aA(e,n){var r=ll(this,e),o=r.size;return r.set(e,n),this.size+=r.size==o?0:1,this}function hr(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n<r;){var o=e[n];this.set(o[0],o[1])}}hr.prototype.clear=tA,hr.prototype.delete=rA,hr.prototype.get=oA,hr.prototype.has=iA,hr.prototype.set=aA;var sA="Expected a function";function Lu(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError(sA);var r=function(){var o=arguments,i=n?n.apply(this,o):o[0],a=r.cache;if(a.has(i))return a.get(i);var s=e.apply(this,o);return r.cache=a.set(i,s)||a,s};return r.cache=new(Lu.Cache||hr),r}Lu.Cache=hr;var lA=500;function cA(e){var n=Lu(e,function(o){return r.size===lA&&r.clear(),o}),r=n.cache;return n}var dA=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,uA=/\\(\\)?/g,fA=cA(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(dA,function(r,o,i,a){n.push(i?a.replace(uA,"$1"):o||r)}),n});function uo(e){return e==null?"":Yh(e)}function Yo(e,n){return Rn(e)?e:Rx(e,n)?[e]:fA(uo(e))}function Ea(e){if(typeof e=="string"||Nu(e))return e;var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function Fu(e,n){n=Yo(n,e);for(var r=0,o=n.length;e!=null&&r<o;)e=e[Ea(n[r++])];return r&&r==o?e:void 0}function Na(e,n,r){var o=e==null?void 0:Fu(e,n);return o===void 0?r:o}function Du(e,n){for(var r=-1,o=n.length,i=e.length;++r<o;)e[i+r]=n[r];return e}var my=En?En.isConcatSpreadable:void 0;function pA(e){return Rn(e)||al(e)||!!(my&&e&&e[my])}function mA(e,n,r,o,i){var a=-1,s=e.length;for(r||(r=pA),i||(i=[]);++a<s;){var l=e[a];r(l)?Du(i,l):i[i.length]=l}return i}function gA(e){var n=e==null?0:e.length;return n?mA(e):[]}function gy(e){return ey(ry(e,void 0,gA),e+"")}var Mu=fy(Object.getPrototypeOf,Object),hA="[object Object]",yA=Function.prototype,_A=Object.prototype,hy=yA.toString,bA=_A.hasOwnProperty,wA=hy.call(Object);function kA(e){if(!Jn(e)||io(e)!=hA)return!1;var n=Mu(e);if(n===null)return!0;var r=bA.call(n,"constructor")&&n.constructor;return typeof r=="function"&&r instanceof r&&hy.call(r)==wA}function yy(e,n,r){var o=-1,i=e.length;n<0&&(n=-n>i?0:i+n),r=r>i?i:r,r<0&&(r+=i),i=n>r?0:r-n>>>0,n>>>=0;for(var a=Array(i);++o<i;)a[o]=e[o+n];return a}function CA(e,n,r){var o=e.length;return r=r===void 0?o:r,!n&&r>=o?e:yy(e,n,r)}var EA="\\ud800-\\udfff",NA="\\u0300-\\u036f",SA="\\ufe20-\\ufe2f",xA="\\u20d0-\\u20ff",AA=NA+SA+xA,IA="\\ufe0e\\ufe0f",vA="\\u200d",TA=RegExp("["+vA+EA+AA+IA+"]");function _y(e){return TA.test(e)}function OA(e){return e.split("")}var by="\\ud800-\\udfff",BA="\\u0300-\\u036f",PA="\\ufe20-\\ufe2f",VA="\\u20d0-\\u20ff",$A=BA+PA+VA,RA="\\ufe0e\\ufe0f",LA="["+by+"]",Uu="["+$A+"]",ju="\\ud83c[\\udffb-\\udfff]",FA="(?:"+Uu+"|"+ju+")",wy="[^"+by+"]",ky="(?:\\ud83c[\\udde6-\\uddff]){2}",Cy="[\\ud800-\\udbff][\\udc00-\\udfff]",DA="\\u200d",Ey=FA+"?",Ny="["+RA+"]?",MA="(?:"+DA+"(?:"+[wy,ky,Cy].join("|")+")"+Ny+Ey+")*",UA=Ny+Ey+MA,jA="(?:"+[wy+Uu+"?",Uu,ky,Cy,LA].join("|")+")",KA=RegExp(ju+"(?="+ju+")|"+jA+UA,"g");function qA(e){return e.match(KA)||[]}function GA(e){return _y(e)?qA(e):OA(e)}function zA(e){return function(n){n=uo(n);var r=_y(n)?GA(n):void 0,o=r?r[0]:n.charAt(0),i=r?CA(r,1).join(""):n.slice(1);return o[e]()+i}}var HA=zA("toUpperCase");function WA(e){return HA(uo(e).toLowerCase())}function YA(e,n,r,o){for(var i=-1,a=e==null?0:e.length;++i<a;)r=n(r,e[i],i,e);return r}function Sy(e){return function(n){return e?.[n]}}var JA={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},XA=Sy(JA),ZA=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,QA="\\u0300-\\u036f",eI="\\ufe20-\\ufe2f",tI="\\u20d0-\\u20ff",nI=QA+eI+tI,rI="["+nI+"]",oI=RegExp(rI,"g");function iI(e){return e=uo(e),e&&e.replace(ZA,XA).replace(oI,"")}var aI=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function sI(e){return e.match(aI)||[]}var lI=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function cI(e){return lI.test(e)}var xy="\\ud800-\\udfff",dI="\\u0300-\\u036f",uI="\\ufe20-\\ufe2f",fI="\\u20d0-\\u20ff",pI=dI+uI+fI,Ay="\\u2700-\\u27bf",Iy="a-z\\xdf-\\xf6\\xf8-\\xff",mI="\\xac\\xb1\\xd7\\xf7",gI="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",hI="\\u2000-\\u206f",yI=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",vy="A-Z\\xc0-\\xd6\\xd8-\\xde",_I="\\ufe0e\\ufe0f",Ty=mI+gI+hI+yI,Oy="['’]",By="["+Ty+"]",bI="["+pI+"]",Py="\\d+",wI="["+Ay+"]",Vy="["+Iy+"]",$y="[^"+xy+Ty+Py+Ay+Iy+vy+"]",kI="\\ud83c[\\udffb-\\udfff]",CI="(?:"+bI+"|"+kI+")",EI="[^"+xy+"]",Ry="(?:\\ud83c[\\udde6-\\uddff]){2}",Ly="[\\ud800-\\udbff][\\udc00-\\udfff]",Jo="["+vy+"]",NI="\\u200d",Fy="(?:"+Vy+"|"+$y+")",SI="(?:"+Jo+"|"+$y+")",Dy="(?:"+Oy+"(?:d|ll|m|re|s|t|ve))?",My="(?:"+Oy+"(?:D|LL|M|RE|S|T|VE))?",Uy=CI+"?",jy="["+_I+"]?",xI="(?:"+NI+"(?:"+[EI,Ry,Ly].join("|")+")"+jy+Uy+")*",AI="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",II="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",vI=jy+Uy+xI,TI="(?:"+[wI,Ry,Ly].join("|")+")"+vI,OI=RegExp([Jo+"?"+Vy+"+"+Dy+"(?="+[By,Jo,"$"].join("|")+")",SI+"+"+My+"(?="+[By,Jo+Fy,"$"].join("|")+")",Jo+"?"+Fy+"+"+Dy,Jo+"+"+My,II,AI,Py,TI].join("|"),"g");function BI(e){return e.match(OI)||[]}function PI(e,n,r){return e=uo(e),n=n,n===void 0?cI(e)?BI(e):sI(e):e.match(n)||[]}var VI="['’]",$I=RegExp(VI,"g");function RI(e){return function(n){return YA(PI(iI(n).replace($I,"")),e,"")}}var LI=RI(function(e,n,r){return n=n.toLowerCase(),e+(r?WA(n):n)});function FI(){this.__data__=new gr,this.size=0}function DI(e){var n=this.__data__,r=n.delete(e);return this.size=n.size,r}function MI(e){return this.__data__.get(e)}function UI(e){return this.__data__.has(e)}var jI=200;function KI(e,n){var r=this.__data__;if(r instanceof gr){var o=r.__data__;if(!Ca||o.length<jI-1)return o.push([e,n]),this.size=++r.size,this;r=this.__data__=new hr(o)}return r.set(e,n),this.size=r.size,this}function yr(e){var n=this.__data__=new gr(e);this.size=n.size}yr.prototype.clear=FI,yr.prototype.delete=DI,yr.prototype.get=MI,yr.prototype.has=UI,yr.prototype.set=KI;function qI(e,n){return e&&_a(n,$u(n),e)}function GI(e,n){return e&&_a(n,Ru(n),e)}var Ky=typeof Ve=="object"&&Ve&&!Ve.nodeType&&Ve,qy=Ky&&typeof module=="object"&&module&&!module.nodeType&&module,zI=qy&&qy.exports===Ky,Gy=zI?Yn.Buffer:void 0,zy=Gy?Gy.allocUnsafe:void 0;function HI(e,n){if(n)return e.slice();var r=e.length,o=zy?zy(r):new e.constructor(r);return e.copy(o),o}function WI(e,n){for(var r=-1,o=e==null?0:e.length,i=0,a=[];++r<o;){var s=e[r];n(s,r,e)&&(a[i++]=s)}return a}function Hy(){return[]}var YI=Object.prototype,JI=YI.propertyIsEnumerable,Wy=Object.getOwnPropertySymbols,Ku=Wy?function(e){return e==null?[]:(e=Object(e),WI(Wy(e),function(n){return JI.call(e,n)}))}:Hy;function XI(e,n){return _a(e,Ku(e),n)}var ZI=Object.getOwnPropertySymbols,Yy=ZI?function(e){for(var n=[];e;)Du(n,Ku(e)),e=Mu(e);return n}:Hy;function QI(e,n){return _a(e,Yy(e),n)}function Jy(e,n,r){var o=n(e);return Rn(e)?o:Du(o,r(e))}function qu(e){return Jy(e,$u,Ku)}function Xy(e){return Jy(e,Ru,Yy)}var Gu=lo(Yn,"DataView"),zu=lo(Yn,"Promise"),Hu=lo(Yn,"Set"),Zy="[object Map]",ev="[object Object]",Qy="[object Promise]",e_="[object Set]",t_="[object WeakMap]",n_="[object DataView]",tv=so(Gu),nv=so(Ca),rv=so(zu),ov=so(Hu),iv=so(Au),Nn=io;(Gu&&Nn(new Gu(new ArrayBuffer(1)))!=n_||Ca&&Nn(new Ca)!=Zy||zu&&Nn(zu.resolve())!=Qy||Hu&&Nn(new Hu)!=e_||Au&&Nn(new Au)!=t_)&&(Nn=function(e){var n=io(e),r=n==ev?e.constructor:void 0,o=r?so(r):"";if(o)switch(o){case tv:return n_;case nv:return Zy;case rv:return Qy;case ov:return e_;case iv:return t_}return n});var av=Object.prototype,sv=av.hasOwnProperty;function lv(e){var n=e.length,r=new e.constructor(n);return n&&typeof e[0]=="string"&&sv.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var cl=Yn.Uint8Array;function Wu(e){var n=new e.constructor(e.byteLength);return new cl(n).set(new cl(e)),n}function cv(e,n){var r=n?Wu(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var dv=/\w*$/;function uv(e){var n=new e.constructor(e.source,dv.exec(e));return n.lastIndex=e.lastIndex,n}var r_=En?En.prototype:void 0,o_=r_?r_.valueOf:void 0;function fv(e){return o_?Object(o_.call(e)):{}}function pv(e,n){var r=n?Wu(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var mv="[object Boolean]",gv="[object Date]",hv="[object Map]",yv="[object Number]",_v="[object RegExp]",bv="[object Set]",wv="[object String]",kv="[object Symbol]",Cv="[object ArrayBuffer]",Ev="[object DataView]",Nv="[object Float32Array]",Sv="[object Float64Array]",xv="[object Int8Array]",Av="[object Int16Array]",Iv="[object Int32Array]",vv="[object Uint8Array]",Tv="[object Uint8ClampedArray]",Ov="[object Uint16Array]",Bv="[object Uint32Array]";function Pv(e,n,r){var o=e.constructor;switch(n){case Cv:return Wu(e);case mv:case gv:return new o(+e);case Ev:return cv(e,r);case Nv:case Sv:case xv:case Av:case Iv:case vv:case Tv:case Ov:case Bv:return pv(e,r);case hv:return new o;case yv:case wv:return new o(e);case _v:return uv(e);case bv:return new o;case kv:return fv(e)}}function Vv(e){return typeof e.constructor=="function"&&!il(e)?NS(Mu(e)):{}}var $v="[object Map]";function Rv(e){return Jn(e)&&Nn(e)==$v}var i_=Wo&&Wo.isMap,Lv=i_?Bu(i_):Rv,Fv="[object Set]";function Dv(e){return Jn(e)&&Nn(e)==Fv}var a_=Wo&&Wo.isSet,Mv=a_?Bu(a_):Dv,Uv=1,jv=2,Kv=4,s_="[object Arguments]",qv="[object Array]",Gv="[object Boolean]",zv="[object Date]",Hv="[object Error]",l_="[object Function]",Wv="[object GeneratorFunction]",Yv="[object Map]",Jv="[object Number]",c_="[object Object]",Xv="[object RegExp]",Zv="[object Set]",Qv="[object String]",eT="[object Symbol]",tT="[object WeakMap]",nT="[object ArrayBuffer]",rT="[object DataView]",oT="[object Float32Array]",iT="[object Float64Array]",aT="[object Int8Array]",sT="[object Int16Array]",lT="[object Int32Array]",cT="[object Uint8Array]",dT="[object Uint8ClampedArray]",uT="[object Uint16Array]",fT="[object Uint32Array]",Ct={};Ct[s_]=Ct[qv]=Ct[nT]=Ct[rT]=Ct[Gv]=Ct[zv]=Ct[oT]=Ct[iT]=Ct[aT]=Ct[sT]=Ct[lT]=Ct[Yv]=Ct[Jv]=Ct[c_]=Ct[Xv]=Ct[Zv]=Ct[Qv]=Ct[eT]=Ct[cT]=Ct[dT]=Ct[uT]=Ct[fT]=!0,Ct[Hv]=Ct[l_]=Ct[tT]=!1;function Sa(e,n,r,o,i,a){var s,l=n&Uv,c=n&jv,d=n&Kv;if(r&&(s=i?r(e,o,i,a):r(e)),s!==void 0)return s;if(!ao(e))return e;var f=Rn(e);if(f){if(s=lv(e),!l)return xS(e,s)}else{var u=Nn(e),p=u==l_||u==Wv;if(ba(e))return HI(e,l);if(u==c_||u==s_||p&&!i){if(s=c||p?{}:Vv(e),!l)return c?QI(e,GI(s,e)):XI(e,qI(s,e))}else{if(!Ct[u])return i?e:{};s=Pv(e,u,l)}}a||(a=new yr);var g=a.get(e);if(g)return g;a.set(e,s),Mv(e)?e.forEach(function(m){s.add(Sa(m,n,r,m,e,a))}):Lv(e)&&e.forEach(function(m,_){s.set(_,Sa(m,n,r,_,e,a))});var h=d?c?Xy:qu:c?Ru:$u,y=f?void 0:h(e);return PS(y||e,function(m,_){y&&(_=m,m=e[_]),Tu(s,_,Sa(m,n,r,_,e,a))}),s}var pT=1,mT=4;function Yu(e){return Sa(e,pT|mT)}var gT="__lodash_hash_undefined__";function hT(e){return this.__data__.set(e,gT),this}function yT(e){return this.__data__.has(e)}function xa(e){var n=-1,r=e==null?0:e.length;for(this.__data__=new hr;++n<r;)this.add(e[n])}xa.prototype.add=xa.prototype.push=hT,xa.prototype.has=yT;function _T(e,n){for(var r=-1,o=e==null?0:e.length;++r<o;)if(n(e[r],r,e))return!0;return!1}function Ju(e,n){return e.has(n)}var bT=1,wT=2;function d_(e,n,r,o,i,a){var s=r&bT,l=e.length,c=n.length;if(l!=c&&!(s&&c>l))return!1;var d=a.get(e),f=a.get(n);if(d&&f)return d==n&&f==e;var u=-1,p=!0,g=r&wT?new xa:void 0;for(a.set(e,n),a.set(n,e);++u<l;){var h=e[u],y=n[u];if(o)var m=s?o(y,h,u,n,e,a):o(h,y,u,e,n,a);if(m!==void 0){if(m)continue;p=!1;break}if(g){if(!_T(n,function(_,b){if(!Ju(g,b)&&(h===_||i(h,_,r,o,a)))return g.push(b)})){p=!1;break}}else if(!(h===y||i(h,y,r,o,a))){p=!1;break}}return a.delete(e),a.delete(n),p}function kT(e){var n=-1,r=Array(e.size);return e.forEach(function(o,i){r[++n]=[i,o]}),r}function CT(e){var n=-1,r=Array(e.size);return e.forEach(function(o){r[++n]=o}),r}var ET=1,NT=2,ST="[object Boolean]",xT="[object Date]",AT="[object Error]",IT="[object Map]",vT="[object Number]",TT="[object RegExp]",OT="[object Set]",BT="[object String]",PT="[object Symbol]",VT="[object ArrayBuffer]",$T="[object DataView]",u_=En?En.prototype:void 0,Xu=u_?u_.valueOf:void 0;function RT(e,n,r,o,i,a,s){switch(r){case $T:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case VT:return!(e.byteLength!=n.byteLength||!a(new cl(e),new cl(n)));case ST:case xT:case vT:return vu(+e,+n);case AT:return e.name==n.name&&e.message==n.message;case TT:case BT:return e==n+"";case IT:var l=kT;case OT:var c=o&ET;if(l||(l=CT),e.size!=n.size&&!c)return!1;var d=s.get(e);if(d)return d==n;o|=NT,s.set(e,n);var f=d_(l(e),l(n),o,i,a,s);return s.delete(e),f;case PT:if(Xu)return Xu.call(e)==Xu.call(n)}return!1}var LT=1,FT=Object.prototype,DT=FT.hasOwnProperty;function MT(e,n,r,o,i,a){var s=r&LT,l=qu(e),c=l.length,d=qu(n),f=d.length;if(c!=f&&!s)return!1;for(var u=c;u--;){var p=l[u];if(!(s?p in n:DT.call(n,p)))return!1}var g=a.get(e),h=a.get(n);if(g&&h)return g==n&&h==e;var y=!0;a.set(e,n),a.set(n,e);for(var m=s;++u<c;){p=l[u];var _=e[p],b=n[p];if(o)var k=s?o(b,_,p,n,e,a):o(_,b,p,e,n,a);if(!(k===void 0?_===b||i(_,b,r,o,a):k)){y=!1;break}m||(m=p=="constructor")}if(y&&!m){var A=e.constructor,C=n.constructor;A!=C&&"constructor"in e&&"constructor"in n&&!(typeof A=="function"&&A instanceof A&&typeof C=="function"&&C instanceof C)&&(y=!1)}return a.delete(e),a.delete(n),y}var UT=1,f_="[object Arguments]",p_="[object Array]",dl="[object Object]",jT=Object.prototype,m_=jT.hasOwnProperty;function KT(e,n,r,o,i,a){var s=Rn(e),l=Rn(n),c=s?p_:Nn(e),d=l?p_:Nn(n);c=c==f_?dl:c,d=d==f_?dl:d;var f=c==dl,u=d==dl,p=c==d;if(p&&ba(e)){if(!ba(n))return!1;s=!0,f=!1}if(p&&!f)return a||(a=new yr),s||Vu(e)?d_(e,n,r,o,i,a):RT(e,n,c,r,o,i,a);if(!(r&UT)){var g=f&&m_.call(e,"__wrapped__"),h=u&&m_.call(n,"__wrapped__");if(g||h){var y=g?e.value():e,m=h?n.value():n;return a||(a=new yr),i(y,m,r,o,a)}}return p?(a||(a=new yr),MT(e,n,r,o,i,a)):!1}function g_(e,n,r,o,i){return e===n?!0:e==null||n==null||!Jn(e)&&!Jn(n)?e!==e&&n!==n:KT(e,n,r,o,g_,i)}function qT(e,n){return e!=null&&n in Object(e)}function h_(e,n,r){n=Yo(n,e);for(var o=-1,i=n.length,a=!1;++o<i;){var s=Ea(n[o]);if(!(a=e!=null&&r(e,s)))break;e=e[s]}return a||++o!=i?a:(i=e==null?0:e.length,!!i&&Ou(i)&&Iu(s,i)&&(Rn(e)||al(e)))}function GT(e,n){return e!=null&&h_(e,n,qT)}function zT(e){return Jn(e)&&ol(e)}function HT(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}var WT={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},YT=Sy(WT),y_=/[&<>"']/g,JT=RegExp(y_.source);function XT(e){return e=uo(e),e&&JT.test(e)?e.replace(y_,YT):e}var ZT=Object.prototype,QT=ZT.hasOwnProperty;function eO(e,n){return e!=null&&QT.call(e,n)}function ul(e,n){return e!=null&&h_(e,n,eO)}var tO=Math.min;function nO(e,n,r){for(var o=FS,i=e[0].length,a=e.length,s=a,l=Array(a),c=1/0,d=[];s--;){var f=e[s];c=tO(f.length,c),l[s]=i>=120&&f.length>=120?new xa(s&&f):void 0}f=e[0];var u=-1,p=l[0];e:for(;++u<i&&d.length<c;){var g=f[u],h=g;if(g=g!==0?g:0,!(p?Ju(p,h):o(d,h))){for(s=a;--s;){var y=l[s];if(!(y?Ju(y,h):o(e[s],h)))continue e}p&&p.push(h),d.push(g)}}return d}function rO(e){return zT(e)?e:[]}var oO=KS(function(e){var n=Su(e,rO);return n.length&&n[0]===e[0]?nO(n):[]});function iO(e,n){return n.length<2?e:Fu(e,yy(n,0,-1))}var aO="[object Map]",sO="[object Set]",lO=Object.prototype,cO=lO.hasOwnProperty;function Zu(e){if(e==null)return!0;if(ol(e)&&(Rn(e)||typeof e=="string"||typeof e.splice=="function"||ba(e)||Vu(e)||al(e)))return!e.length;var n=Nn(e);if(n==aO||n==sO)return!e.size;if(il(e))return!py(e).length;for(var r in e)if(cO.call(e,r))return!1;return!0}function yn(e,n){return g_(e,n)}var dO=Object.prototype,uO=dO.hasOwnProperty;function __(e,n){n=Yo(n,e);var r=-1,o=n.length;if(!o)return!0;for(;++r<o;){var i=Ea(n[r]);if(i==="__proto__"&&!uO.call(e,"__proto__")||(i==="constructor"||i==="prototype")&&r<o-1)return!1}var a=iO(e,n);return a==null||delete a[Ea(HT(n))]}function fO(e){return kA(e)?void 0:e}var pO=1,mO=2,gO=4,fo=gy(function(e,n){var r={};if(e==null)return r;var o=!1;n=Su(n,function(a){return a=Yo(a,e),o||(o=a.length>1),a}),_a(e,Xy(e),r),o&&(r=Sa(r,pO|mO|gO,fO));for(var i=n.length;i--;)__(r,n[i]);return r});function b_(e,n,r,o){if(!ao(e))return e;n=Yo(n,e);for(var i=-1,a=n.length,s=a-1,l=e;l!=null&&++i<a;){var c=Ea(n[i]),d=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(i!=s){var f=l[c];d=void 0,d===void 0&&(d=ao(f)?f:Iu(n[i+1])?[]:{})}Tu(l,c,d),l=l[c]}return e}function hO(e,n,r){for(var o=-1,i=n.length,a={};++o<i;){var s=n[o],l=Fu(e,s);r(l,s)&&b_(a,Yo(s,e),l)}return a}function yO(e,n){return hO(e,n,function(r,o){return GT(e,o)})}var Qu=gy(function(e,n){return e==null?{}:yO(e,n)});function w_(e,n,r){return e==null?e:b_(e,n,r)}var _O=0;function ef(e){var n=++_O;return uo(e)+n}function k_(e,n){return e==null?!0:__(e,n)}const Xo="{key}",po={"kong.client.consumer":{dataType:"object",writable:!1,readable:!0},"kong.client.consumer_groups":{dataType:"array",writable:!1,readable:!0},"kong.client.credential":{dataType:"object",writable:!1,readable:!0},"kong.client.identity_realm_source":{dataType:"object",writable:!1,readable:!0},"kong.client.forwarded_ip":{dataType:"string",writable:!1,readable:!0},"kong.client.forwarded_port":{dataType:"number",writable:!1,readable:!0},"kong.client.ip":{dataType:"string",writable:!1,readable:!0},"kong.client.port":{dataType:"number",writable:!1,readable:!0},"kong.client.protocol":{dataType:"string",writable:!1,readable:!0},"kong.client.principal":{dataType:"object",writable:!1,readable:!0},"kong.client.principal.{key}":{dataType:"any",writable:!1,readable:!0},"kong.request.forwarded_host":{dataType:"string",writable:!1,readable:!0},"kong.request.forwarded_port":{dataType:"number",writable:!1,readable:!0},"kong.request.forwarded_scheme":{dataType:"string",writable:!1,readable:!0},"kong.request.port":{dataType:"number",writable:!1,readable:!0},"kong.response.source":{dataType:"string",writable:!1,readable:!0},"kong.router.route":{dataType:"object",writable:!1,readable:!0},"kong.route_id":{dataType:"string",writable:!1,readable:!0},"kong.route_name":{dataType:"string",writable:!1,readable:!0},"kong.router.service":{dataType:"object",writable:!1,readable:!0},"kong.service_name":{dataType:"string",writable:!1,readable:!0},"kong.service_id":{dataType:"string",writable:!1,readable:!0},"kong.service.response.status":{dataType:"number",writable:!1,readable:!0},"kong.version":{dataType:"string",writable:!1,readable:!0},"kong.node.id":{dataType:"string",writable:!1,readable:!0},"kong.configuration.{key}":{dataType:"any",writable:!1,readable:!0},"kong.service.target":{dataType:"string ({host}:{port})",writable:!0,readable:!1},"kong.service.request.scheme":{dataType:"string ({scheme})",writable:!0,readable:!1},"kong.ctx.plugin.{key}":{dataType:"any",writable:!0,readable:!0},"kong.ctx.shared.{key}":{dataType:"any",writable:!0,readable:!0}},fl=Object.keys(po).filter(e=>e.includes(Xo)).map(e=>e.replace(Xo,""));function tf(e){if(!e||!Ia(e))return;const n=fl.find(r=>e.startsWith(r));if(n)return e.slice(n.length).replace(Xo,"")}function Aa(e){if(!e)return null;const n=fl.find(r=>e.startsWith(r));return n||e}function Ia(e){return e?fl.some(n=>e.startsWith(n)):!1}function C_(e){return e?Ia(e)?Aa(e)+Xo:e:null}function nf(e){if(!e)return!1;const n=C_(e);return n?po[n]?.readable??!1:!1}function rf(e){if(!e)return!1;const n=C_(e);return n?po[n]?.writable??!1:!1}const of=Symbol("EXPERIMENTAL_FREE_FORM_PROVIDER"),nn={KM_2262_CODE_MODE:"KM-2262-code-mode",KM_2306_CONDITION_FIELD_314:"KM-2306-condition-field-314",KM_2446_DATAKIT_JWT_NODES:"KM-2446-Datakit-JWT-nodes",KM_2503_CUSTOM_PLUGIN_FREEFORM:"KM-2503-custom-plugin-freeform",KM_2485_CLONED_PLUGINS:"KM-2485-cloned-plugins",KHCP_20393_IDENTITY_PRINCIPALS_UI:"khcp-20393-identity-principals-ui",KM_3444_GATEWAY_317:"KM-3444-gateway-317"},E_=Symbol("TOASTER_PROVIDER");function pl(){const e=(...r)=>{console.warn("TOASTER_PROVIDER is not provided",...r)},n=t.inject(E_,e);return r=>n(r)}const N_=["request","service_request","service_response","response","vault"],Zo=N_,S_=["call","jq","exit","property","static","branch","cache","xml_to_json","json_to_xml","jwt_decode","jwt_sign","jwt_verify"],x_=["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS","TRACE","CONNECT"],af=["EdDSA","ES256","ES384","ES512","HS256","HS384","HS512","PS256","PS384","PS512","RS256","RS384","RS512"],Pe=(e,n)=>{const r=e.__vccOpts||e;for(const[o,i]of n)r[o]=i;return r},bO={},wO={height:"16",viewBox:"0 -960 960 960",width:"16",xmlns:"http://www.w3.org/2000/svg"};function kO(e,n){return t.openBlock(),t.createElementBlock("svg",wO,[...n[0]||(n[0]=[t.createElementVNode("path",{d:"M240-160h480v-400H240v400Zm296.5-143.5Q560-327 560-360t-23.5-56.5Q513-440 480-440t-56.5 23.5Q400-393 400-360t23.5 56.5Q447-280 480-280t56.5-23.5ZM240-160v-400 400Zm0 80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h280v-80q0-83 58.5-141.5T720-920q83 0 141.5 58.5T920-720h-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80h120q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Z",fill:"currentColor"},null,-1)])])}const CO=Pe(bO,[["render",kO]]),EO={},NO={height:"16",viewBox:"0 -960 960 960",width:"16",xmlns:"http://www.w3.org/2000/svg"};function SO(e,n){return t.openBlock(),t.createElementBlock("svg",NO,[...n[0]||(n[0]=[t.createElementVNode("path",{d:"M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q65 0 123 19t107 53l-58 59q-38-24-81-37.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133 0 226.5-93.5T800-480q0-18-2-36t-6-35l65-65q11 32 17 66t6 70q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm-56-216L254-466l56-56 114 114 400-401 56 56-456 457Z",fill:"currentColor"},null,-1)])])}const xO=Pe(EO,[["render",SO]]),va=[{id:"external_interaction",colors:{foreground:LN,background:vN},nodes:[{type:"call",icon:Se.NetworkIcon},{type:"cache",icon:Se.CachedIcon}]},{id:"control_flow",colors:{foreground:PN,background:NN},nodes:[{type:"branch",icon:Se.ArrowSplitIcon},{type:"exit",icon:Se.GatewayIcon}]},{id:"data_transformation",colors:{foreground:Lh,background:SN},nodes:[{type:"jq",icon:Se.CodeblockIcon},{type:"xml_to_json",icon:Se.DataObjectIcon},{type:"json_to_xml",icon:Se.CodeIcon}]},{id:"data_value",colors:{foreground:Dh,background:RN},nodes:[{type:"property",icon:Se.StackIcon},{type:"static",icon:Se.DeployIcon}]},{id:"authentication",colors:{foreground:VN,background:$N},nodes:[{type:"jwt_sign",icon:Se.EditSquareIcon},{type:"jwt_decode",icon:CO},{type:"jwt_verify",icon:xO}]}],AO=va.reduce((e,n)=>{for(const r of n.nodes)e[r.type]={icon:r.icon,colors:n.colors};return e},{}),Qo={vault:{icon:Se.KeyIcon},request:{icon:Se.CloudIcon},service_request:{icon:Se.CloudIcon},service_response:{icon:Se.CloudIcon},response:{icon:Se.CloudIcon}};function IO(e){return va.find(({id:n})=>n===e).colors}function sf(e){return AO[e]??Qo[e]}const{t:lf}=Vt.createI18n("en-us",Lt);function ei(e){return lf(`plugins.free-form.datakit.flow_editor.node_types.${e}.description`)}function vO(e){return lf(`plugins.free-form.datakit.flow_editor.node_types.${e}.summary`)}function TO(e){return lf(`plugins.free-form.datakit.flow_editor.node_panel.groups.${e}`)}const OO={call:{io:{input:{fields:[{name:"headers"},{name:"body"},{name:"query"}]},output:{fields:[{name:"headers"},{name:"body"},{name:"status"}]}}},jq:{io:{input:{fields:[],configurable:!0},output:{fields:[]}}},exit:{io:{input:{fields:[{name:"headers"},{name:"body"}]}}},property:{io:{input:{fields:[],configurable:!0},output:{fields:[]}}},static:{io:{output:{fields:[],configurable:!0}}},branch:{io:{input:{fields:[]},next:{branches:[{name:"then"},{name:"else"}]}}},cache:{io:{input:{fields:[{name:"data"},{name:"key"},{name:"ttl"}]},output:{fields:[{name:"data"},{name:"hit"},{name:"miss"},{name:"stored"}]}}},xml_to_json:{io:{input:{fields:[]},output:{fields:[]}}},json_to_xml:{io:{input:{fields:[],configurable:!0},output:{fields:[]}}},jwt_decode:{io:{input:{fields:[]},output:{fields:[{name:"header"},{name:"payload"},{name:"signature"}]}}},jwt_sign:{io:{input:{fields:[{name:"claims"},{name:"key"}]},output:{fields:[{name:"claims"},{name:"header"},{name:"token"}]}}},jwt_verify:{io:{input:{fields:[{name:"key"},{name:"token"}]},output:{fields:[{name:"claims"},{name:"header"}]}}}};function BO(e){return{id:e.id,title:TO(e.id),colors:IO(e.id),nodeTypes:e.nodes.map(({type:n})=>n)}}function PO(e,n){return{...OO[n.type],type:n.type,icon:n.icon,group:e.id,summary:vO(n.type),description:ei(n.type)}}const A_=va.reduce((e,n)=>(e[n.id]=BO(n),e),{}),ml=va.reduce((e,n)=>{for(const r of n.nodes)e[r.type]=PO(n,r);return e},{}),I_=va.map(e=>({...A_[e.id],nodes:e.nodes.map(({type:n})=>ml[n])}));function VO(e){return A_[e]}const gl={request:{type:"request",description:ei("request"),io:{output:{fields:[{name:"headers"},{name:"body"},{name:"query"}]}},...Qo.request},service_request:{type:"service_request",description:ei("service_request"),io:{input:{fields:[{name:"headers"},{name:"body"},{name:"query"}]}},...Qo.service_request},service_response:{type:"service_response",description:ei("service_response"),io:{output:{fields:[{name:"headers"},{name:"body"}]}},...Qo.service_response},response:{type:"response",description:ei("response"),io:{input:{fields:[{name:"headers"},{name:"body"}]}},...Qo.response},vault:{type:"vault",io:{output:{fields:[],configurable:!0}},...Qo.vault,hidden:!0}},cf=Object.keys(gl),df=e=>cf.includes(e),$O=e=>[...cf,...S_].includes(e),rn=e=>cf.includes(e),hl=e=>rn(e.type),uf=e=>!!e?.startsWith("node:"),Ta=e=>Object.prototype.hasOwnProperty.call(e,"ownerId");function _r(e){return Yu(e)}function ff(e,n){if(e.length!==n.length)return!1;if(e.length===0)return!0;const r=new Set(n);return e.every(o=>r.has(o))}function ti(e){return`${e}:${ef()}`}function yl(e){const[n,r]=e.split(".");return{nodeName:n,fieldName:r}}function v_(e){const[n,r]=e.split(".");return{nodeId:n,fieldId:r}}function ni(e){return rn(e)?gl[e]:ml[e]}function T_(e){const n=ni(e),r=n.io?.input?.fields.map(({name:i})=>i)??[],o=n.io?.output?.fields.map(({name:i})=>i)??[];return{input:r,output:o}}function Oa(e){return ni(e).io?.next?.branches?.map(({name:r})=>r)??[]}function O_(e){return(e??[]).map(n=>({id:ti("field"),name:n}))}function Ur(e,n,r){if(r)return e.fields[n].find(o=>o.name===r)}function jr(e,n,r){if(r)return e.fields[n].find(o=>o.id===r)}function pf(e,n){return n?e.fields.output.some(r=>r.id===n):!0}function B_(e,n){return n?e.fields.input.some(r=>r.id===n):!0}function RO(e){const n=["request","service_request","vault"].includes(e)?"request":"response",r=gl[e];return{name:e,phase:n,position:{x:0,y:0},fields:T_(r.type),expanded:{},hidden:r.hidden}}function P_(e,n){const o=(typeof e=="string"&&$O(e)?e.toUpperCase():e).replace(/_\d+$/,"");for(let i=1;;i++){const a=`${o}_${i}`;if(!n.has(a))return a}}function mf(e,n){return`${e}:${n}`}function LO(e){const n=e.lastIndexOf(":");if(n===-1)throw new Error(`Invalid group ID format: ${e}`);const r=e.slice(0,n),o=e.slice(n+1);return{nodeId:r,branch:o}}function _l(e,n){return`${e}:${n}`}function V_(e,n,r,o,i){return{id:mf(e,n),ownerId:e,branch:n,phase:r,memberIds:[...o],position:i?.position?{...i.position}:void 0,dimensions:i?.dimensions?{...i.dimensions}:void 0}}function FO(e,n,r,o,i){const a={...e.config,nodes:n};o!==void 0?a.resources=o:a.resources&&(a.resources=null);const s={...e.__ui_data,...r},l={...e,config:a,__ui_data:s};return i!=null?l.partials=[{id:i}]:l.partials&&(l.partials=null),l}function bl(e,n,r){const o=n?jr(e,r,n):void 0;return`${e.name}${o?`.${o.name}`:""}`}function Ba(e,n){const r=n(e.source),o=n(e.target);return[bl(r,e.sourceField,"output"),bl(o,e.targetField,"input")]}function gf(e,n,r,o,i){const a=i(e),s=i(r);return[bl(a,n,"output"),bl(s,o,"input")]}function $_(e){if(e.length===0)throw new Error("getBoundingRect requires at least one rect");let n=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(const{x:a,y:s,width:l,height:c}of e){if(![a,s,l,c].every(Number.isFinite))throw new Error("Rect values must be finite numbers");if(l<0||c<0)throw new RangeError("Rect width and height must be non-negative");const d=a+l,f=s+c;if(!Number.isFinite(d)||!Number.isFinite(f))throw new RangeError("Rect boundaries must be finite numbers");a<n&&(n=a),s<r&&(r=s),d>o&&(o=d),f>i&&(i=f)}return{x:n,y:r,width:o-n,height:i-r}}var R_=Object.defineProperty,DO=(e,n,r)=>n in e?R_(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,MO=(e,n)=>{for(var r in n)R_(e,r,{get:n[r],enumerable:!0})},UO=(e,n,r)=>DO(e,n+"",r),L_={};MO(L_,{Graph:()=>Xn,alg:()=>_f});var jO=Object.defineProperty,F_=(e,n)=>{for(var r in n)jO(e,r,{get:n[r],enumerable:!0})},hf=class{constructor(n){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},n&&(this._isDirected="directed"in n?n.directed:!0,this._isMultigraph="multigraph"in n?n.multigraph:!1,this._isCompound="compound"in n?n.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(n){return this._label=n,this}graph(){return this._label}setDefaultNodeLabel(n){return typeof n!="function"?this._defaultNodeLabelFn=()=>n:this._defaultNodeLabelFn=n,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(n=>Object.keys(this._in[n]).length===0)}sinks(){return this.nodes().filter(n=>Object.keys(this._out[n]).length===0)}setNodes(n,r){return n.forEach(o=>{r!==void 0?this.setNode(o,r):this.setNode(o)}),this}setNode(n,r){return n in this._nodes?(arguments.length>1&&(this._nodes[n]=r),this):(this._nodes[n]=arguments.length>1?r:this._defaultNodeLabelFn(n),this._isCompound&&(this._parent[n]="\0",this._children[n]={},this._children["\0"][n]=!0),this._in[n]={},this._preds[n]={},this._out[n]={},this._sucs[n]={},++this._nodeCount,this)}node(n){return this._nodes[n]}hasNode(n){return n in this._nodes}removeNode(n){if(n in this._nodes){let r=o=>this.removeEdge(this._edgeObjs[o]);delete this._nodes[n],this._isCompound&&(this._removeFromParentsChildList(n),delete this._parent[n],this.children(n).forEach(o=>{this.setParent(o)}),delete this._children[n]),Object.keys(this._in[n]).forEach(r),delete this._in[n],delete this._preds[n],Object.keys(this._out[n]).forEach(r),delete this._out[n],delete this._sucs[n],--this._nodeCount}return this}setParent(n,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r===void 0)r="\0";else{r+="";for(let o=r;o!==void 0;o=this.parent(o))if(o===n)throw new Error("Setting "+r+" as parent of "+n+" would create a cycle");this.setNode(r)}return this.setNode(n),this._removeFromParentsChildList(n),this._parent[n]=r,this._children[r][n]=!0,this}parent(n){if(this._isCompound){let r=this._parent[n];if(r!=="\0")return r}}children(n="\0"){if(this._isCompound){let r=this._children[n];if(r)return Object.keys(r)}else{if(n==="\0")return this.nodes();if(this.hasNode(n))return[]}return[]}predecessors(n){let r=this._preds[n];if(r)return Object.keys(r)}successors(n){let r=this._sucs[n];if(r)return Object.keys(r)}neighbors(n){let r=this.predecessors(n);if(r){let o=new Set(r),i=this.successors(n);if(i)for(let a of i)o.add(a);return Array.from(o.values())}}isLeaf(n){var r;let o;return this.isDirected()?o=this.successors(n):o=this.neighbors(n),((r=o?.length)!=null?r:0)===0}filterNodes(n){let r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph()),Object.entries(this._nodes).forEach(([a,s])=>{n(a)&&r.setNode(a,s)}),Object.values(this._edgeObjs).forEach(a=>{r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,this.edge(a))});let o={},i=a=>{let s=this.parent(a);return!s||r.hasNode(s)?(o[a]=s,s):s in o?o[s]:i(s)};return this._isCompound&&r.nodes().forEach(a=>r.setParent(a,i(a))),r}setDefaultEdgeLabel(n){return typeof n!="function"?this._defaultEdgeLabelFn=()=>n:this._defaultEdgeLabelFn=n,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(n,r){return n.reduce((o,i)=>(r!==void 0?this.setEdge(o,i,r):this.setEdge(o,i),i)),this}setEdge(n,r,o,i){let a,s,l,c,d=!1;typeof n=="object"&&n!==null&&"v"in n?(a=n.v,s=n.w,l=n.name,arguments.length===2&&(c=r,d=!0)):(a=n,s=r,l=i,arguments.length>2&&(c=o,d=!0)),a=""+a,s=""+s,l!==void 0&&(l=""+l);let f=Pa(this._isDirected,a,s,l);if(f in this._edgeLabels)return d&&(this._edgeLabels[f]=c),this;if(l!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(a),this.setNode(s),this._edgeLabels[f]=d?c:this._defaultEdgeLabelFn(a,s,l);let u=KO(this._isDirected,a,s,l);return a=u.v,s=u.w,Object.freeze(u),this._edgeObjs[f]=u,D_(this._preds[s],a),D_(this._sucs[a],s),this._in[s][f]=u,this._out[a][f]=u,this._edgeCount++,this}edge(n,r,o){let i=arguments.length===1?yf(this._isDirected,n):Pa(this._isDirected,n,r,o);return this._edgeLabels[i]}edgeAsObj(n,r,o){let i=arguments.length===1?this.edge(n):this.edge(n,r,o);return typeof i!="object"||i===null?{label:i}:i}hasEdge(n,r,o){return(arguments.length===1?yf(this._isDirected,n):Pa(this._isDirected,n,r,o))in this._edgeLabels}removeEdge(n,r,o){let i=arguments.length===1?yf(this._isDirected,n):Pa(this._isDirected,n,r,o),a=this._edgeObjs[i];if(a){let s=a.v,l=a.w;delete this._edgeLabels[i],delete this._edgeObjs[i],M_(this._preds[l],s),M_(this._sucs[s],l),delete this._in[l][i],delete this._out[s][i],this._edgeCount--}return this}inEdges(n,r){return this.isDirected()?this.filterEdges(this._in[n],n,r):this.nodeEdges(n,r)}outEdges(n,r){return this.isDirected()?this.filterEdges(this._out[n],n,r):this.nodeEdges(n,r)}nodeEdges(n,r){if(n in this._nodes)return this.filterEdges({...this._in[n],...this._out[n]},n,r)}_removeFromParentsChildList(n){delete this._children[this._parent[n]][n]}filterEdges(n,r,o){if(!n)return;let i=Object.values(n);return o?i.filter(a=>a.v===r&&a.w===o||a.v===o&&a.w===r):i}};function D_(e,n){e[n]?e[n]++:e[n]=1}function M_(e,n){e[n]!==void 0&&!--e[n]&&delete e[n]}function Pa(e,n,r,o){let i=""+n,a=""+r;if(!e&&i>a){let s=i;i=a,a=s}return i+""+a+""+(o===void 0?"\0":o)}function KO(e,n,r,o){let i=""+n,a=""+r;if(!e&&i>a){let l=i;i=a,a=l}let s={v:i,w:a};return o&&(s.name=o),s}function yf(e,n){return Pa(e,n.v,n.w,n.name)}var qO={};F_(qO,{read:()=>WO,write:()=>GO});function GO(e){let n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:zO(e),edges:HO(e)},r=e.graph();return r!==void 0&&(n.value=structuredClone(r)),n}function zO(e){return e.nodes().map(n=>{let r=e.node(n),o=e.parent(n),i={v:n};return r!==void 0&&(i.value=r),o!==void 0&&(i.parent=o),i})}function HO(e){return e.edges().map(n=>{let r=e.edge(n),o={v:n.v,w:n.w};return n.name!==void 0&&(o.name=n.name),r!==void 0&&(o.value=r),o})}function WO(e){let n=new hf(e.options);return e.value!==void 0&&n.setGraph(e.value),e.nodes.forEach(r=>{n.setNode(r.v,r.value),r.parent&&n.setParent(r.v,r.parent)}),e.edges.forEach(r=>{n.setEdge({v:r.v,w:r.w,name:r.name},r.value)}),n}var _f={};F_(_f,{CycleException:()=>kl,bellmanFord:()=>U_,components:()=>XO,dijkstra:()=>wl,dijkstraAll:()=>eB,findCycles:()=>tB,floydWarshall:()=>rB,isAcyclic:()=>iB,postorder:()=>sB,preorder:()=>lB,prim:()=>cB,shortestPaths:()=>dB,tarjan:()=>K_,topsort:()=>q_});var YO=()=>1;function U_(e,n,r,o){return JO(e,String(n),r||YO,o||function(i){var a;return(a=e.outEdges(i))!=null?a:[]})}function JO(e,n,r,o){let i={},a,s=0,l=e.nodes(),c=function(u){let p=i[u.v],g=i[u.w];if(!p||!g)return;let h=r(u);p.distance+h<g.distance&&(i[u.w]={distance:p.distance+h,predecessor:u.v},a=!0)},d=function(){l.forEach(function(u){o(u).forEach(function(p){let g=p.v===u?p.v:p.w,h=g===p.v?p.w:p.v;c({v:g,w:h})})})};l.forEach(function(u){let p=u===n?0:Number.POSITIVE_INFINITY;i[u]={distance:p,predecessor:""}});let f=l.length;for(let u=1;u<f&&(a=!1,s++,d(),!!a);u++);if(s===f-1&&(a=!1,d(),a))throw new Error("The graph contains a negative weight cycle");return i}function XO(e){let n={},r=[],o;function i(a){var s,l;a in n||(n[a]=!0,o.push(a),(s=e.successors(a))==null||s.forEach(i),(l=e.predecessors(a))==null||l.forEach(i))}return e.nodes().forEach(function(a){o=[],i(a),o.length&&r.push(o)}),r}var j_=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(n=>n.key)}has(n){return n in this._keyIndices}priority(n){let r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,r){let o=this._keyIndices,i=String(n);if(!(i in o)){let a=this._arr,s=a.length;return o[i]=s,a.push({key:i,priority:r}),this._decrease(s),!0}return!1}removeMin(){if(this.size()===0)throw new Error("Queue underflow");this._swap(0,this._arr.length-1);let n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,r){let o=this._keyIndices[n];if(o===void 0)throw new Error(`Key not found: ${n}`);let i=this._arr[o].priority;if(r>i)throw new Error(`New priority is greater than current priority. Key: ${n} Old: ${i} New: ${r}`);this._arr[o].priority=r,this._decrease(o)}_heapify(n){let r=this._arr,o=2*n,i=o+1,a=n;o<r.length&&(a=r[o].priority<r[a].priority?o:a,i<r.length&&(a=r[i].priority<r[a].priority?i:a),a!==n&&(this._swap(n,a),this._heapify(a)))}_decrease(n){let r=this._arr,o=r[n].priority,i;for(;n!==0&&(i=n>>1,!(r[i].priority<o));)this._swap(n,i),n=i}_swap(n,r){let o=this._arr,i=this._keyIndices,a=o[n],s=o[r];o[n]=s,o[r]=a,i[s.key]=n,i[a.key]=r}},ZO=()=>1;function wl(e,n,r,o){let i=function(a){var s;return(s=e.outEdges(a))!=null?s:[]};return QO(e,String(n),r||ZO,o||i)}function QO(e,n,r,o){let i={},a=new j_,s,l,c=function(d){let f=d.v!==s?d.v:d.w,u=i[f];if(!u)return;let p=r(d),g=l.distance+p;if(p<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+d+" Weight: "+p);g<u.distance&&(u.distance=g,u.predecessor=s,a.decrease(f,g))};for(e.nodes().forEach(function(d){let f=d===n?0:Number.POSITIVE_INFINITY;i[d]={distance:f,predecessor:""},a.add(d,f)});a.size()>0;){s=a.removeMin();let d=i[s];if(!d||d.distance===Number.POSITIVE_INFINITY)break;l=d,o(s).forEach(c)}return i}function eB(e,n,r){return e.nodes().reduce(function(o,i){return o[i]=wl(e,i,n,r),o},{})}function K_(e){let n=0,r=[],o={},i=[];function a(s){var l;let c=o[s]={onStack:!0,lowlink:n,index:n++};if(r.push(s),(l=e.successors(s))==null||l.forEach(function(d){if(d in o){let f=o[d];f!=null&&f.onStack&&(c.lowlink=Math.min(c.lowlink,f.index))}else{a(d);let f=o[d];f&&(c.lowlink=Math.min(c.lowlink,f.lowlink))}}),c.lowlink===c.index){let d=[],f;do{f=r.pop();let u=o[f];u&&(u.onStack=!1),d.push(f)}while(s!==f);i.push(d)}}return e.nodes().forEach(function(s){s in o||a(s)}),i}function tB(e){return K_(e).filter(function(n){var r;let o=n[0];return o?n.length>1||n.length===1&&((r=e.outEdges(o,o))!=null?r:[]).length>0:!1})}var nB=()=>1;function rB(e,n,r){return oB(e,n||nB,r||function(o){var i;return(i=e.outEdges(o))!=null?i:[]})}function oB(e,n,r){let o={},i=e.nodes();return i.forEach(function(a){let s={};o[a]=s,s[a]={distance:0,predecessor:""},i.forEach(function(l){a!==l&&(s[l]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),r(a).forEach(function(l){let c=l.v===a?l.w:l.v,d=n(l);s[c]={distance:d,predecessor:a}})}),i.forEach(function(a){let s=o[a];s&&i.forEach(function(l){let c=o[l];c&&i.forEach(function(d){let f=c[a],u=s[d],p=c[d];if(f&&u&&p){let g=f.distance+u.distance;g<p.distance&&(p.distance=g,p.predecessor=u.predecessor)}})})}),o}var kl=class extends Error{constructor(n){super(n),this.name="CycleException"}};function q_(e){let n={},r={},o=[];function i(a){var s;if(a in r)throw new kl;a in n||(r[a]=!0,n[a]=!0,(s=e.predecessors(a))==null||s.forEach(i),delete r[a],o.push(a))}if(e.sinks().forEach(i),Object.keys(n).length!==e.nodeCount())throw new kl;return o}function iB(e){try{q_(e)}catch(n){if(n instanceof kl)return!1;throw n}return!0}function aB(e,n,r,o,i){Array.isArray(n)||(n=[n]);let a=(l=>{var c;return(c=e.isDirected()?e.successors(l):e.neighbors(l))!=null?c:[]}),s={};return n.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);i=G_(e,l,r==="post",s,a,o,i)}),i}function G_(e,n,r,o,i,a,s){return n in o||(o[n]=!0,r||(s=a(s,n)),i(n).forEach(function(l){s=G_(e,l,r,o,i,a,s)}),r&&(s=a(s,n))),s}function z_(e,n,r){return aB(e,n,r,function(o,i){return o.push(i),o},[])}function sB(e,n){return z_(e,n,"post")}function lB(e,n){return z_(e,n,"pre")}function cB(e,n){var r;let o=new hf,i={},a=new j_,s;function l(f){let u=f.v===s?f.w:f.v,p=a.priority(u);if(p!==void 0){let g=n(f);g<p&&(i[u]=s,a.decrease(u,g))}}if(e.nodeCount()===0)return o;e.nodes().forEach(function(f){a.add(f,Number.POSITIVE_INFINITY),o.setNode(f)});let c=e.nodes()[0];c!==void 0&&a.decrease(c,0);let d=!1;for(;a.size()>0;){if(s=a.removeMin(),s in i)o.setEdge(s,i[s]);else{if(d)throw new Error("Input graph is not connected: "+e);d=!0}(r=e.nodeEdges(s))==null||r.forEach(l)}return o}function dB(e,n,r,o){return uB(e,n,r,o??(i=>{var a;return(a=e.outEdges(i))!=null?a:[]}))}function uB(e,n,r,o){if(r===void 0)return wl(e,n,r,o);let i=!1,a=e.nodes();for(let s=0;s<a.length;s++){let l=a[s];if(l===void 0)continue;let c=o(l);for(let d=0;d<c.length;d++){let f=c[d];if(!f)continue;let u=f.v===l?f.v:f.w,p=u===f.v?f.w:f.v;r({v:u,w:p})<0&&(i=!0)}if(i)return U_(e,n,r,o)}return wl(e,n,r,o)}var Xn=hf;function ri(e,n,r,o){let i=o;for(;e.hasNode(i);)i=bf(o);return r.dummy=n,e.setNode(i,r),i}function fB(e){let n=new Xn().setGraph(e.graph());return e.nodes().forEach(r=>n.setNode(r,e.node(r))),e.edges().forEach(r=>{let o=n.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);n.setEdge(r.v,r.w,{weight:o.weight+i.weight,minlen:Math.max(o.minlen,i.minlen)})}),n}function H_(e){let n=new Xn({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(r=>{e.children(r).length||n.setNode(r,e.node(r))}),e.edges().forEach(r=>{n.setEdge(r,e.edge(r))}),n}function W_(e,n){let r=e.x,o=e.y,i=n.x-r,a=n.y-o,s=e.width/2,l=e.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");let c,d;return Math.abs(a)*s>Math.abs(i)*l?(a<0&&(l=-l),c=l*i/a,d=l):(i<0&&(s=-s),c=s,d=s*a/i),{x:r+c,y:o+d}}function Cl(e){let n=Va(X_(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let o=e.node(r),i=o.rank;i!==void 0&&(n[i]||(n[i]=[]),n[i][o.order]=r)}),n}function pB(e){let n=e.nodes().map(o=>{let i=e.node(o).rank;return i===void 0?Number.MAX_VALUE:i}),r=Zn(Math.min,n);e.nodes().forEach(o=>{let i=e.node(o);Object.hasOwn(i,"rank")&&(i.rank-=r)})}function mB(e){let n=e.nodes().map(s=>e.node(s).rank).filter(s=>s!==void 0),r=Zn(Math.min,n),o=[];e.nodes().forEach(s=>{let l=e.node(s).rank-r;o[l]||(o[l]=[]),o[l].push(s)});let i=0,a=e.graph().nodeRankFactor;Array.from(o).forEach((s,l)=>{s===void 0&&l%a!==0?--i:s!==void 0&&i&&s.forEach(c=>e.node(c).rank+=i)})}function Y_(e,n,r,o){let i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=o),ri(e,"border",i,n)}function gB(e,n=J_){let r=[];for(let o=0;o<e.length;o+=n){let i=e.slice(o,o+n);r.push(i)}return r}var J_=65535;function Zn(e,n){if(n.length>J_){let r=gB(n);return e(...r.map(o=>e(...o)))}else return e(...n)}function X_(e){let n=e.nodes().map(r=>{let o=e.node(r).rank;return o===void 0?Number.MIN_VALUE:o});return Zn(Math.max,n)}function hB(e,n){let r={lhs:[],rhs:[]};return e.forEach(o=>{n(o)?r.lhs.push(o):r.rhs.push(o)}),r}function yB(e,n){return n()}var _B=0;function bf(e){let n=++_B;return e+(""+n)}function Va(e,n,r=1){n==null&&(n=e,e=0);let o=a=>a<n;r<0&&(o=a=>n<a);let i=[];for(let a=e;o(a);a+=r)i.push(a);return i}function El(e,n){let r={};for(let o of n)e[o]!==void 0&&(r[o]=e[o]);return r}function Nl(e,n){let r;return typeof n=="string"?r=o=>o[n]:r=n,Object.entries(e).reduce((o,[i,a])=>(o[i]=r(a,i),o),{})}function bB(e,n){return e.reduce((r,o,i)=>(r[o]=n[i],r),{})}var Sl="\0";function Z_(e,n,r){var o,i,a,s,l,c;if(!(e&&n&&r&&n.dummy==="edge"&&r.dummy==="edge"&&n.edgeObj&&r.edgeObj&&e[n.edgeObj.v]&&e[r.edgeObj.v]&&e[n.edgeObj.w]&&e[r.edgeObj.w]))return 0;let d=!0;n.edgeObj.w===r.edgeObj.w&&(d=!1);let f=d?(i=(o=e[n.edgeObj.v])==null?void 0:o.rank)!=null?i:NaN+1:(s=(a=e[n.edgeObj.w])==null?void 0:a.rank)!=null?s:NaN-1,u=Object.entries(e).find(y=>{var m,_;return((m=y[1].edgeObj)==null?void 0:m.v)===n.edgeObj.v&&((_=y[1].edgeObj)==null?void 0:_.w)===n.edgeObj.w&&y[1].rank===f}),p=Object.entries(e).find(y=>{var m,_;return((m=y[1].edgeObj)==null?void 0:m.v)===r.edgeObj.v&&((_=y[1].edgeObj)==null?void 0:_.w)===r.edgeObj.w&&y[1].rank===f});if(!u||!p)return 0;let g=(l=u[1].order)!=null?l:NaN,h=(c=p[1].order)!=null?c:NaN;return isNaN(g-h)?0:g-h}var wB=class{constructor(){UO(this,"_sentinel");let n={};n._next=n._prev=n,this._sentinel=n}dequeue(){let n=this._sentinel,r=n._prev;if(r!==n)return Q_(r),r}enqueue(n){let r=this._sentinel;n._prev&&n._next&&Q_(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){let n=[],r=this._sentinel,o=r._prev;for(;o!==r;)n.push(JSON.stringify(o,kB)),o=o._prev;return"["+n.join(", ")+"]"}};function Q_(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function kB(e,n){if(e!=="_next"&&e!=="_prev")return n}var CB=wB,EB=()=>1;function NB(e,n){if(e.nodeCount()<=1)return[];let r=xB(e,n||EB);return SB(r.graph,r.buckets,r.zeroIdx).flatMap(o=>e.outEdges(o.v,o.w)||[])}function SB(e,n,r){var o;let i=[],a=n[n.length-1],s=n[0],l;for(;e.nodeCount();){for(;l=s.dequeue();)wf(e,n,r,l);for(;l=a.dequeue();)wf(e,n,r,l);if(e.nodeCount()){for(let c=n.length-2;c>0;--c)if(l=(o=n[c])==null?void 0:o.dequeue(),l){i=i.concat(wf(e,n,r,l,!0)||[]);break}}}return i}function wf(e,n,r,o,i){let a=[],s=i?a:void 0;return(e.inEdges(o.v)||[]).forEach(l=>{let c=e.edge(l),d=e.node(l.v);i&&a.push({v:l.v,w:l.w}),d.out-=c,kf(n,r,d)}),(e.outEdges(o.v)||[]).forEach(l=>{let c=e.edge(l),d=l.w,f=e.node(d);f.in-=c,kf(n,r,f)}),e.removeNode(o.v),s}function xB(e,n){let r=new Xn,o=0,i=0;e.nodes().forEach(l=>{r.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=r.edge(l.v,l.w)||0,d=n(l),f=c+d;r.setEdge(l.v,l.w,f);let u=r.node(l.v),p=r.node(l.w);i=Math.max(i,u.out+=d),o=Math.max(o,p.in+=d)});let a=AB(i+o+3).map(()=>new CB),s=o+1;return r.nodes().forEach(l=>{kf(a,s,r.node(l))}),{graph:r,buckets:a,zeroIdx:s}}function kf(e,n,r){var o,i,a;r.out?r.in?(a=e[r.out-r.in+n])==null||a.enqueue(r):(i=e[e.length-1])==null||i.enqueue(r):(o=e[0])==null||o.enqueue(r)}function AB(e){let n=[];for(let r=0;r<e;r++)n.push(r);return n}function IB(e,n){(e.graph().acyclicer==="greedy"?NB(e,r(e)):vB(e,n??null)).forEach(o=>{let i=e.edge(o);e.removeEdge(o),i.forwardName=o.name,i.reversed=!0,e.setEdge(o.w,o.v,i,bf("rev"))});function r(o){return i=>o.edge(i).weight}}function vB(e,n){let r=[],o={},i={};function a(c){Object.hasOwn(i,c)||(i[c]=!0,o[c]=!0,e.outEdges(c).forEach(d=>{Object.hasOwn(o,d.w)?r.push(d):a(d.w)}),delete o[c])}function s(c){var d;Object.hasOwn(i,c)||(i[c]=!0,o[c]=!0,(d=e.outEdges(c))==null||d.forEach(f=>{var u,p;Object.hasOwn(o,f.w)||((u=n.node(c))==null?void 0:u.rank)>((p=n.node(f.w))==null?void 0:p.rank)&&OB(e,f.w,f)?r.push(f):s(f.w)}),delete o[c])}let l=a;return n&&typeof n.node=="function"&&(l=s),e.sources().forEach(l),e.nodes().forEach(l),r}function TB(e){e.edges().forEach(n=>{let r=e.edge(n);if(r.reversed){e.removeEdge(n);let o=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,o)}})}function OB(e,n,r){let o=new Set;function i(a){var s;if(e.sources().includes(a))return!0;o.add(a);for(let l of(s=e.inEdges(a))!=null?s:[])if(!(l.v===r.v&&l.w===r.w)&&!o.has(l.v)&&i(l.v))return!0;return!1}return i(n)}function BB(e){e.graph().dummyChains=[],e.edges().forEach(n=>PB(e,n))}function PB(e,n){let r=n.v,o=e.node(r).rank,i=n.w,a=e.node(i).rank,s=n.name,l=e.edge(n),c=l.labelRank;if(a===o+1)return;e.removeEdge(n);let d,f,u;for(u=0,++o;o<a;++u,++o)l.points=[],f={width:0,height:0,edgeLabel:l,edgeObj:n,rank:o},d=ri(e,"edge",f,"_d"),o===c&&(f.width=l.width,f.height=l.height,f.dummy="edge-label",f.labelpos=l.labelpos),e.setEdge(r,d,{weight:l.weight},s),u===0&&e.graph().dummyChains.push(d),r=d;e.setEdge(r,i,{weight:l.weight},s)}function VB(e){e.graph().dummyChains.forEach(n=>{let r=e.node(n),o=r.edgeLabel,i;for(e.setEdge(r.edgeObj,o);r.dummy;)i=e.successors(n)[0],e.removeNode(n),o.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),n=i,r=e.node(n)})}function Cf(e){let n={};function r(o){let i=e.node(o);if(Object.hasOwn(n,o))return i.rank;n[o]=!0;let a=e.outEdges(o),s=a?a.map(c=>c==null?Number.POSITIVE_INFINITY:r(c.w)-e.edge(c).minlen):[],l=Zn(Math.min,s);return l===Number.POSITIVE_INFINITY&&(l=0),i.rank=l}e.sources().forEach(r)}function oi(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}var eb=$B;function $B(e){let n=new Xn({directed:!1}),r=e.nodes();if(r.length===0)throw new Error("Graph must have at least one node");let o=r[0],i=e.nodeCount();n.setNode(o,{});let a,s;for(;RB(n,e)<i&&(a=LB(n,e),!!a);)s=n.hasNode(a.v)?oi(e,a):-oi(e,a),FB(n,e,s);return n}function RB(e,n){function r(o){let i=n.nodeEdges(o);i&&i.forEach(a=>{let s=a.v,l=o===s?a.w:s;!e.hasNode(l)&&!oi(n,a)&&(e.setNode(l,{}),e.setEdge(o,l,{}),r(l))})}return e.nodes().forEach(r),e.nodeCount()}function LB(e,n){return n.edges().reduce((r,o)=>{let i=Number.POSITIVE_INFINITY;return e.hasNode(o.v)!==e.hasNode(o.w)&&(i=oi(n,o)),i<r[0]?[i,o]:r},[Number.POSITIVE_INFINITY,null])[1]}function FB(e,n,r){e.nodes().forEach(o=>n.node(o).rank+=r)}var{preorder:DB,postorder:MB}=_f,UB=mo;mo.initLowLimValues=Nf,mo.initCutValues=Ef,mo.calcCutValue=tb,mo.leaveEdge=rb,mo.enterEdge=ob,mo.exchangeEdges=ib;function mo(e){e=fB(e),Cf(e);let n=eb(e);Nf(n),Ef(n,e);let r,o;for(;r=rb(n);)o=ob(n,e,r),ib(n,e,r,o)}function Ef(e,n){let r=MB(e,e.nodes());r=r.slice(0,r.length-1),r.forEach(o=>jB(e,n,o))}function jB(e,n,r){let o=e.node(r).parent,i=e.edge(r,o);i.cutvalue=tb(e,n,r)}function tb(e,n,r){let o=e.node(r).parent,i=!0,a=n.edge(r,o),s=0;a||(i=!1,a=n.edge(o,r)),s=a.weight;let l=n.nodeEdges(r);return l&&l.forEach(c=>{let d=c.v===r,f=d?c.w:c.v;if(f!==o){let u=d===i,p=n.edge(c).weight;if(s+=u?p:-p,qB(e,r,f)){let g=e.edge(r,f).cutvalue;s+=u?-g:g}}}),s}function Nf(e,n){arguments.length<2&&(n=e.nodes()[0]),nb(e,{},1,n)}function nb(e,n,r,o,i){let a=r,s=e.node(o);n[o]=!0;let l=e.neighbors(o);return l&&l.forEach(c=>{Object.hasOwn(n,c)||(r=nb(e,n,r,c,o))}),s.low=a,s.lim=r++,i?s.parent=i:delete s.parent,r}function rb(e){return e.edges().find(n=>e.edge(n).cutvalue<0)}function ob(e,n,r){let o=r.v,i=r.w;n.hasEdge(o,i)||(o=r.w,i=r.v);let a=e.node(o),s=e.node(i),l=a,c=!1;return a.lim>s.lim&&(l=s,c=!0),n.edges().filter(d=>c===ab(e,e.node(d.v),l)&&c!==ab(e,e.node(d.w),l)).reduce((d,f)=>oi(n,f)<oi(n,d)?f:d)}function ib(e,n,r,o){let i=r.v,a=r.w;e.removeEdge(i,a),e.setEdge(o.v,o.w,{}),Nf(e),Ef(e,n),KB(e,n)}function KB(e,n){let r=e.nodes().find(i=>!e.node(i).parent);if(!r)return;let o=DB(e,[r]);o=o.slice(1),o.forEach(i=>{let a=e.node(i).parent,s=n.edge(i,a),l=!1;s||(s=n.edge(a,i),l=!0),n.node(i).rank=n.node(a).rank+(l?s.minlen:-s.minlen)})}function qB(e,n,r){return e.hasEdge(n,r)}function ab(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}var GB=zB;function zB(e){let n=e.graph().ranker;if(typeof n=="function")return n(e);switch(n){case"network-simplex":sb(e);break;case"tight-tree":WB(e);break;case"longest-path":HB(e);break;case"none":break;default:sb(e)}}var HB=Cf;function WB(e){Cf(e),eb(e)}function sb(e){UB(e)}var YB=JB;function JB(e){let n=ZB(e),r=e.graph();Array.isArray(r.dummyChains)&&r.dummyChains.forEach(o=>{let i=e.node(o),a=i.edgeObj,s=XB(e,n,a.v,a.w),l=s.path,c=s.lca,d=0,f=l[d],u=!0;for(;o!==a.w;){if(i=e.node(o),u){for(;(f=l[d])!==c&&e.node(f).maxRank<i.rank;)d++;f===c&&(u=!1)}if(!u){for(;d<l.length-1&&e.node(l[d+1]).minRank<=i.rank;)d++;f=l[d]}f!==void 0&&e.setParent(o,f),o=e.successors(o)[0]}})}function XB(e,n,r,o){let i=[],a=[],s=Math.min(n[r].low,n[o].low),l=Math.max(n[r].lim,n[o].lim),c;c=r;do c=e.parent(c),i.push(c);while(c&&(n[c].low>s||l>n[c].lim));let d=c,f=o;for(;(f=e.parent(f))!==d;)a.push(f);return{path:i.concat(a.reverse()),lca:d}}function ZB(e){let n={},r=0;function o(i){let a=r;e.children(i).forEach(o),n[i]={low:a,lim:r++}}return e.children(Sl).forEach(o),n}function QB(e){let n=ri(e,"root",{},"_root"),r=eP(e),o=Object.values(r),i=Zn(Math.max,o)-1,a=2*i+1;e.graph().nestingRoot=n,e.edges().forEach(l=>e.edge(l).minlen*=a);let s=tP(e)+1;e.children(Sl).forEach(l=>{lb(e,n,a,s,i,r,l)}),e.graph().nodeRankFactor=a}function lb(e,n,r,o,i,a,s){var l;let c=e.children(s);if(!c.length){s!==n&&e.setEdge(n,s,{weight:0,minlen:r});return}let d=Y_(e,"_bt"),f=Y_(e,"_bb"),u=e.node(s);e.setParent(d,s),u.borderTop=d,e.setParent(f,s),u.borderBottom=f,c.forEach(p=>{var g;lb(e,n,r,o,i,a,p);let h=e.node(p),y=h.borderTop?h.borderTop:p,m=h.borderBottom?h.borderBottom:p,_=h.borderTop?o:2*o,b=y!==m?1:i-((g=a[s])!=null?g:0)+1;e.setEdge(d,y,{weight:_,minlen:b,nestingEdge:!0}),e.setEdge(m,f,{weight:_,minlen:b,nestingEdge:!0})}),e.parent(s)||e.setEdge(n,d,{weight:0,minlen:i+((l=a[s])!=null?l:0)})}function eP(e){let n={};function r(o,i){let a=e.children(o);a&&a.length&&a.forEach(s=>r(s,i+1)),n[o]=i}return e.children(Sl).forEach(o=>r(o,1)),n}function tP(e){return e.edges().reduce((n,r)=>n+e.edge(r).weight,0)}function nP(e){let n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,e.edges().forEach(r=>{e.edge(r).nestingEdge&&e.removeEdge(r)})}var rP=oP;function oP(e){function n(r){let o=e.children(r),i=e.node(r);if(o.length&&o.forEach(n),i&&Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let a=i.minRank,s=i.maxRank+1;a<s;++a)cb(e,"borderLeft","_bl",r,i,a),cb(e,"borderRight","_br",r,i,a)}}e.children(Sl).forEach(n)}function cb(e,n,r,o,i,a){let s={width:0,height:0,rank:a,borderType:n},l=i[n][a-1],c=ri(e,"border",s,r);i[n][a]=c,e.setParent(c,o),l&&e.setEdge(l,c,{weight:1})}function iP(e){var n;let r=(n=e.graph().rankdir)==null?void 0:n.toLowerCase();(r==="lr"||r==="rl")&&db(e)}function aP(e){var n;let r=(n=e.graph().rankdir)==null?void 0:n.toLowerCase();(r==="bt"||r==="rl")&&sP(e),(r==="lr"||r==="rl")&&(lP(e),db(e))}function db(e){e.nodes().forEach(n=>ub(e.node(n))),e.edges().forEach(n=>ub(e.edge(n)))}function ub(e){let n=e.width;e.width=e.height,e.height=n}function sP(e){e.nodes().forEach(n=>Sf(e.node(n))),e.edges().forEach(n=>{var r;let o=e.edge(n);(r=o.points)==null||r.forEach(Sf),Object.hasOwn(o,"y")&&Sf(o)})}function Sf(e){e.y=-e.y}function lP(e){e.nodes().forEach(n=>xf(e.node(n))),e.edges().forEach(n=>{var r;let o=e.edge(n);(r=o.points)==null||r.forEach(xf),Object.hasOwn(o,"x")&&xf(o)})}function xf(e){let n=e.x;e.x=e.y,e.y=n}function cP(e,n=null){let r={},o=e.nodes().filter(d=>!e.children(d).length),i=o.map(d=>e.node(d).rank),a=Zn(Math.max,i),s=Va(a+1).map(()=>[]);function l(d){if(r[d])return;r[d]=!0;let f=e.node(d);s[f.rank].push(d);let u=e.successors(d);u&&[...u].sort((p,g)=>c(p,g)).forEach(l)}o.sort((d,f)=>e.node(d).rank-e.node(f).rank).forEach(l);function c(d,f){let u=e.node(d),p=e.node(f);return Z_(n,u,p)}return s}function dP(e,n){let r=0;for(let o=1;o<n.length;++o)r+=uP(e,n[o-1],n[o]);return r}function uP(e,n,r){let o=bB(r,r.map((d,f)=>f)),i=n.flatMap(d=>{let f=e.outEdges(d);return f?f.map(u=>({pos:o[u.w],weight:e.edge(u).weight})).sort((u,p)=>u.pos-p.pos):[]}),a=1;for(;a<r.length;)a<<=1;let s=2*a-1;a-=1;let l=new Array(s).fill(0),c=0;return i.forEach(d=>{let f=d.pos+a;l[f]+=d.weight;let u=0;for(;f>0;)f%2&&(u+=l[f+1]),f=f-1>>1,l[f]+=d.weight;c+=d.weight*u}),c}function fP(e,n=[]){return n.map(r=>{let o=e.inEdges(r);if(!o||!o.length)return{v:r};{let i=o.reduce((a,s)=>{let l=e.edge(s),c=e.node(s.v);return{sum:a.sum+l.weight*c.order,weight:a.weight+l.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}})}function pP(e,n){let r={};e.forEach((i,a)=>{let s={indegree:0,in:[],out:[],vs:[i.v],i:a};i.barycenter!==void 0&&(s.barycenter=i.barycenter,s.weight=i.weight),r[i.v]=s}),n.edges().forEach(i=>{let a=r[i.v],s=r[i.w];a!==void 0&&s!==void 0&&(s.indegree++,a.out.push(s))});let o=Object.values(r).filter(i=>!i.indegree);return mP(o)}function mP(e){let n=[];function r(i){return a=>{a.merged||(a.barycenter===void 0||i.barycenter===void 0||a.barycenter>=i.barycenter)&&gP(i,a)}}function o(i){return a=>{a.in.push(i),--a.indegree===0&&e.push(a)}}for(;e.length;){let i=e.pop();n.push(i),i.in.reverse().forEach(r(i)),i.out.forEach(o(i))}return n.filter(i=>!i.merged).map(i=>El(i,["vs","i","barycenter","weight"]))}function gP(e,n){let r=0,o=0;e.weight&&(r+=e.barycenter*e.weight,o+=e.weight),n.weight&&(r+=n.barycenter*n.weight,o+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/o,e.weight=o,e.i=Math.min(n.i,e.i),n.merged=!0}function hP(e,n,r,o,i){let a={},s=null,l=null,c=i;typeof n=="boolean"?(c=n,a={}):n&&(a=n,s=r??null,l=o??null);let d=hB(e,_=>Object.hasOwn(_,"barycenter")),f=d.lhs,u=d.rhs.sort((_,b)=>b.i-_.i),p=[],g=0,h=0,y=0;f.sort(yP(l,s,!!c));for(let[_,b]of Object.entries(a)){let k=f.findIndex(A=>A.vs[0]===_);f.splice(k+1,0,b)}y=fb(p,u,y),f.forEach(_=>{y+=_.vs.length,p.push(_.vs),g+=_.barycenter*_.weight,h+=_.weight,y=fb(p,u,y)});let m={vs:p.flat(1)};return h&&(m.barycenter=g/h,m.weight=h),m}function fb(e,n,r){let o;for(;n.length&&(o=n[n.length-1]).i<=r;)n.pop(),e.push(o.vs),r++;return r}function yP(e,n,r){return(o,i)=>{if(o.barycenter<i.barycenter)return-1;if(o.barycenter>i.barycenter)return 1;if(e&&(typeof o.vs[0]=="string"||typeof i.vs[0]=="string")){let a=e.node(o.vs[0]),s=e.node(i.vs[0]),l=Z_(n,a,s);if(l!==0)return l}return r?i.i-o.i:o.i-i.i}}function pb(e,n,r,o,i){var a,s,l,c,d,f,u,p,g,h,y;let m=null,_=i;typeof o=="boolean"?(_=o,m=null):o!==void 0&&(m=o);let b=e.children(n),k=e.node(n),A=k?k.borderLeft:void 0,C=k?k.borderRight:void 0,w={};A&&(b=b.filter(B=>B!==A&&B!==C));let x=fP(e,b);x.forEach(B=>{if(e.children(B.v).length){let{result:P}=pb(e,B.v,r,m,_);w[B.v]=P,Object.hasOwn(P,"barycenter")&&bP(B,P)}});let I=pP(x,r);_P(I,w);let T={},v=!1;for(let B=0;B<I.length;B++)for(let P=B+1;P<I.length;P++)if(!(!I[B]||!I[P]||!((a=I[B])!=null&&a.barycenter)||!((s=I[P])!=null&&s.barycenter))&&((l=I[B])==null?void 0:l.barycenter)===I[P].barycenter){let R=(d=(c=I[B])==null?void 0:c.vs[0])!=null?d:"",F=(u=(f=I[P])==null?void 0:f.vs[0])!=null?u:"",X=e.node(R),Z=e.node(F);if(X.dummy==="edge"&&Z.dummy==="edge"&&((p=X.edgeObj)==null?void 0:p.v)===((g=Z.edgeObj)==null?void 0:g.v)&&((h=X.edgeObj)==null?void 0:h.w)===((y=Z.edgeObj)==null?void 0:y.w))if(X.edgeLabel.reversed){T[F]=I[B],I.splice(B,1),B--;break}else T[R]=I[P],I.splice(P,1),P--;else v=!0}let S=hP(I,T,m,e,_);if(A&&C){S.vs=[A,S.vs,C].flat(1);let B=e.predecessors(A);if(B&&B.length){let P=e.node(B[0]),R=e.predecessors(C),F=e.node(R[0]);Object.hasOwn(S,"barycenter")||(S.barycenter=0,S.weight=0),S.barycenter=(S.barycenter*S.weight+P.order+F.order)/(S.weight+2),S.weight+=2}}return Object.defineProperty(S,"result",{value:S,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(S,"usedBias",{value:v,enumerable:!1,configurable:!0,writable:!0}),S}function _P(e,n){e.forEach(r=>{r.vs=r.vs.flatMap(o=>n[o]?n[o].vs:o)})}function bP(e,n){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight):(e.barycenter=n.barycenter,e.weight=n.weight)}function wP(e,n,r,o){o||(o=e.nodes());let i=kP(e),a=new Xn({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(s=>e.node(s));return o.forEach(s=>{let l=e.node(s),c=e.parent(s);if(l.rank===n||l.minRank<=n&&n<=l.maxRank){a.setNode(s),a.setParent(s,c||i);let d=e[r](s);d&&d.forEach(f=>{let u=f.v===s?f.w:f.v,p=a.edge(u,s),g=p!==void 0?p.weight:0;a.setEdge(u,s,{weight:e.edge(f).weight+g})}),Object.hasOwn(l,"minRank")&&a.setNode(s,{borderLeft:l.borderLeft[n],borderRight:l.borderRight[n]})}}),a}function kP(e){let n;for(;e.hasNode(n=bf("_root")););return n}function CP(e,n,r){let o={},i;r.forEach(a=>{let s=e.parent(a),l,c;for(;s;){if(l=e.parent(s),l?(c=o[l],o[l]=s):(c=i,i=s),c&&c!==s){n.setEdge(c,s);return}s=l}})}function mb(e,n={},r=null){if(typeof n.customOrder=="function"){n.customOrder(e,mb);return}let o=X_(e),i=gb(e,Va(1,o+1),"inEdges"),a=gb(e,Va(o-1,-1,-1),"outEdges"),s=cP(e,r);if(hb(e,s),n.disableOptimalOrderHeuristic)return;let l=Number.POSITIVE_INFINITY,c,d=n.constraints||[];for(let f=0,u=0;u<4;++f,++u){EP(f%2?i:a,f%4>=2,d,r),s=Cl(e);let p=dP(e,s);p<l?(u=0,c=Object.assign({},s),l=p):p===l&&(c=structuredClone(s))}hb(e,c)}function gb(e,n,r){let o=new Map,i=(a,s)=>{o.has(a)||o.set(a,[]),o.get(a).push(s)};for(let a of e.nodes()){let s=e.node(a);if(typeof s.rank=="number"&&i(s.rank,a),typeof s.minRank=="number"&&typeof s.maxRank=="number")for(let l=s.minRank;l<=s.maxRank;l++)l!==s.rank&&i(l,a)}return n.map(function(a){return wP(e,a,r,o.get(a)||[])})}function EP(e,n,r,o){let i=!0,a=new Xn;e.forEach(function(s){r.forEach(f=>a.setEdge(f.left,f.right));let l=s.graph().root,{result:c,usedBias:d}=pb(s,l,a,o,i);n&&d&&(i=!i),c.vs.forEach((f,u)=>s.node(f).order=u),CP(s,a,c.vs)})}function hb(e,n){Object.values(n).forEach(r=>r.forEach((o,i)=>e.node(o).order=i))}function NP(e,n){let r={};function o(i,a){let s=0,l=0,c=i.length,d=a[a.length-1];return a.forEach((f,u)=>{let p=xP(e,f),g=p?e.node(p).order:c;(p||f===d)&&(a.slice(l,u+1).forEach(h=>{let y=e.predecessors(h);y&&y.forEach(m=>{let _=e.node(m),b=_.order;(b<s||g<b)&&!(_.dummy&&e.node(h).dummy)&&yb(r,m,h)})}),l=u+1,s=g)}),a}return n.length&&n.reduce(o),r}function SP(e,n){let r={};function o(a,s,l,c,d){Va(s,l).forEach(f=>{let u=a[f];if(u!==void 0&&e.node(u).dummy){let p=e.predecessors(u);p&&p.forEach(g=>{if(g===void 0)return;let h=e.node(g);h.dummy&&(h.order<c||h.order>d)&&yb(r,g,u)})}})}function i(a,s){let l=-1,c=-1,d=0;return s.forEach((f,u)=>{if(e.node(f).dummy==="border"){let p=e.predecessors(f);if(p&&p.length){let g=p[0];if(g===void 0)return;c=e.node(g).order,o(s,d,u,l,c),d=u,l=c}}o(s,d,s.length,c,a.length)}),s}return n.length&&n.reduce(i),r}function xP(e,n){if(e.node(n).dummy){let r=e.predecessors(n);if(r)return r.find(o=>e.node(o).dummy)}}function yb(e,n,r){if(n>r){let i=n;n=r,r=i}let o=e[n];o||(e[n]=o={}),o[r]=!0}function AP(e,n,r){if(n>r){let i=n;n=r,r=i}let o=e[n];return o!==void 0&&Object.hasOwn(o,r)}function IP(e,n,r,o,i){let a={},s={},l={};return n.forEach(c=>{c.forEach((d,f)=>{a[d]=d,s[d]=d,l[d]=f})}),n.forEach(c=>{let d=-1,f=-1,u=!1,p=c,g=c.findIndex(h=>i?.includes(h)||_b(h,e,i));g>0&&(p=[c[g],...c.slice(0,g),...c.slice(g+1)],u=!0),p.forEach(h=>{var y;let m=o(h);if(m&&m.length){i!=null&&i.includes(h)&&(m=m.filter(k=>_b(k,e,i)));let _=m.sort((k,A)=>{let C=l[k],w=l[A];return(C!==void 0?C:0)-(w!==void 0?w:0)}),b=(_.length-1)/2;for(let k=Math.floor(b),A=Math.ceil(b);k<=A;++k){let C=_[k];if(C===void 0)continue;let w=l[C];if(w!==void 0&&s[h]===h&&d<w&&l[C]!==f&&!AP(r,h,C)){let x=a[C];x!==void 0&&(s[C]=h,s[h]=a[h]=x,d=w,u&&(d=-1,f=(y=l[C])!=null?y:-1,u=!1))}}}})}),{root:a,align:s}}function vP(e,n,r,o,i=!1){let a={},s=TP(e,n,r,i),l=i?"borderLeft":"borderRight";function c(g,h){let y=s.nodes().slice(),m={},_=y.pop();for(;_;){if(m[_])g(_);else{m[_]=!0,y.push(_);for(let b of h(_))y.push(b)}_=y.pop()}}function d(g){let h=s.inEdges(g);h?a[g]=h.reduce((y,m)=>{var _;let b=(_=a[m.v])!=null?_:0,k=s.edge(m);return Math.max(y,b+(k!==void 0?k:0))},0):a[g]=0}function f(g){let h=s.outEdges(g),y=Number.POSITIVE_INFINITY;h&&(y=h.reduce((_,b)=>{let k=a[b.w],A=s.edge(b);return Math.min(_,(k!==void 0?k:0)-(A!==void 0?A:0))},Number.POSITIVE_INFINITY));let m=e.node(g);y!==Number.POSITIVE_INFINITY&&m.borderType!==l&&(a[g]=Math.max(a[g]!==void 0?a[g]:0,y))}function u(g){return s.predecessors(g)||[]}function p(g){return s.successors(g)||[]}return c(d,u),c(f,p),Object.keys(o).forEach(g=>{var h;let y=r[g];y!==void 0&&(a[g]=(h=a[y])!=null?h:0)}),a}function TP(e,n,r,o){let i=new Xn,a=e.graph(),s=$P(a.nodesep,a.edgesep,o);return n.forEach(l=>{let c;l.forEach(d=>{let f=r[d];if(f!==void 0){if(i.setNode(f),c!==void 0){let u=r[c];if(u!==void 0){let p=i.edge(u,f);i.setEdge(u,f,Math.max(s(e,d,c),p||0))}}c=d}})}),i}function OP(e,n){return Object.values(n).reduce((r,o)=>{let i=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;Object.entries(o).forEach(([l,c])=>{let d=RP(e,l)/2;i=Math.max(c+d,i),a=Math.min(c-d,a)});let s=i-a;return s<r[0]&&(r=[s,o]),r},[Number.POSITIVE_INFINITY,null])[1]}function BP(e,n){let r=Object.values(n),o=Zn(Math.min,r),i=Zn(Math.max,r);["u","d"].forEach(a=>{["l","r"].forEach(s=>{let l=a+s,c=e[l];if(!c||c===n)return;let d=Object.values(c),f=o-Zn(Math.min,d);s!=="l"&&(f=i-Zn(Math.max,d)),f&&(e[l]=Nl(c,u=>u+f))})})}function PP(e,n=void 0){let r=e.ul;return r?Nl(r,(o,i)=>{var a,s;if(n){let c=n.toLowerCase(),d=e[c];if(d&&d[i]!==void 0)return d[i]}let l=Object.values(e).map(c=>{let d=c[i];return d!==void 0?d:0}).sort((c,d)=>c-d);return(((a=l[1])!=null?a:0)+((s=l[2])!=null?s:0))/2}):{}}function VP(e,n){let r=Cl(e),o=Object.assign(NP(e,r),SP(e,r)),i={},a;["u","d"].forEach(l=>{a=l==="u"?r:Object.values(r).reverse(),["l","r"].forEach(c=>{c==="r"&&(a=a.map(u=>Object.values(u).reverse()));let d=IP(e,a,o,u=>(l==="u"?e.predecessors(u):e.successors(u))||[],n),f=vP(e,a,d.root,d.align,c==="r");c==="r"&&(f=Nl(f,u=>-u)),i[l+c]=f})});let s=OP(e,i);return BP(i,s),PP(i,e.graph().align)}function $P(e,n,r){return(o,i,a)=>{let s=o.node(i),l=o.node(a),c=0,d;if(c+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":d=-s.width/2;break;case"r":d=s.width/2;break}if(d&&(c+=r?d:-d),d=void 0,c+=(s.dummy?n:e)/2,c+=(l.dummy?n:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":d=l.width/2;break;case"r":d=-l.width/2;break}return d&&(c+=r?d:-d),c}}function RP(e,n){return e.node(n).width}function _b(e,n,r){var o;if(!r)return!1;let i=(o=n.node(e))==null?void 0:o.edgeObj;if(!i||n.node(e).edgeLabel.reversed)return!1;let a=r.indexOf(i?.v),s=r.indexOf(i?.w);return a!==-1&&s!==-1&&a===(s+1)%r.length||a===(s-1)%r.length}function LP(e,n){e=H_(e),FP(e),Object.entries(VP(e,n)).forEach(([r,o])=>e.node(r).x=o)}function FP(e){let n=Cl(e),r=e.graph(),o=r.ranksep,i=r.rankalign,a=0;n.forEach(s=>{let l=s.reduce((c,d)=>{var f;let u=(f=e.node(d).height)!=null?f:0;return c>u?c:u},0);s.forEach(c=>{let d=e.node(c);i==="top"?d.y=a+d.height/2:i==="bottom"?d.y=a+l-d.height/2:d.y=a+l/2}),a+=l+o})}var bb=new WeakMap;function DP(e,n={}){return kb(e,yB,n),e}function wb(e,n,r){let o=n;for(;o!==void 0;){let i=e.parent(o);if(i===r)return o;o=i}}function kb(e,n,r){var o;let i=e.nodes().filter(b=>e.children(b).length),a={};i.forEach(b=>{let k=e.node(b);if(k&&k.rankdir){let A=new Xn({multigraph:!0,compound:!0});A.setGraph({rankdir:k.rankdir});let C=e.children(b);C.forEach(R=>{let F={...e.node(R)};A.setNode(R,F);let X=e.parent(R);X&&X!==b&&C.includes(X)&&A.setParent(R,X)});let w=new Set;e.edges().forEach(R=>{let F=wb(e,R.v,b),X=wb(e,R.w,b);if(F&&X&&F!==X){let Z=`${F}\0${X}`;w.has(Z)||(w.add(Z),A.setEdge(F,X,{...e.edge(R)}))}}),kb(A,n,r);let x=Sb(A);Cb(x,n,r,null),Eb(A,x);let I=1/0,T=1/0,v=-1/0,S=-1/0;A.nodes().forEach(R=>{if(R===b)return;let F=A.node(R);F&&typeof F.x=="number"&&typeof F.y=="number"&&typeof F.width=="number"&&typeof F.height=="number"&&(I=Math.min(I,F.x-F.width/2),v=Math.max(v,F.x+F.width/2),T=Math.min(T,F.y-F.height/2),S=Math.max(S,F.y+F.height/2))}),(!isFinite(I)||!isFinite(T)||!isFinite(v)||!isFinite(S))&&(I=T=0,v=S=0);let B=v-I,P=S-T;a[b]={minX:I,minY:T,maxX:v,maxY:S,width:B,height:P,offsetX:I,offsetY:T},k._dagreClusterSubgraph=A}});let s=[],l=b=>{let k=[],A=(e.children(b)||[]).filter(C=>C!==b);for(;A.length>0;){let C=A.shift();k.push(C),(e.children(C)||[]).filter(w=>w!==C).forEach(w=>A.push(w))}return k},c=new Map;i.forEach(b=>{let k=e.node(b);k&&k.rankdir&&a[b]&&c.set(b,(e.children(b)||[]).filter(A=>A!==b))});let d=new Set([...c.values()].flat()),f=new Map;c.forEach((b,k)=>{d.has(k)||f.set(k,l(k))});let u=new Set([...f.values()].flat()),p=b=>{for(let[k,A]of f)if(A.includes(b))return k;return b},g=[];e.edges().forEach(b=>{(u.has(b.v)||u.has(b.w))&&g.push({edge:b,label:e.edge(b)})});let h=new Map;u.forEach(b=>{let k=e.parent(b);h.set(b,typeof k=="string"?k:void 0)}),f.forEach((b,k)=>{let A=e.node(k),C=[];b.forEach(I=>{let T=e.node(I);T&&(C.push({id:I,node:T,parent:h.get(I)}),e.removeNode(I))});let w=g.filter(({edge:I})=>b.includes(I.v)||b.includes(I.w)),x=a[k];A&&(s.push({clusterId:k,subgraph:A._dagreClusterSubgraph,bounds:x,children:b,removedNodes:C,removedEdges:w}),A.width=x.width,A.height=x.height)});let y=new Set;g.forEach(({edge:b,label:k})=>{let A=p(b.v),C=p(b.w);if(A!==C&&e.hasNode(A)&&e.hasNode(C)){let w=`${A}\0${C}`;y.has(w)||(y.add(w),e.setEdge(A,C,{...k,width:0,height:0}))}});let m=Sb(e),_=Cb(m,n,r,(o=bb.get(e))!=null?o:null);bb.set(e,_),Eb(e,m),y.forEach(b=>{let k=b.indexOf("\0"),A=b.slice(0,k),C=b.slice(k+1);e.hasEdge(A,C)&&e.removeEdge(A,C)}),s.forEach(({clusterId:b,subgraph:k,bounds:A,removedNodes:C,removedEdges:w})=>{var x,I;let T=e.node(b),v=(x=T?.x)!=null?x:0,S=(I=T?.y)!=null?I:0,B=(A.minX+A.maxX)/2,P=(A.minY+A.maxY)/2;C.forEach(({id:R,node:F,parent:X})=>{e.setNode(R,F),X!==void 0&&e.setParent(R,X)}),w.forEach(({edge:R,label:F})=>{e.setEdge(R,F)}),k.nodes().forEach(R=>{if(R===b)return;let F=k.node(R),X=e.node(R);X&&F&&typeof F.x=="number"&&typeof F.y=="number"&&(X.x=v+(F.x-B),X.y=S+(F.y-P))}),delete T._dagreClusterSubgraph}),i.forEach(b=>{var k,A;let C=e.node(b),w=a[b];if(C&&C.rankdir&&C._dagreClusterSubgraph&&w){let x=C._dagreClusterSubgraph,I=(k=C.x)!=null?k:0,T=(A=C.y)!=null?A:0,v=(w.minX+w.maxX)/2,S=(w.minY+w.maxY)/2;x.nodes().forEach(B=>{if(B===b)return;let P=x.node(B),R=e.node(B);if(R&&P&&typeof P.x=="number"&&typeof P.y=="number"){let F=P.x-v,X=P.y-S;R.x=I+F,R.y=T+X}}),delete C._dagreClusterSubgraph}})}function Cb(e,n,r,o=null){var i,a;let s=r?.useDynamic!==!1,l=s&&(i=o?.graph)!=null?i:null,c=s&&(a=o?.rawNodes)!=null?a:null;n(" makeSpaceForEdgeLabels",()=>HP(e)),n(" removeSelfEdges",()=>nV(e)),n(" acyclic",()=>IB(e,l)),n(" nestingGraph.run",()=>QB(e)),n(" rank",()=>GB(H_(e))),n(" injectEdgeLabelProxies",()=>WP(e)),n(" removeEmptyRanks",()=>mB(e)),n(" nestingGraph.cleanup",()=>nP(e)),n(" normalizeRanks",()=>pB(e)),n(" assignRankMinMax",()=>YP(e)),n(" removeEdgeLabelProxies",()=>JP(e)),n(" normalize.run",()=>BB(e)),n(" parentDummyChains",()=>YB(e)),n(" addBorderSegments",()=>rP(e)),n(" order",()=>mb(e,r,c)),n(" insertSelfEdges",()=>rV(e)),n(" adjustCoordinateSystem",()=>iP(e)),n(" position",()=>LP(e,r.corePath)),n(" positionSelfEdges",()=>oV(e));let d=JSON.parse(JSON.stringify(e._nodes));return n(" removeBorderNodes",()=>tV(e)),n(" normalize.undo",()=>VB(e)),n(" fixupEdgeLabelCoords",()=>QP(e)),n(" undoCoordinateSystem",()=>aP(e)),n(" translateGraph",()=>XP(e)),n(" assignNodeIntersects",()=>ZP(e)),n(" reversePoints",()=>eV(e)),n(" acyclic.undo",()=>TB(e)),{graph:e,rawNodes:d}}function Eb(e,n){e.nodes().forEach(r=>{let o=e.node(r),i=n.node(r);o&&(o.x=i.x,o.y=i.y,o.order=i.order,o.rank=i.rank,n.children(r).length&&(o.width=i.width,o.height=i.height))}),e.edges().forEach(r=>{let o=e.edge(r),i=n.edge(r);o.points=i.points,Object.hasOwn(i,"x")&&(o.x=i.x,o.y=i.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var MP=["nodesep","edgesep","ranksep","marginx","marginy"],UP={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},jP=["acyclicer","ranker","rankdir","align","rankalign"],KP=["width","height","rank"],Nb={width:0,height:0},qP=["minlen","weight","width","height","labeloffset"],GP={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},zP=["labelpos"];function Sb(e){let n=new Xn({multigraph:!0,compound:!0}),r=If(e.graph());return n.setGraph(Object.assign({},UP,Af(r,MP),El(r,jP))),e.nodes().forEach(o=>{let i=If(e.node(o)),a=Af(i,KP);Object.keys(Nb).forEach(l=>{a[l]===void 0&&(a[l]=Nb[l])}),n.setNode(o,a);let s=e.parent(o);s!==void 0&&n.setParent(o,s)}),e.edges().forEach(o=>{let i=If(e.edge(o));n.setEdge(o,Object.assign({},GP,Af(i,qP),El(i,zP)))}),n}function HP(e){let n=e.graph();n.ranksep/=2,e.edges().forEach(r=>{var o;let i=e.edge(r);i.minlen*=2,((o=i.labelpos)!=null?o:"r").toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})}function WP(e){e.edges().forEach(n=>{let r=e.edge(n);if(r.width&&r.height){let o=e.node(n.v),i={rank:(e.node(n.w).rank-o.rank)/2+o.rank,e:n};ri(e,"edge-proxy",i,"_ep")}})}function YP(e){let n=0;e.nodes().forEach(r=>{let o=e.node(r);o.borderTop&&(o.minRank=e.node(o.borderTop).rank,o.maxRank=e.node(o.borderBottom).rank,n=Math.max(n,o.maxRank))}),e.graph().maxRank=n}function JP(e){e.nodes().forEach(n=>{let r=e.node(n);if(r.dummy==="edge-proxy"){let o=r;e.edge(o.e).labelRank=r.rank,e.removeNode(n)}})}function XP(e){let n=Number.POSITIVE_INFINITY,r=0,o=Number.POSITIVE_INFINITY,i=0,a=e.graph(),s=a.marginx||0,l=a.marginy||0;function c(d){let f=d.x,u=d.y,p=d.width,g=d.height;n=Math.min(n,f-p/2),r=Math.max(r,f+p/2),o=Math.min(o,u-g/2),i=Math.max(i,u+g/2)}e.nodes().forEach(d=>c(e.node(d))),e.edges().forEach(d=>{let f=e.edge(d);Object.hasOwn(f,"x")&&c(f)}),n-=s,o-=l,e.nodes().forEach(d=>{let f=e.node(d);f.x-=n,f.y-=o}),e.edges().forEach(d=>{let f=e.edge(d);f.points.forEach(u=>{u.x-=n,u.y-=o}),Object.hasOwn(f,"x")&&(f.x-=n),Object.hasOwn(f,"y")&&(f.y-=o)}),a.width=r-n+s,a.height=i-o+l}function ZP(e){e.edges().forEach(n=>{if(n.v===n.w)return;let r=e.edge(n),o=e.node(n.v),i=e.node(n.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=i,s=o),r.points.unshift(W_(o,a)),r.points.push(W_(i,s))})}function QP(e){e.edges().forEach(n=>{let r=e.edge(n);if(Object.hasOwn(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function eV(e){e.edges().forEach(n=>{let r=e.edge(n);r.reversed&&r.points.reverse()})}function tV(e){e.nodes().forEach(n=>{if(e.children(n).length){let r=e.node(n),o=e.node(r.borderTop),i=e.node(r.borderBottom),a=e.node(r.borderLeft[r.borderLeft.length-1]),s=e.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-o.y),r.x=a.x+r.width/2,r.y=o.y+r.height/2}}),e.nodes().forEach(n=>{e.node(n).dummy==="border"&&e.removeNode(n)})}function nV(e){e.edges().forEach(n=>{if(n.v===n.w){let r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function rV(e){Cl(e).forEach(n=>{let r=0;n.forEach((o,i)=>{let a=e.node(o);typeof a.rank!="number"&&(a.rank=0),a.order=i+r,(a.selfEdges||[]).forEach(s=>{ri(e,"selfedge",{width:s.label.width,height:s.label.height,rank:a.rank,order:i+ ++r,e:s.e,edgeLabel:s.label},"_se"),(!Array.isArray(s.label.points)||s.label.points.length!==7)&&(s.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete a.selfEdges})})}function oV(e){e.nodes().forEach(n=>{let r=e.node(n),o=i=>typeof i=="number"&&isFinite(i);if(r.dummy==="selfedge"){let i=r,a=e.node(i.e.v),s=o(a?.x)?a.x:0,l=o(a?.y)?a.y:0,c=o(a?.width)?a.width:0,d=o(a?.height)?a.height:0,f=o(r.x)?r.x:s,u=o(r.y)?r.y:l,p=c/2,g=d/2;i.edgeLabel.points=[{x:f+p,y:u-g},{x:f+p,y:u-g},{x:f,y:u},{x:f-p,y:u+g},{x:f-p,y:u+g},{x:f,y:u},{x:f,y:u}],i.edgeLabel.x=f,i.edgeLabel.y=u,e.setEdge(i.e,i.edgeLabel),e.removeNode(n)}else r&&Array.isArray(r.selfEdges)&&r.selfEdges.forEach(i=>{if(!Array.isArray(i.label.points)||i.label.points.length!==7){let a=o(r.x)?r.x:0,s=o(r.y)?r.y:0,l=o(r.width)?r.width:0,c=o(r.height)?r.height:0,d=l/2,f=c/2;i.label.points=[{x:a+d,y:s-f},{x:a+d,y:s-f},{x:a,y:s},{x:a-d,y:s+f},{x:a-d,y:s+f},{x:a,y:s},{x:a,y:s}]}})})}function Af(e,n){return Nl(El(e,n),Number)}function If(e){let n={};return e&&Object.entries(e).forEach(([r,o])=>{typeof r=="string"&&(r=r.toLowerCase()),n[r]=o}),n}function iV(e){return e.map(({source:n,target:r})=>({source:n,target:r}))}function aV(e){const n=[];for(const r of e)for(const o of r.memberIds)n.push({source:r.ownerId,target:o});return n}function xb(e,n){return[...iV(e),...aV(n)]}function xl(e,n){const r=new Map;for(const{source:o,target:i}of e)r.has(o)||r.set(o,[]),r.get(o).push(i),r.has(i)||r.set(i,[]);return n&&(r.has(n.source)||r.set(n.source,[]),r.get(n.source).push(n.target),r.has(n.target)||r.set(n.target,[])),r}function vf(e){const n=new Set,r=new Set;function o(i){if(r.has(i))return!0;if(n.has(i))return!1;n.add(i),r.add(i);for(const a of e.get(i)??[])if(o(a))return!0;return r.delete(i),!1}for(const i of e.keys())if(o(i))return!0;return!1}function Tf(e,n){const r=e.config;if(!r)return[];const o=r[n];return Array.isArray(o)?o.filter(i=>typeof i=="string"&&uf(i)):[]}function sV({state:e,groupMapById:n,getNodeById:r,history:o}){const i=t.computed(()=>{const S=new Map;for(const B of e.value.groups)for(const P of B.memberIds)S.set(P,{ownerId:B.ownerId,branch:B.branch});return S}),a=t.computed(()=>{const S=new Map;for(const B of e.value.groups)for(const P of B.memberIds)S.set(P,B);return S}),s=t.computed(()=>{const S=new Map;for(const B of e.value.groups)S.has(B.ownerId)||S.set(B.ownerId,[]),S.get(B.ownerId).push(B);return S}),l=t.computed(()=>xb(e.value.edges,e.value.groups)),c=t.computed(()=>xl(l.value));function d(S,B){return S?Oa(S.type).includes(B):!1}function f(S,B){if(B===S.id)return!1;const P=r(B);return!(!P||rn(P.type)||P.phase!==S.phase)}function u(S,B){const P=[],R=new Set;for(const F of B)R.has(F)||(R.add(F),f(S,F)&&P.push(F));return P}function p(S,B,P){const R=r(S);return d(R,B)?u(R,P):[]}function g(S,B,P){const R=mf(S.id,B),F=n.value.get(R);P.length>0?F?(F.phase!==S.phase&&(F.phase=S.phase),ff(F.memberIds,P)||(F.position=void 0,F.dimensions=void 0,F.memberIds=[...P])):e.value.groups.push(V_(S.id,B,S.phase,P)):F&&(e.value.groups=e.value.groups.filter(X=>X.id!==R))}function h(S,B,P,R={}){const F=r(S);if(!d(F,B))return!1;const X=u(F,P),Z=Tf(F,B);if(ff(Z,X))return!1;const U=F.config??={};return X.length>0?U[B]=[...X]:(delete U[B],Object.keys(U).length===0&&delete F.config),g(F,B,X),(R.commit??!0)&&o.commit(R.tag),!0}function y(S,B={}){const P=e.value.groups.filter(R=>R.ownerId!==S);return P.length===e.value.groups.length?!1:(e.value.groups=P,(B.commit??!0)&&o.commit(B.tag),!0)}function m(S,B){const P=n.value.get(mf(S,B));if(P)return[...P.memberIds];const R=r(S);return R?Tf(R,B):[]}function _(S){return i.value.get(S)}function b(S){const B=[];let P=a.value.get(S);for(;P;)B.push(P.id),P=a.value.get(P.ownerId);return B}function k(S,B){const P=b(B);if(P.length===0)return!1;const R=new Set(b(S));return R.size===0?!0:P.some(F=>!R.has(F))}function A(S,B){if(S===B)return!0;const P=new Set,R=[B];for(;R.length>0;){const F=R.pop();if(P.has(F))continue;if(P.add(F),F===S)return!0;const X=c.value.get(F);if(X)for(const Z of X)P.has(Z)||R.push(Z)}return!1}function C(S,B,P){const R=r(S);return!(!d(R,B)||!f(R,P)||A(S,P))}function w(S,B,P,R={}){const F=r(S);if(!F||!C(S,B,P))return!1;const X=Tf(F,B);if(X.includes(P))return!1;x(P,{commit:!1});const Z=[...X,P];return h(S,B,Z,{commit:!1})?((R.commit??!0)&&o.commit(R.tag),!0):!1}function x(S,B={}){const P=_(S);if(!P)return!1;const R=m(P.ownerId,P.branch),F=R.filter(X=>X!==S);return F.length===R.length?!1:h(P.ownerId,P.branch,F,B)}function I(S){let B=0;const P=new Set;let R=a.value.get(S);for(;R&&!P.has(R.id);)B+=1,P.add(R.id),R=a.value.get(R.ownerId);return B}function T(S){const B=n.value.get(S);return B?I(B.ownerId):0}function v(S){return S?n.value.has(S):!1}return{memberGroupMap:a,groupsByOwner:s,findMembership:_,getMembers:m,wouldCreateCycle:A,setMembers:h,prepareMembers:p,addMember:w,removeMember:x,clear:y,getNodeDepth:I,getGroupDepth:T,isGroupId:v,isEdgeEnteringGroup:k,canAddMember:C}}function lV(e,n){const{commit:r,undo:o,redo:i,canUndo:a,canRedo:s,clear:l,reset:c,undoStack:d,redoStack:f}=At.useManualRefHistory(e,{capacity:n?.capacity,clone:n?.clone});let u;function p(k){n?.onHistoryChange?.(k,e.value)}function g(k){if(!k){u=void 0,r(),p("commit");return}if(k!=="*"&&u!==k){u=k,r(),p("commit");return}r(),d.value.shift(),p("commit")}function h(){o(),u=void 0,p("undo")}function y(){i(),u=void 0,p("redo")}function m(){l(),u=void 0,p("clear")}function _(){c(),u=void 0,p("reset")}function b(){o(),f.value.shift(),u=void 0,p("revert")}return{canUndo:a,canRedo:s,commit:g,undo:h,redo:y,clear:m,reset:_,revert:b}}function cV(e){return e.config?.resources?.vault||{}}function dV(e){const{resources:n}=e.config||{};return n?.vault?Object.keys(n.vault):[]}function uV(e){const n=Object.entries(e);if(n.length===0)return;const r={};for(const[o,i]of n)r[o]=i;return r}function Ab(e,n){const r=e.config?.nodes??[],o=e.__ui_data?.nodes??[],i=e.__ui_data?.groups??[],a=new Map(o.map(m=>[m.name,m])),s=new Map(i.map(m=>[m.name,m])),l=[],c=[],d=new Map,f=[],u=[],p=new Map,g=m=>{const _=new Set,b=[...m];for(;b.length>0;){const k=b.shift();if(!_.has(k)&&(_.add(k),df(k)||(d.get(k).phase="request"),!!p.has(k)))for(const A of p.get(k))_.has(A)||b.push(A)}};let h=!1;for(const m of r){const _=a.get(m.name);!_&&!h&&(h=!0);const b=vb({type:m.type,configNode:m,uiNode:_,pluginData:e});l.push(b),d.set(b.name,b)}for(const m of l){const _=Oa(m.type);if(!_.length)continue;const b=m.config;if(b)for(const k of _){const A=b[k];if(!Array.isArray(A)){s.has(_l(m.name,k))&&(h=!0);continue}const C=[];for(const w of A){if(typeof w!="string")continue;const x=d.get(w);x&&!rn(x.type)&&C.push(x.id)}if(C.length){b[k]=C;const w=_l(m.name,k),x=s.get(w),I=x?{position:_r(x.position)}:void 0,T=V_(m.id,k,m.phase,C,I);f.push(T),!x&&!h&&(h=!0)}else delete b[k],s.has(_l(m.name,k))&&(h=!0)}}for(const m of Zo)if(!d.has(m)){let _=a.get(m);_||(h||(h=!0),_=RO(m));const b=vb({type:m,uiNode:_,pluginData:e});l.push(b),d.set(b.name,b)}for(const m of r)mV(m,u);for(const m of u){const _=d.get(m.source),b=d.get(m.target);if(!_||!b){_||console.warn(`[initEditorState] skip: source "${m.source}" not found`),b||console.warn(`[initEditorState] skip: target "${m.target}" not found`);continue}p.has(m.source)||p.set(m.source,new Set),p.get(m.source).add(m.target),p.has(m.target)||p.set(m.target,new Set),p.get(m.target).add(m.source),c.push({id:ti("edge"),source:_.id,sourceField:Ur(_,"output",m.sourceField)?.id,target:b.id,targetField:Ur(b,"input",m.targetField)?.id})}g(["request","service_request"]);let y=null;return e.config?.resources?.cache&&(y={...e.config.resources.cache},e.partials&&(y.partial_id=e.partials[0].id)),{nodes:l,edges:c,groups:f,pendingLayout:h?n?"keepHistory":"clearHistory":!1,pendingFitView:!0,...y?{cacheConfig:y}:{}}}function Ib(e){const{type:n,name:r,phase:o,position:i,fields:a,config:s}=e,l=T_(n),c=ni(n);return{id:ti("node"),type:n,name:r??n,phase:o??"request",position:i??{x:0,y:0},expanded:{},fields:{input:O_(a?.input??l.input),output:O_(a?.output??l.output)},hidden:e.hidden||c.hidden,config:s?_r(s):{}}}function fV(e){return rn(e)?e==="request"||e==="service_request"?"request":"response":"request"}function vb({type:e,configNode:n,uiNode:r,pluginData:o}){return Ib({type:e,name:n?.name,phase:r?.phase??fV(e),position:r?.position,fields:gV({type:e,uiNode:r,configNode:n,pluginData:o}),hidden:r?.hidden,config:hV({type:e,configNode:n,pluginData:o})})}function pV(e){const{type:n,name:r,input:o,inputs:i,output:a,outputs:s,...l}=e;return _r(l)}function mV(e,n){const r=e.name;if(e.input){const{nodeName:o,fieldName:i}=yl(e.input);o&&n.push({source:o,sourceField:i,target:r})}if(e.inputs)for(const[o,i]of Object.entries(e.inputs)){if(!i)continue;const{nodeName:a,fieldName:s}=yl(i);a&&n.push({source:a,sourceField:s,target:r,targetField:o})}if(e.output){const{nodeName:o,fieldName:i}=yl(e.output);o&&n.push({source:r,target:o,targetField:i})}if(e.outputs)for(const[o,i]of Object.entries(e.outputs)){if(!i)continue;const{nodeName:a,fieldName:s}=yl(i);a&&n.push({source:r,sourceField:o,target:a,targetField:s})}}function gV({type:e,uiNode:n,configNode:r,pluginData:o}){const a=ni(e)?.io;if(!a)return;const s={};if(a.input?.configurable&&(n?s.input=n.fields?.input??[]:r?.inputs&&(s.input=Object.keys(r.inputs))),a.output?.configurable){if(n)s.output=n.fields?.output??[];else{const l=new Set;r?.outputs&&Object.keys(r.outputs).forEach(c=>l.add(c)),r?.type==="static"&&r.values&&Object.keys(r.values).forEach(c=>l.add(c)),l.size&&(s.output=Array.from(l))}e==="vault"&&(s.output=dV(o))}return Object.keys(s).length?s:void 0}function hV({type:e,configNode:n,pluginData:r}){return e==="vault"?cV(r):n?pV(n):void 0}function yV(e){const n=t.computed(()=>{const u=new Map;return e.value.nodes.forEach(p=>u.set(p.id,p)),u}),r=t.computed(()=>e.value.edges),o=t.computed(()=>e.value.groups),i=t.computed(()=>xb(r.value,o.value));function a(u){return xl(i.value,u?{source:u.source,target:u.target}:void 0)}function s(u){const p=n.value.get(u.source),g=n.value.get(u.target);if(!p||!g)return u;const h=B_(p,u.sourceField)&&!pf(p,u.sourceField),y=pf(g,u.targetField);return h&&y?{source:u.target,sourceField:u.targetField,target:u.source,targetField:u.sourceField}:u}function l(u){const p=s(u),g=[],h=n.value.get(p.source),y=n.value.get(p.target);if(h||g.push("source node not found"),y||g.push("target node not found"),!h||!y)return{ok:!1,errors:g};pf(h,p.sourceField)||g.push("source handle is not an output field"),B_(y,p.targetField)||g.push("target handle is not an input field"),y.name==="request"&&g.push('cannot target "request"'),h.name==="response"&&g.push('cannot source from "response"');const m=r.value.some(k=>k.target===p.target&&!k.targetField),_=r.value.some(k=>k.target===p.target&&!!k.targetField);(m&&p.targetField||_&&!p.targetField)&&g.push("cannot mix whole-node and field-level inputs on same target"),p.targetField&&r.value.some(k=>k.target===p.target&&k.targetField===p.targetField)&&g.push("target field already connected"),!p.targetField&&r.value.some(k=>k.target===p.target&&!k.targetField)&&g.push("target input already taken"),p.source===p.target&&g.push("self-loop not allowed");const b=a({source:p.source,target:p.target});return vf(b)&&g.push("connection introduces a cycle"),g.length?{ok:!1,errors:g}:{ok:!0}}function c(){const u=[];for(const p of Zo)[...n.value.values()].some(g=>g.name===p)||u.push(`missing implicit node "${p}"`);for(const p of r.value){const g=n.value.get(p.source);n.value.get(p.target).name==="request"&&u.push(`edge "${p.id}" targets "request"`),g.name==="response"&&u.push(`edge "${p.id}" sources from "response"`)}return vf(a())&&u.push("graph contains cycle"),u.length?{ok:!1,errors:u}:{ok:!0}}function d(u){return l(u).ok}function f(u){return!u.source||!u.target?!1:d({source:u.source,sourceField:u.sourceHandle,target:u.target,targetField:u.targetHandle})}return{canonicalizeConnection:s,validateConnection:l,validateGraph:c,isValidConnection:d,isValidVueFlowConnection:f,buildAdjacency:xl}}const[Of,_V]=At.createInjectionState(function(n,r={}){const o=t.ref(Ab(n)),i=t.ref(),a=t.ref(),s=t.ref(!1),l=t.ref(!1),c=lV(o,{capacity:200,clone:_r,onHistoryChange:H=>{H!=="clear"&&r.onChange?.(Ae(),z(),ne(),o.value.cacheConfig?.partial_id)}}),d=t.ref(!1),f=t.ref(new Set);function u(){o.value.pendingLayout=!1,c.commit("*")}function p(H=!0){o.value.pendingFitView!==H&&(o.value.pendingFitView=H,c.commit("*"))}const g=t.computed(()=>{const H={request:0,response:0};return o.value.nodes.forEach(D=>{rn(D.type)||H[D.phase]++}),H}),h=t.computed(()=>new Map(o.value.nodes.map(H=>[H.id,H]))),y=t.computed(()=>new Map(o.value.nodes.map(H=>[H.name,H]))),m=t.computed(()=>{const H=new Map,D=new Map;for(const q of o.value.edges)H.set(q.id,q),D.has(q.source)||D.set(q.source,new Set),D.get(q.source).add(q.id),D.has(q.target)||D.set(q.target,new Set),D.get(q.target).add(q.id);return{edgeMapById:H,edgeIdMapByNodeId:D}}),_=t.computed(()=>m.value.edgeMapById),b=t.computed(()=>m.value.edgeIdMapByNodeId),k=t.computed(()=>new Map(o.value.groups.map(H=>[H.id,H]))),A=t.computed(()=>new Set(o.value.nodes.map(H=>H.name))),C=sV({state:o,groupMapById:k,getNodeById:S,history:c}),{canonicalizeConnection:w,validateConnection:x,validateGraph:I,isValidConnection:T,isValidVueFlowConnection:v}=yV(o);function S(H){return h.value.get(H)}function B(H){return y.value.get(H)}function P(H){return _.value.get(H)}function R(H){if(!b.value.has(H))return[];const D=[];return b.value.get(H).forEach(q=>{const ie=P(q);ie&&D.push(ie)}),D}function F(H){return R(H).filter((D=>D.target===H))}function X(H){return R(H).filter((D=>D.source===H))}const Z=t.computed(()=>i.value?S(i.value):void 0);function U(H){i.value=H}function K(H){a.value=H}function L(H){if(rn(H.type))throw new Error("[createNode] implicit nodes are fixed.");return Ib({type:H.type,name:H.name||(rn(H.type)?void 0:P_(H.type,A.value)),phase:H.phase,position:H.position,fields:H.fields,config:H.config})}function oe(H,D=!0){const q=L(H);if(q)return o.value.nodes.push(q),D&&c.commit(),d.value=!0,q.id}function se(H,D,q=!0){const ie=S(H);if(!ie||rn(ie.type))return;const he={..._r(ie),id:ti("node"),name:P_(ie.name,A.value),position:D??{x:ie.position.x+20,y:ie.position.y+20}},xe=Oa(he.type);if(xe.length&&he.config){for(const Ke of xe)delete he.config[Ke];Object.keys(he.config).length===0&&delete he.config}return o.value.nodes.push(he),q&&c.commit(),d.value=!0,he.id}function M(H,D=!0){if(!S(H))return;o.value.edges=o.value.edges.filter(he=>he.source!==H&&he.target!==H),C.clear(H,{commit:!1}),C.removeMember(H,{commit:!1}),o.value.nodes=o.value.nodes.filter(he=>he.id!==H),i.value===H&&(i.value=void 0);const ie=I();ie.ok||console.warn("[removeNode] topology invalid:",ie.errors.join("; ")),D&&c.commit()}function le(H,D,q=!0,ie){const he=S(H);if(!he)return;if(df(he.name)){console.warn("[renameNode] implicit node name is reserved.");return}he.name!==D&&(he.name=D,q&&c.commit(ie))}function Y(H,D,q=!0){const ie=S(H);ie&&(ie.position={...D},q&&c.commit())}function ae(H,D,q=!0){const ie=k.value.get(H);if(!ie)return;const he=ie.position;he&&he.x===D.x&&he.y===D.y||(ie.position={...D},q&&c.commit())}function Me(H,D,q=!0){const ie=k.value.get(H);if(!ie)return!1;const he={...D.position},xe={...D.dimensions},Ke=ie.position&&ie.position.x===he.x&&ie.position.y===he.y,tt=ie.dimensions&&ie.dimensions.width===xe.width&&ie.dimensions.height===xe.height;return Ke&&tt?!1:(ie.position=he,ie.dimensions=xe,q&&c.commit(),!0)}function Ee(H,D,q,ie=!0,he){const xe=S(H);if(!xe)return;const Ke=q??!xe.expanded[D];Ke!==!!xe.expanded[D]&&(xe.expanded[D]=Ke,ie&&c.commit(he??`toggle:${H}:${D}`))}function Ue(H,D,q=!0,ie){const he=S(H);he&&(he.config=_r(D),q&&c.commit(ie))}function Ie(H,D,q,ie=!0){const he=S(H);if(!he)return;const xe=he.fields[D];if(xe.some(Ke=>Ke.name===q)){console.warn(`[addField] field "${q}" already exists on ${D}.`);return}xe.push({id:ti("field"),name:q}),D==="input"?he.fields.input=xe:he.fields.output=xe,ie&&c.commit()}function ce(H,D,q,ie=!0){const he=S(H);if(!he)return;const xe=he.fields.input,Ke=he.fields.output,tt=xe.find(j=>j.id===D)??Ke.find(j=>j.id===D);tt&&(tt.name=q,ie&&c.commit())}function re(H,D,q=!0,ie=!0){const he=S(H);if(!he)return;const xe=he.fields.input,Ke=he.fields.output,tt=xe.findIndex(fe=>fe.id===D);tt>=0&&xe.splice(tt,1);const j=Ke.findIndex(fe=>fe.id===D);j>=0&&Ke.splice(j,1),he.fields.input=xe,he.fields.output=Ke,q&&(o.value.edges=o.value.edges.filter(fe=>fe.sourceField!==D&&fe.targetField!==D));const te=I();te.ok||console.warn("[removeField] topology invalid:",te.errors.join("; ")),ie&&c.commit()}function Oe(H,D=!0){const q=w(H),ie=x(q);if(!ie.ok){console.warn("[connectEdge] invalid connection:",ie.errors.join("; "));return}const he={id:ti("edge"),...q};o.value.edges.push(he);const xe=I();if(!xe.ok){o.value.edges.pop(),console.warn("[connectEdge] topology invalid:",xe.errors.join("; "));return}return D&&c.commit(),he.id}function ve(H,D,q=!0){je(H,!1),Oe(D,!1),q&&c.commit()}function je(H,D=!0){const q=o.value.edges.findIndex(xe=>xe.id===H);if(q<0)return;const ie=o.value.edges[q];o.value.edges.splice(q,1);const he=I();if(!he.ok){o.value.edges.splice(q,0,ie),console.warn("[disconnectEdge] topology invalid:",he.errors.join("; "));return}D&&c.commit()}function st(H,D=!0){const q=F(H);for(const ie of q)je(ie.id,!1);D&&c.commit()}function ct(H,D=!0){const q=X(H);for(const ie of q)je(ie.id,!1);D&&c.commit()}function Ae(){const H=[];for(const D of o.value.nodes){if(rn(D.type))continue;let q;const ie={};let he;const xe={};for(const fe of o.value.edges.filter(ee=>ee.target===D.id)){const ee=S(fe.source);if(!ee)continue;const ke=jr(ee,"output",fe.sourceField)?.name,Je=ke?`${ee.name}.${ke}`:ee.name,ge=jr(D,"input",fe.targetField)?.name;ge?ie[ge]=Je:q===void 0&&(q=Je)}for(const fe of o.value.edges.filter(ee=>ee.source===D.id)){const ee=S(fe.target);if(!ee)continue;const ke=ee.type;if(!rn(ke)||!gl[ke].io?.input)continue;const Je=jr(ee,"input",fe.targetField)?.name,ge=Je?`${ee.name}.${Je}`:ee.name,we=jr(D,"output",fe.sourceField)?.name;we?xe[we]=ge:he===void 0&&(he=ge)}const Ke={..._r(D.config),name:D.name,type:D.type},tt=Oa(D.type);if(tt.length)for(const fe of tt){const ee=Ke[fe];if(!Array.isArray(ee))continue;const ke=[];for(const Je of ee){const ge=S(Je);ge&&ke.push(ge.name)}ke.length?Ke[fe]=Array.from(new Set(ke)):delete Ke[fe]}Object.keys(ie).length>0?Ke.inputs=ie:q!==void 0&&(Ke.input=q),Object.keys(xe).length>0?Ke.outputs=xe:he!==void 0&&(Ke.output=he),H.push(Ke)}return H}function $e(){return o.value.nodes.map(H=>_r({name:H.name,phase:H.phase,position:{...H.position},expanded:{...H.expanded},fields:{input:H.fields.input.map(D=>D.name),output:H.fields.output.map(D=>D.name)}}))}function ne(){const H={},D=B("vault");if(D){const q=uV(D.config);q&&Object.keys(q).length>0&&(H.vault=q)}if(o.value.cacheConfig){const{strategy:q,redis:ie,memory:he}=o.value.cacheConfig;H.cache={strategy:q,redis:ie,memory:he}}if(Object.keys(H).length!==0)return H}function G(){const H=[];for(const D of o.value.groups){const q=S(D.ownerId);if(!q)continue;const ie=D.position;ie&&H.push({name:_l(q.name,D.branch),position:{...ie}})}return H}function z(){return{nodes:$e(),groups:G()}}function Q(H,D){D&&c.commit(),o.value=Ab(H,D),D||c.clear()}return{state:o,selection:i,portalSelection:a,modalOpen:s,skipValidation:d,invalidConfigNodeIds:f,propertiesPanelOpen:l,configNodeCounts:g,nodeMapById:h,nodeMapByName:y,edgeMapById:_,edgeIdMapByNodeId:b,groupMapById:k,getNodeById:S,getNodeByName:B,getEdgeById:P,getEdgesByNodeId:R,getInEdgesByNodeId:F,getOutEdgesByNodeId:X,selectedNode:Z,selectNode:U,selectPortalEdge:K,createNode:L,addNode:oe,duplicateNode:se,removeNode:M,renameNode:le,moveNode:Y,moveGroup:ae,setGroupLayout:Me,toggleExpanded:Ee,replaceConfig:Ue,branchGroups:C,addField:Ie,renameField:ce,removeField:re,connectEdge:Oe,replaceConnection:ve,disconnectEdge:je,disconnectInEdges:st,disconnectOutEdges:ct,toConfigNodes:Ae,toUINodes:$e,toUIGroups:G,toUIData:z,toResources:ne,load:Q,commit:c.commit,undo:c.undo,redo:c.redo,canUndo:c.canUndo,canRedo:c.canRedo,clear:c.clear,reset:c.reset,revert:c.revert,isValidConnection:T,isValidVueFlowConnection:v,validateGraph:()=>I(),clearPendingLayout:u,setPendingFitView:p}});function It(){const e=_V();if(!e)throw new Error("Editor state is not provided. Ensure you are using provideEditorStore in a parent component.");return e}function bV(e){const{branchLayout:n,phase:r,layoutOptions:o,nodes:i,edges:a}=e,{findNode:s}=kt.useVueFlow(),{state:l,branchGroups:c,getNodeById:d,moveNode:f,commit:u}=It(),{getNodeDepth:p,isGroupId:g,groupsByOwner:h}=c,{isBranchEdgeId:y,updateGroupLayout:m,translateGroupTree:_,waitForLayoutFlush:b}=n,{viewport:k,padding:A=Mr.padding,gaps:C=Mr.gaps}=o,{nodes:w=Mr.gaps.nodes,edges:x=Mr.gaps.edges,ranks:I=Mr.gaps.ranks}=C;async function T(B=!0){const P=new Map(i.value.map(Y=>[Y.id,Y.data])),R=new Map,F=new Map,X=Y=>{if(!Y)return;let ae=F.get(Y);return ae||(ae=s(Y),ae&&F.set(Y,ae),ae)},Z=new Map,U=Y=>{let ae=Z.get(Y);return ae!==void 0||(ae=p(Y),Z.set(Y,ae)),ae},K=Y=>{if(!Ta(Y.data))return Y.parentNode;const ae=X(Y.data.ownerId);if(!ae)throw new Error(`Cannot find owner node '${Y.data.ownerId}' for group node '${Y.id}' via findNode`);return ae.parentNode};for(const Y of a.value){if(y(Y.id))continue;const ae=Y.source,Me=Y.target;if(g(ae)||g(Me))continue;const Ee=X(ae),Ue=X(Me);if(Ee){if(!Ue)throw new Error(`Cannot find target node '${Me}' for edge '${Y.id}' via findNode`)}else throw new Error(`Cannot find source node '${ae}' for edge '${Y.id}' via findNode`);if(K(Ee)===K(Ue))continue;let Ie=Ee,ce=Ue,re=U(Ie.id),Oe=U(ce.id);for(;re!==Oe;)if(re>Oe){const ve=K(Ie);if(!ve)throw new Error(`Expected node '${Ie.id}' to have parent, but it does not`);const je=X(ve);if(!je)throw new Error(`Cannot find parent node '${ve}' for node '${Ie.id}' via findNode`);Ie=je,re--}else if(Oe>re){const ve=K(ce);if(!ve)throw new Error(`Expected node '${ce.id}' to have parent, but it does not`);const je=X(ve);if(!je)throw new Error(`Cannot find parent node '${ve}' for node '${ce.id}' via findNode`);ce=je,Oe--}for(;re>=0;){const ve=K(Ie),je=K(ce);if(ve===je){R.has(re)||R.set(re,[]),R.get(re).push({v:Ie.id,w:ce.id});break}if(ve){if(!je){const Ae=`Expected node '${ce.id}' to have parent, but it does not`;throw console.error(Ae,ce),new Error(Ae)}}else{const Ae=`Expected node '${Ie.id}' to have parent, but it does not`;throw console.error(Ae,Ie),new Error(Ae)}const st=X(ve),ct=X(je);if(st){if(!ct)throw new Error(`Cannot find parent node '${je}' for node '${ce.id}' via findNode`)}else throw new Error(`Cannot find parent node '${ve}' for node '${Ie.id}' via findNode`);Ie=st,ce=ct,re--,Oe--}}const L=l.value.groups.toSorted((Y,ae)=>U(ae.ownerId)-U(Y.ownerId));for(const Y of L)v(Y.memberIds.reduce((ae,Me)=>{const Ee=d(Me);if(!Ee)return console.warn(`Cannot find node '${Me}' of group '${Y.id}' by getNodeById`),ae;if(Ee.phase!==r)return ae;if(Ee.type==="branch"){const Ue=h.value.get(Ee.id);Ue&&ae.push(...Ue)}return P.delete(Ee.id),ae.push(Ee),ae},[]),{virtualEdges:R.get(U(Y.ownerId)),cachedFindNode:X}),await t.nextTick(),m(Y.id,!1),await b();const oe=P.values().toArray();for(const Y of oe){if(Ta(Y)||Y.type!=="branch")continue;const ae=h.value.get(Y.id);ae&&oe.push(...ae)}const{autoNodes:se,leftNode:M,rightNode:le}=S(oe);v(se,{leftNode:M,rightNode:le,virtualEdges:R.get(0),cachedFindNode:X}),B&&u()}function v(B,P){const{leftNode:R,rightNode:F,virtualEdges:X,cachedFindNode:Z}=P||{},U=R?(Z??s)(R.id):void 0,K=F?(Z??s)(F.id):void 0;let L;if(B.length>0){L=new L_.Graph({multigraph:!0}),L.setGraph({rankdir:r==="request"?"LR":"RL",nodesep:w,edgesep:x,ranksep:I});const Ie=new Set;for(const ce of B){const re=(Z??s)(ce.id);if(!re){console.warn(`Cannot find graph node '${ce.id}' in ${r} phase`);continue}Ie.add(ce.id),Ta(ce)?L.setNode(ce.id,{...ce.dimensions??re.dimensions}):L.setNode(ce.id,{...re.dimensions})}for(const ce of a.value)!Ie.has(ce.source)||!Ie.has(ce.target)||L.setEdge(ce.source,ce.target,{points:[]});X?.forEach(ce=>L.setEdge(ce,{points:[]})),DP(L)}const oe=[],se=Ie=>({x:Ie.x-Ie.width/2,y:Ie.y-Ie.height/2,width:Ie.width,height:Ie.height});if(B.length>0){if(!L)throw new Error("Expected dagreGraph to be initialized");for(const Ie of B){const ce=L.node(Ie.id),re=se(ce);oe.push(re),Ta(Ie)?_(Ie.id,re,re.x+Ho,re.y+Ho):f(Ie.id,{x:re.x,y:re.y},!1)}}const M=oe.length>0?$_(oe):{x:0,y:0,width:0,height:0},le=M.width,Y=M.height,ae=M.x,Me=M.x+M.width,Ee=Math.max(0,Math.min(t.toValue(k?.width)??Number.POSITIVE_INFINITY,WN)-le-2*w-(U?.dimensions?.width??0)-(K?.dimensions?.width??0)-2*A),Ue=M.y+Y/2;R&&f(R.id,{x:ae-w-Ee/2-(U?.dimensions?.width??0),y:Ue-(U?.dimensions?.height??0)/2},!1),F&&f(F.id,{x:Me+w+Ee/2,y:Ue-(K?.dimensions?.height??0)/2},!1)}function S(B){let P,R;const F=[];for(const X of B){if(Ta(X)){F.push(X);continue}switch(X.name){case"request":{if(r!=="request")throw new Error(`Unexpected request node in ${r} phase`);if(P)throw new Error("Duplicated request node in request phase");P=X;break}case"service_request":{if(r!=="request")throw new Error(`Unexpected service_request node in ${r} phase`);if(R)throw new Error("Duplicated service_request node in request phase");R=X;break}case"service_response":{if(r!=="response")throw new Error(`Unexpected service_response node in ${r} phase`);if(R)throw new Error("Duplicated service_response node in response phase");R=X;break}case"response":{if(r!=="response")throw new Error(`Unexpected response node in ${r} phase`);if(P)throw new Error("Duplicated response node in response phase");P=X;break}default:{F.push(X);break}}}return{autoNodes:F,leftNode:P,rightNode:R}}return{autoLayout:T}}function wV({phase:e,groupMapById:n,getNodeDepth:r,canAddMember:o,draggingId:i}){const a=t.shallowRef(),s=t.shallowRef();function l(u){a.value=u,s.value=void 0}function c(){a.value&&(a.value=void 0,s.value=void 0)}function d(u){let p;const g=i?.value;return n.value.forEach(h=>{if(h.phase!==e||g&&uf(g)&&!o(h.ownerId,h.branch,g))return;const y=h.position,m=h.dimensions;if(!y||!m||!(u.x>=y.x&&u.x<=y.x+m.width&&u.y>=y.y&&u.y<=y.y+m.height))return;const b=r(h.ownerId);(!p||b>p.depth)&&(p={depth:b,id:h.id})}),p?.id}function f(u){if(!a.value){s.value=void 0;return}if(!u){s.value=void 0;return}s.value=d(u)}return{activeGroupId:s,start:l,updateActiveGroup:f,end:c}}function kV({phase:e,readonly:n,flowId:r,draggingId:o}){const{findNode:i}=kt.useVueFlow(r),a=It(),{state:s,groupMapById:l,getNodeById:c,moveNode:d,moveGroup:f,setGroupLayout:u,commit:p,branchGroups:g}=a,{memberGroupMap:h,groupsByOwner:y,getNodeDepth:m,getGroupDepth:_}=g,b=K=>!!K&&K.startsWith("branch:");function k(K){const L=[];for(const oe of K.memberIds){const se=c(oe);se&&L.push(se)}return L}const A=t.computed(()=>{const K=new Map;return h.value.forEach((L,oe)=>{if(L.phase!==e||!L.position)return;const se=c(oe);se&&(se.phase!==e||se.hidden||K.set(oe,L))}),K}),C=t.computed(()=>{const K=new Map;return y.value.forEach((L,oe)=>{const se=L.filter(M=>M.phase===e);se.length>0&&K.set(oe,se)}),K}),w=t.computed(()=>{const K=[];for(const L of s.value.groups){const oe=c(L.ownerId);if(!oe||oe.phase!==e)continue;const se=L.position,M=L.dimensions;if(!se||!M)continue;const le=k(L).filter(ae=>ae.phase===e&&!ae.hidden),Y=_(L.id);K.push({id:L.id,type:"group",position:se,width:M.width,height:M.height,data:{...L,memberIds:le.map(ae=>ae.id)},draggable:!n,selectable:!1,zIndex:Y*tl+qN})}return K}),x=t.computed(()=>{let K=0;for(const L of s.value.groups){if(L.phase!==e)continue;const oe=_(L.id);oe>K&&(K=oe)}return K}),I=t.computed(()=>{const K=[];for(const L of s.value.groups){if(L.phase!==e||!L.position||!L.dimensions)continue;const oe=c(L.ownerId);if(!oe||oe.phase!==e||oe.hidden||!k(L).filter(Y=>Y.phase===e&&!Y.hidden).length)continue;const M=Math.max(m(oe.id),_(L.id))+x.value+1,le={id:`branch:${L.id}`,source:oe.id,target:L.id,sourceHandle:`branch@${L.branch}`,targetHandle:"input",markerEnd:kt.MarkerType.ArrowClosed,selectable:!1,focusable:!1,updatable:!1,data:{type:"branch",ownerId:oe.id,branch:L.branch,groupId:L.id},zIndex:M*tl+zN};K.push(le)}return K}),T=new Map,v=new Map;let S;function B(K,L=!0){if(K.phase!==e)return;const oe=k(K).filter(ae=>ae.phase===e&&!ae.hidden);if(!oe.length)return;const se=[];for(const ae of oe){const Ee=i(ae.id)?.dimensions,Ue=Ee?.width??0,Ie=Ee?.height??0;if(Ue<=0||Ie<=0)return;se.push({...ae.position,width:Ue,height:Ie});const ce=y.value.get(ae.id)??[];for(const re of ce){if(re.phase!==e)continue;const Oe=T.get(re.id),ve=Oe?.position??re.position,je=Oe?.dimensions??re.dimensions;!ve||!je||se.push({x:ve.x,y:ve.y,width:je.width,height:je.height})}}const M=$_(se),le=M.width+Ho*2,Y=M.height+Ho*2;return{position:{x:Math.round(M.x-Ho),y:Math.round(M.y-Ho)},dimensions:{width:Math.round(le),height:Math.round(Y)},commit:L}}function P(){if(T.size===0){S=void 0;return}const K=[];let L=!1;T.forEach((oe,se)=>{const M=u(se,oe,!1);K.push({id:se,changed:M,commit:oe.commit}),oe.commit&&M&&!L&&(L=!0)}),T.clear(),S=void 0;for(const{id:oe,changed:se,commit:M}of K){if(!se)continue;const le=l.value.get(oe);if(!le)continue;const Y=A.value.get(le.ownerId);Y&&v.set(Y.id,{commit:M})}if(v.size>0){const oe=Array.from(v);v.clear();for(const[se,{commit:M}]of oe)F(se,M)}L&&p("*")}function R(){T.size!==0&&(S||(S=t.nextTick().then(P)))}function F(K,L=!0){const oe=l.value.get(K);if(!oe)return;const se=B(oe,L);se&&(T.set(K,se),R())}function X(K,L,oe,se){const M=l.value.get(K);if(!M)return;if(!M.position){f(K,L,!1),F(K);return}if(oe===0&&se===0){f(K,L,!1);return}f(K,L,!1);const le=[K],Y=new Set([K]),ae=new Set;for(;le.length;){const Me=le.shift(),Ee=l.value.get(Me);if(!Ee)continue;const Ue=k(Ee).filter(Ie=>Ie.phase===e&&!Ie.hidden);for(const Ie of Ue){ae.has(Ie.id)||(d(Ie.id,{x:Ie.position.x+oe,y:Ie.position.y+se},!1),ae.add(Ie.id));const ce=C.value.get(Ie.id)??[];for(const re of ce){if(Y.has(re.id))continue;const Oe=l.value.get(re.id);Oe?.position&&f(re.id,{x:Oe.position.x+oe,y:Oe.position.y+se},!1),Y.add(re.id),le.push(re.id)}}}}function Z(K,L){const oe=o?.value;if(!oe)return!1;if(oe===K||L.some(se=>oe===se))return!0;for(const se of L)if((C.value.get(se)??[])?.some(le=>le.id===oe))return!0;return!1}const U=new Map;return t.watch(()=>s.value.groups.filter(L=>L.phase===e).map(L=>{const oe=L.memberIds.map(se=>{const M=i(se),le=Math.round(M?.dimensions?.width??0),Y=Math.round(M?.dimensions?.height??0);return`${se}:${le}x${Y}`});return{id:L.id,memberIds:L.memberIds,signature:oe.join(",")}}),K=>{const L=new Set(K.map(oe=>oe.id));for(const oe of U.keys())L.has(oe)||U.delete(oe);for(const oe of K)Z(oe.id,oe.memberIds)||U.get(oe.id)===oe.signature||(U.set(oe.id,oe.signature),F(oe.id))},{deep:!0,flush:"post"}),{groupsByOwner:C,memberGroupMap:A,groupNodes:w,branchEdges:I,isBranchEdgeId:b,updateGroupLayout:F,translateGroupTree:X,getNodeDepth:m,maxGroupDepth:x,waitForLayoutFlush:()=>S??Promise.resolve()}}function CV(e){t.provide(Kh,e)}function Tb(){return t.inject(Kh,void 0)}function Ob(){const e=Tb();if(!e)throw new Error("Confirm modal not provided");return e}function EV(e){const{readonly:n,flowId:r}=e,o=kt.useVueFlow(r),{onNodesChange:i,onEdgesChange:a,onPaneClick:s,findEdge:l}=o,{disconnectEdge:c,commit:d,portalSelection:f,selectPortalEdge:u}=It();i(p=>{p.some(g=>g.type==="select"&&"selected"in g&&g.selected)&&u(void 0)}),a(p=>{const g=p.some(y=>y.type==="select"&&"selected"in y&&y.selected),h=f.value?p.some(y=>y.type==="remove"&&y.id===f.value):!1;(g||h)&&u(void 0)}),s(()=>u(void 0)),At.useEventListener("keydown",p=>{if(n||p.key!=="Delete"&&p.key!=="Backspace")return;const g=f.value;!g||l(g)||(p.preventDefault(),c(g,!1),u(void 0),d())})}function Bb(e){const n=e.match(/^(input|output)(?:s@(.*))?$/);if(n)return{io:n[1],field:n[2]}}const NV={default:TN,hover:BN,selected:ON};let Pb,Bf;function Al(e){const n=e.id===Pb?"selected":e.id===Bf?"hover":"default",r=NV[n],{markerEnd:o}=e,i=typeof o=="object"?{...o,color:r}:{type:o,color:r},a=e.zIndex??0,s=n==="selected"?a+2:n==="hover"?a+1:a;return{...e,style:{...e.style,stroke:r,strokeWidth:n==="selected"?1.5:void 0},markerEnd:i,zIndex:s}}const[SV,xV]=At.createInjectionState(function(e){const{phase:n,flowId:r,layoutOptions:o,readonly:i}=e,{viewport:a,padding:s=Mr.padding,gaps:l=Mr.gaps}=o,{nodes:c=Mr.gaps.nodes}=l,d=kt.useVueFlow(r),f=It(),u=Tb(),p=pl(),{i18n:{t:g}}=Ye(),{findNode:h,fitView:y,deleteKeyCode:m,onNodeDrag:_,onNodeDragStop:b,onConnect:k,onNodesChange:A,onEdgesChange:C,onEdgeUpdate:w,onEdgeMouseEnter:x,onEdgeMouseLeave:I,getNodes:T,setNodes:v,setEdges:S,addSelectedNodes:B,screenToFlowCoordinate:P}=d;m.value=["Delete","Backspace"];const{state:R,commit:F,moveNode:X,selectNode:Z,removeNode:U,getNodeById:K,connectEdge:L,disconnectEdge:oe,getInEdgesByNodeId:se,branchGroups:M,commit:le,reset:Y,groupMapById:ae}=f,{isGroupId:Me,canAddMember:Ee}=M,Ue=t.shallowRef(),Ie=V=>{Ue.value=V},ce=t.readonly(Ue);function re(V,me){const de=K(V.source),ue=K(V.target);return!!(de&&ue&&de.phase===me&&ue.phase===me)}const Oe=kV({phase:n,readonly:i,flowId:r,draggingId:ce}),{memberGroupMap:ve,groupNodes:je,branchEdges:st,isBranchEdgeId:ct,updateGroupLayout:Ae,translateGroupTree:$e,getNodeDepth:ne,maxGroupDepth:G}=Oe,{activeGroupId:z,start:Q,updateActiveGroup:H,end:D}=wV({phase:n,groupMapById:ae,getNodeDepth:ne,canAddMember:Ee,draggingId:ce}),q=t.computed(()=>R.value.nodes.filter(V=>V.phase===n&&!V.hidden).map(V=>{const me=ve.value.get(V.id),de=me?.position,ue=me?.dimensions,Re=me&&de&&ue?{x:V.position.x-de.x,y:V.position.y-de.y}:V.position,Be=ne(V.id),ye=!!(me&&de&&ue),_e=(ye?Be:0)+G.value+1;return{id:V.id,type:"flow",position:Re,data:V,deletable:!i&&!hl(V),parentNode:ye?me.id:void 0,zIndex:_e*tl+HN}})),ie=t.computed(()=>R.value.edges.filter(V=>re(V,n)).filter(V=>!M.isEdgeEnteringGroup(V.source,V.target)).filter(V=>{const me=K(V.source),de=K(V.target);return!me?.hidden&&!de?.hidden}).map(V=>{const me=K(V.source),de=K(V.target);if(!me||!de){const Re=[];throw me||Re.push(`source node "${V.source}"`),de||Re.push(`target node "${V.target}"`),new Error(`Missing ${Re.join(" and ")} for edge "${V.id}" in phase "${n}"`)}const ue=Math.max(ne(V.source),ne(V.target))+G.value+1;return Al({id:V.id,source:V.source,target:V.target,sourceHandle:V.sourceField?`outputs@${V.sourceField}`:"output",targetHandle:V.targetField?`inputs@${V.targetField}`:"input",markerEnd:kt.MarkerType.ArrowClosed,data:V,updatable:!i,zIndex:ue*tl+GN})})),he=t.computed(()=>[...st.value,...ie.value]),{autoLayout:xe}=bV({phase:n,layoutOptions:o,branchLayout:Oe,nodes:q,edges:he});EV({readonly:i,flowId:r}),t.watch([q,je,he],([V,me,de])=>{v([...me,...V]),S(de)},{immediate:!0});const Ke=t.computed(()=>({padding:s/Math.max(t.toValue(a?.width)??0,t.toValue(a?.height)??0)}));async function tt({source:V,sourceHandle:me,target:de,targetHandle:ue}){if(!me||!ue)return;const Re=Bb(me),Be=Bb(ue);if(Re?.io==="input"||Be?.io==="output"||me==="output"&&ue==="output")return;const ye=se(de);let _e=!1,_t=!1;const et=[],Xe=[],Ge=Be?.io==="input"?ye.filter(ut=>!ut.targetField):ye.filter(ut=>!!ut.targetField);Ge.length>0&&(_e=!0,Ge.forEach(ut=>{Xe.push(Ba(ut,K)),oe(ut.id,!1)}));const He=Be?.io==="input"?Be?.field?ye.filter(ut=>ut.targetField===Be.field):ye.filter(ut=>!!ut.targetField):ye.filter(ut=>!ut.targetField);if(He.length>0){if(He.some(Pt=>Pt.source===V&&Pt.target===de&&Pt.targetField===Be?.field&&Pt.sourceField===Re?.field))return;_t=!0,He.forEach(Pt=>{Xe.push(Ba(Pt,K)),oe(Pt.id,!1)})}if(!L({source:V,sourceField:Re?.field,target:de,targetField:Be?.field},!1)){Y(),p({message:g("plugins.free-form.datakit.flow_editor.error.invalid_connection"),appearance:"danger"});return}if(et.push(gf(V,Re?.field,de,Be?.field,K)),_e||_t){if(!u)throw Y(),new Error("Expected confirm modal to be provided here when reachable");if(!await u(g(_e?"plugins.free-form.datakit.flow_editor.confirm.message.switch":"plugins.free-form.datakit.flow_editor.confirm.message.override"),et,Xe)){Y();return}}le()}k(tt);let j=!1;const te=()=>{j&&(j=!1,le())};A(V=>{V.filter(ue=>ue.type==="select").filter(ue=>!Me(ue.id)).sort((ue,Re)=>ue.selected===Re.selected?0:ue.selected?1:-1).forEach(ue=>{Z(ue.selected?ue.id:void 0)});let de=!1;V.forEach(ue=>{if(ue.type==="remove"){if(Me(ue.id))return;de=!0,U(ue.id,!1)}}),de&&!j&&(j=!0,queueMicrotask(te))}),_(({node:V,event:me})=>{if(!V)return;if(Me(V.id)){const ye=V.id;Ie(ye),H(void 0);const _e=ae.value.get(ye);if(!_e)return;const _t=_e.position??{...V.position},et=V.position.x-_t.x,Xe=V.position.y-_t.y;$e(ye,V.position,et,Xe);const Ge=ve.value.get(_e.ownerId);Ge&&Ae(Ge.id,!1);return}const de=V.id;Q("canvas"),Ie(de);const ue=V.parentNode;let Re={...V.position};if(ue&&Me(ue)){const ye=ae.value.get(ue);ye?.position&&(Re={x:ye.position.x+V.position.x,y:ye.position.y+V.position.y})}if(X(de,Re,!1),!hl(K(de))){const ye={x:Re.x,y:Re.y,width:V.dimensions?.width??0,height:V.dimensions?.height??0},_e=me&&"clientX"in me?P({x:me.clientX,y:me.clientY}):void 0,_t={x:ye.x+ye.width/2,y:ye.y+ye.height/2};H(_e??_t)}const Be=ue&&Me(ue)?ue:ve.value.get(de)?.id;Be&&Ae(Be,!1)}),b(({node:V})=>{if(!V)return;if(Ie(void 0),Me(V.id)){F();return}const me=V.id,de=V.parentNode;let ue={...V.position};if(de&&Me(de)){const Be=ae.value.get(de);Be?.position&&(ue={x:Be.position.x+V.position.x,y:Be.position.y+V.position.y})}X(me,ue,!1);const Re=de&&Me(de)?de:ve.value.get(me)?.id;Re&&Ae(Re,!1),ge(me),D(),F()}),C(V=>{V.filter(ue=>ue.type==="select").sort((ue,Re)=>ue.selected===Re.selected?0:ue.selected?1:-1).forEach(ue=>{ct(ue.id)||(Pb=ue.selected?ue.id:void 0,S(Re=>Re.map(Be=>Be.id!==ue.id||!Be.markerEnd?Be:Al({...Be,zIndex:ue.selected?1:void 0}))))});let de=!1;V.forEach(ue=>{if(ue.type==="remove"){if(ct(ue.id))return;de=!0,oe(ue.id,!1)}}),de&&!j&&(j=!0,queueMicrotask(te))}),x(({edge:V})=>{ct(V.id)||(Bf=V.id,S(me=>me.map(de=>de.id!==V.id?de:Al(de))))}),I(({edge:V})=>{ct(V.id)||(Bf=void 0,S(me=>me.map(de=>de.id!==V.id?de:Al(de))))}),w(({edge:V,connection:me})=>{ct(V.id)||(oe(V.id,!1),tt(me))});function fe(V){y({...Ke.value,...V})}async function ee(V){return Z(V),new Promise(me=>setTimeout(()=>{const de=h(V);B(de?[de]:[]),me()},0))}function ke(V){const me=T.value.filter(({type:Ge})=>Ge!=="group"),de=me.find(({id:Ge})=>Ge===V);if(!de)throw new Error(`Node ${V} not found`);const{x:ue,y:Re}=de.data.position,{width:Be,height:ye}=de.dimensions,_e=Re,_t=Re+ye,et=me.filter(({id:Ge})=>Ge!==V).filter(({data:{position:{y:Ge}},dimensions:{height:He}})=>Ge<_t&&Ge+He>_e).map(({data:{position:{x:Ge}},dimensions:{width:He}})=>({left:Ge,right:Ge+He})).sort((Ge,He)=>Ge.left-He.left);let Xe=ue+Be+c;for(const{left:Ge,right:He}of et)if(!(He<=Xe)){if(Xe+Be<=Ge)return{x:Xe,y:_e};Xe=Math.max(Xe,He)+c}return{x:Xe,y:_e}}function Je(V){if(!V)return;const me=h(V);if(!me)throw new Error(`Node ${V} not found`);const{position:{x:de},dimensions:{width:ue}}=me,Re=de+ue,{viewport:Be,dimensions:ye,setViewport:_e}=d,{x:_t,y:et,zoom:Xe}=Be.value,{width:Ge}=ye.value,He=de*Xe+_t,St=Re*Xe+_t,ut=Ge-jh-c;if(St<=ut)return;let Pt=ut-St;He+Pt<0&&(Pt=-He),Pt!==0&&_e({x:_t+Pt,y:et,zoom:Xe},{duration:XN})}function ge(V){if(!z.value)return!1;const{nodeId:me,branch:de}=LO(z.value),ue=M.addMember(me,de,V,{commit:!1});return H(void 0),ue}return{vueFlowStore:d,editorStore:f,readonly:i,nodes:q,edges:he,selectNode:ee,autoLayout:xe,placeToRight:ke,scrollRightToReveal:Je,fitViewParams:Ke,fitView:fe,groupDrop:{activeGroupId:z,startPanelDrag:()=>Q("panel"),endPanelDrag:D,updateActiveGroup:H,attachNodeToActiveGroup:ge}}});let ii=null;function AV(){if(ii)return ii;if(typeof navigator>"u")return ii="windows";const e=navigator.userAgentData?.platform||navigator.platform||navigator.userAgent;return/Mac|iPhone|iPad|iPod/i.test(e)?ii="mac":/Linux/i.test(e)&&!/Android/i.test(e)?ii="linux":ii="windows"}const IV={Shift:"⇧",Alt:"⌥",Ctrl:"⌃",Meta:"⌘",Mod:"⌘",Enter:"↩",ArrowUp:"↑",ArrowDown:"↓",ArrowLeft:"←",ArrowRight:"→",Tab:"⇥",Esc:"⎋",Space:"Space",Delete:"⌫"},vV={Shift:"Shift",Alt:"Alt",Ctrl:"Ctrl",Meta:"Win",Mod:"Ctrl",Enter:"Enter",ArrowUp:"Up",ArrowDown:"Down",ArrowLeft:"Left",ArrowRight:"Right",Tab:"Tab",Esc:"Esc",Space:"Spacebar",Delete:"Delete"},TV={Shift:"Shift",Alt:"Alt",Ctrl:"Ctrl",Meta:"Super",Mod:"Ctrl",Enter:"Enter",ArrowUp:"Up",ArrowDown:"Down",ArrowLeft:"Left",ArrowRight:"Right",Tab:"Tab",Esc:"Esc",Space:"Space",Delete:"Delete"};function OV(e,n={}){const r=n.platform??AV(),o=n.joiner??(r==="mac"?"":" + "),i=r==="mac"?IV:r==="linux"?TV:vV;return(Array.isArray(e)?e:e[r]).map(s=>s in i?i[s]:s).join(o)}const BV={key:0,class:"label"},PV={class:"keys"},Il=Pe(t.defineComponent({__name:"HotkeyLabel",props:{label:{},keys:{},reverse:{type:Boolean}},setup(e){const n=OV(e.keys);return(r,o)=>(t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["dk-hotkey-label",{reverse:e.reverse}])},[e.label?(t.openBlock(),t.createElementBlock("span",BV,t.toDisplayString(e.label),1)):t.createCommentVNode("",!0),t.createElementVNode("kbd",PV,t.toDisplayString(t.unref(n)),1)],2))}}),[["__scopeId","data-v-7ca86b0d"]]),VV=["onClick"],$V={key:0,class:"additional-count"},Vb=24,RV=16,vl=Pe(t.defineComponent({__name:"NodePortal",props:{expanded:{type:Boolean,default:()=>{}},reversed:{type:Boolean},targets:{}},setup(e){const n=Number.parseFloat(DN)||0,r={target:"body"},{portalSelection:o,selectPortalEdge:i}=It(),a=t.ref(!1),s=t.computed(()=>{const h=o.value;return h?e.targets.some(y=>y.edgeId===h):!1}),l=t.computed(()=>e.expanded!==void 0?e.expanded||s.value:a.value||s.value),c=()=>Vb*e.targets.length+n*(e.targets.length-1),d=t.computed(()=>({width:l.value?`${c()}px`:"fit-content"})),f=h=>{i(h)},u=h=>o.value===h,p=t.computed(()=>e.targets.map((h,y)=>{const m=(Vb+n)*y;return{edgeId:h.edgeId,key:`${h.node.id}-${h.fieldName??"node"}-${y}`,icon:sf(h.node.type).icon,tooltip:h.fieldName?`${h.node.name}.${h.fieldName}`:h.node.name,highlighted:u(h.edgeId),tooltipEl:null,style:y===0?{width:"fit-content",zIndex:e.targets.length}:{position:"absolute",...e.reversed?{left:`${m}px`,transform:l.value?"translateX(0)":`translateX(-${m}px)`}:{right:0,transform:l.value?`translateX(-${m}px)`:"translateX(0)"},zIndex:e.targets.length-y}}})),g=t.computed(()=>Math.max(e.targets.length-1,0));return(h,y)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["dk-node-portal",{expanded:l.value,reversed:e.reversed}]),onClick:y[0]||(y[0]=t.withModifiers(()=>{},["stop"])),onDragstart:y[1]||(y[1]=t.withModifiers(()=>{},["stop"])),onMousedown:y[2]||(y[2]=t.withModifiers(()=>{},["stop"])),onMouseenter:y[3]||(y[3]=m=>a.value=!0),onMouseleave:y[4]||(y[4]=m=>a.value=!1)},[t.createElementVNode("div",{class:"target-boxes",style:t.normalizeStyle(d.value)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p.value,(m,_)=>(t.openBlock(),t.createBlock(t.unref(be.KTooltip),{key:m.key,class:"target-box-wrapper","kpop-attributes":r,placement:"top",style:t.normalizeStyle(m.style),text:m.tooltip},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["target-box",{highlighted:m.highlighted}]),onClick:t.withModifiers(b=>f(m.edgeId),["stop"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(m.icon),{color:`var(--kui-color-text-neutral, ${t.unref(Wn)})`,size:RV},null,8,["color"])),_===0&&g.value>0?(t.openBlock(),t.createElementBlock("span",$V," +"+t.toDisplayString(g.value),1)):t.createCommentVNode("",!0)],10,VV)]),_:2},1032,["style","text"]))),128))],4)],34))}}),[["__scopeId","data-v-45ce7484"]]),Tl=Pe(t.defineComponent({__name:"HandleTwig",props:{color:{},position:{default:()=>kt.Position.Left},size:{default:()=>Number.parseFloat(Mh)},type:{}},setup(e){t.useCssVars(r=>({v64bbaf90:r.color}));const n=t.computed(()=>({width:`${e.size}px`,minWidth:`${e.size}px`}));return(r,o)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["handle-twig",[e.type,e.position===t.unref(kt.Position).Left?"left":"right"]]),style:t.normalizeStyle(n.value)},null,6))}}),[["__scopeId","data-v-74b600f2"]]),Pf=Pe(t.defineComponent({__name:"NodeBadge",props:{type:{},size:{},iconOnly:{type:Boolean}},setup(e){t.useCssVars(r=>({v3b4ea967:n.value.colors?.background,v00febd7c:n.value.colors?.foreground}));const n=t.computed(()=>sf(e.type));return(r,o)=>{const i=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(i,{appearance:"neutral",class:t.normalizeClass(["dk-node-badge",{"icon-only":e.iconOnly,"has-colors":!!n.value.colors}]),size:e.size},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(e.type),1)]),_:2},[n.value?.icon?{name:"icon",fn:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.value.icon)))]),key:"0"}:void 0]),1032,["class","size"])}}}),[["__scopeId","data-v-409d29e5"]]),LV={class:"body"},FV={class:"name"},DV={class:"handle"},MV={class:"handle-label-wrapper"},UV={class:"handle-label-wrapper"},jV={class:"handle-label text"},KV={class:"handle"},qV={class:"handle-label-wrapper"},GV={class:"handle-label-wrapper"},zV={class:"handle-label text"},HV={key:2,class:"branch-handles"},WV={class:"handle-label-wrapper"},YV={class:"handle-label text"},$b=Pe(t.defineComponent({__name:"FlowNode",props:{data:{},error:{type:Boolean},readonly:{type:Boolean}},setup(e){const n=t.useSlots(),{t:r}=Vt.createI18n("en-us",Lt),o=xV(),{getInEdgesByNodeId:i,getOutEdgesByNodeId:a,getNodeById:s,toggleExpanded:l,duplicateNode:c,removeNode:d,propertiesPanelOpen:f,branchGroups:u}=It(),p=t.computed(()=>ni(e.data.type)),g=t.computed(()=>e.data.fields.input.length>0),h=t.computed(()=>e.data.fields.output.length>0),y=t.computed(()=>g.value&&i(e.data.id).every(se=>se.targetField===void 0)),m=t.computed(()=>h.value&&a(e.data.id).every(se=>se.sourceField===void 0)),_=t.computed(()=>e.data.expanded.input??!1),b=t.computed(()=>e.data.expanded.output??!1),k=t.computed(()=>p.value.io?.next?.branches?.map(({name:se})=>se)??[]),A=t.computed(()=>k.value.length>0),C=t.computed(()=>u.findMembership(e.data.id)),w=t.computed(()=>{if(e.data.type==="property"){const se=e.data.config?.property;return rf(se)}return p.value.io?.input}),x=t.computed(()=>{if(e.data.type==="property"){const se=e.data.config?.property;return nf(se)}return p.value.io?.output}),I=t.computed(()=>hl(e.data)),T=t.computed(()=>e.data.phase==="response"),v=t.computed(()=>e.data.phase==="request"?kt.Position.Left:kt.Position.Right),S=t.computed(()=>e.data.phase==="request"?kt.Position.Right:kt.Position.Left),B=t.computed(()=>e.data.phase==="request"?kt.Position.Right:kt.Position.Left),P=t.computed(()=>hl(e.data)?r(`plugins.free-form.datakit.flow_editor.node_types.${e.data.type}.name`):e.data.name),R=t.computed(()=>I.value?xN:AN);function F(se){return se==="input"?T.value:!T.value}function X(se){const M=new Map,le=se==="input"?i(e.data.id):a(e.data.id);for(const Y of le){const ae=s(se==="input"?Y.source:Y.target);if(!ae)continue;if(se==="input"){const ce=ae.type==="vault",re=ae.phase!==e.data.phase,Oe=u.isEdgeEnteringGroup(ae.id,e.data.id);if(!(ce||re||Oe))continue}else{const ce=ae.phase!==e.data.phase,re=u.isEdgeEnteringGroup(e.data.id,ae.id);if(!(ce||re))continue}const Me=se==="input"?Y.targetField||"input":Y.sourceField||"output";let Ee;se==="input"&&Y.sourceField?Ee=ae.fields.output.find(re=>re.id===Y.sourceField)?.name:se==="output"&&Y.targetField&&(Ee=ae.fields.input.find(re=>re.id===Y.targetField)?.name);const Ue={edgeId:Y.id,node:ae,fieldName:Ee},Ie=M.get(Me);Ie?Ie.push(Ue):M.set(Me,[Ue])}return M}const Z=t.computed(()=>X("input")),U=t.computed(()=>X("output"));function K(se){!o||o.readonly||se==="input"&&!y.value||se==="output"&&!m.value||l(e.data.id,se)}async function L(){if(!o||o.readonly)return;const se=c(e.data.id,o.placeToRight(e.data.id));await o.selectNode(se),o.scrollRightToReveal(se),f.value=!0}function oe(){u.removeMember(e.data.id)}return t.watch(y,se=>{se||l(e.data.id,"input",!0,!0,"*")},{immediate:!0}),t.watch(m,se=>{se||l(e.data.id,"output",!0,!0,"*")},{immediate:!0}),t.watch(()=>e.data.fields.input,(se,M)=>{yn(se,M)||l(e.data.id,"input",se.length>0,!0,"*")},{deep:!0}),t.watch(()=>e.data.fields.output,(se,M)=>{yn(se,M)||l(e.data.id,"output",se.length>0,!0,"*")},{deep:!0}),(se,M)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["dk-flow-node",{reversed:T.value,implicit:I.value,readonly:e.readonly}])},[t.createElementVNode("div",LV,[I.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(be.KTooltip),{key:0,class:"badge",placement:"top",text:e.data.type},{default:t.withCtx(()=>[t.createVNode(Pf,{"icon-only":"",size:"small",type:e.data.type},null,8,["type"])]),_:1},8,["text"])),t.createElementVNode("div",FV,t.toDisplayString(P.value),1),e.error?(t.openBlock(),t.createBlock(t.unref(Se.WarningIcon),{key:1,class:"error-icon",color:`var(--kui-color-text-danger, ${t.unref(Rh)})`,size:16},null,8,["color"])):t.createCommentVNode("",!0),n.actions?t.renderSlot(se.$slots,"actions",{data:e.data},void 0,!0,2):I.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(be.KDropdown),{key:3,class:"menu",disabled:e.readonly,"kpop-attributes":{offset:"4px",target:"body",popoverClasses:"dk-flow-node-menu"},width:"160",onClick:M[1]||(M[1]=t.withModifiers(()=>{},["stop"]))},{items:t.withCtx(()=>[t.createVNode(t.unref(be.KDropdownItem),{onClick:L},{default:t.withCtx(()=>[t.createVNode(Il,{keys:t.unref(nl).duplicate,label:t.unref(r)("plugins.free-form.datakit.flow_editor.actions.duplicate")},null,8,["keys","label"])]),_:1}),C.value?(t.openBlock(),t.createBlock(t.unref(be.KDropdownItem),{key:0,onClick:oe},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("plugins.free-form.datakit.flow_editor.actions.remove_from_branch")),1)]),_:1})):t.createCommentVNode("",!0),t.createVNode(t.unref(be.KDropdownItem),{danger:"",onClick:M[0]||(M[0]=le=>t.unref(d)(e.data.id))},{default:t.withCtx(()=>[t.createVNode(Il,{keys:t.unref(nl).delete,label:t.unref(r)("plugins.free-form.datakit.flow_editor.actions.delete")},null,8,["keys","label"])]),_:1})]),default:t.withCtx(()=>[t.createVNode(t.unref(be.KButton),{appearance:"tertiary",class:"menu-trigger",icon:"",size:"small"},{default:t.withCtx(()=>[t.createVNode(t.unref(Se.MoreIcon),{color:`var(--kui-color-text, ${t.unref(Cu)})`},null,8,["color"])]),_:1})]),_:1},8,["disabled"]))]),n["before-handles"]?t.renderSlot(se.$slots,"before-handles",{data:e.data},void 0,!0,0):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["handles",{reversed:T.value}])},[w.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["input-handles",{"has-fields":g.value}])},[t.createElementVNode("div",DV,[t.createVNode(t.unref(kt.Handle),{id:"input",position:v.value,type:"target"},null,8,["position"]),Z.value.has("input")?(t.openBlock(),t.createBlock(vl,{key:0,mode:"input",reversed:F("input"),targets:Z.value.get("input")},null,8,["reversed","targets"])):t.createCommentVNode("",!0),t.createElementVNode("div",MV,[t.createElementVNode("div",{class:t.normalizeClass(["handle-label trigger",{collapsible:y.value}]),onClick:M[2]||(M[2]=t.withModifiers(le=>K("input"),["stop"]))},[M[4]||(M[4]=t.createElementVNode("div",{class:"text"}," inputs ",-1)),g.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[_.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(Se.UnfoldMoreIcon),{key:0,size:`var(--kui-icon-size-20, ${t.unref(zo)})`},null,8,["size"])),_.value?(t.openBlock(),t.createBlock(t.unref(Se.UnfoldLessIcon),{key:1,color:y.value?void 0:`var(--kui-color-text-disabled, ${t.unref(Fh)})`,size:`var(--kui-icon-size-20, ${t.unref(zo)})`},null,8,["color","size"])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0)],2),g.value&&_.value?(t.openBlock(),t.createBlock(Tl,{key:0,color:R.value,position:v.value,type:"bar"},null,8,["color","position"])):t.createCommentVNode("",!0)])]),g.value&&_.value?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(e.data.fields.input,(le,Y)=>(t.openBlock(),t.createElementBlock("div",{key:`inputs-${le.id}`,class:"handle indented"},[t.createVNode(t.unref(kt.Handle),{id:`inputs@${le.id}`,position:v.value,type:"target"},null,8,["id","position"]),Z.value.has(le.id)?(t.openBlock(),t.createBlock(vl,{key:0,mode:"input",reversed:F("input"),targets:Z.value.get(le.id)},null,8,["reversed","targets"])):t.createCommentVNode("",!0),t.createElementVNode("div",UV,[t.createElementVNode("div",jV,t.toDisplayString(le.name),1),t.createVNode(Tl,{color:R.value,position:v.value,type:Y<e.data.fields.input.length-1?"trident":"corner"},null,8,["color","position","type"])])]))),128)):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0),x.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["output-handles",{"has-fields":h.value}])},[t.createElementVNode("div",KV,[t.createElementVNode("div",qV,[t.createElementVNode("div",{class:t.normalizeClass(["handle-label trigger",{collapsible:m.value}]),onClick:M[3]||(M[3]=t.withModifiers(le=>K("output"),["stop"]))},[M[5]||(M[5]=t.createElementVNode("div",{class:"text"}," outputs ",-1)),h.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[b.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(Se.UnfoldMoreIcon),{key:0,size:`var(--kui-icon-size-20, ${t.unref(zo)})`},null,8,["size"])),b.value?(t.openBlock(),t.createBlock(t.unref(Se.UnfoldLessIcon),{key:1,color:m.value?void 0:`var(--kui-color-text-disabled, ${t.unref(Fh)})`,size:`var(--kui-icon-size-20, ${t.unref(zo)})`},null,8,["color","size"])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0)],2),h.value&&b.value?(t.openBlock(),t.createBlock(Tl,{key:0,color:R.value,position:S.value,type:"bar"},null,8,["color","position"])):t.createCommentVNode("",!0)]),t.createVNode(t.unref(kt.Handle),{id:"output",position:S.value,type:"source"},null,8,["position"]),U.value.has("output")?(t.openBlock(),t.createBlock(vl,{key:0,mode:"output",reversed:F("output"),targets:U.value.get("output")},null,8,["reversed","targets"])):t.createCommentVNode("",!0)]),h.value&&b.value?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(e.data.fields.output,(le,Y)=>(t.openBlock(),t.createElementBlock("div",{key:`outputs-${le.id}`,class:"handle indented"},[t.createElementVNode("div",GV,[t.createElementVNode("div",zV,t.toDisplayString(le.name),1),t.createVNode(Tl,{color:R.value,position:S.value,type:Y<e.data.fields.output.length-1?"trident":"corner"},null,8,["color","position","type"])]),t.createVNode(t.unref(kt.Handle),{id:`outputs@${le.id}`,position:S.value,type:"source"},null,8,["id","position"]),U.value.has(le.id)?(t.openBlock(),t.createBlock(vl,{key:0,mode:"output",reversed:F("output"),targets:U.value.get(le.id)},null,8,["reversed","targets"])):t.createCommentVNode("",!0)]))),128)):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0),A.value?(t.openBlock(),t.createElementBlock("div",HV,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(k.value,le=>(t.openBlock(),t.createElementBlock("div",{key:`branch-${le}`,class:"handle"},[t.createElementVNode("div",WV,[t.createElementVNode("div",YV,t.toDisplayString(le),1)]),t.createVNode(t.unref(kt.Handle),{id:`branch@${le}`,connectable:!1,position:B.value,type:"source"},null,8,["id","position"])]))),128))])):t.createCommentVNode("",!0)],2),n["after-handles"]?t.renderSlot(se.$slots,"after-handles",{data:e.data},void 0,!0,1):t.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-1de3b7cb"]]),JV=Pe(t.defineComponent({__name:"GroupNode",props:{data:{},active:{type:Boolean}},setup(e){const n=e,r=t.computed(()=>n.data.phase==="response"),o=t.computed(()=>r.value?kt.Position.Right:kt.Position.Left);return(i,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["dk-branch-group-node",{reversed:r.value,"drop-target":e.active}])},[t.createVNode(t.unref(kt.Handle),{id:"input",connectable:!1,position:o.value,type:"target"},null,8,["position"])],2))}}),[["__scopeId","data-v-cf30ffea"]]),Vf=Pe(t.defineComponent({__name:"FlowCanvas",props:{flowId:{},phase:{},mode:{}},emits:["initialized","nodes-change","node-click"],setup(e,{expose:n,emit:r}){const o=t.useSlots(),i=r,a=t.useTemplateRef("flowCanvas"),s=At.useElementBounding(a),{i18n:{t:l}}=Ye(),c=t.computed(()=>{const Ee=e.mode==="edit"||e.mode==="inspect";return{panOnDrag:Ee?void 0:!1,panOnScroll:Ee?void 0:!1,zoomOnDoubleClick:Ee?void 0:!1,zoomOnPinch:Ee?void 0:!1,zoomOnScroll:Ee?void 0:!1}}),{vueFlowStore:d,editorStore:f,autoLayout:u,fitViewParams:p,fitView:g,selectNode:h,placeToRight:y,scrollRightToReveal:m,groupDrop:_}=SV({phase:e.phase,flowId:e.flowId,layoutOptions:{viewport:{width:s.width,height:s.height}},readonly:e.mode!=="edit"}),{addNode:b,propertiesPanelOpen:k,invalidConfigNodeIds:A,selectedNode:C,duplicateNode:w,commit:x,selectPortalEdge:I}=f,{screenToFlowCoordinate:T,zoomIn:v,zoomOut:S,viewport:B,maxZoom:P,minZoom:R}=d,{activeGroupId:F,startPanelDrag:X,endPanelDrag:Z,updateActiveGroup:U,attachNodeToActiveGroup:K}=_;function L(Ee){const Ue=Ee.dataTransfer?.types.find(Ie=>Ie.startsWith(`${ha}/`));if(Ue)return Ue.replace(`${ha}/`,"")}function oe(Ee){if(e.mode==="inspect"){if(Ee?.node?.type==="group")return;i("node-click",Ee.node.data);return}if(e.mode==="edit"){if(Ee?.node?.type==="group"){h(void 0),I(void 0);return}k.value=!0}}function se(Ee){e.mode==="edit"&&(Ee.preventDefault(),U(T({x:Ee.clientX,y:Ee.clientY})))}function M(Ee){if(e.mode!=="edit")return;const Ue=Ee.dataTransfer?.getData(ha);if(!Ue)return;Ee.preventDefault();const Ie=JSON.parse(Ue);if(Ie.action!=="create-node")return;const ce=T({x:Ee.clientX,y:Ee.clientY}),{type:re,anchor:Oe}=Ie.data,ve={type:re,phase:e.phase,position:{x:ce.x-Oe.offsetX,y:ce.y-Oe.offsetY}},je=b(ve,!1);if(!je){Z();return}K(je),x(),h(je),k.value=!0,Z()}async function le(){i("initialized"),e.mode==="inspect"&&setTimeout(async()=>{await u(!1),setTimeout(()=>g(),0)},0)}async function Y(){await u(),setTimeout(()=>g(),0)}const ae=t.computed(()=>{if(e.mode==="preview")return[];const Ee=[{name:"zoom_in",icon:Se.AddIcon,action:v,disabled:B.value.zoom>=P.value},{name:"zoom_out",icon:Se.RemoveIcon,action:S,disabled:B.value.zoom<=R.value},{name:"fit_view",icon:Se.FullscreenIcon,action:g}];return e.mode==="edit"&&Ee.push({name:"auto_layout",icon:Se.AutoLayoutIcon,action:Y}),Ee});e.mode==="edit"&&(At.useEventListener("dragstart",Ee=>{L(Ee)&&X()}),At.useEventListener("dragend",()=>{Z()}));async function Me(){const Ee=C.value;if(e.mode!=="edit"||!Ee||Ee.phase!==e.phase)return;const Ue=w(Ee.id,y(Ee.id));Ue&&(await h(Ue),k.value=!0,m(Ue))}return $h({enabled:t.computed(()=>!!C.value&&e.mode==="edit"&&C.value.phase===e.phase),duplicate:Me}),n({autoLayout:u,fitView:g}),(Ee,Ue)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"flowCanvas",ref:a,class:"dk-flow-canvas"},[t.createVNode(t.unref(kt.VueFlow),t.mergeProps({id:e.flowId,class:["flow",{readonly:e.mode!=="edit",inspect:e.mode==="inspect"}]},c.value,{"connect-on-click":!1,"elements-selectable":e.mode==="edit"||e.mode==="inspect","max-zoom":t.unref(YN),"min-zoom":t.unref(JN),"multi-selection-key-code":null,"nodes-connectable":e.mode==="edit","nodes-draggable":e.mode==="edit",onDragover:se,onDrop:M,onNodeClick:oe,onNodesChange:Ue[0]||(Ue[0]=Ie=>i("nodes-change")),onNodesInitialized:le}),{"node-flow":t.withCtx(({data:Ie})=>[t.createVNode($b,{data:Ie,error:t.unref(A).has(Ie.id),readonly:e.mode!=="edit"},t.createSlots({_:2},[o["node-before-handles"]?{name:"before-handles",fn:t.withCtx(()=>[t.renderSlot(Ee.$slots,"node-before-handles",{data:Ie},void 0,!0)]),key:"0"}:void 0,o["node-actions"]?{name:"actions",fn:t.withCtx(()=>[t.renderSlot(Ee.$slots,"node-actions",{data:Ie},void 0,!0)]),key:"1"}:void 0,o["node-after-handles"]?{name:"after-handles",fn:t.withCtx(()=>[t.renderSlot(Ee.$slots,"node-after-handles",{data:Ie},void 0,!0)]),key:"2"}:void 0]),1032,["data","error","readonly"])]),"node-group":t.withCtx(({data:Ie})=>[t.createVNode(JV,{active:t.unref(F)===Ie.id,data:Ie},null,8,["active","data"])]),default:t.withCtx(()=>[t.createVNode(t.unref(yN.Background)),t.createVNode(t.unref(Th.Controls),{"fit-view-params":t.unref(p),position:"bottom-left","show-fit-view":!1,"show-interactive":!1,"show-zoom":!1},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ae.value,Ie=>(t.openBlock(),t.createBlock(t.unref(be.KTooltip),{key:Ie.name,placement:"right",text:t.unref(l)(`plugins.free-form.datakit.flow_editor.actions.${Ie.name}`)},{default:t.withCtx(()=>[t.createVNode(t.unref(Th.ControlButton),{disabled:Ie.disabled,onClick:t.withModifiers(Ie.action,["stop"])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(Ie.icon),{size:18}))]),_:2},1032,["disabled","onClick"])]),_:2},1032,["text"]))),128))]),_:1},8,["fit-view-params"])]),_:3},16,["id","class","elements-selectable","max-zoom","min-zoom","nodes-connectable","nodes-draggable"])],512))}}),[["__scopeId","data-v-11561a7e"]]);function Rb(){const e=["methods","logout_methods"];return{setFieldType:(f,u,p)=>{if(!(!f||!u||!p))switch(p.type){case"boolean":f[u]={type:pe.ConfigurationSchemaType.BadgeStatus,...f[u]};break;case"string":p.encrypted?f[u]={type:pe.ConfigurationSchemaType.Redacted,...f[u]}:f[u]={type:pe.ConfigurationSchemaType.Text,...f[u]};break;case"set":p.elements?.type==="string"&&(f[u]={type:pe.ConfigurationSchemaType.BadgeTag,...f[u]});break;case"array":e.includes(u)?f[u]={type:pe.ConfigurationSchemaType.BadgeMethod,...f[u]}:p.elements?.type==="string"?p.encrypted?f[u]={type:pe.ConfigurationSchemaType.RedactedArray,...f[u]}:f[u]={type:pe.ConfigurationSchemaType.BadgeTag,...f[u]}:p.elements?.type==="record"&&(f[u]={type:pe.ConfigurationSchemaType.Json,...f[u]});break;case"record":f[u]={type:pe.ConfigurationSchemaType.Json,...f[u]};break;default:f[u]={type:pe.ConfigurationSchemaType.Text,...f[u]};break}},convertToDotNotation:f=>f.replace(/-/g,"."),unFlattenObject:f=>{const u={};for(const p in f){const g=p.split(".");g.reduce((h,y,m)=>h[y]||(h[y]=isNaN(g[m+1])?g.length-1===m?f[p]:{}:[]),u)}return u},dismissField:(f,u,p="redis",g=!1)=>{const h=new RegExp("(?<=-redis-).*");if(typeof f!="object"||f===null)return f;p==="redis"?Object.keys(f).forEach(y=>{y.match(h)&&delete f[y]}):g?f[p]=null:delete f[p],Object.assign(f,u)},isObjectEmpty:f=>Object.keys(f).length===0,unsetNullForeignKey:(f,u)=>{["service.id","route.id","consumer.id","consumer_group.id"].indexOf(f)>-1&&u[f]===null&&(delete u[f],u[f.replace(".id","")]=null)},formatPluginFieldLabel:f=>f.replace(/_/g," ").split("-").map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("-"),getTallestPluginCardHeight:f=>{let u=0;if(f.length)for(let p=0;p<f.length;p++){const g=f[p].$el;u=g.offsetHeight>u?g.offsetHeight:u}return u},getToggleVisibility:(f,u)=>{if(f&&u){const p=window?.getComputedStyle(f)?.getPropertyValue("grid-template-columns")?.split(" ").length;return u>p}return!0}}}const XV=["basic-auth","key-auth","key-auth-enc","oauth2","hmac-auth","jwt","acl"];var Ol=(e=>(e.REDIS_CE="redis-ce",e.REDIS_EE="redis-ee",e))(Ol||{});const Bl=["Featured"],$f=[W.PluginGroup.AUTHENTICATION,W.PluginGroup.AI,W.PluginGroup.SECURITY,W.PluginGroup.TRAFFIC_CONTROL,W.PluginGroup.SERVERLESS,W.PluginGroup.ANALYTICS_AND_MONITORING,W.PluginGroup.TRANSFORMATIONS,W.PluginGroup.LOGGING,W.PluginGroup.DEPLOYMENT,W.PluginGroup.WEBSOCKET,W.PluginGroup.MONETIZATION,W.PluginGroup.CUSTOM_PLUGINS],Pl=[W.PluginGroup.AI,W.PluginGroup.ANALYTICS_AND_MONITORING,W.PluginGroup.AUTHENTICATION,W.PluginGroup.LOGGING,W.PluginGroup.MONETIZATION,W.PluginGroup.SECURITY,W.PluginGroup.SERVERLESS,W.PluginGroup.TRAFFIC_CONTROL,W.PluginGroup.TRANSFORMATIONS,W.PluginGroup.CUSTOM_PLUGINS];var go=(e=>(e.SERVICE="service_id",e.ROUTE="route_id",e.CONSUMER="consumer_id",e.CONSUMER_GROUP="consumer_group_id",e))(go||{});const ho=e=>{const n=Object.fromEntries(e.fields.map(r=>Object.entries(r)[0]));return"id"in n||(n.id={}),n},yo={label:"Tags",name:"tags",type:"input",inputType:"text",valueType:"array",valueArrayType:"string",placeholder:"Enter list of tags",help:"An optional set of strings for grouping and filtering, separated by commas.",hint:"e.g. tag1, tag2, tag3"},ai={getColumnFields:ho,tags:yo,id:{label:"ID"},enabled:{label:"Enabled",indexed:!0,type:"boolean"},created_at:{label:"Created"},updated_at:{label:"Last updated"},fields:{arrayItems(e){const n=e.inputAttributes||{};return delete e.inputAttributes,{type:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"kong-form-array-field",fieldItemsClasses:"kong-form-array-field-item",newElementButtonLabelClasses:"kong-form-new-element-button-label",inputAttributes:{class:"form-control",style:{minWidth:"200px"},...n},removeElementButtonLabel:"remove",styleClasses:"kong-form-field-wrapper",inputType:"text",valueType:"array",valueArrayType:"string",...e}}}},Lb={fields:[{group:{hint:"The arbitrary group name to associate to the consumer."}},{tags:yo}]},ZV={fields:[{id:{uuid:!0,type:"string",auto:!0}},{created_at:{auto:!0,timestamp:!0,type:"integer"}},{consumer:{reference:"consumers",type:"foreign",on_delete:"cascade",required:!0}},{group:{required:!0,type:"string",hint:"The arbitrary group name to associate to the consumer."}},{tags:{elements:{type:"string",required:!0},type:"set"}}]},Fb={fields:[{username:{}},{password:{inputType:"password"}},{tags:yo}]},QV={fields:[{id:{uuid:!0,type:"string",auto:!0}},{created_at:{auto:!0,timestamp:!0,type:"integer"}},{consumer:{reference:"consumers",type:"foreign",on_delete:"cascade",required:!0}},{username:{required:!0,type:"string",unique:!0}},{password:{type:"string",required:!0,encrypted:!0}},{tags:{elements:{type:"string",required:!0},type:"set"}}]},Db=t.defineComponent({name:"KeyAuthIdentityRealmsBase",__name:"Base",props:t.mergeModels({realms:{}},{modelValue:{default:()=>[{scope:"cp",id:null,region:null}]},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const n=e,r=t.useModel(e,"modelValue"),{i18n:o}=rt.useI18n(),{t:i}=o,a={value:"current-cp",label:i("custom_field.key_auth_identity_realms.cp_label"),group:i("custom_field.key_auth_identity_realms.cp_group_label")},s=t.inject(We.FORMS_CONFIG),{axiosInstance:l}=pe.useAxios(s?.axiosRequestConfig),c=()=>{if(s?.app==="konnect"){const h=/\b(us|eu|au|me|in|sg)\b/.exec(s?.apiBaseUrl||"");if(h)return{region:h[1]}}return{}},d=t.ref(!0),f=t.ref([a]),u=async()=>{if(s?.app==="konnect")try{d.value=!0;let h=`${s?.apiBaseUrl}/v1/realms`;const y=[];do{const m=await l.get(h);m&&m.data&&m.data.data&&y.push(...m.data.data.map(_=>({value:_.id,label:_.name,group:i("custom_field.key_auth_identity_realms.realm_group_label")}))),h=m.data.meta.next?`${s?.apiBaseUrl}${m.data.meta.next}`:null}while(h);f.value=[a,...y]}catch(h){console.error("Failed to fetch Konnect realms",h)}finally{d.value=!1}},p=t.computed(()=>r.value.map(h=>h.id||"current-cp")),g=h=>{const y=h.includes("current-cp")?[{scope:"cp",id:null,region:null}]:[],m=r.value.filter(({scope:C})=>C!=="cp").map(({id:C})=>C),_=h.filter(C=>C!=="current-cp"),A=(m.length!==_.length||m.some(C=>!_.includes(C))?_.filter(C=>!m.includes(C)):_).map(C=>({...c(),scope:"realm",id:C}));r.value=[...y,...A]};return t.onMounted(()=>{n.realms===void 0&&u()}),t.watch(()=>n.realms,h=>{h&&(f.value=[a,...h.map(y=>({...y,group:i("custom_field.key_auth_identity_realms.realm_group_label")}))],d.value=!1)},{immediate:!0}),(h,y)=>{const m=t.resolveComponent("KMultiselect");return t.openBlock(),t.createBlock(m,{items:f.value,loading:d.value,"model-value":p.value,"onUpdate:modelValue":g},null,8,["items","loading","model-value"])}}}),e$={class:"field-wrapper"},t$=Pe(t.defineComponent({__name:"VfgAdapter",props:{disabled:{type:Boolean},formOptions:{},model:{},schema:{},vfg:{},errors:{},hint:{}},emits:["modelUpdated"],setup(e,{expose:n,emit:r}){const o=e,i=r,{clearValidationErrors:a,value:s}=We.composables.useAbstractFields({model:t.toRef(()=>o.model),schema:o.schema,formOptions:o.formOptions,emitModelUpdated:l=>{i("modelUpdated",l.value,l.model)}});return n({clearValidationErrors:a}),(l,c)=>(t.openBlock(),t.createElementBlock("div",e$,[t.createVNode(Db,{modelValue:t.unref(s),"onUpdate:modelValue":c[0]||(c[0]=d=>t.isRef(s)?s.value=d:null)},null,8,["modelValue"])]))}}),[["__scopeId","data-v-269e85ed"]]),Mb={fields:[{key:{submitWhenNull:!1,hint:`You can optionally set your own unique key to authenticate the
4
4
  client. If missing, it will be generated for you.`,inputType:"password",encrypted:!0}},{tags:yo},{ttl:{help:"Time-to-live (in seconds) value for data"}}]},n$=e=>e?.app==="kongManager"?{fieldsToDelete:["config-identity_realms"],shamefullyTransformPayload:({payload:n})=>{(e?.credential&&typeof n.ttl!="number"||Number.isNaN(n.ttl))&&(n.ttl=0)}}:{"config-identity_realms":{component:e?.experimentalRenders?.keyAuthIdentityRealms??!1?t.markRaw(t$):null}},r$={fields:[{id:{uuid:!0,type:"string",auto:!0}},{created_at:{auto:!0,timestamp:!0,type:"integer"}},{consumer:{reference:"consumers",type:"foreign",on_delete:"cascade",required:!0}},{key:{auto:!0,hint:"If left empty, a key will be generated after saving this form.",required:!1,type:"string",encrypted:!0,unique:!0}},{tags:{elements:{type:"string",required:!0},type:"set"}},{ttl:{between:[0,1e8],description:"Time-to-live (in seconds) value for data",type:"number"}}]},Ub={fields:[{username:{hint:"The username to use in the HMAC Signature verification."}},{secret:{inputType:"text",submitWhenNull:!1,hint:`The secret to use in the HMAC Signature verification. Note that
5
5
  if this parameter isn’t provided, Kong will generate a value for you and
6
6
  send it as part of the response body.`}},{tags:yo}]},o$={fields:[{id:{uuid:!0,type:"string",auto:!0}},{created_at:{auto:!0,timestamp:!0,type:"integer"}},{consumer:{reference:"consumers",type:"foreign",on_delete:"cascade",required:!0}},{username:{required:!0,type:"string",unique:!0,hint:"The username to use in the HMAC Signature verification."}},{secret:{auto:!0,type:"string",encrypted:!0,hint:"The secret to use in the HMAC Signature verification. Note that if this parameter isn’t provided, Kong will generate a value for you and send it as part of the response body."}},{tags:{elements:{type:"string",required:!0},type:"set"}}]},i$={fields:[{key:{submitWhenNull:!1,hint:`A unique string identifying the credential. If left out, it will
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/free-form/plugins/datakit/flow-editor/store/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC5D,OAAO,KAAK,EACV,MAAM,EACN,OAAO,EACP,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,cAAc,EACd,cAAc,EACd,cAAc,EACd,YAAY,EACZ,OAAO,EACP,SAAS,EACT,aAAa,EACb,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,aAAa,EACd,MAAM,aAAa,CAAA;AAQpB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD,sDAAsD;AACtD,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAEpC;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,GAAG,OAAO,CAMtE;AAED,oCAAoC;AACpC,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;AAC9C,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;AAC9C,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAA;AAKhD,oCAAoC;AACpC,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,cAAc,GAAG;IACnE,QAAQ,EAAE,QAAQ,CAAA;IAClB,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB,CAMA;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,YAAY,GAAG;IAC7D,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAMA;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,kCAIzC;AAED,0CAA0C;AAC1C,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,GAAG;IACjD,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,MAAM,EAAE,SAAS,EAAE,CAAA;CACpB,CAMA;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,EAAE,CAGhE;AAED,wCAAwC;AACxC,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAE7D;AAED,oCAAoC;AACpC,wBAAgB,eAAe,CAC7B,IAAI,EAAE,YAAY,EAClB,EAAE,EAAE,OAAO,GAAG,QAAQ,EACtB,IAAI,CAAC,EAAE,SAAS,GACf,SAAS,GAAG,SAAS,CAGvB;AAED,0BAA0B;AAC1B,wBAAgB,aAAa,CAC3B,IAAI,EAAE,YAAY,EAClB,EAAE,EAAE,OAAO,GAAG,QAAQ,EACtB,EAAE,CAAC,EAAE,OAAO,GACX,SAAS,GAAG,SAAS,CAGvB;AAED,oCAAoC;AACpC,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAG7E;AACD,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAG5E;AAED,2CAA2C;AAC3C,eAAO,MAAM,mBAAmB,EAAE,gBAAgB,EAKjD,CAAA;AAED,4CAA4C;AAC5C,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAYxE;AAED,gEAAgE;AAChE,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,cAAc,GAAG,MAAM,EACrC,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,GAC/B,cAAc,CAUhB;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAEvE;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,CAQrF;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,SAAS,CAE/E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,CAQ1F;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,MAAM,EAAE,EACnB,MAAM,CAAC,EAAE;IACP,QAAQ,CAAC,EAAE,UAAU,CAAA;IACrB,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB,GACA,aAAa,CAUf;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,iBAAiB,EAC3B,WAAW,EAAE,UAAU,EAAE,EACzB,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,aAAa,CAAC,WAAW,CAAC,EACrC,SAAS,CAAC,EAAE,MAAM,GACjB,iBAAiB,CAqBnB"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/free-form/plugins/datakit/flow-editor/store/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC5D,OAAO,KAAK,EACV,MAAM,EACN,OAAO,EACP,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,cAAc,EACd,cAAc,EACd,cAAc,EACd,YAAY,EACZ,OAAO,EACP,SAAS,EACT,aAAa,EACb,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,aAAa,EACd,MAAM,aAAa,CAAA;AAQpB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD,sDAAsD;AACtD,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAEpC;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,GAAG,OAAO,CAMtE;AAED,oCAAoC;AACpC,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;AAC9C,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;AAC9C,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAA;AAKhD,oCAAoC;AACpC,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,cAAc,GAAG;IACnE,QAAQ,EAAE,QAAQ,CAAA;IAClB,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB,CAMA;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,YAAY,GAAG;IAC7D,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAMA;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,kCAIzC;AAED,0CAA0C;AAC1C,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,GAAG;IACjD,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,MAAM,EAAE,SAAS,EAAE,CAAA;CACpB,CAMA;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,EAAE,CAGhE;AAED,wCAAwC;AACxC,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAE7D;AAED,oCAAoC;AACpC,wBAAgB,eAAe,CAC7B,IAAI,EAAE,YAAY,EAClB,EAAE,EAAE,OAAO,GAAG,QAAQ,EACtB,IAAI,CAAC,EAAE,SAAS,GACf,SAAS,GAAG,SAAS,CAGvB;AAED,0BAA0B;AAC1B,wBAAgB,aAAa,CAC3B,IAAI,EAAE,YAAY,EAClB,EAAE,EAAE,OAAO,GAAG,QAAQ,EACtB,EAAE,CAAC,EAAE,OAAO,GACX,SAAS,GAAG,SAAS,CAGvB;AAED,oCAAoC;AACpC,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAG7E;AACD,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAG5E;AAED,2CAA2C;AAC3C,eAAO,MAAM,mBAAmB,EAAE,gBAAgB,EAKjD,CAAA;AAED,4CAA4C;AAC5C,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAYxE;AAED,gEAAgE;AAChE,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,cAAc,GAAG,MAAM,EACrC,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,GAC/B,cAAc,CAUhB;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAEvE;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,CAQrF;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,SAAS,CAE/E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,CAQ1F;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,MAAM,EAAE,EACnB,MAAM,CAAC,EAAE;IACP,QAAQ,CAAC,EAAE,UAAU,CAAA;IACrB,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB,GACA,aAAa,CAUf;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,iBAAiB,EAC3B,WAAW,EAAE,UAAU,EAAE,EACzB,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,aAAa,CAAC,WAAW,CAAC,EACrC,SAAS,CAAC,EAAE,MAAM,GACjB,iBAAiB,CA2BnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/entities-plugins",
3
- "version": "10.2.1",
3
+ "version": "10.2.2-pr.3988.ef7ce04b3.0",
4
4
  "type": "module",
5
5
  "main": "./dist/entities-plugins.umd.js",
6
6
  "module": "./dist/entities-plugins.es.js",